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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74018d3156ab86966dbe83a24e7d5a8fb702f12 | 390 | py | Python | topologies/simple.py | murawaki/lexwave | d9dd7405def3e9df335c326adf51410cabf249fe | [
"BSD-2-Clause"
] | null | null | null | topologies/simple.py | murawaki/lexwave | d9dd7405def3e9df335c326adf51410cabf249fe | [
"BSD-2-Clause"
] | null | null | null | topologies/simple.py | murawaki/lexwave | d9dd7405def3e9df335c326adf51410cabf249fe | [
"BSD-2-Clause"
] | null | null | null | # simple
spec = {
'scale': 1.0,
'nodes': [ 'A', 'B', 'C', 'D' ],
'distances': [
['A', 'B', 1.5],
['A', 'C', 2.0],
['C', 'D', 2.0],
['A', 'D', 2.5],
],
'powers': {
'A': 1.0,
'B': 0.5,
'C': 4.0,
'D': 1.0,
},
'survival': 5.... | 17.727273 | 36 | 0.276923 |
spec = {
'scale': 1.0,
'nodes': [ 'A', 'B', 'C', 'D' ],
'distances': [
['A', 'B', 1.5],
['A', 'C', 2.0],
['C', 'D', 2.0],
['A', 'D', 2.5],
],
'powers': {
'A': 1.0,
'B': 0.5,
'C': 4.0,
'D': 1.0,
},
'survival': 5.0,
'... | true | true |
f7401928a20a0a7f8959204c0746a334093ad1c6 | 12,234 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/writesetfield.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/writesetfield.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/writesetfield.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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, p... | 25.434511 | 128 | 0.709825 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class WriteSetField(Base):
_SDM_NAME = 'writeSetField'
def __init__(self, parent):
super(WriteSetField, self).__init__(parent)
@property
def ArpDestinationHardwareAddress(self):
return se... | true | true |
f7401959cbd28c56cf672b1b547cbe391aa9ea26 | 2,272 | py | Python | platform-tools/systrace/catapult/telemetry/telemetry/internal/actions/play.py | nbasingh5/dragons | 7926c79f95b46ca1ff44617b1d8cdc633343774b | [
"MIT"
] | 4 | 2017-12-29T03:17:40.000Z | 2021-07-04T03:28:11.000Z | platform-tools/systrace/catapult/telemetry/telemetry/internal/actions/play.py | nbasingh5/dragons | 7926c79f95b46ca1ff44617b1d8cdc633343774b | [
"MIT"
] | 9 | 2017-09-10T19:49:04.000Z | 2018-04-14T04:39:55.000Z | platform-tools/systrace/catapult/telemetry/telemetry/internal/actions/play.py | nbasingh5/dragons | 7926c79f95b46ca1ff44617b1d8cdc633343774b | [
"MIT"
] | 6 | 2017-12-05T07:15:08.000Z | 2021-07-04T03:28:13.000Z | # Copyright 2013 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.
"""A Telemetry page_action that performs the "play" action on media elements.
Media elements can be specified by a selector argument. If no selector is
defi... | 44.54902 | 78 | 0.730194 |
from telemetry.core import exceptions
from telemetry.internal.actions import media_action
from telemetry.internal.actions import page_action
from telemetry.internal.actions import utils
class PlayAction(media_action.MediaAction):
def __init__(self, selector=None,
playing_event_timeout_in_seconds... | true | true |
f7401ab214037f44c41b92fc28764ecfe2ebaf77 | 1,980 | py | Python | .tox/scenario/lib/python2.7/site-packages/oslo_messaging/_drivers/zmq_driver/zmq_names.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | 1 | 2021-02-17T15:30:45.000Z | 2021-02-17T15:30:45.000Z | .tox/scenario/lib/python2.7/site-packages/oslo_messaging/_drivers/zmq_driver/zmq_names.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/oslo_messaging/_drivers/zmq_driver/zmq_names.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | 2 | 2015-11-03T03:21:55.000Z | 2015-12-01T08:56:14.000Z | # Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 28.285714 | 78 | 0.664646 |
from oslo_messaging._drivers.zmq_driver import zmq_async
zmq = zmq_async.import_zmq()
FIELD_TYPE = 'type'
FIELD_FAILURE = 'failure'
FIELD_REPLY = 'reply'
FIELD_LOG_FAILURE = 'log_failure'
FIELD_ID = 'id'
FIELD_MSG_ID = 'message_id'
FIELD_MSG_TYPE = 'msg_type'
FIELD_REPLY_ID = 'reply_id'
FIELD_TARGET = ... | true | true |
f7401ad0157b9589da75fd0dd36958522776b882 | 2,386 | py | Python | Calculator/training/dribble_exercise.py | ViliamVadocz/Bots | 092abc5bf92e9dab9d07499849d54a33b0b0c4f6 | [
"MIT"
] | null | null | null | Calculator/training/dribble_exercise.py | ViliamVadocz/Bots | 092abc5bf92e9dab9d07499849d54a33b0b0c4f6 | [
"MIT"
] | null | null | null | Calculator/training/dribble_exercise.py | ViliamVadocz/Bots | 092abc5bf92e9dab9d07499849d54a33b0b0c4f6 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from pathlib import Path
from math import pi
from dribble_grader import DribbleGrader
from rlbot.utils.game_state_util import GameState, BallState, CarState, Physics, Vector3, Rotator
from rlbot.matchconfig.match_config import Team, PlayerConfig
from rlbottraining.training_e... | 29.45679 | 106 | 0.615256 | from dataclasses import dataclass, field
from pathlib import Path
from math import pi
from dribble_grader import DribbleGrader
from rlbot.utils.game_state_util import GameState, BallState, CarState, Physics, Vector3, Rotator
from rlbot.matchconfig.match_config import Team, PlayerConfig
from rlbottraining.training_e... | true | true |
f7401b80ba6833f45899a67ce531cba12cd25f81 | 7,064 | py | Python | coralinedb/coralinedb.py | BOSS-Danuphan/coralinedb | 23458c82528ac7ceb78c17e23163d542ad96b79a | [
"MIT"
] | null | null | null | coralinedb/coralinedb.py | BOSS-Danuphan/coralinedb | 23458c82528ac7ceb78c17e23163d542ad96b79a | [
"MIT"
] | null | null | null | coralinedb/coralinedb.py | BOSS-Danuphan/coralinedb | 23458c82528ac7ceb78c17e23163d542ad96b79a | [
"MIT"
] | null | null | null | """
Coraline DB Manager - This will take care of reading and saving tables to SQL database
"""
# import python packages
import pandas as pd
import time
class BaseDB:
"""
Base class for all DB
These functions must be inherited by sub-class
- create_connection
- show_databases
-... | 28.59919 | 97 | 0.56795 |
import pandas as pd
import time
class BaseDB:
def __init__(self, host, username, passwd):
self.host = host
self.username = username
self.passwd = passwd
self.engines = {}
def __del__(self):
for en_key in self.engines:
engine = self.engines[en_key]
... | true | true |
f7401bf722cfe9fb53dc9fef57430501f74b5b48 | 3,305 | py | Python | scripts/req_packages.py | mvyskoc/odroid-games | fd8d4208dc2979d993dbbc7fc31bb2ec87519281 | [
"BSD-2-Clause"
] | null | null | null | scripts/req_packages.py | mvyskoc/odroid-games | fd8d4208dc2979d993dbbc7fc31bb2ec87519281 | [
"BSD-2-Clause"
] | null | null | null | scripts/req_packages.py | mvyskoc/odroid-games | fd8d4208dc2979d993dbbc7fc31bb2ec87519281 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
import subprocess
import os
import sys
import re
import argparse
RE_LDD_LIB=re.compile(r"\s*(.+?)(?:\s=>\s(.+?))?\s\((0x[0-9A-Fa-f]+)\)")
RE_DPKG=re.compile(r"(.+?)(?::(.+?))?:\s()(.+?)")
DEFAULT_EXCLUDE=[
'linux-vdso.so',
'libc.so',
'libpthread.so',
'libdl.so',
'ld-linux-x86-6... | 26.023622 | 75 | 0.588502 |
import subprocess
import os
import sys
import re
import argparse
RE_LDD_LIB=re.compile(r"\s*(.+?)(?:\s=>\s(.+?))?\s\((0x[0-9A-Fa-f]+)\)")
RE_DPKG=re.compile(r"(.+?)(?::(.+?))?:\s()(.+?)")
DEFAULT_EXCLUDE=[
'linux-vdso.so',
'libc.so',
'libpthread.so',
'libdl.so',
'ld-linux-x86-64.so',
'libm.... | true | true |
f7401c30fbb4e672b3b745052577d7fddb3b7ddb | 355 | py | Python | CAN24_AN/generate_test_cmd.py | yyuting/FastImageProcessing | c3ac272d3218cc4d30939f8219be70bc4125c4cc | [
"MIT"
] | null | null | null | CAN24_AN/generate_test_cmd.py | yyuting/FastImageProcessing | c3ac272d3218cc4d30939f8219be70bc4125c4cc | [
"MIT"
] | null | null | null | CAN24_AN/generate_test_cmd.py | yyuting/FastImageProcessing | c3ac272d3218cc4d30939f8219be70bc4125c4cc | [
"MIT"
] | null | null | null | import os
import sys
model_dirs_file = sys.argv[1]
example_cmd_file = sys.argv[2]
example_model = sys.argv[3]
out_file = sys.argv[4]
dirs = open(model_dirs_file).read().split('\n')
cmd = open(example_cmd_file).read()
str = ''
for dir in dirs:
new_cmd = cmd.replace(example_model, dir)
str += new_cmd + '\n'
... | 18.684211 | 47 | 0.678873 | import os
import sys
model_dirs_file = sys.argv[1]
example_cmd_file = sys.argv[2]
example_model = sys.argv[3]
out_file = sys.argv[4]
dirs = open(model_dirs_file).read().split('\n')
cmd = open(example_cmd_file).read()
str = ''
for dir in dirs:
new_cmd = cmd.replace(example_model, dir)
str += new_cmd + '\n'
... | true | true |
f7401c5e554aa8907279fe87ac5a8e9a7716be30 | 494 | py | Python | Instructor/migrations/0003_alter_rubric_name.py | Bwc9876/CodeReview | 1142757054508aafdf57e48ea9b17af528df0ca9 | [
"MIT"
] | null | null | null | Instructor/migrations/0003_alter_rubric_name.py | Bwc9876/CodeReview | 1142757054508aafdf57e48ea9b17af528df0ca9 | [
"MIT"
] | 109 | 2021-10-10T02:51:39.000Z | 2022-03-21T17:58:43.000Z | Instructor/migrations/0003_alter_rubric_name.py | Bwc9876/CodeReview | 1142757054508aafdf57e48ea9b17af528df0ca9 | [
"MIT"
] | 1 | 2021-09-18T12:49:25.000Z | 2021-09-18T12:49:25.000Z | # Generated by Django 4.0 on 2021-12-17 12:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Instructor', '0002_initial'),
]
operations = [
migrations.AlterField(
model_name='rubric',
name='name',
fie... | 26 | 120 | 0.582996 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Instructor', '0002_initial'),
]
operations = [
migrations.AlterField(
model_name='rubric',
name='name',
field=models.CharField(help_text='The name the s... | true | true |
f7401d00988b81bc765ee9ecd638b09f72d4f9b2 | 5,673 | py | Python | saleor/graphql/checkout/dataloaders.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 1 | 2021-05-29T10:50:52.000Z | 2021-05-29T10:50:52.000Z | saleor/graphql/checkout/dataloaders.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 19 | 2022-02-21T04:34:12.000Z | 2022-03-28T04:55:08.000Z | saleor/graphql/checkout/dataloaders.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | null | null | null | from collections import defaultdict
from django.db.models import F
from promise import Promise
from ...checkout import CheckoutLineInfo
from ...checkout.models import Checkout, CheckoutLine
from ..core.dataloaders import DataLoader
from ..product.dataloaders import (
CollectionsByVariantIdLoader,
ProductByVar... | 38.856164 | 86 | 0.641636 | from collections import defaultdict
from django.db.models import F
from promise import Promise
from ...checkout import CheckoutLineInfo
from ...checkout.models import Checkout, CheckoutLine
from ..core.dataloaders import DataLoader
from ..product.dataloaders import (
CollectionsByVariantIdLoader,
ProductByVar... | true | true |
f7401d1d1d3b0bb1192c078b79cc44e4cbce7cdd | 7,266 | py | Python | pkgcheck/messages.py | pombredanne/github.com-FFY00-pkgcheck | 72e82bbdfd13c7f4350cf8307fe9fad1a3e5313c | [
"Apache-2.0"
] | 4 | 2020-06-08T21:35:29.000Z | 2020-06-09T02:01:54.000Z | pkgcheck/messages.py | pombredanne/github.com-FFY00-pkgcheck | 72e82bbdfd13c7f4350cf8307fe9fad1a3e5313c | [
"Apache-2.0"
] | null | null | null | pkgcheck/messages.py | pombredanne/github.com-FFY00-pkgcheck | 72e82bbdfd13c7f4350cf8307fe9fad1a3e5313c | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 28.948207 | 75 | 0.547894 |
import re
import textwrap
class _Message(object):
def __init__(self, msg_id, msg_str, long_msg, default):
self.msg_id = msg_id
self.msg_str = msg_str
if long_msg:
self.long_msg = textwrap.dedent(long_msg)
self.long_msg = self.long_msg.strip()
... | true | true |
f7401e2c5de243047befee1e90edef26b39ddcb4 | 597 | py | Python | students/K33402/Dubina Sergey/laboratory_works/lab3/ray_system/api/migrations/0002_application_user.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 4 | 2020-09-03T15:41:42.000Z | 2021-12-24T15:28:20.000Z | students/K33402/Dubina Sergey/laboratory_works/lab3/ray_system/api/migrations/0002_application_user.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 48 | 2020-09-13T20:22:42.000Z | 2021-04-30T11:13:30.000Z | students/K33402/Dubina Sergey/laboratory_works/lab3/ray_system/api/migrations/0002_application_user.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 69 | 2020-09-06T10:32:37.000Z | 2021-11-28T18:13:17.000Z | # Generated by Django 3.1.1 on 2020-12-07 14:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('api', '0001_i... | 27.136364 | 122 | 0.646566 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('api', '0001_initial'),
]
operations = [
... | true | true |
f7401e9c5378d9c1a65971c432bd7365b3709b53 | 8,313 | py | Python | webexteamssdk/api/webhooks.py | fracaen/webexteamssdk | 673312779b8e05cf0535bea8b96599015cccbff1 | [
"MIT"
] | 118 | 2018-09-13T18:06:34.000Z | 2022-03-30T05:16:36.000Z | webexteamssdk/api/webhooks.py | fracaen/webexteamssdk | 673312779b8e05cf0535bea8b96599015cccbff1 | [
"MIT"
] | 88 | 2018-10-08T21:57:02.000Z | 2022-02-26T06:33:33.000Z | webexteamssdk/api/webhooks.py | fracaen/webexteamssdk | 673312779b8e05cf0535bea8b96599015cccbff1 | [
"MIT"
] | 86 | 2018-09-10T09:42:01.000Z | 2022-03-30T05:38:14.000Z | # -*- coding: utf-8 -*-
"""Webex Teams Webhooks API wrapper.
Copyright (c) 2016-2020 Cisco and/or its affiliates.
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 wi... | 34.6375 | 79 | 0.657284 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
from builtins import *
from past.builtins import basestring
from ..generator_containers import generator_container
from ..restsession import RestSession
from ..utils import (
check_type,
dict_from_items... | true | true |
f7401f339b72c81904cabe484d881d448b5616cb | 243 | py | Python | satchmo/apps/product/urls/category.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/product/urls/category.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/product/urls/category.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import *
urlpatterns = patterns('product.views',
(r'^(?P<parent_slugs>([-\w]+/)*)?(?P<slug>[-\w]+)/$',
'category_view', {}, 'satchmo_category'),
(r'^$', 'category_index', {}, 'satchmo_category_index'),
)
| 30.375 | 60 | 0.584362 | from django.conf.urls import *
urlpatterns = patterns('product.views',
(r'^(?P<parent_slugs>([-\w]+/)*)?(?P<slug>[-\w]+)/$',
'category_view', {}, 'satchmo_category'),
(r'^$', 'category_index', {}, 'satchmo_category_index'),
)
| true | true |
f7401f3a90b7d337b5f2bdd451f0b32ef04bfb62 | 7,805 | py | Python | app/contracts/views.py | snakrani/discovery | 99690f186a194cabef6a5d1ad18fca715be1e187 | [
"CC0-1.0"
] | null | null | null | app/contracts/views.py | snakrani/discovery | 99690f186a194cabef6a5d1ad18fca715be1e187 | [
"CC0-1.0"
] | null | null | null | app/contracts/views.py | snakrani/discovery | 99690f186a194cabef6a5d1ad18fca715be1e187 | [
"CC0-1.0"
] | null | null | null | from titlecase import titlecase
from django.conf import settings
from django.db.models import Q
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from discovery.csv import get_memberships, get_membersh... | 36.643192 | 273 | 0.604741 | from titlecase import titlecase
from django.conf import settings
from django.db.models import Q
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from discovery.csv import get_memberships, get_membersh... | true | true |
f7402034fef36db00b5434638301139eb4e9eb78 | 4,849 | py | Python | pgoapi/protos/POGOProtos/Networking/Requests/Messages/DownloadRemoteConfigVersionMessage_pb2.py | PogoHop/pgoapi-hsvr | b5761159e0240bbb81ef6c257fe2eb1bc1ce2d47 | [
"MIT"
] | null | null | null | pgoapi/protos/POGOProtos/Networking/Requests/Messages/DownloadRemoteConfigVersionMessage_pb2.py | PogoHop/pgoapi-hsvr | b5761159e0240bbb81ef6c257fe2eb1bc1ce2d47 | [
"MIT"
] | null | null | null | pgoapi/protos/POGOProtos/Networking/Requests/Messages/DownloadRemoteConfigVersionMessage_pb2.py | PogoHop/pgoapi-hsvr | b5761159e0240bbb81ef6c257fe2eb1bc1ce2d47 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/DownloadRemoteConfigVersionMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf im... | 48.009901 | 503 | 0.775211 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from... | true | true |
f7402105f9ac5429b9a3e1a34609ee9734cab3c9 | 7,321 | py | Python | django_thumbs/tests.py | rrmerugu/django-thumbs | 699691e3b767af9510b3f2bea64321ff6df5444d | [
"BSD-3-Clause"
] | 4 | 2018-08-12T21:01:38.000Z | 2021-07-12T13:39:22.000Z | django_thumbs/tests.py | rrmerugu/django-thumbs | 699691e3b767af9510b3f2bea64321ff6df5444d | [
"BSD-3-Clause"
] | null | null | null | django_thumbs/tests.py | rrmerugu/django-thumbs | 699691e3b767af9510b3f2bea64321ff6df5444d | [
"BSD-3-Clause"
] | 3 | 2019-03-30T19:19:01.000Z | 2019-11-05T17:15:20.000Z | from django.test import TestCase
from thumbs.fields import validate_size, split_original, determine_thumb, \
sting2tuple
from thumbs.fields import SizeError, OriginalError
import logging
logger = logging.getLogger(__name__)
try:
from PIL import Image, ImageOps
except ImportError:
import Image
import ... | 36.788945 | 77 | 0.613168 | from django.test import TestCase
from thumbs.fields import validate_size, split_original, determine_thumb, \
sting2tuple
from thumbs.fields import SizeError, OriginalError
import logging
logger = logging.getLogger(__name__)
try:
from PIL import Image, ImageOps
except ImportError:
import Image
import ... | true | true |
f7402167707e8e4e7b41d76b3f8b03691a0c33c9 | 4,837 | py | Python | documentation/test_python/test_layout.py | 0rganizers/m.css | 298e425b3659689c777623040b6a9c93196dc265 | [
"MIT"
] | null | null | null | documentation/test_python/test_layout.py | 0rganizers/m.css | 298e425b3659689c777623040b6a9c93196dc265 | [
"MIT"
] | null | null | null | documentation/test_python/test_layout.py | 0rganizers/m.css | 298e425b3659689c777623040b6a9c93196dc265 | [
"MIT"
] | null | null | null | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz>
#
# 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 Softwar... | 46.509615 | 143 | 0.645855 |
import os
from _search import searchdata_format_version, searchdata_filename, searchdata_filename_b85
from . import BaseTestCase
class Layout(BaseTestCase):
def test(self):
self.run_python({
'PROJECT_TITLE': "A project",
'PROJECT_SUBTITLE': "is cool",
... | true | true |
f74021d156f4b83ec95ab5c157c869eb7958eb2b | 640 | py | Python | tests/modules/contrib/test_kernel.py | spxtr/bumblebee-status | 45125f39af8323775aeabf809ae5ae80cfe3ccd9 | [
"MIT"
] | 1,089 | 2016-11-06T10:02:53.000Z | 2022-03-26T12:53:30.000Z | tests/modules/contrib/test_kernel.py | spxtr/bumblebee-status | 45125f39af8323775aeabf809ae5ae80cfe3ccd9 | [
"MIT"
] | 817 | 2016-11-05T05:42:39.000Z | 2022-03-25T19:43:52.000Z | tests/modules/contrib/test_kernel.py | spxtr/bumblebee-status | 45125f39af8323775aeabf809ae5ae80cfe3ccd9 | [
"MIT"
] | 317 | 2016-11-05T00:35:06.000Z | 2022-03-24T13:35:03.000Z | import pytest
import core.config
import modules.contrib.kernel
@pytest.fixture
def some_kernel():
return "this-is-my-kernel"
@pytest.fixture
def kernel_module():
return modules.contrib.kernel.Module(config=core.config.Config([]), theme=None)
def test_full_text(mocker, kernel_module):
platform = mocke... | 22.068966 | 83 | 0.751563 | import pytest
import core.config
import modules.contrib.kernel
@pytest.fixture
def some_kernel():
return "this-is-my-kernel"
@pytest.fixture
def kernel_module():
return modules.contrib.kernel.Module(config=core.config.Config([]), theme=None)
def test_full_text(mocker, kernel_module):
platform = mocke... | true | true |
f74022324b96061fef1b4f9109c43010dcae4e92 | 4,498 | py | Python | tests/extension/thread_/stream_source_join/thread_stream_source_join.py | Pyverilog/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | tests/extension/thread_/stream_source_join/thread_stream_source_join.py | Pyverilog/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | tests/extension/thread_/stream_source_join/thread_stream_source_join.py | shtaxxx/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... | 27.765432 | 79 | 0.599155 | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import veriloggen.thread as vthread
import veriloggen.type... | true | true |
f74022bbebef1483634791b541f215d97a74f4eb | 622 | py | Python | predict_rub_salary.py | NecrOctopuS/programmer_job_analysis | ead971ed5f6eabd85c5f3d75c63c95bdc1e2c5a8 | [
"MIT"
] | null | null | null | predict_rub_salary.py | NecrOctopuS/programmer_job_analysis | ead971ed5f6eabd85c5f3d75c63c95bdc1e2c5a8 | [
"MIT"
] | null | null | null | predict_rub_salary.py | NecrOctopuS/programmer_job_analysis | ead971ed5f6eabd85c5f3d75c63c95bdc1e2c5a8 | [
"MIT"
] | null | null | null | DOLLARS_TO_RUBLES = 65
EUROS_TO_RUBLES = 71
def predict_rub_salary(lower_salary, upper_salary, currency):
if lower_salary and upper_salary:
middle_salary = (lower_salary + upper_salary)/2
elif lower_salary:
middle_salary = lower_salary * 1.2
elif upper_salary:
middle_salary = upper... | 28.272727 | 61 | 0.667203 | DOLLARS_TO_RUBLES = 65
EUROS_TO_RUBLES = 71
def predict_rub_salary(lower_salary, upper_salary, currency):
if lower_salary and upper_salary:
middle_salary = (lower_salary + upper_salary)/2
elif lower_salary:
middle_salary = lower_salary * 1.2
elif upper_salary:
middle_salary = upper... | true | true |
f740231ee40761657758df68c06a446b08eba023 | 1,309 | py | Python | examples/quickstart_async.py | SGeetansh/dffml | 04647bdcadef2f7e7b59cdd8ac1e89f17ef1095b | [
"MIT"
] | 3 | 2021-03-08T18:41:21.000Z | 2021-06-05T20:15:14.000Z | examples/quickstart_async.py | yashlamba/dffml | d309db8503ab3c29fcd99b96479c24b2fdd4d200 | [
"MIT"
] | 24 | 2020-05-20T23:29:57.000Z | 2021-04-14T04:18:21.000Z | examples/quickstart_async.py | yashlamba/dffml | d309db8503ab3c29fcd99b96479c24b2fdd4d200 | [
"MIT"
] | 1 | 2021-04-19T23:58:26.000Z | 2021-04-19T23:58:26.000Z | import asyncio
from dffml import train, accuracy, predict, Features, Feature
from dffml_model_scikit import LinearRegressionModel
async def main():
model = LinearRegressionModel(
features=Features(
Feature("Years", int, 1),
Feature("Expertise", int, 1),
Feature("Trust"... | 27.270833 | 70 | 0.5233 | import asyncio
from dffml import train, accuracy, predict, Features, Feature
from dffml_model_scikit import LinearRegressionModel
async def main():
model = LinearRegressionModel(
features=Features(
Feature("Years", int, 1),
Feature("Expertise", int, 1),
Feature("Trust"... | true | true |
f740234768f31aacb6299b5af19f8682c8f84b46 | 2,313 | py | Python | examples/hodgkinhuxley.py | yonesuke/prax | 6957776b11c297d4463fba6d15cd06671dfbd45f | [
"MIT"
] | null | null | null | examples/hodgkinhuxley.py | yonesuke/prax | 6957776b11c297d4463fba6d15cd06671dfbd45f | [
"MIT"
] | null | null | null | examples/hodgkinhuxley.py | yonesuke/prax | 6957776b11c297d4463fba6d15cd06671dfbd45f | [
"MIT"
] | null | null | null | import jax.numpy as jnp
from prax import Oscillator
from jax.config import config; config.update("jax_enable_x64", True)
import matplotlib.pyplot as plt
class HodgkinHuxley(Oscillator):
def __init__(self, input_current, C=1.0, G_Na=120.0, G_K=36.0, G_L=0.3, E_Na=50.0, E_K=-77.0, E_L=-54.4, dt=0.01, eps=10**-5):
... | 30.038961 | 145 | 0.591007 | import jax.numpy as jnp
from prax import Oscillator
from jax.config import config; config.update("jax_enable_x64", True)
import matplotlib.pyplot as plt
class HodgkinHuxley(Oscillator):
def __init__(self, input_current, C=1.0, G_Na=120.0, G_K=36.0, G_L=0.3, E_Na=50.0, E_K=-77.0, E_L=-54.4, dt=0.01, eps=10**-5):
... | true | true |
f7402441c98e12bfd89f226ed254422ac0373687 | 2,924 | py | Python | social_auth/backends/contrib/dailymotion.py | Sponsorcraft/django-social-auth | 093fde0b8aed9875ce077364ec368cbd3d7a8c7c | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 3 | 2015-05-18T13:51:29.000Z | 2015-05-18T14:39:08.000Z | social_auth/backends/contrib/dailymotion.py | gugu/django-social-auth-1 | e47512f568b7dc7d247d0f667d8ef34972beb1d1 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | social_auth/backends/contrib/dailymotion.py | gugu/django-social-auth-1 | e47512f568b7dc7d247d0f667d8ef34972beb1d1 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | """
Dailymotion OAuth2 support.
This adds support for Dailymotion OAuth service. An application must
be registered first on dailymotion and the settings DAILYMOTION_CONSUMER_KEY
and DAILYMOTION_CONSUMER_SECRET must be defined with the corresponding
values.
User screen name is used to generate username.
By default ac... | 34.809524 | 78 | 0.72606 | from urllib2 import HTTPError
from django.utils import simplejson
from social_auth.utils import dsa_urlopen
from social_auth.backends import BaseOAuth2
from social_auth.backends import SocialAuthBackend
from social_auth.exceptions import AuthCanceled
DAILYMOTION_SERVER = 'api.dailymotion.com'
DAILYMOTION_REQUEST_T... | true | true |
f74026356879c2c78651f4b68513a4d0d5ff04e5 | 1,162 | py | Python | src/slave/preprocess.py | emanuelibiapino/micro_cluster | 42ecf3d50aea1e8ec70d3782cac3e440ea08194c | [
"MIT"
] | null | null | null | src/slave/preprocess.py | emanuelibiapino/micro_cluster | 42ecf3d50aea1e8ec70d3782cac3e440ea08194c | [
"MIT"
] | null | null | null | src/slave/preprocess.py | emanuelibiapino/micro_cluster | 42ecf3d50aea1e8ec70d3782cac3e440ea08194c | [
"MIT"
] | null | null | null | from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk import RegexpTokenizer
import re
def regex_clean_ruidos(text):
'''
função manual para eliminação de ruídos através de regex, descartar qualquer coisa
que na composição possua uma 'não letra', como símbolos e núme... | 25.26087 | 95 | 0.629948 | from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk import RegexpTokenizer
import re
def regex_clean_ruidos(text):
return ' '.join([
t for t in text.strip().split() if re.match(r'[^\W\d]*$', t)
])
def regex_clean(text):
return regex_clean_ruidos(
' '.jo... | true | true |
f740264d9f938f8fa3775e0f9dd3d52f62ad9885 | 1,810 | py | Python | umm-python/app/web/rest/task_step_api.py | suomitek/cubeai | cc4c0f5f445a552d239910da63944307c1f06e37 | [
"Apache-2.0"
] | null | null | null | umm-python/app/web/rest/task_step_api.py | suomitek/cubeai | cc4c0f5f445a552d239910da63944307c1f06e37 | [
"Apache-2.0"
] | null | null | null | umm-python/app/web/rest/task_step_api.py | suomitek/cubeai | cc4c0f5f445a552d239910da63944307c1f06e37 | [
"Apache-2.0"
] | null | null | null | import tornado.web
from app.domain.task_step import TaskStep
from app.service import token_service
from app.database import task_step_db
from app.utils import mytime
import json
class TaskStepApi(tornado.web.RequestHandler):
async def post(self, *args, **kwargs):
token = token_service.get_token(self.requ... | 31.754386 | 121 | 0.640884 | import tornado.web
from app.domain.task_step import TaskStep
from app.service import token_service
from app.database import task_step_db
from app.utils import mytime
import json
class TaskStepApi(tornado.web.RequestHandler):
async def post(self, *args, **kwargs):
token = token_service.get_token(self.requ... | true | true |
f7402800d6e71d8a4bc10bfbe970233f01d441b7 | 4,159 | py | Python | rlcard/agents/human_agents/gin_rummy_human_agent/gui_gin_rummy/info_messaging.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 1,735 | 2019-09-05T12:49:43.000Z | 2022-03-30T12:02:07.000Z | rlcard/agents/human_agents/gin_rummy_human_agent/gui_gin_rummy/info_messaging.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 197 | 2019-09-14T05:59:02.000Z | 2022-03-03T19:21:19.000Z | rlcard/agents/human_agents/gin_rummy_human_agent/gui_gin_rummy/info_messaging.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 476 | 2019-09-13T15:25:32.000Z | 2022-03-29T01:41:29.000Z | '''
Project: Gui Gin Rummy
File name: info_messaging.py
Author: William Hale
Date created: 3/28/2020
'''
# from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .game_canvas import GameCanvas
from typing import List
import rlcard.games.gin_rummy.utils.utils as... | 41.178218 | 119 | 0.683337 |
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .game_canvas import GameCanvas
from typing import List
import rlcard.games.gin_rummy.utils.utils as gin_rummy_utils
from rlcard.games.gin_rummy.utils.thinker import Thinker
from .canvas_item import CardItem
from . import configurations
def blank_info_me... | true | true |
f7402975bd914baa7f2848760975ead90431866c | 828 | py | Python | core/migrations/0002_auto_20150126_1611.py | Siikakala/kompassi | 14cdcd966ab689d762cc885e28b6d15465c216f0 | [
"CC-BY-3.0"
] | null | null | null | core/migrations/0002_auto_20150126_1611.py | Siikakala/kompassi | 14cdcd966ab689d762cc885e28b6d15465c216f0 | [
"CC-BY-3.0"
] | null | null | null | core/migrations/0002_auto_20150126_1611.py | Siikakala/kompassi | 14cdcd966ab689d762cc885e28b6d15465c216f0 | [
"CC-BY-3.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='event',
name='logo_url',
field=models.CharField(defau... | 31.846154 | 205 | 0.629227 |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='event',
name='logo_url',
field=models.CharField(default='', help_text='Voi o... | true | true |
f74029b99cc5c0c5e9408397c6c1419bb1809903 | 13,570 | py | Python | samtranslator/plugins/globals/globals.py | oltruong/serverless-application-model | f6a3c5140c85f53bfcc2c7a7494b74f9f302580b | [
"Apache-2.0"
] | 2 | 2019-06-04T02:05:28.000Z | 2019-06-16T14:17:08.000Z | samtranslator/plugins/globals/globals.py | oltruong/serverless-application-model | f6a3c5140c85f53bfcc2c7a7494b74f9f302580b | [
"Apache-2.0"
] | 4 | 2021-05-12T00:13:20.000Z | 2022-03-12T00:56:07.000Z | samtranslator/plugins/globals/globals.py | oltruong/serverless-application-model | f6a3c5140c85f53bfcc2c7a7494b74f9f302580b | [
"Apache-2.0"
] | 15 | 2019-05-27T01:04:30.000Z | 2021-10-01T05:54:45.000Z | from samtranslator.public.sdk.resource import SamResourceType
from samtranslator.public.intrinsics import is_intrinsics
class Globals(object):
"""
Class to parse and process Globals section in SAM template. If a property is specified at Global section for
say Function, then this class will add it to each... | 33.259804 | 120 | 0.608327 | from samtranslator.public.sdk.resource import SamResourceType
from samtranslator.public.intrinsics import is_intrinsics
class Globals(object):
"""
Class to parse and process Globals section in SAM template. If a property is specified at Global section for
say Function, then this class will add it to each... | false | true |
f74029e0841e139c562e14d2f486103d2f9ffb47 | 12,070 | py | Python | PC/application_pc.py | LukiBa/zybo_face | 5f229818727b65ffa82efee2f63522234364fbe2 | [
"MIT"
] | null | null | null | PC/application_pc.py | LukiBa/zybo_face | 5f229818727b65ffa82efee2f63522234364fbe2 | [
"MIT"
] | null | null | null | PC/application_pc.py | LukiBa/zybo_face | 5f229818727b65ffa82efee2f63522234364fbe2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 1 18:09:27 2021
@author: lukas
"""
import cv2
import dlib
import numpy as np
import timeit
import utils
import queue
import multiprocessing
import pathlib
import argparse
import time
def _create_parser():
parser = argparse.ArgumentParser()
parser.add_argument(... | 40.099668 | 124 | 0.599171 |
import cv2
import dlib
import numpy as np
import timeit
import utils
import queue
import multiprocessing
import pathlib
import argparse
import time
def _create_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--descriptor_file', type=str,
default='./saved_descriptors... | true | true |
f7402a374775523fcf6b679ffe30baedc1452878 | 6,346 | py | Python | model-optimizer/mo/middle/passes/fusing/fuse_grouped_conv.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | null | null | null | model-optimizer/mo/middle/passes/fusing/fuse_grouped_conv.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 19 | 2021-03-26T08:11:00.000Z | 2022-02-21T13:06:26.000Z | model-optimizer/mo/middle/passes/fusing/fuse_grouped_conv.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 1 | 2021-07-28T17:30:46.000Z | 2021-07-28T17:30:46.000Z | """
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 38.695122 | 131 | 0.624961 |
import logging as log
import numpy as np
from mo.graph.graph import Node, Graph
from mo.middle.passes.fusing.helpers import get_next_operation
def concat_convolutions(graph: Graph, start_node: Node, last_node: Node):
conv_nodes = get_next_operation(start_node)
assert len(conv_nodes) == len(last_node... | true | true |
f7402ce7bceafcfe00e36b1c5ee9e7caf9c33bcf | 7,558 | bzl | Python | bazel/google_cloud_cpp_deps.bzl | cojenco/google-cloud-cpp | 1f61ce44c9e757421835e6085b04f6f4150f7b37 | [
"Apache-2.0"
] | null | null | null | bazel/google_cloud_cpp_deps.bzl | cojenco/google-cloud-cpp | 1f61ce44c9e757421835e6085b04f6f4150f7b37 | [
"Apache-2.0"
] | null | null | null | bazel/google_cloud_cpp_deps.bzl | cojenco/google-cloud-cpp | 1f61ce44c9e757421835e6085b04f6f4150f7b37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 43.188571 | 116 | 0.648055 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
def google_cloud_cpp_deps():
if "rules_cc" not in native.existing_rules():
http_archive(
name = "rules_cc",
strip_prefix = "rules_cc-daf6ace7cfeacd6a83e9ff2ed659f416537b6c74",
... | true | true |
f7402cf3af2ad2ecefafc8b421c17a5c4dee05e7 | 839 | py | Python | my_happy_python_utils/path_utils.py | ggservice007/my-happy-python-utils | 146cee791447339f72a153b941d4cd4be5697025 | [
"Apache-2.0"
] | null | null | null | my_happy_python_utils/path_utils.py | ggservice007/my-happy-python-utils | 146cee791447339f72a153b941d4cd4be5697025 | [
"Apache-2.0"
] | null | null | null | my_happy_python_utils/path_utils.py | ggservice007/my-happy-python-utils | 146cee791447339f72a153b941d4cd4be5697025 | [
"Apache-2.0"
] | null | null | null | import os, sys, inspect
import subprocess
from . import version
__version__ = version.get_current()
def get_current_dir_for_jupyter():
"""Get the current path for jupyter"""
return getCurrentDir(os.getcwd())
def get_current_dir(current_file):
"""Get the current path"""
current_dir = os.path.dirna... | 20.975 | 47 | 0.713945 | import os, sys, inspect
import subprocess
from . import version
__version__ = version.get_current()
def get_current_dir_for_jupyter():
return getCurrentDir(os.getcwd())
def get_current_dir(current_file):
current_dir = os.path.dirname(current_file)
return current_dir
def get_parent_dir(current_file... | true | true |
f7402d4e8430b166f3b0d7c27628f39303c4a186 | 3,738 | py | Python | lib/utils/utils.py | tasx0823/BBN | bd477907482774970eafac3c24dbf83bddae27ff | [
"MIT"
] | 620 | 2019-12-04T09:09:22.000Z | 2022-03-22T08:46:27.000Z | lib/utils/utils.py | ChenAnno/BBN | 7992e908842f5934f0d1ee3f430d796621e81975 | [
"MIT"
] | 30 | 2019-12-21T11:07:59.000Z | 2022-03-12T00:19:08.000Z | lib/utils/utils.py | ChenAnno/BBN | 7992e908842f5934f0d1ee3f430d796621e81975 | [
"MIT"
] | 98 | 2019-12-10T06:41:35.000Z | 2022-03-21T12:51:19.000Z | import logging
import time
import os
import torch
from utils.lr_scheduler import WarmupMultiStepLR
from net import Network
def create_logger(cfg):
dataset = cfg.DATASET.DATASET
net_type = cfg.BACKBONE.TYPE
module_type = cfg.MODULE.TYPE
log_dir = os.path.join(cfg.OUTPUT_DIR, cfg.NAME, "lo... | 33.375 | 102 | 0.603799 | import logging
import time
import os
import torch
from utils.lr_scheduler import WarmupMultiStepLR
from net import Network
def create_logger(cfg):
dataset = cfg.DATASET.DATASET
net_type = cfg.BACKBONE.TYPE
module_type = cfg.MODULE.TYPE
log_dir = os.path.join(cfg.OUTPUT_DIR, cfg.NAME, "lo... | true | true |
f7402d64f3089e887964b8fdd46515d789bb343e | 1,093 | py | Python | parallel-nn/distributed/dist.py | AbsoluteStratos/blog-code | 3a8e308d55931b053b8a47268c52d62e0fa16bd8 | [
"MIT"
] | 2 | 2021-07-30T10:04:18.000Z | 2022-01-30T18:29:30.000Z | parallel-nn/distributed/dist.py | AbsoluteStratos/blog-code | 3a8e308d55931b053b8a47268c52d62e0fa16bd8 | [
"MIT"
] | 1 | 2021-10-17T20:08:41.000Z | 2021-10-17T20:08:41.000Z | parallel-nn/distributed/dist.py | AbsoluteStratos/blog-code | 3a8e308d55931b053b8a47268c52d62e0fa16bd8 | [
"MIT"
] | 2 | 2021-07-30T10:04:20.000Z | 2021-09-01T00:07:14.000Z | '''
Learning How To Train Neural Networks in Parallel (The Right Way)
===
Author: Nicholas Geneva (MIT Liscense)
url: https://nicholasgeneva.com/blog/
github: https://github.com/NickGeneva/blog-code
===
'''
from abc import abstractmethod
class Distributed(object):
"""Parent class for distributed comm methods
... | 24.840909 | 84 | 0.680695 | from abc import abstractmethod
class Distributed(object):
@property
def size(self):
return 1
@property
def rank(self):
return 0
@property
def comm(self):
return None
@property
def name(self):
return ""
@abstractmethod
def barrier(self):
... | true | true |
f7402de6b06503d2e9a555967b8a67041880ae08 | 409 | py | Python | Python/employee directory.py | BlackTimber-Labs/DemoPr | 6495b5307323ce17be5071006f1de90a1120edf4 | [
"MIT"
] | 10 | 2021-10-01T15:11:27.000Z | 2021-10-03T10:41:36.000Z | Python/employee directory.py | BlackTimber-Labs/DemoPr | 6495b5307323ce17be5071006f1de90a1120edf4 | [
"MIT"
] | 102 | 2021-10-01T14:49:50.000Z | 2021-10-31T17:30:15.000Z | Python/employee directory.py | BlackTimber-Labs/DemoPr | 6495b5307323ce17be5071006f1de90a1120edf4 | [
"MIT"
] | 88 | 2021-10-01T14:28:10.000Z | 2021-10-31T12:02:42.000Z | #Program to find the phone number of an employee
phone=dict()
i=1
n=int(input("Enter the no. of entries:"))
while i<=n:
a=input("Enter the phone number:")
b=input("Enter name:")
phone[b]=a
i=i+1
l=phone.keys()
x=input("Enter the name to be searched:")
for i in l:
if i==x:
print(... | 21.526316 | 49 | 0.584352 |
phone=dict()
i=1
n=int(input("Enter the no. of entries:"))
while i<=n:
a=input("Enter the phone number:")
b=input("Enter name:")
phone[b]=a
i=i+1
l=phone.keys()
x=input("Enter the name to be searched:")
for i in l:
if i==x:
print(x,"phone number:",phone[i])
break
else:... | true | true |
f7402efbd4b32c2c99085a9c25781dc63017b65b | 100 | py | Python | include/tclap-1.4.0-rc1/tests/test74.py | SpaceKatt/cpp-cli-poc | 02ffefea2fc6e999fa2b27d08a8b3be6830b1b97 | [
"BSL-1.0"
] | 62 | 2021-09-21T18:58:02.000Z | 2022-03-07T02:17:43.000Z | third_party/tclap-1.4.0-rc1/tests/test74.py | Vertexwahn/FlatlandRT | 37d09fde38b25eff5f802200b43628efbd1e3198 | [
"Apache-2.0"
] | null | null | null | third_party/tclap-1.4.0-rc1/tests/test74.py | Vertexwahn/FlatlandRT | 37d09fde38b25eff5f802200b43628efbd1e3198 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import simple_test
simple_test.test("test20", ["-a", "-b", ], expect_fail=True)
| 16.666667 | 60 | 0.67 |
import simple_test
simple_test.test("test20", ["-a", "-b", ], expect_fail=True)
| true | true |
f7402f69eab70dc018d8e937e8665ca9c99debb4 | 20,941 | py | Python | TMProcessing/tm_splitter.py | USPTO/TrademarkPublicData | f1b333502dea7249c2ad12fb0c9bae3f7c1f8206 | [
"CC0-1.0"
] | 20 | 2017-10-14T14:10:22.000Z | 2021-09-06T22:11:09.000Z | TMProcessing/tm_splitter.py | USPTO/TrademarkPublicData | f1b333502dea7249c2ad12fb0c9bae3f7c1f8206 | [
"CC0-1.0"
] | 2 | 2018-10-23T14:25:35.000Z | 2020-01-20T22:28:36.000Z | TMProcessing/tm_splitter.py | USPTO/TrademarkPublicData | f1b333502dea7249c2ad12fb0c9bae3f7c1f8206 | [
"CC0-1.0"
] | 7 | 2018-01-04T18:53:18.000Z | 2021-01-06T11:33:15.000Z | #!/usr/bin/python3
# tm_splitter.py by Michael Henderson
# Split individual TM files from a bulk downloaded XML file containing an aggregation of TMs
# Write out a separate XML files and Solr ready XML file for each TM
import os
import re
import sys
import getopt
import xml.dom.minidom
def main(argv):
#de... | 40.426641 | 393 | 0.598825 |
import os
import re
import sys
import getopt
import xml.dom.minidom
def main(argv):
bulk_tm_file = 'apc161231-56-test.xml'
output_directory = 'tm_corpus'
xml_tag ='<?xml version=\"1.0\" encoding=\"UTF-8\"?>'
start_xml_pattern = re.compile("(?P<xml_tag><\?xml[^>]+\?>[\s]*?)", r... | true | true |
f7402ff23ea4a358ec9a231087bd021fbaff290c | 1,494 | py | Python | patronclient/tests/unit/fixture_data/cloudpipe.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patronclient/tests/unit/fixture_data/cloudpipe.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patronclient/tests/unit/fixture_data/cloudpipe.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 39.315789 | 75 | 0.61178 |
from patronclient.tests.unit.fixture_data import base
class Fixture(base.Fixture):
base_url = 'os-cloudpipe'
def setUp(self):
super(Fixture, self).setUp()
get_os_cloudpipe = {'cloudpipes': [{'project_id': 1}]}
self.requests.register_uri('GET', self.url(),
... | true | true |
f740302e3c91af8002d123f8013ea5f073ba4765 | 1,299 | py | Python | sdk/servicebus/azure-servicebus/tests/perf_tests/T1_legacy_tests/receive_message_stream.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/servicebus/azure-servicebus/tests/perf_tests/T1_legacy_tests/receive_message_stream.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/servicebus/azure-servicebus/tests/perf_tests/T1_legacy_tests/receive_message_stream.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 33.307692 | 94 | 0.452656 |
import asyncio
from ._test_base import _ReceiveTest
class LegacyReceiveMessageStreamTest(_ReceiveTest):
def run_sync(self):
count = 0
if self.args.peeklock:
for msg in self.receiver:
if count >= self.args.num_messages:
break
cou... | true | true |
f740304df6fe1432a122d59e3dba42c15e3c9dc4 | 407 | py | Python | script.py | baluyotraf/flask-basic | 31658b8b57dab8c1379de9b177cc0e0b3fab3059 | [
"MIT"
] | null | null | null | script.py | baluyotraf/flask-basic | 31658b8b57dab8c1379de9b177cc0e0b3fab3059 | [
"MIT"
] | null | null | null | script.py | baluyotraf/flask-basic | 31658b8b57dab8c1379de9b177cc0e0b3fab3059 | [
"MIT"
] | 2 | 2018-10-06T00:42:05.000Z | 2019-06-27T05:45:57.000Z | import click
from flask.cli import FlaskGroup
from app import app, db
@click.group(cls=FlaskGroup, create_app=lambda: app)
def cli():
"""Management script for the flask application."""
@cli.command()
def init_db():
"""Creates database tables"""
db.create_all()
@cli.command()
def delete_db():
"""De... | 15.653846 | 54 | 0.670762 | import click
from flask.cli import FlaskGroup
from app import app, db
@click.group(cls=FlaskGroup, create_app=lambda: app)
def cli():
@cli.command()
def init_db():
db.create_all()
@cli.command()
def delete_db():
db.drop_all()
if __name__ == '__main__':
cli()
| true | true |
f74030980e795b4229a83c0c28cd1942de09f49c | 370 | py | Python | accounts/admin.py | xarg/snippify | b692a941a7a46959df9aff064b7ad056d0125484 | [
"MIT"
] | 2 | 2016-08-19T06:24:02.000Z | 2021-05-11T00:08:24.000Z | accounts/admin.py | xarg/snippify | b692a941a7a46959df9aff064b7ad056d0125484 | [
"MIT"
] | 5 | 2021-05-01T15:03:07.000Z | 2021-05-01T15:03:08.000Z | accounts/admin.py | xarg/snippify | b692a941a7a46959df9aff064b7ad056d0125484 | [
"MIT"
] | null | null | null | from django.contrib import admin
from models import UserFollow, UserProfile
class UserFollowAdmin(admin.ModelAdmin):
list_display=['user', 'followed_user']
class UserProfileAdmin(admin.ModelAdmin):
list_display=['user', 'location', 'url', 'profile_privacy']
admin.site.register(UserFollow, UserFollowAdmin)
a... | 28.461538 | 63 | 0.791892 | from django.contrib import admin
from models import UserFollow, UserProfile
class UserFollowAdmin(admin.ModelAdmin):
list_display=['user', 'followed_user']
class UserProfileAdmin(admin.ModelAdmin):
list_display=['user', 'location', 'url', 'profile_privacy']
admin.site.register(UserFollow, UserFollowAdmin)
a... | true | true |
f74030de8cdf79242bfc746396c7505043f02353 | 13,463 | py | Python | test/functional/feature_dbcrash.py | ravenjetcoin/ravenjetcoin | 6b76a19818f26ffde5bc9dd6bb5385143d8417b3 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | ravenjetcoin/ravenjetcoin | 6b76a19818f26ffde5bc9dd6bb5385143d8417b3 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | ravenjetcoin/ravenjetcoin | 6b76a19818f26ffde5bc9dd6bb5385143d8417b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Marlin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
... | 47.40493 | 120 | 0.640125 |
import errno
import http.client
import random
import sys
import time
from test_framework.mininode import *
from test_framework.script import *
from test_framework.test_framework import MarlinTestFramework
from test_framework.util import *
HTTP_DISCONNECT_ERRORS = [http.client.CannotSendRequest]
try:
HTTP_DI... | true | true |
f74031c02fb16e976fe188386f78e5c05e47f2a2 | 400 | py | Python | mycal/attendance/migrations/0014_auto_20201117_1453.py | mjhow4/newattendanceapp | 685173631fc7cf7e56923e27f47d405629633386 | [
"MIT"
] | null | null | null | mycal/attendance/migrations/0014_auto_20201117_1453.py | mjhow4/newattendanceapp | 685173631fc7cf7e56923e27f47d405629633386 | [
"MIT"
] | null | null | null | mycal/attendance/migrations/0014_auto_20201117_1453.py | mjhow4/newattendanceapp | 685173631fc7cf7e56923e27f47d405629633386 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-17 19:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('attendance', '0013_auto_20201115_1154'),
]
operations = [
migrations.AlterField(
model_name='case',
name='attorney',... | 21.052632 | 61 | 0.605 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('attendance', '0013_auto_20201115_1154'),
]
operations = [
migrations.AlterField(
model_name='case',
name='attorney',
field=models.CharField(max_length=... | true | true |
f74031d0561e95af36c7d887a7437ab70081dd23 | 663 | py | Python | crosscap/yamlhack.py | corydodt/Crosscap | f93ccd9d038a4482a84a6e9f5d4f91f78620383d | [
"MIT"
] | 1 | 2019-03-11T20:25:36.000Z | 2019-03-11T20:25:36.000Z | crosscap/yamlhack.py | corydodt/Crosscap | f93ccd9d038a4482a84a6e9f5d4f91f78620383d | [
"MIT"
] | 14 | 2018-01-25T19:11:57.000Z | 2020-12-22T19:30:11.000Z | crosscap/yamlhack.py | corydodt/Crosscap | f93ccd9d038a4482a84a6e9f5d4f91f78620383d | [
"MIT"
] | null | null | null | """
Make yaml respect OrderedDicts and stop sorting things
"""
from collections import OrderedDict
import sys
import yaml
_items = 'viewitems' if sys.version_info < (3,) else 'items'
def map_representer(dumper, data):
return dumper.represent_dict(getattr(data, _items)())
def map_constructor(loader, node): # ... | 24.555556 | 80 | 0.760181 | from collections import OrderedDict
import sys
import yaml
_items = 'viewitems' if sys.version_info < (3,) else 'items'
def map_representer(dumper, data):
return dumper.represent_dict(getattr(data, _items)())
def map_constructor(loader, node):
loader.flatten_mapping(node)
return OrderedDict(loader.c... | true | true |
f74033924f64e434b9c1d3d0500160627c9e1819 | 101,053 | py | Python | pandas/core/internals/blocks.py | dwhu/pandas | 283fa07e723fac091685366ba83727624748fddb | [
"BSD-3-Clause"
] | 1 | 2021-12-16T20:01:21.000Z | 2021-12-16T20:01:21.000Z | pandas/core/internals/blocks.py | dwhu/pandas | 283fa07e723fac091685366ba83727624748fddb | [
"BSD-3-Clause"
] | null | null | null | pandas/core/internals/blocks.py | dwhu/pandas | 283fa07e723fac091685366ba83727624748fddb | [
"BSD-3-Clause"
] | 1 | 2020-01-24T06:01:29.000Z | 2020-01-24T06:01:29.000Z | from datetime import datetime, timedelta
import functools
import inspect
import re
from typing import Any, List
import warnings
import numpy as np
from pandas._libs import NaT, algos as libalgos, lib, tslib, writers
from pandas._libs.index import convert_scalar
import pandas._libs.internals as libinternals
from panda... | 32.121106 | 88 | 0.578508 | from datetime import datetime, timedelta
import functools
import inspect
import re
from typing import Any, List
import warnings
import numpy as np
from pandas._libs import NaT, algos as libalgos, lib, tslib, writers
from pandas._libs.index import convert_scalar
import pandas._libs.internals as libinternals
from panda... | true | true |
f74033da7c11750aca320824dd67776fc359e857 | 12,022 | py | Python | userbot/modules/afk.py | Xlaaf/One4uBot | 6d142b9621c1bbd76bc5c07759f5c13c646281d1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 77 | 2020-02-09T19:23:30.000Z | 2021-12-21T16:13:43.000Z | userbot/modules/afk.py | Xlaaf/One4uBot | 6d142b9621c1bbd76bc5c07759f5c13c646281d1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 20 | 2020-03-23T15:22:09.000Z | 2021-09-28T09:30:54.000Z | userbot/modules/afk.py | Xlaaf/One4uBot | 6d142b9621c1bbd76bc5c07759f5c13c646281d1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1,011 | 2020-02-01T10:04:35.000Z | 2022-03-26T13:08:07.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module which contains afk-related commands """
import time
from datetime import datetime
from random impor... | 38.408946 | 273 | 0.542006 |
import time
from datetime import datetime
from random import choice, randint
from telethon.events import StopPropagation
from userbot import (
AFKREASON,
COUNT_MSG,
CMD_HELP,
ISAFK,
BOTLOG,
BOTLOG_CHATID,
USERS,
PM_AUTO_BAN)
from userbot.events import register
AFKSTR = [
... | true | true |
f74036196ac3e4237968b676526d67eaa30593a3 | 3,314 | py | Python | blog/blog/settings.py | AminAbdisamad/django-blog | ee730f2c86d6ffa4549e68b81cb5ea10dd2f6f91 | [
"MIT"
] | 1 | 2019-03-06T15:22:36.000Z | 2019-03-06T15:22:36.000Z | blog/blog/settings.py | AminAbdisamad/django-app | ee730f2c86d6ffa4549e68b81cb5ea10dd2f6f91 | [
"MIT"
] | null | null | null | blog/blog/settings.py | AminAbdisamad/django-app | ee730f2c86d6ffa4549e68b81cb5ea10dd2f6f91 | [
"MIT"
] | null | null | null | """
Django settings for blog project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.689922 | 91 | 0.698552 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '(-0u)#m+=0@9fs51dhk5y#dfnnqac%krz5ry=$u-2zg@1ar1px'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'users.apps.UsersConfig',
'pages.apps.PagesConfig',
'crispy_forms',
... | true | true |
f74036e8bb4d4ebcfc75ad384f3133cb732cdf4c | 921 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractMaynoveltranslationsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractMaynoveltranslationsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractMaynoveltranslationsCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | def extractMaynoveltranslationsCom(item):
'''
Parser for 'maynoveltranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('president shen always top up money', 'president shen alw... | 40.043478 | 120 | 0.566775 | def extractMaynoveltranslationsCom(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('president shen always top up money', 'president shen always top up money', 'translat... | true | true |
f74036fe01eb8abb678f091cfd1ae053795c8e42 | 207 | py | Python | models/__init__.py | hackerekcah/conv-hcpc | 1ac4a558e38bdba68162bfcc5cd8b2b7c8eea1b9 | [
"MIT"
] | null | null | null | models/__init__.py | hackerekcah/conv-hcpc | 1ac4a558e38bdba68162bfcc5cd8b2b7c8eea1b9 | [
"MIT"
] | null | null | null | models/__init__.py | hackerekcah/conv-hcpc | 1ac4a558e38bdba68162bfcc5cd8b2b7c8eea1b9 | [
"MIT"
] | null | null | null | ARCH_REGISTRY = dict()
def register_arch(cls):
ARCH_REGISTRY[cls.__name__] = cls
return cls
# explicitly import all models to register arch
from models import conv1d
__all__ = ["register_arch"] | 15.923077 | 47 | 0.73913 | ARCH_REGISTRY = dict()
def register_arch(cls):
ARCH_REGISTRY[cls.__name__] = cls
return cls
from models import conv1d
__all__ = ["register_arch"] | true | true |
f74037bbdfd8b70f3219b796e42e9e376e2378a7 | 263 | py | Python | server/app/api_1_0/__init__.py | ju1115kr/hash-brown | 93c5e636404608c7cba889cc9f9e0f3d3d0723b2 | [
"Apache-2.0"
] | 4 | 2018-06-27T10:28:54.000Z | 2020-03-15T10:44:37.000Z | server/app/api_1_0/__init__.py | ju1115kr/hash-brown | 93c5e636404608c7cba889cc9f9e0f3d3d0723b2 | [
"Apache-2.0"
] | 9 | 2018-06-27T10:29:37.000Z | 2021-12-13T19:48:39.000Z | server/app/api_1_0/__init__.py | ju1115kr/hash-brown | 93c5e636404608c7cba889cc9f9e0f3d3d0723b2 | [
"Apache-2.0"
] | 2 | 2018-07-04T16:54:20.000Z | 2018-07-04T16:58:36.000Z | # -*- coding: utf-8 -*-
from flask import Blueprint
from flask_cors import CORS
# Flask Blueprint 정의
api = Blueprint('api', __name__)
CORS(api) # enable CORS on the API_v1.0 blueprint
from . import errors,transaction,authentication, news, users, search, stars
| 26.3 | 75 | 0.745247 |
from flask import Blueprint
from flask_cors import CORS
api = Blueprint('api', __name__)
CORS(api)
from . import errors,transaction,authentication, news, users, search, stars
| true | true |
f74037e84f8c87dfd913a65204f4db50122a2ac5 | 14,058 | py | Python | builders/losses_builder_test.py | zhonglihanzhu/tensorflow-objectDetection | aa3d1b754d5c78b8401ce86d4c20f45741fc2b77 | [
"Apache-2.0"
] | 1 | 2019-04-24T16:32:11.000Z | 2019-04-24T16:32:11.000Z | builders/losses_builder_test.py | zhonglihanzhu/tensorflow-objectDetection | aa3d1b754d5c78b8401ce86d4c20f45741fc2b77 | [
"Apache-2.0"
] | null | null | null | builders/losses_builder_test.py | zhonglihanzhu/tensorflow-objectDetection | aa3d1b754d5c78b8401ce86d4c20f45741fc2b77 | [
"Apache-2.0"
] | 3 | 2018-04-04T07:26:54.000Z | 2020-08-14T01:43:29.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.09589 | 80 | 0.669654 |
import tensorflow as tf
from google.protobuf import text_format
from builders import losses_builder
from core import losses
from protos import losses_pb2
class LocalizationLossBuilderTest(tf.test.TestCase):
def test_build_weighted_l2_localization_loss(self):
losses_text_proto = """
local... | true | true |
f74039d36a6ac73f98e7a7a22d1766feb916500b | 478 | py | Python | tests/test_internet_access.py | QwantResearch/idunn | 88b6862f1036187855b5541bbb6758ddd4df33c1 | [
"Apache-2.0"
] | 26 | 2018-11-30T09:17:17.000Z | 2020-11-07T01:53:07.000Z | tests/test_internet_access.py | QwantResearch/idunn | 88b6862f1036187855b5541bbb6758ddd4df33c1 | [
"Apache-2.0"
] | 38 | 2018-06-08T09:41:04.000Z | 2020-12-07T17:39:12.000Z | tests/test_internet_access.py | Qwant/idunn | 65582dfed732093778bf7c2998db1e2cd78255b8 | [
"Apache-2.0"
] | 9 | 2018-05-18T13:07:00.000Z | 2020-08-01T16:42:40.000Z | from idunn.blocks.services_and_information import InternetAccessBlock
def test_internet_access_block():
internet_access_block = InternetAccessBlock.from_es({"properties": {"wifi": "no"}}, lang="en")
assert internet_access_block is None
def test_internet_access_block_ok():
internet_access_block = Interne... | 34.142857 | 98 | 0.759414 | from idunn.blocks.services_and_information import InternetAccessBlock
def test_internet_access_block():
internet_access_block = InternetAccessBlock.from_es({"properties": {"wifi": "no"}}, lang="en")
assert internet_access_block is None
def test_internet_access_block_ok():
internet_access_block = Interne... | true | true |
f74039d779bab41005d35888cc4a33959399664d | 2,257 | py | Python | adv/aa.py | betairylia/dl | 4eb06837b13decc569066a43b58e205f3b716ff8 | [
"Apache-2.0"
] | null | null | null | adv/aa.py | betairylia/dl | 4eb06837b13decc569066a43b58e205f3b716ff8 | [
"Apache-2.0"
] | null | null | null | adv/aa.py | betairylia/dl | 4eb06837b13decc569066a43b58e205f3b716ff8 | [
"Apache-2.0"
] | null | null | null | import adv_test
from adv import *
from slot.a import *
import slot.a
def module():
return Mikoto
class Mikoto(Adv):
a1 = ('cc', 0.10, 'hp70')
a3 = ('cc', 0.08)
def init(this):
if this.condition('connect s1'):
this.s1_proc = this.c_s1_proc
def prerun(this):
this.... | 24.802198 | 77 | 0.489145 | import adv_test
from adv import *
from slot.a import *
import slot.a
def module():
return Mikoto
class Mikoto(Adv):
a1 = ('cc', 0.10, 'hp70')
a3 = ('cc', 0.08)
def init(this):
if this.condition('connect s1'):
this.s1_proc = this.c_s1_proc
def prerun(this):
this.... | true | true |
f7403ab5d8ecd44dc96a440ac65e221c9f1917f3 | 4,715 | py | Python | rqalpha/const.py | bttt123/rqalpha | 1e4c860363b89a2f574b61c73d21a57242d7f2e1 | [
"Apache-2.0"
] | 44 | 2017-06-17T09:43:17.000Z | 2022-03-02T11:08:03.000Z | rqalpha/const.py | hadrianl/rqalpha_kairui | eb0e0de1d69f1a4d6f349d4dc011e1c9eccfe2d8 | [
"Apache-2.0"
] | 2 | 2017-08-26T13:10:17.000Z | 2018-06-14T12:28:08.000Z | rqalpha/const.py | hadrianl/rqalpha_kairui | eb0e0de1d69f1a4d6f349d4dc011e1c9eccfe2d8 | [
"Apache-2.0"
] | 28 | 2017-06-26T10:06:29.000Z | 2021-12-17T04:26:04.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 24.056122 | 116 | 0.649841 |
from enum import Enum
class CustomEnum(Enum):
def __repr__(self):
return "%s.%s" % (
self.__class__.__name__, self._name_)
class EXECUTION_PHASE(CustomEnum):
GLOBAL = "[全局]"
ON_INIT = "[程序初始化]"
BEFORE_TRADING = "[日内交易前]"
ON_BAR = "[盘中 handle_bar 函数]"
ON_T... | true | true |
f7403af3f673762406695e8e74c4de7630e93320 | 1,837 | py | Python | proj files/path.py | ZhenoSan/DistributedFileSystem | 8776e0ecffcc06ea213603ad0ca202e15595297c | [
"MIT"
] | 1 | 2021-03-01T08:49:26.000Z | 2021-03-01T08:49:26.000Z | proj files/path.py | ZhenoSan/DistributedFileSystem | 8776e0ecffcc06ea213603ad0ca202e15595297c | [
"MIT"
] | null | null | null | proj files/path.py | ZhenoSan/DistributedFileSystem | 8776e0ecffcc06ea213603ad0ca202e15595297c | [
"MIT"
] | null | null | null | import os
strt = 'folder1/folder2/file3'
strt = 'folder1'
newl = strt.split('/')
print(newl)
'''
def list_files(startpath):
for root, dirs, files in os.walk(startpath):
level = root.replace(startpath, '').count(os.sep)
#print(level)
indent = ' ' * 4 * (level)
print('{}{}/'.format(i... | 21.869048 | 67 | 0.615678 | import os
strt = 'folder1/folder2/file3'
strt = 'folder1'
newl = strt.split('/')
print(newl)
| true | true |
f7403b6f16078156f4dd1e0f333e7adc8a3c422a | 5,987 | py | Python | src/utils.py | nicola144/auxiliary-particle-filters | 61d72e9163abb73007c0fbd30f68d4cc6d7ab4e9 | [
"MIT"
] | 5 | 2020-11-26T15:56:15.000Z | 2022-02-06T12:48:21.000Z | src/utils.py | nicola144/auxiliary-particle-filters | 61d72e9163abb73007c0fbd30f68d4cc6d7ab4e9 | [
"MIT"
] | null | null | null | src/utils.py | nicola144/auxiliary-particle-filters | 61d72e9163abb73007c0fbd30f68d4cc6d7ab4e9 | [
"MIT"
] | null | null | null | import re
import sys
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams
from scipy.integrate import simps
from scipy.special import logsumexp
from scipy.optimize import minimize
# from sklearn.cluster import DBSCAN
# from sklearn.preprocessing import StandardScaler
import time
import ra... | 25.806034 | 98 | 0.683648 | import re
import sys
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams
from scipy.integrate import simps
from scipy.special import logsumexp
from scipy.optimize import minimize
import time
import random
from tqdm import tqdm
def compute_cluster_centers(all_points):
all_points = S... | true | true |
f7403bb9d1c724f316feebfeb305cf8f490377a4 | 2,900 | py | Python | railrl/predictors/state_action_network.py | fredshentu/public_model_based_controller | 9301699bc56aa49ba5c699f7d5be299046a8aa0c | [
"MIT"
] | null | null | null | railrl/predictors/state_action_network.py | fredshentu/public_model_based_controller | 9301699bc56aa49ba5c699f7d5be299046a8aa0c | [
"MIT"
] | null | null | null | railrl/predictors/state_action_network.py | fredshentu/public_model_based_controller | 9301699bc56aa49ba5c699f7d5be299046a8aa0c | [
"MIT"
] | null | null | null | import abc
import tensorflow as tf
from railrl.core.neuralnet import NeuralNetwork
from rllab.misc.overrides import overrides
class StateActionNetwork(NeuralNetwork, metaclass=abc.ABCMeta):
"""
A map from (state, action) to a vector
"""
def __init__(
self,
name_or_scope,
... | 34.52381 | 73 | 0.593103 | import abc
import tensorflow as tf
from railrl.core.neuralnet import NeuralNetwork
from rllab.misc.overrides import overrides
class StateActionNetwork(NeuralNetwork, metaclass=abc.ABCMeta):
def __init__(
self,
name_or_scope,
output_dim,
env_spec=None,
... | true | true |
f7403bd30d604fb80212a777fdb215bee2cfe9bc | 290 | py | Python | python/exchange_two_nos.py | codevscolor/codevscolor | 35ef9042bdc86f45ef87795c35963b75fb64d5d7 | [
"Apache-2.0"
] | 6 | 2019-04-26T03:11:54.000Z | 2021-05-07T21:48:29.000Z | python/exchange_two_nos.py | akojif/codevscolor | 56db3dffeac8f8d76ff8fcf5656770f33765941f | [
"Apache-2.0"
] | null | null | null | python/exchange_two_nos.py | akojif/codevscolor | 56db3dffeac8f8d76ff8fcf5656770f33765941f | [
"Apache-2.0"
] | 26 | 2019-02-23T14:50:46.000Z | 2022-02-04T23:44:24.000Z | #1
first = int(input("Enter the value of the first number : "))
second = int(input("Enter the value of the second number : "))
#2
first = first + second
#3
second = first - second
#4
first = first - second
#5
print("After exchange, First number is : ",first," Second number is : ",second)
| 24.166667 | 79 | 0.675862 |
first = int(input("Enter the value of the first number : "))
second = int(input("Enter the value of the second number : "))
first = first + second
second = first - second
first = first - second
print("After exchange, First number is : ",first," Second number is : ",second)
| true | true |
f7403bdf2e7f20e422b388eaddd5aee64a579fa2 | 99 | py | Python | mindsdb/api/http/namespaces/configs/datasources.py | yarenty/mindsdb | 9164bca6f45fd0f5ec329babe973f286ffe59709 | [
"MIT"
] | 261 | 2018-09-28T02:32:17.000Z | 2018-12-10T06:30:54.000Z | mindsdb/api/http/namespaces/configs/datasources.py | yarenty/mindsdb | 9164bca6f45fd0f5ec329babe973f286ffe59709 | [
"MIT"
] | 27 | 2018-09-26T08:49:11.000Z | 2018-12-10T14:42:52.000Z | mindsdb/api/http/namespaces/configs/datasources.py | yarenty/mindsdb | 9164bca6f45fd0f5ec329babe973f286ffe59709 | [
"MIT"
] | 46 | 2018-10-06T10:11:18.000Z | 2018-12-10T04:02:17.000Z | from flask_restx import Namespace
ns_conf = Namespace('datasources', description='Data sources')
| 19.8 | 62 | 0.79798 | from flask_restx import Namespace
ns_conf = Namespace('datasources', description='Data sources')
| true | true |
f7403cc0cce36fb0315ab882dec11e104594c968 | 19,928 | py | Python | code/ml.py | marcusbotacin/ELF.Classifier | d017e82d24d047145ef92cb2437c6a03d845a90e | [
"MIT"
] | 2 | 2019-10-19T05:10:38.000Z | 2020-08-28T19:23:40.000Z | code/ml.py | marcusbotacin/ELF.Classifier | d017e82d24d047145ef92cb2437c6a03d845a90e | [
"MIT"
] | null | null | null | code/ml.py | marcusbotacin/ELF.Classifier | d017e82d24d047145ef92cb2437c6a03d845a90e | [
"MIT"
] | null | null | null | # FORSETI - Feature extractor and classificator for ELF binaries
# Author: Lucas Galante
# Advisor: Marcus Botacin, Andre Gregio, Paulo de Geus
# 2019, UFPR, UNICAMP
import binaries # Object class for handling binaries
import ConfigParser # Configuration file for user
import dm # Data metrics... | 38.030534 | 136 | 0.54165 |
import binaries
import ConfigParser
import dm
import sys
import os
from sklearn import svm
from sklearn.model_selection import KFold
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
class MachineLearing:
... | false | true |
f7403cce5dfeb204d5655bcd642b0e170028d73b | 256 | py | Python | .history/ClassFiles/Control Flow/For_20210101213904.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/Control Flow/For_20210101213904.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/Control Flow/For_20210101213904.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | ''' For loop
Used to iterate over a sequence.
Sequence is usually: (list,tuple, dictionary,set,string)
Does not require an indexing variable to initiate the loop.
I can use break abd continue statements.
'''
fruits = ["grapes", "berrys", ] | 23.272727 | 59 | 0.695313 | fruits = ["grapes", "berrys", ] | true | true |
f7403ef77d6786dcb59806e84e2a8e4395e52f83 | 1,595 | py | Python | python/polypy/lib/word_algebra.py | amatveyakin/polykit | beb20059d9f90b8341e5ddf75543ab1f2168d1b4 | [
"MIT"
] | 1 | 2021-09-16T08:25:23.000Z | 2021-09-16T08:25:23.000Z | python/polypy/lib/word_algebra.py | amatveyakin/polykit | beb20059d9f90b8341e5ddf75543ab1f2168d1b4 | [
"MIT"
] | null | null | null | python/polypy/lib/word_algebra.py | amatveyakin/polykit | beb20059d9f90b8341e5ddf75543ab1f2168d1b4 | [
"MIT"
] | null | null | null | import re
from .delta import Inf, d_expr_dimension
from .linear import Linear
from .lyndon import to_lyndon_basis
from .util import get_one_item
def word_expr_weight(expr):
return len(get_one_item(expr.items())[0])
def word_expr_max_char(expr):
return max([max(word) for word, _ in expr.items()])
def words_... | 29.537037 | 74 | 0.677743 | import re
from .delta import Inf, d_expr_dimension
from .linear import Linear
from .lyndon import to_lyndon_basis
from .util import get_one_item
def word_expr_weight(expr):
return len(get_one_item(expr.items())[0])
def word_expr_max_char(expr):
return max([max(word) for word, _ in expr.items()])
def words_... | true | true |
f7403f2a0f66fcd26ffdf6876e78b0117f16e9ed | 44,632 | py | Python | cyberbrain/value_stack.py | sourcery-ai-bot/Cyberbrain | d3b65f073c4850f4ab677f07f7b832b93b896c9b | [
"MIT"
] | 2 | 2020-12-30T20:28:17.000Z | 2020-12-31T04:02:27.000Z | cyberbrain/value_stack.py | formazione/Cyberbrain | c135ee7879ef049e459e34be1756da8006430e24 | [
"MIT"
] | null | null | null | cyberbrain/value_stack.py | formazione/Cyberbrain | c135ee7879ef049e459e34be1756da8006430e24 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""A self maintained value stack."""
from __future__ import annotations
import dataclasses
import enum
import functools
import inspect
import sys
from copy import copy
from dis import Instruction
from types import FrameType
from typing import Optional
try:
from typing import TYPE_CHECKING, Lit... | 36.583607 | 88 | 0.622199 |
from __future__ import annotations
import dataclasses
import enum
import functools
import inspect
import sys
from copy import copy
from dis import Instruction
from types import FrameType
from typing import Optional
try:
from typing import TYPE_CHECKING, Literal
except ImportError:
from typing_extensions im... | true | true |
f74040105130f4fd0ceedc2705d6a5fa569b3164 | 3,807 | py | Python | homeassistant/components/gstreamer/media_player.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/gstreamer/media_player.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/gstreamer/media_player.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """Play media via gstreamer."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
SUPPORT_PLAY, SUPPORT_PLAY_MEDIA, S... | 27 | 79 | 0.651694 | import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
SUPPORT_PLAY, SUPPORT_PLAY_MEDIA, SUPPORT_VOLUME_SET)
from homeassi... | true | true |
f740413c9f6699524d5b9d56f7e4f8a6c26b5cab | 1,420 | py | Python | portal/migrations/0009_auto_20170826_1647.py | nickmvincent/ugc-val-est | b5cceda14ef5830f1befaddfccfd90a694c9677a | [
"MIT"
] | 2 | 2019-11-13T19:56:05.000Z | 2020-09-05T03:21:14.000Z | portal/migrations/0009_auto_20170826_1647.py | nickmvincent/ugc-val-est | b5cceda14ef5830f1befaddfccfd90a694c9677a | [
"MIT"
] | 6 | 2018-03-02T16:49:20.000Z | 2021-06-10T18:55:02.000Z | portal/migrations/0009_auto_20170826_1647.py | nickmvincent/ugc-val-est | b5cceda14ef5830f1befaddfccfd90a694c9677a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-26 16:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portal', '0008_auto_20170825_1249'),
]
operations = [
migrations.AddField(
... | 30.869565 | 68 | 0.605634 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portal', '0008_auto_20170825_1249'),
]
operations = [
migrations.AddField(
model_name='sampledredditthread',
name='sample_... | true | true |
f7404150187df19b3e70c4af067f98c99fe1498d | 7,946 | py | Python | src/config.py | ubirch/ubirch-goclient-chirpstack-connector | b0ba68ac7a18d52a97aa1b9292b91f0d34993f07 | [
"Apache-2.0"
] | null | null | null | src/config.py | ubirch/ubirch-goclient-chirpstack-connector | b0ba68ac7a18d52a97aa1b9292b91f0d34993f07 | [
"Apache-2.0"
] | null | null | null | src/config.py | ubirch/ubirch-goclient-chirpstack-connector | b0ba68ac7a18d52a97aa1b9292b91f0d34993f07 | [
"Apache-2.0"
] | null | null | null | import os
import json
import shutil
import logging
from typing import Callable
class Config():
def __init__(self, configFile: str, log: logging.Logger):
""" init function of the Config class """
# set default values (None means that is has to be set)
self.configFile = configFile
self.log = log
s... | 43.659341 | 148 | 0.674427 | import os
import json
import shutil
import logging
from typing import Callable
class Config():
def __init__(self, configFile: str, log: logging.Logger):
self.configFile = configFile
self.log = log
self.config: dict = None
self.configFD = None
self.backupPath = self.configFile + ".backup"
... | true | true |
f7404183abd7066c7c542a5b75b491edf2b468ce | 1,009 | py | Python | jdcloud_sdk/services/cps/models/Ipv6AddressSpec.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/cps/models/Ipv6AddressSpec.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/cps/models/Ipv6AddressSpec.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 31.53125 | 75 | 0.70664 |
class Ipv6AddressSpec(object):
def __init__(self, bandwidth, ipv6Addresses, charge, ):
self.bandwidth = bandwidth
self.ipv6Addresses = ipv6Addresses
self.charge = charge
| true | true |
f74041d2619806f6a836172cf853cfdc24dc54ca | 3,106 | py | Python | xam/preprocessing/binning/mdlp.py | topolphukhanh/xam | 3fa958ba8b0c8e8e266cac9997b7a7d0c309f55c | [
"MIT"
] | 357 | 2017-03-23T19:07:31.000Z | 2022-03-11T09:08:07.000Z | xam/preprocessing/binning/mdlp.py | topolphukhanh/xam | 3fa958ba8b0c8e8e266cac9997b7a7d0c309f55c | [
"MIT"
] | 8 | 2018-07-05T09:18:36.000Z | 2022-03-04T05:10:09.000Z | xam/preprocessing/binning/mdlp.py | topolphukhanh/xam | 3fa958ba8b0c8e8e266cac9997b7a7d0c309f55c | [
"MIT"
] | 89 | 2017-03-24T22:12:39.000Z | 2022-02-14T15:47:41.000Z | """
Minimum Description Length Principle (MDLP) binning
- Original paper: http://sci2s.ugr.es/keel/pdf/algorithm/congreso/fayyad1993.pdf
- Implementation inspiration: https://www.ibm.com/support/knowledgecenter/it/SSLVMB_21.0.0/com.ibm.spss.statistics.help/alg_optimal-binning.htm
"""
import collections
import math
i... | 27.981982 | 143 | 0.67933 |
import collections
import math
import numpy as np
from scipy import stats
from sklearn.utils import check_X_y
from .base import BaseSupervisedBinner
class MDLPBinner(BaseSupervisedBinner):
def fit(self, X, y, **fit_params):
X, y = check_X_y(X, y, y_numeric=True)
self.cut_points_ = [mdlp_cut(... | true | true |
f740426344c2fdd9bd6bc200f900d8fc6c7d22c0 | 1,054 | py | Python | bin/AdaBoost.py | ezeddin/random_forest | 07a23af1764fbf7a54a27e79d5ac68c69a64f0b1 | [
"MIT"
] | null | null | null | bin/AdaBoost.py | ezeddin/random_forest | 07a23af1764fbf7a54a27e79d5ac68c69a64f0b1 | [
"MIT"
] | null | null | null | bin/AdaBoost.py | ezeddin/random_forest | 07a23af1764fbf7a54a27e79d5ac68c69a64f0b1 | [
"MIT"
] | null | null | null | from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.datasets import make_gaussian_quantiles
from sklearn.ensemble import RandomForestClassifier
def AdaBoost(X_train, y_train, X_test, DEPTH, N_ESTIMATORS):
# Create and fit an AdaBoosted decision tree
bdt = AdaB... | 35.133333 | 127 | 0.783681 | from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.datasets import make_gaussian_quantiles
from sklearn.ensemble import RandomForestClassifier
def AdaBoost(X_train, y_train, X_test, DEPTH, N_ESTIMATORS):
bdt = AdaBoostClassifier(DecisionTreeClassifier(max_de... | true | true |
f74044431f0156566f65e0435802f79bdfecfbff | 636 | py | Python | bin/rst2man.py | incognitoRepo/hdlogger | c738161ef3144469ba0f47caf89770613031e96e | [
"BSD-2-Clause"
] | null | null | null | bin/rst2man.py | incognitoRepo/hdlogger | c738161ef3144469ba0f47caf89770613031e96e | [
"BSD-2-Clause"
] | null | null | null | bin/rst2man.py | incognitoRepo/hdlogger | c738161ef3144469ba0f47caf89770613031e96e | [
"BSD-2-Clause"
] | null | null | null | #!/Users/alberthan/VSCodeProjects/hdlogger/bin/python3
# Author:
# Contact: grubert@users.sf.net
# Copyright: This module has been placed in the public domain.
"""
man.py
======
This module provides a simple command line interface that uses the
man page writer to output from ReStructuredText source.
"""
import loc... | 23.555556 | 80 | 0.773585 |
import locale
try:
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
from docutils.writers import manpage
description = ("Generates plain unix manual documents. " + default_description)
publish_cmdline(writer=manpage.Writer(), description=... | true | true |
f74044e4481aea62aaad532662124ba0432d6527 | 6,922 | py | Python | pipelines/cv_biobert_lstm_ft.py | BioSystemsUM/biotmpy | f981d58cf7f53a2aa09708e13d6561533c164e1f | [
"MIT"
] | 13 | 2021-11-02T11:10:56.000Z | 2022-02-23T11:48:20.000Z | pipelines/cv_biobert_lstm_ft.py | BioSystemsUM/biotmpy | f981d58cf7f53a2aa09708e13d6561533c164e1f | [
"MIT"
] | null | null | null | pipelines/cv_biobert_lstm_ft.py | BioSystemsUM/biotmpy | f981d58cf7f53a2aa09708e13d6561533c164e1f | [
"MIT"
] | null | null | null | model_name= 'cv_biobert_lstm_ft'
import sys
sys.path.append('../')
import os
import tensorflow
import numpy as np
import random
seed_value = 123123
#seed_value = None
environment_name = sys.executable.split('/')[-3]
print('Environment:', environment_name)
os.environ[environment_name] = str(seed_val... | 33.601942 | 152 | 0.746172 | model_name= 'cv_biobert_lstm_ft'
import sys
sys.path.append('../')
import os
import tensorflow
import numpy as np
import random
seed_value = 123123
environment_name = sys.executable.split('/')[-3]
print('Environment:', environment_name)
os.environ[environment_name] = str(seed_value)
np.random.se... | true | true |
f7404519c97593d29e968f26d7eafdd8f3f75b6b | 331 | py | Python | backend/messages.py | erickzhao/sobbing-rabbits | 27d295895aa72477fe942f680535bd142b82bf27 | [
"MIT"
] | 4 | 2019-03-17T16:02:49.000Z | 2020-11-06T02:46:03.000Z | backend/messages.py | erickzhao/sobbing-rabbits | 27d295895aa72477fe942f680535bd142b82bf27 | [
"MIT"
] | null | null | null | backend/messages.py | erickzhao/sobbing-rabbits | 27d295895aa72477fe942f680535bd142b82bf27 | [
"MIT"
] | null | null | null | from twilio.rest import Client
account = "ACeec37d10088b2826aa81746d709c57e3"
token = "e84982e1d3e37a080664f749f1027c0a"
client = Client(account, token)
def send_sms(number, body):
message = client.messages.create(to="+14383996776", from_="+1 778 654 6641",
body=body)
return m... | 27.583333 | 80 | 0.691843 | from twilio.rest import Client
account = "ACeec37d10088b2826aa81746d709c57e3"
token = "e84982e1d3e37a080664f749f1027c0a"
client = Client(account, token)
def send_sms(number, body):
message = client.messages.create(to="+14383996776", from_="+1 778 654 6641",
body=body)
return m... | true | true |
f74045d8500b549605f4ec378b475c401d1092c0 | 40,875 | py | Python | kilojoule/humidair.py | johnfmaddox/kilojoule | b4c146ded82e3ef51a0252ff48b1066a076e9aeb | [
"MIT"
] | null | null | null | kilojoule/humidair.py | johnfmaddox/kilojoule | b4c146ded82e3ef51a0252ff48b1066a076e9aeb | [
"MIT"
] | null | null | null | kilojoule/humidair.py | johnfmaddox/kilojoule | b4c146ded82e3ef51a0252ff48b1066a076e9aeb | [
"MIT"
] | null | null | null | from .units import Quantity, units
from .common import (
invert_dict,
CP_symbUpper_to_units,
preferred_units_from_type,
preferred_units_from_symbol,
)
from .realfluid import Properties as rfprop
from .plotting import PropertyPlot, plt
import CoolProp
from CoolProp.CoolProp import HAPropsSI,set_reference... | 39.340712 | 180 | 0.5703 | from .units import Quantity, units
from .common import (
invert_dict,
CP_symbUpper_to_units,
preferred_units_from_type,
preferred_units_from_symbol,
)
from .realfluid import Properties as rfprop
from .plotting import PropertyPlot, plt
import CoolProp
from CoolProp.CoolProp import HAPropsSI,set_reference... | true | true |
f74047ed40ca4a7b1dd28d1f5812a0b3d3b4d563 | 4,908 | py | Python | api/models.py | buzzlighter97/Ya.Praktikum_YamDB | 20550ad74eff7980026bfe6df3ffcd7db85b39ad | [
"MIT"
] | null | null | null | api/models.py | buzzlighter97/Ya.Praktikum_YamDB | 20550ad74eff7980026bfe6df3ffcd7db85b39ad | [
"MIT"
] | null | null | null | api/models.py | buzzlighter97/Ya.Praktikum_YamDB | 20550ad74eff7980026bfe6df3ffcd7db85b39ad | [
"MIT"
] | null | null | null | from datetime import datetime as dt
from django.contrib.auth import get_user_model
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
User = get_user_model()
"""
MAX_YEARS_TITLES: this value indicates which year ... | 24.663317 | 76 | 0.582518 | from datetime import datetime as dt
from django.contrib.auth import get_user_model
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
User = get_user_model()
MAX_YEARS_TITLES = dt.now().year + 10
class Categori... | true | true |
f74049f783086c0ac98aaa0e292f5ceb6913f665 | 7,087 | py | Python | scripts/mkdoc.py | DusanJovic-NOAA/ccpp-framework | c95101b40df4cf7109c3d34651792d89455690bf | [
"Apache-2.0"
] | null | null | null | scripts/mkdoc.py | DusanJovic-NOAA/ccpp-framework | c95101b40df4cf7109c3d34651792d89455690bf | [
"Apache-2.0"
] | null | null | null | scripts/mkdoc.py | DusanJovic-NOAA/ccpp-framework | c95101b40df4cf7109c3d34651792d89455690bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Functions to generate basic documentation in HTML and LaTeX for CCPP metadata
#
# DH* TODO: create a Python module metadata.py with a class Metadata
# and use this for ccpp_prebuild.py; create to_html and to_latex routines for it
import logging
import os
from common import decode_containe... | 39.814607 | 117 | 0.59461 |
import logging
import os
from common import decode_container, escape_tex
r = metadata_request[var_name][0]
line = '''
\hyperlink{{{standard_name_ref}}}{{\\blue\\underline{{\\execout{{{standard_name}}}}}}} \\\\'''.format(
standard_name=escape_tex(var.standard_name), standard_name_... | true | true |
f7404b2795ed88a6e9af36178538e8b71b5e757e | 851 | py | Python | Game/libs/debugconstants.py | Penaz91/Glitch_Heaven | 0363fc368af205d1e829b2556ad70797930c10bd | [
"MIT"
] | 1 | 2016-04-27T20:38:07.000Z | 2016-04-27T20:38:07.000Z | Game/libs/debugconstants.py | Penaz91/Glitch_Heaven | 0363fc368af205d1e829b2556ad70797930c10bd | [
"MIT"
] | 75 | 2015-10-22T06:10:37.000Z | 2018-09-16T17:02:34.000Z | Game/libs/debugconstants.py | Penaz91/Glitch_Heaven | 0363fc368af205d1e829b2556ad70797930c10bd | [
"MIT"
] | null | null | null | import pygame
_debugkeys_ = {
pygame.K_1: "wallClimb", pygame.K_2: "multiJump",
pygame.K_3: "highJump", pygame.K_4: "featherFalling",
pygame.K_5: "gravity", pygame.K_6: "hover",
pygame.K_7: "stickyCeil", pygame.K_8: "invertedGravity",
pygame.K_9: "permBodies", pygame.K_q: "solidH... | 50.058824 | 67 | 0.629847 | import pygame
_debugkeys_ = {
pygame.K_1: "wallClimb", pygame.K_2: "multiJump",
pygame.K_3: "highJump", pygame.K_4: "featherFalling",
pygame.K_5: "gravity", pygame.K_6: "hover",
pygame.K_7: "stickyCeil", pygame.K_8: "invertedGravity",
pygame.K_9: "permBodies", pygame.K_q: "solidH... | true | true |
f7404b670ea67ab4df11c410d6fd260ff116580d | 997 | py | Python | josephus_survivor.py | emreozturanli/Python-Questions-and-Answers | b24624cebeb571ddc6aa519f743a961fa34f19f6 | [
"MIT"
] | null | null | null | josephus_survivor.py | emreozturanli/Python-Questions-and-Answers | b24624cebeb571ddc6aa519f743a961fa34f19f6 | [
"MIT"
] | null | null | null | josephus_survivor.py | emreozturanli/Python-Questions-and-Answers | b24624cebeb571ddc6aa519f743a961fa34f19f6 | [
"MIT"
] | null | null | null | # ********JOSEPHUS SURVIVOR********
#codewars
# In this kata you have to correctly return who is the "survivor", ie: the last element of a Josephus permutation.
# Basically you have to assume that n people are put into a circle and that they are eliminated in steps of k elements, like this:
# josephus_survivor(7,3)... | 30.212121 | 130 | 0.564694 |
def josephus_survivor(n,k):
lst = list(range(1,n+1))
while len(lst) > 1 :
if len(lst) >= k :
lst = lst[k:] + lst[:k-1]
else:
i = (k % len(lst)) - 1
if i == -1:
lst = lst[:-1]
else:
lst = lst[i+1:... | true | true |
f7404bc5f6f77bff53711e5ce831e82713d3c90c | 3,174 | py | Python | tf_mnist.py | Dongzhou-1996/tf_learning | fe764e78cc1a934707ae01d0847f901cb6fbb8b9 | [
"Apache-2.0"
] | null | null | null | tf_mnist.py | Dongzhou-1996/tf_learning | fe764e78cc1a934707ae01d0847f901cb6fbb8b9 | [
"Apache-2.0"
] | null | null | null | tf_mnist.py | Dongzhou-1996/tf_learning | fe764e78cc1a934707ae01d0847f901cb6fbb8b9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import tensorflow as tf
import os
import numpy as np
import argparse
import shutil
from tensorflow.examples.tutorials.mnist import input_data
parser = argparse.ArgumentParser('MNIST Softmax')
parser.add_argument('--data_dir', type=str, default='/tmp/mnist-data',
... | 44.704225 | 124 | 0.654379 |
import tensorflow as tf
import os
import numpy as np
import argparse
import shutil
from tensorflow.examples.tutorials.mnist import input_data
parser = argparse.ArgumentParser('MNIST Softmax')
parser.add_argument('--data_dir', type=str, default='/tmp/mnist-data',
help='the directory o... | true | true |
f7404c23f64fd4e0c0e77da03d4f8150735b2602 | 1,543 | py | Python | test/test_api_v1.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 5 | 2020-04-02T12:03:57.000Z | 2020-10-18T19:29:15.000Z | test/test_api_v1.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 22 | 2020-03-31T02:00:34.000Z | 2021-06-30T17:59:01.000Z | test/test_api_v1.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 3 | 2020-04-04T16:08:08.000Z | 2020-10-20T01:32:46.000Z | import json
import pytest
from conftest import CI_ENV
@pytest.mark.skipif(CI_ENV, reason="avoid issuing HTTP requests on CI")
def test_user_tweets(api_client):
expected_keys = ['created_at', 'score_bert', 'score_lr', 'score_nb', 'status_id', 'status_text']
response = api_client.get('/api/v1/user_tweets/ber... | 39.564103 | 131 | 0.726507 | import json
import pytest
from conftest import CI_ENV
@pytest.mark.skipif(CI_ENV, reason="avoid issuing HTTP requests on CI")
def test_user_tweets(api_client):
expected_keys = ['created_at', 'score_bert', 'score_lr', 'score_nb', 'status_id', 'status_text']
response = api_client.get('/api/v1/user_tweets/ber... | true | true |
f7404c364bb3fcd0a888b8e151293dbc6fd3a3f2 | 15,525 | py | Python | venv/lib/python3.8/site-packages/plotly/validators/_violin.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | venv/lib/python3.8/site-packages/plotly/validators/_violin.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | venv/lib/python3.8/site-packages/plotly/validators/_violin.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class ViolinValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="violin", parent_name="", **kwargs):
super(ViolinValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_c... | 48.667712 | 71 | 0.548792 | import _plotly_utils.basevalidators
class ViolinValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="violin", parent_name="", **kwargs):
super(ViolinValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_c... | true | true |
f7404d7ea192880ab86e37acaeb02c70421f2853 | 1,502 | py | Python | src/cltkv1/stops/processes.py | todd-cook/cltkv1 | 90c3daaafda242a1982b38c2b11c52aedab7ddf8 | [
"MIT"
] | null | null | null | src/cltkv1/stops/processes.py | todd-cook/cltkv1 | 90c3daaafda242a1982b38c2b11c52aedab7ddf8 | [
"MIT"
] | null | null | null | src/cltkv1/stops/processes.py | todd-cook/cltkv1 | 90c3daaafda242a1982b38c2b11c52aedab7ddf8 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from boltons.cacheutils import cachedproperty
from boltons.strutils import split_punct_ws
from cltkv1.core.data_types import Process
from cltkv1.stops.words import Stops
@dataclass
class StopsProcess(Process):
"""
>>> from cltkv1.core.data_types import Doc, Word
>>> fr... | 31.957447 | 107 | 0.664447 | from dataclasses import dataclass
from boltons.cacheutils import cachedproperty
from boltons.strutils import split_punct_ws
from cltkv1.core.data_types import Process
from cltkv1.stops.words import Stops
@dataclass
class StopsProcess(Process):
language: str = None
@cachedproperty
def algorithm(self):
... | true | true |
f7404d966e2999ccfcb232dc74d8d591fcf06803 | 595 | py | Python | tests/test_http_pipeline.py | Poorvak/http_pipeline | 2e5711c3f44bb88e55eaae6dbf888d2ff626f997 | [
"CC-BY-3.0",
"MIT"
] | null | null | null | tests/test_http_pipeline.py | Poorvak/http_pipeline | 2e5711c3f44bb88e55eaae6dbf888d2ff626f997 | [
"CC-BY-3.0",
"MIT"
] | 633 | 2018-02-05T00:02:14.000Z | 2022-03-28T05:38:30.000Z | tests/test_http_pipeline.py | Poorvak/http_pipeline | 2e5711c3f44bb88e55eaae6dbf888d2ff626f997 | [
"CC-BY-3.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `http_pipeline` package."""
import pytest
from http_pipeline import http_pipeline
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return reque... | 22.884615 | 78 | 0.704202 |
import pytest
from http_pipeline import http_pipeline
@pytest.fixture
def response():
def test_content(response):
| true | true |
f7404dd23bdb552dd96e5b0f86101c724fd9da4e | 6,793 | py | Python | dnn/loss.py | MalayAgr/DeepNeuralNetworksFromScratch | ded75b148d9bb497014c016bfd2d7d0280c007ab | [
"MIT"
] | 4 | 2021-08-01T19:18:42.000Z | 2022-01-09T01:16:26.000Z | dnn/loss.py | MalayAgr/DeepNeuralNetworksFromScratch | ded75b148d9bb497014c016bfd2d7d0280c007ab | [
"MIT"
] | null | null | null | dnn/loss.py | MalayAgr/DeepNeuralNetworksFromScratch | ded75b148d9bb497014c016bfd2d7d0280c007ab | [
"MIT"
] | null | null | null | from __future__ import annotations
from abc import ABC, abstractmethod
import numpy as np
from numba import njit
@njit(cache=True)
def _clip(a: np.ndarray, epsilon: float) -> np.ndarray:
if ((a == 1) | (a <= 0)).any():
a = np.maximum(a, epsilon).astype(np.float32)
a = np.minimum(1 - epsilon, a).... | 29.663755 | 92 | 0.629619 | from __future__ import annotations
from abc import ABC, abstractmethod
import numpy as np
from numba import njit
@njit(cache=True)
def _clip(a: np.ndarray, epsilon: float) -> np.ndarray:
if ((a == 1) | (a <= 0)).any():
a = np.maximum(a, epsilon).astype(np.float32)
a = np.minimum(1 - epsilon, a).... | true | true |
f7404fe473b756e941478f7613628a96fa8f59b5 | 4,097 | py | Python | Battle_Of_Two_K/my_class.py | Battle-Of-Two-K/NumericalMethods | 88fe581fe4cb4d5e676f368e9de562f99c324674 | [
"MIT"
] | null | null | null | Battle_Of_Two_K/my_class.py | Battle-Of-Two-K/NumericalMethods | 88fe581fe4cb4d5e676f368e9de562f99c324674 | [
"MIT"
] | null | null | null | Battle_Of_Two_K/my_class.py | Battle-Of-Two-K/NumericalMethods | 88fe581fe4cb4d5e676f368e9de562f99c324674 | [
"MIT"
] | null | null | null | import copy
class My_matrix:
def __init__(self, matrix):
self.matrix = matrix
def __str__(self):
out = f'{self.matrix_size}\n'
for row in self.matrix:
out += str(row) + '\n'
return out
def null_matrix(self):
return [[0 for i in self.range_row()] for j ... | 26.953947 | 94 | 0.508177 | import copy
class My_matrix:
def __init__(self, matrix):
self.matrix = matrix
def __str__(self):
out = f'{self.matrix_size}\n'
for row in self.matrix:
out += str(row) + '\n'
return out
def null_matrix(self):
return [[0 for i in self.range_row()] for j ... | true | true |
f740506fdd4d745bc85979159f4277704a5920e5 | 14,985 | py | Python | third_party/py/gflags/gflags/_helpers.py | timm-gs/bazel | d16012774f97d8a3d0f7732e116dba8ab636a4cb | [
"Apache-2.0"
] | 17 | 2017-10-25T05:39:49.000Z | 2021-03-03T07:32:13.000Z | third_party/py/gflags/gflags/_helpers.py | timm-gs/bazel | d16012774f97d8a3d0f7732e116dba8ab636a4cb | [
"Apache-2.0"
] | null | null | null | third_party/py/gflags/gflags/_helpers.py | timm-gs/bazel | d16012774f97d8a3d0f7732e116dba8ab636a4cb | [
"Apache-2.0"
] | 6 | 2018-02-13T06:55:59.000Z | 2019-05-26T15:24:45.000Z | #!/usr/bin/env python
# Copyright 2002 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of c... | 34.767981 | 100 | 0.701702 |
import collections
import os
import re
import struct
import sys
import textwrap
try:
import fcntl
except ImportError:
fcntl = None
try:
import termios
except ImportError:
termios = None
import third_party.pep257 as pep257
import six
_DEFAULT_HELP_WIDTH = 80
_MIN_HELP_... | true | true |
f7405098b1ce59a39682290c2e92850cdd8441fd | 56,362 | py | Python | Lib/test/test_array.py | devnexen/RustPython | 345a4f912c83ce723fc859ab934c17ffe3f2b57a | [
"CC-BY-4.0",
"MIT"
] | 2 | 2021-09-03T16:15:06.000Z | 2021-09-03T16:19:28.000Z | Lib/test/test_array.py | devnexen/RustPython | 345a4f912c83ce723fc859ab934c17ffe3f2b57a | [
"CC-BY-4.0",
"MIT"
] | 6 | 2021-10-01T13:51:43.000Z | 2021-11-17T13:27:14.000Z | Lib/test/test_array.py | devnexen/RustPython | 345a4f912c83ce723fc859ab934c17ffe3f2b57a | [
"CC-BY-4.0",
"MIT"
] | 1 | 2020-08-04T12:13:42.000Z | 2020-08-04T12:13:42.000Z | """Test the arraymodule.
Roger E. Masse
"""
import unittest
from test import support
from test.support import _2G, os_helper
import weakref
import pickle
import operator
import struct
import sys
import warnings
import array
from array import _array_reconstructor as array_reconstructor
sizeof_wchar = array.array('... | 34.055589 | 92 | 0.576009 |
import unittest
from test import support
from test.support import _2G, os_helper
import weakref
import pickle
import operator
import struct
import sys
import warnings
import array
from array import _array_reconstructor as array_reconstructor
sizeof_wchar = array.array('u').itemsize
class ArraySubclass(array.array)... | true | true |
f74051fd7306d34e53f50db8c91666f44b3ca8f7 | 3,624 | py | Python | src/screen.py | QuentinBubu/trophees-nsi-2022 | 3402b584de7b07b54b6e97332d279f670efe48c2 | [
"MIT"
] | null | null | null | src/screen.py | QuentinBubu/trophees-nsi-2022 | 3402b584de7b07b54b6e97332d279f670efe48c2 | [
"MIT"
] | 2 | 2022-03-01T10:51:46.000Z | 2022-03-15T19:51:18.000Z | src/screen.py | QuentinBubu/trophees-nsi-2022 | 3402b584de7b07b54b6e97332d279f670efe48c2 | [
"MIT"
] | 1 | 2022-03-29T17:02:17.000Z | 2022-03-29T17:02:17.000Z | import pygame
from pygameSettings import afficher_text
class Screen:
WAITING = 'waiting'
PROLOGUE = 'prologue'
MAIN = 'main'
sprites = pygame.sprite.Group()
on_screen = {}
def __init__(self) -> None:
"""Initialisation classe Screen pour gerer l'affichage
Arguments : screen ... | 32.070796 | 93 | 0.548565 | import pygame
from pygameSettings import afficher_text
class Screen:
WAITING = 'waiting'
PROLOGUE = 'prologue'
MAIN = 'main'
sprites = pygame.sprite.Group()
on_screen = {}
def __init__(self) -> None:
pygame.init()
self.screen = pygame.display.set_mode((1280, 720), pygame.RES... | true | true |
f7405214feb2748d30e6cb0e66454d75f42ee019 | 1,353 | py | Python | DatastructureAndAlgorithms/4_ArrayAndString/10_maximum_index.py | sabyasachisome/DatastructureAndAlgorithms | 5c810bc1b1f31a856d9331673305c0021453c572 | [
"MIT"
] | null | null | null | DatastructureAndAlgorithms/4_ArrayAndString/10_maximum_index.py | sabyasachisome/DatastructureAndAlgorithms | 5c810bc1b1f31a856d9331673305c0021453c572 | [
"MIT"
] | null | null | null | DatastructureAndAlgorithms/4_ArrayAndString/10_maximum_index.py | sabyasachisome/DatastructureAndAlgorithms | 5c810bc1b1f31a856d9331673305c0021453c572 | [
"MIT"
] | null | null | null | """
Given an array A[] of N positive integers.
The task is to find the maximum of j - i subjected to the constraint of A[i] <= A[j].
Example 1:
Input:
N = 2
A[] = {1, 10}
Output:
1
Explanation:
A[0]<=A[1] so (j-i) is 1-0 = 1.
Example 2:
Input:
N = 9
A[] = {34, 8, 10, 3, 2, 80, 30, 33, 1}
Output:
6
Explanation:
In t... | 24.160714 | 101 | 0.601626 |
class Solution:
def maxIndexDiff(self, arr, n):
max_diff=0
for i in range(n):
j=n-1
while(j>i):
if arr[i]<arr[j] and j-i>max_diff:
max_diff=j-i
j-=1
return max_diff
... | true | true |
f740525eb8f615afc79833efbc9820348da5b5fb | 6,127 | py | Python | unlock/bci/decode/__init__.py | NeuralProsthesisLab/unlock | 0c4d95abdab288d3e657ca2db867b06f755f26ff | [
"BSD-3-Clause"
] | 6 | 2017-05-05T01:08:55.000Z | 2021-08-03T21:50:07.000Z | unlock/bci/decode/__init__.py | NeuralProsthesisLab/unlock | 0c4d95abdab288d3e657ca2db867b06f755f26ff | [
"BSD-3-Clause"
] | 1 | 2015-05-21T01:02:50.000Z | 2015-05-21T16:03:43.000Z | unlock/bci/decode/__init__.py | NeuralProsthesisLab/unlock | 0c4d95abdab288d3e657ca2db867b06f755f26ff | [
"BSD-3-Clause"
] | 4 | 2015-05-21T12:38:42.000Z | 2022-03-28T15:47:58.000Z | # Copyright (c) James Percent, Byron Galbraith and Unlock contributors.
# 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 notic... | 46.067669 | 99 | 0.699853 |
import numpy as np
from unlock.bci.decode.decode import *
from unlock.bci.decode.harmonic import *
from unlock.bci.decode.femg import *
from unlock.bci.decode.eyeblink import *
from unlock.bci.decode.tm import *
class UnlockDecoderFactory(object):
def create_decoder(self, decoder, *... | true | true |
f74052fc75149623c53807a92dbaed0dc80b21ed | 398 | py | Python | missions/Road To Centurion/1.2 Brain Teaser.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | 1 | 2022-01-04T03:47:34.000Z | 2022-01-04T03:47:34.000Z | missions/Road To Centurion/1.2 Brain Teaser.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | 4 | 2021-04-13T07:03:37.000Z | 2021-12-15T11:34:05.000Z | missions/Road To Centurion/1.2 Brain Teaser.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | null | null | null | from ktane.directors import BombSolver, from_pool
from ktane.mods.c import ColourFlash
from ktane.vanilla import (ComplicatedWires, Memory, WhosOnFirst, WireSequence,
Password, Wires, TheButton, Keypad)
BombSolver(
ColourFlash(),
ComplicatedWires(),
*from_pool(Memory, WhosOnFirst... | 33.166667 | 79 | 0.718593 | from ktane.directors import BombSolver, from_pool
from ktane.mods.c import ColourFlash
from ktane.vanilla import (ComplicatedWires, Memory, WhosOnFirst, WireSequence,
Password, Wires, TheButton, Keypad)
BombSolver(
ColourFlash(),
ComplicatedWires(),
*from_pool(Memory, WhosOnFirst... | true | true |
f7405322518a66f963b74f15aa3f85fb9446b57c | 1,187 | py | Python | build/lib/Quantuiti/_ema.py | dmuraco3/CompuTradePython | 5c2bc4d1d3baabd68677b8c3d78b8caeed52ba28 | [
"Apache-2.0"
] | null | null | null | build/lib/Quantuiti/_ema.py | dmuraco3/CompuTradePython | 5c2bc4d1d3baabd68677b8c3d78b8caeed52ba28 | [
"Apache-2.0"
] | null | null | null | build/lib/Quantuiti/_ema.py | dmuraco3/CompuTradePython | 5c2bc4d1d3baabd68677b8c3d78b8caeed52ba28 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def ema(self, N):
"""
Simple Moving Average = (N - PeriodSum) / N
N = number of days in a given period
PeriodSum = sum of stock closing prices in that period
"""
name = 'ema_' + str(N)
dependent = 'sma_' + str(N)
try:
return self.data[name][self.index]
... | 33.914286 | 129 | 0.47936 | import numpy as np
def ema(self, N):
name = 'ema_' + str(N)
dependent = 'sma_' + str(N)
try:
return self.data[name][self.index]
except Exception as error:
self.sma(N)
print(self.data.head())
temp=[]
for index, row in self.data.iterrows():
... | true | true |
f74053718f0bd617347898c99e1841d104fae1cd | 33,191 | py | Python | tests/core/full_node/test_full_node_store.py | 13thProgression/lotus-blockchain | ea6d1973cac256bc0dae790a23aac3fe6925dd4e | [
"Apache-2.0"
] | 4 | 2021-08-24T19:43:33.000Z | 2022-02-09T04:29:56.000Z | tests/core/full_node/test_full_node_store.py | 13thProgression/lotus-blockchain | ea6d1973cac256bc0dae790a23aac3fe6925dd4e | [
"Apache-2.0"
] | 5 | 2021-08-24T22:55:58.000Z | 2022-01-11T11:44:04.000Z | tests/core/full_node/test_full_node_store.py | 13thProgression/lotus-blockchain | ea6d1973cac256bc0dae790a23aac3fe6925dd4e | [
"Apache-2.0"
] | 3 | 2021-09-10T17:13:31.000Z | 2022-03-15T08:47:21.000Z | # flake8: noqa: F811, F401
import asyncio
import atexit
import logging
from secrets import token_bytes
from typing import List, Optional
import pytest
from lotus.consensus.blockchain import ReceiveBlockResult
from lotus.consensus.multiprocess_validation import PreValidationResult
from lotus.consensus.pot_iterations i... | 44.551678 | 120 | 0.625742 |
import asyncio
import atexit
import logging
from secrets import token_bytes
from typing import List, Optional
import pytest
from lotus.consensus.blockchain import ReceiveBlockResult
from lotus.consensus.multiprocess_validation import PreValidationResult
from lotus.consensus.pot_iterations import is_overflow_block
fr... | true | true |
f74053c382947a53aed43ff4529eb3fe7e80aa5a | 657 | py | Python | openpipe/actions/transform/using/regex/assign_.py | OpenPipe/openpipe | bf00bafc1d9240459dd26873141074b89b53d36f | [
"Apache-2.0"
] | 2 | 2021-01-28T15:33:15.000Z | 2022-03-09T10:20:27.000Z | openpipe/actions/transform/using/regex/assign_.py | Openpipe/openpipe | bf00bafc1d9240459dd26873141074b89b53d36f | [
"Apache-2.0"
] | 35 | 2019-03-22T10:49:21.000Z | 2019-11-29T09:23:47.000Z | openpipe/actions/transform/using/regex/assign_.py | OpenPipe/openpipe | bf00bafc1d9240459dd26873141074b89b53d36f | [
"Apache-2.0"
] | 1 | 2022-01-26T22:08:40.000Z | 2022-01-26T22:08:40.000Z | """
Build a dictionary from a key/map regex group expression
"""
from openpipe.pipeline.engine import ActionRuntime
from re import compile, MULTILINE
class Action(ActionRuntime):
category = "Data Transformation"
required_config = """
regex: # A regex expression that must match two groups:
... | 25.269231 | 64 | 0.637747 | from openpipe.pipeline.engine import ActionRuntime
from re import compile, MULTILINE
class Action(ActionRuntime):
category = "Data Transformation"
required_config = """
regex: # A regex expression that must match two groups:
# (group1) (group2)
"""
def on_start(self, config... | true | true |
f74054611ccea3131676d187a7213d70f3e899ce | 3,790 | py | Python | 2018/07/solution.py | jrm5100/advent-of-code-python | 1f448ef0b87bb305814444d1b7f865493d455104 | [
"MIT"
] | null | null | null | 2018/07/solution.py | jrm5100/advent-of-code-python | 1f448ef0b87bb305814444d1b7f865493d455104 | [
"MIT"
] | null | null | null | 2018/07/solution.py | jrm5100/advent-of-code-python | 1f448ef0b87bb305814444d1b7f865493d455104 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
##############
# Load input #
##############
def load_input():
incomplete_steps = set() # incomplete steps, initalized to all steps
requirements = dict() # map steps to the required steps that must be completed first
with open("input.txt", "r") as f:
for line in f:
... | 39.479167 | 141 | 0.637467 |
prerequisite = line.split(' ')[1]
incomplete_steps.add(step)
incomplete_steps.add(prerequisite)
if step not in requirements:
requirements[step] = set(prerequisite)
else:
requirements[step].add(prerequisite)
ret... | true | true |
f7405464ab07406c3df5c9951266c75251015f9c | 3,195 | py | Python | bilstm_crf_ner/model/ner_model.py | rufinob/ehr-relation-extraction | d23e38a08de8c08e1d2de3f840b65fbbb4b61d8c | [
"MIT"
] | 43 | 2020-12-02T11:04:38.000Z | 2022-03-28T15:07:06.000Z | bilstm_crf_ner/model/ner_model.py | rufinob/ehr-relation-extraction | d23e38a08de8c08e1d2de3f840b65fbbb4b61d8c | [
"MIT"
] | 17 | 2021-05-05T00:19:17.000Z | 2022-03-17T03:14:58.000Z | bilstm_crf_ner/model/ner_model.py | rufinob/ehr-relation-extraction | d23e38a08de8c08e1d2de3f840b65fbbb4b61d8c | [
"MIT"
] | 23 | 2020-11-12T00:03:19.000Z | 2022-03-16T10:32:30.000Z | #from fastai.text import *
from .core import *
class NERModel(nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.use_elmo = config.use_elmo
if not self.use_elmo:
self.emb = nn.Embedding(self.config.nwords, self.config.dim_word, padding... | 38.963415 | 170 | 0.620344 |
from .core import *
class NERModel(nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.use_elmo = config.use_elmo
if not self.use_elmo:
self.emb = nn.Embedding(self.config.nwords, self.config.dim_word, padding_idx=0)
self.c... | true | true |
f7405486c3624f6b83c8bc901bb14c3dfe91a78f | 30,533 | py | Python | pytext/metrics/__init__.py | debowin/pytext | 91126bb34bd689f3513f25ca0d356ad374e004ab | [
"BSD-3-Clause"
] | 3 | 2019-10-19T11:16:12.000Z | 2021-11-17T11:09:00.000Z | pytext/metrics/__init__.py | debowin/pytext | 91126bb34bd689f3513f25ca0d356ad374e004ab | [
"BSD-3-Clause"
] | null | null | null | pytext/metrics/__init__.py | debowin/pytext | 91126bb34bd689f3513f25ca0d356ad374e004ab | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
from collections import defaultdict
from json import dumps as json_dumps
from typing import (
Any,
DefaultDict,
Dict,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
)
... | 33.552747 | 107 | 0.628566 |
import itertools
from collections import defaultdict
from json import dumps as json_dumps
from typing import (
Any,
DefaultDict,
Dict,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
)
import numpy as np
from pytext.utils import cuda
from pytext.utils.ascii_table import ascii... | true | true |
f74054c4d8a41d781697ed54e9f0b9c765213d5b | 3,726 | py | Python | core/domain/email_jobs_one_off_test.py | netajik/oppia | d3780352d615db7438e010c5aa5eb60588bb7de6 | [
"Apache-2.0"
] | 1 | 2019-01-31T18:48:50.000Z | 2019-01-31T18:48:50.000Z | core/domain/email_jobs_one_off_test.py | netajik/oppia | d3780352d615db7438e010c5aa5eb60588bb7de6 | [
"Apache-2.0"
] | 1 | 2020-01-26T14:02:43.000Z | 2020-01-26T14:02:43.000Z | core/domain/email_jobs_one_off_test.py | netajik/oppia | d3780352d615db7438e010c5aa5eb60588bb7de6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 38.412371 | 79 | 0.672571 |
import datetime
import types
from core.domain import email_jobs_one_off
from core.platform import models
from core.tests import test_utils
import feconf
(email_models,) = models.Registry.import_models([models.NAMES.email])
taskqueue_services = models.Registry.import_taskqueue_services()
class Emai... | true | true |
f74055af35e039ceebef9de681ea52a4fa3c2126 | 3,712 | py | Python | web-server/code/03-handlers/server-index-page.py | choosewhatulike/500lines | fba689d101eb5600f5c8f4d7fd79912498e950e2 | [
"CC-BY-3.0"
] | 26,185 | 2015-01-01T04:59:51.000Z | 2022-03-31T10:20:14.000Z | web-server/code/03-handlers/server-index-page.py | fsxchen/500lines | 3f2cd407ebedaf0a3cfa6858c4cf94543067433d | [
"CC-BY-3.0"
] | 160 | 2015-01-05T12:20:21.000Z | 2021-10-03T07:25:43.000Z | web-server/code/03-handlers/server-index-page.py | fsxchen/500lines | 3f2cd407ebedaf0a3cfa6858c4cf94543067433d | [
"CC-BY-3.0"
] | 6,572 | 2015-01-01T01:31:00.000Z | 2022-03-31T07:31:22.000Z | import sys, os, BaseHTTPServer
#-------------------------------------------------------------------------------
class ServerException(Exception):
'''For internal error reporting.'''
pass
#-------------------------------------------------------------------------------
class case_no_file(object):
'''File ... | 29.696 | 80 | 0.515356 | import sys, os, BaseHTTPServer
class ServerException(Exception):
pass
class case_no_file(object):
def test(self, handler):
return not os.path.exists(handler.full_path)
def act(self, handler):
raise ServerException("'{0}' not found".format(handler.path))
class case_existing_file(ob... | true | true |
f74055b0459ce41641901d5d89c293885fa8a12a | 8,580 | py | Python | scripts/label_image_flask.py | Seb-Park/tensorflow-for-poets-2 | 1ef4112553b25f1c687b40b6872d4a97b9d44762 | [
"Apache-2.0"
] | null | null | null | scripts/label_image_flask.py | Seb-Park/tensorflow-for-poets-2 | 1ef4112553b25f1c687b40b6872d4a97b9d44762 | [
"Apache-2.0"
] | null | null | null | scripts/label_image_flask.py | Seb-Park/tensorflow-for-poets-2 | 1ef4112553b25f1c687b40b6872d4a97b9d44762 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.648649 | 137 | 0.675058 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
from flask import Flask, escape, request, jsonify
import argparse
import sys
import time
import numpy as np
import requests
import tensorflow as tf
app = Flask(__name__)
@app.rout... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.