hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f8d6ebe30091a2ef3c3ea36b101629fb53ff29 | 14,172 | py | Python | capablerobot_camera/deserializers/max9286.py | CapableRobot/CapableRobot_Camera_Python | 3880e04e243ad21783c6a67563d83519a23d3eb4 | [
"MIT"
] | null | null | null | capablerobot_camera/deserializers/max9286.py | CapableRobot/CapableRobot_Camera_Python | 3880e04e243ad21783c6a67563d83519a23d3eb4 | [
"MIT"
] | null | null | null | capablerobot_camera/deserializers/max9286.py | CapableRobot/CapableRobot_Camera_Python | 3880e04e243ad21783c6a67563d83519a23d3eb4 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2019 Chris Osterwood for Capable Robot Components
#
# 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.034965 | 292 | 0.58411 |
import time
import logging
from adafruit_bus_device.i2c_device import I2CDevice
from ..support import MAX20087
from ..util import *
_DELAY = 0.01
_REG_LINKEN = 0x00
_REG_GPIO_CFG = 0x01
_REG_CTRLCNEN = 0x0A
_REG_SYNC = 0x0C
_REG_FLT_MON = 0x0D
_REG_ERROR_GP... | true | true |
f7f8d7f86f7bfd88c08580e4fd8235435dcc681c | 516 | py | Python | tests/test_render.py | Bezier89/conda-build | 95a118f8f06230120514fe0066a52a152ec2349b | [
"BSD-3-Clause"
] | null | null | null | tests/test_render.py | Bezier89/conda-build | 95a118f8f06230120514fe0066a52a152ec2349b | [
"BSD-3-Clause"
] | null | null | null | tests/test_render.py | Bezier89/conda-build | 95a118f8f06230120514fe0066a52a152ec2349b | [
"BSD-3-Clause"
] | null | null | null | import os
from conda_build import api
def test_output_with_noarch_says_noarch(testing_metadata):
testing_metadata.meta['build']['noarch'] = 'python'
output = api.get_output_file_path(testing_metadata)
assert os.path.sep + "noarch" + os.path.sep in output[0]
def test_output_with_noarch_python_says_noarch... | 34.4 | 65 | 0.763566 | import os
from conda_build import api
def test_output_with_noarch_says_noarch(testing_metadata):
testing_metadata.meta['build']['noarch'] = 'python'
output = api.get_output_file_path(testing_metadata)
assert os.path.sep + "noarch" + os.path.sep in output[0]
def test_output_with_noarch_python_says_noarch... | true | true |
f7f8d874c7f1ef1a0ee56b54a7dc60dd2fd12539 | 3,380 | py | Python | src/alembic_utils/pg_view.py | gyana/alembic_utils | a4bc7f5f025335faad7b178eb84ab78093e525ec | [
"MIT"
] | null | null | null | src/alembic_utils/pg_view.py | gyana/alembic_utils | a4bc7f5f025335faad7b178eb84ab78093e525ec | [
"MIT"
] | null | null | null | src/alembic_utils/pg_view.py | gyana/alembic_utils | a4bc7f5f025335faad7b178eb84ab78093e525ec | [
"MIT"
] | null | null | null | # pylint: disable=unused-argument,invalid-name,line-too-long
from __future__ import annotations
from typing import List
from parse import parse
from sqlalchemy import text as sql_text
from alembic_utils.exceptions import SQLParseFailure
from alembic_utils.replaceable_entity import ReplaceableEntity
class PGView(Re... | 32.5 | 99 | 0.59497 |
from __future__ import annotations
from typing import List
from parse import parse
from sqlalchemy import text as sql_text
from alembic_utils.exceptions import SQLParseFailure
from alembic_utils.replaceable_entity import ReplaceableEntity
class PGView(ReplaceableEntity):
@classmethod
def from_sql(cls, sq... | true | true |
f7f8d877672e9bc13db5730cbd60b24743cfcd47 | 1,214 | py | Python | test/unit/test_column.py | mv1742/dbt-spark | a8a85c54d10920af1c5efcbb4d2a51eb7cfcad11 | [
"Apache-2.0"
] | 92 | 2019-03-23T07:23:55.000Z | 2021-06-15T18:18:32.000Z | test/unit/test_column.py | mv1742/dbt-spark | a8a85c54d10920af1c5efcbb4d2a51eb7cfcad11 | [
"Apache-2.0"
] | 156 | 2019-03-21T03:26:58.000Z | 2021-06-29T15:30:51.000Z | test/unit/test_column.py | mv1742/dbt-spark | a8a85c54d10920af1c5efcbb4d2a51eb7cfcad11 | [
"Apache-2.0"
] | 58 | 2019-04-12T09:09:43.000Z | 2021-06-24T15:25:11.000Z | import unittest
from dbt.adapters.spark import SparkColumn
class TestSparkColumn(unittest.TestCase):
def test_convert_table_stats_with_no_statistics(self):
self.assertDictEqual(
SparkColumn.convert_table_stats(None),
{}
)
def test_convert_table_stats_with_bytes(self)... | 31.128205 | 79 | 0.556013 | import unittest
from dbt.adapters.spark import SparkColumn
class TestSparkColumn(unittest.TestCase):
def test_convert_table_stats_with_no_statistics(self):
self.assertDictEqual(
SparkColumn.convert_table_stats(None),
{}
)
def test_convert_table_stats_with_bytes(self)... | true | true |
f7f8d8d82dec9b4a1cc6352811a0559852bc9b6d | 3,250 | py | Python | test/integration/test_attendance.py | PatrickLaban/cfapi | aeecf4a034a9dda3dd033f241f7c37e52a8c02c9 | [
"MIT"
] | 1 | 2021-09-05T17:21:49.000Z | 2021-09-05T17:21:49.000Z | test/integration/test_attendance.py | PatrickLaban/cfapi | aeecf4a034a9dda3dd033f241f7c37e52a8c02c9 | [
"MIT"
] | null | null | null | test/integration/test_attendance.py | PatrickLaban/cfapi | aeecf4a034a9dda3dd033f241f7c37e52a8c02c9 | [
"MIT"
] | null | null | null | import json
from test.factories import AttendanceFactory, OrganizationFactory
from test.harness import IntegrationTest
from app import db, Attendance
class TestAttendance(IntegrationTest):
def test_attendance(self):
cfsf = OrganizationFactory(name="Code for San Francisco")
url = "https://www.cod... | 43.333333 | 102 | 0.675692 | import json
from test.factories import AttendanceFactory, OrganizationFactory
from test.harness import IntegrationTest
from app import db, Attendance
class TestAttendance(IntegrationTest):
def test_attendance(self):
cfsf = OrganizationFactory(name="Code for San Francisco")
url = "https://www.cod... | true | true |
f7f8d9686f7b6252a64bd3c45d4c9fbc91c7ffad | 6,238 | py | Python | src/concurrency/managers.py | GStepien/CSToolkit | 7a6872356f71843816a53c42b9abf5ae1ed97adf | [
"BSD-3-Clause"
] | null | null | null | src/concurrency/managers.py | GStepien/CSToolkit | 7a6872356f71843816a53c42b9abf5ae1ed97adf | [
"BSD-3-Clause"
] | null | null | null | src/concurrency/managers.py | GStepien/CSToolkit | 7a6872356f71843816a53c42b9abf5ae1ed97adf | [
"BSD-3-Clause"
] | null | null | null | """
Note: Regular Managers cannot be pickled. This module adds support for picklable
managers so that subprocesses can create data structures managed by a common parent manager.
"""
from __future__ import annotations
import abc
from typing import Any, Optional, final, Callable, Tuple, Final, Protocol, runtime_checkab... | 42.148649 | 115 | 0.569894 |
from __future__ import annotations
import abc
from typing import Any, Optional, final, Callable, Tuple, Final, Protocol, runtime_checkable
import multiprocessing.managers as mp_mngr
import utils.types.containers as con
from concurrency import cs
class Im:
class PicklableSyncManagedMixin(cs.Im.HasCSLMixin):
... | true | true |
f7f8d9ca1460dacb3395d80fc8f87522919650b4 | 7,565 | py | Python | main/handler.py | t24kc/raspberry-pi | 505a504019165fb4a66c13bc27eff443bc083b1d | [
"MIT"
] | 1 | 2019-10-05T21:17:23.000Z | 2019-10-05T21:17:23.000Z | main/handler.py | t24kc/raspberry-pi | 505a504019165fb4a66c13bc27eff443bc083b1d | [
"MIT"
] | 1 | 2021-02-08T21:01:02.000Z | 2021-02-08T21:01:02.000Z | main/handler.py | t24kc/raspberry-pi | 505a504019165fb4a66c13bc27eff443bc083b1d | [
"MIT"
] | null | null | null | from datetime import datetime
from time import sleep
from lib.mail import Mail
from lib.spread_sheet import SpreadSheet
from sensor.SHT31 import SHT31
from sensor.BH1750FVI import BH1750FVI
from sensor.VL6180 import VL6180X
from sensor.CO2MINI import CO2MINI
from sensor.relay_module import RelayModule
import matplotli... | 31.785714 | 88 | 0.578982 | from datetime import datetime
from time import sleep
from lib.mail import Mail
from lib.spread_sheet import SpreadSheet
from sensor.SHT31 import SHT31
from sensor.BH1750FVI import BH1750FVI
from sensor.VL6180 import VL6180X
from sensor.CO2MINI import CO2MINI
from sensor.relay_module import RelayModule
import matplotli... | true | true |
f7f8da7af22881c2f4baf51a409c9e4fba74d88a | 179 | py | Python | team-violet-code/storage-provider/src/__init__.py | shaunkane21/omh-dsu-ri | c00e1bccaa29c4efafbb270e5660d062f591c98b | [
"Apache-2.0"
] | null | null | null | team-violet-code/storage-provider/src/__init__.py | shaunkane21/omh-dsu-ri | c00e1bccaa29c4efafbb270e5660d062f591c98b | [
"Apache-2.0"
] | null | null | null | team-violet-code/storage-provider/src/__init__.py | shaunkane21/omh-dsu-ri | c00e1bccaa29c4efafbb270e5660d062f591c98b | [
"Apache-2.0"
] | null | null | null | ''' all controllers for various collections of database '''
import os
import glob
__all__ = [os.path.basename(f)[:-3]
for f in glob.glob(os.path.dirname(__file__) + "/*.py")]
| 29.833333 | 60 | 0.687151 | import os
import glob
__all__ = [os.path.basename(f)[:-3]
for f in glob.glob(os.path.dirname(__file__) + "/*.py")]
| true | true |
f7f8daa2a2a01f21ca0d4d4284828b76074d55bd | 630 | py | Python | mmf/utils/phoc/build_phoc.py | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed | [
"BSD-3-Clause"
] | 3,252 | 2018-07-27T02:32:24.000Z | 2020-05-07T17:54:46.000Z | mmf/utils/phoc/build_phoc.py | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed | [
"BSD-3-Clause"
] | 914 | 2020-05-07T18:36:26.000Z | 2022-03-31T05:45:26.000Z | mmf/utils/phoc/build_phoc.py | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed | [
"BSD-3-Clause"
] | 490 | 2020-05-07T20:05:10.000Z | 2022-03-31T14:17:23.000Z | import numpy as np
from .cphoc import build_phoc as _build_phoc_raw
_alphabet = {
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
... | 12.115385 | 57 | 0.384127 | import numpy as np
from .cphoc import build_phoc as _build_phoc_raw
_alphabet = {
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
... | true | true |
f7f8dc3b8dcffaef8d601fb6423f82d8ba44405e | 19,934 | py | Python | tests/model/test_grouping.py | diegodelemos/asclepias-broker | 363ebf620ceea8cd4bd387d414c9cfaca226ce35 | [
"MIT"
] | null | null | null | tests/model/test_grouping.py | diegodelemos/asclepias-broker | 363ebf620ceea8cd4bd387d414c9cfaca226ce35 | [
"MIT"
] | null | null | null | tests/model/test_grouping.py | diegodelemos/asclepias-broker | 363ebf620ceea8cd4bd387d414c9cfaca226ce35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# Asclepias Broker is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test broker model."""
from helpers import assert_grouping, create_objects_from_relations, \
generate_paylo... | 32.94876 | 79 | 0.467242 |
from helpers import assert_grouping, create_objects_from_relations, \
generate_payloads
from asclepias_broker.api import EventAPI
from asclepias_broker.api.ingestion import get_group_from_id, \
get_or_create_groups, merge_identity_groups, merge_version_groups
from asclepias_broker.models import Group, G... | true | true |
f7f8dc4eea8d9545658fcc1bcc7abc41265a8a74 | 3,649 | py | Python | fire/main_test.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | null | null | null | fire/main_test.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | null | null | null | fire/main_test.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | 1 | 2021-04-10T14:17:27.000Z | 2021-04-10T14:17:27.000Z | # Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.234694 | 88 | 0.597698 |
import os
import tempfile
from fire import __main__
from fire import testutils
class MainModuleTest(testutils.BaseTestCase):
def testNameSetting(self):
with self.assertOutputMatches("gettempdir"):
__main__.main(["__main__.py", "tempfile"])
def testArgPassing(self... | true | true |
f7f8dd91c4b452880c9229d78c718790c4e62939 | 2,842 | py | Python | meeting/hooks.py | patilpuja/Meeting | 2394eb0af4ca8d06f270aabefa138eeda9fb7088 | [
"MIT"
] | null | null | null | meeting/hooks.py | patilpuja/Meeting | 2394eb0af4ca8d06f270aabefa138eeda9fb7088 | [
"MIT"
] | null | null | null | meeting/hooks.py | patilpuja/Meeting | 2394eb0af4ca8d06f270aabefa138eeda9fb7088 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "meeting"
app_title = "Meeting_App"
app_publisher = "DPI"
app_description = "meeting_app"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "pooja@gmail.com"
app_license = "MIT"
... | 22.203125 | 78 | 0.663969 |
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "meeting"
app_title = "Meeting_App"
app_publisher = "DPI"
app_description = "meeting_app"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "pooja@gmail.com"
app_license = "MIT"
... | true | true |
f7f8deb246360d15f4a58e2f3c3f90b3607a00a1 | 9,306 | py | Python | contrib/tools/python3/src/Lib/multiprocessing/spawn.py | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | contrib/tools/python3/src/Lib/multiprocessing/spawn.py | birichie/catboost | de75c6af12cf490700e76c22072fbdc15b35d679 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | contrib/tools/python3/src/Lib/multiprocessing/spawn.py | birichie/catboost | de75c6af12cf490700e76c22072fbdc15b35d679 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | #
# Code used to start processes when using the spawn or forkserver
# start methods.
#
# multiprocessing/spawn.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import os
import sys
import runpy
import types
from . import get_start_method, set_start_method
from . import proc... | 31.228188 | 77 | 0.651408 |
import os
import sys
import runpy
import types
from . import get_start_method, set_start_method
from . import process
from .context import reduction
from . import util
__all__ = ['_main', 'freeze_support', 'set_executable', 'get_executable',
'get_preparation_data', 'get_command_line', 'import_mai... | true | true |
f7f8dec58445e5be8843c73bc4033625170f83dc | 2,768 | py | Python | scripts/west_commands/export.py | Weining2019/zephyr | 0ccbe8ab6aedf100b9d31177e0b48eaa3d112e5c | [
"Apache-2.0"
] | 5 | 2020-07-07T00:52:37.000Z | 2022-03-27T12:56:16.000Z | scripts/west_commands/export.py | Weining2019/zephyr | 0ccbe8ab6aedf100b9d31177e0b48eaa3d112e5c | [
"Apache-2.0"
] | 3 | 2021-08-11T18:14:01.000Z | 2021-08-11T22:41:10.000Z | scripts/west_commands/export.py | Weining2019/zephyr | 0ccbe8ab6aedf100b9d31177e0b48eaa3d112e5c | [
"Apache-2.0"
] | 5 | 2020-12-05T01:03:13.000Z | 2022-01-28T13:39:17.000Z | # Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
import argparse
from pathlib import Path
from shutil import rmtree
from subprocess import CalledProcessError
from west.commands import WestCommand
from west import log
from zcmake import run_cmake
EXPORT_DESCRIPTION = '''\
This co... | 32.564706 | 74 | 0.65354 |
import argparse
from pathlib import Path
from shutil import rmtree
from subprocess import CalledProcessError
from west.commands import WestCommand
from west import log
from zcmake import run_cmake
EXPORT_DESCRIPTION = '''\
This command registers the current Zephyr installation as a CMake
config package in the CM... | true | true |
f7f8df1646228e276bbcb4fed58b38a6f7b1427f | 3,542 | py | Python | app/main.py | tum-ai/expingo-inpainting-service | 657f65316c179f85507350d55e4ab4ac429552a0 | [
"MIT"
] | null | null | null | app/main.py | tum-ai/expingo-inpainting-service | 657f65316c179f85507350d55e4ab4ac429552a0 | [
"MIT"
] | 3 | 2020-11-08T12:33:08.000Z | 2020-11-15T23:20:06.000Z | app/main.py | tum-ai/expingo-inpainting-service | 657f65316c179f85507350d55e4ab4ac429552a0 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import uvicorn
import tensorflow as tf
import neuralgym as ng
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from fastapi import FastAPI, UploadFile, File
from fastapi import HTTPException
from inpaint.inpainting_model import InpaintCAModel
class Pain... | 28.796748 | 102 | 0.649068 | import numpy as np
import cv2
import uvicorn
import tensorflow as tf
import neuralgym as ng
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from fastapi import FastAPI, UploadFile, File
from fastapi import HTTPException
from inpaint.inpainting_model import InpaintCAModel
class Pain... | true | true |
f7f8e0c398f5f0c5fbab1bf4f63ac794b3017391 | 10,586 | py | Python | kinto/core/utils.py | swhgoon/kinto | 10001d44bb08e4fbc74da31a41a4eaa461e0fd7f | [
"Apache-2.0"
] | null | null | null | kinto/core/utils.py | swhgoon/kinto | 10001d44bb08e4fbc74da31a41a4eaa461e0fd7f | [
"Apache-2.0"
] | null | null | null | kinto/core/utils.py | swhgoon/kinto | 10001d44bb08e4fbc74da31a41a4eaa461e0fd7f | [
"Apache-2.0"
] | 1 | 2020-07-15T04:27:08.000Z | 2020-07-15T04:27:08.000Z | import ast
import hashlib
import hmac
import os
import re
import six
import time
from base64 import b64decode, b64encode
from binascii import hexlify
from six.moves.urllib import parse as urlparse
from enum import Enum
# ujson is not installable with pypy
try: # pragma: no cover
import ujson as json # NOQA
... | 29.162534 | 81 | 0.636501 | import ast
import hashlib
import hmac
import os
import re
import six
import time
from base64 import b64decode, b64encode
from binascii import hexlify
from six.moves.urllib import parse as urlparse
from enum import Enum
try:
import ujson as json
def json_serializer(v, **kw):
return json.dumps(v, e... | true | true |
f7f8e150c8827dd48b3e52b4c49d30c6140d0fc8 | 4,652 | py | Python | google/cloud/security/scanner/scanners/forwarding_rule_scanner.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | 1 | 2018-03-26T08:15:21.000Z | 2018-03-26T08:15:21.000Z | google/cloud/security/scanner/scanners/forwarding_rule_scanner.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | google/cloud/security/scanner/scanners/forwarding_rule_scanner.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 37.821138 | 79 | 0.663371 |
from google.cloud.security.common.util import log_util
from google.cloud.security.common.data_access import forwarding_rules_dao
from google.cloud.security.scanner.audit import forwarding_rule_rules_engine
from google.cloud.security.scanner.scanners import base_scanner
LOGGER = log_util.get_logger(__nam... | true | true |
f7f8e209d791db1e7d711c2c75fca6e125fce1a5 | 10,809 | py | Python | latent_programmer/models/relative_attention.py | GurcanDurukan/google-research | 85fcb6fedaeb9a91e6a27ac469773771fca41634 | [
"Apache-2.0"
] | 1 | 2021-09-30T22:00:31.000Z | 2021-09-30T22:00:31.000Z | latent_programmer/models/relative_attention.py | GurcanDurukan/google-research | 85fcb6fedaeb9a91e6a27ac469773771fca41634 | [
"Apache-2.0"
] | 6 | 2022-02-10T00:01:02.000Z | 2022-02-10T07:24:45.000Z | latent_programmer/models/relative_attention.py | LaudateCorpus1/google-research | f349d160966ae1e63755ee2c97481f59331da4b5 | [
"Apache-2.0"
] | 2 | 2021-09-03T13:42:04.000Z | 2021-09-14T21:20:51.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 41.413793 | 134 | 0.655472 |
import functools
from typing import Any, Callable, Iterable, Optional
from flax.linen import attention
from flax.linen import initializers
from flax.linen import linear
from flax.linen import module
from jax import lax
import jax.numpy as jnp
PRNGKey = Any
Shape = Iterable[int]
Dtype = Any
Array ... | true | true |
f7f8e30f155d1aeea266bf1aeebc782ce4d04b0b | 7,432 | py | Python | sdk/python/pulumi_azure_nextgen/compute/latest/get_image.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/compute/latest/get_image.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/compute/latest/get_image.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.910995 | 209 | 0.66873 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetImageResult',
'AwaitableGetImageResult',
'get_image',
]
warnings.warn("""The 'latest' version is deprecated. Please m... | true | true |
f7f8e3c3e3f8a8fa75035d3ef14d861b7c2f6cf0 | 1,570 | py | Python | dmrg_helpers/extract/estimator_name.py | iglpdc/dmrg_helpers | df27ff06395c0a4779c2d2723d57524da55cc14a | [
"MIT"
] | 1 | 2019-09-26T13:06:04.000Z | 2019-09-26T13:06:04.000Z | dmrg_helpers/extract/estimator_name.py | iglpdc/dmrg_helpers | df27ff06395c0a4779c2d2723d57524da55cc14a | [
"MIT"
] | null | null | null | dmrg_helpers/extract/estimator_name.py | iglpdc/dmrg_helpers | df27ff06395c0a4779c2d2723d57524da55cc14a | [
"MIT"
] | null | null | null | '''A class for estimator names.
'''
from dmrg_helpers.extract.tuple_to_key import tuple_to_key
from sqlite3 import register_adapter, register_converter
class EstimatorName(object):
"""A class to store estimator names into the database.
You use this function to handle estimator names inside the databasesel... | 28.035714 | 78 | 0.696178 | from dmrg_helpers.extract.tuple_to_key import tuple_to_key
from sqlite3 import register_adapter, register_converter
class EstimatorName(object):
def __init__(self, operators):
super(EstimatorName, self).__init__()
self.operators = operators
def adapt_estimator_name(estimator_name):
return tupl... | true | true |
f7f8e40e478faeef4cc94983cb3df4e20d3c6a14 | 38 | py | Python | python/testData/refactoring/introduceVariable/leftQuoteSubstring.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/introduceVariable/leftQuoteSubstring.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/introduceVariable/leftQuoteSubstring.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | a = "hello"
print(a + " world" + "!")
| 12.666667 | 25 | 0.447368 | a = "hello"
print(a + " world" + "!")
| true | true |
f7f8e425bf5d7b764bc951d3653fe2c9c693bfa4 | 8,499 | py | Python | tests/originalTests/wizard_test.py | Sikiru98/jsonpickle-master | ebaf6ee73827535dba50c3f8cf53e7a3b52cb310 | [
"BSD-3-Clause"
] | 956 | 2015-06-24T15:04:55.000Z | 2022-03-30T06:25:04.000Z | scripts/external_libs/jsonpickle-2.0.0/tests/wizard_test.py | hjat2005/trex-core | 400f03c86c844a0096dff3f6b13e58a808aaefff | [
"Apache-2.0"
] | 782 | 2015-09-20T15:19:00.000Z | 2022-03-31T23:52:05.000Z | scripts/external_libs/jsonpickle-2.0.0/tests/wizard_test.py | hjat2005/trex-core | 400f03c86c844a0096dff3f6b13e58a808aaefff | [
"Apache-2.0"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | """Wizard tests from petrounias.org
http://www.petrounias.org/articles/2014/09/16/pickling-python-collections-with-non-built-in-type-keys-and-cycles/
Includes functionality to assist with adding compatibility to jsonpickle.
"""
from __future__ import absolute_import, division, unicode_literals
import unittest
import... | 39.714953 | 113 | 0.65643 | from __future__ import absolute_import, division, unicode_literals
import unittest
import collections
from jsonpickle import encode, decode
class World(object):
def __init__(self):
self.wizards = []
class Wizard(object):
def __init__(self, world, name):
self.name = name
self.spells ... | true | true |
f7f8e441fd5ef08542f58f79c890f052003abc09 | 1,225 | py | Python | kpurawler.py | rendybjunior/kpurawler | 14d1693a59d64ce0ef6b4977af8b5ebfbc6b383e | [
"Apache-2.0"
] | 2 | 2019-04-04T15:18:14.000Z | 2019-04-19T10:41:02.000Z | kpurawler.py | rendybjunior/kpurawler | 14d1693a59d64ce0ef6b4977af8b5ebfbc6b383e | [
"Apache-2.0"
] | null | null | null | kpurawler.py | rendybjunior/kpurawler | 14d1693a59d64ce0ef6b4977af8b5ebfbc6b383e | [
"Apache-2.0"
] | null | null | null | import sys
import time
import scrapy
import json
class DctSpider(scrapy.Spider):
name = 'dct_crawler'
dapil_id = '4782' # ID Dapil Cianjur 2
current_ts = round(time.time() * 1000)
start_urls = ['https://infopemilu.kpu.go.id/pileg2019/pencalonan/pengajuan-calon/' + \
str(dapil_id) + '/calonDct.... | 37.121212 | 90 | 0.581224 | import sys
import time
import scrapy
import json
class DctSpider(scrapy.Spider):
name = 'dct_crawler'
dapil_id = '4782'
current_ts = round(time.time() * 1000)
start_urls = ['https://infopemilu.kpu.go.id/pileg2019/pencalonan/pengajuan-calon/' + \
str(dapil_id) + '/calonDct.json?_=' + str(curre... | true | true |
f7f8e4c84a19ab19e4a8a596b55b41d235ea9f09 | 568 | py | Python | webapp/migrations/versions/e9fbe7694450_add_required_grants.py | ramboldio/steuerlotse | eeebb91be6c13435d621d105ffdb19e972c8f649 | [
"MIT"
] | null | null | null | webapp/migrations/versions/e9fbe7694450_add_required_grants.py | ramboldio/steuerlotse | eeebb91be6c13435d621d105ffdb19e972c8f649 | [
"MIT"
] | null | null | null | webapp/migrations/versions/e9fbe7694450_add_required_grants.py | ramboldio/steuerlotse | eeebb91be6c13435d621d105ffdb19e972c8f649 | [
"MIT"
] | null | null | null | """Add required grants
Revision ID: e9fbe7694450
Revises: c0b039d92792
Create Date: 2021-04-19 12:59:52.861502
"""
from alembic import op
import sqlalchemy as sa
from app import app
# revision identifiers, used by Alembic.
revision = 'e9fbe7694450'
down_revision = 'c0b039d92792'
branch_labels = None
depends_on = N... | 18.322581 | 57 | 0.691901 | from alembic import op
import sqlalchemy as sa
from app import app
revision = 'e9fbe7694450'
down_revision = 'c0b039d92792'
branch_labels = None
depends_on = None
def upgrade():
if app.config['ENV'] in ('staging', 'production'):
op.execute("""
GRANT ALL ON TABLE "user" TO steuerlotse;
... | true | true |
f7f8e5da038078ff467546f516187ea82b512845 | 41 | py | Python | back/old/similar.py | npavlinov/OxfordHack2018 | 271d3b857cb43dd45cf7897b3316699d562c20c5 | [
"MIT"
] | null | null | null | back/old/similar.py | npavlinov/OxfordHack2018 | 271d3b857cb43dd45cf7897b3316699d562c20c5 | [
"MIT"
] | null | null | null | back/old/similar.py | npavlinov/OxfordHack2018 | 271d3b857cb43dd45cf7897b3316699d562c20c5 | [
"MIT"
] | null | null | null |
def similarity(a, b):
return a==b
| 6.833333 | 21 | 0.560976 |
def similarity(a, b):
return a==b
| true | true |
f7f8e63167f09b5a75d7932a285bf2185a61939f | 9,674 | py | Python | homeassistant/components/google.py | adolfoeliazat/voidhomecontrol | 6d733253811c553912e46e24debec818b28b0688 | [
"Apache-2.0"
] | 1 | 2021-08-06T09:54:39.000Z | 2021-08-06T09:54:39.000Z | homeassistant/components/google.py | adolfoeliazat/voidhomecontrol | 6d733253811c553912e46e24debec818b28b0688 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/google.py | adolfoeliazat/voidhomecontrol | 6d733253811c553912e46e24debec818b28b0688 | [
"Apache-2.0"
] | 1 | 2020-08-26T20:54:14.000Z | 2020-08-26T20:54:14.000Z | """
Support for Google - Calendar Event Devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/google/
NOTE TO OTHER DEVELOPERS: IF YOU ADD MORE SCOPES TO THE OAUTH THAN JUST
CALENDAR THEN USERS WILL NEED TO DELETE THEIR TOKEN_FILE. THEY WILL LOSE THEI... | 32.904762 | 79 | 0.666839 | import logging
import os
import yaml
import voluptuous as vol
from voluptuous.error import Error as VoluptuousError
import homeassistant.helpers.config_validation as cv
import homeassistant.loader as loader
from homeassistant.setup import setup_component
from homeassistant.helpers import discovery
from homeassistant.... | true | true |
f7f8e661b1844ac4cfad83acdfcf206762e9ef77 | 37,604 | py | Python | lacusClient_p2pTest/app_implementation/restfulServer/flask-restful/tests/test_api.py | tavog96/distribuidosProyecto | 8aee06ca580389412809353ac312c417aa1163fa | [
"MIT"
] | 2 | 2020-01-18T15:07:37.000Z | 2020-01-18T15:07:38.000Z | lacusClient_p2pTest/app_implementation/restfulServer/flask-restful/tests/test_api.py | tavog96/distribuidosProyecto | 8aee06ca580389412809353ac312c417aa1163fa | [
"MIT"
] | null | null | null | lacusClient_p2pTest/app_implementation/restfulServer/flask-restful/tests/test_api.py | tavog96/distribuidosProyecto | 8aee06ca580389412809353ac312c417aa1163fa | [
"MIT"
] | null | null | null | import unittest
import json
from flask import Flask, Blueprint, redirect, views, abort as flask_abort
from flask.signals import got_request_exception, signals_available
try:
from mock import Mock
except:
# python3
from unittest.mock import Mock
import flask
import werkzeug
from werkzeug.exceptions import HT... | 35.475472 | 113 | 0.588395 | import unittest
import json
from flask import Flask, Blueprint, redirect, views, abort as flask_abort
from flask.signals import got_request_exception, signals_available
try:
from mock import Mock
except:
from unittest.mock import Mock
import flask
import werkzeug
from werkzeug.exceptions import HTTPExcepti... | true | true |
f7f8e7146cfa372ab73c9e73a218cb539729f7df | 2,792 | py | Python | src/blog_app/blog_app.py | diogoosorio/blog | e0f9878d44354b17f4fc4a06942bc8e166558489 | [
"MIT"
] | null | null | null | src/blog_app/blog_app.py | diogoosorio/blog | e0f9878d44354b17f4fc4a06942bc8e166558489 | [
"MIT"
] | null | null | null | src/blog_app/blog_app.py | diogoosorio/blog | e0f9878d44354b17f4fc4a06942bc8e166558489 | [
"MIT"
] | null | null | null | import uuid
import re
from flask import Flask, redirect, render_template, g, abort, request, make_response
from flask_ink.ink import Ink
from flask_caching import Cache
from .settings import SETTINGS, CACHE_SETTINGS
from .repository import LocalRepository
from .parsers import BlogParser
from .pagination import BlogPa... | 25.153153 | 86 | 0.681232 | import uuid
import re
from flask import Flask, redirect, render_template, g, abort, request, make_response
from flask_ink.ink import Ink
from flask_caching import Cache
from .settings import SETTINGS, CACHE_SETTINGS
from .repository import LocalRepository
from .parsers import BlogParser
from .pagination import BlogPa... | true | true |
f7f8e777ca2a69e11f577cc6ce9cad4dff445c98 | 22,813 | py | Python | old/ms/openid/gaesession.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 16 | 2015-01-02T15:39:04.000Z | 2016-03-17T06:38:46.000Z | old/ms/openid/gaesession.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 37 | 2015-01-28T20:58:05.000Z | 2016-03-22T04:01:32.000Z | old/ms/openid/gaesession.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 8 | 2015-04-08T02:26:03.000Z | 2016-03-04T05:56:24.000Z | """
Copyright 2013 The Trustees of Princeton University
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 applicab... | 42.168207 | 173 | 0.646517 | """
Copyright 2013 The Trustees of Princeton University
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 applicab... | false | true |
f7f8e864972c983bff3a89442b814c36fc2b717a | 1,018 | py | Python | setup.py | Skuldur/somnus | 45cec3e2ed3f27e2a024ea214651af30a0e6fe60 | [
"MIT"
] | 5 | 2020-07-13T13:41:36.000Z | 2021-05-22T18:50:17.000Z | setup.py | Skuldur/somnus | 45cec3e2ed3f27e2a024ea214651af30a0e6fe60 | [
"MIT"
] | null | null | null | setup.py | Skuldur/somnus | 45cec3e2ed3f27e2a024ea214651af30a0e6fe60 | [
"MIT"
] | 1 | 2020-07-18T16:50:15.000Z | 2020-07-18T16:50:15.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="somnus",
version="0.2.2",
author="Sigurður Skúli Sigurgeirsson",
author_email="siggiskuli@gmail.com",
description="Somnus is keyword detection made easy.",
long_description=long_descri... | 28.277778 | 58 | 0.59725 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="somnus",
version="0.2.2",
author="Sigurður Skúli Sigurgeirsson",
author_email="siggiskuli@gmail.com",
description="Somnus is keyword detection made easy.",
long_description=long_descri... | true | true |
f7f8e8aa3b05ca83d51ea2b4294fe88b9c4d9386 | 4,743 | py | Python | test/python/pulse/test_channels.py | mstypulk/qiskit-terra | 058feb06657ec4b598cc65216288bdd984550d00 | [
"Apache-2.0"
] | null | null | null | test/python/pulse/test_channels.py | mstypulk/qiskit-terra | 058feb06657ec4b598cc65216288bdd984550d00 | [
"Apache-2.0"
] | null | null | null | test/python/pulse/test_channels.py | mstypulk/qiskit-terra | 058feb06657ec4b598cc65216288bdd984550d00 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""Test cases for the pulse channel group."""
import unittest
from qiskit.pulse.channels import AcquireChannel, MemorySlot,... | 30.018987 | 98 | 0.663293 |
import unittest
from qiskit.pulse.channels import AcquireChannel, MemorySlot, RegisterSlot, SnapshotChannel
from qiskit.pulse.channels import DeviceSpecification, Qubit
from qiskit.pulse.channels import DriveChannel, ControlChannel, MeasureChannel
from qiskit.pulse.exceptions import PulseError
from qiskit.test... | true | true |
f7f8e8bae3283b951970e2d74bb26605806e6e7d | 1,943 | py | Python | aiida_porousmaterials/parser/__init__.py | pzarabadip/aiida-porousmaterials | ec4fd944a3014656968e810a3222f1eae7bf9a66 | [
"MIT"
] | 1 | 2021-03-06T01:27:18.000Z | 2021-03-06T01:27:18.000Z | aiida_porousmaterials/parser/__init__.py | pzarabadip/aiida-porousmaterials | ec4fd944a3014656968e810a3222f1eae7bf9a66 | [
"MIT"
] | 1 | 2020-03-05T09:05:57.000Z | 2020-03-05T09:05:57.000Z | aiida_porousmaterials/parser/__init__.py | pzarabadip/aiida-porousmaterials | ec4fd944a3014656968e810a3222f1eae7bf9a66 | [
"MIT"
] | null | null | null | """PorousMaterials Output Parse"""
import os
import re
from aiida.common import NotExistent, OutputParsingError
from aiida.engine import ExitCode
from aiida.orm import Dict, SinglefileData
from aiida.parsers.parser import Parser
from aiida_porousmaterials.utils import parse_base_output
class PorousMaterialsParser(Pa... | 34.087719 | 141 | 0.671642 | import os
import re
from aiida.common import NotExistent, OutputParsingError
from aiida.engine import ExitCode
from aiida.orm import Dict, SinglefileData
from aiida.parsers.parser import Parser
from aiida_porousmaterials.utils import parse_base_output
class PorousMaterialsParser(Parser):
def parse(self, **kwarg... | true | true |
f7f8ea1b011e8fda627b12f5f487a4c766951af9 | 1,454 | py | Python | setup.py | ghewgill/pydkim | 8ef3b455be730a31b10983a0b2340ffc7cabf88e | [
"Zlib"
] | 10 | 2016-05-09T13:54:55.000Z | 2022-01-24T09:58:59.000Z | setup.py | akheron/pydkim | 89b08ee3b346b447c11f92ac55a1a2fe6b7e03af | [
"Zlib"
] | null | null | null | setup.py | akheron/pydkim | 89b08ee3b346b447c11f92ac55a1a2fe6b7e03af | [
"Zlib"
] | 8 | 2015-10-31T16:00:16.000Z | 2020-03-28T22:11:26.000Z | #!/usr/bin/env python
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the author be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and ... | 37.282051 | 76 | 0.722146 |
from distutils.core import setup
version = "0.3"
setup(
name = "pydkim",
version = version,
description = "DKIM (DomainKeys Identified Mail)",
long_description =
"""pydkim is a Python library that implements DKIM (DomainKeys
Identified Mail) email signing and verification.""",
... | true | true |
f7f8eaa4678a20123277c8c31ce50e217b24c8d7 | 1,687 | py | Python | day_08.py | balcortex/advent_of_code_2020 | e56a54c7578d3d70b0dcc451100b0bb65624a954 | [
"MIT"
] | null | null | null | day_08.py | balcortex/advent_of_code_2020 | e56a54c7578d3d70b0dcc451100b0bb65624a954 | [
"MIT"
] | null | null | null | day_08.py | balcortex/advent_of_code_2020 | e56a54c7578d3d70b0dcc451100b0bb65624a954 | [
"MIT"
] | null | null | null | with open("day_08_input.txt") as f:
txt = f.read()
# - - - Part 1 - - -
def acum(txt: str) -> int:
counter = 0
index = 0
memo = []
program = txt.split("\n")
while True:
ins, num = program[index].split()
num = int(num)
if index not in memo:
memo.append(ind... | 19.616279 | 75 | 0.459395 | with open("day_08_input.txt") as f:
txt = f.read()
def acum(txt: str) -> int:
counter = 0
index = 0
memo = []
program = txt.split("\n")
while True:
ins, num = program[index].split()
num = int(num)
if index not in memo:
memo.append(index)
else:
... | true | true |
f7f8ec507d9f47557eed00e504d016649ecb715a | 928 | py | Python | steps/split_feats_by_spk.py | ondrejklejch/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 18 | 2019-10-24T04:42:16.000Z | 2021-11-24T03:07:59.000Z | steps/split_feats_by_spk.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | null | null | null | steps/split_feats_by_spk.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 4 | 2018-08-31T01:08:50.000Z | 2019-05-10T12:12:57.000Z | import sys
from collections import defaultdict
def save_feats(feats_dir, spk_id, feats):
for j in range(0, len(feats), 20):
with open('%s/feats_%.4d_%.4d.scp' % (feats_dir, spk_id, j), 'w') as f:
for line in feats[j:j + 20]:
print >> f, line
if __name__ == '__main__':
feat... | 29.935484 | 79 | 0.58944 | import sys
from collections import defaultdict
def save_feats(feats_dir, spk_id, feats):
for j in range(0, len(feats), 20):
with open('%s/feats_%.4d_%.4d.scp' % (feats_dir, spk_id, j), 'w') as f:
for line in feats[j:j + 20]:
print >> f, line
if __name__ == '__main__':
feat... | true | true |
f7f8ed932b7446f3626d5114e48e64208afa23ee | 28,897 | py | Python | src/bdbd/src/bdbd/analysis/motion/NewRaph10.py | rkent/BDBD | c5d391da84faf5607c443078781f8b4e1c017dd5 | [
"MIT"
] | null | null | null | src/bdbd/src/bdbd/analysis/motion/NewRaph10.py | rkent/BDBD | c5d391da84faf5607c443078781f8b4e1c017dd5 | [
"MIT"
] | null | null | null | src/bdbd/src/bdbd/analysis/motion/NewRaph10.py | rkent/BDBD | c5d391da84faf5607c443078781f8b4e1c017dd5 | [
"MIT"
] | null | null | null | # newton-raphson iteration of motion equations
import numpy as np
import rospy
import math
import time
from bdbd_common.utils import fstr, gstr
from bdbd_common.msg import LeftRights
from bdbd_common.geometry import lr_est, default_lr_model, D_TO_R
def estr(a):
return fstr(a, fmat='10.7g', n_per_line=10)
class N... | 33.996471 | 129 | 0.462193 |
import numpy as np
import rospy
import math
import time
from bdbd_common.utils import fstr, gstr
from bdbd_common.msg import LeftRights
from bdbd_common.geometry import lr_est, default_lr_model, D_TO_R
def estr(a):
return fstr(a, fmat='10.7g', n_per_line=10)
class NewRaph():
def __init__(self, n, dt
... | true | true |
f7f8eeaabedd066a839f4a52e7e5bf44b79aadf0 | 833 | py | Python | king_of_the_hill/segment_timer.py | andrewzwicky/KingOfTheHill | e0077d9fc9ca4ebb1d0dfa556589d83b4a52bf45 | [
"MIT"
] | null | null | null | king_of_the_hill/segment_timer.py | andrewzwicky/KingOfTheHill | e0077d9fc9ca4ebb1d0dfa556589d83b4a52bf45 | [
"MIT"
] | null | null | null | king_of_the_hill/segment_timer.py | andrewzwicky/KingOfTheHill | e0077d9fc9ca4ebb1d0dfa556589d83b4a52bf45 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
from Adafruit_LED_Backpack import SevenSegment
from time import sleep
def setup():
GPIO.setmode(GPIO.BCM)
red_segment = SevenSegment.SevenSegment(address=0x70)
green_segment = SevenSegment.SevenSegment(address=0x72)
red_segment.begin()
green_segment.begin()
return red... | 18.108696 | 59 | 0.666267 | import RPi.GPIO as GPIO
from Adafruit_LED_Backpack import SevenSegment
from time import sleep
def setup():
GPIO.setmode(GPIO.BCM)
red_segment = SevenSegment.SevenSegment(address=0x70)
green_segment = SevenSegment.SevenSegment(address=0x72)
red_segment.begin()
green_segment.begin()
return red... | true | true |
f7f8efaa23034e9a4cbd289bc8a5783292e56cee | 500 | py | Python | plotly/validators/layout/scene/yaxis/_spikecolor.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/scene/yaxis/_spikecolor.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/layout/scene/yaxis/_spikecolor.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class SpikecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='spikecolor',
parent_name='layout.scene.yaxis',
**kwargs
):
super(SpikecolorValidator, self).__init__(
plotly_name=pl... | 26.315789 | 71 | 0.612 | import _plotly_utils.basevalidators
class SpikecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='spikecolor',
parent_name='layout.scene.yaxis',
**kwargs
):
super(SpikecolorValidator, self).__init__(
plotly_name=pl... | true | true |
f7f8f06b9799a1cd00fe1cb57ff8e5c82fad6f8e | 808 | py | Python | zoom-meetings/Zoom.py | ye-song/automation | ae9e987234a40e139f8f9bd84fea7e68e1e9e9df | [
"MIT"
] | null | null | null | zoom-meetings/Zoom.py | ye-song/automation | ae9e987234a40e139f8f9bd84fea7e68e1e9e9df | [
"MIT"
] | null | null | null | zoom-meetings/Zoom.py | ye-song/automation | ae9e987234a40e139f8f9bd84fea7e68e1e9e9df | [
"MIT"
] | null | null | null | #! python3
# Zoom.py - opens up zoom and login the meeting session.
import subprocess
import pyautogui
import time
'''
This is a sample code. To use this sample code:
1. Replace the path of zoom application on your machine
2. Replace the coordinates of where each mouse click will be
** Note that this depends on the s... | 26.933333 | 68 | 0.757426 |
import subprocess
import pyautogui
import time
subprocess.Popen('C:\\Users\\AppData\\Roaming\\Zoom\\bin\\Zoom.exe')
time.sleep(1)
pyautogui.click((1300, 713))
time.sleep(1)
pyautogui.typewrite('meeting ID')
time.sleep(1)
pyautogui.click((1305, 908))
time.sleep(2)
pyautogui.typewrite('password')
time.sleep(1)
pyauto... | true | true |
f7f8f11d956cc0b98b114859aa0373559038bb23 | 4,846 | py | Python | stanCode_projects/boggle_game_solver/anagram.py | ShihYesWei/stanCode-projects | 69104b7be3d8c3fbd34935c1d4e15e40961e4556 | [
"MIT"
] | null | null | null | stanCode_projects/boggle_game_solver/anagram.py | ShihYesWei/stanCode-projects | 69104b7be3d8c3fbd34935c1d4e15e40961e4556 | [
"MIT"
] | null | null | null | stanCode_projects/boggle_game_solver/anagram.py | ShihYesWei/stanCode-projects | 69104b7be3d8c3fbd34935c1d4e15e40961e4556 | [
"MIT"
] | null | null | null | """
File: anagram.py
Name: Alan Chen
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 21
If you correctly implement this program, you should see the
number of anagrams for each ... | 30.670886 | 119 | 0.62175 |
FILE = 'dictionary.txt'
EXIT = '-1'
dictionary = []
alpha_dict = {}
num_list = []
printed = []
def main():
read_dictionary()
print('Welcome to stanCode "Anagram Generator" (or ' + str(EXIT) + ' to quit) ')
global num_list
global alpha_dict
global printed
while True:
... | true | true |
f7f8f14baa26e0bd197444f4daedee8f28d48ce8 | 9,085 | py | Python | research/ptn/train_ptn.py | Zhangxu0501/models | 7c8ca1647926226556e05fdd6535a35abe3100eb | [
"Apache-2.0"
] | 310 | 2017-01-23T15:04:12.000Z | 2022-01-11T05:50:41.000Z | research/ptn/train_ptn.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 12 | 2017-05-23T17:42:59.000Z | 2020-01-10T05:16:22.000Z | research/ptn/train_ptn.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 73 | 2017-01-24T13:57:45.000Z | 2021-09-29T18:52:57.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 applicab... | 39.329004 | 113 | 0.634342 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
from tensorflow import app
import model_ptn
flags = tf.app.flags
slim = tf.contrib.slim
flags.DEFINE_string('inp_dir',
... | true | true |
f7f8f22719b9a83585d52f10a2d0966474c96d29 | 13,861 | py | Python | vize/130401078/server/ftpserver/myftpserver.py | hasan-se/blm304 | 893d15282497a426ff96b0c8b6c77d57c406742e | [
"Unlicense"
] | 1 | 2021-05-04T21:46:08.000Z | 2021-05-04T21:46:08.000Z | vize/130401078/server/ftpserver/myftpserver.py | hasan-se/blm304 | 893d15282497a426ff96b0c8b6c77d57c406742e | [
"Unlicense"
] | null | null | null | vize/130401078/server/ftpserver/myftpserver.py | hasan-se/blm304 | 893d15282497a426ff96b0c8b6c77d57c406742e | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date Sat May 16 12:05:20 2020
@author Abdoul Karim TOURE
@contact contact@trabdlkarim.com
@copyright Copyright 2020, Abdoul Karim TOURE
@license GPL v3.0 or Later
@version 1.0.1
@status Development
"""
import os
import sys
import socket
import threading
import time
i... | 37.160858 | 131 | 0.561215 |
import os
import sys
import socket
import threading
import time
import datetime
import argparse as arg
from socketserver import UDPServer
from socketserver import ThreadingMixIn
from socketserver import DatagramRequestHandler
PORT = 42
DPORT = 9999
HOST = "127.0.0.1"
GREEN = '\033[92m'
END = '\033[0m'
class MyFTP... | true | true |
f7f8f3bfd951108aa64a2bda82e8cf60541c50a4 | 3,942 | py | Python | FER_osc.py | jaegonlee/fer | 628651d88568103f5b2b3e081d5c6b5dab39267d | [
"MIT"
] | null | null | null | FER_osc.py | jaegonlee/fer | 628651d88568103f5b2b3e081d5c6b5dab39267d | [
"MIT"
] | null | null | null | FER_osc.py | jaegonlee/fer | 628651d88568103f5b2b3e081d5c6b5dab39267d | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
from keras.models import model_from_json
import numpy as np
import cv2
import argparse
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import math
from pythonosc import udp_client
class FacialExpressionModel(object):
EMOTIONS_LIST = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Surprise... | 36.841121 | 112 | 0.637494 |
from keras.models import model_from_json
import numpy as np
import cv2
import argparse
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import math
from pythonosc import udp_client
class FacialExpressionModel(object):
EMOTIONS_LIST = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Surprise", "Neutral"]
def _... | true | true |
f7f8f3e21df8c6750dc12a89f42a1ee05324bdc1 | 21,739 | py | Python | compiler/expr_translate.py | esay2077/logica | 2d5038f8d1d2c64e4c53ee4e3e1e7cad575ecaf4 | [
"Apache-2.0"
] | null | null | null | compiler/expr_translate.py | esay2077/logica | 2d5038f8d1d2c64e4c53ee4e3e1e7cad575ecaf4 | [
"Apache-2.0"
] | null | null | null | compiler/expr_translate.py | esay2077/logica | 2d5038f8d1d2c64e4c53ee4e3e1e7cad575ecaf4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 38.819643 | 80 | 0.611068 |
import copy
import json
if '.' not in __package__:
from common import color
from common.data import processed_functions
from compiler import dialects
else:
from ..common import color
from ..common.data import processed_functions
from ..compiler import dialects
class QL(object):
BUILT_... | true | true |
f7f8f4055005760b328adc7f17e7344bb07e40e6 | 491 | py | Python | app/decorators.py | rudGess/flasky_python | 9584e289b6773d45a8c005563e5335cf2c050b16 | [
"MIT"
] | null | null | null | app/decorators.py | rudGess/flasky_python | 9584e289b6773d45a8c005563e5335cf2c050b16 | [
"MIT"
] | null | null | null | app/decorators.py | rudGess/flasky_python | 9584e289b6773d45a8c005563e5335cf2c050b16 | [
"MIT"
] | null | null | null | from functools import wraps
from flask import abort
from flask_login import current_user
from .models import Permission
def permission_required(permission):
def decorator(f):
@wraps(f)
def decorator_function(*args, **kwargs):
if not current_user.can(permission):
abort(40... | 28.882353 | 51 | 0.688391 | from functools import wraps
from flask import abort
from flask_login import current_user
from .models import Permission
def permission_required(permission):
def decorator(f):
@wraps(f)
def decorator_function(*args, **kwargs):
if not current_user.can(permission):
abort(40... | true | true |
f7f8f43cb6af0c9b6fa95fe9b49b4abc6faad1cf | 2,579 | py | Python | django_kms/fields.py | skruger/django-kms-field | 31ecec0920f2cfc7bd65a51d141992939a638870 | [
"MIT"
] | 4 | 2020-12-22T07:01:21.000Z | 2021-11-02T05:13:46.000Z | django_kms/fields.py | skruger/django-kms-field | 31ecec0920f2cfc7bd65a51d141992939a638870 | [
"MIT"
] | null | null | null | django_kms/fields.py | skruger/django-kms-field | 31ecec0920f2cfc7bd65a51d141992939a638870 | [
"MIT"
] | 1 | 2022-02-15T19:07:12.000Z | 2022-02-15T19:07:12.000Z | import hashlib
import boto3
from django.db import models
from django.conf import settings
from django.core import checks
from .cache import SimpleCache
def get_kms_client():
return boto3.client('kms', getattr(settings, 'KMS_FIELD_REGION', 'us-east-1'))
class KMSEncryptedCharField(models.BinaryField):
def... | 33.493506 | 101 | 0.629314 | import hashlib
import boto3
from django.db import models
from django.conf import settings
from django.core import checks
from .cache import SimpleCache
def get_kms_client():
return boto3.client('kms', getattr(settings, 'KMS_FIELD_REGION', 'us-east-1'))
class KMSEncryptedCharField(models.BinaryField):
def... | true | true |
f7f8f5dc93766d76651477266dea32ca815d388b | 1,442 | py | Python | prep_timit.py | toxidol/MLSP-FA2021 | 3109e62f00d6f16e410f4eae341df2e027ee9cc3 | [
"MIT"
] | null | null | null | prep_timit.py | toxidol/MLSP-FA2021 | 3109e62f00d6f16e410f4eae341df2e027ee9cc3 | [
"MIT"
] | null | null | null | prep_timit.py | toxidol/MLSP-FA2021 | 3109e62f00d6f16e410f4eae341df2e027ee9cc3 | [
"MIT"
] | null | null | null | '''
Add noise to audio files in TIMIT.
'''
import os
import glob
import random
from tqdm import tqdm
from create_mixed_audio_file_with_soundfile import mix_clean_with_noise
if __name__ == '__main__':
snr = 0 # in dB
timit_root = '/Users/goree/Desktop/cmu/datasets/timit/data' # change for user path struc... | 36.05 | 132 | 0.63939 |
import os
import glob
import random
from tqdm import tqdm
from create_mixed_audio_file_with_soundfile import mix_clean_with_noise
if __name__ == '__main__':
snr = 0
timit_root = '/Users/goree/Desktop/cmu/datasets/timit/data'
output_root = f'/Users/goree/Desktop/cmu/datasets/timit_snr{snr}'
... | true | true |
f7f8f7c3573646a35c91abe428ebbe00f9f0d7de | 7,154 | py | Python | awschecks/awstagscheck.py | pvbouwel/nagios-awschecks | 80acd7f31281176542a9b8ea6609093890d24cbd | [
"Apache-2.0"
] | null | null | null | awschecks/awstagscheck.py | pvbouwel/nagios-awschecks | 80acd7f31281176542a9b8ea6609093890d24cbd | [
"Apache-2.0"
] | 2 | 2021-05-01T05:24:48.000Z | 2021-05-01T06:07:42.000Z | awschecks/awstagscheck.py | pvbouwel/nagios-awschecks | 80acd7f31281176542a9b8ea6609093890d24cbd | [
"Apache-2.0"
] | null | null | null | __author__ = 'pvbouwel'
from nagioscheck import NagiosCheck
from nagioscheck import NagiosCheckThresholdError
from nagioscheck import NagiosCheckOptionError
class AWSTagCheck(NagiosCheck):
possible_resources = ['instance', 'volume', 'snapshot']
warning_tags = []
critical_tags = []
resources_to_check ... | 44.434783 | 120 | 0.632653 | __author__ = 'pvbouwel'
from nagioscheck import NagiosCheck
from nagioscheck import NagiosCheckThresholdError
from nagioscheck import NagiosCheckOptionError
class AWSTagCheck(NagiosCheck):
possible_resources = ['instance', 'volume', 'snapshot']
warning_tags = []
critical_tags = []
resources_to_check ... | true | true |
f7f8f86dbe8447ac259cdbc99f1185e6db2a2623 | 10,763 | py | Python | superset/models/sql_lab.py | isabella232/incubator-superset-internal | 81f77fd28e8b4320b2b7e829312cefa8d326235a | [
"Apache-2.0"
] | null | null | null | superset/models/sql_lab.py | isabella232/incubator-superset-internal | 81f77fd28e8b4320b2b7e829312cefa8d326235a | [
"Apache-2.0"
] | 1 | 2021-02-23T16:45:47.000Z | 2021-04-24T23:15:03.000Z | superset/models/sql_lab.py | isabella232/incubator-superset-internal | 81f77fd28e8b4320b2b7e829312cefa8d326235a | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.634375 | 87 | 0.658181 |
import re
from datetime import datetime
from typing import Any, Dict, List
import simplejson as json
import sqlalchemy as sqla
from flask import Markup
from flask_appbuilder import Model
from flask_appbuilder.models.decorators import renders
from humanize import naturaltime
from sqlalchemy import (
... | true | true |
f7f8f91f3b4c784eb51e7f9535f53fbad1535a11 | 5,471 | py | Python | lte/gateway/python/magma/mobilityd/tests/test_dhcp_client.py | silveryfu/magma | ba490fb13d054b7085bbaca474aa831c4e7bcb94 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/mobilityd/tests/test_dhcp_client.py | silveryfu/magma | ba490fb13d054b7085bbaca474aa831c4e7bcb94 | [
"BSD-3-Clause"
] | 85 | 2020-08-11T06:27:29.000Z | 2022-03-22T10:15:09.000Z | lte/gateway/python/magma/mobilityd/tests/test_dhcp_client.py | rckclmbr/magma | 6e537f7274ec3b7827743c546e2926defcc63103 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.966216 | 87 | 0.638457 | import datetime
import logging
import os
import subprocess
import sys
import threading
import time
import unittest
from freezegun import freeze_time
from magma.pipelined.bridge_util import BridgeTools
from magma.mobilityd.dhcp_client import DHCPClient
from magma.mobilityd.mac import MacAddress
from magma.mobilityd.dh... | true | true |
f7f8fa647fba78c1ce9c223ce3f3d69b64ab9abd | 3,970 | py | Python | cirq/testing/lin_alg_utils.py | kunalq/Cirq | e73c9bef672e83143ab04e7f169988149055d630 | [
"Apache-2.0"
] | 1 | 2019-09-04T16:55:30.000Z | 2019-09-04T16:55:30.000Z | cirq/testing/lin_alg_utils.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | null | null | null | cirq/testing/lin_alg_utils.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | 1 | 2018-10-25T19:36:50.000Z | 2018-10-25T19:36:50.000Z | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 28.357143 | 80 | 0.653904 |
from typing import Optional
import numpy as np
from cirq import linalg
def random_superposition(dim: int) -> np.ndarray:
state_vector = np.random.randn(dim).astype(complex)
state_vector += 1j * np.random.randn(dim)
state_vector /= np.linalg.norm(state_vector)
return state_vector
def... | true | true |
f7f8fae07784bbb86adba0fefb6eda74a718187e | 360 | py | Python | app/handlers/emails.py | Stanford-PERTS/triton | 5a4f401fc7019d59ce4c41eafa6c5bda822fae0a | [
"CC0-1.0"
] | null | null | null | app/handlers/emails.py | Stanford-PERTS/triton | 5a4f401fc7019d59ce4c41eafa6c5bda822fae0a | [
"CC0-1.0"
] | null | null | null | app/handlers/emails.py | Stanford-PERTS/triton | 5a4f401fc7019d59ce4c41eafa6c5bda822fae0a | [
"CC0-1.0"
] | null | null | null | from gae_handlers import RestHandler
from model import Email
class Emails(RestHandler):
requires_auth = True
model = Email
def get(self, **kwargs):
self.not_allowed()
def put(self):
self.not_allowed()
def delete(self):
self.not_allowed()
def not_allowed(self):
... | 18 | 44 | 0.65 | from gae_handlers import RestHandler
from model import Email
class Emails(RestHandler):
requires_auth = True
model = Email
def get(self, **kwargs):
self.not_allowed()
def put(self):
self.not_allowed()
def delete(self):
self.not_allowed()
def not_allowed(self):
... | true | true |
f7f8fb22ebff466907fc03b928d0b7c0bb52885f | 2,475 | py | Python | src/engine/SCons/Tool/ipkg.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | 1 | 2019-09-18T06:37:02.000Z | 2019-09-18T06:37:02.000Z | src/engine/SCons/Tool/ipkg.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | src/engine/SCons/Tool/ipkg.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | """SCons.Tool.ipkg
Tool-specific initialization for ipkg.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
The ipkg tool calls the ipkg-build. Its only argument should be the
packages fake_root.
"""
#
# Copyrigh... | 36.397059 | 103 | 0.688081 |
__revision__ = "src/engine/SCons/Tool/ipkg.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import os
import SCons.Builder
def generate(env):
try:
bld = env['BUILDERS']['Ipkg']
except KeyError:
bld = SCons.Builder.Builder( action = '$IPKGCOM',
... | true | true |
f7f8fc22209ed29922a9fded6cbf07758909bd88 | 5,186 | py | Python | Views/Creation/transitionAddUI.py | yvesjordan06/automata-brains | 1c34dd9315fcee7ce1807a2b94a0ec48421d03b1 | [
"MIT"
] | 3 | 2020-01-31T15:54:48.000Z | 2020-02-01T10:01:35.000Z | Views/Creation/transitionAddUI.py | yvesjordan06/automata-brains | 1c34dd9315fcee7ce1807a2b94a0ec48421d03b1 | [
"MIT"
] | null | null | null | Views/Creation/transitionAddUI.py | yvesjordan06/automata-brains | 1c34dd9315fcee7ce1807a2b94a0ec48421d03b1 | [
"MIT"
] | 2 | 2020-02-01T09:59:51.000Z | 2020-02-01T10:02:12.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/transition.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from Models.Automate import Automate
from Models.Etat import Etat
from Mo... | 39.587786 | 91 | 0.703047 |
from PyQt5 import QtCore, QtGui, QtWidgets
from Models.Automate import Automate
from Models.Etat import Etat
from Models.Transition import Transition
class Ui_Form(object):
def __init__(self, automate: Automate):
self.automate = automate
def setupUi(self, Form):
Form.setObjectName("... | true | true |
f7f8fcc3f8ac166f01bc66ee014bf273fbb9bbce | 38,459 | py | Python | tests/urlpatterns_reverse/tests.py | kux/django | d61ebc8fed212366340b1ed6f5d7722613801459 | [
"BSD-3-Clause"
] | null | null | null | tests/urlpatterns_reverse/tests.py | kux/django | d61ebc8fed212366340b1ed6f5d7722613801459 | [
"BSD-3-Clause"
] | null | null | null | tests/urlpatterns_reverse/tests.py | kux/django | d61ebc8fed212366340b1ed6f5d7722613801459 | [
"BSD-3-Clause"
] | 1 | 2020-04-24T21:08:18.000Z | 2020-04-24T21:08:18.000Z | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include
from django.contrib.auth.models import User
from django.core... | 50.471129 | 240 | 0.640838 |
from __future__ import unicode_literals
import sys
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from djan... | true | true |
f7f8fcdf0fa75890bcd55e1d8dde8f464567a7d9 | 5,239 | py | Python | setupext/platform.py | bpercy11/jpype | f4d59ee1829bb6060e7d2ed82af4390b59d43309 | [
"Apache-2.0"
] | null | null | null | setupext/platform.py | bpercy11/jpype | f4d59ee1829bb6060e7d2ed82af4390b59d43309 | [
"Apache-2.0"
] | 51 | 2017-06-18T15:45:23.000Z | 2021-02-17T21:24:35.000Z | setupext/platform.py | bpercy11/jpype | f4d59ee1829bb6060e7d2ed82af4390b59d43309 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
#
# 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/l... | 37.421429 | 104 | 0.626074 |
import setupext
import os
import sys
import sysconfig
import distutils.log
def Platform(include_dirs=None, sources=None, platform=sys.platform):
if include_dirs is None:
include_dirs = []
if sources is None:
sources = []
platform_specific = {
'include_dirs': in... | true | true |
f7f8fd0149883f695cc5f6113ad072a0bc0a8be3 | 14,786 | py | Python | ta/wrapper.py | amalekji/trading-tech-analysis | b360062d6b2a31f0bf237e42a9a399d3b1f6c306 | [
"MIT"
] | 1 | 2020-07-18T09:05:57.000Z | 2020-07-18T09:05:57.000Z | ta/wrapper.py | amalekji/trading-tech-analysis | b360062d6b2a31f0bf237e42a9a399d3b1f6c306 | [
"MIT"
] | null | null | null | ta/wrapper.py | amalekji/trading-tech-analysis | b360062d6b2a31f0bf237e42a9a399d3b1f6c306 | [
"MIT"
] | 1 | 2020-08-25T18:16:11.000Z | 2020-08-25T18:16:11.000Z | """
.. module:: wrapper
:synopsis: Wrapper of Indicators.
.. moduleauthor:: Dario Lopez Padial (Bukosabino)
"""
import pandas as pd
from ta.momentum import (AwesomeOscillatorIndicator, KAMAIndicator,
ROCIndicator, RSIIndicator, StochasticOscillator,
TSIIndicator, ... | 44.536145 | 115 | 0.679562 |
import pandas as pd
from ta.momentum import (AwesomeOscillatorIndicator, KAMAIndicator,
ROCIndicator, RSIIndicator, StochasticOscillator,
TSIIndicator, UltimateOscillator, WilliamsRIndicator)
from ta.others import (CumulativeReturnIndicator, DailyLogReturnIndicator,
... | true | true |
f7f8fd3989b258dee19eb783744d48f0724395fc | 7,871 | py | Python | Tests/Methods/Machine/test_Magnet_Type_10_meth.py | harshasunder-1/pyleecan | 32ae60f98b314848eb9b385e3652d7fc50a77420 | [
"Apache-2.0"
] | 2 | 2020-08-28T14:54:55.000Z | 2021-03-13T19:34:45.000Z | Tests/Methods/Machine/test_Magnet_Type_10_meth.py | harshasunder-1/pyleecan | 32ae60f98b314848eb9b385e3652d7fc50a77420 | [
"Apache-2.0"
] | null | null | null | Tests/Methods/Machine/test_Magnet_Type_10_meth.py | harshasunder-1/pyleecan | 32ae60f98b314848eb9b385e3652d7fc50a77420 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.LamSlotMag import LamSlotMag
from pyleecan.Classes.SlotMFlat import SlotMFlat
from pyleecan.Classes.MagnetType10 import MagnetType10
from pyleecan.Classes.Segment import Segment
from pyleecan.Methods.Machine.Magnet.comp_surface import comp_surface
from pylee... | 30.041985 | 83 | 0.552026 |
import pytest
from pyleecan.Classes.LamSlotMag import LamSlotMag
from pyleecan.Classes.SlotMFlat import SlotMFlat
from pyleecan.Classes.MagnetType10 import MagnetType10
from pyleecan.Classes.Segment import Segment
from pyleecan.Methods.Machine.Magnet.comp_surface import comp_surface
from pyleecan.Methods import Pare... | true | true |
f7f8fd94d0979b4da9c3f98c6a085813e1539c36 | 2,284 | py | Python | util/third_party/tensorflow_extra/tool/tflite/tflite/FakeQuantOptions.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | util/third_party/tensorflow_extra/tool/tflite/tflite/FakeQuantOptions.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | util/third_party/tensorflow_extra/tool/tflite/tflite/FakeQuantOptions.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class FakeQuantOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFakeQuantOptions(cls, buf, offset=0):
n = fla... | 37.442623 | 114 | 0.706655 |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class FakeQuantOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFakeQuantOptions(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = FakeQuantOptio... | true | true |
f7f8fde234a004edd794854839a327987ec9b813 | 407 | py | Python | ir_sensor.py | xp7551/robot | ba34d0d5ba4c2b497370159a8d0c0b2d6e02d44e | [
"Apache-2.0"
] | null | null | null | ir_sensor.py | xp7551/robot | ba34d0d5ba4c2b497370159a8d0c0b2d6e02d44e | [
"Apache-2.0"
] | null | null | null | ir_sensor.py | xp7551/robot | ba34d0d5ba4c2b497370159a8d0c0b2d6e02d44e | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
RECEIVER = 12
LIGHT = 26
GPIO.setup(RECEIVER,GPIO.IN)
GPIO.setup(LIGHT,GPIO.OUT)
GPIO.output(LIGHT, False)
def flash(seconds):
GPIO.output(LIGHT,True)
time.sleep(seconds)
GPIO.output(LIGHT,False)
time.sleep(2)
#flash(.5)
while ... | 16.28 | 28 | 0.712531 | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
RECEIVER = 12
LIGHT = 26
GPIO.setup(RECEIVER,GPIO.IN)
GPIO.setup(LIGHT,GPIO.OUT)
GPIO.output(LIGHT, False)
def flash(seconds):
GPIO.output(LIGHT,True)
time.sleep(seconds)
GPIO.output(LIGHT,False)
time.sleep(2)
while True:
if ... | true | true |
f7f8fe2ae62001f14decf23cf96ad9423321072b | 3,748 | py | Python | tests/tests_git/test_git_repository.py | lobdelle/opensearch-build | d2d77fb4282cc3f3c0f938f0bfc83b640621a0f6 | [
"Apache-2.0"
] | null | null | null | tests/tests_git/test_git_repository.py | lobdelle/opensearch-build | d2d77fb4282cc3f3c0f938f0bfc83b640621a0f6 | [
"Apache-2.0"
] | null | null | null | tests/tests_git/test_git_repository.py | lobdelle/opensearch-build | d2d77fb4282cc3f3c0f938f0bfc83b640621a0f6 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import os
import subprocess
import unittest
from unittest.mock import patch
from git.git_repository import GitRepository
from ... | 42.590909 | 101 | 0.685699 |
import os
import subprocess
import unittest
from unittest.mock import patch
from git.git_repository import GitRepository
from system.temporary_directory import TemporaryDirectory
class TestGitRepository(unittest.TestCase):
def setUp(self):
self.repo = GitRepository(
url="https://github.... | true | true |
f7f8ff8b0baee3aeee8955d966f0bbbf22772121 | 15,058 | py | Python | simulate_expression_compendia_modules/cca_core.py | ajlee21/Batch_effects_simulation | d707321346de48de5e63cf251280bdf9372be59c | [
"BSD-3-Clause"
] | 6 | 2020-05-04T15:16:32.000Z | 2021-02-28T04:49:21.000Z | simulate_expression_compendia_modules/cca_core.py | ajlee21/Batch_effects_simulation | d707321346de48de5e63cf251280bdf9372be59c | [
"BSD-3-Clause"
] | 12 | 2020-02-27T20:12:36.000Z | 2021-04-07T20:28:35.000Z | simulate_expression_compendia_modules/cca_core.py | ajlee21/Batch_effects_simulation | d707321346de48de5e63cf251280bdf9372be59c | [
"BSD-3-Clause"
] | 2 | 2019-06-02T18:29:17.000Z | 2020-02-13T09:33:37.000Z | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.900285 | 87 | 0.644043 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
num_cca_trials = 5
epsilon = 1e-6
def positivedef_matrix_sqrt(array):
w, v = np.linalg.eigh(array)
wsqrt = np.sqrt(w)
sqrtarray = np.dot(v, np.dot(np.diag(w... | true | true |
f7f900a004a70ebc269357bed77d212a4a156452 | 14,176 | py | Python | tsai/models/TSTPlus.py | MOREDataset/tsai | 54987a579365ca7722475fff2fc4a24dc054e82c | [
"Apache-2.0"
] | null | null | null | tsai/models/TSTPlus.py | MOREDataset/tsai | 54987a579365ca7722475fff2fc4a24dc054e82c | [
"Apache-2.0"
] | null | null | null | tsai/models/TSTPlus.py | MOREDataset/tsai | 54987a579365ca7722475fff2fc4a24dc054e82c | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/108c_models.TSTPlus.ipynb (unless otherwise specified).
__all__ = ['SinCosPosEncoding', 'Coord2dPosEncoding', 'Coord1dPosEncoding', 'ScaledDotProductAttention',
'MultiHeadAttention', 'TSTEncoderLayer', 'TSTEncoder', 'TSTPlus', 'MultiTST']
# Cell
from ..import... | 49.051903 | 161 | 0.621755 |
__all__ = ['SinCosPosEncoding', 'Coord2dPosEncoding', 'Coord1dPosEncoding', 'ScaledDotProductAttention',
'MultiHeadAttention', 'TSTEncoderLayer', 'TSTEncoder', 'TSTPlus', 'MultiTST']
from ..imports import *
from ..utils import *
from .layers import *
from .utils import *
def SinCosPosEncoding(q_len, d_... | true | true |
f7f9015192572741b93dcf2a76b855f273eaa985 | 1,885 | py | Python | python-midonetclient/src/midonetclient/ip_addr_group.py | obino/midonet | 10cd954bec1290cf0c70aecaa1e13c91f1b008a6 | [
"Apache-2.0"
] | 221 | 2015-01-04T17:49:57.000Z | 2021-12-23T16:15:35.000Z | python-midonetclient/src/midonetclient/ip_addr_group.py | syseleven/midonet | e0b640c96d1a96177e8635112095a8546cdfa37c | [
"Apache-2.0"
] | 8 | 2018-05-24T13:36:03.000Z | 2021-02-19T16:01:43.000Z | python-midonetclient/src/midonetclient/ip_addr_group.py | syseleven/midonet | e0b640c96d1a96177e8635112095a8546cdfa37c | [
"Apache-2.0"
] | 95 | 2015-01-07T02:06:23.000Z | 2022-02-23T22:23:55.000Z |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Midokura PTE 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/LICEN... | 31.949153 | 77 | 0.667374 |
from midonetclient import ip_addr_group_addr
from midonetclient import resource_base
from midonetclient import vendor_media_type
class IpAddrGroup(resource_base.ResourceBase):
media_type = vendor_media_type.APPLICATION_IP_ADDR_GROUP_JSON
def __init__(self, uri, dto, auth):
super(I... | true | true |
f7f90189faf46bd4ef7740faaa5089554922c925 | 32,105 | py | Python | parser/fase2/team01/Grupo1/Librerias/storageManager/c3dGen.py | Gabriel-15/tytus | fb00718bf3fcc5211a3604fba1a551f44bdc6deb | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team01/Grupo1/Librerias/storageManager/c3dGen.py | Gabriel-15/tytus | fb00718bf3fcc5211a3604fba1a551f44bdc6deb | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team01/Grupo1/Librerias/storageManager/c3dGen.py | Gabriel-15/tytus | fb00718bf3fcc5211a3604fba1a551f44bdc6deb | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | # Package: C3D Gen
# License: Released under MIT License
# Notice: Copyright (c) 2020 TytusDB Team
# Developer: Team 01
import os
import json
import temporalesp as temposg
tempos = temposg.temporalesp()
path = 'c3d/'
#dataPath = path + 'databases'
##################
# Databas... | 40.383648 | 263 | 0.446099 |
import os
import json
import temporalesp as temposg
tempos = temposg.temporalesp()
path = 'c3d/'
os.incTemporal()
f.write(" t" + str(ilabel) + "= createDB(" + "t" + str(ilabel-1) + "" + ")\n")
f.write(" \n")
f.close()
return 0
exc... | true | true |
f7f90558156e48d2db7a90ffba5223496a2ef6c0 | 458 | py | Python | www/mobile/pcap2har/har.py | AutomationConsultant/webpagetest | 37aff455ea1b99ba319f6558a676c0e72ba6e1eb | [
"BSD-3-Clause"
] | 1 | 2017-09-24T13:59:56.000Z | 2017-09-24T13:59:56.000Z | www/mobile/pcap2har/har.py | AutomationConsultant/webpagetest | 37aff455ea1b99ba319f6558a676c0e72ba6e1eb | [
"BSD-3-Clause"
] | null | null | null | www/mobile/pcap2har/har.py | AutomationConsultant/webpagetest | 37aff455ea1b99ba319f6558a676c0e72ba6e1eb | [
"BSD-3-Clause"
] | null | null | null | """
functions and classes for generating HAR data from parsed http data
"""
import http
import logging
import simplejson as json
# custom json encoder
class JsonReprEncoder(json.JSONEncoder):
'''
Custom Json Encoder that attempts to call json_repr on every object it
encounters.
'''
def default(self, obj):
... | 24.105263 | 75 | 0.733624 | import http
import logging
import simplejson as json
class JsonReprEncoder(json.JSONEncoder):
def default(self, obj):
if hasattr(obj, 'json_repr'):
return obj.json_repr()
return json.JSONEncoder.default(self, obj)
| true | true |
f7f905ac5f3247bfbdabb9536e9345ff41b87012 | 7,057 | py | Python | eval_multipro.py | chenjun2hao/segmentation.pytorch | a319d0f006559dd58bd853065e6fe79ae8c23791 | [
"BSD-3-Clause"
] | 2 | 2021-03-30T12:51:15.000Z | 2021-03-31T02:39:14.000Z | eval_multipro.py | chenjun2hao/segmentation.pytorch | a319d0f006559dd58bd853065e6fe79ae8c23791 | [
"BSD-3-Clause"
] | null | null | null | eval_multipro.py | chenjun2hao/segmentation.pytorch | a319d0f006559dd58bd853065e6fe79ae8c23791 | [
"BSD-3-Clause"
] | null | null | null | # System libs
import os
import argparse
from distutils.version import LooseVersion
from multiprocessing import Queue, Process
# Numerical libs
import numpy as np
import math
import torch
import torch.nn as nn
from scipy.io import loadmat
# Our libs
from mit_semseg.config import cfg
from mit_semseg.dataset import ValDat... | 31.504464 | 115 | 0.646167 |
import os
import argparse
from distutils.version import LooseVersion
from multiprocessing import Queue, Process
import numpy as np
import math
import torch
import torch.nn as nn
from scipy.io import loadmat
from mit_semseg.config import cfg
from mit_semseg.dataset import ValDataset
from mit_semseg.models import Mode... | true | true |
f7f905fdb9be139b0f079498f55a01dfc8360e6c | 3,840 | py | Python | backend/app/init_test_data.py | wu-clan/fastapi_mysql_demo | efa3bdff73aa4d366da5f12dbb58c0221205e39b | [
"MIT"
] | null | null | null | backend/app/init_test_data.py | wu-clan/fastapi_mysql_demo | efa3bdff73aa4d366da5f12dbb58c0221205e39b | [
"MIT"
] | null | null | null | backend/app/init_test_data.py | wu-clan/fastapi_mysql_demo | efa3bdff73aa4d366da5f12dbb58c0221205e39b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import asyncio
from email_validator import EmailNotValidError, validate_email
from faker import Faker
from backend.app.datebase.db_mysql import db_session
from backend.app.models import User
from backend.app.common.log import log
from backend.app.api.jwt_security import ... | 29.312977 | 62 | 0.569271 |
import asyncio
from email_validator import EmailNotValidError, validate_email
from faker import Faker
from backend.app.datebase.db_mysql import db_session
from backend.app.models import User
from backend.app.common.log import log
from backend.app.api.jwt_security import get_hash_password
db = db_session()
class ... | true | true |
f7f9072287ea5e9b9965c70a954474c6ae29a058 | 5,004 | py | Python | ginga/cvw/CvHelp.py | chyan26/ginga | e00c887d8660e0a4178f9681ca7ea7784b7ca129 | [
"BSD-3-Clause"
] | 1 | 2019-04-27T01:34:27.000Z | 2019-04-27T01:34:27.000Z | ginga/cvw/CvHelp.py | chyan26/ginga | e00c887d8660e0a4178f9681ca7ea7784b7ca129 | [
"BSD-3-Clause"
] | null | null | null | ginga/cvw/CvHelp.py | chyan26/ginga | e00c887d8660e0a4178f9681ca7ea7784b7ca129 | [
"BSD-3-Clause"
] | null | null | null | #
# CvHelp.py -- help classes for the Cv drawing
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import numpy as np
import cv2
from ginga import colors
from ginga.fonts import font_asst
def get_cached_font(fontname, fontsize):
key = (fontname, fontsi... | 34.040816 | 75 | 0.605715 |
import numpy as np
import cv2
from ginga import colors
from ginga.fonts import font_asst
def get_cached_font(fontname, fontsize):
key = (fontname, fontsize)
try:
return font_asst.get_cache(key)
except KeyError:
info = font_asst.get_font_info(fontname, subst_ok=True)
... | true | true |
f7f9078107c1939db791d56780a432ef994073ea | 3,572 | py | Python | tensorflow/python/autograph/operators/__init__.py | fwtan/tensorflow | efa3fb28d94b7937edaafb5874c191ad0e2149ca | [
"Apache-2.0"
] | 1 | 2020-05-14T03:53:01.000Z | 2020-05-14T03:53:01.000Z | tensorflow/python/autograph/operators/__init__.py | fwtan/tensorflow | efa3fb28d94b7937edaafb5874c191ad0e2149ca | [
"Apache-2.0"
] | 2 | 2021-08-25T16:05:52.000Z | 2022-02-10T01:51:12.000Z | tensorflow/python/autograph/operators/__init__.py | taotesea/tensorflow | 5e6479904941624cf7ce58ab3d236375c8012ef4 | [
"Apache-2.0"
] | 1 | 2020-08-07T12:49:50.000Z | 2020-08-07T12:49:50.000Z | # Copyright 2018 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... | 54.121212 | 80 | 0.81047 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.autograph.operators.control_flow import for_stmt
from tensorflow.python.autograph.operators.control_flow import if_stmt
from tensorflow.python.autograph.opera... | true | true |
f7f909d58b8a77d036f474d253f03615abba9827 | 121,740 | py | Python | src/olympia/addons/tests/test_models.py | gponimansky/addons-server | 7013e50e0687b48bbd88c89fb8af867c1eca4843 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/tests/test_models.py | gponimansky/addons-server | 7013e50e0687b48bbd88c89fb8af867c1eca4843 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/tests/test_models.py | gponimansky/addons-server | 7013e50e0687b48bbd88c89fb8af867c1eca4843 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import os
import time
from datetime import datetime, timedelta
from waffle.testutils import override_switch
from django import forms
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core import mail
from django.core.files.storage im... | 39.195106 | 79 | 0.639256 |
import json
import os
import time
from datetime import datetime, timedelta
from waffle.testutils import override_switch
from django import forms
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core import mail
from django.core.files.storage import default_storage as... | true | true |
f7f90a0540bf0fec399a75e22bd5cc243b8cfd32 | 2,495 | py | Python | dj_rest_auth/forms.py | mka142/dj-rest-auth | cf750277edacf1a14ac270bd5e6463a74719ead2 | [
"MIT"
] | null | null | null | dj_rest_auth/forms.py | mka142/dj-rest-auth | cf750277edacf1a14ac270bd5e6463a74719ead2 | [
"MIT"
] | null | null | null | dj_rest_auth/forms.py | mka142/dj-rest-auth | cf750277edacf1a14ac270bd5e6463a74719ead2 | [
"MIT"
] | null | null | null |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
if 'allauth' in settings.INSTALLED_APPS:
from allauth.account import app_settings
from allauth.account.adapter import get_adapter
from allauth.account.forms import \
... | 38.984375 | 94 | 0.626052 |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
if 'allauth' in settings.INSTALLED_APPS:
from allauth.account import app_settings
from allauth.account.adapter import get_adapter
from allauth.account.forms import \
... | true | true |
f7f90a3583fd605043fb9cabd4286008020b0c89 | 3,554 | py | Python | testdata/common/cgroups.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 1,523 | 2015-01-01T03:42:24.000Z | 2022-02-06T22:24:04.000Z | testdata/common/cgroups.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 10 | 2015-01-09T06:46:05.000Z | 2022-03-29T21:57:57.000Z | testdata/common/cgroups.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 647 | 2015-01-02T04:01:40.000Z | 2022-03-30T15:57:35.000Z | #!/usr/bin/env impala-python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (... | 40.386364 | 88 | 0.735791 |
import os
import sys
import errno
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-s", "--cluster_size", type="int", dest="cluster_size", default=3,
help="Size of the cluster (number of impalad instances to start).")
def get_cpu_controller_root():
... | false | true |
f7f90ab8093b615c87e2065480a30e60ee540897 | 5,384 | py | Python | _unittest/test_31_Q3D.py | Samuelopez-ansys/pyaedt | 87df97641aeff02024e9d5756ae82d78bb4bc033 | [
"MIT"
] | null | null | null | _unittest/test_31_Q3D.py | Samuelopez-ansys/pyaedt | 87df97641aeff02024e9d5756ae82d78bb4bc033 | [
"MIT"
] | null | null | null | _unittest/test_31_Q3D.py | Samuelopez-ansys/pyaedt | 87df97641aeff02024e9d5756ae82d78bb4bc033 | [
"MIT"
] | null | null | null | import os
# Setup paths for module imports
from _unittest.conftest import scratch_path, local_path
import gc
# Import required modules
from pyaedt import Q3d, Q2d
from pyaedt.generic.filesystem import Scratch
test_project_name = "coax_Q3D"
bondwire_project_name = "bondwireq3d"
class TestClass:
def setup_class(... | 40.481203 | 111 | 0.66679 | import os
from _unittest.conftest import scratch_path, local_path
import gc
from pyaedt import Q3d, Q2d
from pyaedt.generic.filesystem import Scratch
test_project_name = "coax_Q3D"
bondwire_project_name = "bondwireq3d"
class TestClass:
def setup_class(self):
with Scratch(scratch_path) as sel... | true | true |
f7f90c6d5c788b9ab72e73ebedb40c4fab332b5a | 600 | py | Python | pythonhblib/hbrandlib.py | hbachchas/myexp | a5e055b9565d20b824210e4d18e260a569321971 | [
"MIT"
] | null | null | null | pythonhblib/hbrandlib.py | hbachchas/myexp | a5e055b9565d20b824210e4d18e260a569321971 | [
"MIT"
] | null | null | null | pythonhblib/hbrandlib.py | hbachchas/myexp | a5e055b9565d20b824210e4d18e260a569321971 | [
"MIT"
] | null | null | null | import math
import numpy.random as nprand
def get_rand_list(alist, th=.5):
"""
Breaks down the input list into two lists by randomly moving elements
Input: threshold is used
example: [list1, list2] = get_rand_list([1,2,3,4,5,6,7,8,9], 0.2);\\
list1 = 0.8, list2 = 0.2
"""
nlist = []
co... | 23.076923 | 73 | 0.58 | import math
import numpy.random as nprand
def get_rand_list(alist, th=.5):
nlist = []
counter = math.ceil( len(alist)*th )
while(counter):
num = nprand.randint(0,len(alist))
assert num < len(alist)
nlist.append( alist[num] )
alist.pop(num)
counter = cou... | true | true |
f7f90c9689aab51534d1ab3ed46ca29f8349b052 | 1,727 | py | Python | pype/hosts/resolve/plugins/publish/collect_workfile.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/hosts/resolve/plugins/publish/collect_workfile.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/hosts/resolve/plugins/publish/collect_workfile.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | import pyblish.api
from pype.hosts import resolve
from avalon import api as avalon
from pprint import pformat
# dev
from importlib import reload
from pype.hosts.resolve.otio import davinci_export
reload(davinci_export)
class CollectWorkfile(pyblish.api.ContextPlugin):
"""Inject the current working file into cont... | 31.4 | 77 | 0.640996 | import pyblish.api
from pype.hosts import resolve
from avalon import api as avalon
from pprint import pformat
from importlib import reload
from pype.hosts.resolve.otio import davinci_export
reload(davinci_export)
class CollectWorkfile(pyblish.api.ContextPlugin):
label = "Collect Workfile"
order = pyblish.a... | true | true |
f7f90ccf566c15fd7b12d22dc94c7d9c8f2c00ff | 10,426 | py | Python | docs/conf.py | huanghua1994/FMM3D | 0f635079b0c0468c0544648780b83902d66fb13a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | huanghua1994/FMM3D | 0f635079b0c0468c0544648780b83902d66fb13a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | huanghua1994/FMM3D | 0f635079b0c0468c0544648780b83902d66fb13a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# fmm3d documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 1 16:19:13 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 33.7411 | 216 | 0.716766 |
import sys
import os
import sphinx.ext.autodoc
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('sphinxext'))
sys.path.insert(0,os.path.abspath('../../texext'))
nsions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',... | true | true |
f7f90d3a53db73f2706a7a910f1d6609cc798e4f | 1,192 | py | Python | Assignments 2/question3.py | rohitmalik10/MOJOwork | 8767a39b4397032b98d878bbc9aea7642a83f75c | [
"Apache-2.0"
] | null | null | null | Assignments 2/question3.py | rohitmalik10/MOJOwork | 8767a39b4397032b98d878bbc9aea7642a83f75c | [
"Apache-2.0"
] | null | null | null | Assignments 2/question3.py | rohitmalik10/MOJOwork | 8767a39b4397032b98d878bbc9aea7642a83f75c | [
"Apache-2.0"
] | null | null | null | import requests
import json
url = "https://awm16002.srv.wifi.arista.com/new/webservice/login/modScanWifi/86400"
payload = "{\n\"type\":\"apikeycredentials\",\n\"keyId\":\"KEY-ATN565039-674\",\n\"keyValue\":\"16d7b32456a7700568d359fa452818bd\"\n}"
headers1 = {
'Content-Type': "application/json",
'cache-control... | 31.368421 | 134 | 0.697987 | import requests
import json
url = "https://awm16002.srv.wifi.arista.com/new/webservice/login/modScanWifi/86400"
payload = "{\n\"type\":\"apikeycredentials\",\n\"keyId\":\"KEY-ATN565039-674\",\n\"keyValue\":\"16d7b32456a7700568d359fa452818bd\"\n}"
headers1 = {
'Content-Type': "application/json",
'cache-control... | true | true |
f7f90d3c3725723f59c631163e5506ce02225ba9 | 146 | py | Python | item_engine/lin_dag_network/constants.py | GabrielAmare/TextEngine | 39ceb323a63af35e32c4be34ae35a77e811bc973 | [
"MIT"
] | null | null | null | item_engine/lin_dag_network/constants.py | GabrielAmare/TextEngine | 39ceb323a63af35e32c4be34ae35a77e811bc973 | [
"MIT"
] | null | null | null | item_engine/lin_dag_network/constants.py | GabrielAmare/TextEngine | 39ceb323a63af35e32c4be34ae35a77e811bc973 | [
"MIT"
] | null | null | null | from typing import TypeVar
from ..elements import Element
__all__ = ["E", "F"]
E = TypeVar("E", bound=Element)
F = TypeVar("F", bound=Element)
| 16.222222 | 31 | 0.678082 | from typing import TypeVar
from ..elements import Element
__all__ = ["E", "F"]
E = TypeVar("E", bound=Element)
F = TypeVar("F", bound=Element)
| true | true |
f7f90de8f73ea29de48c5fb2f56ea65818c0886a | 2,763 | py | Python | aws_parsecf/parser.py | dklawson/aws-parsecf | 0ef89231821bd5848acff0e0646f45c414e0b340 | [
"MIT"
] | 10 | 2018-04-08T23:25:19.000Z | 2021-04-30T01:50:07.000Z | aws_parsecf/parser.py | dklawson/aws-parsecf | 0ef89231821bd5848acff0e0646f45c414e0b340 | [
"MIT"
] | 3 | 2018-06-04T15:17:56.000Z | 2020-03-17T22:51:07.000Z | aws_parsecf/parser.py | dklawson/aws-parsecf | 0ef89231821bd5848acff0e0646f45c414e0b340 | [
"MIT"
] | 7 | 2017-07-12T06:01:21.000Z | 2021-06-17T12:36:26.000Z | from aws_parsecf.common import DELETE
from aws_parsecf.conditions import Conditions
from aws_parsecf.functions import Functions
class Parser:
def __init__(self, root, default_region, parameters={}):
self.functions = Functions(self, root, default_region, parameters)
self.conditions = Conditions(self... | 37.849315 | 103 | 0.522258 | from aws_parsecf.common import DELETE
from aws_parsecf.conditions import Conditions
from aws_parsecf.functions import Functions
class Parser:
def __init__(self, root, default_region, parameters={}):
self.functions = Functions(self, root, default_region, parameters)
self.conditions = Conditions(self... | true | true |
f7f90df69d452181e45fc33f58bfab087715e8da | 5,324 | py | Python | voila/execute.py | catethos/voila | 621c4375533ddb1afd70256765474a9f9a06a0c0 | [
"BSD-3-Clause"
] | 1 | 2019-06-27T11:26:14.000Z | 2019-06-27T11:26:14.000Z | voila/execute.py | silky/voila | 74a186f745fe609271e79de0d8a0153b6f4d3438 | [
"BSD-3-Clause"
] | null | null | null | voila/execute.py | silky/voila | 74a186f745fe609271e79de0d8a0153b6f4d3438 | [
"BSD-3-Clause"
] | null | null | null | from nbconvert.preprocessors.execute import ExecutePreprocessor
from ipykernel.jsonutil import json_clean
class OutputWidget:
"""This class mimics a front end output widget"""
def __init__(self, comm_id, state, kernel_client, executor):
self.comm_id = comm_id
self.state = state
self.ke... | 44.366667 | 117 | 0.627911 | from nbconvert.preprocessors.execute import ExecutePreprocessor
from ipykernel.jsonutil import json_clean
class OutputWidget:
def __init__(self, comm_id, state, kernel_client, executor):
self.comm_id = comm_id
self.state = state
self.kernel_client = kernel_client
self.executor = ex... | true | true |
f7f90e13b9ee05d0c14d79f6245a3073660c6bd4 | 7,337 | py | Python | mmpose/models/losses/mse_loss.py | fourierer/mmpose | 1b481a4e46cea7cf47e01669d61ac4670f361e07 | [
"Apache-2.0"
] | null | null | null | mmpose/models/losses/mse_loss.py | fourierer/mmpose | 1b481a4e46cea7cf47e01669d61ac4670f361e07 | [
"Apache-2.0"
] | null | null | null | mmpose/models/losses/mse_loss.py | fourierer/mmpose | 1b481a4e46cea7cf47e01669d61ac4670f361e07 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from ..registry import LOSSES
@LOSSES.register_module()
class JointsMSELoss(nn.Module):
"""MSE loss for heatmaps.
Args:
use_target_weight (bool): Option to use weighted MSE loss.
Different joint types may have different target weights.
"""
def ... | 37.433673 | 88 | 0.589751 | import torch
import torch.nn as nn
from ..registry import LOSSES
@LOSSES.register_module()
class JointsMSELoss(nn.Module):
def __init__(self, use_target_weight=False):
super().__init__()
self.criterion = nn.MSELoss()
self.use_target_weight = use_target_weight
def forward(self, outpu... | true | true |
f7f90e9473d82089eca1a34d6b4b53d614979092 | 8,125 | py | Python | venv/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/oursql.py | tchengatcincoai/cryptocoin-prices-compare | f295fecc7213a877bf717af0eb98414e9137b554 | [
"MIT"
] | 78 | 2017-08-19T03:46:13.000Z | 2020-02-19T04:29:45.000Z | virtual/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/oursql.py | annstella/blog | 1cdb7e7e7df028a84fae9b7d901116aae577589d | [
"MIT"
] | 95 | 2018-01-31T20:28:13.000Z | 2018-04-10T01:55:35.000Z | virtual/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/oursql.py | annstella/blog | 1cdb7e7e7df028a84fae9b7d901116aae577589d | [
"MIT"
] | 43 | 2018-02-05T23:23:46.000Z | 2021-07-28T22:51:42.000Z | # mysql/oursql.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+oursql
:name: OurSQL
:dbapi: oursql
:connectstri... | 31.862745 | 77 | 0.621046 |
import re
from .base import (BIT, MySQLDialect, MySQLExecutionContext)
from ... import types as sqltypes, util
class _oursqlBIT(BIT):
def result_processor(self, dialect, coltype):
return None
class MySQLExecutionContext_oursql(MySQLExecutionContext):
@property
def plain_query(self):
... | true | true |
f7f90fbd4fb9163471ae66d5d83c92e61ae9d1d4 | 516 | py | Python | hatefull/apps/tests/models.py | MauricioDinki/hatefull | fdefd69251ea136798ff483bfa90a3b08a871ec7 | [
"BSD-3-Clause"
] | null | null | null | hatefull/apps/tests/models.py | MauricioDinki/hatefull | fdefd69251ea136798ff483bfa90a3b08a871ec7 | [
"BSD-3-Clause"
] | null | null | null | hatefull/apps/tests/models.py | MauricioDinki/hatefull | fdefd69251ea136798ff483bfa90a3b08a871ec7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from hatefull.apps.questions.models import Question
class Test(models.Model):
user = models.ForeignKey(
User,
verbose_name='User',
blank=False,
null=False,
)
... | 20.64 | 51 | 0.631783 |
from django.contrib.auth.models import User
from django.db import models
from hatefull.apps.questions.models import Question
class Test(models.Model):
user = models.ForeignKey(
User,
verbose_name='User',
blank=False,
null=False,
)
name = models.CharField(
blank=F... | true | true |
f7f9114bcce5c7358fdb6de76cbc16378aef9ff6 | 21,658 | py | Python | devices/openwrt_router.py | GerbenChenCBN/boardfarm | d83dc09ee0f4db044e4b7a7e727cd7d0704e0a3c | [
"BSD-3-Clause-Clear"
] | null | null | null | devices/openwrt_router.py | GerbenChenCBN/boardfarm | d83dc09ee0f4db044e4b7a7e727cd7d0704e0a3c | [
"BSD-3-Clause-Clear"
] | null | null | null | devices/openwrt_router.py | GerbenChenCBN/boardfarm | d83dc09ee0f4db044e4b7a7e727cd7d0704e0a3c | [
"BSD-3-Clause-Clear"
] | 1 | 2020-03-05T01:58:34.000Z | 2020-03-05T01:58:34.000Z | # Copyright (c) 2015
#
# All rights reserved.
#
# This file is distributed under the Clear BSD license.
# The full text can be found in LICENSE in the root directory.
import atexit
import os
import os.path
import random
import signal
import socket
import sys
import urllib2
import pexpect
import base
from datetime impo... | 39.093863 | 154 | 0.575122 |
import atexit
import os
import os.path
import random
import signal
import socket
import sys
import urllib2
import pexpect
import base
from datetime import datetime
import ipaddress
import power
import common
import connection_decider
class OpenWrtRouter(base.BaseDevice):
'''
Args:
model: Examples... | false | true |
f7f9164efff6d52516815096462e484ab74c68bb | 7,128 | py | Python | tests/test_widgets.py | KyleGW/gopro-dashboard-overlay | 0bc244dccfc0046e680876e91541de81c54f7477 | [
"MIT"
] | null | null | null | tests/test_widgets.py | KyleGW/gopro-dashboard-overlay | 0bc244dccfc0046e680876e91541de81c54f7477 | [
"MIT"
] | null | null | null | tests/test_widgets.py | KyleGW/gopro-dashboard-overlay | 0bc244dccfc0046e680876e91541de81c54f7477 | [
"MIT"
] | null | null | null | import random
from datetime import timedelta
from PIL import ImageFont
from gopro_overlay import fake
from gopro_overlay.dimensions import Dimension
from gopro_overlay.layout import BigMetric, gps_info
from gopro_overlay.layout_components import text, metric
from gopro_overlay.point import Coordinate
from gopro_overl... | 31.400881 | 120 | 0.575898 | import random
from datetime import timedelta
from PIL import ImageFont
from gopro_overlay import fake
from gopro_overlay.dimensions import Dimension
from gopro_overlay.layout import BigMetric, gps_info
from gopro_overlay.layout_components import text, metric
from gopro_overlay.point import Coordinate
from gopro_overl... | true | true |
f7f91764a81371107a333003e63f98bef4c3bace | 2,281 | py | Python | uwsgi_tasks/decorators.py | zanachka/uwsgi_tasks | cad3e72c8bd66979c6ac23a1cc68caff176435ab | [
"MIT"
] | 92 | 2015-01-21T06:25:18.000Z | 2022-02-23T22:29:05.000Z | uwsgi_tasks/decorators.py | zanachka/uwsgi_tasks | cad3e72c8bd66979c6ac23a1cc68caff176435ab | [
"MIT"
] | 17 | 2015-04-30T21:02:05.000Z | 2021-03-09T17:30:00.000Z | uwsgi_tasks/decorators.py | zanachka/uwsgi_tasks | cad3e72c8bd66979c6ac23a1cc68caff176435ab | [
"MIT"
] | 13 | 2015-04-30T20:54:36.000Z | 2022-02-12T17:06:15.000Z | # -*- coding: utf-8 -*-
from uwsgi_tasks.tasks import Task, TaskExecutor, TimerTask, CronTask
__all__ = ('task', 'timer', 'timer_lazy', 'cron', 'cron_lazy')
def task(func=None, executor=TaskExecutor.AUTO, **setup):
def create_task(function):
return Task(function, executor, **setup)
if callable(func... | 23.515464 | 74 | 0.562911 |
from uwsgi_tasks.tasks import Task, TaskExecutor, TimerTask, CronTask
__all__ = ('task', 'timer', 'timer_lazy', 'cron', 'cron_lazy')
def task(func=None, executor=TaskExecutor.AUTO, **setup):
def create_task(function):
return Task(function, executor, **setup)
if callable(func):
return creat... | true | true |
f7f9177527f4f51d7b3ba22fe9cbe8733ddaaee6 | 16,878 | py | Python | ivi/agilent/agilentBase8340.py | sacherjj/python-ivi | 6dd1ba93d65dc30a652a3a1b34c66921d94315e8 | [
"MIT"
] | 161 | 2015-01-23T17:43:01.000Z | 2022-03-29T14:42:42.000Z | ivi/agilent/agilentBase8340.py | sacherjj/python-ivi | 6dd1ba93d65dc30a652a3a1b34c66921d94315e8 | [
"MIT"
] | 45 | 2015-01-15T13:35:04.000Z | 2021-06-03T01:58:55.000Z | ivi/agilent/agilentBase8340.py | sacherjj/python-ivi | 6dd1ba93d65dc30a652a3a1b34c66921d94315e8 | [
"MIT"
] | 87 | 2015-01-31T10:55:23.000Z | 2022-03-17T08:18:47.000Z | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | 36.851528 | 99 | 0.691077 |
from .. import ivi
from .. import rfsiggen
from .. import extra
class agilentBase8340(rfsiggen.Base, rfsiggen.ModulateAM, rfsiggen.ModulateFM,
rfsiggen.ModulatePulse, rfsiggen.Sweep, rfsiggen.FrequencySweep, rfsiggen.PowerSweep,
extra.common.Memory,
extra.common.SystemSetup,
ivi.Driver... | true | true |
f7f917cf3dbc3931977727128198cdddbd382e8a | 4,623 | py | Python | keras_retinanet/callbacks/eval.py | hunglvfimo/keras-retinanet | af5948a1d52edf30f2eb50d7332a6a3a9971ad66 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/callbacks/eval.py | hunglvfimo/keras-retinanet | af5948a1d52edf30f2eb50d7332a6a3a9971ad66 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/callbacks/eval.py | hunglvfimo/keras-retinanet | af5948a1d52edf30f2eb50d7332a6a3a9971ad66 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 39.853448 | 118 | 0.625784 |
import keras
from ..utils.eval import evaluate
import os
import csv
class Evaluate(keras.callbacks.Callback):
def __init__(
self,
generator,
iou_threshold=0.5,
score_threshold=0.05,
max_detections=100,
save_path=None,
tensorboard=None,
csv_logger=N... | true | true |
f7f919252b012f3c42c96d0559257130df289fc9 | 5,508 | py | Python | pypureclient/flasharray/FA_2_3/models/protection_group_snapshot_transfer_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_3/models/protection_group_snapshot_transfer_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_3/models/protection_group_snapshot_transfer_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 40.5 | 524 | 0.629085 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_3 import models
class ProtectionGroupSnapshotTransferGetResponse(object):
swagger_types = {
'more_items_remaining': 'bool',
'total_item_count': '... | true | true |
f7f91a28ad3a3759a0901289e41eb13277be61e7 | 3,072 | py | Python | data_preprocess.py | alexandrumeterez/talkwithmete | dc027a35b6b8b6dfdb9a86ccd5a3284e332a54b7 | [
"MIT"
] | null | null | null | data_preprocess.py | alexandrumeterez/talkwithmete | dc027a35b6b8b6dfdb9a86ccd5a3284e332a54b7 | [
"MIT"
] | null | null | null | data_preprocess.py | alexandrumeterez/talkwithmete | dc027a35b6b8b6dfdb9a86ccd5a3284e332a54b7 | [
"MIT"
] | null | null | null | import unicodedata
import re
from voc import Voc
MAX_LENGTH = 50 # Maximum sentence length to consider
# Turn a Unicode string to plain ASCII, thanks to
# http://stackoverflow.com/a/518232/2809427
def unicodeToAscii(s):
return ''.join(
c for c in unicodedata.normalize('NFD', s)
if unicodedata.ca... | 33.391304 | 95 | 0.629557 | import unicodedata
import re
from voc import Voc
MAX_LENGTH = 50
def unicodeToAscii(s):
return ''.join(
c for c in unicodedata.normalize('NFD', s)
if unicodedata.category(c) != 'Mn'
)
def normalizeString(s):
s = unicodeToAscii(s.lower().strip())
s = re.sub(r"([.!?])", r" \1", s... | true | true |
f7f91be39c48179d45fa6f9c2acb5819e494b0c2 | 1,863 | py | Python | warGame.py | f-forte-carpio/PyCards | 9b0c1a9fab068c1597209d81a4c50ee349b21342 | [
"Unlicense"
] | null | null | null | warGame.py | f-forte-carpio/PyCards | 9b0c1a9fab068c1597209d81a4c50ee349b21342 | [
"Unlicense"
] | null | null | null | warGame.py | f-forte-carpio/PyCards | 9b0c1a9fab068c1597209d81a4c50ee349b21342 | [
"Unlicense"
] | null | null | null | import pygame as Pg
import CardGameBasicFrame as Cg
players = Cg.give_cards(2, 26)
print('Welcome to the card game War')
Pg.init()
surface=Pg.display.set_mode((100,100))
def main():
def check_cards(index):
p1 = players[0][index][1]
p2 = players[1][index][1]
print("player 1's dr... | 31.576271 | 103 | 0.457327 | import pygame as Pg
import CardGameBasicFrame as Cg
players = Cg.give_cards(2, 26)
print('Welcome to the card game War')
Pg.init()
surface=Pg.display.set_mode((100,100))
def main():
def check_cards(index):
p1 = players[0][index][1]
p2 = players[1][index][1]
print("player 1's dr... | true | true |
f7f91e3af56179c30d291b22ea147491cd6e61e3 | 1,287 | py | Python | 107 Binary Tree Level Order Traversal II.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | 107 Binary Tree Level Order Traversal II.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | 107 Binary Tree Level Order Traversal II.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | """
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by
level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ \
9 20
/ \
15 7
return its bottom-up level order traversal as:
[
[15,7],
[9,20],
[3]
]
""... | 20.758065 | 140 | 0.566434 | __author__ = 'Danyang'
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def levelOrderBottom(self, root):
if not root:
return []
result = []
next_level = [root]
while next_level:
... | true | true |
f7f91e8d1f21cacff6ca3536401360aa17ebea6b | 8,373 | py | Python | breathe-easy.py | shuvrag/breathe-easy | 0d20e5f7a81669e1e2f298fb8999837310c0593c | [
"MIT"
] | null | null | null | breathe-easy.py | shuvrag/breathe-easy | 0d20e5f7a81669e1e2f298fb8999837310c0593c | [
"MIT"
] | null | null | null | breathe-easy.py | shuvrag/breathe-easy | 0d20e5f7a81669e1e2f298fb8999837310c0593c | [
"MIT"
] | null | null | null | import streamlit as st
import pandas as pd
import numpy as np
import datetime
from datetime import timedelta
import plotly.graph_objects as go
timechoice = [' ', '00:00:00', '01:00:00', '02:00:00', '03:00:00',
'04:00:00', '05:00:00', '06:00:00', '07:00:00',
'08:00:00', '09:00:00', '10:00:00', '11:00:00',
'12:0... | 31.958015 | 123 | 0.482862 | import streamlit as st
import pandas as pd
import numpy as np
import datetime
from datetime import timedelta
import plotly.graph_objects as go
timechoice = [' ', '00:00:00', '01:00:00', '02:00:00', '03:00:00',
'04:00:00', '05:00:00', '06:00:00', '07:00:00',
'08:00:00', '09:00:00', '10:00:00', '11:00:00',
'12:0... | true | true |
f7f91ea58a510a63d8feeffbe35f9df98ff60938 | 784 | py | Python | sample_code/chains.py | Nov05/Lambda-Blockchain | 6aee033969c0ba587198daa2bedbc89f75d87c0c | [
"MIT"
] | null | null | null | sample_code/chains.py | Nov05/Lambda-Blockchain | 6aee033969c0ba587198daa2bedbc89f75d87c0c | [
"MIT"
] | null | null | null | sample_code/chains.py | Nov05/Lambda-Blockchain | 6aee033969c0ba587198daa2bedbc89f75d87c0c | [
"MIT"
] | null | null | null | import random
def longest_linked_list_chain(keys, buckets, loops=10):
"""
Roll keys number of keys into buckets number of random buckets
and count collisions
"""
for i in range(loops):
key_counts = {}
for i in range(buckets):
key_counts[i] = 0
for i in range(key... | 28 | 127 | 0.59949 | import random
def longest_linked_list_chain(keys, buckets, loops=10):
for i in range(loops):
key_counts = {}
for i in range(buckets):
key_counts[i] = 0
for i in range(keys):
random_key = str(random.random())
hash_index = hash(random_key) % buckets
... | true | true |
f7f91f033bd6cc73c04ba7bc1b09a753616f98d4 | 697 | py | Python | tests/check_style.py | flysky2008/autogluon | 7ad9e5601cf17e616950ae7ef2e84d77b04832e4 | [
"Apache-2.0"
] | null | null | null | tests/check_style.py | flysky2008/autogluon | 7ad9e5601cf17e616950ae7ef2e84d77b04832e4 | [
"Apache-2.0"
] | null | null | null | tests/check_style.py | flysky2008/autogluon | 7ad9e5601cf17e616950ae7ef2e84d77b04832e4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Check style"""
import sys
from subprocess import Popen, PIPE
import logging
def main():
logging.getLogger().setLevel(logging.INFO)
logging.info("PEP8 Style check")
flake8_proc = Popen(['flake8', '--count'], stdout=PIPE)
flake8_out = flake8_proc.communi... | 25.814815 | 87 | 0.652798 |
import sys
from subprocess import Popen, PIPE
import logging
def main():
logging.getLogger().setLevel(logging.INFO)
logging.info("PEP8 Style check")
flake8_proc = Popen(['flake8', '--count'], stdout=PIPE)
flake8_out = flake8_proc.communicate()[0]
lines = flake8_out.splitlines()
count = int(l... | true | true |
f7f91f4ce0a2b0628f58e9cbecebbecd93ec5caf | 6,584 | py | Python | src/grammar_learner/learner.py | akolonin/language-learning | 022c34a3066aa97ea0d007419e026247a4f78dd5 | [
"MIT"
] | null | null | null | src/grammar_learner/learner.py | akolonin/language-learning | 022c34a3066aa97ea0d007419e026247a4f78dd5 | [
"MIT"
] | null | null | null | src/grammar_learner/learner.py | akolonin/language-learning | 022c34a3066aa97ea0d007419e026247a4f78dd5 | [
"MIT"
] | null | null | null | # language-learning/src/learner.py # 81213
import os, time # pickle, numpy as np, pandas as pd
from copy import deepcopy
from shutil import copy2 as copy
from collections import OrderedDict, Counter
from .utl import UTC, kwa, sec2string
from .read_files import check_dir, check_mst_... | 41.670886 | 98 | 0.652491 | os, time
from copy import deepcopy
from shutil import copy2 as copy
from collections import OrderedDict, Counter
from .utl import UTC, kwa, sec2string
from .read_files import check_dir, check_mst_files
from .pparser import files2links
from .category_learner import learn_categories, cats2list
from .grammar_inducer ... | true | true |
f7f91f67c6600a226adbc4ca765b9b3d3d9badbe | 2,725 | py | Python | py_iex/stats.py | jxzym25/py_iex | 0808dff2fd31f3a30a7e1fd1adc38e9ac486d5fd | [
"MIT"
] | 1 | 2018-03-19T06:30:11.000Z | 2018-03-19T06:30:11.000Z | py_iex/stats.py | jxzym25/py_iex | 0808dff2fd31f3a30a7e1fd1adc38e9ac486d5fd | [
"MIT"
] | null | null | null | py_iex/stats.py | jxzym25/py_iex | 0808dff2fd31f3a30a7e1fd1adc38e9ac486d5fd | [
"MIT"
] | null | null | null | from .iex import IEX
class Stats(IEX):
@IEX._call_api_on_func
def get_intraday(self):
"""
Returns intraday statistics
"""
_FUNCTION_KEYS = ("stats", "intraday")
return _FUNCTION_KEYS
@IEX._call_api_on_func
def get_recent(self):
"""
This call will... | 40.671642 | 170 | 0.602202 | from .iex import IEX
class Stats(IEX):
@IEX._call_api_on_func
def get_intraday(self):
_FUNCTION_KEYS = ("stats", "intraday")
return _FUNCTION_KEYS
@IEX._call_api_on_func
def get_recent(self):
_FUNCTION_KEYS = ("stats", "recent")
return _FUNCTION_KEYS
@IEX._call_api... | true | true |
f7f91f8630c3f524d35f2a305adc8ffc5c0ff0cb | 380 | py | Python | accounts/serializers.py | akahard2dj/DjangoBlackberry | 4e732d8650dc7d61cd79033d5072d836707b411f | [
"MIT"
] | null | null | null | accounts/serializers.py | akahard2dj/DjangoBlackberry | 4e732d8650dc7d61cd79033d5072d836707b411f | [
"MIT"
] | null | null | null | accounts/serializers.py | akahard2dj/DjangoBlackberry | 4e732d8650dc7d61cd79033d5072d836707b411f | [
"MIT"
] | null | null | null | from rest_framework import serializers
from accounts.models import Berry
class BerrySerializer(serializers.ModelSerializer):
class Meta:
model = Berry
fields = ('id', 'email', 'nickname', 'created_at')
class BerryListSerializer(serializers.ModelSerializer):
class Meta:
model = Berry... | 23.75 | 58 | 0.684211 | from rest_framework import serializers
from accounts.models import Berry
class BerrySerializer(serializers.ModelSerializer):
class Meta:
model = Berry
fields = ('id', 'email', 'nickname', 'created_at')
class BerryListSerializer(serializers.ModelSerializer):
class Meta:
model = Berry... | true | true |
f7f91ff5720693ef2b071e117d6f40ac1d0ca390 | 171 | py | Python | tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['RelativeDifference'] , ['ConstantTrend'] , ['BestCycle'] , ['LSTM'] ); | 42.75 | 93 | 0.766082 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['RelativeDifference'] , ['ConstantTrend'] , ['BestCycle'] , ['LSTM'] ); | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.