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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fac6406716955963b6e24fc3b352de6df14caa | 4,279 | py | Python | site-packages/robots/south_migrations/0001_initial.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | site-packages/robots/south_migrations/0001_initial.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | site-packages/robots/south_migrations/0001_initial.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Url'
db.create_table('robots_url', (
('id', self.gf('django.db.models.fields.AutoField')(primary... | 48.078652 | 184 | 0.588923 | from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.create_table('robots_url', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('pattern', self.gf(... | true | true |
08fac650a46d763d1036bd48339aec728708970e | 5,949 | py | Python | custom/covid/tests/test_custom_rules.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | custom/covid/tests/test_custom_rules.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | custom/covid/tests/test_custom_rules.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | from casexml.apps.case.mock import CaseFactory
from pillowtop.es_utils import initialize_index_and_mapping
from corehq.apps.app_manager.const import USERCASE_TYPE
from corehq.apps.app_manager.util import enable_usercase
from corehq.apps.callcenter.sync_usercase import sync_usercases
from corehq.apps.data_interfaces.mo... | 43.742647 | 108 | 0.734577 | from casexml.apps.case.mock import CaseFactory
from pillowtop.es_utils import initialize_index_and_mapping
from corehq.apps.app_manager.const import USERCASE_TYPE
from corehq.apps.app_manager.util import enable_usercase
from corehq.apps.callcenter.sync_usercase import sync_usercases
from corehq.apps.data_interfaces.mo... | true | true |
08fac6d2d0b372509ac2bb389b82becc2570b05c | 7,541 | py | Python | src/operations/linked.py | pioro/couchbase-plugin | 1217f8f092ec455bf638068a0a92cdebf1f3372a | [
"Apache-2.0"
] | null | null | null | src/operations/linked.py | pioro/couchbase-plugin | 1217f8f092ec455bf638068a0a92cdebf1f3372a | [
"Apache-2.0"
] | null | null | null | src/operations/linked.py | pioro/couchbase-plugin | 1217f8f092ec455bf638068a0a92cdebf1f3372a | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 by Delphix. All rights reserved.
#
#######################################################################################################################
# In this module, all dSource related operations are implemented.
############################################################################... | 48.031847 | 128 | 0.733855 |
import logging
import sys
import config
import db_commands
import linking
from controller import helper_lib
from controller.couchbase_operation import CouchbaseOperation
from controller.resource_builder import Resource
from controller.helper_lib import delete_file
from db_commands import constants
from internal_excep... | false | true |
08fac7e640c12d467704b6192aa858da361aeee8 | 94 | py | Python | weapp_auth/apps.py | Meowzz95/django_weapp_auth | c6a1b15091cfd51f9d7bec0e75d4f51fb309b311 | [
"BSD-3-Clause"
] | 3 | 2019-07-14T08:00:14.000Z | 2020-07-23T07:22:30.000Z | weapp_auth/apps.py | Meowzz95/django_weapp_auth | c6a1b15091cfd51f9d7bec0e75d4f51fb309b311 | [
"BSD-3-Clause"
] | null | null | null | weapp_auth/apps.py | Meowzz95/django_weapp_auth | c6a1b15091cfd51f9d7bec0e75d4f51fb309b311 | [
"BSD-3-Clause"
] | 1 | 2019-07-15T00:50:24.000Z | 2019-07-15T00:50:24.000Z | from django.apps import AppConfig
class WeappAuthConfig(AppConfig):
name = 'weapp_auth'
| 15.666667 | 33 | 0.765957 | from django.apps import AppConfig
class WeappAuthConfig(AppConfig):
name = 'weapp_auth'
| true | true |
08fac82485714e66c69cd4c49a17459d91d4b781 | 2,766 | py | Python | girder/__init__.py | cjh1/girder | 293e238b56a4b7a0a413648b5f324876d577ebb0 | [
"Apache-2.0"
] | null | null | null | girder/__init__.py | cjh1/girder | 293e238b56a4b7a0a413648b5f324876d577ebb0 | [
"Apache-2.0"
] | null | null | null | girder/__init__.py | cjh1/girder | 293e238b56a4b7a0a413648b5f324876d577ebb0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | 33.325301 | 79 | 0.632321 |
import cherrypy
import logging.handlers
import os
from girder.constants import ROOT_DIR, MAX_LOG_SIZE, LOG_BACKUP_COUNT
class LogLevelFilter(object):
def __init__(self, min, max):
self.minLevel = min
self.maxLevel = max
def filter(self, logRecord):
level = logRecord.levelno
... | true | true |
08fac8c336d6897feeb58f176eadf29ebd87bc1a | 610 | py | Python | Bangla-Stopwords/BN_stopwords.py | asifabdullah-git/Bangla-Stopwords | 73b59a34bb01fcda38034743b4bb64ec02c5fda8 | [
"MIT"
] | null | null | null | Bangla-Stopwords/BN_stopwords.py | asifabdullah-git/Bangla-Stopwords | 73b59a34bb01fcda38034743b4bb64ec02c5fda8 | [
"MIT"
] | null | null | null | Bangla-Stopwords/BN_stopwords.py | asifabdullah-git/Bangla-Stopwords | 73b59a34bb01fcda38034743b4bb64ec02c5fda8 | [
"MIT"
] | null | null | null | import words
from nltk.tokenize import word_tokenize
example_sent = "ইহা শুনতে ভালো লাগছে "
def sw(text):
word_tokens = word_tokenize(text)
#filtered_sentence = [w for w in word_tokens if not w in words.bn_stopwords]
filtered_sentence = []
for w in word_tokens:
if w not in words.bn_stopwords:... | 17.941176 | 80 | 0.618033 | import words
from nltk.tokenize import word_tokenize
example_sent = "ইহা শুনতে ভালো লাগছে "
def sw(text):
word_tokens = word_tokenize(text)
filtered_sentence = []
for w in word_tokens:
if w not in words.bn_stopwords:
filtered_sentence.append(w)
print(filtered_sentence)
... | true | true |
08fac984a517aa50c8e09e458c163dfe97cf2df4 | 208 | py | Python | urllib_test07.py | LieonShelly/PythonDemo | 39ebd41074671c59297adfeb86adf733261ad6d4 | [
"MIT"
] | null | null | null | urllib_test07.py | LieonShelly/PythonDemo | 39ebd41074671c59297adfeb86adf733261ad6d4 | [
"MIT"
] | null | null | null | urllib_test07.py | LieonShelly/PythonDemo | 39ebd41074671c59297adfeb86adf733261ad6d4 | [
"MIT"
] | null | null | null | from urllib import request
from urllib import error
if __name__ == "__main__":
url = "asdf"
req = request.Request(url)
try:
response = request.urlopen(req)
except error.HTTPError as e:
print(e.code) | 20.8 | 33 | 0.721154 | from urllib import request
from urllib import error
if __name__ == "__main__":
url = "asdf"
req = request.Request(url)
try:
response = request.urlopen(req)
except error.HTTPError as e:
print(e.code) | true | true |
08fac9d70db0c779a6425b179fbae83bc2f613d4 | 855 | py | Python | demo/demo-python/demo_seuif97.py | thermalogic/seuif97 | 3c25c3de35913950820c30b53a7092afab15d138 | [
"MIT"
] | 31 | 2017-02-21T12:44:13.000Z | 2021-03-21T10:53:37.000Z | demo/demo-python/demo_seuif97.py | thermalogic/seuif97 | 3c25c3de35913950820c30b53a7092afab15d138 | [
"MIT"
] | 3 | 2019-10-23T01:34:59.000Z | 2020-11-13T02:58:47.000Z | demo/demo-python/demo_seuif97.py | thermalogic/seuif97 | 3c25c3de35913950820c30b53a7092afab15d138 | [
"MIT"
] | 129 | 2017-02-21T11:18:12.000Z | 2020-11-02T09:23:51.000Z |
"""
The Simple example of seuif97.py
The input pairs implemented in seuif97.py
(p,t) (p,h) (p,s) (p,v)
(t,h) (t,s) (t,v)
(h,s)
(p,x) (t,x)
The types of functions:
1 ??2?(in1,in2) , e.g: h=pt2h(p,t)
2 ??(in1,in2,propertyID), , e.g: h=pt(p,t,4), the propertyID h is 4
Lic... | 18.586957 | 78 | 0.51462 |
import seuif97
p, t = 16.10, 535.10
h = seuif97.pt2h(p, t)
s = seuif97.pt2s(p, t)
v = seuif97.pt2v(p, t)
print("(p,t),h,s,v:",
"{:>.2f}\t {:>.2f}\t {:>.2f}\t {:>.3f}\t {:>.4f}".format(p, t, h, s, v))
t = seuif97.ph(p, h, 1)
s = seuif97.ph(p, h, 5)
v = seuif97.ph(p, h, 3)
print("(p,h),t,s,v:",
"{:>.2f}... | true | true |
08faca32802bd4a36187d2f8654db92d9844bc98 | 940 | py | Python | sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rusage_paged.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rusage_paged.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rusage_paged.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 33.571429 | 121 | 0.576596 |
from msrest.paging import Paged
class SignalRUsagePaged(Paged):
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[SignalRUsage]'}
}
def __init__(self, *args, **kwargs):
super(SignalRUsagePaged, self).__init__(*args, *... | true | true |
08facbf0c5ea04a18e2f81f6d34310a3a8da9891 | 2,826 | py | Python | cyborg_enhancement/mitaka_version/cyborg/cyborg/cmd/dbsync.py | opnfv/cran | 60a2982c7b9de09880005b23da88bff0a8d59467 | [
"Apache-2.0"
] | 37 | 2017-03-23T02:10:35.000Z | 2021-11-25T07:57:36.000Z | cyborg_enhancement/mitaka_version/cyborg/cyborg/cmd/dbsync.py | opnfv/cran | 60a2982c7b9de09880005b23da88bff0a8d59467 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | cyborg_enhancement/mitaka_version/cyborg/cyborg/cmd/dbsync.py | opnfv/cran | 60a2982c7b9de09880005b23da88bff0a8d59467 | [
"Apache-2.0"
] | 27 | 2017-07-14T02:26:24.000Z | 2022-01-19T07:55:10.000Z | # Copyright 2017 Huawei Technologies Co.,LTD.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 30.717391 | 78 | 0.672328 |
import sys
from oslo_config import cfg
from cyborg.common.i18n import _
from cyborg.common import service
from cyborg.conf import CONF
from cyborg.db import migration
class DBCommand(object):
def upgrade(self):
migration.upgrade(CONF.command.revision)
def revision(self):
migration.revisi... | true | true |
08facc73639316286402d02e9208c795fa3f8ca6 | 206 | py | Python | test/models/test_yufacedetectnet.py | fengyuentau/PyTorch-FLOPs | 98e8c765aaa3526656b1799d5bb2ef94fca8d97a | [
"Apache-2.0"
] | null | null | null | test/models/test_yufacedetectnet.py | fengyuentau/PyTorch-FLOPs | 98e8c765aaa3526656b1799d5bb2ef94fca8d97a | [
"Apache-2.0"
] | null | null | null | test/models/test_yufacedetectnet.py | fengyuentau/PyTorch-FLOPs | 98e8c765aaa3526656b1799d5bb2ef94fca8d97a | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append('.')
import flops_counter as fc
from models import YuFaceDetectNet
model = YuFaceDetectNet()
x = fc.TensorSize([1, 3, 224, 210])
y = model(x)
print(y, model.flops)
# print(model) | 20.6 | 35 | 0.728155 | import sys
sys.path.append('.')
import flops_counter as fc
from models import YuFaceDetectNet
model = YuFaceDetectNet()
x = fc.TensorSize([1, 3, 224, 210])
y = model(x)
print(y, model.flops)
| true | true |
08faccdab49b0f07c2e2c0633f044c3cce97b8fb | 2,329 | py | Python | hata/discord/channel/metadata/guild_directory.py | WizzyBots/hata | f6991afc0bebf7dad932888a536f4d010f8663c7 | [
"0BSD"
] | null | null | null | hata/discord/channel/metadata/guild_directory.py | WizzyBots/hata | f6991afc0bebf7dad932888a536f4d010f8663c7 | [
"0BSD"
] | 1 | 2022-02-08T16:54:39.000Z | 2022-02-08T16:54:39.000Z | hata/discord/channel/metadata/guild_directory.py | WizzyBots/hata | f6991afc0bebf7dad932888a536f4d010f8663c7 | [
"0BSD"
] | null | null | null | __all__ = ('ChannelMetadataGuildDirectory',)
from scarletio import copy_docs
from ...permission import Permission
from ...permission.permission import PERMISSION_MASK_VIEW_CHANNEL, PERMISSION_NONE, PERMISSION_THREAD_AND_VOICE_DENY
from .. import channel_types as CHANNEL_TYPES
from .guild_main_base import ChannelMet... | 34.761194 | 116 | 0.700301 | __all__ = ('ChannelMetadataGuildDirectory',)
from scarletio import copy_docs
from ...permission import Permission
from ...permission.permission import PERMISSION_MASK_VIEW_CHANNEL, PERMISSION_NONE, PERMISSION_THREAD_AND_VOICE_DENY
from .. import channel_types as CHANNEL_TYPES
from .guild_main_base import ChannelMet... | true | true |
08facd697d367b55e35c3f7984b7f196c558ed0d | 5,375 | py | Python | modoboa/admin/api.py | carragom/modoboa | 12061c2b46e4ac62719af190ba44244fdd558030 | [
"0BSD"
] | null | null | null | modoboa/admin/api.py | carragom/modoboa | 12061c2b46e4ac62719af190ba44244fdd558030 | [
"0BSD"
] | null | null | null | modoboa/admin/api.py | carragom/modoboa | 12061c2b46e4ac62719af190ba44244fdd558030 | [
"0BSD"
] | null | null | null | """Admin API."""
from django import http
from django.contrib.contenttypes.models import ContentType
from rest_framework import status, viewsets
from rest_framework.decorators import detail_route, list_route
from rest_framework.exceptions import ParseError
from rest_framework.permissions import IsAuthenticated, Djang... | 33.179012 | 78 | 0.648372 |
from django import http
from django.contrib.contenttypes.models import ContentType
from rest_framework import status, viewsets
from rest_framework.decorators import detail_route, list_route
from rest_framework.exceptions import ParseError
from rest_framework.permissions import IsAuthenticated, DjangoModelPermissions... | true | true |
08face22b3d7688b35db8ed4d2dd02b6521066f6 | 38,124 | py | Python | test/ext/test_hybrid.py | tlocke/sqlalchemy-1 | 0a3e5cff337692763be7f7c751c3901d5337a4fc | [
"MIT"
] | null | null | null | test/ext/test_hybrid.py | tlocke/sqlalchemy-1 | 0a3e5cff337692763be7f7c751c3901d5337a4fc | [
"MIT"
] | null | null | null | test/ext/test_hybrid.py | tlocke/sqlalchemy-1 | 0a3e5cff337692763be7f7c751c3901d5337a4fc | [
"MIT"
] | null | null | null | from decimal import Decimal
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL
from sqlalchemy import literal_column
from sqlalchemy import Numeric
from sqlalchemy i... | 30.401914 | 79 | 0.567123 | from decimal import Decimal
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL
from sqlalchemy import literal_column
from sqlalchemy import Numeric
from sqlalchemy i... | true | true |
08face6de342147ae7d353c745cc1583d25b989e | 13,370 | py | Python | app/dao/time_series_detector/sample_op.py | yichuankaorou/Metis_python2.7_pro | f476a8fa6b006e73698f93ddb0397c22c1f504e6 | [
"Apache-2.0"
] | 1 | 2020-04-17T15:35:50.000Z | 2020-04-17T15:35:50.000Z | app/dao/time_series_detector/sample_op.py | yichuankaorou/Metis_python2.7_pro | f476a8fa6b006e73698f93ddb0397c22c1f504e6 | [
"Apache-2.0"
] | 3 | 2020-06-05T21:29:30.000Z | 2021-06-10T21:38:24.000Z | app/dao/time_series_detector/sample_op.py | metis-develop/Metis_customized_v1.0 | acf0c24d492f9d41724c260c939c7bca3e58f9ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Tencent is pleased to support the open source community by making Metis available.
Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with th... | 43.409091 | 305 | 0.553777 |
import datetime
import uuid
import csv
import codecs
import MySQLdb
from app.dao.db_common import database
from app.common.common import *
from app.common.errorcode import *
class SampleOperation(object):
def __init__(self):
self.__conn = MySQLdb.connect(host=database.HOST, port=database.PORT, user=data... | true | true |
08facf5386f97cacb5a16fe9031e624e61a89d70 | 8,473 | py | Python | bokeh/models/transforms.py | RiccardoGiro/bokeh | 7e1bfeea4f3d7a6296aabfeec96e79e1f5a28467 | [
"BSD-3-Clause"
] | 1 | 2021-10-30T00:32:00.000Z | 2021-10-30T00:32:00.000Z | bokeh/models/transforms.py | Deng-Fankang/bokeh | 894731860c53b7c9ddd0057dee85cf064278dc0e | [
"BSD-3-Clause"
] | 12 | 2020-08-26T20:19:29.000Z | 2020-08-26T20:19:52.000Z | bokeh/models/transforms.py | Deng-Fankang/bokeh | 894731860c53b7c9ddd0057dee85cf064278dc0e | [
"BSD-3-Clause"
] | 2 | 2021-01-12T18:22:24.000Z | 2021-10-30T00:32:02.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 32.968872 | 136 | 0.565915 |
import logging log = logging.getLogger(__name__)
from ..core.enums import JitterRandomDistribution, StepMode
from ..core.has_props import abstract
from ..core.properties import (
AnyRef,
Bool,
Dict,
Either,
Enum,
Float,
Instance,
Seq,
String,
)
from ..model import Model
from .sour... | true | true |
08fad0988679bc4a2da7c3415151d5b68cd5b693 | 106,885 | py | Python | nova/tests/api/ec2/test_cloud.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | null | null | null | nova/tests/api/ec2/test_cloud.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | nova/tests/api/ec2/test_cloud.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T10:40:59.000Z | 2020-07-24T10:40:59.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | 45.405692 | 79 | 0.552164 |
import base64
import copy
import datetime
import functools
import os
import string
import tempfile
from nova.api.ec2 import cloud
from nova.api.ec2 import ec2utils
from nova.api.ec2 import inst_state
from nova.compute import api as compute_api
from nova.compute import power_state
from nova.compute import utils as co... | false | true |
08fad0b06d94e2b4dfb4d52ab4dbcd15647cfce7 | 7,346 | py | Python | bin/ToolBOS-Setup.py | antonelloceravola/ToolBOSCore | b03414a867a9f0585e06bb8e4f299c4be1357f3a | [
"BSD-3-Clause"
] | null | null | null | bin/ToolBOS-Setup.py | antonelloceravola/ToolBOSCore | b03414a867a9f0585e06bb8e4f299c4be1357f3a | [
"BSD-3-Clause"
] | null | null | null | bin/ToolBOS-Setup.py | antonelloceravola/ToolBOSCore | b03414a867a9f0585e06bb8e4f299c4be1357f3a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Configures the user's shell environment to work with ToolBOS
#
# Copyright (c) Honda Research Institute Europe GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met... | 34.488263 | 82 | 0.578138 | #
# Copyright (c) Honda Research Institute Europe GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions a... | true | true |
08fad1035df097ba39b87cdbf59f563f9d9ae6f0 | 143 | py | Python | setup.py | yannikschaelte/jabbar | 56c315714a54d0bf1dd1991ecd3926c536a6b5b5 | [
"MIT"
] | 7 | 2020-07-30T23:11:29.000Z | 2021-04-22T09:29:26.000Z | setup.py | yannikschaelte/jabbar | 56c315714a54d0bf1dd1991ecd3926c536a6b5b5 | [
"MIT"
] | 5 | 2020-07-31T09:36:16.000Z | 2022-01-01T08:38:39.000Z | setup.py | yannikschaelte/jabbar | 56c315714a54d0bf1dd1991ecd3926c536a6b5b5 | [
"MIT"
] | null | null | null | """Setup jabbar module."""
# this is still needed for editable installs
import setuptools
if __name__ == "__main__":
setuptools.setup()
| 15.888889 | 44 | 0.713287 |
import setuptools
if __name__ == "__main__":
setuptools.setup()
| true | true |
08fad1a3a6e7abc4327b0d269b89107034dceae4 | 13,350 | py | Python | symphony/bdk/gen/pod_model/message_status.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | symphony/bdk/gen/pod_model/message_status.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | symphony/bdk/gen/pod_model/message_status.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | """
Pod API
This document refers to Symphony API calls that do not need encryption or decryption of content. - sessionToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined... | 48.545455 | 637 | 0.594382 |
import re import sys from typing import List, Union
from symphony.bdk.gen.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
val... | true | true |
08fad1f38e0d042bc7aac568d1b0e41c5c3da468 | 635 | py | Python | tests/bots/stocks/government/test_toplobbying_command.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 255 | 2022-03-29T16:43:51.000Z | 2022-03-31T23:57:08.000Z | tests/bots/stocks/government/test_toplobbying_command.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 14 | 2022-03-29T14:20:33.000Z | 2022-03-31T23:39:20.000Z | tests/bots/stocks/government/test_toplobbying_command.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 24 | 2022-03-29T15:28:56.000Z | 2022-03-31T23:54:15.000Z | import pytest
try:
from bots.stocks.government.toplobbying import toplobbying_command
except ImportError:
pytest.skip(allow_module_level=True)
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("pe... | 22.678571 | 70 | 0.647244 | import pytest
try:
from bots.stocks.government.toplobbying import toplobbying_command
except ImportError:
pytest.skip(allow_module_level=True)
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("pe... | true | true |
08fad39274dfe0f5e6ba5101790b570b6836d8f7 | 2,940 | py | Python | alipay/aop/api/domain/MiniAppTemplateData.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/MiniAppTemplateData.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/MiniAppTemplateData.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class MiniAppTemplateData(object):
def __init__(self):
self._app_name = None
self._desc = None
self._image = None
self._link = None
self._logo = None
sel... | 25.344828 | 67 | 0.523129 | import json
from alipay.aop.api.constant.ParamConstants import *
class MiniAppTemplateData(object):
def __init__(self):
self._app_name = None
self._desc = None
self._image = None
self._link = None
self._logo = None
self._title = None
@property
def app_nam... | true | true |
08fad3fc0c7d4a791c04c49d4a3ef4a514d95be4 | 3,012 | py | Python | recipes/recipes/images_pins_roller.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | recipes/recipes/images_pins_roller.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | 4 | 2022-03-17T18:58:21.000Z | 2022-03-17T18:58:22.000Z | recipes/recipes/images_pins_roller.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from PB.recipes.infra import images_pins_roller as images_pins_roller_pb
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'depot_tools/git',
'depot_... | 31.051546 | 80 | 0.640438 |
from PB.recipes.infra import images_pins_roller as images_pins_roller_pb
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'depot_tools/git',
'depot_tools/git_cl',
'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
'cloudbuildhelper',
'inf... | true | true |
08fad4c646d6650b31f9c19c25c4dc8a493aaaab | 1,392 | py | Python | setup.py | TimoGroom/ItChat | ac7ff2a49c3096313dfb07abd9e5987a651b9755 | [
"MIT"
] | 31 | 2016-11-08T02:27:49.000Z | 2019-12-06T00:55:48.000Z | setup.py | TimoGroom/ItChat | ac7ff2a49c3096313dfb07abd9e5987a651b9755 | [
"MIT"
] | null | null | null | setup.py | TimoGroom/ItChat | ac7ff2a49c3096313dfb07abd9e5987a651b9755 | [
"MIT"
] | 13 | 2016-11-08T02:08:39.000Z | 2020-07-13T03:58:09.000Z | """ A wechat personal account api project
See:
https://github.com/littlecodersh/ItChat
https://github.com/littlecodersh/ItChat/tree/robot
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
import itchat
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'RE... | 24.857143 | 72 | 0.676724 |
from setuptools import setup, find_packages
from codecs import open
from os import path
import itchat
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='itchat',
version=itchat.__version__,
descripti... | true | true |
08fad54685f53a17ff1ae49a75f98a37e42fd850 | 1,898 | py | Python | mmdet/models/detectors/__init__.py | JustWeZero/mmdetection | 6de523b5b1e71b9c989760faff0462e807827515 | [
"Apache-2.0"
] | 2 | 2021-11-17T22:44:00.000Z | 2022-01-17T02:20:32.000Z | mmdet/models/detectors/__init__.py | JustWeZero/mmdetection | 6de523b5b1e71b9c989760faff0462e807827515 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/__init__.py | JustWeZero/mmdetection | 6de523b5b1e71b9c989760faff0462e807827515 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .atss import ATSS
from .autoassign import AutoAssign
from .base import BaseDetector
from .cascade_rcnn import CascadeRCNN
from .centernet import CenterNet
from .cornernet import CornerNet
from .deformable_detr import DeformableDETR
from .detr import DETR
from .fast_r... | 37.215686 | 77 | 0.79294 | from .atss import ATSS
from .autoassign import AutoAssign
from .base import BaseDetector
from .cascade_rcnn import CascadeRCNN
from .centernet import CenterNet
from .cornernet import CornerNet
from .deformable_detr import DeformableDETR
from .detr import DETR
from .fast_rcnn import FastRCNN
from .faster_rcnn import Fas... | true | true |
08fad58048574f69dd8b1429a8a8cee53af5e293 | 11,831 | py | Python | src/gafaelfawr/models/oidc.py | lsst/jwt_authorizer | 76b984c809ad10843f2cd6f543e88ee1002bdb96 | [
"MIT"
] | null | null | null | src/gafaelfawr/models/oidc.py | lsst/jwt_authorizer | 76b984c809ad10843f2cd6f543e88ee1002bdb96 | [
"MIT"
] | 5 | 2019-06-18T17:28:52.000Z | 2020-04-20T22:15:54.000Z | src/gafaelfawr/models/oidc.py | lsst/gafaelfawr | a9dd91c7770e194d609f64fee6fd955a27231bd6 | [
"MIT"
] | 1 | 2019-06-25T16:04:57.000Z | 2019-06-25T16:04:57.000Z | """Representation of data for OpenID Connect support."""
from __future__ import annotations
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field, validator
from ..constants import ALGORITHM
from ..exceptions import InvalidGrantError
from ..util i... | 30.809896 | 79 | 0.643056 |
from __future__ import annotations
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field, validator
from ..constants import ALGORITHM
from ..exceptions import InvalidGrantError
from ..util import normalize_datetime, random_128_bits
from .token imp... | true | true |
08fad5b373e3f4a6d922dd0375967a7937a5c712 | 2,686 | py | Python | branch_protect.py | casa-vega/branch-protections | f649ded18119534f51ba6452222dadf20e12beb8 | [
"MIT"
] | null | null | null | branch_protect.py | casa-vega/branch-protections | f649ded18119534f51ba6452222dadf20e12beb8 | [
"MIT"
] | null | null | null | branch_protect.py | casa-vega/branch-protections | f649ded18119534f51ba6452222dadf20e12beb8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json
import sys
import requests
def get_repos():
resp = requests.get(f"{url}/orgs/{org}/repos?per_page=100&page=1", headers=headers)
payload = resp.json()
while "next" in resp.links:
resp = requests.get(resp.links["next"]["url"], headers=headers)
payload.exte... | 27.690722 | 87 | 0.615041 |
import json
import sys
import requests
def get_repos():
resp = requests.get(f"{url}/orgs/{org}/repos?per_page=100&page=1", headers=headers)
payload = resp.json()
while "next" in resp.links:
resp = requests.get(resp.links["next"]["url"], headers=headers)
payload.extend(resp.json())
r... | true | true |
08fad87e76ece57e450c67c232443a522a837be7 | 12,423 | py | Python | sample_sheet_parser.py | jasenjackson/FatFlies_scRNA | f132ad94072c46d5b5e3778ee44154e189935da0 | [
"MIT"
] | 1 | 2019-03-19T23:33:00.000Z | 2019-03-19T23:33:00.000Z | sample_sheet_parser.py | jasenjackson/FatFlies_scRNA | f132ad94072c46d5b5e3778ee44154e189935da0 | [
"MIT"
] | null | null | null | sample_sheet_parser.py | jasenjackson/FatFlies_scRNA | f132ad94072c46d5b5e3778ee44154e189935da0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
@author: Timothy Baker
samplesheet_parser.py
04/01/2019:
- Broke out original parse_sample_sheet() method to smaller
parsing functions.
- included new attributes for downstream configuration for zUMI
and differential expression inputs
- need t... | 35.595989 | 98 | 0.591806 |
import pandas as pd
import csv
class SampleSheetParser:
def __init__(self, sample_sheet):
self.sample_sheet = sample_sheet
self.offset_pos = {}
self.header_info = {}
self.path_info = {}
self.zumi_input = {}
self.diff_input = {}
self.adapter = {}
se... | true | true |
08fad8e1cb6f2f5dd488ac126b2309f10ac6b64c | 253 | py | Python | search/lexrank.py | selimslab/portfolio | 816b38971f3e9e519490923d1cca51cc85d9cf93 | [
"MIT"
] | null | null | null | search/lexrank.py | selimslab/portfolio | 816b38971f3e9e519490923d1cca51cc85d9cf93 | [
"MIT"
] | null | null | null | search/lexrank.py | selimslab/portfolio | 816b38971f3e9e519490923d1cca51cc85d9cf93 | [
"MIT"
] | null | null | null | """
Create a summary using lexrank algorithm
using sentences as nodes and tf-idf weighted cosine similarities as edges
1. create a transition matrix
2. apply thresholding and teleportation
3. run power method until the markov process settle down
"""
| 23 | 73 | 0.794466 | true | true | |
08fad8ff96c4c6501f3cb7d10ca9b09bcf98a152 | 4,354 | py | Python | deepmdp/DeepMDP.py | Niels-vv/Safe-RL-With-DR | 9f299661bb4cea9f0cd3121ea4b273cfb1016f9f | [
"MIT"
] | 1 | 2021-11-23T15:13:26.000Z | 2021-11-23T15:13:26.000Z | deepmdp/DeepMDP.py | Niels-vv/Safe-RL-With-DR | 9f299661bb4cea9f0cd3121ea4b273cfb1016f9f | [
"MIT"
] | null | null | null | deepmdp/DeepMDP.py | Niels-vv/Safe-RL-With-DR | 9f299661bb4cea9f0cd3121ea4b273cfb1016f9f | [
"MIT"
] | null | null | null | import torch
from torch import nn
import torch.nn.functional as F
# Class to compute transition cost for DeepMDP
class TransitionAux(nn.Module):
def __init__(self, device):
super(TransitionAux, self).__init__()
self.c_hid = 1
self.action_dim = 32 * 32 # TODO pysc2 specific
zero_pad... | 48.921348 | 140 | 0.698209 | import torch
from torch import nn
import torch.nn.functional as F
class TransitionAux(nn.Module):
def __init__(self, device):
super(TransitionAux, self).__init__()
self.c_hid = 1
self.action_dim = 32 * 32
zero_pad = torch.nn.ZeroPad2d((0, 1, 0, 1)) conv = torch.nn.Conv2d(in... | true | true |
08fad96fc8d1aeedd9bf07468b38175c4e1785f1 | 19,846 | py | Python | electrum/bitcoin.py | John-Tonny/Electrum-vircle | c1eff12c706308d7dafa60bbe364b04efbcef5c5 | [
"MIT"
] | null | null | null | electrum/bitcoin.py | John-Tonny/Electrum-vircle | c1eff12c706308d7dafa60bbe364b04efbcef5c5 | [
"MIT"
] | null | null | null | electrum/bitcoin.py | John-Tonny/Electrum-vircle | c1eff12c706308d7dafa60bbe364b04efbcef5c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including wit... | 30.115326 | 125 | 0.653079 |
import hashlib
from typing import List, Tuple, TYPE_CHECKING, Optional, Union
from enum import IntEnum
from .util import bfh, bh2u, BitcoinException, assert_bytes, to_bytes, inv_dict
from . import version
from . import segwit_addr
from . import constants
from . import ecc
from .crypto import sha256d, sha256, hash_160... | true | true |
08fad981088425ae5f8bf4169d069a6c7defc782 | 14,791 | py | Python | perfkitbenchmarker/providers/aws/aws_dynamodb.py | mdemeke/mickysbenchmarker | a61896f273577ea61a646f74bd3c4aa3d5996db2 | [
"Apache-2.0"
] | 1 | 2020-12-16T21:49:28.000Z | 2020-12-16T21:49:28.000Z | perfkitbenchmarker/providers/aws/aws_dynamodb.py | mdemeke/mickysbenchmarker | a61896f273577ea61a646f74bd3c4aa3d5996db2 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/providers/aws/aws_dynamodb.py | mdemeke/mickysbenchmarker | a61896f273577ea61a646f74bd3c4aa3d5996db2 | [
"Apache-2.0"
] | 1 | 2021-07-12T16:09:26.000Z | 2021-07-12T16:09:26.000Z | # Copyright 2018 PerfKitBenchmarker 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 appli... | 42.139601 | 96 | 0.616997 |
import json
import logging
from typing import Any, Dict, Tuple, Sequence
from absl import flags
from perfkitbenchmarker import errors
from perfkitbenchmarker import non_relational_db
from perfkitbenchmarker import vm_util
from perfkitbenchmarker.providers.aws import util
FLAGS = flags.FLAGS
flags.DEFINE_string('aws_... | true | true |
08fad9f02bfa0446b40efba4cb83da0e4f3b268f | 8,881 | py | Python | clusters.py | ceroo1005/DATL | ac7ceee4f6d0f9ce493743e80afdedd808806703 | [
"MIT"
] | null | null | null | clusters.py | ceroo1005/DATL | ac7ceee4f6d0f9ce493743e80afdedd808806703 | [
"MIT"
] | null | null | null | clusters.py | ceroo1005/DATL | ac7ceee4f6d0f9ce493743e80afdedd808806703 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from random import shuffle
import numpy as np
class CosineClusters():
def __init__(self, num_clusters=100, Euclidean=False):
self.clusters = [] # 储存各个集群
self.item_cluster = {} # 储存每个样本所属集群
self.Euclidean = Euclidean
# 初始化集群
... | 31.604982 | 139 | 0.589573 | import torch
import torch.nn.functional as F
from random import shuffle
import numpy as np
class CosineClusters():
def __init__(self, num_clusters=100, Euclidean=False):
self.clusters = [] self.item_cluster = {} self.Euclidean = Euclidean
for i in range(0, num_cluster... | true | true |
08fada068bd1ca541a5f658c479e8bc728faeb45 | 3,576 | py | Python | cscs-checks/apps/vasp/vasp_check.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | cscs-checks/apps/vasp/vasp_check.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | cscs-checks/apps/vasp/vasp_check.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import reframe as rfm
import reframe.utility.sanity as sn
class VASPCheck(rfm.RunOnlyRegressionTest):
keep_files = ['OUT... | 31.928571 | 76 | 0.565157 |
import reframe as rfm
import reframe.utility.sanity as sn
class VASPCheck(rfm.RunOnlyRegressionTest):
keep_files = ['OUTCAR']
maintainers = ['LM']
tags = {'scs'}
strict_check = False
modules = ['VASP']
extra_resources = {
'switches': {
'num_switches': 1
}
}
... | true | true |
08fada2fa3f02227bab9088de1fc2a3633095fc4 | 623 | py | Python | bmtk/tests/simulator/core/test_io_tools.py | aaberbach/bmtk | 42aa70ce2003227a32df6ce5a95420dbf4bdfbd4 | [
"BSD-3-Clause"
] | 216 | 2017-10-03T17:02:42.000Z | 2022-03-20T03:35:48.000Z | bmtk/tests/simulator/core/test_io_tools.py | moekay/bmtk | 6efdf6387d2a6badf276b917ee15d238daeae883 | [
"BSD-3-Clause"
] | 70 | 2017-10-05T00:50:41.000Z | 2022-03-30T18:55:01.000Z | bmtk/tests/simulator/core/test_io_tools.py | moekay/bmtk | 6efdf6387d2a6badf276b917ee15d238daeae883 | [
"BSD-3-Clause"
] | 97 | 2017-10-03T22:15:06.000Z | 2022-03-23T21:03:26.000Z | import os
import pytest
import tempfile
from bmtk.simulator.core.io_tools import IOUtils
def test_setup():
io = IOUtils()
tmp_dir = tempfile.mkdtemp()
io.setup_output_dir(tmp_dir, log_file=None)
assert(os.path.exists(tmp_dir))
def test_logging(capsys):
io = IOUtils()
io.log_info('hello')
... | 19.46875 | 48 | 0.677368 | import os
import pytest
import tempfile
from bmtk.simulator.core.io_tools import IOUtils
def test_setup():
io = IOUtils()
tmp_dir = tempfile.mkdtemp()
io.setup_output_dir(tmp_dir, log_file=None)
assert(os.path.exists(tmp_dir))
def test_logging(capsys):
io = IOUtils()
io.log_info('hello')
... | true | true |
08fadcce8d340c47b9b744325012e89f434d4d11 | 12,344 | py | Python | code/python/IRNConfiguration/v1/fds/sdk/IRNConfiguration/model/custom_symbol_type_dto.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/IRNConfiguration/v1/fds/sdk/IRNConfiguration/model/custom_symbol_type_dto.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/IRNConfiguration/v1/fds/sdk/IRNConfiguration/model/custom_symbol_type_dto.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
IRN API v1
Allows users to extract, create, update and configure IRN data. # noqa: E501
The version of the OpenAPI document: 1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.IRNConfiguration.model_utils import ( # noqa: F401
... | 44.243728 | 121 | 0.57048 |
import re import sys
from fds.sdk.IRNConfiguration.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info... | true | true |
08fadeaf8a8837e82ffc4f6e72b916a0f14dc5cb | 93 | py | Python | wxPythonExer/hello_wx.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | wxPythonExer/hello_wx.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | wxPythonExer/hello_wx.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | import wx
app=wx.App()
frame=wx.Frame(None, -1, "Hello World")
frame.show()
app.MainLoop() | 11.625 | 39 | 0.677419 | import wx
app=wx.App()
frame=wx.Frame(None, -1, "Hello World")
frame.show()
app.MainLoop() | true | true |
08fadecefacdedc8a459c869f6cb5a87ebc7aa2e | 3,867 | py | Python | example_ticker_and_miniticker.py | johnjdailey/unicorn-binance-websocket-api | f55765974690c2600141d9588c405a9bb0222266 | [
"MIT"
] | 1 | 2020-01-29T09:17:49.000Z | 2020-01-29T09:17:49.000Z | example_ticker_and_miniticker.py | johnjdailey/unicorn-binance-websocket-api | f55765974690c2600141d9588c405a9bb0222266 | [
"MIT"
] | null | null | null | example_ticker_and_miniticker.py | johnjdailey/unicorn-binance-websocket-api | f55765974690c2600141d9588c405a9bb0222266 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_ticker_and_miniticker.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: htt... | 50.881579 | 120 | 0.661495 |
from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager
import time
from unicorn_binance_websocket_api_process_streams import BinanceWebSocketApiProcessStreams
binance_websocket_api_manager = BinanceWebSocketApiManager(BinanceWebSocketApiProcessStreams.process_strea... | true | true |
08fae0eb860798a83a9c4737fe1d3a8c65432b9b | 316 | py | Python | lambdata_danielmartinalarcon/class_examples/sqrt_tests.py | DanielMartinAlarcon/lambdata | 47c4e985688e183c837e2621911af78a0fa68e51 | [
"MIT"
] | null | null | null | lambdata_danielmartinalarcon/class_examples/sqrt_tests.py | DanielMartinAlarcon/lambdata | 47c4e985688e183c837e2621911af78a0fa68e51 | [
"MIT"
] | null | null | null | lambdata_danielmartinalarcon/class_examples/sqrt_tests.py | DanielMartinAlarcon/lambdata | 47c4e985688e183c837e2621911af78a0fa68e51 | [
"MIT"
] | 1 | 2019-02-14T16:15:40.000Z | 2019-02-14T16:15:40.000Z | import unittest
from scratch import *
class SqrtTests(unittest.TestCase):
"""Obligatory docstring"""
def test_sqrt9(self):
self.assertEqual(newton_sqrt1(9), 3)
def test_sqrt2(self):
self.assertAlmostEqual(newton_sqrt1(2), .41421356237)
if __name__ == '__main__':
unittest.main()
| 19.75 | 61 | 0.689873 | import unittest
from scratch import *
class SqrtTests(unittest.TestCase):
def test_sqrt9(self):
self.assertEqual(newton_sqrt1(9), 3)
def test_sqrt2(self):
self.assertAlmostEqual(newton_sqrt1(2), .41421356237)
if __name__ == '__main__':
unittest.main()
| true | true |
08fae10de8620331aa9438dd47f76062f9020bae | 2,258 | py | Python | tvn/non_local/network.py | DELTA37/TVN | 3bd9e9967e5ab94b1261d0626005d5be7b3934bf | [
"MIT"
] | 7 | 2020-12-31T07:07:01.000Z | 2021-09-06T06:27:48.000Z | tvn/non_local/network.py | Senwang98/Tiny-Video-Network | 2c69a4147a5beedf4246401dafbca5b54906fea4 | [
"MIT"
] | 2 | 2020-12-31T22:31:47.000Z | 2021-05-13T02:24:29.000Z | tvn/non_local/network.py | Senwang98/Tiny-Video-Network | 2c69a4147a5beedf4246401dafbca5b54906fea4 | [
"MIT"
] | 2 | 2021-05-08T08:21:28.000Z | 2022-02-26T15:17:47.000Z | from torch import nn
# from .non_local_concatenation import NONLocalBlock2D
# from .non_local_gaussian import NONLocalBlock2D
from .non_local_embedded_gaussian import NONLocalBlock2D
# from .non_local_dot_product import NONLocalBlock2D
class Network(nn.Module):
def __init__(self):
super(Network, self).__i... | 28.582278 | 92 | 0.612046 | from torch import nn
from .non_local_embedded_gaussian import NONLocalBlock2D
class Network(nn.Module):
def __init__(self):
super(Network, self).__init__()
self.conv_1 = nn.Sequential(
nn.Conv2d(in_channels=1, out_channels=32, kernel_size=3, stride=1, padding=1),
nn.BatchN... | true | true |
08fae12c8192a57e5d73a7044626d81b2a3daed1 | 580 | py | Python | tests/classification/test_dropout_avrnn.py | echo-ray/Kashgari | fc8ba49fd051bd8c09f0c4092aa96b656f27eced | [
"Apache-2.0"
] | 16 | 2020-12-02T13:44:20.000Z | 2022-03-16T00:49:34.000Z | tests/classification/test_dropout_avrnn.py | echo-ray/Kashgari | fc8ba49fd051bd8c09f0c4092aa96b656f27eced | [
"Apache-2.0"
] | 1 | 2022-01-11T08:14:05.000Z | 2022-02-25T09:29:17.000Z | tests/classification/test_dropout_avrnn.py | echo-ray/Kashgari | fc8ba49fd051bd8c09f0c4092aa96b656f27eced | [
"Apache-2.0"
] | 3 | 2021-06-18T00:00:58.000Z | 2022-03-26T11:35:24.000Z | # encoding: utf-8
# author: BrikerMan
# contact: eliyar917@gmail.com
# blog: https://eliyar.biz
# file: test_dropout_avrnn.py
# time: 2019-06-27 11:07
import tests.classification.test_bi_lstm as base
from kashgari.tasks.classification import Dropout_AVRNN_Model
class TestDropout_AVRNN_Model(base.TestBi_LSTM_Model)... | 22.307692 | 61 | 0.736207 |
import tests.classification.test_bi_lstm as base
from kashgari.tasks.classification import Dropout_AVRNN_Model
class TestDropout_AVRNN_Model(base.TestBi_LSTM_Model):
@classmethod
def setUpClass(cls):
cls.epochs = 1
cls.model_class = Dropout_AVRNN_Model
def test_basic_use(self):
... | true | true |
08fae2f296b1a92f06d276d333f4b269402195d4 | 443 | py | Python | common/utils/sign_dataset.py | emanuel-metzenthin/distributedRL | 8043deedc5847081b95cca738397cc074cdecf15 | [
"MIT"
] | null | null | null | common/utils/sign_dataset.py | emanuel-metzenthin/distributedRL | 8043deedc5847081b95cca738397cc074cdecf15 | [
"MIT"
] | null | null | null | common/utils/sign_dataset.py | emanuel-metzenthin/distributedRL | 8043deedc5847081b95cca738397cc074cdecf15 | [
"MIT"
] | null | null | null | import json
import os
from utils.dataset import Dataset
class SignDataset(Dataset):
def _load_images_and_gt(self):
gt_file = open(os.path.join(self.path, self.split + '.json'))
gt_json = json.loads(gt_file.read())
self.images = []
self.gt = []
for entry in gt_json:
... | 24.611111 | 75 | 0.625282 | import json
import os
from utils.dataset import Dataset
class SignDataset(Dataset):
def _load_images_and_gt(self):
gt_file = open(os.path.join(self.path, self.split + '.json'))
gt_json = json.loads(gt_file.read())
self.images = []
self.gt = []
for entry in gt_json:
... | true | true |
08fae303de0c6e4514cb669c84190b68886dcb52 | 12,762 | py | Python | bfi.py | SNException/Brainfuck-Interpreter | cda37a7e8b2899d6a130f0488dcebd6eb484e63b | [
"MIT"
] | null | null | null | bfi.py | SNException/Brainfuck-Interpreter | cda37a7e8b2899d6a130f0488dcebd6eb484e63b | [
"MIT"
] | null | null | null | bfi.py | SNException/Brainfuck-Interpreter | cda37a7e8b2899d6a130f0488dcebd6eb484e63b | [
"MIT"
] | null | null | null | #!usr/bin/env python
# MIT license
# Copyright 2019 Niklas Schultz
# Python script which can run brainfuck files.
from sys import argv
from sys import exit
from sys import maxsize
from sys import stdout
from time import time
from time import sleep
from argparse import ArgumentParser
from os import path
from os import... | 34.679348 | 120 | 0.585802 |
from sys import argv
from sys import exit
from sys import maxsize
from sys import stdout
from time import time
from time import sleep
from argparse import ArgumentParser
from os import path
from os import _exit
from threading import Thread
header = """
██████╗ ███████╗██╗
██╔══██╗██╔════╝██║
██████╔╝████... | true | true |
08fae43d0a16bc65d09a1840709a3b33db50db51 | 2,081 | py | Python | woth_api.py | MichaelWehar/Word-of-The-Hour-API | 5711d12b3491264df6ba011ad12e9fbd4c88888d | [
"MIT"
] | null | null | null | woth_api.py | MichaelWehar/Word-of-The-Hour-API | 5711d12b3491264df6ba011ad12e9fbd4c88888d | [
"MIT"
] | null | null | null | woth_api.py | MichaelWehar/Word-of-The-Hour-API | 5711d12b3491264df6ba011ad12e9fbd4c88888d | [
"MIT"
] | 1 | 2021-04-06T02:58:38.000Z | 2021-04-06T02:58:38.000Z | import requests
class WothAPI():
# Woth Endpoint URL
woth_url = "https://wordofthehour.org/cache/wordofthehour.json?src=python_woth_api"
# Get raw data from endpoint
@staticmethod
def __fetch_raw():
return requests.get(WothAPI.woth_url).json()
# Get data from endpoint and put it into a ... | 38.537037 | 87 | 0.58001 | import requests
class WothAPI():
woth_url = "https://wordofthehour.org/cache/wordofthehour.json?src=python_woth_api"
@staticmethod
def __fetch_raw():
return requests.get(WothAPI.woth_url).json()
@staticmethod
def __fetch_all_fields():
raw_data = WothAPI.__fetch_r... | true | true |
08fae48ec0812a9725cf85041cc45319cd42fcca | 13,497 | py | Python | diagnostics/thomson/Raman/raman_theory.py | gjhartwell/cth-python | 558148a5755fd0bd3b12e1380d365f8bf51efa19 | [
"MIT"
] | null | null | null | diagnostics/thomson/Raman/raman_theory.py | gjhartwell/cth-python | 558148a5755fd0bd3b12e1380d365f8bf51efa19 | [
"MIT"
] | null | null | null | diagnostics/thomson/Raman/raman_theory.py | gjhartwell/cth-python | 558148a5755fd0bd3b12e1380d365f8bf51efa19 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 12 17:45:49 2018
@author: James
"""
import numpy as np
import matplotlib.pyplot as plt
exp_val = {} # dictionary of experimental values
exp_val['anisotropy'] = (0.395 *10**-82) / (8.8541878176*10**-12)**2
# the molecular - polarizability anisotropy for N2 in cm^6.
# ... | 32.601449 | 109 | 0.629918 | import numpy as np
import matplotlib.pyplot as plt
exp_val = {}
exp_val['anisotropy'] = (0.395 *10**-82) / (8.8541878176*10**-12)**2
# temperature plasmas: high resolution and stray light rejection" 2002
exp_val['N2_rot_constant'] = 199.887
exp_val['h'] = 6.62607004*10**-34 exp_val['e'] = 1.60217662*10**-19
exp_v... | true | true |
08fae4a853233fe5432a7601834098349c25e420 | 3,936 | py | Python | parl/utils/machine_info.py | guangchao-wang/PARL | e8797bd0d31d81bc81aae8b12792ff922bcb8ea9 | [
"Apache-2.0"
] | 1 | 2020-06-24T04:17:56.000Z | 2020-06-24T04:17:56.000Z | parl/utils/machine_info.py | ic7y/PARL | e8797bd0d31d81bc81aae8b12792ff922bcb8ea9 | [
"Apache-2.0"
] | null | null | null | parl/utils/machine_info.py | ic7y/PARL | e8797bd0d31d81bc81aae8b12792ff922bcb8ea9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 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 app... | 28.941176 | 95 | 0.614329 |
import os
import platform
import random
import socket
import subprocess
from parl.utils import logger, _HAS_FLUID, _IS_WINDOWS
__all__ = [
'get_gpu_count', 'get_ip_address', 'is_gpu_available', 'get_free_tcp_port',
'is_port_available', 'get_port_from_range'
]
def get_ip_address():
if _IS_WINDOWS:
... | true | true |
08fae4f32fe2cd614b6cb34c8c908ac05cfd221f | 436 | py | Python | comptes/migrations/0003_ordre.py | nim65s/django-comptes | 8007745e0c09e8765d21f66d0aa06754458e9fce | [
"BSD-2-Clause"
] | null | null | null | comptes/migrations/0003_ordre.py | nim65s/django-comptes | 8007745e0c09e8765d21f66d0aa06754458e9fce | [
"BSD-2-Clause"
] | 24 | 2016-02-19T09:36:07.000Z | 2022-03-21T20:02:19.000Z | comptes/migrations/0003_ordre.py | nim65s/django-comptes | 8007745e0c09e8765d21f66d0aa06754458e9fce | [
"BSD-2-Clause"
] | null | null | null | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comptes', '0002_auto_20150517_2022'),
]
operations = [
migrations.AlterModelOptions(
name='dette',
options={'ordering': ['-moment']},
),
migrations.A... | 21.8 | 47 | 0.552752 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comptes', '0002_auto_20150517_2022'),
]
operations = [
migrations.AlterModelOptions(
name='dette',
options={'ordering': ['-moment']},
),
migrations.A... | true | true |
08fae4f3dce7f7b431264be36779bd2166d3a926 | 12,751 | py | Python | src/ocr_script.py | polifonia-project/OCR | 81db8757556e27765a8512bec4b5271c0a2cb301 | [
"MIT"
] | 1 | 2021-11-11T20:16:43.000Z | 2021-11-11T20:16:43.000Z | src/ocr_script.py | polifonia-project/OCR | 81db8757556e27765a8512bec4b5271c0a2cb301 | [
"MIT"
] | 3 | 2021-12-07T17:56:45.000Z | 2021-12-10T10:17:15.000Z | src/ocr_script.py | polifonia-project/textual-corpus-population | 81db8757556e27765a8512bec4b5271c0a2cb301 | [
"MIT"
] | null | null | null | import argparse
import ntpath
import os
import re
import cv2
import numpy as np
import pytesseract
from PIL import Image
from pdf2image import convert_from_path
from dotenv import load_dotenv
load_dotenv()
Image.MAX_IMAGE_PIXELS = 933120000
SUPPORTED_IMAGE_FORMAT = ['.png', '.jpg', '.jpeg', '.tiff', '.gif']
def fil... | 48.299242 | 128 | 0.600502 | import argparse
import ntpath
import os
import re
import cv2
import numpy as np
import pytesseract
from PIL import Image
from pdf2image import convert_from_path
from dotenv import load_dotenv
load_dotenv()
Image.MAX_IMAGE_PIXELS = 933120000
SUPPORTED_IMAGE_FORMAT = ['.png', '.jpg', '.jpeg', '.tiff', '.gif']
def fil... | true | true |
08fae4f748325eb7893657690bda628df7112e61 | 1,068 | py | Python | python-algorithm/leetcode/problem_1047.py | isudox/nerd-algorithm | c1fbe153953cf3fc24395f75d102016fdf9ea0fa | [
"MIT"
] | 5 | 2017-06-11T09:19:34.000Z | 2019-01-16T16:58:31.000Z | python-algorithm/leetcode/problem_1047.py | isudox/leetcode-solution | 60085e64deaf396a171367affc94b18114565c43 | [
"MIT"
] | 5 | 2020-03-22T13:53:54.000Z | 2020-03-23T08:49:35.000Z | python-algorithm/leetcode/problem_1047.py | isudox/nerd-algorithm | c1fbe153953cf3fc24395f75d102016fdf9ea0fa | [
"MIT"
] | 1 | 2019-03-02T15:50:43.000Z | 2019-03-02T15:50:43.000Z | """1047. Remove All Adjacent Duplicates In String
https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/
Given a string S of lowercase letters, a duplicate removal consists of
choosing two adjacent and equal letters, and removing them.
We repeatedly make duplicate removals on S until we no longer can... | 28.105263 | 76 | 0.689139 |
class Solution:
def remove_duplicates(self, s: str) -> str:
stack = []
for c in s:
if not stack or c != stack[-1]:
stack.append(c)
else:
stack.pop()
return ''.join(stack)
| true | true |
08fae50e0b5fe3ffe97385ced95f0bf2fa7f82ed | 1,545 | py | Python | volaupload/stat.py | RealDolos/volaupload | 9705bbc4fcd1dbc59abde092ee48dce1cb0bd3e5 | [
"MIT"
] | 8 | 2017-02-19T00:24:24.000Z | 2021-02-08T23:52:42.000Z | volaupload/stat.py | RealDolos/volaupload | 9705bbc4fcd1dbc59abde092ee48dce1cb0bd3e5 | [
"MIT"
] | 4 | 2015-01-19T08:09:07.000Z | 2018-09-11T21:57:06.000Z | volaupload/stat.py | RealDolos/volaupload | 9705bbc4fcd1dbc59abde092ee48dce1cb0bd3e5 | [
"MIT"
] | 2 | 2015-12-19T11:04:48.000Z | 2017-04-20T12:55:33.000Z | """ RealDolos' funky volafile upload tool (Stats)"""
from datetime import datetime
FAC = 1024.0 * 1024.0
class Statistics:
"""Keep some statistics"""
def __init__(self):
self.start = datetime.now()
self.lasts = [(self.start, 0)]
def record(self, pos):
"""Record a position in t... | 23.769231 | 61 | 0.550162 |
from datetime import datetime
FAC = 1024.0 * 1024.0
class Statistics:
def __init__(self):
self.start = datetime.now()
self.lasts = [(self.start, 0)]
def record(self, pos):
self.lasts += (datetime.now(), pos),
if len(self.lasts) > 10:
self.lasts.pop(0)
@pro... | true | true |
08fae544cfec982db271e1b6269b8d506517acc7 | 920 | py | Python | Code/Python/UDEL/AppliedCrypto/frequency.py | dks1018/CoffeeShopCoding | 13ac1700673c86c601eb2758570920620a956e4c | [
"ADSL"
] | null | null | null | Code/Python/UDEL/AppliedCrypto/frequency.py | dks1018/CoffeeShopCoding | 13ac1700673c86c601eb2758570920620a956e4c | [
"ADSL"
] | null | null | null | Code/Python/UDEL/AppliedCrypto/frequency.py | dks1018/CoffeeShopCoding | 13ac1700673c86c601eb2758570920620a956e4c | [
"ADSL"
] | null | null | null | #data derived from http://www.data-compression.com/english.html
freqs = {'a': 0.080642499002080981, 'c': 0.026892340312538593, 'b': 0.015373768624831691, 'e': 0.12886234260657689, 'd': 0.043286671390026357, 'g': 0.019625534749730816, 'f': 0.024484713711692099, 'i': 0.06905550211598431, 'h': 0.060987267963718068, 'k': 0... | 83.636364 | 711 | 0.733696 | freqs = {'a': 0.080642499002080981, 'c': 0.026892340312538593, 'b': 0.015373768624831691, 'e': 0.12886234260657689, 'd': 0.043286671390026357, 'g': 0.019625534749730816, 'f': 0.024484713711692099, 'i': 0.06905550211598431, 'h': 0.060987267963718068, 'k': 0.0062521823678781188, 'j': 0.0011176940633901926, 'm': 0.0250097... | true | true |
08fae658c509060e8989d0f8bb100bc11927df1a | 26,533 | py | Python | tempest/services/compute/xml/servers_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/services/compute/xml/servers_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/services/compute/xml/servers_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 IBM Corp.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.ap... | 41.009274 | 79 | 0.59409 |
import time
import urllib
from lxml import etree
from tempest.common.rest_client import RestClientXML
from tempest.common import waiters
from tempest import exceptions
from tempest.openstack.common import log as logging
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common... | true | true |
08fae834a5608db0fc04d8f0bc24162887334f1c | 8,988 | py | Python | tests/hwsim/nl80211.py | rainlake/hostap | b9cd4f5e75dc4a7aa3b547925cfb871b6aa103f7 | [
"Unlicense"
] | null | null | null | tests/hwsim/nl80211.py | rainlake/hostap | b9cd4f5e75dc4a7aa3b547925cfb871b6aa103f7 | [
"Unlicense"
] | null | null | null | tests/hwsim/nl80211.py | rainlake/hostap | b9cd4f5e75dc4a7aa3b547925cfb871b6aa103f7 | [
"Unlicense"
] | 1 | 2022-03-25T08:21:36.000Z | 2022-03-25T08:21:36.000Z | # nl80211 definitions
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import struct
nl80211_cmd = {
'GET_WIPHY': 1,
'SET_WIPHY': 2,
'NEW_WIPHY': 3,
'DEL_WIPHY': 4,
'GET_INTERFACE':... | 25.106145 | 71 | 0.603471 |
import binascii
import struct
nl80211_cmd = {
'GET_WIPHY': 1,
'SET_WIPHY': 2,
'NEW_WIPHY': 3,
'DEL_WIPHY': 4,
'GET_INTERFACE': 5,
'SET_INTERFACE': 6,
'NEW_INTERFACE': 7,
'DEL_INTERFACE': 8,
'GET_KEY': 9,
'SET_KEY': 10,
'NEW_KEY': 11,
'DEL_KEY': 12,
'GET_BEACON': 13,... | true | true |
08fae87531364fd5c74a6a9fea4464f1afb6abf6 | 58,817 | py | Python | calibre-plugin/dialogs.py | smutandrea/FanFicFare | 56e91c1f73bd2444d7cf7adea9975b169692657d | [
"Apache-2.0"
] | 1 | 2020-03-26T05:44:01.000Z | 2020-03-26T05:44:01.000Z | calibre-plugin/dialogs.py | Hypernoc/FanFicFare | 869ed37137c82cd71ec589f36bc2001528d5e76c | [
"Apache-2.0"
] | null | null | null | calibre-plugin/dialogs.py | Hypernoc/FanFicFare | 869ed37137c82cd71ec589f36bc2001528d5e76c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, unicode_literals, division,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2018, Jim Miller'
__docformat__ = 'restructuredtext en'
import traceback, re
from functools import partial
import logging
logger = logging.ge... | 36.737664 | 258 | 0.619583 |
from __future__ import (absolute_import, unicode_literals, division,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2018, Jim Miller'
__docformat__ = 'restructuredtext en'
import traceback, re
from functools import partial
import logging
logger = logging.getLogger(__name__)
impor... | true | true |
08fae8f987e2d1b04221dc2472c38291342d10ad | 15,024 | py | Python | arkane/encorr/isodesmicTest.py | xiaoruiDong/RMG-Py | 7c613c6ffe64c37564cfab2d634566f67d32b947 | [
"MIT"
] | null | null | null | arkane/encorr/isodesmicTest.py | xiaoruiDong/RMG-Py | 7c613c6ffe64c37564cfab2d634566f67d32b947 | [
"MIT"
] | null | null | null | arkane/encorr/isodesmicTest.py | xiaoruiDong/RMG-Py | 7c613c6ffe64c37564cfab2d634566f67d32b947 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 54.434783 | 120 | 0.610224 |
import unittest
import numpy as np
from rmgpy.molecule import Molecule
from rmgpy.species import Species
from arkane.encorr.isodesmic import ErrorCancelingScheme, ErrorCancelingSpecies, ErrorCancelingReaction, \
IsodesmicScheme, SpeciesConstraints
class TestErrorCancelingReactionAndSpecies(unittest.TestCas... | true | true |
08fae9601f6775b738364ed616ee8240b845e2df | 642 | py | Python | kogpt2/model/__init__.py | routiful/shame | e1825138c0cbf14b937ea43807d033b9a3738496 | [
"Apache-2.0"
] | 226 | 2020-04-26T10:22:54.000Z | 2022-03-08T08:33:37.000Z | kogpt2/model/__init__.py | routiful/shame | e1825138c0cbf14b937ea43807d033b9a3738496 | [
"Apache-2.0"
] | 8 | 2020-04-30T11:38:44.000Z | 2021-03-05T07:09:50.000Z | kogpt2/model/__init__.py | routiful/shame | e1825138c0cbf14b937ea43807d033b9a3738496 | [
"Apache-2.0"
] | 54 | 2020-05-10T19:31:25.000Z | 2022-01-03T15:07:40.000Z | # coding=utf-8
# Copyright 2020 SKT AIX 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 ag... | 33.789474 | 74 | 0.755452 |
from .gpt import *
from .torch_gpt2 import *
| true | true |
08faea2d6abac22380867037188825ead2dc5326 | 4,646 | py | Python | account/models.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | 1 | 2020-11-17T13:08:07.000Z | 2020-11-17T13:08:07.000Z | account/models.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | null | null | null | account/models.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | null | null | null | import json
import html
from django.contrib.auth.validators import UnicodeUsernameValidator
from django.core.validators import BaseValidator
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import ugettext_lazy as _
from utils.language import LANG_CHOICE
fr... | 32.950355 | 96 | 0.6257 | import json
import html
from django.contrib.auth.validators import UnicodeUsernameValidator
from django.core.validators import BaseValidator
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import ugettext_lazy as _
from utils.language import LANG_CHOICE
fr... | true | true |
08faeae1bf434d3af99d51fef9bd856877567dc1 | 6,598 | py | Python | SCons/Utilities/ConfigureCache.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | 2 | 2019-11-21T14:40:00.000Z | 2020-10-25T15:44:53.000Z | SCons/Utilities/ConfigureCache.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | SCons/Utilities/ConfigureCache.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | 2 | 2019-12-23T05:06:28.000Z | 2020-01-16T12:57:55.000Z | #! /usr/bin/env python
#
# SCons - a Software Constructor
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to... | 39.04142 | 82 | 0.637617 |
import argparse
import glob
import json
import os
def rearrange_cache_entries(current_prefix_len, new_prefix_len):
print('Changing prefix length from', current_prefix_len,
'to', new_prefix_len)
dirs = set()
old_dirs = set()
for file in glob.iglob(os.path.join('*', '*')):
name = os.p... | true | true |
08faeafe656ace726dc9bbbcac6504d93cbf47b4 | 10,487 | py | Python | zerver/tests/test_export.py | eric-erki/zulip | a063dd3b26f7ada794e14ace0d24ea1834611446 | [
"Apache-2.0"
] | 1 | 2021-02-13T20:43:29.000Z | 2021-02-13T20:43:29.000Z | zerver/tests/test_export.py | eric-erki/zulip | a063dd3b26f7ada794e14ace0d24ea1834611446 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_export.py | eric-erki/zulip | a063dd3b26f7ada794e14ace0d24ea1834611446 | [
"Apache-2.0"
] | 1 | 2021-04-09T05:50:23.000Z | 2021-04-09T05:50:23.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from django.conf import settings
from django.test import TestCase
import os
import shutil
import ujson
from mock import patch, MagicMock
from six.moves import range
from typing import Any
from zerver.lib.actions imp... | 33.504792 | 88 | 0.60904 | from __future__ import absolute_import
from __future__ import print_function
from django.conf import settings
from django.test import TestCase
import os
import shutil
import ujson
from mock import patch, MagicMock
from six.moves import range
from typing import Any
from zerver.lib.actions import (
do_claim_attac... | true | true |
08faeca5e3e4d6a1f1c86c1fe139592f751cfda2 | 3,280 | py | Python | app/app/settings.py | hossamhsn74/recipe-app-api | 59e749975eb33fa34a32d0fbbd154d5cdd9ca0b4 | [
"MIT"
] | null | null | null | app/app/settings.py | hossamhsn74/recipe-app-api | 59e749975eb33fa34a32d0fbbd154d5cdd9ca0b4 | [
"MIT"
] | 5 | 2021-03-19T15:15:57.000Z | 2022-03-12T00:54:15.000Z | app/app/settings.py | hossamhsn74/recipe-app-api | 59e749975eb33fa34a32d0fbbd154d5cdd9ca0b4 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib imp... | 25.625 | 91 | 0.689329 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '8-*i6zqw*g8&4+*_+5e!s48zhl-bg3%%e!a(0d3w%f36%ywptq'
DEBUG = True
ALLOWED_HOSTS = ['0.0.0.0',]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contri... | true | true |
08faecac45a7309f4224101d8e3621505ed21dcd | 19,861 | py | Python | python3/lib/python3.6/site-packages/tensorflow/contrib/image/ops/gen_single_image_random_dot_stereograms_ops.py | TruongThuyLiem/keras2tensorflow | 726f2370160701081cb43fbd8b56154c10d7ad63 | [
"MIT"
] | 3 | 2020-10-12T15:47:01.000Z | 2022-01-14T19:51:26.000Z | python3/lib/python3.6/site-packages/tensorflow/contrib/image/ops/gen_single_image_random_dot_stereograms_ops.py | TruongThuyLiem/keras2tensorflow | 726f2370160701081cb43fbd8b56154c10d7ad63 | [
"MIT"
] | null | null | null | python3/lib/python3.6/site-packages/tensorflow/contrib/image/ops/gen_single_image_random_dot_stereograms_ops.py | TruongThuyLiem/keras2tensorflow | 726f2370160701081cb43fbd8b56154c10d7ad63 | [
"MIT"
] | 2 | 2020-08-03T13:02:06.000Z | 2020-11-04T03:15:44.000Z | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: single_image_random_dot_stereograms_ops.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager impo... | 45.241458 | 940 | 0.664972 |
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from tensorflow.python.eager import execute as _execute
from tensorflow.python.framework... | true | true |
08faed6d71c5c662c8e59adba10b2a1ab8e73364 | 90,771 | py | Python | client/playerclient.py | almutwakel/the-farmers-market | b9517dfc144b8371265663566bc292bf2dc4a4d0 | [
"MIT"
] | 1 | 2020-09-27T20:23:14.000Z | 2020-09-27T20:23:14.000Z | client/playerclient.py | almutwakel/the-farmers-market | b9517dfc144b8371265663566bc292bf2dc4a4d0 | [
"MIT"
] | null | null | null | client/playerclient.py | almutwakel/the-farmers-market | b9517dfc144b8371265663566bc292bf2dc4a4d0 | [
"MIT"
] | null | null | null | from random import random, randint
import pygame
from pygame import *
pygame.init()
# hover = what button to hover over, main = main menu buttons (0 = none, 1 = play, 2 = help, 3 = credits, 4 = quit)
# type = game mode (1 = single-player, 2 = multi-player, 3 = back), exit = when 1 will set all others to 0)
# ----... | 55.962392 | 265 | 0.496778 | from random import random, randint
import pygame
from pygame import *
pygame.init()
def AAfilledRoundedRect(surface, color, rect, radius=0.4):
rect = Rect(rect)
color = Color(*color)
alpha = color.a
color.a = 0
pos = rect.topleft
rect.topleft = 0, 0
rectangle = Surface(rect.size, SRC... | true | true |
08faed864f86b376782212f7f4550ebf05a513d1 | 1,721 | py | Python | samples/snippets/get_realm.py | LaudateCorpus1/python-game-servers | 9e22e6dd4e2543d694e33eb1ec2c4f9a05d8b940 | [
"Apache-2.0"
] | 11 | 2020-07-13T22:22:10.000Z | 2022-03-17T07:21:36.000Z | samples/snippets/get_realm.py | LaudateCorpus1/python-game-servers | 9e22e6dd4e2543d694e33eb1ec2c4f9a05d8b940 | [
"Apache-2.0"
] | 83 | 2020-03-23T20:31:56.000Z | 2022-03-07T16:24:02.000Z | samples/snippets/get_realm.py | LaudateCorpus1/python-game-servers | 9e22e6dd4e2543d694e33eb1ec2c4f9a05d8b940 | [
"Apache-2.0"
] | 7 | 2020-03-20T20:55:03.000Z | 2022-01-29T08:11:07.000Z | #!/usr/bin/env python
# Copyright 2020 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 require... | 30.732143 | 93 | 0.73097 |
import argparse
from google.cloud import gaming
from google.cloud.gaming_v1.types import realms
def get_realm(project_id, location, realm_id):
client = gaming.RealmsServiceClient()
request = realms.GetRealmRequest(
name=f"projects/{project_id}/locations/{location}/realms/{realm_id}",
)
... | true | true |
08faedeb821e55343ce408d6e64f5dbd2c71491a | 7,395 | py | Python | script/feature-construct.py | svjack/Bu-Hts | 8621f4439bcd04800f887ac6b023ce49fc9a867f | [
"Unlicense",
"MIT"
] | null | null | null | script/feature-construct.py | svjack/Bu-Hts | 8621f4439bcd04800f887ac6b023ce49fc9a867f | [
"Unlicense",
"MIT"
] | null | null | null | script/feature-construct.py | svjack/Bu-Hts | 8621f4439bcd04800f887ac6b023ce49fc9a867f | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
# In[2]:
train = pd.read_csv("../data/train.csv", parse_dates=True, low_memory=False, index_col = "Date")
store = pd.read_csv("../data/store.csv", low_memory=False)
store.fillna(0, inplace = True)
# In[3]:
train["Year"] = t... | 27.800752 | 255 | 0.73117 |
import numpy as np
import pandas as pd
train = pd.read_csv("../data/train.csv", parse_dates=True, low_memory=False, index_col = "Date")
store = pd.read_csv("../data/store.csv", low_memory=False)
store.fillna(0, inplace = True)
train["Year"] = train.index.year
train["Month"] = train.index.month
train["Day"] =... | true | true |
08faeeb42308133ded9878c761bed4c69f04038f | 143 | py | Python | exercicios-turtle/.history/2_equation_20210624122535.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | 1 | 2021-11-28T18:49:21.000Z | 2021-11-28T18:49:21.000Z | exercicios-turtle/.history/2_equation_20210624122535.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | exercicios-turtle/.history/2_equation_20210624122535.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | print('A seguir digite os valores referentes a Ax² + Bx + c = 0')
A=float(input('Digite o valor de A: '))
B=float(input('Digite o valor B: ')) | 35.75 | 65 | 0.664336 | print('A seguir digite os valores referentes a Ax² + Bx + c = 0')
A=float(input('Digite o valor de A: '))
B=float(input('Digite o valor B: ')) | true | true |
08faeeb7a842b97e70207ed478a5de2c344902d3 | 4,499 | py | Python | osipkd/views/dashboard/__init__.py | aagusti/o-sipkd | 6c61fddb87fa6f4be18cac851bb44949019b8f3e | [
"MIT"
] | null | null | null | osipkd/views/dashboard/__init__.py | aagusti/o-sipkd | 6c61fddb87fa6f4be18cac851bb44949019b8f3e | [
"MIT"
] | null | null | null | osipkd/views/dashboard/__init__.py | aagusti/o-sipkd | 6c61fddb87fa6f4be18cac851bb44949019b8f3e | [
"MIT"
] | null | null | null | import json
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
from osipkd.views.base_view import BaseViews
from osipkd.models import DBSession
from osipkd.models.eis import Eis, Chart, ChartItem, Slide
from osipkd.tools import row2dict
########
# APP... | 44.107843 | 138 | 0.491665 | import json
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
from osipkd.views.base_view import BaseViews
from osipkd.models import DBSession
from osipkd.models.eis import Eis, Chart, ChartItem, Slide
from osipkd.tools import row2dict
class dashboard... | true | true |
08faef63830538cfbb811199cc0876fc8021a0bd | 13,397 | py | Python | src/m1.py | xiaoyifei1/05a-Debugging | 09271455014b98e569ee7d64f3082bb752985439 | [
"MIT"
] | null | null | null | src/m1.py | xiaoyifei1/05a-Debugging | 09271455014b98e569ee7d64f3082bb752985439 | [
"MIT"
] | null | null | null | src/m1.py | xiaoyifei1/05a-Debugging | 09271455014b98e569ee7d64f3082bb752985439 | [
"MIT"
] | null | null | null | """
This module lets you practice DEBUGGING when RUN-TIME EXCEPTIONS occur.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Valerie Galluzzi, Mark Hays, Amanda Stouder, Aaron Wilkin,
their colleagues, and Yifei Xiao.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
import rosegrap... | 37.008287 | 79 | 0.559678 |
import rosegraphics as rg
# an EXCEPTION -- an error that occurs when the program runs and
# (left to itself) causes the program to end its execution.
#
# We have written tests for each broken function.
# *** DO NOT MODIFY THE TESTS. ***
# In fact, you do not even need to read the tests.
# Instead, look... | true | true |
08faef8fb53a66ea705104fff2a920622b6affb7 | 649 | py | Python | tkinter--source/evet.py | Ayon134/code_for_Kids | d90698bb38efe5e26c31f02bd129bfdadea158e2 | [
"MIT"
] | null | null | null | tkinter--source/evet.py | Ayon134/code_for_Kids | d90698bb38efe5e26c31f02bd129bfdadea158e2 | [
"MIT"
] | null | null | null | tkinter--source/evet.py | Ayon134/code_for_Kids | d90698bb38efe5e26c31f02bd129bfdadea158e2 | [
"MIT"
] | 2 | 2021-01-08T03:52:46.000Z | 2021-04-01T19:16:12.000Z | #handling button click
#when you press button what will happen
import tkinter
#create a window
window = tkinter.Tk()
window.title("Welcome to Tkinter World :-)")
window.geometry('500x500')
label = tkinter.Label(window, text = "Hello Word!", font=("Arial Bold", 50))
label.grid(column=0, row=0)
def clicked():
... | 23.178571 | 85 | 0.721109 |
import tkinter
window = tkinter.Tk()
window.title("Welcome to Tkinter World :-)")
window.geometry('500x500')
label = tkinter.Label(window, text = "Hello Word!", font=("Arial Bold", 50))
label.grid(column=0, row=0)
def clicked():
label.configure(text="button is clicked !!")
bton = tkinter.Button(window, tex... | true | true |
08faf10f79c220f5365b1d4e4d9b3fa455a71249 | 1,521 | py | Python | Group.py | mrozekma/Sprint | 0bf531d2f16a7bc5b56dbc8c6eae5dc9e251b2f1 | [
"MIT"
] | 2 | 2015-03-18T13:58:46.000Z | 2020-04-10T14:54:56.000Z | Group.py | mrozekma/Sprint | 0bf531d2f16a7bc5b56dbc8c6eae5dc9e251b2f1 | [
"MIT"
] | 20 | 2015-01-16T18:46:53.000Z | 2016-02-18T22:01:00.000Z | Group.py | mrozekma/Sprint | 0bf531d2f16a7bc5b56dbc8c6eae5dc9e251b2f1 | [
"MIT"
] | 2 | 2015-08-24T15:39:20.000Z | 2016-01-03T06:03:13.000Z | from utils import *
from Sprint import Sprint
from stasis.Singleton import get as db
from stasis.ActiveRecord import ActiveRecord, link
class Group(ActiveRecord):
sprint = link(Sprint, 'sprintid')
def __init__(self, sprintid, name, seq = None, deletable = True, id = None):
ActiveRecord.__init__(self)
self.id =... | 28.698113 | 86 | 0.667324 | from utils import *
from Sprint import Sprint
from stasis.Singleton import get as db
from stasis.ActiveRecord import ActiveRecord, link
class Group(ActiveRecord):
sprint = link(Sprint, 'sprintid')
def __init__(self, sprintid, name, seq = None, deletable = True, id = None):
ActiveRecord.__init__(self)
self.id =... | true | true |
08faf12a3f72ff8bbf5f497c91d0a9490b52dd36 | 13,671 | py | Python | src/transformer_deploy/convert.py | averkij/transformer-deploy | 2a0b527dc187e14c718d36dbac8a3e29e34cf78b | [
"Apache-2.0"
] | 1 | 2022-02-14T07:58:33.000Z | 2022-02-14T07:58:33.000Z | src/transformer_deploy/convert.py | averkij/transformer-deploy | 2a0b527dc187e14c718d36dbac8a3e29e34cf78b | [
"Apache-2.0"
] | null | null | null | src/transformer_deploy/convert.py | averkij/transformer-deploy | 2a0b527dc187e14c718d36dbac8a3e29e34cf78b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021, Lefebvre Sarrut Services
#
# 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... | 40.446746 | 116 | 0.664399 |
import argparse
import logging
import os
from pathlib import Path
from typing import Callable, Dict, List, Tuple, Union
import numpy as np
import torch
from numpy import ndarray
from transformers import AutoModelForSequenceClassification, AutoTokenizer, PreTrainedModel, PreTrainedTokenizer
from transformer_deploy.b... | true | true |
08faf3887eb9e6bb76b5bbc07d7c399d61bee257 | 2,262 | py | Python | Chapter 7/tf2_matrix_factorization.py | shantam21/Deep-Learning-with-TensorFlow-2-and-Keras | 1edd5217f871a27b9c95db85b09c8ea23df63dfb | [
"MIT"
] | 267 | 2020-01-01T23:38:26.000Z | 2022-03-20T06:57:05.000Z | Chapter 7/tf2_matrix_factorization.py | shantam21/Deep-Learning-with-TensorFlow-2-and-Keras | 1edd5217f871a27b9c95db85b09c8ea23df63dfb | [
"MIT"
] | 6 | 2020-03-20T05:14:50.000Z | 2021-07-01T09:02:57.000Z | Chapter 7/tf2_matrix_factorization.py | shantam21/Deep-Learning-with-TensorFlow-2-and-Keras | 1edd5217f871a27b9c95db85b09c8ea23df63dfb | [
"MIT"
] | 192 | 2019-12-24T18:49:44.000Z | 2022-03-24T16:05:23.000Z | import numpy as np
import tensorflow as tf
class MatrixFactorizationLayer(tf.keras.layers.Layer):
def __init__(self, emb_sz, **kwargs):
super(MatrixFactorizationLayer, self).__init__(**kwargs)
self.emb_sz = emb_sz
def build(self, input_shape):
num_rows, num_cols = input_shape
s... | 30.16 | 69 | 0.652078 | import numpy as np
import tensorflow as tf
class MatrixFactorizationLayer(tf.keras.layers.Layer):
def __init__(self, emb_sz, **kwargs):
super(MatrixFactorizationLayer, self).__init__(**kwargs)
self.emb_sz = emb_sz
def build(self, input_shape):
num_rows, num_cols = input_shape
s... | true | true |
08faf3b52dd333971547f32646759e908b9a38e8 | 2,357 | py | Python | src/util/util.py | BalinLin/SID | 8c2dfb0e671ee9333945545c82a12cfe227813cd | [
"MIT"
] | 44 | 2020-11-18T00:15:52.000Z | 2022-03-21T12:33:33.000Z | src/util/util.py | OBrutus/SID | c0702815c4b1a72f606f6b0ee4e5d660a0b8c506 | [
"MIT"
] | 17 | 2020-11-20T02:45:54.000Z | 2022-03-22T18:58:26.000Z | src/util/util.py | OBrutus/SID | c0702815c4b1a72f606f6b0ee4e5d660a0b8c506 | [
"MIT"
] | 11 | 2020-11-18T00:15:55.000Z | 2021-12-24T14:21:43.000Z | from __future__ import print_function
import torch
import numpy as np
from PIL import Image
import os
def sdmkdir(dir_name):
if not os.path.exists(dir_name):
os.mkdir(dir_name)
# Converts a Tensor into an image array (numpy)
# |imtype|: the desired type of the converted numpy array
def tensor2im(input_ima... | 29.098765 | 85 | 0.64319 | from __future__ import print_function
import torch
import numpy as np
from PIL import Image
import os
def sdmkdir(dir_name):
if not os.path.exists(dir_name):
os.mkdir(dir_name)
def tensor2im(input_image, imtype=np.uint8,scale=None):
if len(input_image.shape)<3: return None
if isinstanc... | true | true |
08faf3f13adc423a892035992361abdc24f03550 | 2,914 | py | Python | src/microphone.py | Atharv-cyber/Jarvis-1 | 213fd5df31776dee823cab5a429739252e87254e | [
"MIT"
] | 251 | 2015-01-05T19:05:10.000Z | 2022-02-24T02:35:28.000Z | src/microphone.py | axiom24/Jarvis | fa8e5be9f1b3a8d02ca26ba4f6956035012006ef | [
"MIT"
] | 10 | 2015-01-05T23:57:19.000Z | 2021-01-23T21:03:59.000Z | src/microphone.py | axiom24/Jarvis | fa8e5be9f1b3a8d02ca26ba4f6956035012006ef | [
"MIT"
] | 81 | 2015-01-06T12:29:31.000Z | 2022-03-05T17:33:02.000Z | import os
import sys
import wave
import tempfile
import pyaudio
from array import array
from struct import pack
THRESHOLD = 2000
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
SILENCE_DURATION = 40
WAIT_DURATION = 500
SPEECH_DURATION = 300
class Microphone:
"""
This class uses PyAudio to re... | 26.490909 | 64 | 0.551476 | import os
import sys
import wave
import tempfile
import pyaudio
from array import array
from struct import pack
THRESHOLD = 2000
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
SILENCE_DURATION = 40
WAIT_DURATION = 500
SPEECH_DURATION = 300
class Microphone:
def __init__(self):
self.rec... | true | true |
08faf4a0e530e242392228c8cca21acf557d8b10 | 4,124 | py | Python | kubernetes/client/models/v2beta2_resource_metric_source.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/client/models/v2beta2_resource_metric_source.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v2beta2_resource_metric_source.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 26.267516 | 105 | 0.563288 |
from pprint import pformat
from six import iteritems
import re
class V2beta2ResourceMetricSource(object):
swagger_types = {
'name': 'str',
'target': 'V2beta2MetricTarget'
}
attribute_map = {
'name': 'name',
'target': 'target'
}
def __init__(self, name=None, t... | true | true |
08faf4d0f779ea1d32906f59d1b3aa32770cbe68 | 1,059 | py | Python | 2020/day12/2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | null | null | null | 2020/day12/2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | 2 | 2019-12-01T20:03:18.000Z | 2021-05-11T22:41:00.000Z | 2020/day12/2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | null | null | null | import re
file = open('./input', 'r')
lines = file.readlines()
insts = list(map(lambda line: line[:-1], lines))
wp_state = [10, 1]
state = [0, 0]
for inst in insts:
command = inst[0]
value = int(inst[1:])
if command == 'N':
wp_state[1] += value
elif command == 'S':
wp_state[1] -= value
elif comma... | 20.365385 | 48 | 0.525024 | import re
file = open('./input', 'r')
lines = file.readlines()
insts = list(map(lambda line: line[:-1], lines))
wp_state = [10, 1]
state = [0, 0]
for inst in insts:
command = inst[0]
value = int(inst[1:])
if command == 'N':
wp_state[1] += value
elif command == 'S':
wp_state[1] -= value
elif comma... | true | true |
08faf50127ae2f1e09e9691b58ebaac68bd656b8 | 1,116 | py | Python | trainer/preprocessor.py | iht/kschool-challenge-dl | da46222b1c8bd02e5294b9f6a7570dedb7a0ea9a | [
"Apache-2.0"
] | 1 | 2020-02-18T18:52:17.000Z | 2020-02-18T18:52:17.000Z | trainer/preprocessor.py | iht/kschool-challenge-dl | da46222b1c8bd02e5294b9f6a7570dedb7a0ea9a | [
"Apache-2.0"
] | null | null | null | trainer/preprocessor.py | iht/kschool-challenge-dl | da46222b1c8bd02e5294b9f6a7570dedb7a0ea9a | [
"Apache-2.0"
] | 1 | 2020-01-25T10:21:58.000Z | 2020-01-25T10:21:58.000Z | """A class to preprocess images."""
from tensorflow.keras.preprocessing.image import ImageDataGenerator
class MyImagePreprocessor:
"""Preprocess images for training or inference."""
def __init__(self, img_size, batch_size):
"""Create a MyImagePreprocessor.
Args:
img_size: The size of the resultin... | 27.9 | 78 | 0.709677 |
from tensorflow.keras.preprocessing.image import ImageDataGenerator
class MyImagePreprocessor:
def __init__(self, img_size, batch_size):
self._img_size = img_size
self._batch_size = batch_size
self._reduction_factor = 255.0
self._img_datagen = ImageDataGenerator(rescale=1 / self._reduction_factor... | true | true |
08faf560b6f78e2d50dea3d6fe3e73f9a9d574f6 | 31,488 | py | Python | ProjectFiles/bin/Release/2.80/scripts/addons/mesh_extra_tools/pkhg_faces.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-07-08T15:51:14.000Z | 2019-07-08T15:51:14.000Z | ProjectFiles/bin/Release/2.80/scripts/addons/mesh_extra_tools/pkhg_faces.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | ProjectFiles/bin/Release/2.80/scripts/addons/mesh_extra_tools/pkhg_faces.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # gpl author: PHKG
bl_info = {
"name": "PKHG faces",
"author": "PKHG",
"version": (0, 0, 6),
"blender": (2, 7, 1),
"location": "View3D > Tools > PKHG (tab)",
"description": "Faces selected will become added faces of different style",
"warning": "",
"wiki_url": "",
"category": "Mesh"... | 37.665072 | 103 | 0.566533 |
bl_info = {
"name": "PKHG faces",
"author": "PKHG",
"version": (0, 0, 6),
"blender": (2, 7, 1),
"location": "View3D > Tools > PKHG (tab)",
"description": "Faces selected will become added faces of different style",
"warning": "",
"wiki_url": "",
"category": "Mesh",
}
import bpy
imp... | true | true |
08faf5848a8dd32364b5e3c447b93a12946d0169 | 13,543 | py | Python | txstratum/utils.py | luislhl/tx-mining-service | 4ec9d074bca2fd583f823d51e075487cc9bfd5c1 | [
"MIT"
] | 5 | 2020-06-05T20:10:58.000Z | 2022-02-15T19:06:06.000Z | txstratum/utils.py | luislhl/tx-mining-service | 4ec9d074bca2fd583f823d51e075487cc9bfd5c1 | [
"MIT"
] | 20 | 2020-07-30T03:10:47.000Z | 2022-03-31T18:26:32.000Z | txstratum/utils.py | luislhl/tx-mining-service | 4ec9d074bca2fd583f823d51e075487cc9bfd5c1 | [
"MIT"
] | 2 | 2021-08-23T15:39:31.000Z | 2022-02-08T21:20:03.000Z | # Copyright (c) Hathor Labs and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import asyncio
import json
import traceback
from asyncio import Future
from collections import OrderedDict, namedtuple
from contextlib import supp... | 35.545932 | 116 | 0.586428 | import asyncio
import json
import traceback
from asyncio import Future
from collections import OrderedDict, namedtuple
from contextlib import suppress
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union, cast
from structlog import get_logger
from txstratum.consta... | true | true |
08faf6272e98acea9480440c7ecc1cf0b24efb05 | 184 | py | Python | Lib/fontTools/ttLib/tables/G_D_E_F_.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | Lib/fontTools/ttLib/tables/G_D_E_F_.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | Lib/fontTools/ttLib/tables/G_D_E_F_.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from .otBase import BaseTTXConverter
class table_G_D_E_F_(BaseTTXConverter):
pass
| 23 | 64 | 0.842391 | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from .otBase import BaseTTXConverter
class table_G_D_E_F_(BaseTTXConverter):
pass
| true | true |
08faf65736afe723ecea48315e28d190fb791796 | 5,798 | py | Python | scripts/sarsa.py | naokawa0609/naokawa | 5547cea501259ce5b5bc8708e30760ad2f4187b2 | [
"MIT"
] | 148 | 2019-03-27T00:20:16.000Z | 2022-03-30T22:34:11.000Z | scripts/sarsa.py | naokawa0609/naokawa | 5547cea501259ce5b5bc8708e30760ad2f4187b2 | [
"MIT"
] | 3 | 2018-11-07T04:33:13.000Z | 2018-12-31T01:35:16.000Z | scripts/sarsa.py | naokawa0609/naokawa | 5547cea501259ce5b5bc8708e30760ad2f4187b2 | [
"MIT"
] | 116 | 2019-04-18T08:35:53.000Z | 2022-03-24T05:17:46.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import sys
sys.path.append('../scripts/')
from dp_policy_agent import *
import random, copy
# In[2]:
class StateInfo:
def __init__(self, action_num, epsilon=0.3):
self.q = np.zeros(action_num)
self.epsilon = epsilon
def greedy(self):... | 27.875 | 233 | 0.56209 |
import sys
sys.path.append('../scripts/')
from dp_policy_agent import *
import random, copy
class StateInfo:
def __init__(self, action_num, epsilon=0.3):
self.q = np.zeros(action_num)
self.epsilon = epsilon
def greedy(self):
return np.argmax(self.q)
def epsilon_g... | true | true |
08faf856f46ccfae026f63c126c3c90dcfe8ff3b | 2,358 | py | Python | src/selfdroid/TemplateFilters.py | vitlabuda/selfdroid-web-app | 9eac9ee2c34038de13e179b6afb3d530a086e7b2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-03-13T14:57:04.000Z | 2022-03-13T14:57:04.000Z | src/selfdroid/TemplateFilters.py | vitlabuda/selfdroid-web-app | 9eac9ee2c34038de13e179b6afb3d530a086e7b2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/selfdroid/TemplateFilters.py | vitlabuda/selfdroid-web-app | 9eac9ee2c34038de13e179b6afb3d530a086e7b2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
#
# Copyright (c) 2021 Vít Labuda. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice... | 52.4 | 118 | 0.761662 |
import datetime
from selfdroid.Settings import Settings
from selfdroid.appstorage.apk.AndroidVersionList import AndroidVersionList
class TemplateFilters:
@staticmethod
def tf_format_datetime(value: datetime.datetime) -> str:
return value.strftime(Settings.DATETIME_DISPLAY_FORMAT)
@staticmethod
... | true | true |
08faf9d496775ce72ff9c9ea30f4d49d7ce8d73c | 391 | py | Python | shiyanlou_cs1144/Allwork/allwork/wsgi.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs1144/Allwork/allwork/wsgi.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs1144/Allwork/allwork/wsgi.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | """
WSGI config for allwork project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "allwork.settings")
application = get_wsgi_application()
| true | true |
08fafaa96f53cf1dcd9c66e36d41fbef9dca593e | 1,366 | py | Python | lotto_game/city.py | aleattene/lotto-game | 6871699c44c988f926db986668524c002d3560f2 | [
"MIT"
] | null | null | null | lotto_game/city.py | aleattene/lotto-game | 6871699c44c988f926db986668524c002d3560f2 | [
"MIT"
] | null | null | null | lotto_game/city.py | aleattene/lotto-game | 6871699c44c988f926db986668524c002d3560f2 | [
"MIT"
] | null | null | null | class City:
# Dictionary containing the cities (aka "wheel") that can be chosen for each ticket
all_cities = {1: "Bari", 2: "Cagliari", 3: "Firenze", 4: "Genova", 5: "Milano",
6: "Napoli", 7: "Palermo", 8: "Roma", 9: "Torino", 10: "Venezia", 11: "Tutte"}
def __init__(self, id_city, name)... | 39.028571 | 117 | 0.523426 | class City:
all_cities = {1: "Bari", 2: "Cagliari", 3: "Firenze", 4: "Genova", 5: "Milano",
6: "Napoli", 7: "Palermo", 8: "Roma", 9: "Torino", 10: "Venezia", 11: "Tutte"}
def __init__(self, id_city, name):
self.id_city = id_city self.name = name
def _... | true | true |
08fafac8f59dd334f09a6ac100702649182d73d8 | 15,878 | py | Python | lib/model.py | alexmagsam/keras-rpn | 394ed2506003f3bed3c5247d47213163f47931c0 | [
"MIT"
] | 23 | 2019-06-28T02:39:37.000Z | 2021-08-23T17:30:13.000Z | lib/model.py | alexmagsam/keras-rpn | 394ed2506003f3bed3c5247d47213163f47931c0 | [
"MIT"
] | 2 | 2020-03-16T10:11:27.000Z | 2021-06-30T12:06:03.000Z | lib/model.py | alexmagsam/keras-rpn | 394ed2506003f3bed3c5247d47213163f47931c0 | [
"MIT"
] | 8 | 2019-06-28T02:39:39.000Z | 2021-07-17T14:38:10.000Z | import os
import keras.layers as KL
import keras.models as KM
import keras.optimizers as KO
import tensorflow as tf
from keras.callbacks import CSVLogger, ModelCheckpoint
from lib import losses as ls
class RPN:
def __init__(self, config, mode='train'):
assert mode in ['train', 'inference']
self.... | 42.341333 | 121 | 0.586661 | import os
import keras.layers as KL
import keras.models as KM
import keras.optimizers as KO
import tensorflow as tf
from keras.callbacks import CSVLogger, ModelCheckpoint
from lib import losses as ls
class RPN:
def __init__(self, config, mode='train'):
assert mode in ['train', 'inference']
self.... | true | true |
08fafb008e75693595a6a5826c687a8f7ded9048 | 7,577 | py | Python | todoism/apis/v1/resources.py | AngelLiang/hacking-todoism | b3f02822bc54cc12d2ab0258d30bc2c6d842f393 | [
"MIT"
] | null | null | null | todoism/apis/v1/resources.py | AngelLiang/hacking-todoism | b3f02822bc54cc12d2ab0258d30bc2c6d842f393 | [
"MIT"
] | null | null | null | todoism/apis/v1/resources.py | AngelLiang/hacking-todoism | b3f02822bc54cc12d2ab0258d30bc2c6d842f393 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:author: Grey Li (李辉)
:url: http://greyli.com
:copyright: © 2018 Grey Li <withlihui@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from flask import jsonify, request, current_app, url_for, g
from flask.views import MethodView
from todoism.apis.v1 import api_v1
f... | 36.781553 | 113 | 0.630593 | from flask import jsonify, request, current_app, url_for, g
from flask.views import MethodView
from todoism.apis.v1 import api_v1
from todoism.apis.v1.auth import auth_required, generate_token
from todoism.apis.v1.errors import api_abort, ValidationError
from todoism.apis.v1.schemas import user_schema, item_schema, it... | true | true |
08fafd1961821fccb870f45f728c5e6125fc5332 | 3,625 | py | Python | test/option--max-drift.py | bdbaddog/scons-gh-migrate | c76589c83ec00650a2d07dce79fc6dc5ca6465fb | [
"MIT"
] | 1 | 2015-11-04T22:22:10.000Z | 2015-11-04T22:22:10.000Z | test/option--max-drift.py | bdbaddog/scons-gh-migrate | c76589c83ec00650a2d07dce79fc6dc5ca6465fb | [
"MIT"
] | null | null | null | test/option--max-drift.py | bdbaddog/scons-gh-migrate | c76589c83ec00650a2d07dce79fc6dc5ca6465fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 28.320313 | 86 | 0.701241 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
test.write('build.py', r"""
import sys
contents = open(sys.argv[2], 'rb').read()
file = open(sys.argv[1], 'wb')
file.write(contents)
file.close()
""")
test.write('SC... | true | true |
08fafdc984787773b5c150ea78e1cea9004b32fe | 5,596 | py | Python | vel/openai/baselines/bench/benchmarks.py | tigerwlin/vel | 00e4fbb7b612e888e2cbb5d8455146664638cd0b | [
"MIT"
] | 273 | 2018-09-01T08:54:34.000Z | 2022-02-02T13:22:51.000Z | vel/openai/baselines/bench/benchmarks.py | tigerwlin/vel | 00e4fbb7b612e888e2cbb5d8455146664638cd0b | [
"MIT"
] | 47 | 2018-08-17T11:27:08.000Z | 2022-03-11T23:26:55.000Z | vel/openai/baselines/bench/benchmarks.py | tigerwlin/vel | 00e4fbb7b612e888e2cbb5d8455146664638cd0b | [
"MIT"
] | 37 | 2018-10-11T22:56:57.000Z | 2020-10-06T19:53:05.000Z | import re
import os.path as osp
import os
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
_atari7 = ['BeamRider', 'Breakout', 'Enduro', 'Pong', 'Qbert', 'Seaquest', 'SpaceInvaders']
_atariexpl7 = ['Freeway', 'Gravitar', 'MontezumaRevenge', 'Pitfall', 'PrivateEye', 'Solaris', 'Venture']
_BENCHMARKS = []
remov... | 37.306667 | 129 | 0.643853 | import re
import os.path as osp
import os
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
_atari7 = ['BeamRider', 'Breakout', 'Enduro', 'Pong', 'Qbert', 'Seaquest', 'SpaceInvaders']
_atariexpl7 = ['Freeway', 'Gravitar', 'MontezumaRevenge', 'Pitfall', 'PrivateEye', 'Solaris', 'Venture']
_BENCHMARKS = []
remov... | true | true |
08fafde4de9612f4eb6272f3d96b8fb3360e5804 | 1,575 | py | Python | userbot/modules/tiktok_downloader.py | FSharon/UserBot | e21c30ffc15143a97cd2a3ad133926b34b68b8f1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2020-10-25T03:36:43.000Z | 2021-05-27T09:10:09.000Z | userbot/modules/tiktok_downloader.py | FSharon/UserBot | e21c30ffc15143a97cd2a3ad133926b34b68b8f1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2021-07-16T10:10:09.000Z | 2021-12-19T23:34:15.000Z | userbot/modules/tiktok_downloader.py | minaricious/UserBot | e21c30ffc15143a97cd2a3ad133926b34b68b8f1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 7 | 2020-10-27T03:00:57.000Z | 2021-09-02T12:17:54.000Z | # Copyright (C) 2020 Frizzy.
# All rights reserved.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot import bot, CMD_HELP
from userbot.events im... | 35 | 94 | 0.622857 |
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot import bot, CMD_HELP
from userbot.events import register
@register(outgoing=True, pattern="^.tiktok(?: |$)(.*)")
async def _(event):
if event.fwd_from:
return
d_link = event.pattern_match.group(1)
if ".com" not in d_link:
... | true | true |
08faff86da7f3d77043c75d5fceb750108b389f6 | 14,642 | py | Python | learn/data_analysis/normal_data_analysis/play_data.py | ArseneLupinhb/py_al | e2e4d25a00cb13d68da26c17f86f9cf1e47a79e1 | [
"MIT"
] | 1 | 2020-04-14T03:32:56.000Z | 2020-04-14T03:32:56.000Z | learn/data_analysis/normal_data_analysis/play_data.py | ArseneLupinhb/py_al | e2e4d25a00cb13d68da26c17f86f9cf1e47a79e1 | [
"MIT"
] | null | null | null | learn/data_analysis/normal_data_analysis/play_data.py | ArseneLupinhb/py_al | e2e4d25a00cb13d68da26c17f86f9cf1e47a79e1 | [
"MIT"
] | null | null | null | import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn.preprocessing as preprocessing
from sklearn import linear_model
from sklearn import model_selection
from sklearn.ensemble import RandomForestRegressor
print(os.getcwd())
# data_path = r'C:\Users\ArseneLupin\Desktop\OrderT... | 35.028708 | 120 | 0.677093 | import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn.preprocessing as preprocessing
from sklearn import linear_model
from sklearn import model_selection
from sklearn.ensemble import RandomForestRegressor
print(os.getcwd())
data_path = os.getcwd() + r'\dataset\train.csv'
dat... | true | true |
08fafffc9fe8cb3fb61de337df0ab55345e6a14f | 11,711 | py | Python | tests/ut/python/optimizer/test_optimizer_with_loss_scale.py | Vincent34/mindspore | a39a60878a46e7e9cb02db788c0bca478f2fa6e5 | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | tests/ut/python/optimizer/test_optimizer_with_loss_scale.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | tests/ut/python/optimizer/test_optimizer_with_loss_scale.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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... | 38.778146 | 117 | 0.671249 | import numpy as np
import mindspore.nn as nn
from mindspore import Tensor, Parameter
from mindspore import context
from mindspore.common import dtype as mstype
from mindspore.nn.optim import Lamb
from mindspore.nn.optim import Momentum, Adam
from mindspore.nn.wrap.cell_wrapper import WithLossCell
from mindspore.nn.wra... | true | true |
08fb00fa62725a03f5ea0188cd9d82cfce3be546 | 12,732 | py | Python | imc/opaclient.py | prominence-eosc/imc | 1bb9cfcf9cbeade7c96a02192e0cc59f0174c9e3 | [
"Apache-2.0"
] | null | null | null | imc/opaclient.py | prominence-eosc/imc | 1bb9cfcf9cbeade7c96a02192e0cc59f0174c9e3 | [
"Apache-2.0"
] | 76 | 2019-03-19T13:55:13.000Z | 2020-06-05T10:51:03.000Z | imc/opaclient.py | prominence-eosc/imc | 1bb9cfcf9cbeade7c96a02192e0cc59f0174c9e3 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import sys
import time
import requests
from imc.retry import retry
# Logging
logger = logging.getLogger(__name__)
class OPAClient(object):
"""
Open Policy Agent helper
"""
def __init__(self, url=None, timeout=10):
self._url = url
self._timeout = timeout
... | 34.978022 | 105 | 0.506833 | import json
import logging
import sys
import time
import requests
from imc.retry import retry
logger = logging.getLogger(__name__)
class OPAClient(object):
def __init__(self, url=None, timeout=10):
self._url = url
self._timeout = timeout
def set_status(self, cloud, state):
data = {}... | true | true |
08fb0128bdad5ffdfa17819a06aabc6aa16585d8 | 6,839 | py | Python | pysnmp/Dell-VRTX-MIR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Dell-VRTX-MIR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Dell-VRTX-MIR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Dell-VRTX-MIR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Dell-VRTX-MIR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:42:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 112.114754 | 1,160 | 0.794853 | OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
08fb0172adcffe8213127d4da08a6478d63b4a7e | 124,468 | py | Python | pandas/io/parsers.py | finnhacks42/pandas | 64de074403c6e9a574e61aa0500d32ae48d2d4c6 | [
"BSD-3-Clause"
] | null | null | null | pandas/io/parsers.py | finnhacks42/pandas | 64de074403c6e9a574e61aa0500d32ae48d2d4c6 | [
"BSD-3-Clause"
] | null | null | null | pandas/io/parsers.py | finnhacks42/pandas | 64de074403c6e9a574e61aa0500d32ae48d2d4c6 | [
"BSD-3-Clause"
] | null | null | null | """
Module contains tools for processing files into DataFrames or other objects
"""
from __future__ import print_function
from collections import defaultdict
import re
import csv
import sys
import warnings
import datetime
from textwrap import fill
import numpy as np
from pandas import compat
from pandas.compat import... | 35.807825 | 79 | 0.561253 | from __future__ import print_function
from collections import defaultdict
import re
import csv
import sys
import warnings
import datetime
from textwrap import fill
import numpy as np
from pandas import compat
from pandas.compat import (range, lrange, PY3, StringIO, lzip,
zip, string_types, ... | true | true |
08fb0242faec332dda5051c87b7515f30678df4b | 200 | py | Python | world/dominion/plots/constants.py | dvoraen/arxcode | a89f2004fca10e0b1f1995c2420dd3ffbf08774b | [
"MIT"
] | 42 | 2018-08-12T00:55:24.000Z | 2021-12-24T15:16:08.000Z | world/dominion/plots/constants.py | dvoraen/arxcode | a89f2004fca10e0b1f1995c2420dd3ffbf08774b | [
"MIT"
] | 312 | 2018-10-22T23:03:27.000Z | 2022-02-06T13:02:58.000Z | world/dominion/plots/constants.py | dvoraen/arxcode | a89f2004fca10e0b1f1995c2420dd3ffbf08774b | [
"MIT"
] | 42 | 2018-08-12T00:41:48.000Z | 2022-01-27T14:03:16.000Z | RESOURCES = "resources"
CLUE = "clue"
REVELATION = "revelation"
SKILL_NODE = "skillnode"
SPELL = "spell"
FORCES = "forces"
REQUIREMENT_TYPES = (RESOURCES, CLUE, REVELATION, SKILL_NODE, SPELL, FORCES)
| 25 | 76 | 0.74 | RESOURCES = "resources"
CLUE = "clue"
REVELATION = "revelation"
SKILL_NODE = "skillnode"
SPELL = "spell"
FORCES = "forces"
REQUIREMENT_TYPES = (RESOURCES, CLUE, REVELATION, SKILL_NODE, SPELL, FORCES)
| true | true |
08fb032573f32a21068db7eed495969f15c4bf6b | 22,289 | py | Python | models/model_utils.py | UT-Austin-RPL/BUDS | 6b5ae1864b50bb6212fae4fdfba4ffc8e74f2e85 | [
"MIT"
] | 9 | 2021-10-03T06:05:32.000Z | 2022-03-14T01:25:27.000Z | models/model_utils.py | UT-Austin-RPL/BUDS | 6b5ae1864b50bb6212fae4fdfba4ffc8e74f2e85 | [
"MIT"
] | null | null | null | models/model_utils.py | UT-Austin-RPL/BUDS | 6b5ae1864b50bb6212fae4fdfba4ffc8e74f2e85 | [
"MIT"
] | 2 | 2021-10-07T02:22:59.000Z | 2021-11-05T00:31:17.000Z | import torch
import torch.nn as nn
from collections import namedtuple
USE_GPU = torch.cuda.is_available()
Modality_input = namedtuple("Modality_input", ["agentview", "eye_in_hand", "force", "proprio", "frontview"])
Modality_output = namedtuple("Modality_output", ["agentview_recon", "eye_in_hand_recon", "contact", 'p... | 38.363167 | 151 | 0.596303 | import torch
import torch.nn as nn
from collections import namedtuple
USE_GPU = torch.cuda.is_available()
Modality_input = namedtuple("Modality_input", ["agentview", "eye_in_hand", "force", "proprio", "frontview"])
Modality_output = namedtuple("Modality_output", ["agentview_recon", "eye_in_hand_recon", "contact", 'p... | true | true |
08fb03350d6c1fad3b0a98601cad7cf2c9ebab87 | 9,538 | py | Python | greentest/2.7pypy/test_socketserver.py | Eugeny/gevent | adb7b838ed66c13abe5059605730bb4b4531bbcd | [
"MIT"
] | 70 | 2015-08-04T09:39:43.000Z | 2021-09-04T23:28:39.000Z | greentest/2.7pypy/test_socketserver.py | Eugeny/gevent | adb7b838ed66c13abe5059605730bb4b4531bbcd | [
"MIT"
] | 8 | 2016-04-28T16:05:09.000Z | 2019-04-02T07:21:23.000Z | greentest/2.7pypy/test_socketserver.py | Eugeny/gevent | adb7b838ed66c13abe5059605730bb4b4531bbcd | [
"MIT"
] | 299 | 2015-01-23T10:06:24.000Z | 2022-02-02T06:34:51.000Z | """
Test suite for SocketServer.py.
"""
import contextlib
import imp
import os
import select
import signal
import socket
import tempfile
import unittest
import SocketServer
import test.test_support
from test.test_support import reap_children, reap_threads, verbose
try:
import threading
except ImportError:
thr... | 33.70318 | 76 | 0.572028 | """
Test suite for SocketServer.py.
"""
import contextlib
import imp
import os
import select
import signal
import socket
import tempfile
import unittest
import SocketServer
import test.test_support
from test.test_support import reap_children, reap_threads, verbose
try:
import threading
except ImportError:
thr... | false | true |
08fb03d0f296413a77a1e5cf70be72c68d9442fe | 2,868 | py | Python | chia/cmds/start_funcs.py | Flora-Network/chia-blockchain | f4da13dd7160de772ea5daa333984bed3882e84c | [
"Apache-2.0"
] | 35 | 2021-07-07T02:18:05.000Z | 2022-02-09T04:30:25.000Z | chia/cmds/start_funcs.py | Flora-Network/chia-blockchain | f4da13dd7160de772ea5daa333984bed3882e84c | [
"Apache-2.0"
] | 7 | 2021-07-09T17:37:46.000Z | 2021-09-11T17:17:38.000Z | chia/cmds/start_funcs.py | Flora-Network/chia-blockchain | f4da13dd7160de772ea5daa333984bed3882e84c | [
"Apache-2.0"
] | 12 | 2021-07-08T03:48:26.000Z | 2022-03-04T14:48:08.000Z | import asyncio
import os
import subprocess
import sys
from pathlib import Path
from typing import Optional
from chia.cmds.passphrase_funcs import get_current_passphrase
from chia.daemon.client import DaemonProxy, connect_to_daemon_and_validate
from chia.util.keychain import KeyringMaxUnlockAttempts
from chia.util.ser... | 34.142857 | 102 | 0.646792 | import asyncio
import os
import subprocess
import sys
from pathlib import Path
from typing import Optional
from chia.cmds.passphrase_funcs import get_current_passphrase
from chia.daemon.client import DaemonProxy, connect_to_daemon_and_validate
from chia.util.keychain import KeyringMaxUnlockAttempts
from chia.util.ser... | true | true |
08fb046f97b3617263cbc7b412473f46775c84d4 | 11,844 | py | Python | src/azure-cli/azure/cli/command_modules/batch/_help.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/batch/_help.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/batch/_help.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | 32.184783 | 527 | 0.732523 |
from knack.help_files import helps
helps['batch'] = """
type: group
short-summary: Manage Azure Batch.
"""
helps['batch account'] = """
type: group
short-summary: Manage Azure Batch accounts.
"""
helps['batch account autostorage-keys'] = """
type: group
short-summary: Manage the access keys for the auto storage ac... | true | true |
08fb058814c978626de6bd930fb4ec6acdcb2fb2 | 16,055 | py | Python | src/cltoolkit/features/__init__.py | cldf/cltoolkit | 10c2692bd5370d042fc70494a0b948fea8e6a58d | [
"MIT"
] | 2 | 2021-08-08T00:16:58.000Z | 2021-12-31T19:55:40.000Z | src/cltoolkit/features/__init__.py | cldf/cltoolkit | 10c2692bd5370d042fc70494a0b948fea8e6a58d | [
"MIT"
] | 6 | 2021-08-02T09:33:51.000Z | 2022-03-22T19:46:14.000Z | src/cltoolkit/features/__init__.py | cldf/cltoolkit | 10c2692bd5370d042fc70494a0b948fea8e6a58d | [
"MIT"
] | null | null | null | """
A feature is some aspect of language, e.g. the size of its phoneme inventory.
In `cltoolkit`, a :class:`Feature` is an object bundling some metadata with a python callable
accepting a :class:`cltoolkit.models.Language` instance as its sole argument, and returning the
value computed for this language.
A :class:`Fe... | 34.087049 | 98 | 0.520149 | from .collection import FeatureCollection, Feature
from . import phonology
from . import lexicon
from .reqs import requires
assert requires
FEATURES = FeatureCollection(Feature(**f) for f in [
{
"id": "ConsonantQualitySize",
"name": "consonant quality size",
"function": phonology.Inventory... | true | true |
08fb062dc0d9e5c44acb8d93f51b8b29f675f38d | 172 | py | Python | VotingSoftware/Core/wsgi.py | AbhijithGanesh/Django-Cassandra | 587ec7a97e9104ea6713120146ba899a8a6a441e | [
"BSD-3-Clause"
] | 1 | 2021-11-01T15:48:28.000Z | 2021-11-01T15:48:28.000Z | VotingSoftware/Core/wsgi.py | AbhijithGanesh/Django-Cassandra | 587ec7a97e9104ea6713120146ba899a8a6a441e | [
"BSD-3-Clause"
] | null | null | null | VotingSoftware/Core/wsgi.py | AbhijithGanesh/Django-Cassandra | 587ec7a97e9104ea6713120146ba899a8a6a441e | [
"BSD-3-Clause"
] | null | null | null | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Core.settings")
application = get_wsgi_application()
| 21.5 | 65 | 0.790698 | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Core.settings")
application = get_wsgi_application()
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.