hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1b4a5baaed51fa74d86beea7e2da8bcf0e6c08 | 3,478 | py | Python | proxy_spider/settings.py | HowardWH/proxyIPpool | 044f161fab82c034ffd8a1a12719b0c3f0a933bc | [
"MIT"
] | 62 | 2017-04-21T06:41:06.000Z | 2022-02-12T05:22:29.000Z | proxy_spider/settings.py | HowardWH/proxyIPpool | 044f161fab82c034ffd8a1a12719b0c3f0a933bc | [
"MIT"
] | 2 | 2017-08-19T16:26:07.000Z | 2017-08-21T04:46:54.000Z | proxy_spider/settings.py | HowardWH/proxyIPpool | 044f161fab82c034ffd8a1a12719b0c3f0a933bc | [
"MIT"
] | 27 | 2017-02-15T04:38:25.000Z | 2019-08-19T05:48:34.000Z | # -*- coding: utf-8 -*-
# Scrapy settings for proxy_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/l... | 35.85567 | 125 | 0.782059 |
BOT_NAME = 'proxy_spider'
SPIDER_MODULES = ['proxy_spider.spiders']
NEWSPIDER_MODULE = 'proxy_spider.spiders'
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36'
ROBOTSTXT_OBEY = False
DOWNLOADER_MIDDLEWARES ... | true | true |
1c1b4a60ec4ec4c894cc1c63e5473ddddaf77353 | 1,365 | py | Python | tests/tools/test_surelog.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | 1 | 2022-03-10T03:56:49.000Z | 2022-03-10T03:56:49.000Z | tests/tools/test_surelog.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | tests/tools/test_surelog.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | import os
import siliconcompiler
import pytest
@pytest.mark.eda
@pytest.mark.quick
def test_surelog(scroot):
gcd_src = os.path.join(scroot, 'examples', 'gcd', 'gcd.v')
design = "gcd"
step = "import"
chip = siliconcompiler.Chip(loglevel="INFO")
chip.load_target('freepdk45_demo')
chip.add('sour... | 24.375 | 62 | 0.660806 | import os
import siliconcompiler
import pytest
@pytest.mark.eda
@pytest.mark.quick
def test_surelog(scroot):
gcd_src = os.path.join(scroot, 'examples', 'gcd', 'gcd.v')
design = "gcd"
step = "import"
chip = siliconcompiler.Chip(loglevel="INFO")
chip.load_target('freepdk45_demo')
chip.add('sour... | true | true |
1c1b4a90e7a14a4d0d5893f3a08c79fafa035d65 | 711 | py | Python | paddleaudio/utils/__init__.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 1,540 | 2017-11-14T13:26:33.000Z | 2021-11-09T14:05:08.000Z | paddleaudio/utils/__init__.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 599 | 2017-11-14T13:19:12.000Z | 2021-11-09T01:58:26.000Z | paddleaudio/utils/__init__.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 449 | 2017-11-14T12:48:46.000Z | 2021-11-06T09:34:33.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.421053 | 74 | 0.758087 |
from .download import *
from .env import *
from .error import *
from .log import *
from .time import *
| true | true |
1c1b4aa253738f4c6e4d80873719d7186c91109f | 29,508 | py | Python | great_expectations/render/renderer/site_builder.py | kyleaton/great_expectations | a856513859445cdb1b254e0d90022bab6257b6a2 | [
"Apache-2.0"
] | null | null | null | great_expectations/render/renderer/site_builder.py | kyleaton/great_expectations | a856513859445cdb1b254e0d90022bab6257b6a2 | [
"Apache-2.0"
] | null | null | null | great_expectations/render/renderer/site_builder.py | kyleaton/great_expectations | a856513859445cdb1b254e0d90022bab6257b6a2 | [
"Apache-2.0"
] | null | null | null | import logging
from collections import OrderedDict
import os
import traceback
from great_expectations.core import nested_update
from great_expectations.data_context.store.html_site_store import (
HtmlSiteStore,
SiteSectionIdentifier,
)
from great_expectations.data_context.types.resource_identifiers import (
... | 42.335725 | 127 | 0.610817 | import logging
from collections import OrderedDict
import os
import traceback
from great_expectations.core import nested_update
from great_expectations.data_context.store.html_site_store import (
HtmlSiteStore,
SiteSectionIdentifier,
)
from great_expectations.data_context.types.resource_identifiers import (
... | true | true |
1c1b4bd2cc30f239e144ccd31159a32cad564439 | 7,362 | py | Python | cmdb-usage/biz/handlers/ri_elasticache_handler.py | zjj1002/aws-cloud-cmdb-system | 47982007688e5db1272435891cb654ab11d0d60a | [
"Apache-2.0"
] | null | null | null | cmdb-usage/biz/handlers/ri_elasticache_handler.py | zjj1002/aws-cloud-cmdb-system | 47982007688e5db1272435891cb654ab11d0d60a | [
"Apache-2.0"
] | 1 | 2022-01-04T13:53:16.000Z | 2022-01-04T13:53:16.000Z | cmdb-usage/biz/handlers/ri_elasticache_handler.py | zjj1002/aws-cloud-cmdb-system | 47982007688e5db1272435891cb654ab11d0d60a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/9/28
# @Author : Fred liuchuanhao
# @File : .py
# @Role :
import csv
import decimal
from datetime import datetime, timedelta
from websdk.consts import const
from sqlalchemy import or_
from libs.base_handler import BaseHandler
from models.elasticache... | 48.434211 | 122 | 0.58897 |
import csv
import decimal
from datetime import datetime, timedelta
from websdk.consts import const
from sqlalchemy import or_
from libs.base_handler import BaseHandler
from models.elasticache_ri_db import RiElastiCache, model_to_dict, AWSElastiCacheRiUsageReport
from websdk.db_context import DBContext
from tornad... | true | true |
1c1b4bfd6ba7d8e467e5ed99f5ef4ec41b11c769 | 5,957 | py | Python | doc/conf.py | tkhyn/py_cpp | 3328849b375acb7ff3988946b30392eed8d3db23 | [
"MIT"
] | null | null | null | doc/conf.py | tkhyn/py_cpp | 3328849b375acb7ff3988946b30392eed8d3db23 | [
"MIT"
] | null | null | null | doc/conf.py | tkhyn/py_cpp | 3328849b375acb7ff3988946b30392eed8d3db23 | [
"MIT"
] | 1 | 2021-08-31T03:54:24.000Z | 2021-08-31T03:54:24.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Imports -------------------------------------------------------... | 30.706186 | 80 | 0.622293 |
import os
import sys
from glob import glob
from py_cpp import __version__
package_name = 'py_cpp'
doxml_dir = os.path.join('doc', '_doxml')
docs_path = os.path.dirname(__file__)
root_path = os.path.dirname(docs_path)
src_path = os.path.join(root_path, package_name)
sys.... | true | true |
1c1b4d6e137967e16407a99f68d1811416305460 | 5,452 | py | Python | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py | jalauzon-msft/azure-sdk-for-python | 15967f5c6d3376f2334a382486ba86339786e028 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_sql_virtual_machine_management_client.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.247788 | 144 | 0.724688 |
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from ._configuration import SqlVirtualMachineManagementClientConfiguration
from ... | true | true |
1c1b4df6cd424dd13e807cda8d16843825412c8e | 1,681 | py | Python | src/ground/grain-server.backup/mcc/iridium/messages/basic.py | shostakovichs-spacecraft-factory/cansat-2018-2019 | db09eec8d15dd741cd4358da7a44fabc29ab85f0 | [
"MIT"
] | 5 | 2018-11-28T18:54:37.000Z | 2019-12-04T06:49:54.000Z | src/ground/grain-server.backup/mcc/iridium/messages/basic.py | shostakovichs-spacecraft-factory/cansat-2018-2019 | db09eec8d15dd741cd4358da7a44fabc29ab85f0 | [
"MIT"
] | 23 | 2018-11-29T10:53:35.000Z | 2019-05-18T07:45:42.000Z | src/ground/grain-server.backup/mcc/iridium/messages/basic.py | shostakovichs-spacecraft-factory/cansat-2018-2019 | db09eec8d15dd741cd4358da7a44fabc29ab85f0 | [
"MIT"
] | null | null | null | import typing
from . import enum
class InformationElement:
""" Информационный элемент. Сообщения состоят из информационных элементов.
Этот класс олицетворяет такие элементы
"""
IEI: enum.IEI = None
""" Идентификатор информационного элемента. Реализуется в сабклассе """
def unpack(self, i... | 32.960784 | 89 | 0.66508 | import typing
from . import enum
class InformationElement:
IEI: enum.IEI = None
def unpack(self, ie_payload):
self._unpack_body(ie_payload)
def pack(self)->bytes:
return self._pack_body()
def _unpack_body(self, body_data: bytes):
raise NotImplementedError()
def _pack_b... | true | true |
1c1b4ebe49480e9224b09fdff4b01fbfa40f7663 | 12,698 | py | Python | lib/geopy/geocoders/googlev3.py | fabiotanniguchi/emdec-gtfs | 823274d45263409d1d3ee56cf07f60e12d64003a | [
"WTFPL"
] | null | null | null | lib/geopy/geocoders/googlev3.py | fabiotanniguchi/emdec-gtfs | 823274d45263409d1d3ee56cf07f60e12d64003a | [
"WTFPL"
] | null | null | null | lib/geopy/geocoders/googlev3.py | fabiotanniguchi/emdec-gtfs | 823274d45263409d1d3ee56cf07f60e12d64003a | [
"WTFPL"
] | null | null | null | """
:class:`.GoogleV3` is the Google Maps V3 geocoder.
"""
import base64
import hashlib
import hmac
from geopy.compat import urlencode
from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT, DEFAULT_SCHEME
from geopy.exc import (
GeocoderQueryError,
GeocoderQuotaExceeded,
ConfigurationError,
Geocod... | 33.861333 | 105 | 0.584265 |
import base64
import hashlib
import hmac
from geopy.compat import urlencode
from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT, DEFAULT_SCHEME
from geopy.exc import (
GeocoderQueryError,
GeocoderQuotaExceeded,
ConfigurationError,
GeocoderParseError,
GeocoderQueryError,
)
from geopy.location... | true | true |
1c1b4ed0ed1f113c402d3660f36f16e2eac38a70 | 2,557 | py | Python | custom/icds_reports/tests/agg_tests/test_cas_data_export.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/tests/agg_tests/test_cas_data_export.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/tests/agg_tests/test_cas_data_export.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | from custom.icds_reports.queries import get_cas_data_blob_file
import io
import os
import csv
from custom.icds_reports.tests.agg_tests import OUTPUT_PATH, CSVTestCase
class TestLocationView(CSVTestCase):
always_include_columns = {'awc_id', 'case_id'}
def _get_data_from_blobdb(self, indicator, state_id, mon... | 31.9625 | 80 | 0.575284 | from custom.icds_reports.queries import get_cas_data_blob_file
import io
import os
import csv
from custom.icds_reports.tests.agg_tests import OUTPUT_PATH, CSVTestCase
class TestLocationView(CSVTestCase):
always_include_columns = {'awc_id', 'case_id'}
def _get_data_from_blobdb(self, indicator, state_id, mon... | true | true |
1c1b4fc13973a4eeedaf061c71e4dee0d4f72386 | 999 | py | Python | myros2_ws/src/mytalker/setup.py | TREC-LAB/interesting-ros2 | 61cb3a05f43fe3348ca44f929744ec94da069418 | [
"MIT"
] | null | null | null | myros2_ws/src/mytalker/setup.py | TREC-LAB/interesting-ros2 | 61cb3a05f43fe3348ca44f929744ec94da069418 | [
"MIT"
] | null | null | null | myros2_ws/src/mytalker/setup.py | TREC-LAB/interesting-ros2 | 61cb3a05f43fe3348ca44f929744ec94da069418 | [
"MIT"
] | null | null | null | from setuptools import setup
package_name = 'mytalker'
setup(
name=package_name,
version='0.5.1',
packages=[],
py_modules=[
'talker'],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.... | 25.615385 | 62 | 0.598599 | from setuptools import setup
package_name = 'mytalker'
setup(
name=package_name,
version='0.5.1',
packages=[],
py_modules=[
'talker'],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.... | true | true |
1c1b4feb73bddfbc81abdefcfc0bdfab206d3f11 | 9,672 | py | Python | calvin/runtime/south/async/twistedimpl/server_connection.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 334 | 2015-06-04T15:14:28.000Z | 2022-02-09T11:14:17.000Z | calvin/runtime/south/async/twistedimpl/server_connection.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 89 | 2015-06-13T19:15:35.000Z | 2019-12-03T19:23:20.000Z | calvin/runtime/south/async/twistedimpl/server_connection.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 112 | 2015-06-06T19:16:54.000Z | 2020-10-19T01:27:55.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson AB
#
# 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 ... | 33.818182 | 111 | 0.627895 |
from twisted.internet.protocol import Protocol
from twisted.internet.protocol import Factory
from twisted.internet.protocol import DatagramProtocol
from twisted.protocols.basic import LineReceiver
from twisted.internet import error
from calvin.utilities import certificate
from calvin.utilities import ru... | false | true |
1c1b50321f061a1fdde093b527e5865c333ae464 | 81,075 | py | Python | tencentcloud/apigateway/v20180808/apigateway_client.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | tencentcloud/apigateway/v20180808/apigateway_client.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | tencentcloud/apigateway/v20180808/apigateway_client.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 42.761076 | 120 | 0.604366 |
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.apigateway.v20180808 import models
class ApigatewayClient(AbstractClient):
_apiVersion = '2018-08-08'
_end... | true | true |
1c1b50e7ea9f10b2f021f1154fb4c0345a92ba75 | 1,198 | py | Python | mcstatus/tests/test_timeout.py | audiohacked/mcstatus | a31e808b1f35190c3875645e40d5bc31a6f3a950 | [
"Apache-2.0"
] | null | null | null | mcstatus/tests/test_timeout.py | audiohacked/mcstatus | a31e808b1f35190c3875645e40d5bc31a6f3a950 | [
"Apache-2.0"
] | 3 | 2020-04-09T00:26:35.000Z | 2021-01-20T02:16:50.000Z | mcstatus/tests/test_timeout.py | audiohacked/mcstatus | a31e808b1f35190c3875645e40d5bc31a6f3a950 | [
"Apache-2.0"
] | null | null | null | from mock import patch
import sys
import asyncio
import pytest
from mcstatus.protocol.connection import TCPAsyncSocketConnection
class FakeAsyncStream(asyncio.StreamReader):
async def read(self, n: int) -> bytes:
await asyncio.sleep(delay=2)
return bytes([0] * n)
def fake_asyncio_asyncio_open_... | 31.526316 | 132 | 0.714524 | from mock import patch
import sys
import asyncio
import pytest
from mcstatus.protocol.connection import TCPAsyncSocketConnection
class FakeAsyncStream(asyncio.StreamReader):
async def read(self, n: int) -> bytes:
await asyncio.sleep(delay=2)
return bytes([0] * n)
def fake_asyncio_asyncio_open_... | true | true |
1c1b512e630a336d88ae8a81020e2a4963d23dcd | 539 | py | Python | apps/login_app/migrations/0002_user_permission.py | andrewixl/oepcm | e4692005b18d32a09a0642352b7f7278da5de48c | [
"MIT"
] | null | null | null | apps/login_app/migrations/0002_user_permission.py | andrewixl/oepcm | e4692005b18d32a09a0642352b7f7278da5de48c | [
"MIT"
] | null | null | null | apps/login_app/migrations/0002_user_permission.py | andrewixl/oepcm | e4692005b18d32a09a0642352b7f7278da5de48c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.2 on 2021-05-13 07:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('login_app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='permission',
... | 26.95 | 176 | 0.623377 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('login_app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='permission',
field=models.CharField(choices=[('admininistra... | true | true |
1c1b514307f4b559f09462e49e37f74b7a6b9cca | 2,223 | py | Python | cloudmedia/models.py | twn39/django-cloudmedia | cec3a71119efa70dd855398e7a227b9751827b7a | [
"MIT"
] | null | null | null | cloudmedia/models.py | twn39/django-cloudmedia | cec3a71119efa70dd855398e7a227b9751827b7a | [
"MIT"
] | null | null | null | cloudmedia/models.py | twn39/django-cloudmedia | cec3a71119efa70dd855398e7a227b9751827b7a | [
"MIT"
] | null | null | null | from django.db import models
import django.utils.timezone
from django.conf import settings
from django.utils.translation import gettext_lazy as _
class MediaGroup(models.Model):
name = models.CharField(_('name'), max_length=255, default='')
caption = models.CharField(_('caption'), max_length=255, default='')
... | 35.854839 | 112 | 0.667566 | from django.db import models
import django.utils.timezone
from django.conf import settings
from django.utils.translation import gettext_lazy as _
class MediaGroup(models.Model):
name = models.CharField(_('name'), max_length=255, default='')
caption = models.CharField(_('caption'), max_length=255, default='')
... | true | true |
1c1b51492cae859074ffa6f32bb31f220c0a4538 | 4,439 | py | Python | pychron/git/hosts/github.py | aelamspychron/pychron | ad87c22b0817c739c7823a24585053041ee339d5 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/git/hosts/github.py | aelamspychron/pychron | ad87c22b0817c739c7823a24585053041ee339d5 | [
"Apache-2.0"
] | 20 | 2020-09-09T20:58:39.000Z | 2021-10-05T17:48:37.000Z | pychron/git/hosts/github.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | 34.679688 | 101 | 0.540212 |
from __future__ import absolute_import
from requests.exceptions import SSLError
from pychron.git.hosts import GitHostService
from pychron.paths import paths
class GitHubService(GitHostService):
preference_path = 'pychron.github'
name = 'GitHub'
_has_access = True
@property
de... | true | true |
1c1b51724b567b4b1a2b9f3584e905976defcaf4 | 6,329 | py | Python | anchore/anchore-modules/gates/99_file_parse_passwd.py | berez23/anchore | 594cce23f1d87d666397653054c22c2613247734 | [
"Apache-2.0"
] | 401 | 2016-06-16T15:29:48.000Z | 2022-03-24T10:05:16.000Z | anchore/anchore-modules/gates/99_file_parse_passwd.py | berez23/anchore | 594cce23f1d87d666397653054c22c2613247734 | [
"Apache-2.0"
] | 63 | 2016-06-16T21:10:27.000Z | 2020-07-01T06:57:27.000Z | anchore/anchore-modules/gates/99_file_parse_passwd.py | berez23/anchore | 594cce23f1d87d666397653054c22c2613247734 | [
"Apache-2.0"
] | 64 | 2016-06-16T13:05:57.000Z | 2021-07-16T10:03:45.000Z | #!/usr/bin/env python
import sys
import os
import json
import re
import shutil
import tarfile, io
import anchore.anchore_utils
def get_retrieved_file(imgid, srcfile, dstdir):
ret = list()
extractall = False
if srcfile == 'all':
extractall = True
thedstdir = os.path.join(dstdir, imgid)
... | 32.963542 | 136 | 0.53326 |
import sys
import os
import json
import re
import shutil
import tarfile, io
import anchore.anchore_utils
def get_retrieved_file(imgid, srcfile, dstdir):
ret = list()
extractall = False
if srcfile == 'all':
extractall = True
thedstdir = os.path.join(dstdir, imgid)
tarfiles = list()
... | false | true |
1c1b51af20a53e156f72c1dcc1563310cf5d52d2 | 1,930 | py | Python | Elastic/addIndex.py | sourabhpoddar404/falcon | d47cd515e7c214658e8f2d50c3c742ee5fd2fc27 | [
"MIT"
] | 27 | 2019-04-07T08:41:06.000Z | 2022-03-08T09:07:37.000Z | Elastic/addIndex.py | sourabhpoddar404/falcon | d47cd515e7c214658e8f2d50c3c742ee5fd2fc27 | [
"MIT"
] | 13 | 2019-08-22T04:07:19.000Z | 2022-03-24T17:12:10.000Z | Elastic/addIndex.py | sourabhpoddar404/falcon | d47cd515e7c214658e8f2d50c3c742ee5fd2fc27 | [
"MIT"
] | 5 | 2019-06-21T06:25:58.000Z | 2020-12-15T14:10:21.000Z | """
@author: Sakor
"""
from elasticsearch import Elasticsearch
import json
from multiprocessing.pool import ThreadPool
docType = "doc"
# by default we connect to localhost:9200
es = Elasticsearch(['http://localhost:9200'])
path_to_data = '/app/'
# path_to_data = '../'
def addToIndexThread(line):
try:
... | 24.43038 | 84 | 0.616062 | from elasticsearch import Elasticsearch
import json
from multiprocessing.pool import ThreadPool
docType = "doc"
es = Elasticsearch(['http://localhost:9200'])
path_to_data = '/app/'
def addToIndexThread(line):
try:
lineObject=json.loads(line, strict=False)
return addToIndex(lineObject["uri"],li... | true | true |
1c1b52ce268636e2b23510c09ecdf67f9c52623a | 829 | py | Python | app/component_b/query/services.py | mirevsky/django-grpc-cqrs-kafka-template | 31af0bf5d15e393837f937cace90f82a7de26355 | [
"MIT"
] | 2 | 2022-01-10T19:52:36.000Z | 2022-03-19T07:34:54.000Z | app/component_b/query/services.py | mirevsky/django-grpc-cqrs-kafka-template | 31af0bf5d15e393837f937cace90f82a7de26355 | [
"MIT"
] | null | null | null | app/component_b/query/services.py | mirevsky/django-grpc-cqrs-kafka-template | 31af0bf5d15e393837f937cace90f82a7de26355 | [
"MIT"
] | null | null | null | import grpc
from django_grpc_framework import generics
from django_grpc_framework.services import Service
from component_b.common.models import PersonModel
from component_b.common.serializers import PersonProtoSerializer
class PersonQueryService(Service):
def get_object(self, pk):
try:
retur... | 31.884615 | 84 | 0.718938 | import grpc
from django_grpc_framework import generics
from django_grpc_framework.services import Service
from component_b.common.models import PersonModel
from component_b.common.serializers import PersonProtoSerializer
class PersonQueryService(Service):
def get_object(self, pk):
try:
retur... | true | true |
1c1b52e3b22ec8d1398d6c6dc286e9b0f953ea0d | 3,818 | py | Python | python/test/test_beam.py | dmason1-usgs/earthquake-detection-formats | e1827f353418795b25327967ad2da96d4ff2f2c0 | [
"CC0-1.0"
] | 6 | 2019-02-19T07:43:26.000Z | 2021-10-05T00:32:30.000Z | python/test/test_beam.py | dmason1-usgs/earthquake-detection-formats | e1827f353418795b25327967ad2da96d4ff2f2c0 | [
"CC0-1.0"
] | 32 | 2016-10-03T20:23:11.000Z | 2021-04-20T19:56:51.000Z | python/test/test_beam.py | dmason1-usgs/earthquake-detection-formats | e1827f353418795b25327967ad2da96d4ff2f2c0 | [
"CC0-1.0"
] | 7 | 2016-10-03T20:18:57.000Z | 2021-03-24T21:40:14.000Z | #!/usr/bin/env python
#package imports
import detectionformats.beam
#stdlib imports
import unittest
class TestBeam(unittest.TestCase):
BACKAZIMUTH = 12.569
SLOWNESS = 2.5
POWERRATIO = 16.1
BACKAZIMUTHERROR = 2.59
SLOWNESSERROR = 5.56
POWERRATIOERROR = 0.12
JSONSTRING = '{"BackAzimuth": 12... | 41.053763 | 153 | 0.695128 |
import detectionformats.beam
import unittest
class TestBeam(unittest.TestCase):
BACKAZIMUTH = 12.569
SLOWNESS = 2.5
POWERRATIO = 16.1
BACKAZIMUTHERROR = 2.59
SLOWNESSERROR = 5.56
POWERRATIOERROR = 0.12
JSONSTRING = '{"BackAzimuth": 12.569, "Slowness": 2.5, "PowerRatio": 16.1, "BackAzim... | true | true |
1c1b543da2708ac1608070980034dae0395cb122 | 1,319 | py | Python | linked_list/69_rotate_list.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | linked_list/69_rotate_list.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | linked_list/69_rotate_list.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def rotateRight(self, head, k):
"""
:type head: ListNode
:type k: int
:rtype: ListNode
"""
if not head:
... | 21.983333 | 90 | 0.482183 |
class Solution:
def rotateRight(self, head, k):
if not head:
return head
count = 0
cur = head
while cur:
count += 1
cur = cur.next
k = k % count
if k == 0:
return head
dum = ListNode(0... | true | true |
1c1b54f41f416b69f984afa8890f4e1cb58242e8 | 8,420 | py | Python | scrapy/utils/datatypes.py | emschorsch/scrapy | acb7bad1ff4037b4a613ac94e2d3357bf92bdb8f | [
"BSD-3-Clause"
] | 1 | 2015-04-01T20:02:08.000Z | 2015-04-01T20:02:08.000Z | scrapy/utils/datatypes.py | emschorsch/scrapy | acb7bad1ff4037b4a613ac94e2d3357bf92bdb8f | [
"BSD-3-Clause"
] | 2 | 2021-12-13T20:51:32.000Z | 2022-02-11T03:47:35.000Z | scrapy/utils/datatypes.py | emschorsch/scrapy | acb7bad1ff4037b4a613ac94e2d3357bf92bdb8f | [
"BSD-3-Clause"
] | 1 | 2017-11-09T20:33:59.000Z | 2017-11-09T20:33:59.000Z | """
This module contains data types used by Scrapy which are not included in the
Python Standard Library.
This module must not depend on any module outside the Standard Library.
"""
import copy
from collections import deque, defaultdict
from itertools import chain
from scrapy.utils.py27 import OrderedDict
class Mu... | 29.440559 | 107 | 0.594893 | """
This module contains data types used by Scrapy which are not included in the
Python Standard Library.
This module must not depend on any module outside the Standard Library.
"""
import copy
from collections import deque, defaultdict
from itertools import chain
from scrapy.utils.py27 import OrderedDict
class Mu... | false | true |
1c1b5527e951af441fa4a2e9bc45a796ec4139c9 | 1,991 | py | Python | tests/test_water_storage.py | amacd31/bom_data_parser | df3cc8495269cf4f974ce44b1d5c663749d84311 | [
"BSD-3-Clause"
] | 6 | 2015-11-09T12:30:56.000Z | 2021-05-05T04:31:53.000Z | tests/test_water_storage.py | amacd31/bom_data_parser | df3cc8495269cf4f974ce44b1d5c663749d84311 | [
"BSD-3-Clause"
] | null | null | null | tests/test_water_storage.py | amacd31/bom_data_parser | df3cc8495269cf4f974ce44b1d5c663749d84311 | [
"BSD-3-Clause"
] | null | null | null | import os
import pandas as pd
import unittest
from bom_data_parser import read_water_storage_series, read_water_storage_states, read_water_storage_urns
class WaterStoragesTest(unittest.TestCase):
def setUp(self):
self.test_xml_file = os.path.join(os.path.dirname(__file__), 'data', 'water_storage', 'urn:bo... | 47.404762 | 168 | 0.735309 | import os
import pandas as pd
import unittest
from bom_data_parser import read_water_storage_series, read_water_storage_states, read_water_storage_urns
class WaterStoragesTest(unittest.TestCase):
def setUp(self):
self.test_xml_file = os.path.join(os.path.dirname(__file__), 'data', 'water_storage', 'urn:bo... | true | true |
1c1b567c7a054b8af2baf9d75a4be35fed1425fe | 1,324 | py | Python | cirq/contrib/paulistring/separate_test.py | rickyHong/Cirq-repl | 5b31440d5b5bf5a66ee85ef5e44373ac89aa0eaf | [
"Apache-2.0"
] | 2 | 2019-04-02T09:16:28.000Z | 2019-05-25T18:35:19.000Z | cirq/contrib/paulistring/separate_test.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | 36 | 2019-04-03T23:03:51.000Z | 2019-05-15T23:49:01.000Z | cirq/contrib/paulistring/separate_test.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | 2 | 2019-04-03T22:55:05.000Z | 2019-04-24T23:24:53.000Z | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 33.948718 | 75 | 0.728097 |
import cirq
from cirq.contrib.paulistring import (
convert_and_separate_circuit,)
def test_toffoli_separate():
q0, q1, q2 = cirq.LineQubit.range(3)
circuit = cirq.testing.nonoptimal_toffoli_circuit(q0, q1, q2)
c_left, c_right = convert_and_separate_circuit(circuit)
cirq.testing.ass... | true | true |
1c1b5736dec8c259868bab434fdd9e2eca254875 | 2,821 | py | Python | docs/conf.py | infosec-garage/maltools | 007c7856f343b267b28b2bca8065ec2832678fc2 | [
"MIT"
] | null | null | null | docs/conf.py | infosec-garage/maltools | 007c7856f343b267b28b2bca8065ec2832678fc2 | [
"MIT"
] | null | null | null | docs/conf.py | infosec-garage/maltools | 007c7856f343b267b28b2bca8065ec2832678fc2 | [
"MIT"
] | null | null | null | """Configuration file for the Sphinx documentation builder."""
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# I... | 29.082474 | 79 | 0.647288 |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
project = 'Maltools'
copyright = '2021, InfoSec Garage'
author = 'InfoSec Garage Dev Team'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autodoc.typehints',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.intersphinx',
... | true | true |
1c1b592710c2a368c305db9560a970d758c6b4fb | 9,834 | py | Python | official/cv/faster_rcnn/src/FasterRcnn/resnet.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/faster_rcnn/src/FasterRcnn/resnet.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/faster_rcnn/src/FasterRcnn/resnet.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 37.534351 | 119 | 0.562436 |
import numpy as np
import mindspore.ops as ops
import mindspore.nn as nn
from mindspore.common.tensor import Tensor
def weight_init_ones(shape):
return Tensor(np.full(shape, 0.01).astype(np.float32))
def _conv(in_channels, out_channels, kernel_size=3, stride=1, padding=0, pad_mode='pad'):
sha... | true | true |
1c1b5a0299c14f7078c8610e268bfdaa21b5c1e7 | 7,058 | py | Python | opflow/rpc_worker.py | opflow/opflow-python | 8b383e4adbf24995d485ca2aa49a901a18195e85 | [
"BSD-3-Clause"
] | null | null | null | opflow/rpc_worker.py | opflow/opflow-python | 8b383e4adbf24995d485ca2aa49a901a18195e85 | [
"BSD-3-Clause"
] | null | null | null | opflow/rpc_worker.py | opflow/opflow-python | 8b383e4adbf24995d485ca2aa49a901a18195e85 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import logging
import pika
from engine import Engine
from executor import Executor
from util import Util
from exception import ConstructorError
from exception import OperationError
logger = Util.getLogger(__name__)
class RpcWorker:
def __init__(self, uri, exchangeName=None, routingKey=None... | 39.211111 | 101 | 0.619014 |
import logging
import pika
from engine import Engine
from executor import Executor
from util import Util
from exception import ConstructorError
from exception import OperationError
logger = Util.getLogger(__name__)
class RpcWorker:
def __init__(self, uri, exchangeName=None, routingKey=None, applicationId=None,... | false | true |
1c1b5afa8394cbb656abc5ed4bdb8482be7f3adc | 2,334 | py | Python | designateclient/v2/utils.py | openstack/python-designateclient | 87e9b3333bb7d1b2648474df6bbb6a06693964fd | [
"Apache-2.0"
] | 34 | 2015-01-16T21:45:17.000Z | 2021-11-15T09:38:53.000Z | designateclient/v2/utils.py | openstack/python-designateclient | 87e9b3333bb7d1b2648474df6bbb6a06693964fd | [
"Apache-2.0"
] | null | null | null | designateclient/v2/utils.py | openstack/python-designateclient | 87e9b3333bb7d1b2648474df6bbb6a06693964fd | [
"Apache-2.0"
] | 15 | 2015-01-16T21:45:27.000Z | 2020-05-26T05:07:29.000Z | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | 29.544304 | 76 | 0.669666 |
from oslo_utils import uuidutils
from urllib.parse import parse_qs
from urllib.parse import urlparse
from designateclient import exceptions
def resolve_by_name(func, name, *args):
if uuidutils.is_uuid_like(name):
return name
results = func(criterion={"name": "%s" % name}, *args)
... | true | true |
1c1b5cf082de0a9c8bdb45a4ee2981d9d905df26 | 200 | py | Python | chat/chatapp/views.py | diyajaiswal11/Chat-Application | 44d12533dd4759a94b5325718ff6a447b9ac3d65 | [
"MIT"
] | 4 | 2020-07-05T21:15:38.000Z | 2021-04-09T05:42:19.000Z | chat/chatapp/views.py | diyajaiswal11/Chat-Application | 44d12533dd4759a94b5325718ff6a447b9ac3d65 | [
"MIT"
] | 3 | 2021-03-30T13:49:51.000Z | 2021-06-04T23:35:46.000Z | chat/chatapp/views.py | diyajaiswal11/Chat-Application | 44d12533dd4759a94b5325718ff6a447b9ac3d65 | [
"MIT"
] | null | null | null | from django.shortcuts import render
def index(request):
return render(request, 'index.html')
def room(request, room_name):
return render(request, 'room.html', {'room_name': room_name})
| 15.384615 | 65 | 0.71 | from django.shortcuts import render
def index(request):
return render(request, 'index.html')
def room(request, room_name):
return render(request, 'room.html', {'room_name': room_name})
| true | true |
1c1b5dc7df0f3d630a43b9dc3dde1316aeacc5cb | 719 | py | Python | torch_fuze/abstract_trainer.py | Daiver/torch_fuze | 6b7ad568e2d7549c7f0c0d4c309532ac1b92881d | [
"MIT"
] | 1 | 2019-05-16T07:18:05.000Z | 2019-05-16T07:18:05.000Z | torch_fuze/abstract_trainer.py | Daiver/torch_fuze | 6b7ad568e2d7549c7f0c0d4c309532ac1b92881d | [
"MIT"
] | null | null | null | torch_fuze/abstract_trainer.py | Daiver/torch_fuze | 6b7ad568e2d7549c7f0c0d4c309532ac1b92881d | [
"MIT"
] | null | null | null | from .trainer_state import TrainerState
class AbstractTrainer:
def __init__(self):
self.state = TrainerState()
def run(self, *args, **kwargs):
pass
def callbacks_on_training_begin(self, callbacks):
for callback in callbacks:
callback.on_training_begin(self.state)
... | 27.653846 | 53 | 0.682893 | from .trainer_state import TrainerState
class AbstractTrainer:
def __init__(self):
self.state = TrainerState()
def run(self, *args, **kwargs):
pass
def callbacks_on_training_begin(self, callbacks):
for callback in callbacks:
callback.on_training_begin(self.state)
... | true | true |
1c1b5df06c74bfc4a72b2465e3f03c1107b1d030 | 5,916 | py | Python | automation/utilities/selenium_grid/grid_node.py | zahed3795/Super-Automation | a207d39910943256ad2117b1a84ebcaaaf7aa43e | [
"MIT"
] | 2 | 2020-11-12T14:01:49.000Z | 2020-11-12T14:01:52.000Z | automation/utilities/selenium_grid/grid_node.py | zahed3795/Super-Automation | a207d39910943256ad2117b1a84ebcaaaf7aa43e | [
"MIT"
] | null | null | null | automation/utilities/selenium_grid/grid_node.py | zahed3795/Super-Automation | a207d39910943256ad2117b1a84ebcaaaf7aa43e | [
"MIT"
] | null | null | null | import codecs
import os
import subprocess
import sys
from automation import drivers # webdriver storage folder for Super-Automation
DRIVER_DIR = os.path.dirname(os.path.realpath(drivers.__file__))
# Make sure that the Super-Automation DRIVER_DIR is at the top of the System PATH
# (Changes to the System PATH with os.en... | 42.257143 | 81 | 0.586883 | import codecs
import os
import subprocess
import sys
from automation import drivers
DRIVER_DIR = os.path.dirname(os.path.realpath(drivers.__file__))
if not os.environ["PATH"].startswith(DRIVER_DIR):
os.environ["PATH"] = os.environ["PATH"].replace(DRIVER_DIR, "")
os.environ["PATH"] = os.environ["PA... | true | true |
1c1b5f94fa840dcc7a1366e9620d0524b716c9f6 | 13,355 | py | Python | python_utils.py | kaylahardie/oppia | e93ed02dfc7f654ef4fb62268c1a9b9d9ded30ec | [
"Apache-2.0"
] | null | null | null | python_utils.py | kaylahardie/oppia | e93ed02dfc7f654ef4fb62268c1a9b9d9ded30ec | [
"Apache-2.0"
] | 1 | 2020-03-02T21:05:42.000Z | 2020-03-03T07:09:51.000Z | python_utils.py | kaylahardie/oppia | e93ed02dfc7f654ef4fb62268c1a9b9d9ded30ec | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 30.490868 | 157 | 0.680794 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import io
import os
import sys
_FUTURE_PATH = os.path.join(os.getcwd(), 'third_party', 'future-0.17.1')
sys.path.insert(0, _FUTURE_PATH)
_YAML_PATH = os.path.join(os.getcwd(), '... | true | true |
1c1b607e89dc00d1e2d72c73de77142af4d97dd6 | 3,342 | py | Python | opencensus/trace/propagation/google_cloud_format.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | null | null | null | opencensus/trace/propagation/google_cloud_format.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | null | null | null | opencensus/trace/propagation/google_cloud_format.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | null | null | null | # Copyright 2017, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 35.178947 | 77 | 0.647217 |
import logging
import re
from opencensus.trace.span_context import SpanContext
from opencensus.trace.trace_options import TraceOptions
_TRACE_CONTEXT_HEADER_FORMAT = '([0-9a-f]{32})(\/(\d+))?(;o=(\d+))?'
_TRACE_CONTEXT_HEADER_RE = re.compile(_TRACE_CONTEXT_HEADER_FORMAT)
_TRACE_ID_DELIMETER = '/'
_SPAN_... | true | true |
1c1b6103b3071d3d9d8daf5af874fdf4d6ad0fe2 | 22,040 | py | Python | osgbuild/test/test_osgbuild.py | DrDaveD/osg-build | 05108db684009dcae245b7daa50cb24665a8313d | [
"Apache-2.0"
] | 1 | 2021-02-24T19:59:16.000Z | 2021-02-24T19:59:16.000Z | osgbuild/test/test_osgbuild.py | DrDaveD/osg-build | 05108db684009dcae245b7daa50cb24665a8313d | [
"Apache-2.0"
] | 30 | 2016-06-16T23:06:24.000Z | 2021-08-30T18:59:35.000Z | osgbuild/test/test_osgbuild.py | DrDaveD/osg-build | 05108db684009dcae245b7daa50cb24665a8313d | [
"Apache-2.0"
] | 6 | 2015-12-31T06:21:08.000Z | 2019-08-06T18:36:53.000Z | #!/usr/bin/env python
"""unit tests for the osg-build tasks
"""
# pylint: disable=C0103,R0904,W0614,C0111
import atexit
import grp
import re
import os
from os.path import join as opj
import pwd
import shutil
import tempfile
import tarfile
import unittest
from unittest import makeSuite, TestCase
import sys
import osgb... | 38.939929 | 144 | 0.614428 |
import atexit
import grp
import re
import os
from os.path import join as opj
import pwd
import shutil
import tempfile
import tarfile
import unittest
from unittest import makeSuite, TestCase
import sys
import osgbuild.constants as C
from osgbuild import main
from osgbuild import srpm
from osgbuild.utils import (
... | true | true |
1c1b610705ae7e0fb3eaf147c1ef9b47b2b8e395 | 400 | py | Python | 04-move-file.py | sb-olr/Crypto-data-ETL-backtest-Pipeline-project | c3956f027d88e2a006308bcedcb220267fac524b | [
"Apache-2.0"
] | 1 | 2021-11-10T11:28:04.000Z | 2021-11-10T11:28:04.000Z | 04-move-file.py | sb-olr/Crypto-data-ETL-backtest-Pipeline-project | c3956f027d88e2a006308bcedcb220267fac524b | [
"Apache-2.0"
] | null | null | null | 04-move-file.py | sb-olr/Crypto-data-ETL-backtest-Pipeline-project | c3956f027d88e2a006308bcedcb220267fac524b | [
"Apache-2.0"
] | 1 | 2021-07-27T03:29:39.000Z | 2021-07-27T03:29:39.000Z | #!/usr/bin/env python3
# Usage: ./04-move-file.py
import os
from icecream import ic
import my_utils
from config import CONFIG
csv_dir = CONFIG['csv_dir']
processed_dir = CONFIG['processed_dir']
table_name = CONFIG['table_name']
csv_file = f'{csv_dir}{table_name}.csv'
# use move function
if os.path.isfile(csv_file):
... | 21.052632 | 47 | 0.7425 |
import os
from icecream import ic
import my_utils
from config import CONFIG
csv_dir = CONFIG['csv_dir']
processed_dir = CONFIG['processed_dir']
table_name = CONFIG['table_name']
csv_file = f'{csv_dir}{table_name}.csv'
if os.path.isfile(csv_file):
my_utils.move_file(csv_file, processed_dir)
else:
ic('File ... | true | true |
1c1b612ab41c0765d98b94dc4cbb6e09c433a4fe | 214 | py | Python | mathgenerator/mathgen.py | Sankari-K/mathgenerator | 712c74fbe34fe594c4c0f7e3b3057b01d85112ba | [
"MIT"
] | 40 | 2020-11-17T19:45:20.000Z | 2022-03-22T18:16:43.000Z | mathgenerator/mathgen.py | Sankari-K/mathgenerator | 712c74fbe34fe594c4c0f7e3b3057b01d85112ba | [
"MIT"
] | 209 | 2020-10-14T15:32:08.000Z | 2020-11-03T19:08:19.000Z | mathgenerator/mathgen.py | Sankari-K/mathgenerator | 712c74fbe34fe594c4c0f7e3b3057b01d85112ba | [
"MIT"
] | 179 | 2020-10-14T15:36:55.000Z | 2020-10-29T19:26:16.000Z | from .funcs import *
from .__init__ import getGenList
genList = getGenList()
# || Non-generator Functions
def genById(id, *args, **kwargs):
generator = genList[id][2]
return (generator(*args, **kwargs))
| 19.454545 | 39 | 0.686916 | from .funcs import *
from .__init__ import getGenList
genList = getGenList()
def genById(id, *args, **kwargs):
generator = genList[id][2]
return (generator(*args, **kwargs))
| true | true |
1c1b61901e924d520ccf0c23f46ecd0341ee234e | 3,592 | py | Python | ft_auth/views.py | dksivagis/shpescape | a2c97be4628b012145fd5bda63d79836bc5898a0 | [
"Apache-2.0"
] | 1 | 2018-07-26T07:40:47.000Z | 2018-07-26T07:40:47.000Z | ft_auth/views.py | dksivagis/shpescape | a2c97be4628b012145fd5bda63d79836bc5898a0 | [
"Apache-2.0"
] | 1 | 2016-07-22T19:24:30.000Z | 2016-07-22T19:24:30.000Z | ft_auth/views.py | dksivagis/shpescape | a2c97be4628b012145fd5bda63d79836bc5898a0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 30.184874 | 90 | 0.748886 |
import os
import random
from datetime import datetime
from django.conf import settings
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404
from django.template import RequestContext
from django.conf... | false | true |
1c1b62034607a28e7efdff960971fa4c335608ca | 411 | py | Python | python_modules/dagster-graphql/dagster_graphql/test/preset_query.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 3 | 2020-09-09T04:10:23.000Z | 2021-11-08T02:10:42.000Z | python_modules/dagster-graphql/dagster_graphql/test/preset_query.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 2 | 2021-05-11T13:36:27.000Z | 2021-09-03T01:53:11.000Z | python_modules/dagster-graphql/dagster_graphql/test/preset_query.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 1 | 2021-02-21T12:16:47.000Z | 2021-02-21T12:16:47.000Z | from .utils import execute_dagster_graphql
PRESETS_QUERY = '''
query PresetsQuery($name: String!) {
pipeline(params: { name: $name }) {
name
presets {
__typename
name
solidSubset
environmentConfigYaml
mode
}
}
}
'''
def execute_preset_query(pipeline_name, context):
... | 19.571429 | 93 | 0.678832 | from .utils import execute_dagster_graphql
PRESETS_QUERY = '''
query PresetsQuery($name: String!) {
pipeline(params: { name: $name }) {
name
presets {
__typename
name
solidSubset
environmentConfigYaml
mode
}
}
}
'''
def execute_preset_query(pipeline_name, context):
... | true | true |
1c1b633e71972764880ee9e1d1f8bacd8a857fb6 | 8,840 | py | Python | test/gdb_test.py | Kris-b50122/pyOCD | df605c7aa04d72c5187ab652445063cc232cf378 | [
"Apache-2.0"
] | 3 | 2019-06-05T01:32:06.000Z | 2020-05-20T08:55:46.000Z | test/gdb_test.py | Kris-b50122/pyOCD | df605c7aa04d72c5187ab652445063cc232cf378 | [
"Apache-2.0"
] | 1 | 2019-07-05T10:13:09.000Z | 2019-07-05T10:51:43.000Z | test/gdb_test.py | Kris-b50122/pyOCD | df605c7aa04d72c5187ab652445063cc232cf378 | [
"Apache-2.0"
] | 1 | 2019-01-21T03:01:53.000Z | 2019-01-21T03:01:53.000Z | # pyOCD debugger
# Copyright (c) 2015-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 35.789474 | 127 | 0.656448 |
from __future__ import print_function
import os
import json
import sys
from subprocess import (
Popen,
STDOUT,
PIPE,
check_output,
)
import argparse
import logging
import traceback
import threading
from pyocd.__main__ import PyOCDTool
from pyocd.core.helpers import ConnectHe... | true | true |
1c1b634ff20a004c93d1d92c034511d15633df5c | 4,303 | py | Python | setup.py | ExcitedStates/qfit-3.0 | 8ed8e8f44015e4eb30fed7a5da65819a586c2bbf | [
"Artistic-2.0",
"MIT"
] | 13 | 2019-05-22T00:07:39.000Z | 2022-03-09T18:12:47.000Z | setup.py | ExcitedStates/qfit-3.0 | 8ed8e8f44015e4eb30fed7a5da65819a586c2bbf | [
"Artistic-2.0",
"MIT"
] | 84 | 2019-02-14T00:46:57.000Z | 2022-03-03T21:53:15.000Z | setup.py | ExcitedStates/qfit-3.0 | 8ed8e8f44015e4eb30fed7a5da65819a586c2bbf | [
"Artistic-2.0",
"MIT"
] | 7 | 2019-03-08T01:08:05.000Z | 2021-10-02T14:40:45.000Z | '''
Excited States software: qFit 3.0
Contributors: Saulo H. P. de Oliveira, Gydo van Zundert, and Henry van den Bedem.
Contact: vdbedem@stanford.edu
Copyright (C) 2009-2019 Stanford University
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation f... | 42.186275 | 127 | 0.639089 |
import os.path
from setuptools import setup
from setuptools import find_packages
from setuptools.extension import Extension
import numpy as np
def main():
package_dir = {'': 'src'}
packages = find_packages('src')
package_data = {'qfit': [os.path.join('data', '*.npy'), ]}
ext_modules = [Extension("qf... | true | true |
1c1b6720d5ef68eb50cce000b982b1e8022fe656 | 6,453 | py | Python | releasenotes/source/conf.py | openstack/os-net-conf | c9a3764c7c27b957b2d8fb1eee3867ef0d1dfa90 | [
"Apache-2.0"
] | 61 | 2015-01-29T20:10:45.000Z | 2022-01-28T07:01:23.000Z | releasenotes/source/conf.py | openstack/os-net-conf | c9a3764c7c27b957b2d8fb1eee3867ef0d1dfa90 | [
"Apache-2.0"
] | null | null | null | releasenotes/source/conf.py | openstack/os-net-conf | c9a3764c7c27b957b2d8fb1eee3867ef0d1dfa90 | [
"Apache-2.0"
] | 30 | 2015-02-02T14:44:17.000Z | 2020-09-22T19:26:49.000Z | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 33.963158 | 79 | 0.736247 |
extensions = [
'openstackdocstheme',
'reno.sphinxext',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'os-net-config Release Notes'
copyright = u'2018, OpenStackFoundation'
openstackdocs_repo_name = 'openstack/os-net-c... | true | true |
1c1b68caad639ca2b7f89b566a8efa45a52f7015 | 182 | py | Python | packages/leon/welcome.py | Ayush10/tridev | 5d59fec03449df3973f4ffd1c1c5c52892ca267b | [
"MIT"
] | null | null | null | packages/leon/welcome.py | Ayush10/tridev | 5d59fec03449df3973f4ffd1c1c5c52892ca267b | [
"MIT"
] | null | null | null | packages/leon/welcome.py | Ayush10/tridev | 5d59fec03449df3973f4ffd1c1c5c52892ca267b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
def run(string, entities):
"""tridev welcomes you"""
return utils.output('end', 'welcome', utils.translate('welcome'))
| 18.2 | 66 | 0.664835 |
import utils
def run(string, entities):
return utils.output('end', 'welcome', utils.translate('welcome'))
| true | true |
1c1b69e120bc7d20023517c0ae2a8e51c2d69a97 | 1,408 | py | Python | monk/pip_unit_tests/keras/test_activation_tanh.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 542 | 2019-11-10T12:09:31.000Z | 2022-03-28T11:39:07.000Z | monk/pip_unit_tests/keras/test_activation_tanh.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 117 | 2019-11-12T09:39:24.000Z | 2022-03-12T00:20:41.000Z | monk/pip_unit_tests/keras/test_activation_tanh.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 246 | 2019-11-09T21:53:24.000Z | 2022-03-29T00:57:07.000Z | import os
import sys
import psutil
from monk.keras_prototype import prototype
from monk.compare_prototype import compare
from monk.pip_unit_tests.keras.common import print_start
from monk.pip_unit_tests.keras.common import print_status
import tensorflow as tf
if(tf.__version__[0] == '2'):
import tensorflow.compa... | 28.16 | 80 | 0.639205 | import os
import sys
import psutil
from monk.keras_prototype import prototype
from monk.compare_prototype import compare
from monk.pip_unit_tests.keras.common import print_start
from monk.pip_unit_tests.keras.common import print_status
import tensorflow as tf
if(tf.__version__[0] == '2'):
import tensorflow.compa... | true | true |
1c1b69fe20acf74abd94707bf45cdbec1ff3aa7a | 333 | py | Python | tests/data/serialization/ndjson/test_text.py | nickaustinlee/labelbox-python | 45eb808165849e5a55fb6869ca5cc415d74772ce | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/data/serialization/ndjson/test_text.py | nickaustinlee/labelbox-python | 45eb808165849e5a55fb6869ca5cc415d74772ce | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/data/serialization/ndjson/test_text.py | nickaustinlee/labelbox-python | 45eb808165849e5a55fb6869ca5cc415d74772ce | [
"Apache-2.0",
"MIT"
] | null | null | null | import json
from labelbox.data.serialization.ndjson.converter import NDJsonConverter
def test_text():
with open('tests/data/assets/ndjson/text_import.json', 'r') as file:
data = json.load(file)
res = NDJsonConverter.deserialize(data).as_list()
res = list(NDJsonConverter.serialize(res))
assert... | 27.75 | 72 | 0.723724 | import json
from labelbox.data.serialization.ndjson.converter import NDJsonConverter
def test_text():
with open('tests/data/assets/ndjson/text_import.json', 'r') as file:
data = json.load(file)
res = NDJsonConverter.deserialize(data).as_list()
res = list(NDJsonConverter.serialize(res))
assert... | true | true |
1c1b6ade13c7d434d2306676745b377465311a59 | 2,797 | py | Python | colored_mnist.py | jiazhi412/Dataset-REPAIR | 581df7b0e0408247cc63e411d3ea2bb0191c4148 | [
"MIT"
] | null | null | null | colored_mnist.py | jiazhi412/Dataset-REPAIR | 581df7b0e0408247cc63e411d3ea2bb0191c4148 | [
"MIT"
] | null | null | null | colored_mnist.py | jiazhi412/Dataset-REPAIR | 581df7b0e0408247cc63e411d3ea2bb0191c4148 | [
"MIT"
] | null | null | null | import torch
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import os
from utils.datasets import ColoredDataset
from utils.measure import *
from utils.models import *
import argparse
parser = argparse.ArgumentParser()
# parser.add_argument('--gpu', default=0, type=int)
parser.add... | 49.070175 | 118 | 0.76153 | import torch
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import os
from utils.datasets import ColoredDataset
from utils.measure import *
from utils.models import *
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--with-cuda', dest='cuda', action='store... | true | true |
1c1b6b189d4341b1b25029cee9137a166d90f204 | 306 | py | Python | PE031.py | CaptainSora/Python-Project-Euler | 056400f434eec837ece5ef06653b310ebfcc3d4e | [
"MIT"
] | null | null | null | PE031.py | CaptainSora/Python-Project-Euler | 056400f434eec837ece5ef06653b310ebfcc3d4e | [
"MIT"
] | null | null | null | PE031.py | CaptainSora/Python-Project-Euler | 056400f434eec837ece5ef06653b310ebfcc3d4e | [
"MIT"
] | null | null | null | from _int_tools import counting_summations
def coin_sums(target):
"""
Returns the number of ways that target can be made using only the
denominations found in COINS.
"""
return counting_summations([1, 2, 5, 10, 20, 50, 100, 200], target)
def solve(vol=0):
return coin_sums(200)
| 21.857143 | 71 | 0.689542 | from _int_tools import counting_summations
def coin_sums(target):
return counting_summations([1, 2, 5, 10, 20, 50, 100, 200], target)
def solve(vol=0):
return coin_sums(200)
| true | true |
1c1b6b6302801f7a6ce2a0b33c0a787cc520d460 | 428 | py | Python | app.py | EduMacedoEng/ScreenRecorder | 40050789074a40d214cb09d9f6a7b504e345617f | [
"MIT"
] | null | null | null | app.py | EduMacedoEng/ScreenRecorder | 40050789074a40d214cb09d9f6a7b504e345617f | [
"MIT"
] | null | null | null | app.py | EduMacedoEng/ScreenRecorder | 40050789074a40d214cb09d9f6a7b504e345617f | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Api
from resources.gravar import Gravar
from resources.pausar import Pausar
from resources.upload import Upload
from flask_cors import CORS
app = Flask(__name__)
api = Api(app)
CORS(app)
api.add_resource(Gravar, '/record/<string:cdChamado>')
api.add_resource(Pausar, '/... | 25.176471 | 54 | 0.773364 | from flask import Flask
from flask_restful import Api
from resources.gravar import Gravar
from resources.pausar import Pausar
from resources.upload import Upload
from flask_cors import CORS
app = Flask(__name__)
api = Api(app)
CORS(app)
api.add_resource(Gravar, '/record/<string:cdChamado>')
api.add_resource(Pausar, '/... | true | true |
1c1b6c2be0eb4151764f46ba46f5bf94994b5151 | 1,872 | py | Python | migrations/versions/e72c08363f80_third_migration.py | Tellvinch/illusion | a20f68da5d98fe17af5e7950553e08b38ebe2437 | [
"MIT"
] | null | null | null | migrations/versions/e72c08363f80_third_migration.py | Tellvinch/illusion | a20f68da5d98fe17af5e7950553e08b38ebe2437 | [
"MIT"
] | 4 | 2020-06-23T03:02:08.000Z | 2022-01-13T02:55:01.000Z | migrations/versions/e72c08363f80_third_migration.py | Tellvinch/illusion | a20f68da5d98fe17af5e7950553e08b38ebe2437 | [
"MIT"
] | null | null | null | """third migration
Revision ID: e72c08363f80
Revises:
Create Date: 2020-06-22 14:17:30.197359
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e72c08363f80'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ge... | 32.842105 | 72 | 0.665064 | from alembic import op
import sqlalchemy as sa
revision = 'e72c08363f80'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
ength=120), nullable=False),
sa.Column('secure_password', sa.String(length=255), nullable=False),
sa.Column('profile_pic_path', sa.String(length=255), null... | true | true |
1c1b6c659cd0210f397ae88c1aa9d3bee3d922cc | 283 | py | Python | src/models/message.py | ExpectoAprobarum/BackendSV | 58d9e11558c0eca6aabb347cd1f00c7039b7cb2b | [
"CC0-1.0"
] | null | null | null | src/models/message.py | ExpectoAprobarum/BackendSV | 58d9e11558c0eca6aabb347cd1f00c7039b7cb2b | [
"CC0-1.0"
] | null | null | null | src/models/message.py | ExpectoAprobarum/BackendSV | 58d9e11558c0eca6aabb347cd1f00c7039b7cb2b | [
"CC0-1.0"
] | null | null | null | import datetime
from pony.orm import PrimaryKey, Required, LongStr
from .base import db
class Message(db.Entity):
id = PrimaryKey(int, auto=True)
date = Required(datetime.datetime)
content = Required(LongStr)
game = Required('Game')
player = Required('Player')
| 23.583333 | 50 | 0.710247 | import datetime
from pony.orm import PrimaryKey, Required, LongStr
from .base import db
class Message(db.Entity):
id = PrimaryKey(int, auto=True)
date = Required(datetime.datetime)
content = Required(LongStr)
game = Required('Game')
player = Required('Player')
| true | true |
1c1b6d00606b84b9bb027585bc92a4c43e316a85 | 395 | py | Python | setup.py | ct-Open-Source/libzmap-python3 | b4b2d8023d3b25628eb1d6bfdf2473a549b11cf8 | [
"CC-BY-3.0"
] | 1 | 2020-07-24T15:34:21.000Z | 2020-07-24T15:34:21.000Z | setup.py | ct-Open-Source/libzmap-python3 | b4b2d8023d3b25628eb1d6bfdf2473a549b11cf8 | [
"CC-BY-3.0"
] | 1 | 2020-02-16T22:00:10.000Z | 2020-02-16T22:00:10.000Z | setup.py | ct-Open-Source/libzmap-python3 | b4b2d8023d3b25628eb1d6bfdf2473a549b11cf8 | [
"CC-BY-3.0"
] | 2 | 2020-02-11T18:19:48.000Z | 2020-07-24T15:34:42.000Z |
from setuptools import find_packages
from setuptools import setup
# requirements
install_requires = []
setup(name="libzmap",
version="v0.0.3",
description="zmap binding for python",
author="gushitong",
author_email="gushitong@gmail.com",
packages=find_packages(),
url="https://gith... | 24.6875 | 56 | 0.708861 |
from setuptools import find_packages
from setuptools import setup
install_requires = []
setup(name="libzmap",
version="v0.0.3",
description="zmap binding for python",
author="gushitong",
author_email="gushitong@gmail.com",
packages=find_packages(),
url="https://github.com/gushito... | true | true |
1c1b6de5c5312ef0c9fa5d6210f72ec0b2a23bd2 | 3,198 | py | Python | Step_1/Pro2.py | LeeDaeil/Process_A3C | 1876fbe1b928e13b9c8766095b2d13abfda94019 | [
"Apache-2.0"
] | 1 | 2020-03-22T14:39:44.000Z | 2020-03-22T14:39:44.000Z | Step_1/Pro2.py | LeeDaeil/Process_A3C | 1876fbe1b928e13b9c8766095b2d13abfda94019 | [
"Apache-2.0"
] | 1 | 2018-12-23T07:35:43.000Z | 2018-12-23T07:35:43.000Z | Step_1/Pro2.py | LeeDaeil/Process_A3C | 1876fbe1b928e13b9c8766095b2d13abfda94019 | [
"Apache-2.0"
] | 2 | 2018-10-10T01:56:04.000Z | 2018-10-11T03:57:39.000Z | import multiprocessing
from matplotlib import pyplot as plt
from matplotlib import animation
class Pro2(multiprocessing.Process):
def __init__(self, shared_mem):
multiprocessing.Process.__init__(self)
self.shared_mem = shared_mem # Main.py 에서 선언했던 Shared memory 를 가져옴
self.fig ... | 39.481481 | 132 | 0.545654 | import multiprocessing
from matplotlib import pyplot as plt
from matplotlib import animation
class Pro2(multiprocessing.Process):
def __init__(self, shared_mem):
multiprocessing.Process.__init__(self)
self.shared_mem = shared_mem
self.fig = plt.figure()
... | true | true |
1c1b6ea3e95d6371856f15f9b31057dd9d42684d | 4,130 | py | Python | Machine_Learning/Feature_Tutorials/tf2_quant_fine_tune/files/make_target.py | ioannis-krmp/Vitis-Tutorials | c1b42f316ebe195b5f467dd3f949c003ba919647 | [
"Apache-2.0"
] | 1 | 2022-03-15T22:07:18.000Z | 2022-03-15T22:07:18.000Z | Machine_Learning/Feature_Tutorials/tf2_quant_fine_tune/files/make_target.py | ioannis-krmp/Vitis-Tutorials | c1b42f316ebe195b5f467dd3f949c003ba919647 | [
"Apache-2.0"
] | null | null | null | Machine_Learning/Feature_Tutorials/tf2_quant_fine_tune/files/make_target.py | ioannis-krmp/Vitis-Tutorials | c1b42f316ebe195b5f467dd3f949c003ba919647 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2021 Xilinx Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 31.526718 | 174 | 0.657869 |
import argparse
import os
import shutil
import sys
import cv2
from tqdm import tqdm
os.environ['TF_CPP_MIN_LOG_LEVEL']='3'
import tensorflow as tf
from dataset_utils import parser, resize_centercrop
DIVIDER = '-----------------------------------------'
def input_fn(tfrec_dir, batchsize):
tfrecord_files ... | true | true |
1c1b6ef542c2f9da697c9a46f6e38f720cd126dc | 15,792 | pyw | Python | hanoi.pyw | SevenSolaris/Hanoi | 42b07521620d07425d4010003506ee0badedb2e3 | [
"MIT"
] | null | null | null | hanoi.pyw | SevenSolaris/Hanoi | 42b07521620d07425d4010003506ee0badedb2e3 | [
"MIT"
] | null | null | null | hanoi.pyw | SevenSolaris/Hanoi | 42b07521620d07425d4010003506ee0badedb2e3 | [
"MIT"
] | null | null | null | """
This is definitely not my best code. It was written in a rush because I wanted to test
some things.
This is a bare-bones Towers of Hanoi game.
"""
# TODO: Clean up code, refactor, and add documentation and explanation.
import pygame
import pygame.freetype
from pygame.freetype import Font
from pygame import math
... | 33.671642 | 162 | 0.571682 |
import pygame
import pygame.freetype
from pygame.freetype import Font
from pygame import math
from pygame.math import Vector2 as vec2
from pygame import draw
from pygame import Color, Surface, Rect
import random
c_gray = lambda v: (v,v,v)
black = c_gray(0)
white = c_gray(255)
midgray = c_gray(127)
lightgra... | true | true |
1c1b6f9437698150867065f3b48de631cd03fc20 | 7,646 | py | Python | h5py/tests/test_attrs_data.py | bomber8013/h5py | 71a82d9fc99245181747a8630b45373ae1606de0 | [
"BSD-3-Clause"
] | 1,657 | 2015-01-07T15:17:44.000Z | 2022-03-30T13:11:55.000Z | h5py/tests/test_attrs_data.py | bomber8013/h5py | 71a82d9fc99245181747a8630b45373ae1606de0 | [
"BSD-3-Clause"
] | 1,531 | 2015-01-05T21:58:02.000Z | 2022-03-31T12:34:02.000Z | h5py/tests/test_attrs_data.py | bomber8013/h5py | 71a82d9fc99245181747a8630b45373ae1606de0 | [
"BSD-3-Clause"
] | 503 | 2015-01-08T07:14:27.000Z | 2022-03-23T21:09:41.000Z | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Attribute data transfer testing module
... | 29.072243 | 78 | 0.559116 |
import numpy as np
from .common import TestCase, ut
import h5py
from h5py import h5a, h5s, h5t
from h5py import File
from h5py._hl.base import is_empty_dataspace
class BaseAttrs(TestCase):
def setUp(self):
self.f = File(self.mktemp(), 'w')
def tearDown(self):
if self.f:
... | true | true |
1c1b6febf0da30227b4fac5852ca927de4a2156d | 15,425 | py | Python | btsapi/modules/reports/dttables.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 2 | 2018-04-25T01:12:06.000Z | 2018-06-27T22:08:08.000Z | btsapi/modules/reports/dttables.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 1 | 2019-03-03T09:15:29.000Z | 2019-03-03T09:19:03.000Z | btsapi/modules/reports/dttables.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 4 | 2018-03-10T23:30:00.000Z | 2019-12-10T06:21:52.000Z | """Main entry file, definition of ColumnDT and DataTables."""
import sys
from collections import namedtuple
from logging import getLogger
from dateutil.parser import parse as date_parse
import datetime
from sqlalchemy.dialects import postgresql, mysql, sqlite
from sqlalchemy import func, Text, or_
import math
from psyc... | 34.50783 | 107 | 0.608039 | import sys
from collections import namedtuple
from logging import getLogger
from dateutil.parser import parse as date_parse
import datetime
from sqlalchemy.dialects import postgresql, mysql, sqlite
from sqlalchemy import func, Text, or_
import math
from psycopg2.extensions import adapt as sqlescape
from sqlalchemy.sql ... | true | true |
1c1b70fc553bc49c5c1bd2869324094c40681859 | 469 | py | Python | push_baidu.py | disenone/disenone.github.io | 7f763d28287c380f80531fbb15f7ff58c4e5b672 | [
"Apache-2.0"
] | null | null | null | push_baidu.py | disenone/disenone.github.io | 7f763d28287c380f80531fbb15f7ff58c4e5b672 | [
"Apache-2.0"
] | 8 | 2019-12-22T13:13:41.000Z | 2019-12-22T14:50:29.000Z | push_baidu.py | disenone/disenone.github.io | 7f763d28287c380f80531fbb15f7ff58c4e5b672 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import urllib2
import requests
url = 'http://data.zz.baidu.com/urls?site=disenone.github.io&token=gjZXbMTC0FfXAEuZ'
def run():
sitemap = urllib2.urlopen('http://disenone.github.io/sitemap.txt')
sites = sitemap.read()
sites = sites.split('\n')
sites = [x for x in sites if x]
... | 24.684211 | 84 | 0.654584 |
import urllib2
import requests
url = 'http://data.zz.baidu.com/urls?site=disenone.github.io&token=gjZXbMTC0FfXAEuZ'
def run():
sitemap = urllib2.urlopen('http://disenone.github.io/sitemap.txt')
sites = sitemap.read()
sites = sites.split('\n')
sites = [x for x in sites if x]
sites = '\n'.join(site... | false | true |
1c1b7102c939c394f6c649d9c20e823d0750d2b2 | 497 | py | Python | Block.py | Nejat88/Pylatformer-Example | 8200784032c9827cfdbd3bd623fb47b4dbbcdd24 | [
"MIT"
] | 1 | 2021-12-20T11:06:14.000Z | 2021-12-20T11:06:14.000Z | Block.py | Nejat88/Pylatformer-Example | 8200784032c9827cfdbd3bd623fb47b4dbbcdd24 | [
"MIT"
] | null | null | null | Block.py | Nejat88/Pylatformer-Example | 8200784032c9827cfdbd3bd623fb47b4dbbcdd24 | [
"MIT"
] | null | null | null | import pygame
class block:
def __init__(self,x,y,res="data/res/tile.png",flippedX=False,flippedY=False,rectsizes=[0,0,8,8],col=(255,255,255)):
self.rect=pygame.Rect(x+rectsizes[0],y+rectsizes[1],rectsizes[2],rectsizes[3])
self.pos=[x,y]
self.blockTexture=pygame.transform.flip(pygame.image.l... | 41.416667 | 119 | 0.692153 | import pygame
class block:
def __init__(self,x,y,res="data/res/tile.png",flippedX=False,flippedY=False,rectsizes=[0,0,8,8],col=(255,255,255)):
self.rect=pygame.Rect(x+rectsizes[0],y+rectsizes[1],rectsizes[2],rectsizes[3])
self.pos=[x,y]
self.blockTexture=pygame.transform.flip(pygame.image.l... | true | true |
1c1b72169dd443839023420a828058e9753d8db3 | 2,234 | py | Python | save_model.py | Business-Wizard/yolov4-custom-functions | daf98d28b40a17306495883425fe04b6e20b5ff6 | [
"MIT"
] | null | null | null | save_model.py | Business-Wizard/yolov4-custom-functions | daf98d28b40a17306495883425fe04b6e20b5ff6 | [
"MIT"
] | null | null | null | save_model.py | Business-Wizard/yolov4-custom-functions | daf98d28b40a17306495883425fe04b6e20b5ff6 | [
"MIT"
] | null | null | null | import tensorflow as tf
from absl import app, flags, logging
from absl.flags import FLAGS
from core.yolov4 import YOLO, decode, filter_boxes
import core.utils as utils
from core.config import cfg
flags.DEFINE_string('weights', './data/yolov4.weights', 'path to weights file')
flags.DEFINE_string('output', './ch... | 42.150943 | 156 | 0.705909 | import tensorflow as tf
from absl import app, flags, logging
from absl.flags import FLAGS
from core.yolov4 import YOLO, decode, filter_boxes
import core.utils as utils
from core.config import cfg
flags.DEFINE_string('weights', './data/yolov4.weights', 'path to weights file')
flags.DEFINE_string('output', './ch... | true | true |
1c1b72773e6c15d0ebbe2ceacaf6a7238953976c | 46 | py | Python | src/ensae_projects/challenge/__init__.py | sdpython/ensae_projects | 9647751da053c09fa35402527b294e02a4e6e2ad | [
"MIT"
] | 1 | 2020-11-22T10:24:54.000Z | 2020-11-22T10:24:54.000Z | src/ensae_projects/challenge/__init__.py | sdpython/ensae_projects | 9647751da053c09fa35402527b294e02a4e6e2ad | [
"MIT"
] | 13 | 2017-11-20T00:20:45.000Z | 2021-01-05T14:13:51.000Z | src/ensae_projects/challenge/__init__.py | sdpython/ensae_projects | 9647751da053c09fa35402527b294e02a4e6e2ad | [
"MIT"
] | null | null | null | """
@file
@brief Shortcuts to challenges
"""
| 9.2 | 31 | 0.652174 | true | true | |
1c1b739a621ce119e8f532493eab4fa13640eccf | 2,844 | py | Python | lib/spack/spack/cmd/test.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-08-20T06:55:11.000Z | 2018-08-20T06:55:11.000Z | lib/spack/spack/cmd/test.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-04-29T22:36:27.000Z | 2019-04-30T12:51:38.000Z | lib/spack/spack/cmd/test.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-12T19:27:17.000Z | 2020-03-12T19:27:17.000Z | # Copyright 2013-2019 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 __future__ import print_function
import sys
import os
import re
import argparse
import pytest
from six import String... | 30.255319 | 73 | 0.636076 |
from __future__ import print_function
import sys
import os
import re
import argparse
import pytest
from six import StringIO
from llnl.util.filesystem import working_dir
from llnl.util.tty.colify import colify
import spack.paths
description = "run spack's unit tests"
section = "developer"
level = "long"
def s... | true | true |
1c1b74089638949f8f7f306ccdf5c31dc29c118e | 5,574 | py | Python | python/oneflow/nn/modules/moving_average_min_max_observer.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/nn/modules/moving_average_min_max_observer.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/nn/modules/moving_average_min_max_observer.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.781818 | 143 | 0.606925 | import numpy as np
import oneflow as flow
from oneflow.framework.tensor import register_tensor_op
from oneflow.nn.module import Module
class MovingAverageMinMaxObserver(Module):
def __init__(
self,
training: bool = False,
quantization_formula: str = "google",
stop_update_after_ite... | true | true |
1c1b7427a5af3c11619dec0b54f8e1c09399c744 | 1,440 | py | Python | tests/test_data/test_utils.py | colliner/spektral | b776200fd1fa820f05b559f0c1c6265e0eca4894 | [
"MIT"
] | null | null | null | tests/test_data/test_utils.py | colliner/spektral | b776200fd1fa820f05b559f0c1c6265e0eca4894 | [
"MIT"
] | null | null | null | tests/test_data/test_utils.py | colliner/spektral | b776200fd1fa820f05b559f0c1c6265e0eca4894 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.sparse as sp
from spektral.data import Dataset, Graph
from spektral.data.utils import to_disjoint, to_batch, batch_generator
ns = np.random.randint(3, 10, 10)
f = 3
a_list = [sp.csr_matrix(np.ones((n, n))) for n in ns]
x_list = [np.random.rand(n, f) for n in ns]
y = [[0, 1]] * len(ns)
... | 26.181818 | 102 | 0.589583 | import numpy as np
import scipy.sparse as sp
from spektral.data import Dataset, Graph
from spektral.data.utils import to_disjoint, to_batch, batch_generator
ns = np.random.randint(3, 10, 10)
f = 3
a_list = [sp.csr_matrix(np.ones((n, n))) for n in ns]
x_list = [np.random.rand(n, f) for n in ns]
y = [[0, 1]] * len(ns)
... | true | true |
1c1b74359928a49a500c84e1b697202432bf3c41 | 1,778 | py | Python | neighborhood/migrations/0004_auto_20210603_0813.py | Derrick-Nyongesa/Neighborhood-Watch | 06668f25ced27f6e9d1b58835c3cbaed15e0ff7f | [
"MIT"
] | null | null | null | neighborhood/migrations/0004_auto_20210603_0813.py | Derrick-Nyongesa/Neighborhood-Watch | 06668f25ced27f6e9d1b58835c3cbaed15e0ff7f | [
"MIT"
] | null | null | null | neighborhood/migrations/0004_auto_20210603_0813.py | Derrick-Nyongesa/Neighborhood-Watch | 06668f25ced27f6e9d1b58835c3cbaed15e0ff7f | [
"MIT"
] | null | null | null | # Generated by Django 3.2.2 on 2021-06-03 05:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('neighborhood', '0003_auto_20210603_0754'),
]
operations = [
migrations.RemoveField(
model_name=... | 35.56 | 164 | 0.591114 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('neighborhood', '0003_auto_20210603_0754'),
]
operations = [
migrations.RemoveField(
model_name='userprofile',
name='location',
... | true | true |
1c1b74e1d35f27e29e1d7b70f8fbd8e1c5734ebd | 43,365 | py | Python | hata/discord/interaction/components.py | Zeref-Draganeel/hata | faeadbef406bd9a2053ae4a41f48e214e3e272ca | [
"0BSD"
] | null | null | null | hata/discord/interaction/components.py | Zeref-Draganeel/hata | faeadbef406bd9a2053ae4a41f48e214e3e272ca | [
"0BSD"
] | null | null | null | hata/discord/interaction/components.py | Zeref-Draganeel/hata | faeadbef406bd9a2053ae4a41f48e214e3e272ca | [
"0BSD"
] | null | null | null | __all__ = ( 'ComponentBase', 'ComponentButton', 'ComponentRow', 'ComponentSelect', 'ComponentSelectOption',
'create_component')
from os import urandom as random_bytes
from base64 import b85encode as to_base85
import reprlib
from ...backend.utils import copy_docs
from ...backend.export import export
from ..bases ... | 29.241403 | 114 | 0.566332 | __all__ = ( 'ComponentBase', 'ComponentButton', 'ComponentRow', 'ComponentSelect', 'ComponentSelectOption',
'create_component')
from os import urandom as random_bytes
from base64 import b85encode as to_base85
import reprlib
from ...backend.utils import copy_docs
from ...backend.export import export
from ..bases ... | true | true |
1c1b7539436350a4a77fb117095cfee11c5be3ea | 2,925 | py | Python | 2016/day8_2.py | pacificsky/AdventOfCode | 53d985046a158f5ed9a50814ba084e4a0ccfc744 | [
"Apache-2.0"
] | null | null | null | 2016/day8_2.py | pacificsky/AdventOfCode | 53d985046a158f5ed9a50814ba084e4a0ccfc744 | [
"Apache-2.0"
] | null | null | null | 2016/day8_2.py | pacificsky/AdventOfCode | 53d985046a158f5ed9a50814ba084e4a0ccfc744 | [
"Apache-2.0"
] | null | null | null | # http://adventofcode.com/2016/day/8
import parse
RECT = 1
ROTATE_ROW = 2
ROTATE_COL = 3
WIDTH_X = 50
HEIGHT_Y = 6
def init():
screen_state = [None for y in range(HEIGHT_Y)]
for y in range(HEIGHT_Y):
screen_state[y] = [0 for x in range(WIDTH_X)]
return screen_state
def get_instr(line):
da... | 26.116071 | 106 | 0.591111 |
import parse
RECT = 1
ROTATE_ROW = 2
ROTATE_COL = 3
WIDTH_X = 50
HEIGHT_Y = 6
def init():
screen_state = [None for y in range(HEIGHT_Y)]
for y in range(HEIGHT_Y):
screen_state[y] = [0 for x in range(WIDTH_X)]
return screen_state
def get_instr(line):
data = parse.parse("rect {}x{}", line)... | false | true |
1c1b756495d02016219ea4c7c4d87fe52989baca | 4,242 | py | Python | demo/sgi/gl/zrgb.py | tomjackbear/python-0.9.1 | 00adeddadaede51e92447523266c9d5616201c38 | [
"FSFAP"
] | 4 | 2020-07-21T09:47:52.000Z | 2022-01-05T21:43:36.000Z | demo/sgi/gl/zrgb.py | tomjackbear/python-0.9.1 | 00adeddadaede51e92447523266c9d5616201c38 | [
"FSFAP"
] | 1 | 2020-09-23T20:46:33.000Z | 2020-09-23T20:59:57.000Z | demo/sgi/gl/zrgb.py | tomjackbear/python-0.9.1 | 00adeddadaede51e92447523266c9d5616201c38 | [
"FSFAP"
] | 4 | 2020-07-13T00:45:24.000Z | 2021-09-04T14:50:46.000Z | #! /ufs/guido/bin/sgi/python
# zrgb (Requires Z buffer.)
#
# This program demostrates zbuffering 3 intersecting RGB polygons while
# in doublebuffer mode where, movement of the mouse with the LEFTMOUSE
# button depressed will, rotate the 3 polygons. This is done by compound
# rotations allowing continuous screen-or... | 24.952941 | 78 | 0.440123 |
from gl import *
from GL import *
from DEVICE import *
objmat=[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]
idmat=[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]
def main() :
mode = 0
omx = 0
mx = 0
omy = 0
... | false | true |
1c1b75847fb541a30414ac68c9f93c4c7ab7a43a | 54 | py | Python | kiwi-engine-selector/kiwi/heuristics/user.py | bubblegumsoldier/kiwi | 91701c1806dcfbc1b038fecf7c2cab8bb07a01d4 | [
"MIT"
] | null | null | null | kiwi-engine-selector/kiwi/heuristics/user.py | bubblegumsoldier/kiwi | 91701c1806dcfbc1b038fecf7c2cab8bb07a01d4 | [
"MIT"
] | null | null | null | kiwi-engine-selector/kiwi/heuristics/user.py | bubblegumsoldier/kiwi | 91701c1806dcfbc1b038fecf7c2cab8bb07a01d4 | [
"MIT"
] | null | null | null | def get_heuristic(**kwargs):
return kwargs["user"] | 27 | 28 | 0.703704 | def get_heuristic(**kwargs):
return kwargs["user"] | true | true |
1c1b761b9fb3279f59ba19c105098632118377da | 1,279 | py | Python | roocs_utils/inventory/pickle_store.py | aulemahal/roocs-utils | 2894c6b137b47f7eac57e650d7e7ad03dddfd75a | [
"BSD-3-Clause"
] | null | null | null | roocs_utils/inventory/pickle_store.py | aulemahal/roocs-utils | 2894c6b137b47f7eac57e650d7e7ad03dddfd75a | [
"BSD-3-Clause"
] | null | null | null | roocs_utils/inventory/pickle_store.py | aulemahal/roocs-utils | 2894c6b137b47f7eac57e650d7e7ad03dddfd75a | [
"BSD-3-Clause"
] | null | null | null | import os
import pickle
import time
from roocs_utils.inventory import logging
from roocs_utils.inventory.file_lock import FileLock
LOGGER = logging.getLogger(__file__)
class PickleStore:
def __init__(self, content_file):
self._content_file = content_file
self._lock = FileLock(f"{content_file}.lo... | 22.051724 | 71 | 0.599687 | import os
import pickle
import time
from roocs_utils.inventory import logging
from roocs_utils.inventory.file_lock import FileLock
LOGGER = logging.getLogger(__file__)
class PickleStore:
def __init__(self, content_file):
self._content_file = content_file
self._lock = FileLock(f"{content_file}.lo... | true | true |
1c1b7792047aaa77d70c7533f3e788964a32c4b3 | 23,914 | py | Python | tests/functional/trace_fio.py | Ostrokrzew/standalone-linux-io-tracer | 5fcbe7f0c7b027d9e5fdfb4c6e9d553c6fa617b6 | [
"BSD-3-Clause-Clear"
] | 24 | 2019-05-09T08:36:46.000Z | 2022-03-16T16:20:01.000Z | tests/functional/trace_fio.py | Ostrokrzew/standalone-linux-io-tracer | 5fcbe7f0c7b027d9e5fdfb4c6e9d553c6fa617b6 | [
"BSD-3-Clause-Clear"
] | 122 | 2019-05-27T12:27:15.000Z | 2020-07-31T06:45:08.000Z | tests/functional/trace_fio.py | Ostrokrzew/standalone-linux-io-tracer | 5fcbe7f0c7b027d9e5fdfb4c6e9d553c6fa617b6 | [
"BSD-3-Clause-Clear"
] | 18 | 2019-05-27T09:31:56.000Z | 2021-05-27T18:54:52.000Z | #
# Copyright(c) 2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
from math import isclose
import pytest
from datetime import timedelta
from attotime import attotimedelta
from test_utils.size import Size, Unit
from test_utils.os_utils import Udev
from test_tools.fio.fio_param import ReadWrite, I... | 40.532203 | 95 | 0.574308 |
from math import isclose
import pytest
from datetime import timedelta
from attotime import attotimedelta
from test_utils.size import Size, Unit
from test_utils.os_utils import Udev
from test_tools.fio.fio_param import ReadWrite, IoEngine
from test_tools.fio.fio import Fio
from test_tools.fio.fio_result import Fio... | true | true |
1c1b779f0ba2075d83c89bbae5e7d430bcf6709e | 7,984 | py | Python | ten_h_looper/create_loop.py | AleksaC/ten-h-looper | 01aa767e6e55fb6f9cf3cdcbcd2335ff9cf472ea | [
"MIT"
] | null | null | null | ten_h_looper/create_loop.py | AleksaC/ten-h-looper | 01aa767e6e55fb6f9cf3cdcbcd2335ff9cf472ea | [
"MIT"
] | null | null | null | ten_h_looper/create_loop.py | AleksaC/ten-h-looper | 01aa767e6e55fb6f9cf3cdcbcd2335ff9cf472ea | [
"MIT"
] | null | null | null | import argparse
import math
import os
import re
import subprocess
import sys
import uuid
from time import strftime, gmtime
import youtube_dl
TEMPFILE_PREFIX = "tenxlooper-temp"
def video_time(s):
units = s.split(":")
seconds = [1, 60, 3600, 86400]
try:
return sum(int(x) * seconds[len(units) - i ... | 28.312057 | 88 | 0.58993 | import argparse
import math
import os
import re
import subprocess
import sys
import uuid
from time import strftime, gmtime
import youtube_dl
TEMPFILE_PREFIX = "tenxlooper-temp"
def video_time(s):
units = s.split(":")
seconds = [1, 60, 3600, 86400]
try:
return sum(int(x) * seconds[len(units) - i ... | true | true |
1c1b77bb811336c1db85eddc6b16a42e49746e68 | 2,839 | py | Python | src/examples/python/constraints.py | LightSecOps/Triton | d167a1855ed0d74352deae6e32b3f95ceb4bb705 | [
"Apache-2.0"
] | 15 | 2021-12-08T09:53:35.000Z | 2022-03-07T10:13:37.000Z | src/examples/python/constraints.py | LightSecOps/Triton | d167a1855ed0d74352deae6e32b3f95ceb4bb705 | [
"Apache-2.0"
] | null | null | null | src/examples/python/constraints.py | LightSecOps/Triton | d167a1855ed0d74352deae6e32b3f95ceb4bb705 | [
"Apache-2.0"
] | 1 | 2021-12-13T22:45:20.000Z | 2021-12-13T22:45:20.000Z | #!/usr/bin/env python2
## -*- coding: utf-8 -*-
from __future__ import print_function
from triton import TritonContext, ARCH, Instruction
# Constraint using AST form
def test1():
Triton = TritonContext()
Triton.setArchitecture(ARCH.X86)
astCtxt = Triton.getAstContext()
x = Triton.newSymbolicVari... | 23.46281 | 70 | 0.630151 |
t print_function
from triton import TritonContext, ARCH, Instruction
def test1():
Triton = TritonContext()
Triton.setArchitecture(ARCH.X86)
astCtxt = Triton.getAstContext()
x = Triton.newSymbolicVariable(32)
c = astCtxt.equal(
astCtxt.bvsub(
astCtxt.bvxor(
... | true | true |
1c1b788925c229b14bfe92be222963ec26ab9c7b | 20,496 | py | Python | service/inference.py | drunkcoding/model-inference | 02d2240bc7052fa32223a80fa63625fe681db102 | [
"MIT"
] | 1 | 2021-11-15T19:07:13.000Z | 2021-11-15T19:07:13.000Z | service/inference.py | drunkcoding/model-inference | 02d2240bc7052fa32223a80fa63625fe681db102 | [
"MIT"
] | null | null | null | service/inference.py | drunkcoding/model-inference | 02d2240bc7052fa32223a80fa63625fe681db102 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
import json
import logging
import subprocess
import random
import re
from typing import List, Optional, Tuple
import numpy as np
import pandas as pd
import io
import torch
from torch.utils.dlpack import to_dlpack
from torch.utils.dlpack import from_dlpack
import os
import nn_pruning
im... | 38.096654 | 131 | 0.580113 | from dataclasses import dataclass
import json
import logging
import subprocess
import random
import re
from typing import List, Optional, Tuple
import numpy as np
import pandas as pd
import io
import torch
from torch.utils.dlpack import to_dlpack
from torch.utils.dlpack import from_dlpack
import os
import nn_pruning
im... | true | true |
1c1b795dc68e5b2e939a4c212c8ae727d9b84e5f | 4,120 | py | Python | resnet_prediction.py | movchan74/message_prediction_cnn_solution | fd9564a981b8051120d20653426953169809702e | [
"MIT"
] | 3 | 2017-12-30T16:22:38.000Z | 2017-12-31T03:02:03.000Z | resnet_prediction.py | movchan74/message_prediction_cnn_solution | fd9564a981b8051120d20653426953169809702e | [
"MIT"
] | null | null | null | resnet_prediction.py | movchan74/message_prediction_cnn_solution | fd9564a981b8051120d20653426953169809702e | [
"MIT"
] | null | null | null | import json
import sys
import os
from collections import Counter
import tqdm
import numpy as np
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.python.ops import array_ops
import random
import pickle
import editdistance
import soundex
import jellyfish
import string
import math
import requ... | 30.072993 | 114 | 0.681068 | import json
import sys
import os
from collections import Counter
import tqdm
import numpy as np
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.python.ops import array_ops
import random
import pickle
import editdistance
import soundex
import jellyfish
import string
import math
import requ... | true | true |
1c1b7a6760dab9693d0958c8e0968a282aaa717a | 2,504 | py | Python | utils/plot_util.py | richtertill/node_embeddings | 7b34fd060178e90b0c82744f5ad2fd600723dbf2 | [
"MIT"
] | 4 | 2020-11-01T20:00:53.000Z | 2021-08-18T21:09:31.000Z | utils/plot_util.py | richtertill/node_embeddings | 7b34fd060178e90b0c82744f5ad2fd600723dbf2 | [
"MIT"
] | 1 | 2021-08-21T12:18:37.000Z | 2021-08-21T12:18:37.000Z | utils/plot_util.py | richtertill/node_embeddings | 7b34fd060178e90b0c82744f5ad2fd600723dbf2 | [
"MIT"
] | 4 | 2020-11-17T17:10:00.000Z | 2021-12-27T04:11:24.000Z | import datetime
import pathlib
import pandas as pd
def create_experiment_folder():
now = datetime.datetime.now()
year = '{:04d}'.format(now.year)
month = '{:02d}'.format(now.month)
day = '{:02d}'.format(now.day)
minute = '{:02d}'.format(now.minute)
hour = '{:02d}'.format(now.hour)
timestamp = year + "_" + month... | 39.125 | 93 | 0.75 | import datetime
import pathlib
import pandas as pd
def create_experiment_folder():
now = datetime.datetime.now()
year = '{:04d}'.format(now.year)
month = '{:02d}'.format(now.month)
day = '{:02d}'.format(now.day)
minute = '{:02d}'.format(now.minute)
hour = '{:02d}'.format(now.hour)
timestamp = year + "_" + month... | true | true |
1c1b7aa8cf1d442fdcf313cdfcad182c3981b69a | 1,000 | py | Python | tests/test_trace_information.py | Context-Aware-Monitoring/Efficient-Stream-Monitoring | f08faaa87ac2ffe74014a9a6e864b641e4a160f5 | [
"MIT"
] | null | null | null | tests/test_trace_information.py | Context-Aware-Monitoring/Efficient-Stream-Monitoring | f08faaa87ac2ffe74014a9a6e864b641e4a160f5 | [
"MIT"
] | null | null | null | tests/test_trace_information.py | Context-Aware-Monitoring/Efficient-Stream-Monitoring | f08faaa87ac2ffe74014a9a6e864b641e4a160f5 | [
"MIT"
] | null | null | null | import unittest
import json
import os
import sys
import pdb
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import trace_information as ti
class TraceInformationTest(unittest.TestCase):
def setUp(self):
self.json_file = open('./data/test_trace.json')
self.trace ... | 27.027027 | 82 | 0.701 | import unittest
import json
import os
import sys
import pdb
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import trace_information as ti
class TraceInformationTest(unittest.TestCase):
def setUp(self):
self.json_file = open('./data/test_trace.json')
self.trace ... | true | true |
1c1b7c4ca7d259aeb1c84db1e8cfba17d565f783 | 1,061 | py | Python | packages/pyright-internal/src/tests/samples/missingSuper1.py | JelleZijlstra/pyright | 8c8bfd2da1c13242477b40d31486d14cd792b4a1 | [
"MIT"
] | null | null | null | packages/pyright-internal/src/tests/samples/missingSuper1.py | JelleZijlstra/pyright | 8c8bfd2da1c13242477b40d31486d14cd792b4a1 | [
"MIT"
] | null | null | null | packages/pyright-internal/src/tests/samples/missingSuper1.py | JelleZijlstra/pyright | 8c8bfd2da1c13242477b40d31486d14cd792b4a1 | [
"MIT"
] | null | null | null | # This sample tests the reportMissingSuperCall diagnostic check.
class ParentA:
def __init__(self):
pass
def __init_subclass__(cls) -> None:
pass
class ParentB:
def __init__(self):
pass
class ParentBPrime(ParentB):
pass
class ParentC:
pass
class ChildA(ParentA, Par... | 17.112903 | 64 | 0.643732 |
class ParentA:
def __init__(self):
pass
def __init_subclass__(cls) -> None:
pass
class ParentB:
def __init__(self):
pass
class ParentBPrime(ParentB):
pass
class ParentC:
pass
class ChildA(ParentA, ParentB):
def __init__(self):
pass
def _... | true | true |
1c1b7cfe904df691fd123387078e61d18856a7d8 | 11,823 | py | Python | recognition/ArcFace/image_iter.py | liuyibin-git/insightface | 5b40f4bfce7e2c9d10bb6328c4fed33e9d76c9de | [
"MIT"
] | 1 | 2021-06-22T17:09:14.000Z | 2021-06-22T17:09:14.000Z | recognition/ArcFace/image_iter.py | liuyibin-git/insightface | 5b40f4bfce7e2c9d10bb6328c4fed33e9d76c9de | [
"MIT"
] | 1 | 2020-07-24T03:33:21.000Z | 2020-07-24T03:33:21.000Z | recognition/ArcFace/image_iter.py | liuyibin-git/insightface | 5b40f4bfce7e2c9d10bb6328c4fed33e9d76c9de | [
"MIT"
] | 1 | 2020-12-07T20:39:28.000Z | 2020-12-07T20:39:28.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import logging
import sys
import numbers
import math
import sklearn
import datetime
import numpy as np
import cv2
import mxnet as mx
from mxnet import ndarray as nd
from mxnet import io... | 36.831776 | 100 | 0.514844 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import logging
import sys
import numbers
import math
import sklearn
import datetime
import numpy as np
import cv2
import mxnet as mx
from mxnet import ndarray as nd
from mxnet import io... | true | true |
1c1b7d19c1f34bc2100de3a51984293e070eff81 | 5,230 | py | Python | api/hdf5_fun.py | zhyhan/pathology-multiresolution | a44e6563dc5bca5998278403e93a4f74dfc3e8e2 | [
"Apache-2.0"
] | 1 | 2020-03-09T12:45:15.000Z | 2020-03-09T12:45:15.000Z | api/hdf5_fun.py | hzycn/pathology-multiresolution | a44e6563dc5bca5998278403e93a4f74dfc3e8e2 | [
"Apache-2.0"
] | null | null | null | api/hdf5_fun.py | hzycn/pathology-multiresolution | a44e6563dc5bca5998278403e93a4f74dfc3e8e2 | [
"Apache-2.0"
] | 1 | 2019-09-07T19:02:14.000Z | 2019-09-07T19:02:14.000Z | import h5py
import numpy as np
import config_fun
import glob
import os
import random
import sys
from PIL import Image
from torch.utils.data import Dataset
from tqdm import tqdm
import patch_preprocess_fun
from itertools import izip
import random
def _precoss_patches(cfg, dataset, file_type):
data_block = np.zeros(... | 34.635762 | 105 | 0.627916 | import h5py
import numpy as np
import config_fun
import glob
import os
import random
import sys
from PIL import Image
from torch.utils.data import Dataset
from tqdm import tqdm
import patch_preprocess_fun
from itertools import izip
import random
def _precoss_patches(cfg, dataset, file_type):
data_block = np.zeros(... | true | true |
1c1b7db7f6bbc765f2a9d2b7ceca505ec33439ad | 11,829 | py | Python | autosklearn/util/logging_.py | vardaan-raj/auto-sklearn | 4597152e3a60cd6f6e32719a3bef26e13951b102 | [
"BSD-3-Clause"
] | null | null | null | autosklearn/util/logging_.py | vardaan-raj/auto-sklearn | 4597152e3a60cd6f6e32719a3bef26e13951b102 | [
"BSD-3-Clause"
] | null | null | null | autosklearn/util/logging_.py | vardaan-raj/auto-sklearn | 4597152e3a60cd6f6e32719a3bef26e13951b102 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
import logging
import logging.config
import logging.handlers
import multiprocessing
import os
import pickle
import random
import select
import socketserver
import struct
import threading
from typing import Any, Dict, Optional, Type
import yaml
def setup_logger(
output_dir: str,
file... | 33.321127 | 115 | 0.619156 |
import logging
import logging.config
import logging.handlers
import multiprocessing
import os
import pickle
import random
import select
import socketserver
import struct
import threading
from typing import Any, Dict, Optional, Type
import yaml
def setup_logger(
output_dir: str,
filename: Optional[str] = Non... | true | true |
1c1b7df70b7457784b9e077467b92d318f3b5c57 | 159 | py | Python | npe2/manifest/__init__.py | nclack/npe2 | 92555a848de10ad597f35721fd14e4b13c51c82d | [
"BSD-3-Clause"
] | 1 | 2022-03-29T00:29:45.000Z | 2022-03-29T00:29:45.000Z | npe2/manifest/__init__.py | nclack/npe2 | 92555a848de10ad597f35721fd14e4b13c51c82d | [
"BSD-3-Clause"
] | 102 | 2021-11-23T20:18:15.000Z | 2022-03-31T22:59:46.000Z | npe2/manifest/__init__.py | nclack/npe2 | 92555a848de10ad597f35721fd14e4b13c51c82d | [
"BSD-3-Clause"
] | 4 | 2021-11-22T23:04:47.000Z | 2022-02-10T00:12:09.000Z | from ._package_metadata import PackageMetadata
from .schema import ENTRY_POINT, PluginManifest
__all__ = ["PackageMetadata", "PluginManifest", "ENTRY_POINT"]
| 31.8 | 62 | 0.81761 | from ._package_metadata import PackageMetadata
from .schema import ENTRY_POINT, PluginManifest
__all__ = ["PackageMetadata", "PluginManifest", "ENTRY_POINT"]
| true | true |
1c1b7e0d8d12c32dcaeaa5d1c0aed88d38dcfd53 | 596 | py | Python | dataset/corpus_test.py | fubiye/edgar-abs-kg | 3973059c7b1cdaab8a4e857a43c702ac0be7e725 | [
"MIT"
] | null | null | null | dataset/corpus_test.py | fubiye/edgar-abs-kg | 3973059c7b1cdaab8a4e857a43c702ac0be7e725 | [
"MIT"
] | null | null | null | dataset/corpus_test.py | fubiye/edgar-abs-kg | 3973059c7b1cdaab8a4e857a43c702ac0be7e725 | [
"MIT"
] | null | null | null | import pandas as pd
df = pd.read_csv(r'D:\data\edgar\example\corpus.csv')
# df['FilingType'] = df['Content'].apply(lambda content: content[:content.index('\n')])
# df['ContentLen'] = df['Content'].apply(lambda content: len(content))
# print(df[df['FilingType'] == '10-D'])
# print(df[df['FilingType'] == '10-D']['Conten... | 35.058824 | 87 | 0.637584 | import pandas as pd
df = pd.read_csv(r'D:\data\edgar\example\corpus.csv')
a = df[df['FilingType'] == '10-D']['Content'].iloc[0]
b = df[df['FilingType'] == '10-D']['Content'].iloc[1]
print(a)
print("$****$")
print(b) | true | true |
1c1b7ecf0899285c7482d8760ff28ce5514d20ac | 1,841 | py | Python | digest_auth.py | TortugaLabs/autonom | a66c08e21878f6c3b5997e508d3a74505af7acb7 | [
"MIT"
] | null | null | null | digest_auth.py | TortugaLabs/autonom | a66c08e21878f6c3b5997e508d3a74505af7acb7 | [
"MIT"
] | null | null | null | digest_auth.py | TortugaLabs/autonom | a66c08e21878f6c3b5997e508d3a74505af7acb7 | [
"MIT"
] | null | null | null | #/usr/bin/env python
#
# Perform http digest authentication
#
from bottle import route, request, response
from const import *
from ini import cfg
import userdb
import random
import shlex
def gen_noise(len = 16):
letters = '0123456789abcdef'
salt = ''
for x in range(len):
salt = salt + random.choice(letters... | 24.223684 | 110 | 0.637154 |
from bottle import route, request, response
from const import *
from ini import cfg
import userdb
import random
import shlex
def gen_noise(len = 16):
letters = '0123456789abcdef'
salt = ''
for x in range(len):
salt = salt + random.choice(letters)
return salt
@route('/digest-auth')
def auth():
user... | true | true |
1c1b7f0500398ba6e0f7a8dd00fdd41ee84f4bf1 | 831 | py | Python | cdag/tests/test_cdag.py | gitter-badger/c_dagger | 264192282edfc6f73ad0fa787e0a6caf7cf163f2 | [
"MIT"
] | 7 | 2021-02-17T21:36:26.000Z | 2021-05-14T20:44:15.000Z | cdag/tests/test_cdag.py | gitter-badger/c_dagger | 264192282edfc6f73ad0fa787e0a6caf7cf163f2 | [
"MIT"
] | null | null | null | cdag/tests/test_cdag.py | gitter-badger/c_dagger | 264192282edfc6f73ad0fa787e0a6caf7cf163f2 | [
"MIT"
] | 3 | 2021-03-08T15:50:21.000Z | 2021-10-01T15:52:57.000Z | #!/usr/bin/env python
"""Tests for `cdag` package."""
import unittest
from click.testing import CliRunner
from cdag import cdag
from cdag import cli
class TestCdag(unittest.TestCase):
"""Tests for `cdag` package."""
def setUp(self):
"""Set up test fixtures, if any."""
def tearDown(self):
... | 24.441176 | 74 | 0.629362 |
import unittest
from click.testing import CliRunner
from cdag import cdag
from cdag import cli
class TestCdag(unittest.TestCase):
def setUp(self):
def tearDown(self):
def test_000_something(self):
def test_command_line_interface(self):
runner = CliRunner()
result = runner.invo... | true | true |
1c1b7f99abc599108000b95617c3ef3e3ef547f5 | 8,958 | py | Python | zippity/__init__.py | hosford42/zippity | 4dbc74b41cea8f6129b6c6babdc071384e34f528 | [
"MIT"
] | null | null | null | zippity/__init__.py | hosford42/zippity | 4dbc74b41cea8f6129b6c6babdc071384e34f528 | [
"MIT"
] | null | null | null | zippity/__init__.py | hosford42/zippity | 4dbc74b41cea8f6129b6c6babdc071384e34f528 | [
"MIT"
] | null | null | null | """
# Zippity
*A simple zip file-based persistence library*
Usage:
from zippity import Zippable
class MyZippableClass(Zippable):
def __init__(self, members):
self.simple_member1 = members['simple_member1']
self.simple_member2 = members['simple_member2']
self.zipp... | 48.421622 | 120 | 0.588524 |
import ast
import os
import shutil
import tempfile
import zipfile
from abc import ABCMeta
from typing import Any, Iterator, Tuple, Callable
from zippity.names import find_object, get_fully_qualified_name
def _path_append(parent, child):
parent = parent.rstrip('/')
child = child.lstrip('/')
return pa... | true | true |
1c1b81b70a8c6e395c341921f9cb30f2eeb6c00e | 869 | py | Python | source/pdv/partners/migrations/0001_initial.py | DanielBacci/geodjango | b8d163e862255834f6ba495019f63fff51aecb7e | [
"MIT"
] | null | null | null | source/pdv/partners/migrations/0001_initial.py | DanielBacci/geodjango | b8d163e862255834f6ba495019f63fff51aecb7e | [
"MIT"
] | 6 | 2019-12-04T23:50:03.000Z | 2021-09-22T17:56:51.000Z | source/pdv/partners/migrations/0001_initial.py | DanielBacci/geodjango | b8d163e862255834f6ba495019f63fff51aecb7e | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-21 14:42
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Partner',
fields... | 32.185185 | 114 | 0.609896 |
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Partner',
fields=[
('id', models.AutoField(auto... | true | true |
1c1b81da2ff3c81177ed108a2828e3432b73602a | 1,653 | py | Python | configs/classification/baseline_plus/cub/baseline-plus_conv4_1xb64_cub_5way-5shot.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 376 | 2021-11-23T13:29:57.000Z | 2022-03-30T07:22:14.000Z | configs/classification/baseline_plus/cub/baseline-plus_conv4_1xb64_cub_5way-5shot.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 51 | 2021-11-23T14:45:08.000Z | 2022-03-30T03:37:15.000Z | configs/classification/baseline_plus/cub/baseline-plus_conv4_1xb64_cub_5way-5shot.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 56 | 2021-11-23T14:02:27.000Z | 2022-03-31T09:01:50.000Z | _base_ = [
'../../_base_/meta_test/cub_meta-test_5way-5shot.py',
'../../_base_/runtime/epoch_based_runtime.py',
'../../_base_/schedules/sgd_200epoch.py'
]
img_size = 84
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadI... | 32.411765 | 78 | 0.637024 | _base_ = [
'../../_base_/meta_test/cub_meta-test_5way-5shot.py',
'../../_base_/runtime/epoch_based_runtime.py',
'../../_base_/schedules/sgd_200epoch.py'
]
img_size = 84
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadI... | true | true |
1c1b827f1e84d595d8280aab75eac110dd631b85 | 3,155 | py | Python | Q/questionnaire/admin/admin_projects.py | trubliphone/esdoc-test | 2f7a39b22cdda89e55d5936ed131873812cf3791 | [
"MIT"
] | null | null | null | Q/questionnaire/admin/admin_projects.py | trubliphone/esdoc-test | 2f7a39b22cdda89e55d5936ed131873812cf3791 | [
"MIT"
] | 2 | 2017-11-01T14:29:46.000Z | 2017-11-02T12:16:03.000Z | Q/questionnaire/admin/admin_projects.py | trubliphone/esdoc-test | 2f7a39b22cdda89e55d5936ed131873812cf3791 | [
"MIT"
] | null | null | null | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
"""
.. mo... | 28.169643 | 115 | 0.615214 | Meta:
model = QProject
fields = [
"name",
"title",
"description",
"order",
"email",
"url",
"logo",
"display_logo",
"authenticated",
"is_active",
"is_displayed",
... | true | true |
1c1b82ee27f406f85f9a1c0431781ef597d68f8c | 8,526 | py | Python | proj/envs/cartpole_swingup.py | angelolovatto/deep-rl | 9f0c1aafe71852c8973bf1ab732114a3cdbe23ad | [
"MIT"
] | 1 | 2018-11-28T15:21:44.000Z | 2018-11-28T15:21:44.000Z | proj/envs/cartpole_swingup.py | angelolovatto/deep-rl | 9f0c1aafe71852c8973bf1ab732114a3cdbe23ad | [
"MIT"
] | null | null | null | proj/envs/cartpole_swingup.py | angelolovatto/deep-rl | 9f0c1aafe71852c8973bf1ab732114a3cdbe23ad | [
"MIT"
] | null | null | null | """
Cart pole swing-up: modified version of:
https://github.com/hardmaru/estool/blob/master/custom_envs/cartpole_swingup.py
"""
import math
from collections import namedtuple
import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
Physics = namedtuple("Physics", "gravity forcemag deltat fr... | 35.525 | 88 | 0.597115 | import math
from collections import namedtuple
import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
Physics = namedtuple("Physics", "gravity forcemag deltat friction")
State = namedtuple("State", "x_pos x_dot theta theta_dot")
Screen = namedtuple("Screen", "width height")
Cart = name... | true | true |
1c1b83f0ce8cef805f6f3df9bfe07ee4a0c0681e | 408 | py | Python | androidapi/api/migrations/0002_usuario_status.py | EnzoRobaina/djangorest-androidapi | b6ad421ba79abb19f0dad924cab36944cb5e9747 | [
"Apache-2.0"
] | null | null | null | androidapi/api/migrations/0002_usuario_status.py | EnzoRobaina/djangorest-androidapi | b6ad421ba79abb19f0dad924cab36944cb5e9747 | [
"Apache-2.0"
] | null | null | null | androidapi/api/migrations/0002_usuario_status.py | EnzoRobaina/djangorest-androidapi | b6ad421ba79abb19f0dad924cab36944cb5e9747 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.3 on 2018-11-29 17:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='usuario',
name='status',
field=... | 20.4 | 52 | 0.583333 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='usuario',
name='status',
field=models.BooleanField(default=True),
... | true | true |
1c1b841469504e5cc7702e81177d0526d85bac19 | 3,629 | py | Python | .history/Missions_to_Mars/scrape_mars_20200812112856.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | .history/Missions_to_Mars/scrape_mars_20200812112856.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | .history/Missions_to_Mars/scrape_mars_20200812112856.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | 2 | 2020-11-02T08:12:16.000Z | 2021-05-17T21:45:42.000Z | from splinter import Browser
from bs4 import BeautifulSoup as bs
import pandas as pd
import time
import re
# This is for debugging
def savetofile(contents):
file = open('_temporary.txt',"w",encoding="utf-8")
file.write(contents)
file.close()
def scrape():
executable_path = {"executable_path": "chrom... | 28.131783 | 155 | 0.63213 | from splinter import Browser
from bs4 import BeautifulSoup as bs
import pandas as pd
import time
import re
def savetofile(contents):
file = open('_temporary.txt',"w",encoding="utf-8")
file.write(contents)
file.close()
def scrape():
executable_path = {"executable_path": "chromedriver"}
browser =... | true | true |
1c1b8483056fcf871294638802e52bb15265869c | 3,243 | py | Python | topic_model/topic_modeling_english.py | krikyn/Strong-Paraphrase-Generation-2020 | 3d5b6f4fd0d4b4f96ed6bdd91b7000d3d80fc901 | [
"MIT"
] | 10 | 2020-04-29T18:28:34.000Z | 2021-11-26T07:41:19.000Z | topic_model/topic_modeling_english.py | krikyn/Strong-Paraphrase-Generation-2020 | 3d5b6f4fd0d4b4f96ed6bdd91b7000d3d80fc901 | [
"MIT"
] | null | null | null | topic_model/topic_modeling_english.py | krikyn/Strong-Paraphrase-Generation-2020 | 3d5b6f4fd0d4b4f96ed6bdd91b7000d3d80fc901 | [
"MIT"
] | 9 | 2020-07-02T08:31:55.000Z | 2021-11-15T20:57:54.000Z | import re
import numpy as np
import pandas as pd
from pprint import pprint
import gensim
import gensim.corpora as corpora
from gensim.utils import simple_preprocess
from gensim.models import CoherenceModel
import spacy
import pyLDAvis
import pyLDAvis.gensim
import matplotlib.pyplot as plt
import logging
import warnings... | 30.308411 | 108 | 0.66605 | import re
import numpy as np
import pandas as pd
from pprint import pprint
import gensim
import gensim.corpora as corpora
from gensim.utils import simple_preprocess
from gensim.models import CoherenceModel
import spacy
import pyLDAvis
import pyLDAvis.gensim
import matplotlib.pyplot as plt
import logging
import warnings... | true | true |
1c1b84f565446545e2fa2356dea1dac22e0d562d | 3,417 | py | Python | python/tests/test_microservice_tester.py | pdstrnadJC/seldon-core | acefbd76d74ff752843f8d8fa1368683849d0ca0 | [
"Apache-2.0"
] | 1 | 2020-11-24T03:26:43.000Z | 2020-11-24T03:26:43.000Z | python/tests/test_microservice_tester.py | pdstrnadJC/seldon-core | acefbd76d74ff752843f8d8fa1368683849d0ca0 | [
"Apache-2.0"
] | 97 | 2021-01-22T11:50:05.000Z | 2021-08-02T21:22:21.000Z | python/tests/test_microservice_tester.py | midhun1998/seldon-core | 76386a01309f41deb6362ffdb6f65ab26219238a | [
"Apache-2.0"
] | 1 | 2021-02-26T20:52:54.000Z | 2021-02-26T20:52:54.000Z | import os
import pytest
import json
import logging
import numpy as np
from seldon_core.microservice_tester import (
run_method,
run_send_feedback,
reconciliate_cont_type,
SeldonTesterException,
)
from unittest import mock
from seldon_core.utils import array_to_grpc_datadef, seldon_message_to_json
from ... | 26.695313 | 82 | 0.621305 | import os
import pytest
import json
import logging
import numpy as np
from seldon_core.microservice_tester import (
run_method,
run_send_feedback,
reconciliate_cont_type,
SeldonTesterException,
)
from unittest import mock
from seldon_core.utils import array_to_grpc_datadef, seldon_message_to_json
from ... | true | true |
1c1b8503da813ef9be0a4b7c26fa2d9ece8dd471 | 11,718 | py | Python | stable_baselines3/common/utils.py | roclark/stable-baselines3 | 21e9994ff99db306e14bfa19ca36f133c7153df4 | [
"MIT"
] | 1 | 2020-10-06T09:06:37.000Z | 2020-10-06T09:06:37.000Z | stable_baselines3/common/utils.py | roclark/stable-baselines3 | 21e9994ff99db306e14bfa19ca36f133c7153df4 | [
"MIT"
] | null | null | null | stable_baselines3/common/utils.py | roclark/stable-baselines3 | 21e9994ff99db306e14bfa19ca36f133c7153df4 | [
"MIT"
] | 1 | 2020-12-18T01:17:26.000Z | 2020-12-18T01:17:26.000Z | import glob
import os
import random
from collections import deque
from typing import Callable, Iterable, Optional, Union
import gym
import numpy as np
import torch as th
# Check if tensorboard is available for pytorch
try:
from torch.utils.tensorboard import SummaryWriter
except ImportError:
SummaryWriter = N... | 37.92233 | 118 | 0.665899 | import glob
import os
import random
from collections import deque
from typing import Callable, Iterable, Optional, Union
import gym
import numpy as np
import torch as th
try:
from torch.utils.tensorboard import SummaryWriter
except ImportError:
SummaryWriter = None
from stable_baselines3.common import logge... | true | true |
1c1b8551301fd07a17ccc5f74cef5d9f8506ed19 | 1,767 | py | Python | tests/deployment/test_delete.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/deployment/test_delete.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/deployment/test_delete.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest.mock
import pytest
import pycamunda.deployment
from tests.mock import raise_requests_exception_mock, not_ok_response_mock
def test_delete_params(engine_url):
delete_deployment = pycamunda.deployment.Delete(
url=engine_url, id_='anId', cascade=True, skip_custom_li... | 32.722222 | 99 | 0.764573 |
import unittest.mock
import pytest
import pycamunda.deployment
from tests.mock import raise_requests_exception_mock, not_ok_response_mock
def test_delete_params(engine_url):
delete_deployment = pycamunda.deployment.Delete(
url=engine_url, id_='anId', cascade=True, skip_custom_listeners=True, skip_io_m... | true | true |
1c1b86864049fdc05bf7a43af7b797ceb47e3c96 | 40,713 | py | Python | src/integration-tests/integration-test.py | stishkin/onefuzz | eca88cb35f60c30fe7a6dbfbc436be0f7ddc36c9 | [
"MIT"
] | null | null | null | src/integration-tests/integration-test.py | stishkin/onefuzz | eca88cb35f60c30fe7a6dbfbc436be0f7ddc36c9 | [
"MIT"
] | null | null | null | src/integration-tests/integration-test.py | stishkin/onefuzz | eca88cb35f60c30fe7a6dbfbc436be0f7ddc36c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
""" Launch multiple templates using samples to verify Onefuzz works end-to-end """
# NOTE:
# 1. This script uses an unpacked version of the `integration-test-results`
# from the CI pipeline.
#
# Check out https://... | 34.502542 | 88 | 0.535234 |
import datetime
import logging
import os
import re
import sys
import time
from enum import Enum
from shutil import which
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar
from uuid import UUID, uuid4
import requests
from onefuzz.api import Command, Onefuzz
from onefuzz.backe... | true | true |
1c1b880b573b8b924a63dc091798fe466a7be1f7 | 9,697 | py | Python | tests/st/mem_reuse/resnet.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | 2 | 2020-04-28T03:49:10.000Z | 2020-04-28T03:49:13.000Z | tests/st/mem_reuse/resnet.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | tests/st/mem_reuse/resnet.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 32.215947 | 120 | 0.649067 |
import numpy as np
import mindspore.nn as nn
from mindspore import Tensor
from mindspore.ops import operations as P
from mindspore.common.initializer import initializer
from mindspore.common import dtype as mstype
def weight_variable(shape):
return initializer('XavierUniform', shape=shape, dtype=mst... | true | true |
1c1b8924ca08aa20cf69852030271c7fc2a9c2c8 | 248 | py | Python | app/constants.py | Drakomire/mCoding-Bot | 0e879152b7b507b11ae44b8606b05ee864c48694 | [
"MIT"
] | 9 | 2021-06-07T20:07:48.000Z | 2021-11-08T11:20:29.000Z | app/constants.py | Drakomire/mCoding-Bot | 0e879152b7b507b11ae44b8606b05ee864c48694 | [
"MIT"
] | 7 | 2021-05-26T00:21:41.000Z | 2021-10-05T19:03:40.000Z | app/constants.py | Drakomire/mCoding-Bot | 0e879152b7b507b11ae44b8606b05ee864c48694 | [
"MIT"
] | 8 | 2021-06-06T15:11:15.000Z | 2021-10-09T14:12:12.000Z | class SpecialType:
def __init__(self, name: str):
self.name = name
def __repr__(self):
return f"<SpecialType {self.name}>"
def __str__(self):
return self.name
MISSING = SpecialType("missing")
ZWS = "\u200B"
| 16.533333 | 43 | 0.612903 | class SpecialType:
def __init__(self, name: str):
self.name = name
def __repr__(self):
return f"<SpecialType {self.name}>"
def __str__(self):
return self.name
MISSING = SpecialType("missing")
ZWS = "\u200B"
| true | true |
1c1b8a400dd0005b53d3958c2f7705a32a64d888 | 18,175 | py | Python | image_classification/token_labeling/tlt/models/uniformer.py | AK391/UniFormer | 22c6b3b98b68236dda6a8fa7152a32af1af62a20 | [
"MIT"
] | null | null | null | image_classification/token_labeling/tlt/models/uniformer.py | AK391/UniFormer | 22c6b3b98b68236dda6a8fa7152a32af1af62a20 | [
"MIT"
] | null | null | null | image_classification/token_labeling/tlt/models/uniformer.py | AK391/UniFormer | 22c6b3b98b68236dda6a8fa7152a32af1af62a20 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# UniFormer
# Copyright (c) 2022 SenseTime X-Lab
# Licensed under The MIT License [see LICENSE for details]
# Written by Kunchang Li
# --------------------------------------------------------
from collections import OrderedDict
import torch
import torch.nn as ... | 40.659955 | 125 | 0.604512 |
from collections import OrderedDict
import torch
import torch.nn as nn
from functools import partial
import torch.nn.functional as F
import math
import numpy as np
from timm.models.vision_transformer import _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_, DropPat... | true | true |
1c1b8aa5967a30864bf96bd0500c7c467e1f7c57 | 8,944 | py | Python | quests/rl/a2c/templates/trainer.py | laurenzberger/training-data-analyst | 3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3 | [
"Apache-2.0"
] | 6,140 | 2016-05-23T16:09:35.000Z | 2022-03-30T19:00:46.000Z | quests/rl/a2c/templates/trainer.py | laurenzberger/training-data-analyst | 3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3 | [
"Apache-2.0"
] | 1,384 | 2016-07-08T22:26:41.000Z | 2022-03-24T16:39:43.000Z | quests/rl/a2c/templates/trainer.py | laurenzberger/training-data-analyst | 3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3 | [
"Apache-2.0"
] | 5,110 | 2016-05-27T13:45:18.000Z | 2022-03-31T18:40:42.000Z | # Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.007605 | 82 | 0.636963 |
import argparse
import json
import os
import sys
from google.cloud import storage
import gym
from gym.wrappers.monitoring.video_recorder import VideoRecorder
import hypertune
import tensorflow as tf
from tensorflow.keras.callbacks import TensorBoard
from . import model
RECORDING_NAME = "recording.mp4"... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.