hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f84601803d72cfa1638fcfd7b2402d63e07ffb | 95 | py | Python | src/PythonDotNet/echo_and_sleep.py | ravikhubchandani/dynamic-web-scraper | a0ae988d52756dc43d25a0eed2752000e97a7491 | [
"MIT"
] | null | null | null | src/PythonDotNet/echo_and_sleep.py | ravikhubchandani/dynamic-web-scraper | a0ae988d52756dc43d25a0eed2752000e97a7491 | [
"MIT"
] | null | null | null | src/PythonDotNet/echo_and_sleep.py | ravikhubchandani/dynamic-web-scraper | a0ae988d52756dc43d25a0eed2752000e97a7491 | [
"MIT"
] | 1 | 2021-07-22T22:54:59.000Z | 2021-07-22T22:54:59.000Z | import sys
import time
msg = sys.argv[1]
sleep = sys.argv[2]
print(msg)
time.sleep(int(sleep)) | 13.571429 | 22 | 0.715789 | import sys
import time
msg = sys.argv[1]
sleep = sys.argv[2]
print(msg)
time.sleep(int(sleep)) | true | true |
f7f846b13ce4b89c41ba206b73951ba6c3817680 | 2,159 | py | Python | bldc/odrive/drag_profiler.py | rravenel/furuta_pendulum | b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f | [
"MIT"
] | 2 | 2021-09-23T16:29:23.000Z | 2021-09-30T19:55:44.000Z | bldc/odrive/drag_profiler.py | rravenel/furuta_pendulum | b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f | [
"MIT"
] | null | null | null | bldc/odrive/drag_profiler.py | rravenel/furuta_pendulum | b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f | [
"MIT"
] | null | null | null | import odrive
import matplotlib.pyplot as plt
import time
'''
Measure internal drag/friction. Spin it up and clock it slowing down.
1465rpm / 154 rad/s / 24.4Hz: -356 rad/s^2
2197rpm / 230 rad/s / 36.6Hz: -378 rad/s^2
2930rpm / 307 rad/s / 48.8Hz: -342 rad/s^2
3663rpm / 383 rad/s / 61.0Hz: -324 rad/s^2
'''
# max is... | 18.29661 | 70 | 0.64428 | import odrive
import matplotlib.pyplot as plt
import time
v_target = 500000
t_sample = 5
still_count = 20
c2rad = 1303.8
t_cut = 1.05
v_sample = 25
print("Connecting...")
d = odrive.find_any()
print("Connected")
x = d.axis0
x.controller.config.control_mode = 1
x.controller.current_setpoint = 0
def test():
x.contr... | true | true |
f7f847160404de669c8660bda4ba3cd69e81f082 | 5,560 | py | Python | tensorpack/train/input_data.py | arassadin/SYQ | d30e6f0053ada3ad504038698a8756425594aa22 | [
"Apache-2.0"
] | 1 | 2018-03-23T16:26:23.000Z | 2018-03-23T16:26:23.000Z | tensorpack/train/input_data.py | andrewliao11/Andrew_tensorpack | 735a2672e3d93b5b612a303b5b6d222e9b2d4280 | [
"Apache-2.0"
] | 1 | 2019-03-10T16:32:12.000Z | 2019-03-11T11:08:52.000Z | tensorpack/train/input_data.py | arassadin/SYQ | d30e6f0053ada3ad504038698a8756425594aa22 | [
"Apache-2.0"
] | 2 | 2019-01-18T15:10:51.000Z | 2019-02-20T17:04:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: input_data.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import tensorflow as tf
import threading
from abc import ABCMeta, abstractmethod
import six
from ..dataflow import DataFlow, RepeatedData
from ..tfutils.summary import add_moving_summary
from ..utils import lo... | 33.095238 | 98 | 0.60054 |
import tensorflow as tf
import threading
from abc import ABCMeta, abstractmethod
import six
from ..dataflow import DataFlow, RepeatedData
from ..tfutils.summary import add_moving_summary
from ..utils import logger
from ..callbacks.concurrency import StartProcOrThread
__all__ = ['QueueInput', 'FeedfreeInput', 'Te... | true | true |
f7f847432998927e6c55b2038310d7fb3624be7d | 23,244 | py | Python | tests/annotations/tests.py | shinshin86/django | 5cc81cd9eb69f5f7a711412c02039b435c393135 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-05-13T10:40:59.000Z | 2019-05-13T10:40:59.000Z | tests/annotations/tests.py | Blaahborgh/django | c591bc3ccece1514d6b419826c7fa36ada9d9213 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-27T16:40:34.000Z | 2019-09-27T16:40:34.000Z | tests/annotations/tests.py | Blaahborgh/django | c591bc3ccece1514d6b419826c7fa36ada9d9213 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-11-04T08:47:02.000Z | 2020-11-04T08:47:02.000Z | import datetime
from decimal import Decimal
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db.models import (
BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, F, Func,
IntegerField, NullBooleanField, Q, Sum, Value,
)
from django.db.models.functions import Length, ... | 41.507143 | 115 | 0.606307 | import datetime
from decimal import Decimal
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db.models import (
BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, F, Func,
IntegerField, NullBooleanField, Q, Sum, Value,
)
from django.db.models.functions import Length, ... | true | true |
f7f8475cb28bcec67b527f653609827444f4b7f3 | 16,077 | py | Python | swagger_to/swagger.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | swagger_to/swagger.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | swagger_to/swagger.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | """Parse Swagger spec."""
import collections
from enum import Enum
import pathlib
from typing import List, Optional, MutableMapping, Any, Set, Tuple, Union # pylint: disable=unused-import
import yaml
from yaml.composer import Composer
from yaml.constructor import Constructor
# pylint: disable=missing-docstring,too-... | 34.426124 | 119 | 0.64981 |
import collections
from enum import Enum
import pathlib
from typing import List, Optional, MutableMapping, Any, Set, Tuple, Union
import yaml
from yaml.composer import Composer
from yaml.constructor import Constructor
class OptionKey(Enum):
PermitAbsenseOfOperationId = "PermitAbsenseOfOperationId"
Perm... | true | true |
f7f8476ba6d8932d191686e45f693ff9d7952891 | 24,350 | py | Python | nova/virt/hyperv/vmutils.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | 1 | 2019-06-19T17:56:41.000Z | 2019-06-19T17:56:41.000Z | nova/virt/hyperv/vmutils.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | null | null | null | nova/virt/hyperv/vmutils.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | 1 | 2020-07-24T06:47:54.000Z | 2020-07-24T06:47:54.000Z | # Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl / Pedro Navarro Perez
# 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
#
# ... | 42.055268 | 79 | 0.618973 |
import sys
import time
import uuid
if sys.platform == 'win32':
import wmi
from oslo.config import cfg
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.virt.hyperv import constants
CONF = cfg.CONF
LOG = logging... | true | true |
f7f8476d880ca6fb2e644208a0320ec7f6e88bd7 | 2,031 | py | Python | python_research/preprocessing/attribute_profiles/max_tree/attribute_matrix_construction.py | myychal/hypernet | 778e9c1a2f27ab1c664bb6d8ea49c65d0c7bdade | [
"MIT"
] | null | null | null | python_research/preprocessing/attribute_profiles/max_tree/attribute_matrix_construction.py | myychal/hypernet | 778e9c1a2f27ab1c664bb6d8ea49c65d0c7bdade | [
"MIT"
] | null | null | null | python_research/preprocessing/attribute_profiles/max_tree/attribute_matrix_construction.py | myychal/hypernet | 778e9c1a2f27ab1c664bb6d8ea49c65d0c7bdade | [
"MIT"
] | null | null | null | import numpy as np
from .attributes_incrementally import StandardDeviation, LengthOfDiagonal, \
FirstHuMoment, Area
from ..utils.data_types import Pixel
def construct_area_matrix(image: np.ndarray) -> np.ndarray:
matrix = np.ones(image.shape, dtype=Area)
image_width = image.shape[1]
for index, _ in en... | 33.295082 | 76 | 0.6903 | import numpy as np
from .attributes_incrementally import StandardDeviation, LengthOfDiagonal, \
FirstHuMoment, Area
from ..utils.data_types import Pixel
def construct_area_matrix(image: np.ndarray) -> np.ndarray:
matrix = np.ones(image.shape, dtype=Area)
image_width = image.shape[1]
for index, _ in en... | true | true |
f7f848b326c1f102b2fdefcf278ec8a88cba3e85 | 5,682 | py | Python | cooltools/cli/logbin_expected.py | Phlya/cooltools | 4fa1d11344cd652622dedcc24c99cd0d5458029b | [
"MIT"
] | null | null | null | cooltools/cli/logbin_expected.py | Phlya/cooltools | 4fa1d11344cd652622dedcc24c99cd0d5458029b | [
"MIT"
] | null | null | null | cooltools/cli/logbin_expected.py | Phlya/cooltools | 4fa1d11344cd652622dedcc24c99cd0d5458029b | [
"MIT"
] | 1 | 2019-11-14T12:24:41.000Z | 2019-11-14T12:24:41.000Z | import pandas as pd
import numpy as np
from functools import partial
from .. import expected
from ..lib.common import read_expected
import click
from .util import validate_csv
from . import cli
@cli.command()
@click.argument(
"expected_path",
metavar="EXPECTED_PATH",
type=str,
callback=partial(valida... | 32.655172 | 112 | 0.681978 | import pandas as pd
import numpy as np
from functools import partial
from .. import expected
from ..lib.common import read_expected
import click
from .util import validate_csv
from . import cli
@cli.command()
@click.argument(
"expected_path",
metavar="EXPECTED_PATH",
type=str,
callback=partial(valida... | true | true |
f7f848fff026443704348bf0031d34da4fc32000 | 374 | py | Python | gekitchensdk/erd/values/dishwasher/__init__.py | joelmoses/gekitchensdk | f3253262c7f6f2c26e5ad4143c20e788b28c57a9 | [
"MIT"
] | null | null | null | gekitchensdk/erd/values/dishwasher/__init__.py | joelmoses/gekitchensdk | f3253262c7f6f2c26e5ad4143c20e788b28c57a9 | [
"MIT"
] | null | null | null | gekitchensdk/erd/values/dishwasher/__init__.py | joelmoses/gekitchensdk | f3253262c7f6f2c26e5ad4143c20e788b28c57a9 | [
"MIT"
] | null | null | null | from .erd_cycle_state import ErdCycleStateRaw, ErdCycleState
from .erd_operating_mode import ErdOperatingMode
from .erd_rinse_agent import ErdRinseAgentRaw, ErdRinseAgent
from .operating_mode import OperatingMode
from .cycle_state_mapping import CYCLE_STATE_RAW_MAP
from .operating_mode_mapping import OPERATING_MODE_MAP... | 46.75 | 60 | 0.895722 | from .erd_cycle_state import ErdCycleStateRaw, ErdCycleState
from .erd_operating_mode import ErdOperatingMode
from .erd_rinse_agent import ErdRinseAgentRaw, ErdRinseAgent
from .operating_mode import OperatingMode
from .cycle_state_mapping import CYCLE_STATE_RAW_MAP
from .operating_mode_mapping import OPERATING_MODE_MAP... | true | true |
f7f8493ffa1855e0ca69e2e1385060c8e9c1ef8a | 3,606 | py | Python | luzfcb_todo/migrations/0001_initial.py | luzfcb/luzfcb_todo | 85af6ef8a4d3995a4577abc61c851317b37f2feb | [
"BSD-2-Clause"
] | null | null | null | luzfcb_todo/migrations/0001_initial.py | luzfcb/luzfcb_todo | 85af6ef8a4d3995a4577abc61c851317b37f2feb | [
"BSD-2-Clause"
] | null | null | null | luzfcb_todo/migrations/0001_initial.py | luzfcb/luzfcb_todo | 85af6ef8a4d3995a4577abc61c851317b37f2feb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... | 54.636364 | 214 | 0.630893 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
o... | true | true |
f7f849f98d43fda3731248f671e2104b55408e37 | 1,912 | py | Python | backend_admin/urls.py | sougannkyou/AppSimulator | 0803d557b0451b049f11e90c258ec11f7074a2ac | [
"MIT"
] | 6 | 2018-10-21T03:41:03.000Z | 2021-12-17T11:09:50.000Z | backend_admin/urls.py | sougannkyou/AppSimulator | 0803d557b0451b049f11e90c258ec11f7074a2ac | [
"MIT"
] | null | null | null | backend_admin/urls.py | sougannkyou/AppSimulator | 0803d557b0451b049f11e90c258ec11f7074a2ac | [
"MIT"
] | 4 | 2020-01-30T14:46:50.000Z | 2021-12-04T01:07:46.000Z | from django.conf.urls import url, patterns
from . import views
from django.views.generic import RedirectView
# from django.views.generic.simple import redirect_to
# from django.views.generic.simple import redirect_to
urlpatterns = [
url(r'^test/$', views.test, name='test'),
url(r'^$', views.index, name='index... | 56.235294 | 121 | 0.70659 | from django.conf.urls import url, patterns
from . import views
from django.views.generic import RedirectView
urlpatterns = [
url(r'^test/$', views.test, name='test'),
url(r'^$', views.index, name='index'),
url(r'^login$', views.login_view, name='login'),
url(r'^logout$', views.logout_view, name='log... | true | true |
f7f84a499e54ce8fd34b532a1823beb6545c1e4b | 781 | py | Python | src/cobra/core/plugins/base/structs.py | lyoniionly/django-cobra | 2427e5cf74b7739115b1224da3306986b3ee345c | [
"Apache-2.0"
] | 1 | 2015-01-27T08:56:46.000Z | 2015-01-27T08:56:46.000Z | src/cobra/core/plugins/base/structs.py | lyoniionly/django-cobra | 2427e5cf74b7739115b1224da3306986b3ee345c | [
"Apache-2.0"
] | null | null | null | src/cobra/core/plugins/base/structs.py | lyoniionly/django-cobra | 2427e5cf74b7739115b1224da3306986b3ee345c | [
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import, print_function
__all__ = ('Annotation', 'Notification')
import warnings
class Annotation(object):
__slots__ = ['label', 'url', 'description']
def __init__(self, label, url=None, description=None):
self.label = label
self.url = url
self.descri... | 23.666667 | 87 | 0.627401 |
from __future__ import absolute_import, print_function
__all__ = ('Annotation', 'Notification')
import warnings
class Annotation(object):
__slots__ = ['label', 'url', 'description']
def __init__(self, label, url=None, description=None):
self.label = label
self.url = url
self.descri... | true | true |
f7f84b77b52cf56b6d38f170521dfac87c0ecff2 | 7,645 | py | Python | util/canloader.py | sectioncritical/atmega_can_bootloader | a703b6902fee0f3e931adc77b0470a8238906a0b | [
"MIT"
] | null | null | null | util/canloader.py | sectioncritical/atmega_can_bootloader | a703b6902fee0f3e931adc77b0470a8238906a0b | [
"MIT"
] | 3 | 2021-12-05T22:59:08.000Z | 2021-12-13T22:03:40.000Z | util/canloader.py | sectioncritical/atmega_can_bootloader | a703b6902fee0f3e931adc77b0470a8238906a0b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# SPDX-License-Identifier: MIT
#
# MIT License
#
# Copyright (c) 2021 Joseph Kroesche
#
# 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 ... | 32.394068 | 83 | 0.614388 |
import argparse
import can
from intelhex import IntelHex
_can_rate = 250000
def crc16_update(crc, val):
crc ^= val
for i in range(8):
if (crc & 1):
crc = (crc >> 1) ^ 0xA001
else:
crc = (crc >> 1)
return crc & 0xFFFF;
def build_arbid(boa... | true | true |
f7f84be4fc0dd3bed67149225c190a3988322e84 | 345 | py | Python | pangea/core/utils.py | LongTailBio/pangea-django | 630551dded7f9e38f95eda8c36039e0de46961e7 | [
"MIT"
] | null | null | null | pangea/core/utils.py | LongTailBio/pangea-django | 630551dded7f9e38f95eda8c36039e0de46961e7 | [
"MIT"
] | 27 | 2020-03-26T02:55:12.000Z | 2022-03-12T00:55:04.000Z | pangea/core/utils.py | LongTailBio/pangea-django | 630551dded7f9e38f95eda8c36039e0de46961e7 | [
"MIT"
] | 1 | 2021-09-14T08:15:54.000Z | 2021-09-14T08:15:54.000Z |
import random
def str2bool(v):
"""Parse boolean value from string."""
return str(v).lower() in ("true", "t", "1")
def random_replicate_name(len=12):
"""Return a random alphanumeric string of length `len`."""
out = random.choices('abcdefghijklmnopqrtuvwxyzABCDEFGHIJKLMNOPQRTUVWXYZ0123456789', k=len)... | 24.642857 | 95 | 0.689855 |
import random
def str2bool(v):
return str(v).lower() in ("true", "t", "1")
def random_replicate_name(len=12):
out = random.choices('abcdefghijklmnopqrtuvwxyzABCDEFGHIJKLMNOPQRTUVWXYZ0123456789', k=len)
return ''.join(out)
| true | true |
f7f84e60e9987fe1920493977cfaea5115d193c2 | 5,432 | py | Python | src/config/template.py | sanghyun-son/srwarp | d7cc08db5ba5ec9103f1813f76d1da825afe1a5b | [
"MIT"
] | 82 | 2021-04-22T09:22:46.000Z | 2022-03-30T03:06:47.000Z | src/config/template.py | sanghyun-son/srwarp | d7cc08db5ba5ec9103f1813f76d1da825afe1a5b | [
"MIT"
] | 3 | 2021-08-04T15:40:52.000Z | 2022-02-21T10:10:52.000Z | src/config/template.py | sanghyun-son/srwarp | d7cc08db5ba5ec9103f1813f76d1da825afe1a5b | [
"MIT"
] | 11 | 2021-05-16T14:54:33.000Z | 2022-02-18T08:25:37.000Z | def set_template(template, cfg):
if 'srwarp-all' in template:
cfg.model = 'srwarp.baseline'
cfg.residual = True
cfg.kernel_size_up = 3
cfg.kernel_net = True
cfg.kernel_net_multi = True
cfg.kernel_depthwise = True
if 'down' in template:
cfg.scale = 2
... | 34.379747 | 126 | 0.495766 | def set_template(template, cfg):
if 'srwarp-all' in template:
cfg.model = 'srwarp.baseline'
cfg.residual = True
cfg.kernel_size_up = 3
cfg.kernel_net = True
cfg.kernel_net_multi = True
cfg.kernel_depthwise = True
if 'down' in template:
cfg.scale = 2
... | true | true |
f7f84f2117caef9b1634023fc97912f62a96cbc8 | 4,729 | py | Python | src/TestBed.py | lallulli/web2help | 71e28f88463286c4a18ad056312ba1d5039b00a3 | [
"BSD-3-Clause"
] | null | null | null | src/TestBed.py | lallulli/web2help | 71e28f88463286c4a18ad056312ba1d5039b00a3 | [
"BSD-3-Clause"
] | null | null | null | src/TestBed.py | lallulli/web2help | 71e28f88463286c4a18ad056312ba1d5039b00a3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Aug 25 2009)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
##########################################################################... | 36.945313 | 243 | 0.654049 | true | true | |
f7f850561c5eacba5840dc7d0b77f271aff3db51 | 6,742 | py | Python | src/champ_teleop/champ_teleop.py | chinaheyu/pydog_ws | c5ff65647845e6c96901fb925a2357507dfeecf0 | [
"MIT"
] | 5 | 2021-10-31T16:18:59.000Z | 2022-01-16T17:03:52.000Z | src/champ_teleop/champ_teleop.py | chinaheyu/pydog_ws | c5ff65647845e6c96901fb925a2357507dfeecf0 | [
"MIT"
] | 4 | 2021-09-11T06:32:48.000Z | 2021-09-16T19:24:16.000Z | src/champ_teleop/champ_teleop.py | chinaheyu/pydog_ws | c5ff65647845e6c96901fb925a2357507dfeecf0 | [
"MIT"
] | 1 | 2021-10-09T12:26:12.000Z | 2021-10-09T12:26:12.000Z | #!/usr/bin/env python
#credits to: https://github.com/ros-teleop/teleop_twist_keyboard/blob/master/teleop_twist_keyboard.py
from __future__ import print_function
import roslib; roslib.load_manifest('champ_teleop')
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
from champ_msgs.msg im... | 32.413462 | 124 | 0.492139 |
from __future__ import print_function
import roslib; roslib.load_manifest('champ_teleop')
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
from champ_msgs.msg import Pose as PoseLite
from geometry_msgs.msg import Pose as Pose
import tf
import sys, select, termios, tty
import numpy ... | true | true |
f7f85101ff74d9e3c076f3d627ca34d67aa84a0e | 3,545 | py | Python | happy_python/happy_config.py | geekcampchina/happy-python | b421d29952bf76158375353b896dfb5eb814b948 | [
"MIT"
] | 1 | 2020-10-14T11:10:02.000Z | 2020-10-14T11:10:02.000Z | happy_python/happy_config.py | geekcampchina/happy-python | b421d29952bf76158375353b896dfb5eb814b948 | [
"MIT"
] | null | null | null | happy_python/happy_config.py | geekcampchina/happy-python | b421d29952bf76158375353b896dfb5eb814b948 | [
"MIT"
] | 1 | 2019-11-25T07:59:26.000Z | 2019-11-25T07:59:26.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
配置文件(INI)转换类
"""
import os
from abc import ABCMeta
from happy_python import HappyPyException
class HappyConfigBase(object, metaclass=ABCMeta):
_section = 'main'
def __init__(self):
pass
@property
def section(self):
"""
使用... | 31.371681 | 91 | 0.53512 |
import os
from abc import ABCMeta
from happy_python import HappyPyException
class HappyConfigBase(object, metaclass=ABCMeta):
_section = 'main'
def __init__(self):
pass
@property
def section(self):
return self._section
@section.setter
def section(self, value):
i... | true | true |
f7f85173a3f091da6309b3c9506444c9517430f5 | 596 | py | Python | examples/non_reliability.py | CharleeSF/brian2 | d2be1ed33a8ac51b1891f89a2544123a937c43ff | [
"BSD-2-Clause"
] | 2 | 2020-03-20T13:30:19.000Z | 2020-03-20T13:30:57.000Z | examples/non_reliability.py | CharleeSF/brian2 | d2be1ed33a8ac51b1891f89a2544123a937c43ff | [
"BSD-2-Clause"
] | null | null | null | examples/non_reliability.py | CharleeSF/brian2 | d2be1ed33a8ac51b1891f89a2544123a937c43ff | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''
Reliability of spike timing.
See e.g. Mainen & Sejnowski (1995) for experimental results in vitro.
Here: a constant current is injected in all trials.
'''
from brian2 import *
N = 25
tau = 20*ms
sigma = .015
eqs_neurons = '''
dx/dt = (1.1 - x) / tau + sigma * (2 / tau)**.5 * xi : 1 (unless r... | 23.84 | 77 | 0.639262 |
from brian2 import *
N = 25
tau = 20*ms
sigma = .015
eqs_neurons = '''
dx/dt = (1.1 - x) / tau + sigma * (2 / tau)**.5 * xi : 1 (unless refractory)
'''
neurons = NeuronGroup(N, model=eqs_neurons, threshold='x > 1', reset='x = 0',
refractory=5*ms, method='euler')
spikes = SpikeMonitor(neurons)
r... | true | true |
f7f8525d5a1f2e2461e06c67ac30feb7935b1125 | 385 | py | Python | RRMS/RRMS/asgi.py | starwriter34/Rehome-Rescue-Management-Software | 44361617ce35deb32bddeb980b01c463fd5e35e3 | [
"MIT"
] | null | null | null | RRMS/RRMS/asgi.py | starwriter34/Rehome-Rescue-Management-Software | 44361617ce35deb32bddeb980b01c463fd5e35e3 | [
"MIT"
] | 5 | 2021-03-19T02:38:53.000Z | 2021-06-10T19:04:18.000Z | RRMS/RRMS/asgi.py | starwriter34/Rehome-Rescue-Management-Software | 44361617ce35deb32bddeb980b01c463fd5e35e3 | [
"MIT"
] | null | null | null | """
ASGI config for RRMS project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS... | 22.647059 | 78 | 0.781818 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'RRMS.settings')
application = get_asgi_application()
| true | true |
f7f853bd6ec6ab92099e3f5f52da08f9c786ec1c | 729 | py | Python | examples/python/example_angular.py | gony0/n2 | 824981473b3c499323a1f677c78fdc246a065a2a | [
"Apache-2.0"
] | 7 | 2019-04-17T07:21:01.000Z | 2019-10-08T07:31:22.000Z | examples/python/example_angular.py | javaCJ/HNSW- | a6f97d3cf189f2de4f1de4a88f69c4a43fb629ac | [
"Apache-2.0"
] | 2 | 2019-06-25T10:00:57.000Z | 2019-10-26T14:55:23.000Z | examples/python/example_angular.py | javaCJ/HNSW- | a6f97d3cf189f2de4f1de4a88f69c4a43fb629ac | [
"Apache-2.0"
] | 1 | 2021-11-03T14:59:27.000Z | 2021-11-03T14:59:27.000Z | from n2 import HnswIndex
import random
f = 3
t = HnswIndex(f) # HnswIndex(f, "L2 or angular")
for i in xrange(1000):
v = [random.gauss(0, 1) for z in xrange(f)]
t.add_data(v)
t.build(m=5, max_m0=10, n_threads=4)
t.save('test.n2')
u = HnswIndex(f, "angular")
u.load('test.n2')
search_id = 1
k = 3
neighbor_id... | 24.3 | 73 | 0.668038 | from n2 import HnswIndex
import random
f = 3
t = HnswIndex(f)
for i in xrange(1000):
v = [random.gauss(0, 1) for z in xrange(f)]
t.add_data(v)
t.build(m=5, max_m0=10, n_threads=4)
t.save('test.n2')
u = HnswIndex(f, "angular")
u.load('test.n2')
search_id = 1
k = 3
neighbor_ids = u.search_by_id(search_id, k... | true | true |
f7f854123b33a3d1454c08b490ec092e9ab5baa9 | 3,322 | py | Python | src/sdk/pynni/tests/test_trial.py | kitstar/nni | c5c0fa2e2dede71d2797a8bafa85c90f59d311f8 | [
"MIT"
] | null | null | null | src/sdk/pynni/tests/test_trial.py | kitstar/nni | c5c0fa2e2dede71d2797a8bafa85c90f59d311f8 | [
"MIT"
] | 4 | 2022-02-10T06:23:52.000Z | 2022-03-08T23:37:29.000Z | src/sdk/pynni/tests/test_trial.py | kitstar/nni | c5c0fa2e2dede71d2797a8bafa85c90f59d311f8 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# 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 u... | 39.082353 | 100 | 0.654124 |
import nni
import nni.platform.test as test_platform
import nni.trial
import numpy as np
from unittest import TestCase, main
class TrialTestCase(TestCase):
def setUp(self):
self._trial_params = { 'msg': 'hi', 'x': 123, 'dict': { 'key': 'value', 'y': None } }
nni.trial._params... | true | true |
f7f854423745070268712b5cedae1f26820f2ae5 | 4,927 | py | Python | Extra/maths.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | 1 | 2021-04-15T01:46:36.000Z | 2021-04-15T01:46:36.000Z | Extra/maths.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | Extra/maths.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | import os
import numpy as np
from nipype.interfaces.base import CommandLine, CommandLineInputSpec #, Info
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,isdefined)
class MathsOutput(TraitedSpec):
out_file = File( desc="image to write after calculations")
class MathsInput(Command... | 38.492188 | 151 | 0.657195 | import os
import numpy as np
from nipype.interfaces.base import CommandLine, CommandLineInputSpec
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,isdefined)
class MathsOutput(TraitedSpec):
out_file = File( desc="image to write after calculations")
class MathsInput(CommandLineInp... | true | true |
f7f854aa83cf581850b148374c8bf6da51fe6f82 | 4,539 | py | Python | ducktape/cluster/windows_remoteaccount.py | rancp/ducktape-docs | e1a3b1b7e68beedf5f8d29a4e5f196912a20e264 | [
"Apache-2.0"
] | null | null | null | ducktape/cluster/windows_remoteaccount.py | rancp/ducktape-docs | e1a3b1b7e68beedf5f8d29a4e5f196912a20e264 | [
"Apache-2.0"
] | null | null | null | ducktape/cluster/windows_remoteaccount.py | rancp/ducktape-docs | e1a3b1b7e68beedf5f8d29a4e5f196912a20e264 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 40.891892 | 115 | 0.659617 |
import logging
import boto3
import os
import base64
import winrm
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
from botocore.exceptions import ClientError
from ducktape.cluster.remoteaccount import RemoteAccount, RemoteCommandError
class WindowsRemoteAccount(RemoteAccount):
... | true | true |
f7f85792d127e2f11e241ebd9a78001deb199f38 | 32,295 | py | Python | stochpy/modules/Analysis.py | bgoli/stochpy | ba06e5eaf1204dbc8ea39996ff8a08e9b0b5997d | [
"BSD-3-Clause"
] | 35 | 2016-02-29T22:56:07.000Z | 2022-03-06T17:21:29.000Z | stochpy/modules/Analysis.py | bgoli/stochpy | ba06e5eaf1204dbc8ea39996ff8a08e9b0b5997d | [
"BSD-3-Clause"
] | 6 | 2016-10-13T12:43:54.000Z | 2021-04-30T09:06:59.000Z | stochpy/modules/Analysis.py | bgoli/stochpy | ba06e5eaf1204dbc8ea39996ff8a08e9b0b5997d | [
"BSD-3-Clause"
] | 13 | 2016-07-07T19:49:25.000Z | 2021-05-14T20:24:17.000Z | #! /usr/bin/env python
"""
Analysis
========
This module provides functions for Stochastic Simulation Algorithms Analysis (SSA). Implemented SSAs import this module to perform their analysis. Plotting of time series species, propensities), distributions (species, propensities, distributions), autocorrelations, and aut... | 37.596042 | 323 | 0.553398 |
from __future__ import division, print_function, absolute_import
from stochpy import _IsPlotting
if _IsPlotting:
from stochpy import plt
from stochpy import matplotlib
from matplotlib import gridspec,colors as clr
from stochpy import _IsNumPy
if _IsNumPy:
import numpy as np
else:
sys.exit()
imp... | true | true |
f7f857dea1a667af831b3fbd0fa512325882af92 | 141 | py | Python | practice/4. radius/4. radius/_4._radius.py | thekaranjit/pythonpractice | c87f535f694ee259a4d9de317f5b2eacd0e3748f | [
"Unlicense"
] | 1 | 2018-06-21T23:15:18.000Z | 2018-06-21T23:15:18.000Z | practice/4. radius/4. radius/_4._radius.py | thekaranjit/pythonpractice | c87f535f694ee259a4d9de317f5b2eacd0e3748f | [
"Unlicense"
] | null | null | null | practice/4. radius/4. radius/_4._radius.py | thekaranjit/pythonpractice | c87f535f694ee259a4d9de317f5b2eacd0e3748f | [
"Unlicense"
] | null | null | null | from math import pi
r = float(input("Input the radious of circle: "))
print("Area of a circle with radius" + str(r) + "is:" + str(pi *r**2))
| 35.25 | 70 | 0.64539 | from math import pi
r = float(input("Input the radious of circle: "))
print("Area of a circle with radius" + str(r) + "is:" + str(pi *r**2))
| true | true |
f7f858c7572f16e9c6eb451dabe10db9b9789972 | 8,678 | py | Python | rigi/tableIns.py | wangjwchn/autogr | c6b5404f6165ea6374f628dbd433ef25253ab5f8 | [
"MIT"
] | null | null | null | rigi/tableIns.py | wangjwchn/autogr | c6b5404f6165ea6374f628dbd433ef25253ab5f8 | [
"MIT"
] | null | null | null | rigi/tableIns.py | wangjwchn/autogr | c6b5404f6165ea6374f628dbd433ef25253ab5f8 | [
"MIT"
] | null | null | null | from z3 import *
from .enum import *
from .table import *
from .utils import *
from .assn import *
class TableInstance(object):
def __init__(self, table):
super(TableInstance, self).__init__()
self.table = table
self.name = table.name
self.key_type = table.key_type
self.val... | 44.050761 | 159 | 0.532035 | from z3 import *
from .enum import *
from .table import *
from .utils import *
from .assn import *
class TableInstance(object):
def __init__(self, table):
super(TableInstance, self).__init__()
self.table = table
self.name = table.name
self.key_type = table.key_type
self.val... | true | true |
f7f859370dd2fa13801bb8ef415e4db2b1c97a81 | 1,124 | py | Python | app/routes/pet.py | nkthanh98/flask-seed | 353993e11a765c2b9cec8adf63a555580c223981 | [
"MIT"
] | null | null | null | app/routes/pet.py | nkthanh98/flask-seed | 353993e11a765c2b9cec8adf63a555580c223981 | [
"MIT"
] | null | null | null | app/routes/pet.py | nkthanh98/flask-seed | 353993e11a765c2b9cec8adf63a555580c223981 | [
"MIT"
] | null | null | null | # coding=utf-8
import logging
from werkzeug import exceptions as exc
from flask import g
from app.extends.flask import (
Namespace,
MethodView
)
from app import schemas
from app.services import PetService
pet_ns = Namespace('pet', __name__)
@pet_ns.route('/pet', methods=['POST'])
class PetCreator(MethodVie... | 23.914894 | 70 | 0.66548 |
import logging
from werkzeug import exceptions as exc
from flask import g
from app.extends.flask import (
Namespace,
MethodView
)
from app import schemas
from app.services import PetService
pet_ns = Namespace('pet', __name__)
@pet_ns.route('/pet', methods=['POST'])
class PetCreator(MethodView):
@pet_n... | true | true |
f7f859b3f499c9a1e5744b75fe5a660dd4670b23 | 13,576 | py | Python | vw_plotspectra.py | mahdiqezlou/vw_spectra | 975b125a03b3f8505e01db7fd4b4c3c609271499 | [
"MIT"
] | null | null | null | vw_plotspectra.py | mahdiqezlou/vw_spectra | 975b125a03b3f8505e01db7fd4b4c3c609271499 | [
"MIT"
] | 3 | 2019-12-09T20:49:57.000Z | 2019-12-10T20:09:01.000Z | vw_plotspectra.py | mahdiqezlou/vw_spectra | 975b125a03b3f8505e01db7fd4b4c3c609271499 | [
"MIT"
] | 1 | 2019-12-03T02:05:29.000Z | 2019-12-03T02:05:29.000Z | # -*- coding: utf-8 -*-
"""Contains the plotting-specific functions specific to the velocity width analysis."""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from fake_spectra import plot_spectra as ps
from fake_spectra import haloassigned_spectra as hs
import kstest as ks
im... | 45.864865 | 123 | 0.606732 |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from fake_spectra import plot_spectra as ps
from fake_spectra import haloassigned_spectra as hs
import kstest as ks
import vw_spectra as vw
try:
xrange(1)
except NameError:
xrange = range
def _bootstrap_sample(vel_data, ... | true | true |
f7f85a1a125b655eb9c751ffdcea4a5de65ff8ce | 4,059 | py | Python | rmgpy/tools/data.py | pw0908/RMG-Py | 3846fcce701f2a5fd12dbfa429687e9fcd647298 | [
"MIT"
] | 1 | 2022-01-24T05:08:32.000Z | 2022-01-24T05:08:32.000Z | rmgpy/tools/data.py | pw0908/RMG-Py | 3846fcce701f2a5fd12dbfa429687e9fcd647298 | [
"MIT"
] | 72 | 2016-06-06T18:18:49.000Z | 2019-11-17T03:21:10.000Z | rmgpy/tools/data.py | pw0908/RMG-Py | 3846fcce701f2a5fd12dbfa429687e9fcd647298 | [
"MIT"
] | 3 | 2017-09-22T15:47:37.000Z | 2021-12-30T23:51:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 62.446154 | 122 | 0.476472 | true | true | |
f7f85a71139fd0deb9e0541460d266eb90c94000 | 8,412 | py | Python | config/settings/production.py | preludelife/nomadgram | ca2c540f7bad3df0c2037c877eeca7c23f423a15 | [
"MIT"
] | null | null | null | config/settings/production.py | preludelife/nomadgram | ca2c540f7bad3df0c2037c877eeca7c23f423a15 | [
"MIT"
] | 3 | 2020-06-05T18:22:45.000Z | 2021-06-10T20:38:11.000Z | config/settings/production.py | preludelife/nomadgram | ca2c540f7bad3df0c2037c877eeca7c23f423a15 | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY')
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 41.643564 | 96 | 0.618997 | from .base import *
from .base import env
= env('DJANGO_SECRET_KEY')
= env.list('DJANGO_ALLOWED_HOSTS', default=['noadcoders.co'])
DATABASES['default'] = env.db('DATABASE_URL')
DATABASES['default']['ATOMIC_REQUESTS'] = True
DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', default=60)
CA... | true | true |
f7f85b4f94428c38c2ae9ab5221ad6078ffbc4c5 | 4,448 | py | Python | gocddash/analysis/parse_cctray.py | peterrosell/gocddash | c1004135dc66b0d8394d6025750b94e12650ab36 | [
"MIT"
] | 4 | 2016-01-20T19:53:06.000Z | 2019-09-16T11:49:13.000Z | gocddash/analysis/parse_cctray.py | peterrosell/gocddash | c1004135dc66b0d8394d6025750b94e12650ab36 | [
"MIT"
] | null | null | null | gocddash/analysis/parse_cctray.py | peterrosell/gocddash | c1004135dc66b0d8394d6025750b94e12650ab36 | [
"MIT"
] | 5 | 2016-07-13T10:41:20.000Z | 2018-04-10T07:41:18.000Z | from collections import defaultdict
from xml.etree import ElementTree as Et
class Projects(object):
def __init__(self, source):
self.tree = Et.fromstring(source)
self.pipelines = {}
self.stages = defaultdict(list)
self.jobs = defaultdict(list)
self.parse()
def parse(se... | 33.69697 | 118 | 0.606565 | from collections import defaultdict
from xml.etree import ElementTree as Et
class Projects(object):
def __init__(self, source):
self.tree = Et.fromstring(source)
self.pipelines = {}
self.stages = defaultdict(list)
self.jobs = defaultdict(list)
self.parse()
def parse(se... | true | true |
f7f85b86a091200d3cee0b7d60d04062afdfdbe5 | 2,112 | py | Python | epytope/Data/pssms/tepitopepan/mat/DRB1_0711_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/tepitopepan/mat/DRB1_0711_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/tepitopepan/mat/DRB1_0711_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | DRB1_0711_9 = {0: {'A': -999.0, 'E': -999.0, 'D': -999.0, 'G': -999.0, 'F': -0.004754, 'I': -0.99525, 'H': -999.0, 'K': -999.0, 'M': -0.99525, 'L': -0.99525, 'N': -999.0, 'Q': -999.0, 'P': -999.0, 'S': -999.0, 'R': -999.0, 'T': -999.0, 'W': -0.004754, 'V': -0.99525, 'Y': -0.004754}, 1: {'A': 0.0, 'E': 0.1, 'D': -1.3, '... | 2,112 | 2,112 | 0.383523 | DRB1_0711_9 = {0: {'A': -999.0, 'E': -999.0, 'D': -999.0, 'G': -999.0, 'F': -0.004754, 'I': -0.99525, 'H': -999.0, 'K': -999.0, 'M': -0.99525, 'L': -0.99525, 'N': -999.0, 'Q': -999.0, 'P': -999.0, 'S': -999.0, 'R': -999.0, 'T': -999.0, 'W': -0.004754, 'V': -0.99525, 'Y': -0.004754}, 1: {'A': 0.0, 'E': 0.1, 'D': -1.3, '... | true | true |
f7f85ba20b6127404ab200341a88c8fff7816f0c | 1,365 | py | Python | src/users/models/componentsschemasmicrosoft_graph_teamscatalogappallof1.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/componentsschemasmicrosoft_graph_teamscatalogappallof1.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/componentsschemasmicrosoft_graph_teamscatalogappallof1.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 35.921053 | 92 | 0.600733 |
from msrest.serialization import Model
class ComponentsschemasmicrosoftGraphTeamscatalogappallof1(Model):
_attribute_map = {
'external_id': {'key': 'externalId', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'version': {'key': 'version', 'type': 'str'},
'distribut... | true | true |
f7f85bd77607159e3f532d0ca917a01ba1522bf6 | 1,328 | py | Python | scripts/cli.py | Skalwalker/PlantsRecognition | 11c3812cfbfb789c0c023693e798918473304d59 | [
"MIT"
] | null | null | null | scripts/cli.py | Skalwalker/PlantsRecognition | 11c3812cfbfb789c0c023693e798918473304d59 | [
"MIT"
] | 3 | 2018-09-22T05:03:33.000Z | 2018-09-22T05:05:17.000Z | scripts/cli.py | Skalwalker/PlantsRecognition | 11c3812cfbfb789c0c023693e798918473304d59 | [
"MIT"
] | 2 | 2019-12-27T07:01:07.000Z | 2020-11-10T15:09:38.000Z | import argparse
from adapter import Adapter
DEFAULT_PLOT = 'none'
DEFAULT_TRAIN = False
DEFAULT_ALGORITHM = ''
DEFAULT_CROSSVAL = 10
DEFAULT_NUMBER_OF_TREES = 100
DEFAULT_PLOT = False
DEFAULT_BEST = False
def getAdapter():
parser = argparse.ArgumentParser(description='A Random Forests approach for plant species ... | 36.888889 | 141 | 0.708584 | import argparse
from adapter import Adapter
DEFAULT_PLOT = 'none'
DEFAULT_TRAIN = False
DEFAULT_ALGORITHM = ''
DEFAULT_CROSSVAL = 10
DEFAULT_NUMBER_OF_TREES = 100
DEFAULT_PLOT = False
DEFAULT_BEST = False
def getAdapter():
parser = argparse.ArgumentParser(description='A Random Forests approach for plant species ... | true | true |
f7f85c0734ac66943359aa744edff514fd2482af | 1,500 | py | Python | airflow/utils/weight_rule.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 15 | 2017-04-06T09:01:50.000Z | 2021-10-02T13:54:31.000Z | airflow/utils/weight_rule.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 26 | 2019-08-05T13:44:11.000Z | 2022-03-30T10:06:18.000Z | airflow/utils/weight_rule.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 21 | 2017-08-20T03:01:05.000Z | 2021-09-07T06:47:51.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 32.608696 | 80 | 0.702667 |
from __future__ import unicode_literals
from builtins import object
from typing import Set
class WeightRule(object):
DOWNSTREAM = 'downstream'
UPSTREAM = 'upstream'
ABSOLUTE = 'absolute'
_ALL_WEIGHT_RULES = set()
@classmethod
def is_valid(cls, weight_rule):
retu... | true | true |
f7f85c756b5af872cec62407d22349d650619b4b | 623 | py | Python | Python/035.py | jaimeliew1/Project_Euler_Solutions | 963c9c6d6571cade8f87341f97a6a2cd1af202bb | [
"MIT"
] | null | null | null | Python/035.py | jaimeliew1/Project_Euler_Solutions | 963c9c6d6571cade8f87341f97a6a2cd1af202bb | [
"MIT"
] | 1 | 2018-04-16T21:01:50.000Z | 2018-04-16T21:01:50.000Z | Python/035.py | jaimeliew1/Project_Euler_Solutions | 963c9c6d6571cade8f87341f97a6a2cd1af202bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Solution to Project Euler problem 35
Author: Jaime Liew
https://github.com/jaimeliew1/Project_Euler_Solutions
"""
from EulerFunctions import is_prime, primelist, numDigits
def CircPerms(x):
perms = [str(x)]
for j in range(numDigits(x) - 1):
perms.append(perms[-1][1:] + pe... | 18.323529 | 57 | 0.621188 |
from EulerFunctions import is_prime, primelist, numDigits
def CircPerms(x):
perms = [str(x)]
for j in range(numDigits(x) - 1):
perms.append(perms[-1][1:] + perms[-1][0])
return [int(i) for i in perms]
def run():
N = 1000000
primes = primelist(N)
circPrimes = []
for i in primes... | true | true |
f7f85ea776d29fad9e4f9a2c3d14fea6f628462d | 17,216 | py | Python | check.py | sophiawho/binaryen | 4dd90785cc27423e5368d5c1c3e4ffec05df631a | [
"Apache-2.0"
] | null | null | null | check.py | sophiawho/binaryen | 4dd90785cc27423e5368d5c1c3e4ffec05df631a | [
"Apache-2.0"
] | null | null | null | check.py | sophiawho/binaryen | 4dd90785cc27423e5368d5c1c3e4ffec05df631a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2015 WebAssembly Community Group participants
#
# 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
#
# Unles... | 42.613861 | 183 | 0.616055 |
import glob
import os
import subprocess
import sys
import unittest
from collections import OrderedDict
from scripts.test import asm2wasm
from scripts.test import binaryenjs
from scripts.test import lld
from scripts.test import shared
from scripts.test import support
from scripts.test import wasm2js
fro... | true | true |
f7f86067d041d6bd499f14e05c2b566ee158ccb8 | 60 | py | Python | python/testData/mover/multiLineSelection10_afterDown.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/mover/multiLineSelection10_afterDown.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/mover/multiLineSelection10_afterDown.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | if True:
pass
<caret><selection>a = 2
b = 3</selection>
| 12 | 23 | 0.616667 | if True:
pass
<caret><selection>a = 2
b = 3</selection>
| false | true |
f7f8609024e051a6ec66d9ca33f19229a1b73937 | 7,347 | py | Python | tests/predict_test.py | michael-weinstein/Elevation | f4e3e105a1e722284f3a32128f551d2ff466a1e0 | [
"MIT"
] | 96 | 2017-12-19T14:42:50.000Z | 2019-03-19T16:17:16.000Z | tests/predict_test.py | whensbrunch/Elevation | cd783ed7ea09d6d7c8c13dbba0c5f7daf5fa1719 | [
"MIT"
] | 4 | 2018-02-16T10:16:24.000Z | 2019-03-24T23:26:01.000Z | tests/predict_test.py | whensbrunch/Elevation | cd783ed7ea09d6d7c8c13dbba0c5f7daf5fa1719 | [
"MIT"
] | 18 | 2019-05-07T19:40:39.000Z | 2022-01-15T15:12:07.000Z | import os
import sys
import shutil
import unittest
# from mock import patch, Mock, PropertyMock, MagicMock
import pandas as pd
import numpy as np
from warnings import warn
class PredictTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(PredictTest, self).__init__(*args, **kwargs)
... | 39.079787 | 116 | 0.6389 | import os
import sys
import shutil
import unittest
import pandas as pd
import numpy as np
from warnings import warn
class PredictTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(PredictTest, self).__init__(*args, **kwargs)
def test_predict_hmg(self):
sys.stdout = s... | true | true |
f7f861c791647b08fca6b48aef7d6edd26f3b27b | 13,706 | py | Python | COMP1001_Assignment8&9_14010627X.py | brandonlee503/COMP1001-Assignments | 6e25dcb367537251887bf487970e4b3a8196b78d | [
"MIT"
] | null | null | null | COMP1001_Assignment8&9_14010627X.py | brandonlee503/COMP1001-Assignments | 6e25dcb367537251887bf487970e4b3a8196b78d | [
"MIT"
] | null | null | null | COMP1001_Assignment8&9_14010627X.py | brandonlee503/COMP1001-Assignments | 6e25dcb367537251887bf487970e4b3a8196b78d | [
"MIT"
] | null | null | null | """
Brandon Lee
14010627X
COMP1001 Assignment 8-9
11-14-14
"""
from random import shuffle
import os
"""
getKey() PseudoCode
function definition: def genkey(length):
check if length is less than 1: if(length<1):
if so raise value error: raise ValueError
otherwise: ... | 51.141791 | 138 | 0.445936 |
from random import shuffle
import os
def genkey(length):
if(length < 1):
raise ValueError("The key length is not valid")
else:
key = []
for i in range(length):
key.append(i)
shuffle(key)
return key
def printkey(key):
if(len(key) < 1):
raise Valu... | true | true |
f7f862522c15f8f8be8369d94c8c90be5cd735fb | 29,816 | py | Python | easy_work_service_sdk/model/flow/flow_instance_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | easy_work_service_sdk/model/flow/flow_instance_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | easy_work_service_sdk/model/flow/flow_instance_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: flow_instance.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 import message as _message
from google.protob... | 46.733542 | 2,770 | 0.746311 |
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
_sym_db ... | true | true |
f7f862ddf3e30024d4d37b5aa4d3cfe3eb121211 | 846 | py | Python | test/test_docker.py | ORNL/curifactory | f8be235b7fa7b91cc86f61d610d7093075b89d1f | [
"BSD-3-Clause"
] | 4 | 2022-01-25T18:27:49.000Z | 2022-03-30T22:57:04.000Z | test/test_docker.py | ORNL/curifactory | f8be235b7fa7b91cc86f61d610d7093075b89d1f | [
"BSD-3-Clause"
] | 1 | 2022-03-05T19:10:42.000Z | 2022-03-07T18:00:49.000Z | test/test_docker.py | ORNL/curifactory | f8be235b7fa7b91cc86f61d610d7093075b89d1f | [
"BSD-3-Clause"
] | null | null | null | import curifactory.utils
from curifactory import docker
from pytest_mock import mocker # noqa: F401 -- flake8 doesn't see it's used as fixture
def test_build_docker(mocker): # noqa: F811 -- mocker has to be passed in as fixture
"""This is mostly just to make sure the docker command isn't changed from what we
... | 29.172414 | 87 | 0.63357 | import curifactory.utils
from curifactory import docker
from pytest_mock import mocker
def test_build_docker(mocker):
mocker.patch("curifactory.utils.run_command")
docker.build_docker("test_name", "./test_cache_folder", "some_version_string")
curifactory.utils.run_command.assert_called_once_with(
... | true | true |
f7f8642da248ec8872dc232e14a27351ddf47a39 | 56 | py | Python | helper.py | rp8jd/cs3240-labdemo | 304bb043b1314cd387f9af071051b15f8359cf1c | [
"MIT"
] | null | null | null | helper.py | rp8jd/cs3240-labdemo | 304bb043b1314cd387f9af071051b15f8359cf1c | [
"MIT"
] | null | null | null | helper.py | rp8jd/cs3240-labdemo | 304bb043b1314cd387f9af071051b15f8359cf1c | [
"MIT"
] | null | null | null | #Rhea Prahlad, rp8jd
def greeting(msg):
print(msg)
| 11.2 | 20 | 0.678571 |
def greeting(msg):
print(msg)
| true | true |
f7f864aa9b310ad1d40db644675ae355d5c072b5 | 7,267 | py | Python | blaze/objects/array.py | talumbau/blaze | 66c9e61476f11d53f7b734664214537182397739 | [
"BSD-3-Clause"
] | 1 | 2018-01-24T08:54:04.000Z | 2018-01-24T08:54:04.000Z | blaze/objects/array.py | talumbau/blaze | 66c9e61476f11d53f7b734664214537182397739 | [
"BSD-3-Clause"
] | null | null | null | blaze/objects/array.py | talumbau/blaze | 66c9e61476f11d53f7b734664214537182397739 | [
"BSD-3-Clause"
] | null | null | null | """This file defines the Concrete Array --- a leaf node in the expression graph
A concrete array is constructed from a Data Descriptor Object which handles the
indexing and basic interpretation of bytes
"""
from __future__ import absolute_import, division, print_function
import datashape
from ..compute.ops import ... | 30.028926 | 87 | 0.601349 |
from __future__ import absolute_import, division, print_function
import datashape
from ..compute.ops import ufuncs
from .. import compute
from ..datadescriptor import (DDesc, DeferredDescriptor, ddesc_as_py)
from ..io import _printing
class Array(object):
def __init__(self, data, axes=None, labels=None, user=... | true | true |
f7f864e3c0dcb5ab73a36652fec21d143736473d | 3,278 | py | Python | src/vggish_input.py | LaiaTarres/TransferLearningMusic | d662327d320031ea3492720b5134ccc01d17983a | [
"0BSD"
] | null | null | null | src/vggish_input.py | LaiaTarres/TransferLearningMusic | d662327d320031ea3492720b5134ccc01d17983a | [
"0BSD"
] | null | null | null | src/vggish_input.py | LaiaTarres/TransferLearningMusic | d662327d320031ea3492720b5134ccc01d17983a | [
"0BSD"
] | 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 applicab... | 37.25 | 80 | 0.744966 |
import numpy as np
import resampy
from scipy.io import wavfile
from src.utils import wavefile_to_waveform
import src.mel_features as mel_features
import src.vggish_params as vggish_params
def waveform_to_examples(data, sample_rate):
if len(data.shape) > 1:
data = np.mean(data, axis=1)
... | true | true |
f7f866d38e7684d202b119c111405c30c1dc5cdc | 529 | py | Python | Ch4/reference-test-original/testlib/2ndcase1staction.py | SumitBisht/RobotFrameworkTestAutomation | 21d8e9feda5a5aa1a369f35ecb01706c3c8153a4 | [
"MIT"
] | 10 | 2015-04-10T07:57:27.000Z | 2020-06-18T13:47:22.000Z | Ch4/reference-test-original/testlib/2ndcase1staction.py | SumitBisht/RobotFrameworkTestAutomation | 21d8e9feda5a5aa1a369f35ecb01706c3c8153a4 | [
"MIT"
] | 1 | 2016-12-15T14:13:49.000Z | 2016-12-18T22:05:37.000Z | Ch4/reference-test-working-as-desired/testlib/2ndcase1staction.py | SumitBisht/RobotFrameworkTestAutomation | 21d8e9feda5a5aa1a369f35ecb01706c3c8153a4 | [
"MIT"
] | 12 | 2015-05-27T14:44:39.000Z | 2021-05-12T05:41:56.000Z | from __future__ import with_statement
from sikuliwrapper import *
#add custom image library
addImagePath(common.cfgImageLibrary)
Settings.MinSimilarity = common.imageMinSimilarity
class XTest(BaseLogger):
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self):
None
#self.... | 23 | 51 | 0.625709 | from __future__ import with_statement
from sikuliwrapper import *
addImagePath(common.cfgImageLibrary)
Settings.MinSimilarity = common.imageMinSimilarity
class XTest(BaseLogger):
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self):
None
def Execute(self, *args):... | true | true |
f7f866e1211984c775ed2633e807a4db3d35b86d | 7,919 | py | Python | python/cugraph/dask/common/input_utils.py | ajschmidt8/cugraph | 7ad8fc36254bbc7d1a1dc7d321a93b08a66c26ab | [
"Apache-2.0"
] | null | null | null | python/cugraph/dask/common/input_utils.py | ajschmidt8/cugraph | 7ad8fc36254bbc7d1a1dc7d321a93b08a66c26ab | [
"Apache-2.0"
] | null | null | null | python/cugraph/dask/common/input_utils.py | ajschmidt8/cugraph | 7ad8fc36254bbc7d1a1dc7d321a93b08a66c26ab | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020-2021, NVIDIA 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 agre... | 34.133621 | 79 | 0.63354 |
from collections.abc import Sequence
from collections import OrderedDict
from dask_cudf.core import DataFrame as dcDataFrame
from dask_cudf.core import Series as daskSeries
import cugraph.comms.comms as Comms
from cugraph.raft.dask.common.utils import get_client
from cugraph.dask.common.part_utils impo... | true | true |
f7f866ffa29448ab3f7e848c0c53552b8b4fe355 | 1,206 | py | Python | tariff_app/migrations/0002_auto_20180807_1548.py | bashmak/djing | 8cc0c670600254d288178acd47965f7b3db6856e | [
"Unlicense"
] | 23 | 2017-04-27T20:13:22.000Z | 2022-03-16T12:47:29.000Z | tariff_app/migrations/0002_auto_20180807_1548.py | bashmak/djing | 8cc0c670600254d288178acd47965f7b3db6856e | [
"Unlicense"
] | 2 | 2017-04-04T15:03:12.000Z | 2021-01-26T15:30:57.000Z | tariff_app/migrations/0002_auto_20180807_1548.py | bashmak/djing | 8cc0c670600254d288178acd47965f7b3db6856e | [
"Unlicense"
] | 13 | 2017-08-22T16:00:03.000Z | 2022-03-20T03:12:15.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-08-07 15:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tariff_app', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | 36.545455 | 205 | 0.596186 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tariff_app', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='periodicpay',
options={'ordering': ('-i... | true | true |
f7f86744f4ef4e0c33ea6f94bb0a1af4489c2926 | 361 | py | Python | tests/contacts/test_check_contact.py | ECRSSS/PythonBarancevHomeworks | df190c7331f03f9d0e3c66a2ce72176d728f8cb0 | [
"Apache-2.0"
] | null | null | null | tests/contacts/test_check_contact.py | ECRSSS/PythonBarancevHomeworks | df190c7331f03f9d0e3c66a2ce72176d728f8cb0 | [
"Apache-2.0"
] | null | null | null | tests/contacts/test_check_contact.py | ECRSSS/PythonBarancevHomeworks | df190c7331f03f9d0e3c66a2ce72176d728f8cb0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contacts import Contact
def test_check_contact(app):
app.navigation.to_contacts()
orm_contacts = app.orm.get_contacts_as_strings_list()
main_page_contacts = app.contacts.get_info_from_main_page_as_strings_list()
orm_contacts.sort()
main_page_contacts.sort()
a... | 30.083333 | 79 | 0.764543 |
from model.contacts import Contact
def test_check_contact(app):
app.navigation.to_contacts()
orm_contacts = app.orm.get_contacts_as_strings_list()
main_page_contacts = app.contacts.get_info_from_main_page_as_strings_list()
orm_contacts.sort()
main_page_contacts.sort()
assert orm_contacts == m... | true | true |
f7f86775373b347567b3e90b759a05da5bab8779 | 1,062 | py | Python | src/transaction_output.py | PanosAntoniadis/noobcash | 47c9e7aabc010982d841e414c30b9c76cbb84b6d | [
"MIT"
] | 7 | 2020-04-11T15:21:53.000Z | 2022-03-29T21:12:15.000Z | src/transaction_output.py | PanosAntoniadis/noobcash | 47c9e7aabc010982d841e414c30b9c76cbb84b6d | [
"MIT"
] | 1 | 2021-06-10T20:32:31.000Z | 2021-06-10T20:32:31.000Z | src/transaction_output.py | PanosAntoniadis/noobcash | 47c9e7aabc010982d841e414c30b9c76cbb84b6d | [
"MIT"
] | null | null | null |
class TransactionOutput:
"""
A transaction output of a noobcash transaction.
Attributes:
transaction_id (int): id of the transaction.
recipient (int): the recipient of the transaction.
amount (int): the amount of nbcs to be transfered.
unspent (boolean): false if this outpu... | 34.258065 | 88 | 0.661017 |
class TransactionOutput:
def __init__(self, transaction_id, recipient, amount):
self.transaction_id = transaction_id
self.recipient = recipient
self.amount = amount
self.unspent = True
@classmethod
def fromdict(cls, output_dict):
transaction_id = output_dict["trans... | true | true |
f7f867c537b595a9f154fdc45487f76dc1a7bb0b | 2,916 | py | Python | ClemBot.Bot/bot/cogs/eval_cog.py | makayla-moster/ClemBot | 26503d25f1fbe2abcf99dbf0f68b17e88ad11a7c | [
"MIT"
] | 32 | 2021-07-10T18:51:29.000Z | 2022-02-27T17:07:28.000Z | ClemBot.Bot/bot/cogs/eval_cog.py | makayla-moster/ClemBot | 26503d25f1fbe2abcf99dbf0f68b17e88ad11a7c | [
"MIT"
] | 87 | 2021-06-29T05:11:35.000Z | 2022-03-27T14:37:14.000Z | ClemBot.Bot/bot/cogs/eval_cog.py | makayla-moster/ClemBot | 26503d25f1fbe2abcf99dbf0f68b17e88ad11a7c | [
"MIT"
] | 21 | 2021-06-23T23:46:17.000Z | 2022-03-19T16:16:05.000Z | import json
import logging
import typing as t
import aiohttp
import discord.ext.commands as commands
import discord.utils as utils
import bot.bot_secrets as bot_secrets
import bot.extensions as ext
log = logging.getLogger(__name__)
HEADERS = {
'Content-type': 'application/json',
'Accept': 'application/json'... | 32.043956 | 117 | 0.605281 | import json
import logging
import typing as t
import aiohttp
import discord.ext.commands as commands
import discord.utils as utils
import bot.bot_secrets as bot_secrets
import bot.extensions as ext
log = logging.getLogger(__name__)
HEADERS = {
'Content-type': 'application/json',
'Accept': 'application/json'... | true | true |
f7f868afb857033e7f63e8cbbc06e5b73cc69103 | 2,163 | py | Python | emolga/layers/embeddings.py | shengwenbo/CopyNet | 013508d10ad5ed09514b233a75e7f41ce7f8fa94 | [
"MIT"
] | 193 | 2016-09-19T02:55:00.000Z | 2022-03-10T13:43:50.000Z | emolga/layers/embeddings.py | Lencof/CopyNet | 361910930337cd6a446df5dd27c539e0a17bfaf9 | [
"MIT"
] | 6 | 2016-11-25T03:38:23.000Z | 2019-03-30T06:11:31.000Z | emolga/layers/embeddings.py | Lencof/CopyNet | 361910930337cd6a446df5dd27c539e0a17bfaf9 | [
"MIT"
] | 77 | 2016-10-14T10:08:44.000Z | 2021-03-11T05:01:27.000Z | # -*- coding: utf-8 -*-
from .core import Layer
from emolga.utils.theano_utils import *
import emolga.basic.initializations as initializations
class Embedding(Layer):
'''
Turn positive integers (indexes) into denses vectors of fixed size.
eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]
@in... | 27.379747 | 86 | 0.538141 |
from .core import Layer
from emolga.utils.theano_utils import *
import emolga.basic.initializations as initializations
class Embedding(Layer):
def __init__(self, input_dim, output_dim, init='uniform', name=None):
super(Embedding, self).__init__()
self.init = initializations.get(init)
s... | true | true |
f7f868d8e6d70ef9898d5cd30efbf9e8192e9a4a | 9,189 | py | Python | doxy_db/interface.py | abathur/doxy_db | fb7767dbdd0b41614d8a551609d9d6ff064b3e9c | [
"MIT"
] | null | null | null | doxy_db/interface.py | abathur/doxy_db | fb7767dbdd0b41614d8a551609d9d6ff064b3e9c | [
"MIT"
] | null | null | null | doxy_db/interface.py | abathur/doxy_db | fb7767dbdd0b41614d8a551609d9d6ff064b3e9c | [
"MIT"
] | null | null | null | """
A small interface to a doxygen database manual.
This API is intended to sit above the manual's abstraction level to minimize the knowledge a consumer needs to have of Doxygen's idioms.
It may meet your needs out of the box, but it probably won't meet everyone's. Even if it doesn't fit your needs, it should be use... | 34.287313 | 271 | 0.650343 |
from lxml import html
from functools import lru_cache
import json
class XMLTranslator(object):
@lru_cache(maxsize=2048)
def __call__(self, desc):
if not desc or not len(desc):
return None
nodes = map(
self.__outer_paragraphs__,
html.fragmen... | true | true |
f7f869df9b88fc253501fbf3a53e0156a4d3a40a | 33,447 | py | Python | code/EDAParallel.py | xijunlee/SPC-POSM | d5b831445437f93d00cb5fe7eb7ac462512feb13 | [
"MIT"
] | null | null | null | code/EDAParallel.py | xijunlee/SPC-POSM | d5b831445437f93d00cb5fe7eb7ac462512feb13 | [
"MIT"
] | null | null | null | code/EDAParallel.py | xijunlee/SPC-POSM | d5b831445437f93d00cb5fe7eb7ac462512feb13 | [
"MIT"
] | null | null | null | import sys
import math
import random
from random import randint
import copy
from sklearn.metrics import mean_squared_error
from sklearn import linear_model
import time
from sklearn import ensemble
from FileProcess import LoadDataFromText
import numpy as np
from pyspark import SparkContext, SparkConf
import pandas as pd... | 36.958011 | 196 | 0.555536 | import sys
import math
import random
from random import randint
import copy
from sklearn.metrics import mean_squared_error
from sklearn import linear_model
import time
from sklearn import ensemble
from FileProcess import LoadDataFromText
import numpy as np
from pyspark import SparkContext, SparkConf
import pandas as pd... | false | true |
f7f86aba727d1eeca2750c813dc714f609b6595d | 7,810 | py | Python | docs/conf.py | yazanattar99/MLOps | 0d11a10a23cbb3144590cb29e982e2c484b94f36 | [
"MIT"
] | null | null | null | docs/conf.py | yazanattar99/MLOps | 0d11a10a23cbb3144590cb29e982e2c484b94f36 | [
"MIT"
] | null | null | null | docs/conf.py | yazanattar99/MLOps | 0d11a10a23cbb3144590cb29e982e2c484b94f36 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# churn_model documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values ha... | 31.877551 | 80 | 0.708195 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'churn_model'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The... | true | true |
f7f86ac652d3ecf96126667f7c99c6a22c96758f | 408 | py | Python | test/travis_test_buzzer.py | mayabook/pimouse_ros | f7fb6e62561d8ebff8577e562d6f516dff0a43ea | [
"BSD-3-Clause"
] | null | null | null | test/travis_test_buzzer.py | mayabook/pimouse_ros | f7fb6e62561d8ebff8577e562d6f516dff0a43ea | [
"BSD-3-Clause"
] | null | null | null | test/travis_test_buzzer.py | mayabook/pimouse_ros | f7fb6e62561d8ebff8577e562d6f516dff0a43ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy, unittest, rostest
import rosnode
import time
class BuzzerTest(unittest.TestCase):
def test_node_exist(self):
nodes = rosnode.get_node_names()
self.assertIn('/buzzer',nodes, "node does not exist")
if __name__ == '__main__':
time.sleep(3)
rospy.init_node('... | 25.5 | 65 | 0.720588 |
import rospy, unittest, rostest
import rosnode
import time
class BuzzerTest(unittest.TestCase):
def test_node_exist(self):
nodes = rosnode.get_node_names()
self.assertIn('/buzzer',nodes, "node does not exist")
if __name__ == '__main__':
time.sleep(3)
rospy.init_node('travis_test_buzzer')
... | true | true |
f7f86c5a614607a75f8761edb936740344c72f81 | 366 | py | Python | copy_logo.py | Suke-H/LearningToPaint | 444e01477ff1b632df931da67af67464c0f9cb98 | [
"MIT"
] | null | null | null | copy_logo.py | Suke-H/LearningToPaint | 444e01477ff1b632df931da67af67464c0f9cb98 | [
"MIT"
] | null | null | null | copy_logo.py | Suke-H/LearningToPaint | 444e01477ff1b632df931da67af67464c0f9cb98 | [
"MIT"
] | null | null | null | from glob import glob
import numpy as np
import shutil
import os
SOURCE_PATH = "data/LLD-logo-files/"
MV_PATH = "image/"
imgs = np.array(glob(SOURCE_PATH + "**"))
N = len(imgs)
print(N)
choice = np.random.choice(N, 10)
print(choice)
for img in imgs[choice]:
# img_name = os.path.basename(img)
# os.remove(MV_... | 19.263158 | 41 | 0.688525 | from glob import glob
import numpy as np
import shutil
import os
SOURCE_PATH = "data/LLD-logo-files/"
MV_PATH = "image/"
imgs = np.array(glob(SOURCE_PATH + "**"))
N = len(imgs)
print(N)
choice = np.random.choice(N, 10)
print(choice)
for img in imgs[choice]:
shutil.copy(img, MV_PATH) | true | true |
f7f86ceb9999dbd51c5edf24f3d3f78ecf0d45ed | 9,135 | py | Python | pyleecan/GUI/Dialog/DMachineSetup/SPreview/WMachineTable/WMachineTable.py | nnassar98/pyleecan | 3a6ffe14ab46e90dc0b2855386623833c622b95e | [
"Apache-2.0"
] | 5 | 2020-03-05T15:22:39.000Z | 2022-03-02T15:26:08.000Z | pyleecan/GUI/Dialog/DMachineSetup/SPreview/WMachineTable/WMachineTable.py | thalesmaoa/pyleecan | c4fdc6362fdeba3d0766d5d1df3ff9c97c3f9fa3 | [
"Apache-2.0"
] | 8 | 2020-07-09T07:43:01.000Z | 2022-03-08T12:52:06.000Z | pyleecan/GUI/Dialog/DMachineSetup/SPreview/WMachineTable/WMachineTable.py | thalesmaoa/pyleecan | c4fdc6362fdeba3d0766d5d1df3ff9c97c3f9fa3 | [
"Apache-2.0"
] | 4 | 2019-12-23T12:38:01.000Z | 2022-01-07T10:47:48.000Z | # -*- coding: utf-8 -*-
from logging import getLogger
from os.path import join
import matplotlib.pyplot as plt
from PySide2.QtWidgets import QFileDialog, QTableWidgetItem, QWidget, QMessageBox
from ......Classes._FEMMHandler import _FEMMHandler
from ......Classes.Output import Output
from ......Classes.Simu1 import ... | 33.833333 | 88 | 0.555665 |
from logging import getLogger
from os.path import join
import matplotlib.pyplot as plt
from PySide2.QtWidgets import QFileDialog, QTableWidgetItem, QWidget, QMessageBox
from ......Classes._FEMMHandler import _FEMMHandler
from ......Classes.Output import Output
from ......Classes.Simu1 import Simu1
from ......Classe... | true | true |
f7f86d675097ecd0c1a803bf32493b2daf3b5786 | 253 | py | Python | frappe-bench/apps/erpnext/erpnext/setup/doctype/uom/uom.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/setup/doctype/uom/uom.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/setup/doctype/uom/uom.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class UOM(Document):
pass | 25.3 | 68 | 0.802372 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class UOM(Document):
pass | true | true |
f7f86fb53925948a4a057bcb045a8d45a27bec4a | 1,312 | py | Python | app/utility/list_back_access.py | syth0le/tg_reminder_bot | 956f552c2c81732aaa41c1f006e31f4167e7cdff | [
"MIT"
] | null | null | null | app/utility/list_back_access.py | syth0le/tg_reminder_bot | 956f552c2c81732aaa41c1f006e31f4167e7cdff | [
"MIT"
] | null | null | null | app/utility/list_back_access.py | syth0le/tg_reminder_bot | 956f552c2c81732aaa41c1f006e31f4167e7cdff | [
"MIT"
] | null | null | null | from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from app.buttons.reply_btns import remindersMenu
from app.reminders import get_all_reminders, get_temporary_reminders, get_bookmarks, get_permanent_reminders
from app.utility.answer_forms import answer_forms
async def back_access(data: str) -> str:... | 36.444444 | 108 | 0.682165 | from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from app.buttons.reply_btns import remindersMenu
from app.reminders import get_all_reminders, get_temporary_reminders, get_bookmarks, get_permanent_reminders
from app.utility.answer_forms import answer_forms
async def back_access(data: str) -> str:... | true | true |
f7f86fd20ba936a7f977c7d9fb04efbed7318635 | 10,671 | py | Python | magpylib/_src/display/plotly/plotly_sensor_mesh.py | OrtnerMichael/magPyLib | 4c7e7f56f6e0b915ec0e024c172c460fa80126e5 | [
"BSD-2-Clause"
] | null | null | null | magpylib/_src/display/plotly/plotly_sensor_mesh.py | OrtnerMichael/magPyLib | 4c7e7f56f6e0b915ec0e024c172c460fa80126e5 | [
"BSD-2-Clause"
] | null | null | null | magpylib/_src/display/plotly/plotly_sensor_mesh.py | OrtnerMichael/magPyLib | 4c7e7f56f6e0b915ec0e024c172c460fa80126e5 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
def get_sensor_mesh(
x_color="red",
y_color="green",
z_color="blue",
center_color="grey",
x_show=True,
y_show=True,
z_show=True,
center_show=True,
colorize_tails=True,
):
"""
returns a plotly mesh3d dictionary of a x,y,z arrows oriented in space according... | 66.69375 | 94 | 0.500984 | import numpy as np
def get_sensor_mesh(
x_color="red",
y_color="green",
z_color="blue",
center_color="grey",
x_show=True,
y_show=True,
z_show=True,
center_show=True,
colorize_tails=True,
):
trace = {
"type": "mesh3d",
"i": np.array([75, 64, 2, 75, 76, 65,... | true | true |
f7f86fedf6e276fcc79b2f2d5dc615ff903f34eb | 15,901 | py | Python | src/environment_provider/environment_provider.py | Greg4cr/etos-environment-provider | f150eb4946cb261a02d0da18713ea382379900fa | [
"Apache-2.0"
] | null | null | null | src/environment_provider/environment_provider.py | Greg4cr/etos-environment-provider | f150eb4946cb261a02d0da18713ea382379900fa | [
"Apache-2.0"
] | 15 | 2020-09-28T12:01:46.000Z | 2022-03-11T11:38:04.000Z | src/environment_provider/environment_provider.py | t-persson/etos-environment-provider | bf01dc2fe8f989bfc5c97dd543a15a15f0383540 | [
"Apache-2.0"
] | 4 | 2020-09-25T11:16:20.000Z | 2021-02-03T12:21:36.000Z | # Copyright 2020-2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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... | 39.358911 | 98 | 0.609459 |
import os
import uuid
import logging
import traceback
import json
from threading import Lock
from copy import deepcopy
from etos_lib.etos import ETOS
from etos_lib.logging.logger import FORMAT_CONFIG
from jsontas.jsontas import JsonTas
from environment_provider.splitter.split import Splitter
from .lib.ce... | true | true |
f7f8702645ae3f954f8122f88c93b97262a2fe34 | 11,528 | py | Python | Scripts/plot_Histograms_RawLENS.py | zmlabe/ExtremeEvents | 701c274c074dd2c4ae7c7294ec20f35c64e6ea2b | [
"MIT"
] | 3 | 2021-03-08T12:15:58.000Z | 2022-02-22T00:32:29.000Z | Scripts/plot_Histograms_RawLENS.py | zmlabe/ExtremeEvents | 701c274c074dd2c4ae7c7294ec20f35c64e6ea2b | [
"MIT"
] | null | null | null | Scripts/plot_Histograms_RawLENS.py | zmlabe/ExtremeEvents | 701c274c074dd2c4ae7c7294ec20f35c64e6ea2b | [
"MIT"
] | 6 | 2021-02-12T18:09:30.000Z | 2021-09-10T20:26:54.000Z | """
Scipt plots histograms of data with mean removed over 4 time periods
Author : Zachary M. Labe
Date : 7 January 2021
"""
### Import modules
import numpy as np
import scipy.stats as sts
import matplotlib.pyplot as plt
import calc_Utilities as UT
import calc_dataFunctions as df
import palettable.wesanderson ... | 33.511628 | 86 | 0.59169 |
stats as sts
import matplotlib.pyplot as plt
import calc_Utilities as UT
import calc_dataFunctions as df
import palettable.wesanderson as ww
import calc_Stats as dSS
p/ExtremeEvents_v1/Composites/LENS/'
reg_name = 'Globe'
dataset = 'lens'
rm_ensemble_mean = True
variq = ['T2M']
monthlychoice = 'annual'
yeartype = ['1... | true | true |
f7f871dca5889b9735f57ee44e1ad10703420a0a | 600 | py | Python | tests/test_equiv.py | mvcisback/mce-spec-inference | 58432b35e35b75cab1c77cbbe2057aff94794597 | [
"MIT"
] | null | null | null | tests/test_equiv.py | mvcisback/mce-spec-inference | 58432b35e35b75cab1c77cbbe2057aff94794597 | [
"MIT"
] | null | null | null | tests/test_equiv.py | mvcisback/mce-spec-inference | 58432b35e35b75cab1c77cbbe2057aff94794597 | [
"MIT"
] | null | null | null | import aiger_bv as BV
import aiger_coins as C
import aiger_ptltl as LTL
from mce.equiv import equiv_states
X = LTL.atom('x')
Y = LTL.atom('y')
SYS = C.circ2mdp(BV.aig2aigbv((X.once() | Y.once()).aig))
def test_equiv_states_smoke():
state = SYS._aigbv.latch2init
for t in range(3):
assert equiv_stat... | 24 | 68 | 0.633333 | import aiger_bv as BV
import aiger_coins as C
import aiger_ptltl as LTL
from mce.equiv import equiv_states
X = LTL.atom('x')
Y = LTL.atom('y')
SYS = C.circ2mdp(BV.aig2aigbv((X.once() | Y.once()).aig))
def test_equiv_states_smoke():
state = SYS._aigbv.latch2init
for t in range(3):
assert equiv_stat... | true | true |
f7f87326f4cfe5fe1ae69344beefe240004d11b6 | 2,360 | py | Python | ParlAI/tests/nightly/gpu/test_self_feeding.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 163 | 2019-06-23T14:07:57.000Z | 2022-02-25T23:06:07.000Z | ParlAI/tests/nightly/gpu/test_self_feeding.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 8 | 2019-07-24T12:41:31.000Z | 2022-02-10T00:17:20.000Z | ParlAI/tests/nightly/gpu/test_self_feeding.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 31 | 2019-06-26T01:21:07.000Z | 2021-09-06T17:23:24.000Z | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.core.testing_utils as testing_utils
"""
Integration tests for the Self-Feeding chatbot pro... | 30.649351 | 86 | 0.601695 |
import unittest
import parlai.core.testing_utils as testing_utils
@testing_utils.skipUnlessGPU
class TestSelffeeding(unittest.TestCase):
def test_dataset_integrity(self):
train_output, valid_output, test_output = testing_utils.display_data(
{'task': 'self_feeding:all'}
)
... | true | true |
f7f873e80e0701b9a77efc459af53f65aac99660 | 1,514 | py | Python | project/dealership/appcoches/models.py | Borjados/IngenieriaWeb | 573590fe30327971affa3f6fc562dbb815e9e553 | [
"bzip2-1.0.6"
] | null | null | null | project/dealership/appcoches/models.py | Borjados/IngenieriaWeb | 573590fe30327971affa3f6fc562dbb815e9e553 | [
"bzip2-1.0.6"
] | null | null | null | project/dealership/appcoches/models.py | Borjados/IngenieriaWeb | 573590fe30327971affa3f6fc562dbb815e9e553 | [
"bzip2-1.0.6"
] | null | null | null | from django.db import models
class Categoria (models.Model):
nombre = models.CharField(max_length=75)
url_categoria = models.CharField(max_length=2000)
class Vendedor (models.Model):
nombre = models.CharField(max_length=75, null=True)
apellido = models.CharField(max_length=75, null=True)
email... | 42.055556 | 93 | 0.739762 | from django.db import models
class Categoria (models.Model):
nombre = models.CharField(max_length=75)
url_categoria = models.CharField(max_length=2000)
class Vendedor (models.Model):
nombre = models.CharField(max_length=75, null=True)
apellido = models.CharField(max_length=75, null=True)
email... | true | true |
f7f8742872f597c7338354e067573207641604cd | 8,430 | py | Python | rqalpha/examples/extend_api/HKMod/realtime_data_source.py | hadrianl/rqalpha_kairui | eb0e0de1d69f1a4d6f349d4dc011e1c9eccfe2d8 | [
"Apache-2.0"
] | 2 | 2019-03-06T00:39:45.000Z | 2019-05-26T15:34:03.000Z | rqalpha/examples/extend_api/HKMod/realtime_data_source.py | hadrianl/rqalpha_kairui | eb0e0de1d69f1a4d6f349d4dc011e1c9eccfe2d8 | [
"Apache-2.0"
] | null | null | null | rqalpha/examples/extend_api/HKMod/realtime_data_source.py | hadrianl/rqalpha_kairui | eb0e0de1d69f1a4d6f349d4dc011e1c9eccfe2d8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/30 0030 9:43
# @Author : Hadrianl
# @File : realtime_data_source
# 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
#
# ... | 40.724638 | 180 | 0.641756 |
import os
import six
import numpy as np
from rqalpha.interface import AbstractDataSource
from rqalpha.const import MARGIN_TYPE
from rqalpha.utils.py2 import lru_cache
from rqalpha.utils.datetime_func import convert_date_to_int, convert_int_to_date
from rqalpha.utils.i18n import gettext as _
from rqa... | true | true |
f7f87428f3b1226ef4d4d717c6ee950613ede0b6 | 1,922 | py | Python | seqpos/lib/python2.7/site-packages/mercurial/scmwindows.py | guanjue/seqpos | ab9308ad128547ca968a1d944490710e583703bc | [
"MIT"
] | null | null | null | seqpos/lib/python2.7/site-packages/mercurial/scmwindows.py | guanjue/seqpos | ab9308ad128547ca968a1d944490710e583703bc | [
"MIT"
] | null | null | null | seqpos/lib/python2.7/site-packages/mercurial/scmwindows.py | guanjue/seqpos | ab9308ad128547ca968a1d944490710e583703bc | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import os
from . import (
encoding,
pycompat,
util,
win32,
)
try:
import _winreg as winreg
winreg.CloseKey
except ImportError:
import winreg
# MS-DOS 'more' is the only pager available by default on Windows.
fallbackpager = 'more'
def systemrcpath(... | 31 | 69 | 0.631634 | from __future__ import absolute_import
import os
from . import (
encoding,
pycompat,
util,
win32,
)
try:
import _winreg as winreg
winreg.CloseKey
except ImportError:
import winreg
fallbackpager = 'more'
def systemrcpath():
rcpath = []
filename = win32.executablepath()
... | true | true |
f7f8751701c664915245122336c8f017860e8762 | 6,268 | py | Python | scripts/14_I.py | HalfInner/AoC2019 | 9badb1d44cd5672b4e5860c8cb7490d60d7c19e3 | [
"MIT"
] | 1 | 2019-12-13T20:02:55.000Z | 2019-12-13T20:02:55.000Z | scripts/14_I.py | HalfInner/AoC2019 | 9badb1d44cd5672b4e5860c8cb7490d60d7c19e3 | [
"MIT"
] | null | null | null | scripts/14_I.py | HalfInner/AoC2019 | 9badb1d44cd5672b4e5860c8cb7490d60d7c19e3 | [
"MIT"
] | null | null | null | '''
--- Day 14: Space Stoichiometry ---
As you approach the rings of Saturn, your ship's low fuel indicator turns on. There isn't any fuel here, but the rings have plenty of raw material. Perhaps your ship's Inter-Stellar Refinery Union brand nanofactory can turn these raw materials into fuel.
You ask the nanofactory ... | 40.96732 | 562 | 0.689215 |
import sys
import re
from collections import deque
from math import ceil
def produce_chemical(chemical_receipts, seek_chemical='FUEL'):
base_chemical = 'ORE'
stack = deque([seek_chemical])
chemical_ingredients = {base_chemical: 0}
ore_creators = {}
div = 1
while stack:
generating_che... | true | true |
f7f876044c0a1f8805ab465254bfe383b3380f3d | 2,420 | py | Python | Graphics/Canvas.py | TausifAnsari/PyHub | f6c949dc6a3974f57d7d146708443d0ceeb4418f | [
"MIT"
] | 1 | 2020-09-30T19:31:20.000Z | 2020-09-30T19:31:20.000Z | Graphics/Canvas.py | TanviSutar/PyHub | 6281e9f515674fb51f0d0862c26ec18020fa7d83 | [
"MIT"
] | null | null | null | Graphics/Canvas.py | TanviSutar/PyHub | 6281e9f515674fb51f0d0862c26ec18020fa7d83 | [
"MIT"
] | null | null | null | from tkinter import *
def doc():
"""
Using the Tkinter canvas :
• bd : Border Width in pixels. Default value : 2
• bg : Background Colour.
• Confine : If true, the canvas cannot be scrolled outside the scroll region.
• Cursor : The c... | 36.666667 | 111 | 0.652893 | from tkinter import *
def doc():
print(doc.__doc__)
root = Tk()
root.title("Arc")
root.geometry("500x500")
root.iconbitmap("assets/favicon.ico")
y = Canvas(root, width=500,height=500,bg="black")
y.pack()
coordinates = 10,50,240,210
arc = y.create_arc(coordinates, start=0, extent=150, fill="white")
mainloop()
root = T... | true | true |
f7f876e7206d63a37cf68f3aa907bb9332beba14 | 5,317 | py | Python | test/module/test_template.py | PokaInc/cfn-python-lint | 2cd49b838088a1be1b1a5e5abdff556f264903b4 | [
"MIT-0"
] | null | null | null | test/module/test_template.py | PokaInc/cfn-python-lint | 2cd49b838088a1be1b1a5e5abdff556f264903b4 | [
"MIT-0"
] | null | null | null | test/module/test_template.py | PokaInc/cfn-python-lint | 2cd49b838088a1be1b1a5e5abdff556f264903b4 | [
"MIT-0"
] | null | null | null | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 ... | 35.925676 | 136 | 0.564228 | from cfnlint import Template
from testlib.testcase import BaseTestCase
class TestTemplate(BaseTestCase):
def setUp(self):
filename = 'test/fixtures/templates/good/generic.yaml'
template = self.load_template(filename)
self.template = Template(filename, template)
self.resource_name... | true | true |
f7f8772bc75acbd519b7c21a5edfe35cbdaad8c5 | 3,816 | py | Python | watertap/examples/flowsheets/full_treatment_train/model_components/unit_0DRO.py | jalving/watertap | a89bd61deaaca9c30402727545e8223a276c93e6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | watertap/examples/flowsheets/full_treatment_train/model_components/unit_0DRO.py | jalving/watertap | a89bd61deaaca9c30402727545e8223a276c93e6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | watertap/examples/flowsheets/full_treatment_train/model_components/unit_0DRO.py | jalving/watertap | a89bd61deaaca9c30402727545e8223a276c93e6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | ###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... | 37.048544 | 94 | 0.632075 | true | true | |
f7f8777c4120d6e87e5b2115ca5195a0e9c8fe05 | 180 | py | Python | what_apps/presence/functions.py | SlashRoot/WHAT | 69e78d01065142446234e77ea7c8c31e3482af29 | [
"MIT"
] | null | null | null | what_apps/presence/functions.py | SlashRoot/WHAT | 69e78d01065142446234e77ea7c8c31e3482af29 | [
"MIT"
] | null | null | null | what_apps/presence/functions.py | SlashRoot/WHAT | 69e78d01065142446234e77ea7c8c31e3482af29 | [
"MIT"
] | null | null | null | def how_user_handles_food(user):
try:
if user.handles_food_with_vigilance:
return "vigilance"
except AttributeError:
return "probably a sucker." | 30 | 44 | 0.666667 | def how_user_handles_food(user):
try:
if user.handles_food_with_vigilance:
return "vigilance"
except AttributeError:
return "probably a sucker." | true | true |
f7f878f1aa78ce5df61fe7b3686bea64cf0b1e66 | 288 | py | Python | ai4water/postprocessing/SeqMetrics/__init__.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/postprocessing/SeqMetrics/__init__.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/postprocessing/SeqMetrics/__init__.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | """SeqMetrics, the module to calculate performance related to tabular/structured and sequential data.
The values in a sequence are not necessarily related.
"""
from ._SeqMetrics import Metrics
from ._regression import RegressionMetrics
from ._classification import ClassificationMetrics
| 36 | 101 | 0.833333 |
from ._SeqMetrics import Metrics
from ._regression import RegressionMetrics
from ._classification import ClassificationMetrics
| true | true |
f7f8795c7a600262712e370ae7d87edc408df69a | 306 | py | Python | taobao_wechat_bot/top/api/rest/BaichuanOrderurlGetRequest.py | zyphs21/myPythonPractise | 7da984c98ee93e650ab2f9da4a2502340f1220b4 | [
"MIT"
] | null | null | null | taobao_wechat_bot/top/api/rest/BaichuanOrderurlGetRequest.py | zyphs21/myPythonPractise | 7da984c98ee93e650ab2f9da4a2502340f1220b4 | [
"MIT"
] | null | null | null | taobao_wechat_bot/top/api/rest/BaichuanOrderurlGetRequest.py | zyphs21/myPythonPractise | 7da984c98ee93e650ab2f9da4a2502340f1220b4 | [
"MIT"
] | null | null | null | '''
Created by auto_sdk on 2015.06.10
'''
from top.api.base import RestApi
class BaichuanOrderurlGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.name = None
def getapiname(self):
return 'taobao.baichuan.orderurl.get'
| 25.5 | 56 | 0.72549 | from top.api.base import RestApi
class BaichuanOrderurlGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.name = None
def getapiname(self):
return 'taobao.baichuan.orderurl.get'
| true | true |
f7f879694ce499eb28bc61ff25bff05417c15a11 | 1,736 | py | Python | python/clx/utils/data/utils.py | shaneding/clx | 6225c03a6bf5c9f7e1b31ace664dca12118f2706 | [
"Apache-2.0"
] | 143 | 2019-11-06T16:08:50.000Z | 2022-03-22T12:14:59.000Z | python/clx/utils/data/utils.py | shaneding/clx | 6225c03a6bf5c9f7e1b31ace664dca12118f2706 | [
"Apache-2.0"
] | 361 | 2019-11-06T20:33:24.000Z | 2022-03-31T19:59:12.000Z | python/clx/utils/data/utils.py | shaneding/clx | 6225c03a6bf5c9f7e1b31ace664dca12118f2706 | [
"Apache-2.0"
] | 82 | 2019-11-06T17:36:42.000Z | 2022-03-17T07:03:04.000Z | # Copyright (c) 2020, NVIDIA 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... | 33.384615 | 133 | 0.6947 |
import cudf
import logging
log = logging.getLogger(__name__)
def str2ascii(df, col_name):
df["len"] = df[col_name].str.len()
df = df.sort_values("len", ascending=False)
split_df = df[col_name].str.findall("[\w\W\d\D\s\S]")
columns_cnt = len(split_df.columns)
split_df = split_d... | true | true |
f7f879a7e195e1737735d4a49ac43b8262fb237f | 898 | py | Python | train_net/read_and_reshape_data.py | ryanmdavis/classifyHistology | 563687250f6d81a7e2596607587238354e7279e5 | [
"MIT"
] | null | null | null | train_net/read_and_reshape_data.py | ryanmdavis/classifyHistology | 563687250f6d81a7e2596607587238354e7279e5 | [
"MIT"
] | null | null | null | train_net/read_and_reshape_data.py | ryanmdavis/classifyHistology | 563687250f6d81a7e2596607587238354e7279e5 | [
"MIT"
] | null | null | null | from tensorflow.examples.tutorials.mnist import input_data
def readReshapeData(path):
# extract data
data = input_data.read_data_sets(path,one_hot=True)
# print info about the datasets
# Shapes of training set
print("Training set (images) shape: {shape}".format(shape=data.train.images.shape))
... | 37.416667 | 87 | 0.691537 | from tensorflow.examples.tutorials.mnist import input_data
def readReshapeData(path):
data = input_data.read_data_sets(path,one_hot=True)
print("Training set (images) shape: {shape}".format(shape=data.train.images.shape))
print("Training set (labels) shape: {shape}".format(shape=data.tr... | true | true |
f7f87a2673453b53a81f3e74665cd1b6bd46b323 | 11,402 | py | Python | test_models.py | ty-97/SDA | 047d8e6ed238f77d8a7846cf3ac9916c4f0d8fbc | [
"MIT"
] | 2 | 2021-08-09T06:36:08.000Z | 2021-11-09T05:37:20.000Z | test_models.py | ty-97/SDA | 047d8e6ed238f77d8a7846cf3ac9916c4f0d8fbc | [
"MIT"
] | 1 | 2022-02-14T07:49:48.000Z | 2022-02-17T03:41:47.000Z | test_models.py | ty-97/SDA | 047d8e6ed238f77d8a7846cf3ac9916c4f0d8fbc | [
"MIT"
] | null | null | null | # Code for "TSM: Temporal Shift Module for Efficient Video Understanding"
# arXiv:1811.08383
# Ji Lin*, Chuang Gan, Song Han
# {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu
import os
import time
import shutil
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
from torch.nn.... | 38.133779 | 173 | 0.564901 |
import os
import time
import shutil
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
from torch.nn.utils import clip_grad_norm_
from torch.nn import functional as F
from sklearn.metrics import confusion_matrix
from ops.dataset import TSNDataSet
from ops.models_test imp... | true | true |
f7f87b3c9acd71b954620d66bf8efd52255bf583 | 1,023 | py | Python | trace-viewer/tracing/build/check_gypi.py | RSB4760/apq8016_external_chromium-trace | 45b575bb05b3714142a9d67b9bd153740ef99226 | [
"BSD-3-Clause"
] | null | null | null | trace-viewer/tracing/build/check_gypi.py | RSB4760/apq8016_external_chromium-trace | 45b575bb05b3714142a9d67b9bd153740ef99226 | [
"BSD-3-Clause"
] | null | null | null | trace-viewer/tracing/build/check_gypi.py | RSB4760/apq8016_external_chromium-trace | 45b575bb05b3714142a9d67b9bd153740ef99226 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 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.
import sys
import os
tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '..'))
if ... | 27.648649 | 77 | 0.659824 |
import sys
import os
tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '..'))
if tracing_path not in sys.path:
sys.path.append(tracing_path)
from tracing.build import check_common
GYPI_FILE = os.path.abspath(os.path.join(os.path.dirname(__f... | false | true |
f7f87b8eb066e5b1cbf1b21db016462edda147c6 | 1,366 | py | Python | blog/migrations/0001_initial.py | wlcobb/assignment1-wlcobb | 9cf97f7c7efac5f33f5ee36559223369bfd20973 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | wlcobb/assignment1-wlcobb | 9cf97f7c7efac5f33f5ee36559223369bfd20973 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | wlcobb/assignment1-wlcobb | 9cf97f7c7efac5f33f5ee36559223369bfd20973 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-24 00:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 37.944444 | 147 | 0.606881 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
f7f87cf58e6fa31c9c8b3c812216d57c8b875297 | 2,702 | py | Python | setup.py | teitei-tk/SixIsles | 68ac3510bc35910c3822e36a309a4a7e179f60c7 | [
"MIT"
] | null | null | null | setup.py | teitei-tk/SixIsles | 68ac3510bc35910c3822e36a309a4a7e179f60c7 | [
"MIT"
] | null | null | null | setup.py | teitei-tk/SixIsles | 68ac3510bc35910c3822e36a309a4a7e179f60c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
SixIsles
========
PyMongo Based ActiveRecord Pattern O/R Mapper
--------------
Dependencies
------------
- Python2.6 or Later
- PyMongo >= 3.1.1
Installation
------------
.. code:: bash
$ pip install SixIsles
Example
-------
Add Github Repository Documents
.. code:: python
... | 21.444444 | 146 | 0.613249 |
try:
import setuptools
from setuptools import setup, find_packages
except ImportError:
import sys
print("Please install setuptools.")
sys.exit(1)
import versions
classifiers = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Pyt... | true | true |
f7f87fbd5599812eb9d0729ffa5be717c649df8e | 562 | py | Python | gym_multilayerthinfilm/__init__.py | MLResearchAtOSRAM/gym-multilayerthinfilm | 3f98520577de032de52afbfe79d161b866fd6cd6 | [
"MIT"
] | 5 | 2021-09-08T13:09:52.000Z | 2022-03-17T18:49:55.000Z | gym_multilayerthinfilm/__init__.py | MLResearchAtOSRAM/gym-multilayerthinfilm | 3f98520577de032de52afbfe79d161b866fd6cd6 | [
"MIT"
] | null | null | null | gym_multilayerthinfilm/__init__.py | MLResearchAtOSRAM/gym-multilayerthinfilm | 3f98520577de032de52afbfe79d161b866fd6cd6 | [
"MIT"
] | 3 | 2021-09-08T17:55:51.000Z | 2022-01-27T07:37:53.000Z | """
gym-multilayerthinfilm - A reinforcement learning environment for designing multilayer thin-films based on
transfer-matrix method optics package, for calculating
reflection, transmission, absorption, and other relevant aspects of thin
and thick multilayer (or single-layer) films.
Written by Heribert Wankerl ... | 33.058824 | 107 | 0.795374 |
from gym_multilayerthinfilm import *
from gym_multilayerthinfilm.utils import *
from gym_multilayerthinfilm.gym_class import *
| true | true |
f7f88051cccc86ea36ff52143595a5d10e923f0d | 721 | py | Python | 2015/day_05_part2.py | jorvis/AdventOfCode | 97c42037abc28c1c16cc3e48a30f2689ca950fb5 | [
"MIT"
] | null | null | null | 2015/day_05_part2.py | jorvis/AdventOfCode | 97c42037abc28c1c16cc3e48a30f2689ca950fb5 | [
"MIT"
] | null | null | null | 2015/day_05_part2.py | jorvis/AdventOfCode | 97c42037abc28c1c16cc3e48a30f2689ca950fb5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
def is_nice_string(s):
# It contains a pair of any two letters that appears at least twice
# in the string without overlapping
matches = re.findall(r"([a-zA-Z]{2}).*\1", s)
if len(matches) == 0:
return False
# It contains at least one letter which repeats... | 24.033333 | 75 | 0.565881 |
import re
def is_nice_string(s):
matches = re.findall(r"([a-zA-Z]{2}).*\1", s)
if len(matches) == 0:
return False
m = re.search(r"([a-zA-Z]).\1", s)
if not m:
return False
return True
| true | true |
f7f88134a2d2774c5cd6a84b20a1928fbeea771a | 153 | py | Python | sanjip/__init__.py | Sanji-IO/sanjip | 5ab77263d8190f803f6f4bd063459873ac9bcabb | [
"MIT"
] | null | null | null | sanjip/__init__.py | Sanji-IO/sanjip | 5ab77263d8190f803f6f4bd063459873ac9bcabb | [
"MIT"
] | 1 | 2019-09-23T20:58:57.000Z | 2019-09-23T20:58:57.000Z | sanjip/__init__.py | Sanji-IO/sanjip | 5ab77263d8190f803f6f4bd063459873ac9bcabb | [
"MIT"
] | 1 | 2019-09-23T00:23:02.000Z | 2019-09-23T00:23:02.000Z | from __future__ import absolute_import
import sanjip.ip as ip
import sanjip.ip.addr
import sanjip.ip.route # noqa: F401
__all__ = [ip.addr, ip.route]
| 19.125 | 38 | 0.771242 | from __future__ import absolute_import
import sanjip.ip as ip
import sanjip.ip.addr
import sanjip.ip.route
__all__ = [ip.addr, ip.route]
| true | true |
f7f88159735653287f31753857f3ce86c7a3e4b4 | 783 | py | Python | src/agender.py | bagustris/nkululeko | 87a4918b37e2a8599b81c4752c6750fc8adaa079 | [
"MIT"
] | 3 | 2021-11-08T08:26:58.000Z | 2022-02-16T15:26:06.000Z | src/agender.py | bagustris/nkululeko | 87a4918b37e2a8599b81c4752c6750fc8adaa079 | [
"MIT"
] | 12 | 2021-09-09T10:11:50.000Z | 2022-02-22T15:36:33.000Z | src/agender.py | bagustris/nkululeko | 87a4918b37e2a8599b81c4752c6750fc8adaa079 | [
"MIT"
] | 1 | 2021-11-08T23:53:48.000Z | 2021-11-08T23:53:48.000Z | # agender.py
from dataset import Dataset
import audformat
import os
import glob_conf
class Agender(Dataset):
"""Class to represent the agender age and gender dataset"""
name = 'agender' # The name
def __init__(self, config):
"""Constructor setting the name"""
Dataset.__init__(self, self.n... | 30.115385 | 72 | 0.63857 |
from dataset import Dataset
import audformat
import os
import glob_conf
class Agender(Dataset):
name = 'agender'
def __init__(self, config):
Dataset.__init__(self, self.name, config)
def load(self):
root = self.config['DATA'][self.name]
db = audformat.Database.load(root)
... | true | true |
f7f8828b4cfd7e84adf786dce8b7506703379faf | 29,044 | py | Python | tests/kafkatest/services/streams.py | smagill-test/kafka | f3a9ce4a69d17db7b8ba21134eb8118070176e48 | [
"Apache-2.0"
] | 1 | 2020-07-01T12:04:35.000Z | 2020-07-01T12:04:35.000Z | tests/kafkatest/services/streams.py | smagill-test/kafka | f3a9ce4a69d17db7b8ba21134eb8118070176e48 | [
"Apache-2.0"
] | 1 | 2021-10-09T04:39:50.000Z | 2021-10-09T04:39:50.000Z | tests/kafkatest/services/streams.py | smagill-test/kafka | f3a9ce4a69d17db7b8ba21134eb8118070176e48 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 43.740964 | 171 | 0.603119 |
import os.path
import signal
import streams_property
import consumer_property
from ducktape.cluster.remoteaccount import RemoteCommandError
from ducktape.services.service import Service
from ducktape.utils.util import wait_until
from kafkatest.directory_layout.kafka_path import KafkaPathResolverMixin
fro... | false | true |
f7f885492edf5b61c328e48b5c3832df019289bf | 3,523 | py | Python | src/train_DBM.py | 1512474508/deep-generative-models | 67d65d63f9f67050c29ae500bdd6b4518da14f7c | [
"MIT"
] | 1 | 2020-07-28T07:03:21.000Z | 2020-07-28T07:03:21.000Z | src/train_DBM.py | 1512474508/deep-generative-models | 67d65d63f9f67050c29ae500bdd6b4518da14f7c | [
"MIT"
] | null | null | null | src/train_DBM.py | 1512474508/deep-generative-models | 67d65d63f9f67050c29ae500bdd6b4518da14f7c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import pickle
import datetime
import argparse
import re
import glob
from obj.DBM import DBM
import tensorflow as tf
import numpy as np
import matplotlib.image as mpimg
from skimage.transform import resize
################################
# train DBM from input ... | 42.445783 | 144 | 0.62759 |
import os
import pickle
import datetime
import argparse
import re
import glob
from obj.DBM import DBM
import tensorflow as tf
import numpy as np
import matplotlib.image as mpimg
from skimage.transform import resize
time = getCurrentTime()+"_"+re.sub(",","_",dims)+"_"+data+"_dbm"
os.makedirs("pickles/"+current_t... | true | true |
f7f8858d90fb3295fa86e40f94d4ca11fce76ac9 | 2,047 | py | Python | lpot/ux/utils/expiring_dict.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | lpot/ux/utils/expiring_dict.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | lpot/ux/utils/expiring_dict.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 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 applicab... | 33.557377 | 85 | 0.657548 |
import time
from collections import UserDict
from typing import Any, Optional
class ExpiringDictItem:
def __init__(self, value: Any, expires_at: float):
self.value = value
self.expires_at = expires_at
def is_expired(self) -> bool:
return time.time() > self.expires_at
... | true | true |
f7f88cc7be9898b09db70273b2cfc6e67eac9843 | 451 | py | Python | apps/puzzles/migrations/0010_auto_20180201_2215.py | madjaqk/puzzle_master_v2 | e50b0f02abbf32aebe9583152bd9a5b43f5da7d7 | [
"MIT"
] | null | null | null | apps/puzzles/migrations/0010_auto_20180201_2215.py | madjaqk/puzzle_master_v2 | e50b0f02abbf32aebe9583152bd9a5b43f5da7d7 | [
"MIT"
] | 8 | 2020-02-07T04:11:07.000Z | 2022-02-10T07:04:57.000Z | apps/puzzles/migrations/0010_auto_20180201_2215.py | madjaqk/puzzle_master_v2 | e50b0f02abbf32aebe9583152bd9a5b43f5da7d7 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2018-02-02 06:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('puzzles', '0009_puzzle_description'),
]
operations = [
migrations.AlterField(
model_name='puzzle',
name='metapuzzles',... | 23.736842 | 112 | 0.631929 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('puzzles', '0009_puzzle_description'),
]
operations = [
migrations.AlterField(
model_name='puzzle',
name='metapuzzles',
field=models.ManyToManyField(bla... | true | true |
f7f88cf4609bc9be85514bd2253b6d7fa8cfb737 | 862 | py | Python | password_generator/urls.py | ritssaikiran90/django-passwordgenerator | 03cebcd97be68794531b13c116d767f1d669c471 | [
"Apache-2.0"
] | null | null | null | password_generator/urls.py | ritssaikiran90/django-passwordgenerator | 03cebcd97be68794531b13c116d767f1d669c471 | [
"Apache-2.0"
] | null | null | null | password_generator/urls.py | ritssaikiran90/django-passwordgenerator | 03cebcd97be68794531b13c116d767f1d669c471 | [
"Apache-2.0"
] | null | null | null | """password_generator URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 37.478261 | 77 | 0.719258 |
from django.urls import path
from generator import views
urlpatterns = [
path('home/',views.home,name="home"),
path('home/generatepasswords/',views.passwords,name="password"),
]
| true | true |
f7f88db69a48ca2950b283e2c40bcc0b02579ea4 | 23,322 | py | Python | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | 1 | 2020-07-28T18:01:53.000Z | 2020-07-28T18:01:53.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.790795 | 198 | 0.671855 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class CustomDomainsOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._se... | true | true |
f7f88e0d59aa4250edde3820139163f252991316 | 1,479 | py | Python | meiduo_mall/meiduo_mall/urls.py | 00wsmart00/meiduo_project_all | 43af3685aa847705154d0a1982a9ed8a1432fc43 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/urls.py | 00wsmart00/meiduo_project_all | 43af3685aa847705154d0a1982a9ed8a1432fc43 | [
"MIT"
] | 9 | 2020-05-11T20:24:01.000Z | 2022-02-26T15:05:53.000Z | meiduo_mall/meiduo_mall/urls.py | 00wsmart00/meiduo_project_all | 43af3685aa847705154d0a1982a9ed8a1432fc43 | [
"MIT"
] | null | null | null | """meiduo_mall URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | 33.613636 | 79 | 0.644354 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('users.urls', namespace='users')),
url(r'^', include('contents.urls', namespace='contents')),
url(r'^', include('verifications.urls')),
... | true | true |
f7f88e5b74de452ffb6e4c73bb7886b085b10acb | 427 | py | Python | rununi2zg.py | gold-mdy-geo/UFC1 | 308ddfd6a20420756255ffd73c71d8c8af8fcd63 | [
"MIT"
] | null | null | null | rununi2zg.py | gold-mdy-geo/UFC1 | 308ddfd6a20420756255ffd73c71d8c8af8fcd63 | [
"MIT"
] | null | null | null | rununi2zg.py | gold-mdy-geo/UFC1 | 308ddfd6a20420756255ffd73c71d8c8af8fcd63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import codecs
import uni2zg
import sys
input_file_name = sys.argv[1]
output_file_name = sys.argv[2]
input_file = codecs.open(input_file_name, encoding='utf-8')
output_file = codecs.open(output_file_name, encoding='utf-8', mode='w')
for input_line in input_file:
input_line = uni2zg.convert(... | 20.333333 | 71 | 0.754098 |
import codecs
import uni2zg
import sys
input_file_name = sys.argv[1]
output_file_name = sys.argv[2]
input_file = codecs.open(input_file_name, encoding='utf-8')
output_file = codecs.open(output_file_name, encoding='utf-8', mode='w')
for input_line in input_file:
input_line = uni2zg.convert(input_line)
output_fi... | true | true |
f7f88e9018ecd10e3778563e14f73ca1e1520113 | 8,123 | py | Python | docs/conf.py | d-brakenhoff/timml | ca94c8f155e59e5c02db3cb5c3dd50a7d478896e | [
"MIT"
] | 24 | 2015-09-13T17:11:58.000Z | 2021-12-14T09:09:17.000Z | docs/conf.py | d-brakenhoff/timml | ca94c8f155e59e5c02db3cb5c3dd50a7d478896e | [
"MIT"
] | 42 | 2015-09-23T19:29:34.000Z | 2022-01-17T09:13:14.000Z | docs/conf.py | d-brakenhoff/timml | ca94c8f155e59e5c02db3cb5c3dd50a7d478896e | [
"MIT"
] | 26 | 2015-08-24T17:25:27.000Z | 2021-07-09T14:09:30.000Z | # -*- coding: utf-8 -*-
#
# PASTAS documentation build configuration file, created by
# sphinx-quickstart on Wed May 11 12:38:06 2016.
# Repository setup is according to:
# http://gisellezeno.com/tutorials/sphinx-for-python-documentation.html
#
# This file is execfile()d with the current directory set to its
# contain... | 30.309701 | 79 | 0.690878 |
import os
import sys
import alabaster
sys.path.insert(0, os.path.abspath('.'))
extensions = [
'alabaster',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.covera... | true | true |
f7f88e9418b85fafd10517a63f6258ec08a8d1ff | 2,862 | py | Python | tests/conftest.py | Richie78321/airtable-python-wrapper | 033f2b85f9da511730258a61af2fba040c4b7e95 | [
"MIT"
] | null | null | null | tests/conftest.py | Richie78321/airtable-python-wrapper | 033f2b85f9da511730258a61af2fba040c4b7e95 | [
"MIT"
] | null | null | null | tests/conftest.py | Richie78321/airtable-python-wrapper | 033f2b85f9da511730258a61af2fba040c4b7e95 | [
"MIT"
] | null | null | null | import pytest
from collections import OrderedDict
from posixpath import join as urljoin
from requests import HTTPError
from urllib.parse import urlencode, quote
from mock import Mock
from airtable import Airtable
@pytest.fixture
def url_builder():
""" Builds Airtable Api Url Manually for mock testing """
d... | 24.672414 | 100 | 0.627184 | import pytest
from collections import OrderedDict
from posixpath import join as urljoin
from requests import HTTPError
from urllib.parse import urlencode, quote
from mock import Mock
from airtable import Airtable
@pytest.fixture
def url_builder():
def _url_builder(base_key, table_name, params=None):
ur... | true | true |
f7f88ee32d093e14d7e3353849f14ba2671cc82e | 13,520 | py | Python | python/infra/DisplayCoverage.py | uofs-simlab/ChasteOS | 04d98998e2ebad3f29086b8eaa1d89c08c6fccf6 | [
"Apache-2.0"
] | null | null | null | python/infra/DisplayCoverage.py | uofs-simlab/ChasteOS | 04d98998e2ebad3f29086b8eaa1d89c08c6fccf6 | [
"Apache-2.0"
] | null | null | null | python/infra/DisplayCoverage.py | uofs-simlab/ChasteOS | 04d98998e2ebad3f29086b8eaa1d89c08c6fccf6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Copyright (c) 2005-2016, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in ... | 45.986395 | 143 | 0.617456 |
"""Copyright (c) 2005-2016, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary for... | false | true |
f7f88fa8748e9e687c730de4d73ba1cc49ab3ac0 | 317 | py | Python | scripts/exercicios/ex107.py | RuanBarretodosSantos/python | 4142ccd71c4ffb4bb6a10d61c85f612758f5bb41 | [
"MIT"
] | null | null | null | scripts/exercicios/ex107.py | RuanBarretodosSantos/python | 4142ccd71c4ffb4bb6a10d61c85f612758f5bb41 | [
"MIT"
] | null | null | null | scripts/exercicios/ex107.py | RuanBarretodosSantos/python | 4142ccd71c4ffb4bb6a10d61c85f612758f5bb41 | [
"MIT"
] | null | null | null | from utilidadesCev import moeda
preco = float(input('Digite o preço: R$ '))
print(f'A metade de R${preco} é R${moeda.metade(preco)}')
print(f'O dobro de R${preco} é R${moeda.dobro(preco)}')
print(f'Aumentando 10%, temos R${moeda.aumentar(preco)}')
print(f'Diminuindo 13%, temos R${moeda.diminuir(preco)}')
print()
| 31.7 | 58 | 0.697161 | from utilidadesCev import moeda
preco = float(input('Digite o preço: R$ '))
print(f'A metade de R${preco} é R${moeda.metade(preco)}')
print(f'O dobro de R${preco} é R${moeda.dobro(preco)}')
print(f'Aumentando 10%, temos R${moeda.aumentar(preco)}')
print(f'Diminuindo 13%, temos R${moeda.diminuir(preco)}')
print()
| true | true |
f7f891cbec2d7de7bfaa07c51a7bbc0169f3390c | 408 | py | Python | generator/modules/onnx.py | dayta-ai/deepo | fa720e39052e63adfe0f2b9dbd8444a0d69c2540 | [
"MIT"
] | 1 | 2021-11-18T18:34:29.000Z | 2021-11-18T18:34:29.000Z | generator/modules/onnx.py | dayta-ai/deepo | fa720e39052e63adfe0f2b9dbd8444a0d69c2540 | [
"MIT"
] | null | null | null | generator/modules/onnx.py | dayta-ai/deepo | fa720e39052e63adfe0f2b9dbd8444a0d69c2540 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .__module__ import Module, dependency, source
from .python import Python
@dependency(Python)
@source('pip')
class Onnx(Module):
def build(self):
return r'''
RUN DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
protobuf-compiler \
libprotoc... | 21.473684 | 57 | 0.536765 |
from .__module__ import Module, dependency, source
from .python import Python
@dependency(Python)
@source('pip')
class Onnx(Module):
def build(self):
return r'''
RUN DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
protobuf-compiler \
libprotoc-dev \
... | true | true |
f7f8928fd3787be3903e58e17905e46d770f2c88 | 347 | py | Python | toontown/rpc/AwardManagerUD.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2020-02-07T18:15:12.000Z | 2020-02-07T18:15:12.000Z | toontown/rpc/AwardManagerUD.py | AnythingTechPro/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | toontown/rpc/AwardManagerUD.py | AnythingTechPro/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD
class AwardManagerUD(DistributedObjectGlobalUD):
notify = DirectNotifyGlobal.directNotify.newCategory("AwardManagerUD")
def giveAwardToToon(self, todo0, todo1, todo2, todo3, to... | 34.7 | 82 | 0.818444 | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD
class AwardManagerUD(DistributedObjectGlobalUD):
notify = DirectNotifyGlobal.directNotify.newCategory("AwardManagerUD")
def giveAwardToToon(self, todo0, todo1, todo2, todo3, to... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.