hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c40b043448434c4bb46287fef9905573f19eb92 | 13,765 | py | Python | mycroft/enclosure/api.py | chrisveilleux/mycroft-core | 32557365daf69d6a5a3cb6fcf3d748abe58b6261 | [
"Apache-2.0"
] | 1 | 2020-09-03T22:33:42.000Z | 2020-09-03T22:33:42.000Z | mycroft/enclosure/api.py | xeddmc/mycroft-core | d6cbccc0cbfbf6b540830aab4c15a32adf67b9bf | [
"Apache-2.0"
] | 2 | 2021-09-08T01:43:29.000Z | 2022-01-13T02:20:19.000Z | mycroft/enclosure/api.py | felipehmsilveira/mycroft-ai | 8b1997e9444d0d672eded29de63bee54c7933b08 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Mycroft AI 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 writin... | 42.094801 | 79 | 0.532655 | from .display_manager import DisplayManager
from mycroft.messagebus.message import Message
class EnclosureAPI:
def __init__(self, bus, name=""):
self.bus = bus
self.name = name
self.display_manager = DisplayManager(self.name)
def register(self, skill_name=""):
if self.name ... | true | true |
1c40b10981b4e2f7eb853180abe5bc8bdf77cde1 | 416 | py | Python | Project Πολυδιάστατες Δομές Δεδομένων/KD_Tree/rebalance.py | DimosthenisMich/UndergraduateCeidProjects | 9f99f2c44e41d06020f3a5e9aacc0cd4357ee833 | [
"MIT"
] | 6 | 2021-02-10T18:31:22.000Z | 2022-03-03T17:49:30.000Z | Project Πολυδιάστατες Δομές Δεδομένων/KD_Tree/rebalance.py | DimosthenisMich/UndergraduateCeidProjects | 9f99f2c44e41d06020f3a5e9aacc0cd4357ee833 | [
"MIT"
] | 1 | 2020-09-30T19:16:39.000Z | 2020-09-30T19:16:39.000Z | Project Πολυδιάστατες Δομές Δεδομένων/KD_Tree/rebalance.py | DimitrisKostorrizos/UndergraduateCeidProjects | 9f99f2c44e41d06020f3a5e9aacc0cd4357ee833 | [
"MIT"
] | 5 | 2021-11-24T21:34:15.000Z | 2022-01-23T22:37:35.000Z | import medianBuild
rebuildPoints = []
dimensions = 2
def gatherTreeNodes(node):
if node is None:
return False
rebuildPoints.append(node.node)
return gatherTreeNodes(node.leftChild), gatherTreeNodes(node.rightChild)
def balanceKdTree(node):
gatherTreeNodes(node) # Gather all the nodes of th... | 23.111111 | 76 | 0.733173 | import medianBuild
rebuildPoints = []
dimensions = 2
def gatherTreeNodes(node):
if node is None:
return False
rebuildPoints.append(node.node)
return gatherTreeNodes(node.leftChild), gatherTreeNodes(node.rightChild)
def balanceKdTree(node):
gatherTreeNodes(node) root = medianBuild.kdTre... | true | true |
1c40b10c25701cd181b5ae1f090d71667f6b3c12 | 9,289 | py | Python | f5_cccl/service/test/test_service_manager.py | f5yacobucci/f5-cccl | 64e7fa0a6d4ead9b5209b5b46bf4ed1b6cef036a | [
"Apache-2.0"
] | null | null | null | f5_cccl/service/test/test_service_manager.py | f5yacobucci/f5-cccl | 64e7fa0a6d4ead9b5209b5b46bf4ed1b6cef036a | [
"Apache-2.0"
] | null | null | null | f5_cccl/service/test/test_service_manager.py | f5yacobucci/f5-cccl | 64e7fa0a6d4ead9b5209b5b46bf4ed1b6cef036a | [
"Apache-2.0"
] | 1 | 2019-11-02T05:22:48.000Z | 2019-11-02T05:22:48.000Z | #!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | 37.156 | 76 | 0.668533 |
import json
import pickle
import pytest
from f5_cccl.test.conftest import bigip_proxy
from f5_cccl.resource.ltm.app_service import ApplicationService
from f5_cccl.resource.ltm.virtual import VirtualServer
from f5_cccl.resource.ltm.pool import Pool
from f5_cccl.resource.ltm.monitor.http_monitor import HTTPMonitor
... | true | true |
1c40b187ffe264ce102883fdd6f745650f5432a9 | 549 | py | Python | tests/functional_tests/to_constant_tests/test_definition.py | lycantropos/lz | 632baaffc1c62cd644f6e67f0bcd7971ae6580da | [
"MIT"
] | 7 | 2019-05-26T15:30:03.000Z | 2022-03-07T16:00:31.000Z | tests/functional_tests/to_constant_tests/test_definition.py | lycantropos/lz | 632baaffc1c62cd644f6e67f0bcd7971ae6580da | [
"MIT"
] | 29 | 2018-11-12T11:45:56.000Z | 2021-05-04T17:24:45.000Z | tests/functional_tests/to_constant_tests/test_definition.py | lycantropos/lz | 632baaffc1c62cd644f6e67f0bcd7971ae6580da | [
"MIT"
] | null | null | null | from typing import (Any,
Dict,
Tuple)
from hypothesis import given
from lz.functional import to_constant
from tests import strategies
@given(strategies.scalars,
strategies.positionals_arguments,
strategies.keywords_arguments)
def test_basic(object_: Any,
... | 24.954545 | 65 | 0.672131 | from typing import (Any,
Dict,
Tuple)
from hypothesis import given
from lz.functional import to_constant
from tests import strategies
@given(strategies.scalars,
strategies.positionals_arguments,
strategies.keywords_arguments)
def test_basic(object_: Any,
... | true | true |
1c40b19329458681621f933a54d265735457c0f6 | 863 | py | Python | metecho/api/management/commands/tests/truncate_data.py | VaccineCloud/Metecho-Vax | 48762a2b5bb53d0d5633d1871e4f1451f5e3e91c | [
"BSD-3-Clause"
] | 1 | 2021-12-09T20:39:01.000Z | 2021-12-09T20:39:01.000Z | metecho/api/management/commands/tests/truncate_data.py | VaccineCloud/Metecho-Vax | 48762a2b5bb53d0d5633d1871e4f1451f5e3e91c | [
"BSD-3-Clause"
] | 1,613 | 2020-03-26T16:39:57.000Z | 2022-03-07T14:54:16.000Z | metecho/api/management/commands/tests/truncate_data.py | VaccineCloud/Metecho-Vax | 48762a2b5bb53d0d5633d1871e4f1451f5e3e91c | [
"BSD-3-Clause"
] | 2 | 2021-04-09T18:51:10.000Z | 2022-01-04T20:32:48.000Z | import pytest
from django.core.management import call_command
from ....models import Epic, Project, ProjectSlug, Task
@pytest.mark.django_db
def test_truncate_data(project_factory, epic_factory, task_factory):
project_factory(repo_owner="test", repo_name="repo")
project_factory(repo_owner="test", repo_name="... | 31.962963 | 68 | 0.735805 | import pytest
from django.core.management import call_command
from ....models import Epic, Project, ProjectSlug, Task
@pytest.mark.django_db
def test_truncate_data(project_factory, epic_factory, task_factory):
project_factory(repo_owner="test", repo_name="repo")
project_factory(repo_owner="test", repo_name="... | true | true |
1c40b1a24e52abaf9b0af9bee3f8f61e57faf9fb | 965 | py | Python | setup.py | kaniak274/pytest_django_dotenv | fb79ccd0ea2228ebdfeddca942fb2827cd5ebdc8 | [
"MIT"
] | 1 | 2021-02-16T09:21:20.000Z | 2021-02-16T09:21:20.000Z | setup.py | kaniak274/pytest_django_dotenv | fb79ccd0ea2228ebdfeddca942fb2827cd5ebdc8 | [
"MIT"
] | null | null | null | setup.py | kaniak274/pytest_django_dotenv | fb79ccd0ea2228ebdfeddca942fb2827cd5ebdc8 | [
"MIT"
] | null | null | null | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pytest-django-dotenv',
version='0.1.2',
author='Kamil Kucharski',
author_email... | 33.275862 | 87 | 0.687047 | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pytest-django-dotenv',
version='0.1.2',
author='Kamil Kucharski',
author_email... | true | true |
1c40b28275563c9bcc37a95e98c3c5e5403a8490 | 3,226 | py | Python | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/hub_virtual_network_connection.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/hub_virtual_network_connection.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/hub_virtual_network_connection.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.013333 | 128 | 0.657161 |
from .resource import Resource
class HubVirtualNetworkConnection(Resource):
_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type'... | true | true |
1c40b2b1cacdd7a0bd6c256ff4ba3c37fa555251 | 618 | py | Python | var/spack/repos/builtin/packages/py-portalocker/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/py-portalocker/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/py-portalocker/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPortalocker(PythonPackage):
"""Portalocker is a library to provide an easy API to file
... | 32.526316 | 95 | 0.734628 |
from spack import *
class PyPortalocker(PythonPackage):
homepage = "https://github.com/WoLpH/portalocker"
url = "https://github.com/WoLpH/portalocker/archive/v1.6.0.tar.gz"
version('1.6.0', sha256='084ff315ccb9fb38a7c06155d409da5df29647da7c6d2bc2b24637f9f79001ff')
depends_on('py-setuptools@38... | true | true |
1c40b4cc87f97cf71ca30d992fb54a0db8b1047d | 1,095 | py | Python | wildlifecompliance/migrations/0561_wildcarespeciestype.py | mintcoding/wildlifecompliance | 28f5bb4ce3116fb62d836a39612c72a052e54ae1 | [
"Apache-2.0"
] | null | null | null | wildlifecompliance/migrations/0561_wildcarespeciestype.py | mintcoding/wildlifecompliance | 28f5bb4ce3116fb62d836a39612c72a052e54ae1 | [
"Apache-2.0"
] | 3 | 2020-03-12T00:45:31.000Z | 2022-03-02T10:37:23.000Z | wildlifecompliance/migrations/0561_wildcarespeciestype.py | mintcoding/wildlifecompliance | 28f5bb4ce3116fb62d836a39612c72a052e54ae1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-11-25 02:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0560_callemail_baby_kangaroo'),
... | 36.5 | 186 | 0.6 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0560_callemail_baby_kangaroo'),
]
operations = [
migrations.CreateModel(
name='Wi... | true | true |
1c40b56d028600725c2cf60e6f97d08757f6e869 | 265 | py | Python | networking/packet_capture.py | ddubson/code-dojo-py | 31a1f6289672c45dc45a49a45ccc1a4326410b4b | [
"MIT"
] | 1 | 2017-03-27T00:21:01.000Z | 2017-03-27T00:21:01.000Z | networking/packet_capture.py | ddubson/code-dojo-py | 31a1f6289672c45dc45a49a45ccc1a4326410b4b | [
"MIT"
] | null | null | null | networking/packet_capture.py | ddubson/code-dojo-py | 31a1f6289672c45dc45a49a45ccc1a4326410b4b | [
"MIT"
] | null | null | null | import pcapy
devs = pcapy.findalldevs()
print(devs)
try:
cap = pcapy.open_live("en0", 65536, 1, 0)
count = 1
while count:
(header, payload) = cap.next()
print(count)
count += 1
except KeyboardInterrupt:
print("Exiting.")
| 15.588235 | 45 | 0.592453 | import pcapy
devs = pcapy.findalldevs()
print(devs)
try:
cap = pcapy.open_live("en0", 65536, 1, 0)
count = 1
while count:
(header, payload) = cap.next()
print(count)
count += 1
except KeyboardInterrupt:
print("Exiting.")
| true | true |
1c40b647a9ebb9057beb8c754620f9cd633a69da | 2,418 | py | Python | uflow/data/dataset_size_test.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | uflow/data/dataset_size_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | uflow/data/dataset_size_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 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... | 33.123288 | 79 | 0.707196 |
from absl.testing import absltest
from uflow.data import generic_flow_dataset
from uflow.data import kitti
from uflow.data import sintel
from uflow.data.dataset_locations import dataset_locations
DATASETS_AND_SIZE = {
'sintel-test-clean': 552,
'sintel-test-final': 552,
'sintel-train-cle... | true | true |
1c40b8c8b43cf840740df919cace841d79a604e2 | 2,398 | py | Python | Stereo-Vision-System/farzad/Project/Cameras/StereoCameras.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 12 | 2017-05-26T12:04:38.000Z | 2021-07-11T04:42:19.000Z | Stereo-Vision-System/farzad/Project/Cameras/StereoCameras.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | null | null | null | Stereo-Vision-System/farzad/Project/Cameras/StereoCameras.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 4 | 2017-05-09T08:26:44.000Z | 2018-04-23T03:16:01.000Z | #<!--------------------------------------------------------------------------->
#<!-- ITU - IT University of Copenhagen -->
#<!-- SSS - Software and Systems Section -->
#<!-- File : StereoCameras.py -... | 55.767442 | 80 | 0.330275 |
__version__ = '$Revision: 2015040501 $'
from Cameras import Cameras
from Setting.ClassProperty import ClassProperty
class StereoCameras(object):
__Instance = None
@ClassProperty
def Instance(self):
if self.__Instance is None:
self.__Instance = ... | true | true |
1c40b91e04029a84ae33cbabeb5831f5f3e1d38e | 9,216 | py | Python | scripts/ased_search_inversion1_cifar100.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | null | null | null | scripts/ased_search_inversion1_cifar100.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | null | null | null | scripts/ased_search_inversion1_cifar100.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | 1 | 2021-12-06T08:42:59.000Z | 2021-12-06T08:42:59.000Z | # -*- coding: utf-8 -*-
## INVERSION1 EXPERIMENT ON CIFAR100
import utorch
import ased
import ased_util
import sys
import time
import numpy as np
from astore import Astore
from sklearn.model_selection import StratifiedShuffleSplit
import argparse
import torch
import torch.multiprocessing as mp
import torch.nn as nn
i... | 39.384615 | 91 | 0.604601 |
import utorch
import ased
import ased_util
import sys
import time
import numpy as np
from astore import Astore
from sklearn.model_selection import StratifiedShuffleSplit
import argparse
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
... | true | true |
1c40b93725b4401b90eeef6d41c467d228a3c3e7 | 21 | py | Python | damCalculator/force/__init__.py | YingnanXuUCB/damCalculator | c2c7d1b57d87033f41e24fad1cececd96ec7c388 | [
"MIT"
] | null | null | null | damCalculator/force/__init__.py | YingnanXuUCB/damCalculator | c2c7d1b57d87033f41e24fad1cececd96ec7c388 | [
"MIT"
] | null | null | null | damCalculator/force/__init__.py | YingnanXuUCB/damCalculator | c2c7d1b57d87033f41e24fad1cececd96ec7c388 | [
"MIT"
] | null | null | null | from .forces import * | 21 | 21 | 0.761905 | from .forces import * | true | true |
1c40b967e9798ce772656204f94ecfee89c38b0e | 2,947 | py | Python | djangosaml2/cache.py | chander/djangosaml2 | edeef7e529769e5f7f99801a6a78c53ea7067198 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | djangosaml2/cache.py | chander/djangosaml2 | edeef7e529769e5f7f99801a6a78c53ea7067198 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | djangosaml2/cache.py | chander/djangosaml2 | edeef7e529769e5f7f99801a6a78c53ea7067198 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2010 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 32.744444 | 93 | 0.695283 |
from saml2.cache import Cache
class DjangoSessionCacheAdapter(dict):
key_prefix = '_saml2'
def __init__(self, django_session, key_suffix):
self.session = django_session
self.key = self.key_prefix + key_suffix
super(DjangoSessionCacheAdapter, self).__init__(self._get_objects())
... | true | true |
1c40b99599236f6163dc5f14cd48f334f09c239c | 1,891 | py | Python | tutorials/tunable_xception_cifar10/tunable_xception_cifar10.py | Gonaz/keras-tuner | f8264811d4744abb4f0fdab480e8a4e6ddf91c4e | [
"Apache-2.0"
] | 1 | 2020-11-08T17:04:21.000Z | 2020-11-08T17:04:21.000Z | tutorials/tunable_xception_cifar10/tunable_xception_cifar10.py | Gonaz/keras-tuner | f8264811d4744abb4f0fdab480e8a4e6ddf91c4e | [
"Apache-2.0"
] | null | null | null | tutorials/tunable_xception_cifar10/tunable_xception_cifar10.py | Gonaz/keras-tuner | f8264811d4744abb4f0fdab480e8a4e6ddf91c4e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Keras Tuner 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.603448 | 74 | 0.773665 |
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.datasets import cifar10
from kerastuner.applications import HyperXception
from kerastuner import RandomSearch
NUM_CLASSES = 10
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
y_train = to_categorical(y_train, NUM_CLASSES)
y_test = to_... | true | true |
1c40b9c3406064309f1ba271b8940f616aec18fa | 1,936 | py | Python | scripts/pipeline_main.py | rnk/llvm-premerge-checks | 859df4066fc06d9151e22530fce3309174cb5470 | [
"Apache-2.0"
] | null | null | null | scripts/pipeline_main.py | rnk/llvm-premerge-checks | 859df4066fc06d9151e22530fce3309174cb5470 | [
"Apache-2.0"
] | null | null | null | scripts/pipeline_main.py | rnk/llvm-premerge-checks | 859df4066fc06d9151e22530fce3309174cb5470 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 Google LLC
#
# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law ... | 39.510204 | 120 | 0.722107 |
import os
from steps import generic_linux, generic_windows, from_shell_output
import yaml
steps_generators = [
'${BUILDKITE_BUILD_CHECKOUT_PATH}/libcxx/utils/ci/buildkite-pipeline-snapshot.sh',
]
if __name__ == '__main__':
scripts_refspec = os.getenv("ph_scripts_refspec", "main")
no_cache = os.getenv('p... | true | true |
1c40b9fa431618695234cae3495c1fe3816040dd | 7,589 | py | Python | losantrest/instance_member.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 5 | 2016-06-16T20:18:11.000Z | 2022-03-09T11:41:59.000Z | losantrest/instance_member.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 4 | 2021-07-13T06:09:16.000Z | 2022-03-07T14:24:49.000Z | losantrest/instance_member.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 6 | 2016-11-18T03:19:17.000Z | 2022-03-09T11:41:47.000Z | """
The MIT License (MIT)
Copyright (c) 2021 Losant IoT, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | 41.244565 | 119 | 0.646594 |
import json
class InstanceMember(object):
def __init__(self, client):
self.client = client
def delete(self, **kwargs):
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "instanceId" in ... | true | true |
1c40ba4a9a02a64d3a26fef8c84e71080aba1669 | 3,894 | py | Python | similarity/eval_iter.py | jtraviesor/alfred-tf-trainer | 9747d24bef418415a31abfe0c9982d2f1d9d8298 | [
"MIT"
] | 3 | 2017-11-18T11:41:46.000Z | 2020-02-13T19:22:28.000Z | similarity/eval_iter.py | jtraviesor/alfred-tf-trainer | 9747d24bef418415a31abfe0c9982d2f1d9d8298 | [
"MIT"
] | 4 | 2017-09-01T05:28:49.000Z | 2017-11-20T05:27:49.000Z | similarity/eval_iter.py | jtraviesor/alfred-tf-trainer | 9747d24bef418415a31abfe0c9982d2f1d9d8298 | [
"MIT"
] | 1 | 2018-06-08T03:55:32.000Z | 2018-06-08T03:55:32.000Z | #! /usr/bin/env python
import tensorflow as tf
import numpy as np
from input_helpers import InputHelper
from time import sleep
# Parameters
# ==================================================
run_id = 'runs/1503723018'
model_file = run_id + "/checkpoints/model-72000"
# Eval Parameters
tf.flags.DEFINE_integer("batch... | 40.14433 | 120 | 0.638418 |
import tensorflow as tf
import numpy as np
from input_helpers import InputHelper
from time import sleep
run_id = 'runs/1503723018'
model_file = run_id + "/checkpoints/model-72000"
tf.flags.DEFINE_integer("batch_size", 64, "Batch Size (default: 64)")
tf.flags.DEFINE_string("checkpoint_dir", "", "Checkpoint directory ... | true | true |
1c40bb05eba11a640cfaf481908902a09ba25371 | 4,534 | py | Python | tests/unit_tests/test_core/test_pin_node.py | henzh/piniverse | 77dce494cefc9e8051bb32298a5b32e2397c1634 | [
"MIT"
] | null | null | null | tests/unit_tests/test_core/test_pin_node.py | henzh/piniverse | 77dce494cefc9e8051bb32298a5b32e2397c1634 | [
"MIT"
] | 1 | 2019-11-11T00:25:44.000Z | 2019-11-11T00:25:44.000Z | tests/unit_tests/test_core/test_pin_node.py | henzh/piniverse | 77dce494cefc9e8051bb32298a5b32e2397c1634 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2019 Henry Zhao
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 42.373832 | 113 | 0.671592 |
import pytest
import inspect
from piniverse.core.pin_node import PinNode, PinGraph
from piniverse.common.exceptions.pin_exception import PinException
from tests.unit_tests.test_core.my_package.my_file import foo, another_foo
def test_pin_node():
pin_node_1 = PinNode('1', '2', arguments={'args': ['3'], 'kwargs':... | true | true |
1c40bb46c037ce1e6e7e93b3825f8451e5627eab | 7,024 | py | Python | examples/pwr_run/checkpointing/nonpc_short/knn/job12.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/knn/job12.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/knn/job12.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 31.217778 | 118 | 0.703303 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
1c40bbef9d0c743ca08be761b688558d1d2052cb | 294 | py | Python | zadanie5.py | djdanto/Python100 | 524188233a966b12cf6bdfb9c14cf6bf25bf5205 | [
"MIT"
] | null | null | null | zadanie5.py | djdanto/Python100 | 524188233a966b12cf6bdfb9c14cf6bf25bf5205 | [
"MIT"
] | null | null | null | zadanie5.py | djdanto/Python100 | 524188233a966b12cf6bdfb9c14cf6bf25bf5205 | [
"MIT"
] | null | null | null |
celsiusz = float(input('Wprowadz temeperature w stopniach celsiusza: '))
fahrenheit = (celsiusz * 1.8) + 32
print('%0.1f Celsiusz = %0.1f Fahrenheit'%(celsiusz,fahrenheit))
kw = float(input('Wprowadz ilość koni mechanicznych: '))
kM = (kw * 1,36)
print(' kw = kM'%(kw,kM)) | 26.727273 | 74 | 0.639456 |
celsiusz = float(input('Wprowadz temeperature w stopniach celsiusza: '))
fahrenheit = (celsiusz * 1.8) + 32
print('%0.1f Celsiusz = %0.1f Fahrenheit'%(celsiusz,fahrenheit))
kw = float(input('Wprowadz ilość koni mechanicznych: '))
kM = (kw * 1,36)
print(' kw = kM'%(kw,kM)) | true | true |
1c40bcbda0e67afd5b32077d733c0afca144bac1 | 6,871 | py | Python | pytorch_lightning/accelerators/ddp2_backend.py | willprice/pytorch-lightning | 94bba4059ce3dc13799d0fd59592f3bcfbbf19c4 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/ddp2_backend.py | willprice/pytorch-lightning | 94bba4059ce3dc13799d0fd59592f3bcfbbf19c4 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/ddp2_backend.py | willprice/pytorch-lightning | 94bba4059ce3dc13799d0fd59592f3bcfbbf19c4 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.70202 | 116 | 0.666715 |
import os
import torch
from pytorch_lightning import _logger as log
from pytorch_lightning.utilities import AMPType
from pytorch_lightning.utilities.distributed import rank_zero_only
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.core.step_result import Result
fro... | true | true |
1c40bd1f8437ddf4868c4190e8316bf496f69d27 | 520 | py | Python | src/flaskFormRequest/validators/float.py | edcilo/flaskFormRequest | 5d346ab8821bdc6653dab9607f8a5d3d992b59d9 | [
"MIT"
] | null | null | null | src/flaskFormRequest/validators/float.py | edcilo/flaskFormRequest | 5d346ab8821bdc6653dab9607f8a5d3d992b59d9 | [
"MIT"
] | null | null | null | src/flaskFormRequest/validators/float.py | edcilo/flaskFormRequest | 5d346ab8821bdc6653dab9607f8a5d3d992b59d9 | [
"MIT"
] | null | null | null | from typing import Union
from .validator import Validator, ValidationError, StopValidation
class Float(Validator):
def __init__(self, message: Union[str, None] = None, parse: bool = True) -> None:
self.parse = parse
self.message = message or 'This field must be an float number.'
def parse_dat... | 28.888889 | 85 | 0.648077 | from typing import Union
from .validator import Validator, ValidationError, StopValidation
class Float(Validator):
def __init__(self, message: Union[str, None] = None, parse: bool = True) -> None:
self.parse = parse
self.message = message or 'This field must be an float number.'
def parse_dat... | true | true |
1c40be8ea064575dc414f4074b3d5a872bc46e73 | 243 | py | Python | chainer_mask_rcnn/functions/__init__.py | m3at/chainer-mask-rcnn | fa491663675cdc97974008becc99454d5e6e1d09 | [
"MIT"
] | 61 | 2018-04-04T07:09:32.000Z | 2021-11-12T19:54:23.000Z | chainer_mask_rcnn/functions/__init__.py | Swall0w/chainer-mask-rcnn | 83366fc77e52aa6a29cfac4caa697d8b45dcffc6 | [
"MIT"
] | 15 | 2018-04-10T10:48:47.000Z | 2021-05-20T10:00:42.000Z | chainer_mask_rcnn/functions/__init__.py | Swall0w/chainer-mask-rcnn | 83366fc77e52aa6a29cfac4caa697d8b45dcffc6 | [
"MIT"
] | 18 | 2018-07-06T10:13:56.000Z | 2022-03-02T12:25:31.000Z | # flake8: noqa
from .affine_channel_2d import affine_channel_2d
from .affine_channel_2d import AffineChannel2DFunction
from .crop_and_resize import crop_and_resize
from .roi_align_2d import roi_align_2d
from .roi_align_2d import ROIAlign2D
| 24.3 | 54 | 0.864198 |
from .affine_channel_2d import affine_channel_2d
from .affine_channel_2d import AffineChannel2DFunction
from .crop_and_resize import crop_and_resize
from .roi_align_2d import roi_align_2d
from .roi_align_2d import ROIAlign2D
| true | true |
1c40beeed5dbae5ac4bcf3d3ba9bff6de8b12127 | 3,988 | py | Python | examples/ad_manager/v202011/forecast_service/get_traffic_data.py | siilats/googleads-python-lib | d82a9cb75a4b2d602d02039536443f5b30157a43 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v202011/forecast_service/get_traffic_data.py | siilats/googleads-python-lib | d82a9cb75a4b2d602d02039536443f5b30157a43 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v202011/forecast_service/get_traffic_data.py | siilats/googleads-python-lib | d82a9cb75a4b2d602d02039536443f5b30157a43 | [
"Apache-2.0"
] | 1 | 2021-06-23T09:15:34.000Z | 2021-06-23T09:15:34.000Z | #!/usr/bin/env 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 ... | 32.16129 | 80 | 0.701354 |
import datetime
from googleads import ad_manager
def main(client):
forecast_service = client.GetService('ForecastService', version='v202011')
network_service = client.GetService('NetworkService', version='v202011')
root_ad_unit_id = network_service.getCurrentNetwork()['effectiveRootAdUnitId']
to... | true | true |
1c40bf9d2019a68825eb40f035446d1a2fc35654 | 35,667 | py | Python | tests/translator/test_translator.py | Buffer0x7cd/serverless-application-model | 805cc85bc26cfda16e9611c047e38f78560ad6e6 | [
"Apache-2.0"
] | 2 | 2019-04-13T16:57:10.000Z | 2019-12-13T08:32:16.000Z | tests/translator/test_translator.py | Buffer0x7cd/serverless-application-model | 805cc85bc26cfda16e9611c047e38f78560ad6e6 | [
"Apache-2.0"
] | 3 | 2021-06-08T22:29:43.000Z | 2022-01-13T03:21:16.000Z | tests/translator/test_translator.py | Buffer0x7cd/serverless-application-model | 805cc85bc26cfda16e9611c047e38f78560ad6e6 | [
"Apache-2.0"
] | 1 | 2021-08-05T13:35:20.000Z | 2021-08-05T13:35:20.000Z | import json
import itertools
import os.path
import hashlib
import sys
from functools import reduce, cmp_to_key
from samtranslator.translator.translator import Translator, prepare_plugins, make_policy_template_for_function_plugin
from samtranslator.parser.parser import Parser
from samtranslator.model.exceptions import ... | 40.530682 | 131 | 0.672386 | import json
import itertools
import os.path
import hashlib
import sys
from functools import reduce, cmp_to_key
from samtranslator.translator.translator import Translator, prepare_plugins, make_policy_template_for_function_plugin
from samtranslator.parser.parser import Parser
from samtranslator.model.exceptions import ... | true | true |
1c40c0d4965fe7922c46178338e7efc5b2a3a77c | 7,754 | py | Python | class_nn/embeddings_google.py | jmhernan/NIreland_NLP | c360c4978452e80575db2e0eed9ef540ed83b5c6 | [
"MIT"
] | null | null | null | class_nn/embeddings_google.py | jmhernan/NIreland_NLP | c360c4978452e80575db2e0eed9ef540ed83b5c6 | [
"MIT"
] | null | null | null | class_nn/embeddings_google.py | jmhernan/NIreland_NLP | c360c4978452e80575db2e0eed9ef540ed83b5c6 | [
"MIT"
] | null | null | null | ######################################################
### Builds NN using google embeddings, parameters ###
### Uses: justifications_clean_text_ohe.csv ###
###### Collapses justifications to 6 categories. ###
###### Stems and tokenizes words ###
### Next step: Sarah needs to talk through w ... | 34.7713 | 173 | 0.716404 |
import numpy as np
import pandas as pd
import nltk
from keras.utils.np_utils import to_categorical
from keras.preprocessing.text import Tokenizer
from keras import models
from keras import layers
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasClassifier
... | true | true |
1c40c13ce9a777a4ab812a86483389edbb71d4ec | 867 | py | Python | myapp/urls.py | srikar7777/Malicious-Urlv5 | a3a231d60cb6ffc44fdc297bf73683872decd435 | [
"MIT"
] | 33 | 2020-02-16T08:08:36.000Z | 2022-03-31T01:01:45.000Z | myapp/urls.py | Kabeer-Ahmed11/Malicious-Urlv5 | 617b319bfd9a7ed6320abd9e7b90c518064b66cb | [
"MIT"
] | 6 | 2020-02-12T06:24:55.000Z | 2022-02-10T08:21:55.000Z | myapp/urls.py | Kabeer-Ahmed11/Malicious-Urlv5 | 617b319bfd9a7ed6320abd9e7b90c518064b66cb | [
"MIT"
] | 22 | 2020-04-11T07:19:46.000Z | 2022-03-02T16:59:53.000Z | from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='index'),
path('getuserfeedbackform',views.getuserfeedbackform,name="getuserfeedbackform"),
path('saveuserfeedbackform',views.saveuserfeedbackform,name="saveuserfeedbackform"),
path('api',views.api,name='api'),
... | 39.409091 | 88 | 0.71511 | from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='index'),
path('getuserfeedbackform',views.getuserfeedbackform,name="getuserfeedbackform"),
path('saveuserfeedbackform',views.saveuserfeedbackform,name="saveuserfeedbackform"),
path('api',views.api,name='api'),
... | true | true |
1c40c470aff28eeaa8d9b1f7fa0b8a20f0302121 | 10,796 | py | Python | gpiozero/pins/local.py | NotBobTheBuilder/gpiozero | aeb9d30056ec97e6bf896152e71a870bd0099b4e | [
"BSD-3-Clause"
] | 1 | 2021-01-27T21:46:52.000Z | 2021-01-27T21:46:52.000Z | gpiozero/pins/local.py | NotBobTheBuilder/gpiozero | aeb9d30056ec97e6bf896152e71a870bd0099b4e | [
"BSD-3-Clause"
] | null | null | null | gpiozero/pins/local.py | NotBobTheBuilder/gpiozero | aeb9d30056ec97e6bf896152e71a870bd0099b4e | [
"BSD-3-Clause"
] | null | null | null | # GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
# Copyright (c) 2016-2019 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2019 Andrew Scheller <github@loowis.durge.org>
# Copyright (c) 2018 Martchus <martchus@gmx.net>
#
# Redistribution and use in source and binary forms, with or without
# modific... | 34.602564 | 96 | 0.648388 | # Copyright (c) 2016-2019 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2019 Andrew Scheller <github@loowis.durge.org>
# Copyright (c) 2018 Martchus <martchus@gmx.net>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:... | true | true |
1c40c520d6f4c68d536b05f273f32c0e7d73d9c8 | 2,265 | py | Python | hatsploit/modules/exploit/linux/dlink/dcs_credentials_disclosure.py | enty8080/HatSplo | 57ea81c2bc73838cbf7d7062d7e665eda1143d18 | [
"MIT"
] | 139 | 2021-02-17T15:52:30.000Z | 2022-03-30T14:50:42.000Z | hatsploit/modules/exploit/linux/dlink/dcs_credentials_disclosure.py | enty8080/HatSplo | 57ea81c2bc73838cbf7d7062d7e665eda1143d18 | [
"MIT"
] | 27 | 2021-03-24T17:14:30.000Z | 2022-03-02T18:50:43.000Z | hatsploit/modules/exploit/linux/dlink/dcs_credentials_disclosure.py | enty8080/HatSplo | 57ea81c2bc73838cbf7d7062d7e665eda1143d18 | [
"MIT"
] | 85 | 2021-02-17T15:39:03.000Z | 2022-03-07T09:08:58.000Z | #!/usr/bin/env python3
#
# This module requires HatSploit: https://hatsploit.netlify.app
# Current source: https://github.com/EntySec/HatSploit
#
from hatsploit.lib.module import Module
from hatsploit.utils.http import HTTPClient
class HatSploitModule(Module, HTTPClient):
details = {
'Name': "D-Link DCS... | 29.415584 | 106 | 0.568212 |
from hatsploit.lib.module import Module
from hatsploit.utils.http import HTTPClient
class HatSploitModule(Module, HTTPClient):
details = {
'Name': "D-Link DCS Credentials Disclosure",
'Module': "exploit/linux/dlink/dcs_credentials_disclosure",
'Authors': [
'Ivan Nikolsky (ent... | true | true |
1c40c568ed84a7c5ad953c1385b4f4dfbcd73e5b | 460 | py | Python | councilmatic_core/migrations/0035_bill_html_text.py | datamade/django-councilmatic | 5b074f376667766e4b6dbf093871d294bb35fc51 | [
"MIT"
] | 26 | 2015-12-05T03:36:49.000Z | 2022-03-05T12:17:59.000Z | councilmatic_core/migrations/0035_bill_html_text.py | datamade/django-councilmatic | 5b074f376667766e4b6dbf093871d294bb35fc51 | [
"MIT"
] | 181 | 2015-10-14T18:01:19.000Z | 2021-06-30T13:52:47.000Z | councilmatic_core/migrations/0035_bill_html_text.py | datamade/django-councilmatic | 5b074f376667766e4b6dbf093871d294bb35fc51 | [
"MIT"
] | 18 | 2015-10-22T09:01:24.000Z | 2020-10-22T19:33:09.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-01-08 16:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('councilmatic_core', '0034_event_guid'),
]
operations = [
migrations.AddFiel... | 21.904762 | 58 | 0.617391 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('councilmatic_core', '0034_event_guid'),
]
operations = [
migrations.AddField(
model_name='bill',
name='html_text',
... | true | true |
1c40c5b9cdf2e9fe2acd1666f7d912767d97bb15 | 1,939 | py | Python | ch07/train_convnet.py | tom01h/deep-learning-from-scratch | acb3c31976cd736b4abd21c3e8ab81c3bf0eb9bb | [
"MIT"
] | 3 | 2018-10-11T16:19:18.000Z | 2022-01-16T07:48:06.000Z | ch07/train_convnet.py | tom01h/deep-learning-from-scratch | acb3c31976cd736b4abd21c3e8ab81c3bf0eb9bb | [
"MIT"
] | null | null | null | ch07/train_convnet.py | tom01h/deep-learning-from-scratch | acb3c31976cd736b4abd21c3e8ab81c3bf0eb9bb | [
"MIT"
] | null | null | null | # coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import pickle
import time
import cupy as cp
#import numpy as cp
import numpy as np
import matplotlib.pyplot as plt
from dataset.cifar10 import load_cifar10
from simple_convnet import SimpleConvNet
from common.trainer import Trainer
... | 31.274194 | 107 | 0.687983 | import sys, os
sys.path.append(os.pardir) import pickle
import time
import cupy as cp
import numpy as np
import matplotlib.pyplot as plt
from dataset.cifar10 import load_cifar10
from simple_convnet import SimpleConvNet
from common.trainer import Trainer
(x_train, t_train), (x_test, t_test) = load_cifar10(normalize=Fa... | true | true |
1c40cb511c8e3b54341078d83202f347436c299f | 7,306 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/14-2Nested_false-termination_16.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/14-2Nested_false-termination_16.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/14-2Nested_false-termination_16.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 31.356223 | 77 | 0.586915 | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
1c40cd0ec916c7cb8d387f5d9e7a69fcb7c06b9b | 7,379 | py | Python | armi/utils/tests/test_gridGui.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 162 | 2019-11-01T17:35:58.000Z | 2022-03-18T04:22:39.000Z | armi/utils/tests/test_gridGui.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 315 | 2019-11-01T17:32:05.000Z | 2022-03-30T03:51:42.000Z | armi/utils/tests/test_gridGui.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 55 | 2019-11-01T16:59:59.000Z | 2022-03-25T18:19:06.000Z | # Copyright 2021 Google, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.432292 | 120 | 0.69237 | import asyncio
import os
import pytest
import time
import unittest
import test.support
# rest of the module. Neat!
wx = test.support.import_module("wx")
from armi import configure, getApp
if getApp() is None:
configure()
from armi.utils import gridEditor
_SECONDS_PER_TICK = 0.05
def _wait(num_ticks: int) -> N... | true | true |
1c40cd99485425830543e682f8506d0020f2d87f | 16,734 | py | Python | detection/models/detection/yolo/backbone.py | stanford-policylab/surveilling-surveillance | bbb9a147927a6342eecfe07ffa756b3acdb63f35 | [
"MIT"
] | 8 | 2021-05-21T03:38:52.000Z | 2021-11-21T08:32:41.000Z | detection/models/detection/yolo/backbone.py | stanford-policylab/surveilling-surveillance | bbb9a147927a6342eecfe07ffa756b3acdb63f35 | [
"MIT"
] | null | null | null | detection/models/detection/yolo/backbone.py | stanford-policylab/surveilling-surveillance | bbb9a147927a6342eecfe07ffa756b3acdb63f35 | [
"MIT"
] | 1 | 2021-06-13T21:49:14.000Z | 2021-06-13T21:49:14.000Z | '''
ABOUT THIS SCRIPT:
This is a yolov3 implementation that constructs the appropriate
yolov3 model layers and performs forward runs as per these modules
This script is a slightly modified version of the follwoing repo:
https://github.com/eriklindernoren/PyTorch-YOLOv3.git
'''
import numpy as np
import torch
import ... | 40.914425 | 93 | 0.553783 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from .utils import (slice_boundary,
parse_model_config,
to_cpu,
build_targets)
from . import constants as C
def create_modules(module... | true | true |
1c40cef8afd98421821fb3f4e64ddeed3a028230 | 8,928 | py | Python | pypureclient/flasharray/FA_2_2/models/volume.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_2/models/volume.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_2/models/volume.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.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 42.312796 | 461 | 0.610887 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_2 import models
class Volume(object):
swagger_types = {
'id': 'str',
'name': 'str',
'connection_count': 'int',
'created': 'int',
... | true | true |
1c40cf17ebef6c5aaba6a98ca4e67106f981e182 | 1,170 | py | Python | pyvisdk/do/exit_standby_mode_failed_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/exit_standby_mode_failed_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/exit_standby_mode_failed_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ExitStandbyModeFailedEvent(vim, *args, **kwargs):
'''This event records that the host... | 34.411765 | 124 | 0.610256 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
log = logging.getLogger(__name__)
def ExitStandbyModeFailedEvent(vim, *args, **kwargs):
obj = vim.client.factory.create('{urn:vim25}ExitStandbyModeFailedEvent')
if (len(args) + len(kwargs)) < 4:
raise IndexError('Expected at le... | true | true |
1c40d1db1ec34f7d9f6f1e18ea250056b1f2eb83 | 1,822 | py | Python | sinecosine.py | hackmeehan/Sine-Cosine | d789b48d3b8f0c6f6a5f17ae57a451100e2ef877 | [
"MIT"
] | null | null | null | sinecosine.py | hackmeehan/Sine-Cosine | d789b48d3b8f0c6f6a5f17ae57a451100e2ef877 | [
"MIT"
] | null | null | null | sinecosine.py | hackmeehan/Sine-Cosine | d789b48d3b8f0c6f6a5f17ae57a451100e2ef877 | [
"MIT"
] | null | null | null | """
sinecosine.py
Author: Jack Meehan
Credit: https://www.webucator.com/blog/2015/03/python-color-constants-module/ (used for colors)
Assignment:
The sine and cosine functions are provided in the Python math library. These functions are used
to relate *angles* to *rectangular* (x,y) coordinate systems and can be very... | 35.72549 | 102 | 0.767838 |
from ggame import App, Sprite, Color, CircleAsset, RectangleAsset, LineStyle
from math import sin, cos, radians
red = Color(0xff0000, 1.0)
purple = Color(0x9A32CD, 1.0)
blue = Color(0x0000EE, 1.0)
black = Color(0x000000, 1.0)
line = LineStyle(2, black)
xcoordinates = range( 0, 360, 10)
bluecircle = CircleAsset(6, li... | true | true |
1c40d214a58bdf8e757e7e56b77ea9ba880b9678 | 679 | py | Python | tests/type_maps/test_method_argument_map.py | vemel/boto3_type_annotations | 88aa07a36f5626428c8d3878a4846d8cb667ea28 | [
"MIT"
] | 44 | 2019-11-09T04:29:31.000Z | 2022-02-11T10:51:41.000Z | tests/type_maps/test_method_argument_map.py | vemel/boto3_type_annotations | 88aa07a36f5626428c8d3878a4846d8cb667ea28 | [
"MIT"
] | 28 | 2019-11-26T23:50:19.000Z | 2021-05-31T18:52:46.000Z | tests/type_maps/test_method_argument_map.py | vemel/boto3_type_annotations | 88aa07a36f5626428c8d3878a4846d8cb667ea28 | [
"MIT"
] | 3 | 2019-11-09T16:43:04.000Z | 2019-12-20T15:05:33.000Z | import unittest
from mypy_boto3_builder.service_name import ServiceNameCatalog
from mypy_boto3_builder.type_maps.method_argument_map import get_method_arguments_stub
class MethodArgumentMapTestCase(unittest.TestCase):
def test_get_method_arguments_stub(self) -> None:
self.assertTrue(
get_meth... | 33.95 | 87 | 0.702504 | import unittest
from mypy_boto3_builder.service_name import ServiceNameCatalog
from mypy_boto3_builder.type_maps.method_argument_map import get_method_arguments_stub
class MethodArgumentMapTestCase(unittest.TestCase):
def test_get_method_arguments_stub(self) -> None:
self.assertTrue(
get_meth... | true | true |
1c40d37e1ca0a0a32af9ab4412f2d1ddda580cdf | 5,818 | py | Python | my_dataset_test.py | TopoXLab/TopoCount | eb93de2bc40d4421ea39c1b80d5c4c4829f3e369 | [
"MIT"
] | 18 | 2020-12-18T02:54:55.000Z | 2022-02-26T01:52:22.000Z | my_dataset_test.py | TopoXLab/TopoCount | eb93de2bc40d4421ea39c1b80d5c4c4829f3e369 | [
"MIT"
] | 2 | 2021-01-13T09:15:38.000Z | 2021-03-26T08:43:43.000Z | my_dataset_test.py | TopoXLab/TopoCount | eb93de2bc40d4421ea39c1b80d5c4c4829f3e369 | [
"MIT"
] | 8 | 2020-12-25T01:50:55.000Z | 2021-06-08T05:21:48.000Z | from torch.utils.data import Dataset
import os
import matplotlib.pyplot as plt
import numpy as np
import torch
import cv2
from torchvision import transforms
import random
from PIL import Image
import glob
class CrowdDataset(Dataset):
'''
crowdDataset
'''
def __init__(self, img_root, gt_dot_root, split... | 40.124138 | 160 | 0.554486 | from torch.utils.data import Dataset
import os
import matplotlib.pyplot as plt
import numpy as np
import torch
import cv2
from torchvision import transforms
import random
from PIL import Image
import glob
class CrowdDataset(Dataset):
def __init__(self, img_root, gt_dot_root, split_txt_filepath=None, phase='train'... | true | true |
1c40d3c29f198e1d6558e79093b5ee23ceef0f5f | 841 | py | Python | google/ads/google_ads/v6/services/conversion_adjustment_upload_service_client_config.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v6/services/conversion_adjustment_upload_service_client_config.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/services/conversion_adjustment_upload_service_client_config.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | config = {
"interfaces": {
"google.ads.googleads.v6.services.ConversionAdjustmentUploadService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_... | 26.28125 | 75 | 0.546968 | config = {
"interfaces": {
"google.ads.googleads.v6.services.ConversionAdjustmentUploadService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_... | true | true |
1c40d4439683f1c1b8e7339dffa661baea4ea06b | 1,182 | py | Python | predict.py | guoshuhong/yolo4_SVHN | fb91d5c21a3ff2b6f8e977e7de5b91b1ecf3394e | [
"MIT"
] | null | null | null | predict.py | guoshuhong/yolo4_SVHN | fb91d5c21a3ff2b6f8e977e7de5b91b1ecf3394e | [
"MIT"
] | null | null | null | predict.py | guoshuhong/yolo4_SVHN | fb91d5c21a3ff2b6f8e977e7de5b91b1ecf3394e | [
"MIT"
] | null | null | null | #-------------------------------------#
# 对单张图片进行预测
#-------------------------------------#
from yolo import YOLO
from PIL import Image
import os
import time
import pandas as pd
import numpy as np
yolo = YOLO()
while True:
filelist = os.listdir()
img = input('Input image filename:')
try:
ima... | 25.148936 | 74 | 0.559222 | from yolo import YOLO
from PIL import Image
import os
import time
import pandas as pd
import numpy as np
yolo = YOLO()
while True:
filelist = os.listdir()
img = input('Input image filename:')
try:
image = Image.open(img)
except:
print('Open Error! Try again!')
continue
else... | true | true |
1c40d491ec9cacd474a81b295016a4c0fc79a49e | 6,447 | py | Python | data/babel.py | neural-polysynthetic-language-modelling/deepspeech.pytorch | 7883e5be5abeacdd52aa170f85d3060ed3b11d00 | [
"MIT"
] | null | null | null | data/babel.py | neural-polysynthetic-language-modelling/deepspeech.pytorch | 7883e5be5abeacdd52aa170f85d3060ed3b11d00 | [
"MIT"
] | null | null | null | data/babel.py | neural-polysynthetic-language-modelling/deepspeech.pytorch | 7883e5be5abeacdd52aa170f85d3060ed3b11d00 | [
"MIT"
] | null | null | null | import os
import wget
import tarfile
import argparse
import csv
from multiprocessing.pool import ThreadPool
import subprocess
from utils import create_manifest
import re
from sphfile import SPHFile
parser = argparse.ArgumentParser(description='Processes downloaded IARPA babel corpus')
parser.add_argument("--target-dir... | 40.54717 | 120 | 0.614549 | import os
import wget
import tarfile
import argparse
import csv
from multiprocessing.pool import ThreadPool
import subprocess
from utils import create_manifest
import re
from sphfile import SPHFile
parser = argparse.ArgumentParser(description='Processes downloaded IARPA babel corpus')
parser.add_argument("--target-dir... | true | true |
1c40d71a856cf0d96408fe13f437a7c391a85183 | 10,511 | py | Python | fireant/queries/builder/query_builder.py | mikeengland/fireant | 63c12728c11f1fb252265459f8b8f384d20414b9 | [
"Apache-2.0"
] | 122 | 2016-08-05T13:34:52.000Z | 2022-03-15T13:21:13.000Z | fireant/queries/builder/query_builder.py | mikeengland/fireant | 63c12728c11f1fb252265459f8b8f384d20414b9 | [
"Apache-2.0"
] | 321 | 2016-08-10T08:48:15.000Z | 2021-07-28T13:08:18.000Z | fireant/queries/builder/query_builder.py | mikeengland/fireant | 63c12728c11f1fb252265459f8b8f384d20414b9 | [
"Apache-2.0"
] | 27 | 2016-08-10T08:11:08.000Z | 2021-08-23T08:14:37.000Z | from typing import TYPE_CHECKING, Union
from pypika import Order
from fireant.dataset.fields import Field
from fireant.exceptions import DataSetException
from fireant.utils import (
deepcopy,
immutable,
)
from ..execution import fetch_data
from ..finders import find_field_in_modified_field
from ..sets import ... | 32.045732 | 120 | 0.643802 | from typing import TYPE_CHECKING, Union
from pypika import Order
from fireant.dataset.fields import Field
from fireant.exceptions import DataSetException
from fireant.utils import (
deepcopy,
immutable,
)
from ..execution import fetch_data
from ..finders import find_field_in_modified_field
from ..sets import ... | true | true |
1c40d7494928228b274188b3277cc77f6aa633df | 5,270 | py | Python | src/compas_rv2/singular/algorithms/propagation.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 4 | 2022-01-17T19:17:22.000Z | 2022-01-21T18:06:02.000Z | src/compas_rv2/singular/algorithms/propagation.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | null | null | null | src/compas_rv2/singular/algorithms/propagation.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from compas.geometry import discrete_coons_patch
from ..utilities import list_split
def quadrangulate_mesh(mesh, sources):
"""Quadrangulate the faces of a mesh by adding edges from vertex sources.
R... | 35.369128 | 142 | 0.579317 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from compas.geometry import discrete_coons_patch
from ..utilities import list_split
def quadrangulate_mesh(mesh, sources):
sources_to_visit = sources[:]
count = 1000
while sources_to_visit and c... | true | true |
1c40d7922ee0e9af71035e7e7719d5b089de3727 | 5,468 | py | Python | benford.py | EivindFa/benfords_law | 6f2a0ab3f63d21b2caeef8f54922972b10d2b1b7 | [
"MIT"
] | null | null | null | benford.py | EivindFa/benfords_law | 6f2a0ab3f63d21b2caeef8f54922972b10d2b1b7 | [
"MIT"
] | null | null | null | benford.py | EivindFa/benfords_law | 6f2a0ab3f63d21b2caeef8f54922972b10d2b1b7 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
from scipy import stats
# data source: https://ourworldindata.org/coronavirus-source-data
def setup(csv_filename, country):
df = pd.read_csv(csv_filename)
df = df.loc[: , ["location", "date", "new_cases" ]]
df = df[df["loc... | 35.738562 | 124 | 0.647952 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
from scipy import stats
def setup(csv_filename, country):
df = pd.read_csv(csv_filename)
df = df.loc[: , ["location", "date", "new_cases" ]]
df = df[df["location"] == country]
df = df[df["new_cases"].notna()] d... | true | true |
1c40d79baf9dc72b1930e86aa0624e64fd126af1 | 3,557 | py | Python | createaquiz/quiz/models.py | ranajaydas/CreateAQuiz | d83ec4aa08b61ffb2f044c3d0cc3accf81e826b7 | [
"MIT"
] | null | null | null | createaquiz/quiz/models.py | ranajaydas/CreateAQuiz | d83ec4aa08b61ffb2f044c3d0cc3accf81e826b7 | [
"MIT"
] | 10 | 2021-03-19T08:08:58.000Z | 2022-03-12T00:12:36.000Z | createaquiz/quiz/models.py | ranajaydas/CreateAQuiz | d83ec4aa08b61ffb2f044c3d0cc3accf81e826b7 | [
"MIT"
] | null | null | null | from random import shuffle
from django.db import models
from django.shortcuts import reverse
from django.conf import settings
from core.utils import ImageResizeUploadS3
class CustomModel:
"""Common Model inherited by other models."""
def get_model(self):
return self.__class__.__name__
class Tag(Cust... | 34.201923 | 111 | 0.681473 | from random import shuffle
from django.db import models
from django.shortcuts import reverse
from django.conf import settings
from core.utils import ImageResizeUploadS3
class CustomModel:
def get_model(self):
return self.__class__.__name__
class Tag(CustomModel, models.Model):
name = models.CharFiel... | true | true |
1c40d837af0d413b7a0f8ca344d09150e56e4904 | 1,007 | py | Python | PerformanceMetricsScript/ApplicationLevelPerformanceMetricsParsing.py | ShivKushwah/PSec-Anonymous | 6561e8e753455731fc5a3ae80bc1007982131880 | [
"MIT"
] | 4 | 2020-04-28T03:35:15.000Z | 2021-12-08T08:19:52.000Z | PerformanceMetricsScript/ApplicationLevelPerformanceMetricsParsing.py | ShivKushwah/PSec | 22b1c066ac0c2667713ce5f6c40f23406ce782f5 | [
"MIT"
] | 1 | 2019-09-15T19:42:14.000Z | 2019-09-15T19:42:14.000Z | PerformanceMetricsScript/ApplicationLevelPerformanceMetricsParsing.py | ShivKushwah/PSec | 22b1c066ac0c2667713ce5f6c40f23406ce782f5 | [
"MIT"
] | null | null | null | import re
import subprocess
import time
import json
import statistics
import time
import os
import sys
search_lst1 = ['MEASURE BASELINE START']
search_lst2 = ['MEASURE BASELINE END']
id_lst = ['MEASURE BASELINE']
with open('BaselineCacheHost1.txt') as json_file:
data1 = json.load(json_file)
with open('BaselineC... | 23.418605 | 78 | 0.704071 | import re
import subprocess
import time
import json
import statistics
import time
import os
import sys
search_lst1 = ['MEASURE BASELINE START']
search_lst2 = ['MEASURE BASELINE END']
id_lst = ['MEASURE BASELINE']
with open('BaselineCacheHost1.txt') as json_file:
data1 = json.load(json_file)
with open('BaselineC... | true | true |
1c40d8498f142620bf4e4ba3383c78937ded2868 | 5,514 | py | Python | bpy_lambda/2.78/scripts/addons_contrib/text_editor_hastebin.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | null | null | null | bpy_lambda/2.78/scripts/addons_contrib/text_editor_hastebin.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | null | null | null | bpy_lambda/2.78/scripts/addons_contrib/text_editor_hastebin.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | 1 | 2019-11-24T18:43:42.000Z | 2019-11-24T18:43:42.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 32.627219 | 129 | 0.593399 |
bl_info = {
"name": "hastebin",
"author": "Dalai Felinto (dfelinto)",
"version": (0, 8),
"blender": (2, 78, 0),
"location": "Text editor > Properties panel",
"description": "Send your selection or text to hastebin.com",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
... | true | true |
1c40d8c2ee70c98476b025510a63d8e9b4910304 | 3,606 | py | Python | Setup/install.py | SyedRizvi-TomTom/aws-xray-cloudwatch-event | 90e8b1e71d801f3dd59ba25ee880ae0f9f581cdf | [
"Apache-2.0"
] | null | null | null | Setup/install.py | SyedRizvi-TomTom/aws-xray-cloudwatch-event | 90e8b1e71d801f3dd59ba25ee880ae0f9f581cdf | [
"Apache-2.0"
] | null | null | null | Setup/install.py | SyedRizvi-TomTom/aws-xray-cloudwatch-event | 90e8b1e71d801f3dd59ba25ee880ae0f9f581cdf | [
"Apache-2.0"
] | null | null | null | '''
/*Copyright 2017-2017 Amazon.com, Inc. or its affiliates. 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.
A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the "license" file accompanying ... | 54.636364 | 361 | 0.801997 |
import os
import json
appname = raw_input("Enter a unique name for your app {pattern:^[a-z0-9]+$}:")
print("Your appname:"+appname+" will be used for naming your CloudFormation stack, public s3 bucket and as a prefix as a prefix to identify all the Lambda functions and IAM Roles associated with your app")
print("Th... | true | true |
1c40da02d769adb5740c546f1fd8aa5897d22286 | 3,044 | py | Python | tensorflow_datasets/public_api.py | mdautrey/datasets | 5ad83a418d3505619c4282d2b3ff7a80edc45469 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/public_api.py | mdautrey/datasets | 5ad83a418d3505619c4282d2b3ff7a80edc45469 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/public_api.py | mdautrey/datasets | 5ad83a418d3505619c4282d2b3ff7a80edc45469 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | 35.395349 | 92 | 0.796321 |
from tensorflow_datasets.core import tf_compat
tf_compat.ensure_tf_install()
from tensorflow_datasets import core
from tensorflow_datasets.core import folder_dataset
from tensorflow_datasets.core import download
from tensorflow_datasets.core import decode
from tensorflow_datasets.core import deprecated
from tensorfl... | true | true |
1c40dad565424aa804e988e7f0c48edb8069d843 | 455 | py | Python | tests/list1.py | akshanshbhatt/lpython | 70fef49dbbb6cbb0447f7013231171e5c8b8e5df | [
"BSD-3-Clause"
] | 31 | 2022-01-07T23:56:33.000Z | 2022-03-29T16:09:02.000Z | tests/list1.py | akshanshbhatt/lpython | 70fef49dbbb6cbb0447f7013231171e5c8b8e5df | [
"BSD-3-Clause"
] | 197 | 2021-12-29T19:01:41.000Z | 2022-03-31T15:58:25.000Z | tests/list1.py | akshanshbhatt/lpython | 70fef49dbbb6cbb0447f7013231171e5c8b8e5df | [
"BSD-3-Clause"
] | 17 | 2022-01-06T15:34:36.000Z | 2022-03-31T13:55:33.000Z | def test_List():
a: list[i32]
a = [1, 2, 3]
a = [-3, -2, -1]
# a = [-2, -1, 0.45] -> semantic error
b: list[str]
b = ["a", "b", "c"]
c: list[list[i32]]
c = [[1, 2, 3], [4, 5, 6]]
d: i32
d = a[2]
# ragged list
e: list[list[str]]
e = [['a', 'b', 'c'], ['d', 'e']]
... | 16.25 | 42 | 0.356044 | def test_List():
a: list[i32]
a = [1, 2, 3]
a = [-3, -2, -1]
b: list[str]
b = ["a", "b", "c"]
c: list[list[i32]]
c = [[1, 2, 3], [4, 5, 6]]
d: i32
d = a[2]
e: list[list[str]]
e = [['a', 'b', 'c'], ['d', 'e']]
a.append(10)
a.remove(1)
a.insert(2, 13)
... | true | true |
1c40dae30ee101fc406cd20627c4cdfdd63c602f | 7,174 | py | Python | InvenTree/part/templatetags/inventree_extras.py | TheCrazyMaffin/InvenTree | 2686f61a4ac279386a83049745339345f1ac4cf7 | [
"MIT"
] | null | null | null | InvenTree/part/templatetags/inventree_extras.py | TheCrazyMaffin/InvenTree | 2686f61a4ac279386a83049745339345f1ac4cf7 | [
"MIT"
] | null | null | null | InvenTree/part/templatetags/inventree_extras.py | TheCrazyMaffin/InvenTree | 2686f61a4ac279386a83049745339345f1ac4cf7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" This module provides template tags for extra functionality
over and above the built-in Django tags.
"""
import os
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as djangosettings
from django import template
from django.urls import reverse
from dj... | 26.182482 | 108 | 0.695707 |
import os
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as djangosettings
from django import template
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.templatetags.static import StaticNode
from InvenTree import version, settings
im... | true | true |
1c40dc2678afa914ac2937d94976a7a9a48cada1 | 16,761 | py | Python | test/test_YNAB_API.py | MatissJanis/bank2ynab | ade89b2aa5062821540a2efd3f91594c8f930469 | [
"MIT"
] | null | null | null | test/test_YNAB_API.py | MatissJanis/bank2ynab | ade89b2aa5062821540a2efd3f91594c8f930469 | [
"MIT"
] | null | null | null | test/test_YNAB_API.py | MatissJanis/bank2ynab | ade89b2aa5062821540a2efd3f91594c8f930469 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
from os.path import join
import os
from shutil import copyfile
import configparser
from test.utils import get_test_confparser, get_project_dir
from bank2ynab.b2y_utilities import (
get_configs,
string_num_diff,
get_config_line,
option_selec... | 36.837363 | 82 | 0.499672 | from unittest import TestCase
from unittest.mock import patch
from os.path import join
import os
from shutil import copyfile
import configparser
from test.utils import get_test_confparser, get_project_dir
from bank2ynab.b2y_utilities import (
get_configs,
string_num_diff,
get_config_line,
option_selec... | true | true |
1c40dc425318deef0d4cb09f150ed1883e6fefef | 12,187 | py | Python | uem/criptoanalisis/mono.py | junquera/my-crypto-works | 8ef1b207a97fd5ee7eb53f985edc73813a0f8fc0 | [
"MIT"
] | null | null | null | uem/criptoanalisis/mono.py | junquera/my-crypto-works | 8ef1b207a97fd5ee7eb53f985edc73813a0f8fc0 | [
"MIT"
] | null | null | null | uem/criptoanalisis/mono.py | junquera/my-crypto-works | 8ef1b207a97fd5ee7eb53f985edc73813a0f8fc0 | [
"MIT"
] | 1 | 2018-07-16T22:03:44.000Z | 2018-07-16T22:03:44.000Z | #!/bin/env python3
'''
[ ANÁLISIS ESTADÍSTICO DE TEXTO ]
[ CIFRADO POR SUSTITUCIÓN MONOALFABÉTICA ]
Javier Junquera Sánchez <javier@junquera.xyz>
Fases:
1. Análisis de entropía
2. Análisis de aparición de caracteres
3. Análisis de caracteres repetidos juntos (RR, LL)
4. Análisis de dupletas repetidas
5. Gen... | 28.474299 | 730 | 0.562485 |
import re
from affine import decode_affine, affine_break
estadisticas_castellano = {'A': 0.1203914356874436, 'B': 0.015130070791165134, 'C': 0.03719184102245509, 'D': 0.05437026585244542, 'E': 0.1386395633977034, 'F': 0.004934755557097172, 'G': 0.01092558720618012, 'H': 0.012658047516610746, 'I': 0.048772133465719646... | true | true |
1c40dc99308567bada224c8e4e4b3fd6b5c6906b | 22,556 | py | Python | pandas/computation/expr.py | clarkfitzg/pandas | a71ede374a019ea40321d8c1cfd13258b45ff58d | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/computation/expr.py | clarkfitzg/pandas | a71ede374a019ea40321d8c1cfd13258b45ff58d | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/computation/expr.py | clarkfitzg/pandas | a71ede374a019ea40321d8c1cfd13258b45ff58d | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | """:func:`~pandas.eval` parsers
"""
import ast
import operator
import sys
import inspect
import tokenize
import datetime
from functools import partial
import pandas as pd
from pandas import compat
from pandas.compat import StringIO, lmap, zip, reduce, string_types
from pandas.core.base import StringMixin
from pandas... | 34.175758 | 79 | 0.601702 |
import ast
import operator
import sys
import inspect
import tokenize
import datetime
from functools import partial
import pandas as pd
from pandas import compat
from pandas.compat import StringIO, lmap, zip, reduce, string_types
from pandas.core.base import StringMixin
from pandas.core import common as com
from pand... | true | true |
1c40dcf9fed1df342a46112c9315c08080e2084f | 25,926 | py | Python | tftpclient.py | xdutaotao/flashboot | 307f65af0cf5d8e6de04cc11916017d1f5d6a8a0 | [
"Apache-2.0"
] | 1 | 2018-11-28T13:11:51.000Z | 2018-11-28T13:11:51.000Z | tftpclient.py | xdutaotao/flashboot | 307f65af0cf5d8e6de04cc11916017d1f5d6a8a0 | [
"Apache-2.0"
] | null | null | null | tftpclient.py | xdutaotao/flashboot | 307f65af0cf5d8e6de04cc11916017d1f5d6a8a0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Author: Maxime Petazzoni
# maxime.petazzoni@bulix.org
#
# This file is part of pTFTPd.
#
# pTFTPd is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... | 33.323907 | 120 | 0.56588 |
from __future__ import print_function
try:
input = raw_input except NameError:
pass
from datetime import datetime
import os
import shutil
import socket
import stat
import sys
import tempfile
import notify
import proto
import state
l = notify.getLogger('tftp')
_UDP_TRANSFER_SIZE = 2**16
_PTFTP_DE... | true | true |
1c40dd64f42e4bab7e00b275d6fd51fa97380b91 | 3,597 | py | Python | hubble/settings.py | lqm229026/hubble | bc9e5d8d37edf04447b1c52857dc521cd1db91ad | [
"Apache-2.0"
] | null | null | null | hubble/settings.py | lqm229026/hubble | bc9e5d8d37edf04447b1c52857dc521cd1db91ad | [
"Apache-2.0"
] | 7 | 2020-06-06T00:37:24.000Z | 2022-02-10T11:05:24.000Z | hubble/settings.py | moonlight824/hubble | bc9e5d8d37edf04447b1c52857dc521cd1db91ad | [
"Apache-2.0"
] | null | null | null | """
Django settings for hubble project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# ... | 26.065217 | 110 | 0.695024 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '!)=lj#vc=l2k6-n1f*_c!pyz29af2i!xmzsc602^5w!#ki)@tu'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
1c40de9808148ccedb9de40c4f422ce5a7eb62e1 | 34,880 | py | Python | spectacles/client.py | DylanBaker/looker-fonz | 93dea44f14d38b8441f21264b968a4f7845cb690 | [
"MIT"
] | null | null | null | spectacles/client.py | DylanBaker/looker-fonz | 93dea44f14d38b8441f21264b968a4f7845cb690 | [
"MIT"
] | 8 | 2019-09-27T20:41:26.000Z | 2019-10-02T21:43:31.000Z | spectacles/client.py | dbanalyticsco/spectacles | 93dea44f14d38b8441f21264b968a4f7845cb690 | [
"MIT"
] | null | null | null | from typing import List, Dict, Optional
import time
from dataclasses import dataclass
import backoff # type: ignore
import requests
from requests.exceptions import Timeout, HTTPError, ConnectionError
import spectacles.utils as utils
from spectacles.types import JsonDict
from spectacles.logger import GLOBAL_LOGGER as l... | 37.264957 | 99 | 0.571072 | from typing import List, Dict, Optional
import time
from dataclasses import dataclass
import backoff import requests
from requests.exceptions import Timeout, HTTPError, ConnectionError
import spectacles.utils as utils
from spectacles.types import JsonDict
from spectacles.logger import GLOBAL_LOGGER as logger
from spec... | true | true |
1c40df65ea2fe64264af604bda94e41779bcdeb6 | 4,703 | py | Python | de1/zip/zip_file_data_set.py | samhiscoxqb/de1-python | 19b8fc6945cf0cd413ef79ff39a65451eea9e627 | [
"MIT"
] | 10 | 2021-02-01T02:24:55.000Z | 2021-11-18T13:29:06.000Z | de1/zip/zip_file_data_set.py | samhiscoxqb/de1-python | 19b8fc6945cf0cd413ef79ff39a65451eea9e627 | [
"MIT"
] | 2 | 2021-02-01T12:05:16.000Z | 2021-02-05T10:05:59.000Z | de1/zip/zip_file_data_set.py | samhiscoxqb/de1-python | 19b8fc6945cf0cd413ef79ff39a65451eea9e627 | [
"MIT"
] | 1 | 2021-02-05T09:39:08.000Z | 2021-02-05T09:39:08.000Z | import os
import tempfile
from copy import deepcopy
from typing import Any, Dict, Type, Union, Optional
from warnings import warn
from kedro.io import AbstractDataSet, DataSetError
from kedro.io.core import parse_dataset_definition, VERSION_KEY, VERSIONED_FLAG_KEY
class ZipFileDataSet(AbstractDataSet):
"""
Z... | 38.54918 | 109 | 0.610674 | import os
import tempfile
from copy import deepcopy
from typing import Any, Dict, Type, Union, Optional
from warnings import warn
from kedro.io import AbstractDataSet, DataSetError
from kedro.io.core import parse_dataset_definition, VERSION_KEY, VERSIONED_FLAG_KEY
class ZipFileDataSet(AbstractDataSet):
DEFAULT_... | true | true |
1c40dfe67753933f27df222980954730939aa54c | 1,380 | py | Python | test_dataset.py | yanzhicong/realistic-ssl-evaluation-pytorch | d0ea3349765f8642e97dce57cf319f703b7f1e42 | [
"MIT"
] | null | null | null | test_dataset.py | yanzhicong/realistic-ssl-evaluation-pytorch | d0ea3349765f8642e97dce57cf319f703b7f1e42 | [
"MIT"
] | null | null | null | test_dataset.py | yanzhicong/realistic-ssl-evaluation-pytorch | d0ea3349765f8642e97dce57cf319f703b7f1e42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import argparse, math, time, json, os
from lib import wrn, transform
from config import config
import vis
parser = argparse.ArgumentParser()
parser.add_argument("--dataset", "-d", default="cifar10", type=str, help="dataset name : [svhn, cifar10]")
pars... | 25.555556 | 106 | 0.703623 | import numpy as np
import argparse, math, time, json, os
from lib import wrn, transform
from config import config
import vis
parser = argparse.ArgumentParser()
parser.add_argument("--dataset", "-d", default="cifar10", type=str, help="dataset name : [svhn, cifar10]")
parser.add_argument("--root", "-r", default="data"... | true | true |
1c40dfec119082283f869d943aa79be46c787106 | 1,233 | py | Python | integration_tests/test_commands/tests/test_stacker.py | troyready/runway | 4fd299961a4b73df39e14f4f19a7236f7be17dd8 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_commands/tests/test_stacker.py | troyready/runway | 4fd299961a4b73df39e14f4f19a7236f7be17dd8 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_commands/tests/test_stacker.py | troyready/runway | 4fd299961a4b73df39e14f4f19a7236f7be17dd8 | [
"Apache-2.0"
] | null | null | null | """Test deploying stacker."""
# pylint: disable=no-self-use
import os
from subprocess import check_output
import boto3
from integration_tests.test_commands.test_commands import Commands
KEY = "/runway/integration-test/stacker"
VALUE = "foo"
class TestRunStacker(Commands):
"""Tests run-stacker subcommand."""
... | 27.4 | 88 | 0.60665 | import os
from subprocess import check_output
import boto3
from integration_tests.test_commands.test_commands import Commands
KEY = "/runway/integration-test/stacker"
VALUE = "foo"
class TestRunStacker(Commands):
TEST_NAME = __name__
def get_stack_path(self):
return os.path.join(
os.p... | true | true |
1c40e0c8d7f2d926101325d5f768f04f96b4f6f0 | 6,474 | py | Python | test/functional/nulldummy.py | hendry19901990/babycoin | c973192d7e877249b0c58127f10ea95083309993 | [
"MIT"
] | null | null | null | test/functional/nulldummy.py | hendry19901990/babycoin | c973192d7e877249b0c58127f10ea95083309993 | [
"MIT"
] | null | null | null | test/functional/nulldummy.py | hendry19901990/babycoin | c973192d7e877249b0c58127f10ea95083309993 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Babycoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test NULLDUMMY softfork.
Connect to a single node.
Generate 2 blocks (save the coinbases for later).
Gener... | 49.045455 | 145 | 0.701267 |
from test_framework.test_framework import BabycoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, NetworkThread
from test_framework.blocktools import create_coinbase, create_block, add_witness_commitment
from test_framework.script import CScript
from io import BytesIO
... | true | true |
1c40e0fff52728bd0af1f0cfdd008ddd639c57ea | 2,255 | py | Python | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_checkos/Opengauss_Function_Tools_gs_checkos_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_checkos/Opengauss_Function_Tools_gs_checkos_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_checkos/Opengauss_Function_Tools_gs_checkos_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 34.166667 | 109 | 0.572062 |
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
logger = Logger()
class Tools(unittest.TestCase):
def setUp(self):
logger.info('--------------Opengauss_Function_Tools_gs_checkos_Case0006start------... | true | true |
1c40e117ad75d54eeb6b012db34f68dbff01bc78 | 1,734 | py | Python | tool_box/conf_auto_fill/pre_field_info_add.py | diudiu/featurefactory | ee02ad9e3ea66e2eeafe6e11859801f0420c7d9e | [
"MIT"
] | null | null | null | tool_box/conf_auto_fill/pre_field_info_add.py | diudiu/featurefactory | ee02ad9e3ea66e2eeafe6e11859801f0420c7d9e | [
"MIT"
] | null | null | null | tool_box/conf_auto_fill/pre_field_info_add.py | diudiu/featurefactory | ee02ad9e3ea66e2eeafe6e11859801f0420c7d9e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
License SYPH-L.
Copyright (c) 2013- SYPH(Shaohan Niu), All Rights Reserved.
-----------------------------------------------------------
Author: S.JunPeng
Date: 2016/12/26
Change Activity:
"""
import os
import sys
import xlrd
home_path = os.path.dirname(os.path.dirn... | 26.676923 | 74 | 0.586505 |
import os
import sys
import xlrd
home_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(home_path)
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'featurefactory.settings')
import django
django.setup()
from apps.etl.models import PreFieldInfo
def load_field_info_from_xls(file_pat... | true | true |
1c40e1d1cb6ec185d05aa5e64e876a4d54ae1721 | 1,805 | py | Python | kokemomo/plugins/engine/controller/km_access_check.py | Kokemomo/Kokemomo | 614504dc49b2f509b25c9ec2229f4438db73bab7 | [
"MIT"
] | 4 | 2016-06-12T13:19:23.000Z | 2020-01-29T09:46:15.000Z | kokemomo/plugins/engine/controller/km_access_check.py | Kokemomo/Kokemomo | 614504dc49b2f509b25c9ec2229f4438db73bab7 | [
"MIT"
] | 67 | 2015-09-10T04:28:33.000Z | 2019-09-19T09:08:11.000Z | kokemomo/plugins/engine/controller/km_access_check.py | Kokemomo/Kokemomo | 614504dc49b2f509b25c9ec2229f4438db73bab7 | [
"MIT"
] | 2 | 2016-06-13T11:20:42.000Z | 2016-07-22T07:44:31.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from functools import wraps
from kokemomo.settings import SETTINGS
from kokemomo.plugins.engine.model.km_user_table import KMUser
from kokemomo.plugins.engine.model.km_group_table import KMGroup
from kokemomo.plugins.engine.model.km_role_table import KMRole
from .km_sessio... | 27.769231 | 74 | 0.629363 |
from functools import wraps
from kokemomo.settings import SETTINGS
from kokemomo.plugins.engine.model.km_user_table import KMUser
from kokemomo.plugins.engine.model.km_group_table import KMGroup
from kokemomo.plugins.engine.model.km_role_table import KMRole
from .km_session_manager import get_value_to_session
__au... | true | true |
1c40e30cd61d7c7f4fac7d007a8b7b4a5d1ec687 | 1,159 | py | Python | todoList.py | G3Code-CS/Python2-follow-along | 267ca69e9bd90e3ccffebf8417a371779e8a3575 | [
"MIT"
] | null | null | null | todoList.py | G3Code-CS/Python2-follow-along | 267ca69e9bd90e3ccffebf8417a371779e8a3575 | [
"MIT"
] | null | null | null | todoList.py | G3Code-CS/Python2-follow-along | 267ca69e9bd90e3ccffebf8417a371779e8a3575 | [
"MIT"
] | null | null | null | class TodoList:
def __init__(self, name):
self.name=name
self.items=[]
def __str__(self):
return f"{self.name}: {self.items}"
def __repr__(self):
return f"TodoList({repr(self.name)})"
quit = False
all_lists = []
current_list = None
while not quit:
#Get the inp... | 25.195652 | 109 | 0.543572 | class TodoList:
def __init__(self, name):
self.name=name
self.items=[]
def __str__(self):
return f"{self.name}: {self.items}"
def __repr__(self):
return f"TodoList({repr(self.name)})"
quit = False
all_lists = []
current_list = None
while not quit:
command ... | true | true |
1c40e5a38c227ab144e1e0c27c22be55c55890a2 | 1,333 | py | Python | sgi/academico/models/aluno.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | null | null | null | sgi/academico/models/aluno.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | 8 | 2019-12-07T13:13:34.000Z | 2021-09-02T03:07:25.000Z | sgi/academico/models/aluno.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | null | null | null | from enum import IntEnum, auto
from django.db import models
from django.utils.translation import gettext_lazy as _
from sgi.base import models as bm
class Aluno(bm.PessoaFisica):
"""
A Pessoa Física só se torna um aluno quando está devidamente
associada um curso. Uma Pessoa Física pode ser aluno de mais... | 31 | 81 | 0.634659 | from enum import IntEnum, auto
from django.db import models
from django.utils.translation import gettext_lazy as _
from sgi.base import models as bm
class Aluno(bm.PessoaFisica):
class Status(IntEnum):
MATRICULADO = auto()
EVADIDO = auto()
TRANCADO = auto()
JUBILADO = auto()
... | true | true |
1c40e64a01511123306d104ac282830293f3b951 | 14,127 | py | Python | classification_models/models/resnet.py | NazaninTafreshi/classification_models | a953e96614ef2211c654c625bbf968c2e5d04fb9 | [
"MIT"
] | null | null | null | classification_models/models/resnet.py | NazaninTafreshi/classification_models | a953e96614ef2211c654c625bbf968c2e5d04fb9 | [
"MIT"
] | null | null | null | classification_models/models/resnet.py | NazaninTafreshi/classification_models | a953e96614ef2211c654c625bbf968c2e5d04fb9 | [
"MIT"
] | null | null | null | import os
import collections
from ._common_blocks import ChannelSE
from .. import get_submodules_from_kwargs
from ..weights import load_model_weights
backend = None
layers = None
models = None
keras_utils = None
ModelParams = collections.namedtuple(
'ModelParams',
['model_name', 'repetitions', 'residual_blo... | 35.494975 | 108 | 0.609825 | import os
import collections
from ._common_blocks import ChannelSE
from .. import get_submodules_from_kwargs
from ..weights import load_model_weights
backend = None
layers = None
models = None
keras_utils = None
ModelParams = collections.namedtuple(
'ModelParams',
['model_name', 'repetitions', 'residual_blo... | true | true |
1c40e73ab629ea0dbb00732d80f05e8fcb8c73d4 | 2,385 | py | Python | tests/test_release_checks.py | iRomi14/drmlib | 0e7da6f9ec7aca3c167db667f1251b33c989bc5b | [
"Apache-2.0"
] | null | null | null | tests/test_release_checks.py | iRomi14/drmlib | 0e7da6f9ec7aca3c167db667f1251b33c989bc5b | [
"Apache-2.0"
] | null | null | null | tests/test_release_checks.py | iRomi14/drmlib | 0e7da6f9ec7aca3c167db667f1251b33c989bc5b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Performs some pre-release checks
"""
import pytest
from tests.conftest import perform_once
def test_changelog_and_version(accelize_drm):
"""
Checks if Version match with Git tag and if changelog is up to date.
"""
perform_once(__name__ + '.test_changelog_and_version')
... | 34.071429 | 80 | 0.592872 | import pytest
from tests.conftest import perform_once
def test_changelog_and_version(accelize_drm):
perform_once(__name__ + '.test_changelog_and_version')
from os.path import join
from subprocess import run, PIPE
from re import fullmatch
if not accelize_drm.pytest_build_environment:
pyte... | true | true |
1c40e745045a2c4157f067beefee2f2f2323a0a4 | 5,428 | py | Python | legacy_code/double_raster_segmentation.py | alvinshi/Mobot_2018 | 2be14a771bc184bf92beb87b0ae4fd4d5deb36b2 | [
"MIT"
] | null | null | null | legacy_code/double_raster_segmentation.py | alvinshi/Mobot_2018 | 2be14a771bc184bf92beb87b0ae4fd4d5deb36b2 | [
"MIT"
] | null | null | null | legacy_code/double_raster_segmentation.py | alvinshi/Mobot_2018 | 2be14a771bc184bf92beb87b0ae4fd4d5deb36b2 | [
"MIT"
] | null | null | null | # adaptive thresholding method
def adaptive_thresholding(img):
img_grey = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
adaptive_threshed = cv2.adaptiveThreshold(img_grey, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 1)
cv2.imshow("adaptive", adaptive_threshed)
return adaptive_threshed
# Nor... | 39.333333 | 122 | 0.595431 | def adaptive_thresholding(img):
img_grey = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
adaptive_threshed = cv2.adaptiveThreshold(img_grey, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 1)
cv2.imshow("adaptive", adaptive_threshed)
return adaptive_threshed
def normalize(img):
normalizeImg... | true | true |
1c40e7a65f2d0aa486c11a4dc3d2889b1385309c | 20,991 | py | Python | CLIP-ViL/clip/model.py | ylsung/VL_adapter | 287409f383f89a11764fc45806864693a4d3e498 | [
"MIT"
] | 41 | 2021-12-14T02:50:16.000Z | 2022-03-30T07:41:19.000Z | CLIP-ViL/clip/model.py | ylsung/VL_adapter | 287409f383f89a11764fc45806864693a4d3e498 | [
"MIT"
] | 1 | 2022-01-07T03:31:47.000Z | 2022-03-25T00:31:53.000Z | CLIP-ViL/clip/model.py | ylsung/VL_adapter | 287409f383f89a11764fc45806864693a4d3e498 | [
"MIT"
] | 2 | 2021-12-14T03:10:18.000Z | 2022-03-29T04:59:23.000Z | from collections import OrderedDict
from typing import Tuple, Union
import torch
import torch.nn.functional as F
from torch import nn
class VisualAdapter(nn.Module):
"""Conventional Adapter layer, in which the weights of up and down sampler modules
are parameters and are optimized."""
def __init__(self,... | 39.531073 | 178 | 0.616216 | from collections import OrderedDict
from typing import Tuple, Union
import torch
import torch.nn.functional as F
from torch import nn
class VisualAdapter(nn.Module):
def __init__(self, input_dim, output_dim, adapter_kind, reduction_factor=16, use_bn=True, use_gate=True):
super().__init__()
self.... | true | true |
1c40e7ccbe64aab0ac0834414cef864c92ed5b6a | 1,073 | py | Python | release/stubs.min/System/Drawing/__init___parts/GraphicsUnit.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Drawing/__init___parts/GraphicsUnit.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Drawing/__init___parts/GraphicsUnit.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class GraphicsUnit(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the unit of measure for the given data.
enum GraphicsUnit,values: Display (1),Document (5),Inch (4),Millimeter (6),Pixel (2),Point (3),World (0)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx._... | 26.170732 | 215 | 0.661696 | class GraphicsUnit(Enum,IComparable,IFormattable,IConvertible):
def __eq__(self,*args):
pass
def __format__(self,*args):
pass
def __ge__(self,*args):
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
pass
def __le__(self,*args):
pass
def __lt__(self,*args):
pass
def __ne__... | true | true |
1c40e7f353d277cb2619d721b37441b276b9c6af | 7,330 | py | Python | lib/plugins/plugin.py | cookieisland/cabernet | 9f429fe7a75707da97133b7ec4b3cf6b7aaec6cd | [
"MIT"
] | 16 | 2021-08-30T07:05:28.000Z | 2022-03-04T06:46:42.000Z | lib/plugins/plugin.py | cookieisland/cabernet | 9f429fe7a75707da97133b7ec4b3cf6b7aaec6cd | [
"MIT"
] | 7 | 2021-08-30T01:33:52.000Z | 2022-03-23T10:19:38.000Z | lib/plugins/plugin.py | cookieisland/cabernet | 9f429fe7a75707da97133b7ec4b3cf6b7aaec6cd | [
"MIT"
] | 9 | 2021-08-29T21:49:03.000Z | 2022-03-12T19:59:29.000Z | """
MIT License
Copyright (C) 2021 ROCKY4546
https://github.com/rocky4546
This file is part of Cabernet
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 lim... | 43.892216 | 136 | 0.65075 |
import logging
import json
import importlib
import importlib.resources
import lib.common.utils as utils
import lib.common.exceptions as exceptions
from lib.config.config_defn import ConfigDefn
from lib.db.db_plugins import DBPlugins
from lib.db.db_config_defn import DBConfigDefn
PLUGIN_CONFIG_DEFN_FILE = 'config_de... | true | true |
1c40e8f255e777435d15fcc720e7c664f9f56b91 | 3,197 | py | Python | models/seq2seq/Transformer.py | hyliush/deep-time-series | 3fea4f62ea740c721c559a0d413e4b3a3e214b3e | [
"Apache-2.0"
] | 5 | 2022-03-19T10:32:29.000Z | 2022-03-29T00:50:30.000Z | models/seq2seq/Transformer.py | hyliush/deep-time-series | 3fea4f62ea740c721c559a0d413e4b3a3e214b3e | [
"Apache-2.0"
] | 1 | 2022-03-22T07:52:08.000Z | 2022-03-22T07:55:28.000Z | models/seq2seq/Transformer.py | hyliush/deep-time-series | 3fea4f62ea740c721c559a0d413e4b3a3e214b3e | [
"Apache-2.0"
] | 2 | 2022-03-19T21:07:39.000Z | 2022-03-23T09:24:30.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from layers.Transformer_EncDec import Decoder, DecoderLayer, Encoder, EncoderLayer, ConvLayer
from layers.SelfAttention_Family import FullAttention, AttentionLayer
from layers.Embed import DataEmbedding
import numpy as np
class Transformer(nn.Module):... | 39.9625 | 114 | 0.558336 | import torch
import torch.nn as nn
import torch.nn.functional as F
from layers.Transformer_EncDec import Decoder, DecoderLayer, Encoder, EncoderLayer, ConvLayer
from layers.SelfAttention_Family import FullAttention, AttentionLayer
from layers.Embed import DataEmbedding
import numpy as np
class Transformer(nn.Module):... | true | true |
1c40e8f509b72527932d80c547e0cb3e0b1c1a43 | 9,242 | py | Python | scripts/genome_wide/add_win_channels.py | renskir/sv-channels | 284335dc20b775f9e90a7f77809acbb838308cd8 | [
"Apache-2.0"
] | 24 | 2021-04-14T10:34:31.000Z | 2022-03-21T07:18:05.000Z | scripts/genome_wide/add_win_channels.py | GooglingTheCancerGenome/CNN | 284335dc20b775f9e90a7f77809acbb838308cd8 | [
"Apache-2.0"
] | 49 | 2018-09-10T09:55:41.000Z | 2020-04-15T12:44:22.000Z | scripts/genome_wide/add_win_channels.py | renskir/sv-channels | 284335dc20b775f9e90a7f77809acbb838308cd8 | [
"Apache-2.0"
] | 6 | 2020-06-17T11:57:38.000Z | 2021-07-13T08:59:56.000Z | import argparse
import logging
from time import time
import numpy as np
import pysam
from functions import (is_left_clipped, is_right_clipped, load_windows,
save_windows)
def init_log(logfile):
FORMAT = '%(asctime)s %(message)s'
logging.basicConfig(format=FORMAT,
... | 36.385827 | 93 | 0.528565 | import argparse
import logging
from time import time
import numpy as np
import pysam
from functions import (is_left_clipped, is_right_clipped, load_windows,
save_windows)
def init_log(logfile):
FORMAT = '%(asctime)s %(message)s'
logging.basicConfig(format=FORMAT,
... | true | true |
1c40e97cc8a3abf448891862595818c4fa990f21 | 4,546 | py | Python | saleor/product/migrations/0030_auto_20170206_0407.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 3 | 2019-06-09T18:00:54.000Z | 2019-06-18T10:07:39.000Z | saleor/product/migrations/0030_auto_20170206_0407.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 2 | 2019-07-02T13:39:49.000Z | 2019-07-07T09:38:27.000Z | saleor/product/migrations/0030_auto_20170206_0407.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 1 | 2019-05-02T17:30:49.000Z | 2019-05-02T17:30:49.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 10:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import versatileimagefield.fields
class Migration(migrations.Migration):
dependencies = [("product", "0029_product_is_feature... | 33.426471 | 86 | 0.523977 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import versatileimagefield.fields
class Migration(migrations.Migration):
dependencies = [("product", "0029_product_is_featured")]
operations = [
migrations.AlterModelOptions(
... | true | true |
1c40ea3df699becca2e1a9f4d5908ab9016d4a01 | 2,398 | py | Python | catkin_ws/build/cv_camera/catkin_generated/pkg.develspace.context.pc.py | BiggieBoo18/mr_robotarm | c4afb4270e8ef70b9238760584575cc9e18c8d7b | [
"MIT"
] | null | null | null | catkin_ws/build/cv_camera/catkin_generated/pkg.develspace.context.pc.py | BiggieBoo18/mr_robotarm | c4afb4270e8ef70b9238760584575cc9e18c8d7b | [
"MIT"
] | null | null | null | catkin_ws/build/cv_camera/catkin_generated/pkg.develspace.context.pc.py | BiggieBoo18/mr_robotarm | c4afb4270e8ef70b9238760584575cc9e18c8d7b | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "C:/Users/yahoo/hack/mr_robotarm/catkin_ws/src/cv_camera/include;C:/opt/ros/melodic/x64/include;C:/opt/ros/melodic/x64/include/opencv".split(';') if "C:/Users/yahoo/hack/mr_robotarm/catkin_ws/src/cv_cam... | 266.444444 | 1,740 | 0.802335 | CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "C:/Users/yahoo/hack/mr_robotarm/catkin_ws/src/cv_camera/include;C:/opt/ros/melodic/x64/include;C:/opt/ros/melodic/x64/include/opencv".split(';') if "C:/Users/yahoo/hack/mr_robotarm/catkin_ws/src/cv_camera/include;C:/opt/ros/melodic/x64/include;C:/opt/ros/mel... | true | true |
1c40ea8a1ea02e403128b1f2ac60d944b4f261f9 | 472 | py | Python | setup.py | GoPreki/xlrd-layer | a6f172debe304c69fad7f69c619896d4d0ef0157 | [
"MIT"
] | null | null | null | setup.py | GoPreki/xlrd-layer | a6f172debe304c69fad7f69c619896d4d0ef0157 | [
"MIT"
] | null | null | null | setup.py | GoPreki/xlrd-layer | a6f172debe304c69fad7f69c619896d4d0ef0157 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from distutils.core import setup
setup(
name="xlrd-layer",
version="1.0.0",
author="Preki",
author_email="ramos@gopreki.com",
packages=['xlrd_layer'],
url='https://gopreki.com',
download_url="https://github.com/GoPreki/xlrd-layer",
license="MIT",
description=... | 26.222222 | 69 | 0.684322 |
from distutils.core import setup
setup(
name="xlrd-layer",
version="1.0.0",
author="Preki",
author_email="ramos@gopreki.com",
packages=['xlrd_layer'],
url='https://gopreki.com',
download_url="https://github.com/GoPreki/xlrd-layer",
license="MIT",
description="Python library for Pre... | true | true |
1c40ec6bc7f7a08df1164f18f3642a58ac7ae014 | 1,042 | py | Python | dist_input.py | omidsakhi/tpu_dist_gan | c676540dcd7c9fc8eb3e01bb976ed6655e1c906d | [
"Apache-2.0"
] | 1 | 2019-12-09T04:45:33.000Z | 2019-12-09T04:45:33.000Z | dist_input.py | omidsakhi/tpu_dist_gan | c676540dcd7c9fc8eb3e01bb976ed6655e1c906d | [
"Apache-2.0"
] | null | null | null | dist_input.py | omidsakhi/tpu_dist_gan | c676540dcd7c9fc8eb3e01bb976ed6655e1c906d | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import math
class InputFunction(object):
def __init__(self, noise_dim):
self.noise_dim = noise_dim
def points_on_circle(self, num, r):
pi = 3.14... | 28.944444 | 109 | 0.65739 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import math
class InputFunction(object):
def __init__(self, noise_dim):
self.noise_dim = noise_dim
def points_on_circle(self, num, r):
pi = 3.14... | true | true |
1c40ed0b3aa037a17466cfff094defcdad7bafa7 | 677 | py | Python | examples/plotting/file/jitter.py | kevin1kevin1k/bokeh | 9f34b5b710e2748ec803c12918ec1706098a3477 | [
"BSD-3-Clause"
] | 17 | 2020-06-14T03:47:35.000Z | 2022-03-07T00:25:23.000Z | examples/plotting/file/jitter.py | kevin1kevin1k/bokeh | 9f34b5b710e2748ec803c12918ec1706098a3477 | [
"BSD-3-Clause"
] | 12 | 2020-07-22T22:40:09.000Z | 2021-03-17T14:10:27.000Z | examples/plotting/file/jitter.py | kevin1kevin1k/bokeh | 9f34b5b710e2748ec803c12918ec1706098a3477 | [
"BSD-3-Clause"
] | 8 | 2020-06-14T03:47:23.000Z | 2021-11-20T15:14:04.000Z | from bokeh.layouts import column
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.autompg import autompg
from bokeh.transform import jitter
years = sorted(autompg.yr.unique())
p1 = figure(plot_width=600, plot_height=300, title="Years vs mpg without jittering")
p1.xgrid.grid_line_color = None... | 32.238095 | 84 | 0.751846 | from bokeh.layouts import column
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.autompg import autompg
from bokeh.transform import jitter
years = sorted(autompg.yr.unique())
p1 = figure(plot_width=600, plot_height=300, title="Years vs mpg without jittering")
p1.xgrid.grid_line_color = None... | true | true |
1c40edab30a942e4d0f8d373e55273ab7795c9e2 | 10,867 | py | Python | ding/rl_utils/adder.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | ding/rl_utils/adder.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | ding/rl_utils/adder.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | from typing import List, Dict, Any, Optional
from collections import deque
import copy
import torch
from ding.utils import list_split, lists_to_dicts
from .gae import gae, gae_data
class Adder(object):
"""
Overview:
Adder is a component that handles different transformations and calculations for tran... | 48.95045 | 119 | 0.570167 | from typing import List, Dict, Any, Optional
from collections import deque
import copy
import torch
from ding.utils import list_split, lists_to_dicts
from .gae import gae, gae_data
class Adder(object):
@classmethod
def get_gae(cls, data: List[Dict[str, Any]], last_value: torch.Tensor, gamma: float, gae_lamb... | true | true |
1c40ee00c39d0b6c3a52855b04fcd56ef6764b7a | 598 | py | Python | front/migrations/__init__.py | llazzaro/django-front | 8a04a88d42b37f4882ab43415e5f20bedae9d257 | [
"MIT"
] | 135 | 2015-01-12T22:21:41.000Z | 2021-12-12T03:52:04.000Z | front/migrations/__init__.py | P-Designs/django-front | 2f7daaa70d6b2210f4a4ad0c251b0893f15bd711 | [
"MIT"
] | 12 | 2015-04-10T12:45:04.000Z | 2020-03-22T17:32:32.000Z | front/migrations/__init__.py | P-Designs/django-front | 2f7daaa70d6b2210f4a4ad0c251b0893f15bd711 | [
"MIT"
] | 24 | 2015-01-24T01:22:18.000Z | 2022-03-15T13:06:47.000Z | """
Django migrations for django-front app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'front': 'fr... | 27.181818 | 78 | 0.754181 |
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'front': 'front.south_migrations',
}
"""
try:
from django.db import migrations except ImportError:
from django.core.exceptions import ImproperlyConfigured
rai... | true | true |
1c40eee28f9b90e96355b7775b84c6b9d38efa2a | 401 | py | Python | modules/execute_attack.py | mica-framework/cli | a5a851a73d7b9bd0431e9c8bb0c8fca401b32ccf | [
"MIT"
] | 5 | 2019-06-14T12:32:56.000Z | 2022-03-17T20:55:48.000Z | modules/execute_attack.py | mica-framework/cli | a5a851a73d7b9bd0431e9c8bb0c8fca401b32ccf | [
"MIT"
] | null | null | null | modules/execute_attack.py | mica-framework/cli | a5a851a73d7b9bd0431e9c8bb0c8fca401b32ccf | [
"MIT"
] | null | null | null | import server
from core import SessionStorage
def execute(*args):
# get the session storage
sessionStorage = args[0]
# get the attack information
attack_type = sessionStorage.get_value('list_attacks')
victims = sessionStorage.get_value('list_victims')
# execute the attack
server.run_attac... | 25.0625 | 58 | 0.730673 | import server
from core import SessionStorage
def execute(*args):
sessionStorage = args[0]
attack_type = sessionStorage.get_value('list_attacks')
victims = sessionStorage.get_value('list_victims')
server.run_attack(attack_type, victims)
return True | true | true |
1c40ef47ff46714cf9f138acd5d81098e95454ef | 407 | py | Python | Django-habits-reminder/Django-habits-reminder/users/migrations/0002_profile_image.py | KrystianKlik/Django-habits-reminder | 915e802aea87cbc48ae07c98701285379423cdf6 | [
"MIT"
] | null | null | null | Django-habits-reminder/Django-habits-reminder/users/migrations/0002_profile_image.py | KrystianKlik/Django-habits-reminder | 915e802aea87cbc48ae07c98701285379423cdf6 | [
"MIT"
] | 8 | 2021-03-19T08:39:55.000Z | 2022-02-10T10:14:40.000Z | Django-habits-reminder/Django-habits-reminder/users/migrations/0002_profile_image.py | KrystianKlik/Django-habits-reminder | 915e802aea87cbc48ae07c98701285379423cdf6 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-02-24 08:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='image',
fiel... | 21.421053 | 85 | 0.599509 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='image',
field=models.ImageField(default='default.jpg', upload... | true | true |
1c40f0d17df2d8045314b3bb535d6a2b05d9e18a | 9,091 | py | Python | common/utils_yml.py | linxichong/pyautotest | ca9483b00bdccaa9e7467e49cf4a1768b59cce26 | [
"MIT"
] | null | null | null | common/utils_yml.py | linxichong/pyautotest | ca9483b00bdccaa9e7467e49cf4a1768b59cce26 | [
"MIT"
] | 4 | 2021-06-03T07:43:09.000Z | 2022-03-12T00:48:44.000Z | common/utils_yml.py | linxichong/pyautotest | ca9483b00bdccaa9e7467e49cf4a1768b59cce26 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import os
import json
import time
from selenium.webdriver.common.alert impo... | 40.225664 | 228 | 0.605104 | from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import os
import json
import time
from selenium.webdriver.common.alert impo... | true | true |
1c40f315bb2de5005ee660d0aceb624424c052f9 | 522 | py | Python | examples/1_Introduction/helloworld.py | kar-thik/TensorFlow-Examples | 2097ad0a6faf55a4a9cee00cc1b0ae3454b178fc | [
"MIT"
] | 23 | 2017-07-07T07:00:52.000Z | 2022-03-09T06:49:17.000Z | examples/1_Introduction/helloworld.py | kar-thik/TensorFlow-Examples | 2097ad0a6faf55a4a9cee00cc1b0ae3454b178fc | [
"MIT"
] | 1 | 2020-01-07T06:27:59.000Z | 2020-04-04T17:06:05.000Z | examples/1_Introduction/helloworld.py | kar-thik/TensorFlow-Examples | 2097ad0a6faf55a4a9cee00cc1b0ae3454b178fc | [
"MIT"
] | 26 | 2017-06-13T01:44:24.000Z | 2021-06-17T18:11:26.000Z | '''
HelloWorld example using TensorFlow library.
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
from __future__ import print_function
import tensorflow as tf
# Simple hello world using TensorFlow
# Create a Constant op
# The op is added as a node to the default graph.
#
#... | 20.076923 | 62 | 0.758621 |
from __future__ import print_function
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
| true | true |
1c40f352ff0180872c40eee0f3b7b37879d3f85f | 6,712 | py | Python | tests/components/light/test_reproduce_state.py | olbjan/home-assistant-1 | 1adb45f74e96fc5eff137a3727647a7e428e123c | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/components/light/test_reproduce_state.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/components/light/test_reproduce_state.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Test reproduce state for Light."""
from homeassistant.components.light.reproduce_state import DEPRECATION_WARNING
from homeassistant.core import State
from tests.common import async_mock_service
VALID_BRIGHTNESS = {"brightness": 180}
VALID_WHITE_VALUE = {"white_value": 200}
VALID_FLASH = {"flash": "short"}
VALID_E... | 39.482353 | 80 | 0.681317 | from homeassistant.components.light.reproduce_state import DEPRECATION_WARNING
from homeassistant.core import State
from tests.common import async_mock_service
VALID_BRIGHTNESS = {"brightness": 180}
VALID_WHITE_VALUE = {"white_value": 200}
VALID_FLASH = {"flash": "short"}
VALID_EFFECT = {"effect": "random"}
VALID_TRA... | true | true |
1c40f405c2c15916fe6045fd7c3a17301d922752 | 3,574 | py | Python | SCRAM/Core/SiteConfig.py | gudrutis/pySCRAM | 662aa639caa52d0ccc931f0ed41f245ad37c9765 | [
"MIT"
] | 5 | 2015-09-15T15:07:43.000Z | 2021-11-15T08:07:47.000Z | SCRAM/Core/SiteConfig.py | gudrutis/pySCRAM | 662aa639caa52d0ccc931f0ed41f245ad37c9765 | [
"MIT"
] | 24 | 2015-01-07T08:16:28.000Z | 2022-03-26T08:20:27.000Z | SCRAM/Core/SiteConfig.py | gudrutis/pySCRAM | 662aa639caa52d0ccc931f0ed41f245ad37c9765 | [
"MIT"
] | 2 | 2018-10-08T11:31:44.000Z | 2021-11-15T08:01:12.000Z | from sys import stderr
from os.path import join, exists
from re import match
from os import environ
class SiteConfig(object):
def __init__(self):
self.siteconf = 'etc/scramrc/site.cfg'
self.site = {'release-checks': {}, 'release-checks-timeout': {}}
self.site['release-checks']['value'] = "... | 43.585366 | 115 | 0.510912 | from sys import stderr
from os.path import join, exists
from re import match
from os import environ
class SiteConfig(object):
def __init__(self):
self.siteconf = 'etc/scramrc/site.cfg'
self.site = {'release-checks': {}, 'release-checks-timeout': {}}
self.site['release-checks']['value'] = "... | true | true |
1c40f4310d253031dc57ddc58e471fbf7ff1469b | 857 | py | Python | games/utils/switch_input.py | ja-mesmugford/talon_config | d30e02f30873986b899bd1f10efc7442c6bd6d22 | [
"MIT"
] | 1 | 2022-02-04T06:19:23.000Z | 2022-02-04T06:19:23.000Z | games/utils/switch_input.py | ja-mesmugford/talon_config | d30e02f30873986b899bd1f10efc7442c6bd6d22 | [
"MIT"
] | null | null | null | games/utils/switch_input.py | ja-mesmugford/talon_config | d30e02f30873986b899bd1f10efc7442c6bd6d22 | [
"MIT"
] | null | null | null | """This module is a stopgap to improve game compatibility.
Replaces Talon's native input within certain contexts.
"""
import time
def switch_to_keyboard_module(context):
"""Switch to using the PyPI `keyboard` module for input in this context.
Some games aren't registering Talon's input as of Windows beta ... | 29.551724 | 78 | 0.644107 |
import time
def switch_to_keyboard_module(context):
import keyboard
@context.action_class("main")
class MainActions:
def key(key: str):
for individual_press in key.split(" "):
keys = individual_press.split("-")
keyboard.press_and_release("+... | true | true |
1c40f4f29e2db0b4751f30f3a623537319be4258 | 3,312 | py | Python | project/code/thermo.py | HeyItsRiddhi/cs207_riddhi_shah | 18d7d6f1fcad213ce35a93ee33c03620f8b06b65 | [
"MIT"
] | null | null | null | project/code/thermo.py | HeyItsRiddhi/cs207_riddhi_shah | 18d7d6f1fcad213ce35a93ee33c03620f8b06b65 | [
"MIT"
] | null | null | null | project/code/thermo.py | HeyItsRiddhi/cs207_riddhi_shah | 18d7d6f1fcad213ce35a93ee33c03620f8b06b65 | [
"MIT"
] | null | null | null | """Thermodynamics and Thermochemistry for Chemical Kinetics
This module contains a thermochem class with methods for
computing the backward reaction rates for a set of
reversible, elementary reactions.
"""
import numpy as np
class thermochem:
"""Methods for calculating the backward reaction rate.
Cp_over_R... | 36.395604 | 78 | 0.602053 |
import numpy as np
class thermochem:
def __init__(self, rxnset):
self.rxnset = rxnset
self.p0 = 1.0e+05 self.R = 8.3144598 self.gamma = np.sum(self.rxnset.nuij, axis=0)
def Cp_over_R(self, T):
a = self.rxnset.nasa7_coeffs
Cp_R... | true | true |
1c40f60cd66cb57d752b99ae0302f7849ac74e37 | 579 | py | Python | package/cloudshell/cp/azure/common/parsers/command_result_parser.py | tim-spiglanin/Azure-Shell | 58c52994f0d6cfd798c5dca33737419ec18363d4 | [
"Apache-2.0"
] | 5 | 2016-09-08T08:33:47.000Z | 2020-02-10T12:31:15.000Z | package/cloudshell/cp/aws/domain/services/parsers/command_results_parser.py | QualiSystemsLab/AWS-Shell-ext | bf7b62640d8d97a5e9199edb7a1ada0b98aac6fb | [
"0BSD"
] | 505 | 2016-08-09T07:41:03.000Z | 2021-02-08T20:26:46.000Z | package/cloudshell/cp/aws/domain/services/parsers/command_results_parser.py | QualiSystemsLab/AWS-Shell-ext | bf7b62640d8d97a5e9199edb7a1ada0b98aac6fb | [
"0BSD"
] | 9 | 2016-06-20T11:41:54.000Z | 2020-11-21T00:42:45.000Z | import jsonpickle
class CommandResultsParser(object):
def set_command_result(self, result, unpicklable=False):
"""
Serializes output as JSON and writes it to console output wrapped with special prefix and suffix
:param result: Result to return
:param unpicklable: If True adds JSON ... | 38.6 | 104 | 0.678756 | import jsonpickle
class CommandResultsParser(object):
def set_command_result(self, result, unpicklable=False):
json = jsonpickle.encode(result, unpicklable=unpicklable)
result_for_output = str(json)
return result_for_output
| true | true |
1c40f9e39c4c934d336e12ba96942af24833e077 | 20,369 | py | Python | Node_Utility.py | SBCV/PythonBlenderUtility | 4f91c5a356fede103bcb8c2a9ba1d4d0b01aadc3 | [
"MIT"
] | 1 | 2022-01-30T05:58:06.000Z | 2022-01-30T05:58:06.000Z | Node_Utility.py | SBCV/PythonBlenderUtility | 4f91c5a356fede103bcb8c2a9ba1d4d0b01aadc3 | [
"MIT"
] | null | null | null | Node_Utility.py | SBCV/PythonBlenderUtility | 4f91c5a356fede103bcb8c2a9ba1d4d0b01aadc3 | [
"MIT"
] | null | null | null |
import bpy
import os
from collections import defaultdict
from Utility.Logging_Extension import logger
# http://blender.stackexchange.com/questions/8936/does-switching-from-blender-render-to-cycles-mess-things-up
# * All matierals in cycles use nodes (even if you set up the material in the Properties panel, it will c... | 43.804301 | 120 | 0.62276 |
import bpy
import os
from collections import defaultdict
from Utility.Logging_Extension import logger
# If you want to use this in a script you can press Control-C while your mouse is over the button to copy it to the
# clipboard.
# =================
# alternative approach (not tested yet)
# http://blender.stacke... | true | true |
1c40faaf42dbbc4233733833e983cceebe86327e | 575 | py | Python | cfn_sweeper/artwork.py | rileydakota/cfn-sweeper | 0f76aed79e1200e006322b2b0371475a3fd7e475 | [
"MIT"
] | 9 | 2021-08-20T17:09:40.000Z | 2021-08-23T18:17:25.000Z | cfn_sweeper/artwork.py | rileydakota/cfn-sweeper | 0f76aed79e1200e006322b2b0371475a3fd7e475 | [
"MIT"
] | 5 | 2021-08-20T16:58:42.000Z | 2022-01-31T21:37:56.000Z | cfn_sweeper/artwork.py | rileydakota/cfn-sweeper | 0f76aed79e1200e006322b2b0371475a3fd7e475 | [
"MIT"
] | 1 | 2022-02-01T14:28:33.000Z | 2022-02-01T14:28:33.000Z | from re import X
from pyfiglet import Figlet
class Artwork():
def art():
f = Figlet(font='larry3d')
print("\n https://github.com/rileydakota/cfn-sweeper" )
print (f.renderText('CFN SWEEPER \n'))
print((" The umanaged resource detector tool!").center(20))
... | 47.916667 | 96 | 0.405217 | from re import X
from pyfiglet import Figlet
class Artwork():
def art():
f = Figlet(font='larry3d')
print("\n https://github.com/rileydakota/cfn-sweeper" )
print (f.renderText('CFN SWEEPER \n'))
print((" The umanaged resource detector tool!").center(20))
... | true | true |
1c40fb60855ff8ad9cbd7cc279f358bfd6c110bb | 304 | py | Python | greentest/test_hub_join.py | davidbalbert/gevent3000 | 3c940dbb2804ec7fe9001758d339eeb423793a28 | [
"MIT"
] | 1 | 2017-01-04T10:58:59.000Z | 2017-01-04T10:58:59.000Z | greentest/test_hub_join.py | hewigovens/gevent-for-ios | 0ef7b67497297b71ed71bca068e56bc103df9069 | [
"MIT"
] | 1 | 2019-04-24T06:29:29.000Z | 2019-04-24T06:29:29.000Z | greentest/test_hub_join.py | davidbalbert/gevent3000 | 3c940dbb2804ec7fe9001758d339eeb423793a28 | [
"MIT"
] | null | null | null | import gevent
# hub.join() guarantees that loop has exited cleanly
res = gevent.get_hub().join()
assert res is True, res
res = gevent.get_hub().join()
assert res is True, res
# but it is still possible to use gevent afterwards
gevent.sleep(0.01)
res = gevent.get_hub().join()
assert res is True, res
| 20.266667 | 52 | 0.730263 | import gevent
res = gevent.get_hub().join()
assert res is True, res
res = gevent.get_hub().join()
assert res is True, res
gevent.sleep(0.01)
res = gevent.get_hub().join()
assert res is True, res
| true | true |
1c40fcbd5a8dba2b2a356b28ee8871a2e93137ee | 19,573 | py | Python | lime/superoperator.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | 4 | 2020-01-15T11:52:23.000Z | 2021-01-05T19:40:36.000Z | lime/superoperator.py | binggu56/scitools | 3f7ce3d8411a23186c73f1bb87a8778e039fbd0b | [
"MIT"
] | null | null | null | lime/superoperator.py | binggu56/scitools | 3f7ce3d8411a23186c73f1bb87a8778e039fbd0b | [
"MIT"
] | 3 | 2020-02-14T07:10:44.000Z | 2021-04-14T17:49:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 25 22:01:00 2020
@author: Bing
Modules for computing signals with superoperator formalism in Liouville space
Instead of performing open quantum dynamics, the Liouvillian is directly diagonalized
Possible improvements:
1. merge the Qobj class ... | 22.497701 | 99 | 0.535278 | import numpy as np
import matplotlib.pyplot as plt
from scipy.sparse import kron, identity, issparse
from scipy.sparse.linalg import eigs
import scipy
import math
from numba import jit
from numpy import exp
from lime.phys import dag, pauli
from lime.mol import Result
def liouvillian(H, c_ops):
if c_ops is ... | true | true |
1c40fce82fec6b6c713a51aa37d5189ac454d3f6 | 1,379 | py | Python | fragbuilder/bio_pdb/Structure.py | larsbratholm/fragbuilder | e16cbcb190403b5fef49811abd11d16d7ef7fb30 | [
"BSD-2-Clause"
] | null | null | null | fragbuilder/bio_pdb/Structure.py | larsbratholm/fragbuilder | e16cbcb190403b5fef49811abd11d16d7ef7fb30 | [
"BSD-2-Clause"
] | null | null | null | fragbuilder/bio_pdb/Structure.py | larsbratholm/fragbuilder | e16cbcb190403b5fef49811abd11d16d7ef7fb30 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""The structure class, representing a macromolecular structure."""
from .Entity import... | 24.625 | 82 | 0.59826 |
from .Entity import Entity
class Structure(Entity):
def __init__(self, id):
self.level="S"
Entity.__init__(self, id)
def __repr__(self):
return "<Structure id=%s>" % self.get_id()
def _sort(self, m1, m2):
return cmp(m1.get_id(), m2.get_id())
def get_... | true | true |
1c40fdf35faba0891f2a51223186847b12b1ad98 | 4,348 | py | Python | alphaml/engine/components/models/regression/libsvm_svr.py | dingdian110/alpha-ml | d6a7a8a8a3452a7e3362bf0ef32b9ac5fe215fde | [
"BSD-3-Clause"
] | 1 | 2021-09-06T20:21:15.000Z | 2021-09-06T20:21:15.000Z | alphaml/engine/components/models/regression/libsvm_svr.py | dingdian110/alpha-ml | d6a7a8a8a3452a7e3362bf0ef32b9ac5fe215fde | [
"BSD-3-Clause"
] | null | null | null | alphaml/engine/components/models/regression/libsvm_svr.py | dingdian110/alpha-ml | d6a7a8a8a3452a7e3362bf0ef32b9ac5fe215fde | [
"BSD-3-Clause"
] | null | null | null | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.conditions import EqualsCondition, InCondition
from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter, \
UnParametrizedHyperparameter
from alphaml.utils.constant... | 41.018868 | 79 | 0.583947 | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.conditions import EqualsCondition, InCondition
from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter, \
UnParametrizedHyperparameter
from alphaml.utils.constant... | true | true |
1c40febbb24609df26dd7e03553d56d35ba52d03 | 582 | py | Python | colosseum/mdps/simple_grid/episodic/mdp.py | MichelangeloConserva/Colosseum | b0711fd9ce75520deb74cda75c148984a8e4152f | [
"MIT"
] | null | null | null | colosseum/mdps/simple_grid/episodic/mdp.py | MichelangeloConserva/Colosseum | b0711fd9ce75520deb74cda75c148984a8e4152f | [
"MIT"
] | null | null | null | colosseum/mdps/simple_grid/episodic/mdp.py | MichelangeloConserva/Colosseum | b0711fd9ce75520deb74cda75c148984a8e4152f | [
"MIT"
] | null | null | null | import gin
from colosseum.loops import human_loop
from colosseum.mdps import EpisodicMDP
from colosseum.mdps.simple_grid.simple_grid import SimpleGridMDP, SimpleGridReward
@gin.configurable
class SimpleGridEpisodic(EpisodicMDP, SimpleGridMDP):
pass
if __name__ == "__main__":
mdp = SimpleGridEpisodic(
... | 22.384615 | 82 | 0.714777 | import gin
from colosseum.loops import human_loop
from colosseum.mdps import EpisodicMDP
from colosseum.mdps.simple_grid.simple_grid import SimpleGridMDP, SimpleGridReward
@gin.configurable
class SimpleGridEpisodic(EpisodicMDP, SimpleGridMDP):
pass
if __name__ == "__main__":
mdp = SimpleGridEpisodic(
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.