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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72c0bf5b4bcb72b7e7dd97debcab75606cc1e94 | 4,894 | py | Python | Widgets/openGL_widgets/VectorGLContext.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | Widgets/openGL_widgets/VectorGLContext.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | Widgets/openGL_widgets/VectorGLContext.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QWidget
from Widgets.openGL_widgets.AbstractGLContext import AbstractGLContext
from ColorPolicy import ColorPolicy
from ctypes import c_void_p
from PyQt5.Qt import Qt
from PyQt5.QtCore import QPoint, QThread
from cython_modules.color_policy import multi_iteration_normalize
from pattern_t... | 38.84127 | 86 | 0.626481 | from PyQt5.QtWidgets import QWidget
from Widgets.openGL_widgets.AbstractGLContext import AbstractGLContext
from ColorPolicy import ColorPolicy
from ctypes import c_void_p
from PyQt5.Qt import Qt
from PyQt5.QtCore import QPoint, QThread
from cython_modules.color_policy import multi_iteration_normalize
from pattern_t... | true | true |
f72c0c49d7421b18eade26ce7db864b767a81dcd | 6,768 | py | Python | tests/infra/runner.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | tests/infra/runner.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | tests/infra/runner.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import getpass
import time
import http
import logging
from random import seed
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
from loguru import logger as LO... | 35.067358 | 157 | 0.553783 |
import getpass
import time
import http
import logging
from random import seed
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
from loguru import logger as LOG
logging.getLogger("matplotlib").setLevel(logging.WARNING)
logging.getLogger("paramiko").setLevel... | true | true |
f72c0cf297fb6c440eea6a74e7fd555334feff9a | 558 | py | Python | src/Product.py | AbdulMutakabbir/CCH-manufacturing-facility-simulator | ffc1b294eecf69c940b04bfc3d66ef58c7b63de6 | [
"MIT"
] | null | null | null | src/Product.py | AbdulMutakabbir/CCH-manufacturing-facility-simulator | ffc1b294eecf69c940b04bfc3d66ef58c7b63de6 | [
"MIT"
] | null | null | null | src/Product.py | AbdulMutakabbir/CCH-manufacturing-facility-simulator | ffc1b294eecf69c940b04bfc3d66ef58c7b63de6 | [
"MIT"
] | null | null | null | # holds the data and methods for products
class Product:
__type: int = None # specifies P1 or P2
# Constructor:
# Inputs:
# p_type:int -> Product Type
def __init__(self, p_type):
if (p_type is not None) and (p_type >= 0) and (p_type <= 3):
self.__type = p_type
el... | 26.571429 | 68 | 0.586022 |
class Product:
__type: int = None
def __init__(self, p_type):
if (p_type is not None) and (p_type >= 0) and (p_type <= 3):
self.__type = p_type
else:
raise Exception("ProductTypeError")
def get_type(self):
if self.__type is None:
... | true | true |
f72c0d36cca4aa60ffe71a6c3374a1be477a7388 | 21,847 | py | Python | universe/rewarder/rewarder_session.py | BitJetKit/universe | cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c | [
"MIT"
] | 8,120 | 2016-12-05T06:37:45.000Z | 2022-03-21T14:45:20.000Z | universe/rewarder/rewarder_session.py | BitJetKit/universe | cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c | [
"MIT"
] | 213 | 2016-12-05T09:57:37.000Z | 2018-04-05T18:55:14.000Z | universe/rewarder/rewarder_session.py | BitJetKit/universe | cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c | [
"MIT"
] | 1,140 | 2016-12-05T06:50:43.000Z | 2022-03-23T08:28:32.000Z | from autobahn.twisted import websocket
import logging
import numpy as np
import threading
import time
from twisted.python import failure
from twisted.internet import defer, endpoints
import twisted.internet.error
from universe import utils
from universe.twisty import reactor
from universe.rewarder import connection_t... | 42.339147 | 245 | 0.602875 | from autobahn.twisted import websocket
import logging
import numpy as np
import threading
import time
from twisted.python import failure
from twisted.internet import defer, endpoints
import twisted.internet.error
from universe import utils
from universe.twisty import reactor
from universe.rewarder import connection_t... | true | true |
f72c0d7a15cd90ef41611423f1b1643e68712a61 | 2,372 | py | Python | discord/enums.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | discord/enums.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | discord/enums.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Copyright (c) 2021-present tag-epic
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
t... | 76.516129 | 623 | 0.802277 |
from glowcord.enums import ActivityType, Any, AuditLogAction, AuditLogActionCategory, ButtonStyle, ChannelType, ClassVar, ComponentType, ContentFilter, DefaultAvatar, Dict, Enum, EnumMeta, ExpireBehavior, ExpireBehaviour, InteractionResponseType, InteractionType, InviteTarget, List, MessageType, NSFWLevel, Notificatio... | true | true |
f72c0e67908a76e0ea66de8a4f836e96cdcb736d | 2,393 | py | Python | plugins/hw_wallet/plugin.py | futuro-coin/electrum-futuro | 04910904a6d4d330f202daf0c1975b8296ad8e5d | [
"MIT"
] | 4 | 2019-01-16T14:30:39.000Z | 2021-10-21T04:21:45.000Z | plugins/hw_wallet/plugin.py | futuro-coin/electrum-futuro | 04910904a6d4d330f202daf0c1975b8296ad8e5d | [
"MIT"
] | 1 | 2021-11-15T17:47:31.000Z | 2021-11-15T17:47:31.000Z | plugins/hw_wallet/plugin.py | futuro-coin/electrum-futuro | 04910904a6d4d330f202daf0c1975b8296ad8e5d | [
"MIT"
] | 2 | 2018-12-18T17:32:46.000Z | 2019-01-16T14:30:42.000Z | #!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Futurocoin client
# Copyright (C) 2016 The Electrum developers
#
# 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 with... | 39.229508 | 80 | 0.72921 |
from electrum.plugins import BasePlugin, hook
from electrum.i18n import _
class HW_PluginBase(BasePlugin):
def __init__(self, parent, config, name):
BasePlugin.__init__(self, parent, config, name)
self.device = self.keystore_class.device
... | true | true |
f72c0ea16de779f16beca6532d9f0bc2298b0a63 | 214 | py | Python | embiggen/sequences/generic_sequences/__init__.py | monarch-initiative/N2V | 8ae02ca125f1d24ca158c2849f2d9bb1711920b9 | [
"BSD-3-Clause"
] | 2 | 2020-01-30T11:57:37.000Z | 2020-05-02T00:05:49.000Z | embiggen/sequences/generic_sequences/__init__.py | monarch-initiative/N2V | 8ae02ca125f1d24ca158c2849f2d9bb1711920b9 | [
"BSD-3-Clause"
] | 93 | 2020-01-26T00:43:51.000Z | 2020-05-10T03:29:54.000Z | embiggen/sequences/generic_sequences/__init__.py | monarch-initiative/N2V | 8ae02ca125f1d24ca158c2849f2d9bb1711920b9 | [
"BSD-3-Clause"
] | 5 | 2020-02-13T07:18:11.000Z | 2020-03-19T08:03:34.000Z | """Module providing generic sequences that are used throught Embiggen."""
from embiggen.sequences.generic_sequences.edge_prediction_sequence import EdgePredictionSequence
__all__ = [
"EdgePredictionSequence"
] | 35.666667 | 96 | 0.827103 | from embiggen.sequences.generic_sequences.edge_prediction_sequence import EdgePredictionSequence
__all__ = [
"EdgePredictionSequence"
] | true | true |
f72c0f9f033cd93ca71e3dcc3956bdced61ba742 | 11,944 | py | Python | nngp/nngp.py | chrhenning/uncertainty_based_ood | 13c0b9910966544527497497f6ff0441d5334591 | [
"Apache-2.0"
] | null | null | null | nngp/nngp.py | chrhenning/uncertainty_based_ood | 13c0b9910966544527497497f6ff0441d5334591 | [
"Apache-2.0"
] | null | null | null | nngp/nngp.py | chrhenning/uncertainty_based_ood | 13c0b9910966544527497497f6ff0441d5334591 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Christian Henning
#
# 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 l... | 39.681063 | 80 | 0.602646 |
import torch
from warnings import warn
def inference_with_isotropic_gaussian_ll(Y, K_train, K_test, K_all, var=1e-10,
L_mat=None, return_cov=False):
m = K_train.shape[0] if L_mat is None else L_mat.shape[0]
n = K_test.shape[0]
assert Y.numel() =... | true | true |
f72c0fcbfb5b7caec767f2ca3b4965a9ad74ab72 | 814 | py | Python | python/173.binary-search-tree-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | 1 | 2019-04-11T12:34:55.000Z | 2019-04-11T12:34:55.000Z | python/173.binary-search-tree-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | python/173.binary-search-tree-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=173 lang=python3
#
# [173] 二叉搜索树迭代器
#
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class BSTIterator:
def __init__(self, root: TreeNode):
self.stack = []
if root is not None:
self.stack.ap... | 19.380952 | 41 | 0.545455 |
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class BSTIterator:
def __init__(self, root: TreeNode):
self.stack = []
if root is not None:
self.stack.append(root)
def next(self) -> int:
nod... | true | true |
f72c101791b5714dbca430af69817d1077ddde46 | 307 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/targets/Target_IC.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/targets/Target_IC.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/targets/Target_IC.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | from pyradioconfig.calculator_model_framework.interfaces.itarget import ITarget
class Target_IC_Nixi(ITarget):
_targetName = ITarget.IC_str
_description = ""
_store_config_output = True
_cfg_location = "nixi"
_tag = ITarget.IC_str
def target_calculate(self, model):
pass
| 21.928571 | 79 | 0.732899 | from pyradioconfig.calculator_model_framework.interfaces.itarget import ITarget
class Target_IC_Nixi(ITarget):
_targetName = ITarget.IC_str
_description = ""
_store_config_output = True
_cfg_location = "nixi"
_tag = ITarget.IC_str
def target_calculate(self, model):
pass
| true | true |
f72c107476fbdd546cdfa11afec00d68c3ac2c51 | 6,189 | py | Python | test/tools/test_tools_jobs.py | Gizmokid2005/sopel | 249a05ab7c6ccb3fb0388e3194514b19897e6990 | [
"EFL-2.0"
] | 555 | 2015-07-25T21:21:43.000Z | 2022-03-28T02:22:38.000Z | test/tools/test_tools_jobs.py | Gizmokid2005/sopel | 249a05ab7c6ccb3fb0388e3194514b19897e6990 | [
"EFL-2.0"
] | 1,177 | 2015-07-31T09:52:31.000Z | 2022-03-26T05:10:34.000Z | test/tools/test_tools_jobs.py | MirahezeBots/sopel | 72aa4fa5bc0bda3cd309ae9c15e86088b29de903 | [
"EFL-2.0"
] | 406 | 2015-07-28T20:34:02.000Z | 2022-03-18T00:37:01.000Z | """Tests for Job Scheduler"""
from __future__ import generator_stop
import time
import pytest
from sopel import loader, plugin
from sopel.tools import jobs
TMP_CONFIG = """
[core]
owner = Bar
nick = Sopel
enable = coretasks
"""
class WithJobMockException(Exception):
pass
@pytest.fixture
def mockconfig(conf... | 23.895753 | 78 | 0.63112 | from __future__ import generator_stop
import time
import pytest
from sopel import loader, plugin
from sopel.tools import jobs
TMP_CONFIG = """
[core]
owner = Bar
nick = Sopel
enable = coretasks
"""
class WithJobMockException(Exception):
pass
@pytest.fixture
def mockconfig(configfactory):
return configf... | true | true |
f72c10ad899fc5c2be354213a6c67529edd4ffb0 | 4,949 | py | Python | arco.py | TunkShif/Arco | ae782e77f82b7fd685ede587e659f96a69ec3a87 | [
"MIT"
] | null | null | null | arco.py | TunkShif/Arco | ae782e77f82b7fd685ede587e659f96a69ec3a87 | [
"MIT"
] | null | null | null | arco.py | TunkShif/Arco | ae782e77f82b7fd685ede587e659f96a69ec3a87 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Arco CLI
Usage:
arco (new | n) -t <title> -g <category> -f <filename>
arco (generate | g)
arco (deploy | d)
arco -h | --help
arco -v | --version
Subcommands:
new Create a new blank page
generate Generate pages
deploy ... | 33.666667 | 78 | 0.555668 |
import os
import json
import markdown
from docopt import docopt
class Utils(object):
def mkdir(self, path):
os.mkdir(path)
print(f'INFO: Folder {path} created!')
def read_file(self, file):
with open(file, 'r') as f:
return f.read()
def write_file(self, file, content... | true | true |
f72c11ddf5cf9792898f16eb88c27c05d0a7fa22 | 121 | py | Python | modules/utility/exit_failure.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | 4 | 2020-09-23T07:11:41.000Z | 2022-02-02T09:08:21.000Z | modules/utility/exit_failure.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | 5 | 2021-08-29T18:23:01.000Z | 2021-11-20T03:53:19.000Z | modules/utility/exit_failure.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | null | null | null | import sys
import typing
import colorama
def exit_failure() -> typing.NoReturn:
colorama.deinit()
sys.exit(1)
| 12.1 | 38 | 0.710744 | import sys
import typing
import colorama
def exit_failure() -> typing.NoReturn:
colorama.deinit()
sys.exit(1)
| true | true |
f72c12cb5d888c460ea2425493c4ccae0a17c163 | 2,097 | py | Python | third_party/catapult/dashboard/dashboard/pinpoint/models/quest/run_telemetry_test.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/catapult/dashboard/dashboard/pinpoint/models/quest/run_telemetry_test.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/catapult/dashboard/dashboard/pinpoint/models/quest/run_telemetry_test.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2018 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.
"""Quest for running a Telemetry benchmark in Swarming."""
import copy
from dashboard.pinpoint.models.quest import run_test
_DEFAULT_EXTRA_ARGS = [
'... | 34.377049 | 78 | 0.69051 |
import copy
from dashboard.pinpoint.models.quest import run_test
_DEFAULT_EXTRA_ARGS = [
'-v', '--upload-results', '--output-format', 'histograms']
class RunTelemetryTest(run_test.RunTest):
def Start(self, change, isolate_server, isolate_hash):
extra_args = copy.copy(self._extra_args)
... | true | true |
f72c12d312063efabbecedfddb86898a11b4cc57 | 750 | py | Python | sdk/python/pulumi_aws_native/networkmanager/__init__.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/networkmanager/__init__.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/networkmanager/__init__.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from .customer_gateway_association import *
from .device import *
f... | 31.25 | 80 | 0.777333 |
from .. import _utilities
import typing
# Export this package's modules as members:
from .customer_gateway_association import *
from .device import *
from .get_customer_gateway_association import *
from .get_device import *
from .get_global_network import *
from .get_link import *
from .get_link_association import ... | true | true |
f72c136f7e297c4a25e30f41fa955aa92ac206dd | 28,541 | py | Python | python/ray/autoscaler/_private/command_runner.py | chinganc/ray | f91c4555270cbcb86adc6c41a9074e2f69721aad | [
"Apache-2.0"
] | null | null | null | python/ray/autoscaler/_private/command_runner.py | chinganc/ray | f91c4555270cbcb86adc6c41a9074e2f69721aad | [
"Apache-2.0"
] | null | null | null | python/ray/autoscaler/_private/command_runner.py | chinganc/ray | f91c4555270cbcb86adc6c41a9074e2f69721aad | [
"Apache-2.0"
] | null | null | null | from getpass import getuser
from shlex import quote
from typing import Dict
import click
import hashlib
import json
import logging
import os
import subprocess
import sys
import time
import warnings
from ray.autoscaler.command_runner import CommandRunnerInterface
from ray.autoscaler._private.docker import check_bind_mo... | 39.750696 | 79 | 0.566063 | from getpass import getuser
from shlex import quote
from typing import Dict
import click
import hashlib
import json
import logging
import os
import subprocess
import sys
import time
import warnings
from ray.autoscaler.command_runner import CommandRunnerInterface
from ray.autoscaler._private.docker import check_bind_mo... | true | true |
f72c13cb90eedb34f57932aeb5a75dd0d3d17462 | 9,968 | py | Python | paddlex/ppdet/modeling/assigners/atss_assigner.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 8 | 2020-03-11T08:12:19.000Z | 2020-03-18T08:33:56.000Z | paddlex/ppdet/modeling/assigners/atss_assigner.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 1 | 2020-03-15T13:05:43.000Z | 2020-03-15T13:05:43.000Z | paddlex/ppdet/modeling/assigners/atss_assigner.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 2 | 2020-03-15T11:53:54.000Z | 2020-03-24T07:27:09.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 47.018868 | 97 | 0.634129 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddlex.ppdet.core.workspace import register
from ..ops import iou_similarity
from ..bbox_utils impor... | true | true |
f72c141ee52744b76809f89d01d00892da4316b0 | 1,625 | py | Python | models/heads/linear.py | lucasmtz/ACAR-Net | 08a224625f04bbf595baaeb1c79ec491642e0059 | [
"Apache-2.0"
] | null | null | null | models/heads/linear.py | lucasmtz/ACAR-Net | 08a224625f04bbf595baaeb1c79ec491642e0059 | [
"Apache-2.0"
] | null | null | null | models/heads/linear.py | lucasmtz/ACAR-Net | 08a224625f04bbf595baaeb1c79ec491642e0059 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torchvision
__all__ = ["linear"]
class LinearHead(nn.Module):
def __init__(self, width, roi_spatial=7, num_classes=60, dropout=0.0, bias=False):
super().__init__()
self.roi_spatial = roi_spatial
self.roi_maxpool = nn.MaxPool2d(roi_spatial)
... | 28.017241 | 100 | 0.549538 | import torch
import torch.nn as nn
import torchvision
__all__ = ["linear"]
class LinearHead(nn.Module):
def __init__(self, width, roi_spatial=7, num_classes=60, dropout=0.0, bias=False):
super().__init__()
self.roi_spatial = roi_spatial
self.roi_maxpool = nn.MaxPool2d(roi_spatial)
... | true | true |
f72c167153faf45427e82959b2fabf65122a99b7 | 3,730 | py | Python | lib/follower.py | bopopescu/ros | 5dc6e23a280e1283de7b38f35116332a79ca33d2 | [
"MIT"
] | null | null | null | lib/follower.py | bopopescu/ros | 5dc6e23a280e1283de7b38f35116332a79ca33d2 | [
"MIT"
] | null | null | null | lib/follower.py | bopopescu/ros | 5dc6e23a280e1283de7b38f35116332a79ca33d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 by Murray Altheim. All rights reserved. This file is part of
# the Robot OS project and is released under the "Apache Licence, Version 2.0".
# Please see the LICENSE file included as part of this package.
#
# author: altheim
# created: 2020-03-31
# mo... | 33.603604 | 132 | 0.538606 |
import time
from colorama import init, Fore, Style
init()
try:
import numpy
except ImportError:
exit("This script requires the numpy module\nInstall with: sudo pip3 install numpy")
from lib.tof import TimeOfFlight, Range
from lib.enums import Orientation
from lib.servo import Servo
from lib.logger... | true | true |
f72c18024f079862885e04b1184e3b2d20a53ce4 | 312 | py | Python | src/Aula15ex67Tabuada.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | src/Aula15ex67Tabuada.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | src/Aula15ex67Tabuada.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | # TABUADA
#Mostra a tabuada de vários números, um de cada vez
#O programa encerra quando o número digitado é negativo
while True:
num = int(input('Número? '))
print('=' * 10)
if num < 0:
break
for i in range(1, 11):
print(f'{num} x {i} = {num * i}')
print('='*10)
print('Fim') | 26 | 55 | 0.580128 |
while True:
num = int(input('Número? '))
print('=' * 10)
if num < 0:
break
for i in range(1, 11):
print(f'{num} x {i} = {num * i}')
print('='*10)
print('Fim') | true | true |
f72c1952b0e4622f4b26e6cbf2935e7858d86d51 | 3,061 | py | Python | BioNetGen-2.3.0/source_Atomizer/SBMLparser/atomizer/analyzeRDF.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | BioNetGen-2.3.0/source_Atomizer/SBMLparser/atomizer/analyzeRDF.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | BioNetGen-2.3.0/source_Atomizer/SBMLparser/atomizer/analyzeRDF.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 14:45:24 2012
@author: proto
"""
'''
this method classifies reactants according to the rdf information, and gives
us information on which reactants are the same, and how do they differ
(compartment etc)
'''
from sbml2bngl import SBML2BNGL
import libsbml
import collec... | 37.790123 | 107 | 0.662202 |
"""
Created on Fri Apr 27 14:45:24 2012
@author: proto
"""
'''
this method classifies reactants according to the rdf information, and gives
us information on which reactants are the same, and how do they differ
(compartment etc)
'''
from sbml2bngl import SBML2BNGL
import libsbml
import collections
def getAnnotatio... | false | true |
f72c197e8fe4e17b1d25cf875d15b358ebf7e019 | 3,413 | py | Python | Dataproc/synth.py | Firehed/google-cloud-php | 5c49ed7a36c276fc59a9eaf9a03db4cd522b6932 | [
"Apache-2.0"
] | 1 | 2019-11-17T06:56:43.000Z | 2019-11-17T06:56:43.000Z | Dataproc/synth.py | Firehed/google-cloud-php | 5c49ed7a36c276fc59a9eaf9a03db4cd522b6932 | [
"Apache-2.0"
] | null | null | null | Dataproc/synth.py | Firehed/google-cloud-php | 5c49ed7a36c276fc59a9eaf9a03db4cd522b6932 | [
"Apache-2.0"
] | 1 | 2019-10-16T03:38:59.000Z | 2019-10-16T03:38:59.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 29.17094 | 94 | 0.658951 |
import os
import synthtool as s
import synthtool.gcp as gcp
import logging
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
common = gcp.CommonTemplates()
for version in ['V1', 'V1beta2']:
lower_version = version.lower()
library = gapic.php_library(
service='datap... | true | true |
f72c198a930ed3f71634b2475161d1817b4821ff | 12,725 | py | Python | simulacionPlanificador.py | inakiuy/teoria-de-la-computacion | e9087e70622a72b8ddd44a3552f13c0e1794587d | [
"MIT"
] | null | null | null | simulacionPlanificador.py | inakiuy/teoria-de-la-computacion | e9087e70622a72b8ddd44a3552f13c0e1794587d | [
"MIT"
] | null | null | null | simulacionPlanificador.py | inakiuy/teoria-de-la-computacion | e9087e70622a72b8ddd44a3552f13c0e1794587d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import deque
import random
SETS = 3 # Cantidad de sets generados
TASKS_CREATED = 10 # Cantidad de tareas creadas por cada set
MAX_SERVICETIME = 100 # Maximo Tiempo de Servicio de una tarea. 28800 = 8h
MAX_SERVICELIST_SIZE = 4 # Maxima canitad de... | 40.015723 | 275 | 0.595521 |
from collections import deque
import random
SETS = 3
TASKS_CREATED = 10
MAX_SERVICETIME = 100
MAX_SERVICELIST_SIZE = 4
MAX_TIMEOUT = 150
DIA_TRABAJO = 300
MAX_TIME = 3000
ALGO = "fcfs"
me, pserviceTime, ppriority, purgency, ptimeOu... | true | true |
f72c19b9cb3d05c83471ebe6d0f7ab647fcf3c80 | 5,478 | py | Python | saas/api/backend.py | markcstansberry/djaodjin-saas | 0749dac36c3b039334fe9f115d92b3167eea03d6 | [
"BSD-2-Clause"
] | null | null | null | saas/api/backend.py | markcstansberry/djaodjin-saas | 0749dac36c3b039334fe9f115d92b3167eea03d6 | [
"BSD-2-Clause"
] | 4 | 2021-04-08T21:56:58.000Z | 2022-02-10T13:26:56.000Z | saas/api/backend.py | markcstansberry/djaodjin-saas | 0749dac36c3b039334fe9f115d92b3167eea03d6 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2019, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 30.949153 | 78 | 0.667579 |
from rest_framework import status
from rest_framework.exceptions import ValidationError
from rest_framework.generics import (RetrieveAPIView,
RetrieveUpdateDestroyAPIView)
from rest_framework.response import Response
from ..backends import ProcessorError
from ..docs import swagger_auto_sc... | true | true |
f72c1a54af7f21cf6b27146291cd2fe43fcaa17f | 11,489 | py | Python | src/maggma/api/query_operator.py | wuxiaohua1011/maggma | b7a059b2d12d9b96aa2092c40eb41f121c0a598b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/maggma/api/query_operator.py | wuxiaohua1011/maggma | b7a059b2d12d9b96aa2092c40eb41f121c0a598b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/maggma/api/query_operator.py | wuxiaohua1011/maggma | b7a059b2d12d9b96aa2092c40eb41f121c0a598b | [
"BSD-3-Clause-LBNL"
] | null | null | null | from typing import List, Dict, Optional, Any, Mapping
from pydantic import BaseModel
from fastapi import Query
from monty.json import MSONable
from maggma.core import Store
from maggma.api.util import STORE_PARAMS, dynamic_import
from pydantic.fields import ModelField
import inspect
import warnings
class QueryOperato... | 35.242331 | 117 | 0.542606 | from typing import List, Dict, Optional, Any, Mapping
from pydantic import BaseModel
from fastapi import Query
from monty.json import MSONable
from maggma.core import Store
from maggma.api.util import STORE_PARAMS, dynamic_import
from pydantic.fields import ModelField
import inspect
import warnings
class QueryOperato... | true | true |
f72c1ab1de5a5c97a92db41310f7ac5f79e19552 | 4,330 | py | Python | bika/lims/browser/artemplate.py | hocinebendou/bika.gsoc | 85bc0c587de7f52073ae0e89bddbc77bf875f295 | [
"MIT"
] | null | null | null | bika/lims/browser/artemplate.py | hocinebendou/bika.gsoc | 85bc0c587de7f52073ae0e89bddbc77bf875f295 | [
"MIT"
] | null | null | null | bika/lims/browser/artemplate.py | hocinebendou/bika.gsoc | 85bc0c587de7f52073ae0e89bddbc77bf875f295 | [
"MIT"
] | null | null | null | from bika.lims.interfaces import IJSONReadExtender, IARTemplate
from zope.component import adapts
from zope.interface import implements
class JSONReadExtender(object):
"""- Place additional information about profile services
into the returned records.
Used in AR Add to prevent extra requests
"""
... | 38.318584 | 83 | 0.526328 | from bika.lims.interfaces import IJSONReadExtender, IARTemplate
from zope.component import adapts
from zope.interface import implements
class JSONReadExtender(object):
implements(IJSONReadExtender)
adapts(IARTemplate)
def __init__(self, context):
self.context = context
def render_template_p... | true | true |
f72c1c45126418c8a2273a6fc96e135d6bcf4da8 | 22,915 | py | Python | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_group_list.py | cvicens/lab-knative | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | [
"Apache-2.0"
] | null | null | null | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_group_list.py | cvicens/lab-knative | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | [
"Apache-2.0"
] | null | null | null | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_group_list.py | cvicens/lab-knative | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: openshift_v1_group_list
short_description: OpenShift GroupList
description:
- Retrieve a list of groups. List operations provide a snapshot read of ... | 47.247423 | 100 | 0.560201 |
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: openshift_v1_group_list
short_description: OpenShift GroupList
description:
- Retrieve a list of groups. List operations provide a snapshot read of the underlying
objects, returning a re... | true | true |
f72c1d801a02316cde52c7ee09431a992b7ae36e | 2,353 | py | Python | research/delf/delf/python/examples/detector.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 6 | 2020-01-15T09:55:24.000Z | 2021-04-22T09:03:46.000Z | research/delf/delf/python/examples/detector.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 10 | 2019-12-28T21:31:19.000Z | 2020-04-12T20:01:58.000Z | research/delf/delf/python/examples/detector.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 8 | 2020-04-12T04:30:33.000Z | 2021-09-17T20:54:44.000Z | # Copyright 2019 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.349206 | 80 | 0.663408 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def MakeDetector(sess, model_dir, import_scope=None):
tf.saved_model.loader.load(
sess, [tf.saved_model.tag_constants.SERVING],
model_dir,
import_sco... | true | true |
f72c1ec91f3364c0ca6dca97ad1176f0456b92a7 | 5,633 | py | Python | ceph_install/rhel/u130/src/prereq/MonPrereq.py | rpratap-bot/ceph-qe-scripts | 8a7090d6707a8e7b927eabfc9c9212f343a35bc4 | [
"MIT"
] | null | null | null | ceph_install/rhel/u130/src/prereq/MonPrereq.py | rpratap-bot/ceph-qe-scripts | 8a7090d6707a8e7b927eabfc9c9212f343a35bc4 | [
"MIT"
] | null | null | null | ceph_install/rhel/u130/src/prereq/MonPrereq.py | rpratap-bot/ceph-qe-scripts | 8a7090d6707a8e7b927eabfc9c9212f343a35bc4 | [
"MIT"
] | null | null | null | import os
import utils.log as log
import time
class EnableRepos(object):
def __init__(self,host, qa_username, qa_password, pool_id):
self.username = qa_username
self.password = qa_password
self.poolid = pool_id
self.host = host
self.ssh = 'ssh %s ' %host.hostname # do no... | 33.135294 | 130 | 0.628972 | import os
import utils.log as log
import time
class EnableRepos(object):
def __init__(self,host, qa_username, qa_password, pool_id):
self.username = qa_username
self.password = qa_password
self.poolid = pool_id
self.host = host
self.ssh = 'ssh %s ' %host.hostname
d... | false | true |
f72c1f06d6b7f222137806f0a368da2e76782f5f | 1,411 | py | Python | project-EE/run_cleaning.py | Mariagca/EscapeEarth | 5c57ff9dc1a1aed8a3d74d664287f54746c85dff | [
"MIT"
] | 2 | 2020-10-08T20:47:36.000Z | 2020-12-12T22:20:41.000Z | project-EE/run_cleaning.py | Mariagca/EscapeEarth | 5c57ff9dc1a1aed8a3d74d664287f54746c85dff | [
"MIT"
] | null | null | null | project-EE/run_cleaning.py | Mariagca/EscapeEarth | 5c57ff9dc1a1aed8a3d74d664287f54746c85dff | [
"MIT"
] | 6 | 2020-10-08T21:18:23.000Z | 2020-10-08T21:34:35.000Z | #imports
import cleaning_modules as cm
import os
#BE SURE TO CHOOSE OR AMEND THE 'rawdatapath' & 'filename_danielle' paths for your computer!!
# our inputs
tic_list = [7582594, 7582633, 7620704, 7618785, 7584049]
sectornumber = 14
rawdatapath = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/'
rawdatapath_danie... | 45.516129 | 110 | 0.764706 |
import cleaning_modules as cm
import os
tic_list = [7582594, 7582633, 7620704, 7618785, 7584049]
sectornumber = 14
rawdatapath = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/'
rawdatapath_danielle = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/'
cleandata, cleanticids = cm.Dataclean(tic_list,sector... | true | true |
f72c1f9c72b57af7309945959a0c4b2f24dee261 | 631 | py | Python | elk_project/manage.py | joyliao07/elk | c697d6847c57c0e7f3b4dc71a373c5fe0407e237 | [
"MIT"
] | null | null | null | elk_project/manage.py | joyliao07/elk | c697d6847c57c0e7f3b4dc71a373c5fe0407e237 | [
"MIT"
] | 7 | 2019-12-04T23:17:25.000Z | 2021-06-09T17:54:51.000Z | elk_project/manage.py | joyliao07/elk | c697d6847c57c0e7f3b4dc71a373c5fe0407e237 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'elk_project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... | 28.681818 | 75 | 0.684628 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'elk_project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f72c1fde1011d3abd20dca04a582e9d40af5f026 | 911 | py | Python | heap sort.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | heap sort.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | heap sort.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[4]:
def heapify(arr, n, i):
largest = i # Initialize largest as root
l = 2 * i + 1 # left = 2*i + 1
r = 2 * i + 2 # right = 2*i + 2
if l < n and arr[i] < arr[l]:
largest = l
if r < n and arr[largest] < arr[r]:
largest = r
if largest != i:
arr[i],ar... | 17.862745 | 51 | 0.556531 |
def heapify(arr, n, i):
largest = i
l = 2 * i + 1
r = 2 * i + 2
if l < n and arr[i] < arr[l]:
largest = l
if r < n and arr[largest] < arr[r]:
largest = r
if largest != i:
arr[i],arr[largest] = arr[largest],arr[i]
heapify(arr, n, largest)
def heapSort(arr):
n = len(arr)
... | true | true |
f72c206e11dd63945aef32da40727635e29f68fe | 3,204 | py | Python | tests/sources/test_url.py | mikewcasale/climetlab | 924aa602dcd638ff1a49a9d8b4b6f7bd29361d1e | [
"Apache-2.0"
] | null | null | null | tests/sources/test_url.py | mikewcasale/climetlab | 924aa602dcd638ff1a49a9d8b4b6f7bd29361d1e | [
"Apache-2.0"
] | null | null | null | tests/sources/test_url.py | mikewcasale/climetlab | 924aa602dcd638ff1a49a9d8b4b6f7bd29361d1e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its statu... | 28.607143 | 88 | 0.652934 |
import datetime
import mimetypes
import os
import sys
import pytest
from climetlab import load_source
from climetlab.sources.url import canonical_extension
from climetlab.testing import climetlab_file
@pytest.mark.skipif(
sys.platform == "win32",
reason="file:// not working on Windows yet",
)
d... | true | true |
f72c2077893d50552e9dcf77f984503151020b67 | 2,825 | py | Python | Testing/Alignment.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | Testing/Alignment.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | Testing/Alignment.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, w... | 27.163462 | 79 | 0.593982 |
from pagebot.toolbox.color import color
from pagebot import getContext
EXPORT_PATH = '_export/Start'
EXPORT_PATH_PDF = EXPORT_PATH + '.pdf'
EXPORT_PATH_JPG = EXPORT_PATH + '.jpg'
EXPORT_PATH_PNG = EXPORT_PATH + '.png'
EXPORT_PATH_SVG = EXPORT_PATH + '.svg'
from pagebot.document import Document
fr... | true | true |
f72c210c8aaaf5a73cd82343cc65417943d52979 | 13,090 | py | Python | geofabric/model/catchment.py | CSIRO-enviro-informatics/geofabric-dataset | fbca2c79a8e7532f751fb51bebd3433c42d9f422 | [
"Apache-2.0"
] | 3 | 2019-07-16T14:07:54.000Z | 2020-07-04T17:55:24.000Z | geofabric/model/catchment.py | CSIRO-enviro-informatics/geofabric-dataset | fbca2c79a8e7532f751fb51bebd3433c42d9f422 | [
"Apache-2.0"
] | 24 | 2018-09-20T05:17:32.000Z | 2021-12-13T19:49:50.000Z | geofabric/model/catchment.py | CSIRO-enviro-informatics/geofabric-dataset | fbca2c79a8e7532f751fb51bebd3433c42d9f422 | [
"Apache-2.0"
] | 3 | 2018-10-23T05:58:22.000Z | 2019-11-03T23:04:35.000Z | # -*- coding: utf-8 -*-
#
import rdflib
from urllib.request import Request, urlopen
from flask import render_template, url_for
from lxml.etree import ParseError
from rdflib import URIRef, Literal, BNode
from lxml import etree
from geofabric import _config as config
from geofabric.helpers import gml_extract_geom_to_geoj... | 40.526316 | 126 | 0.572193 |
import rdflib
from urllib.request import Request, urlopen
from flask import render_template, url_for
from lxml.etree import ParseError
from rdflib import URIRef, Literal, BNode
from lxml import etree
from geofabric import _config as config
from geofabric.helpers import gml_extract_geom_to_geojson, \
wfs_extract_f... | true | true |
f72c2280bf4ad25e6907abd6b677f870efbe0e50 | 1,135 | py | Python | src/models/ep.py | tonyduan/ge-vae | fe3325cb643900d09536b3e1d964443d25625781 | [
"MIT"
] | 7 | 2019-11-04T09:13:44.000Z | 2021-04-22T01:28:27.000Z | src/models/ep.py | tonyduan/ge-vae | fe3325cb643900d09536b3e1d964443d25625781 | [
"MIT"
] | null | null | null | src/models/ep.py | tonyduan/ge-vae | fe3325cb643900d09536b3e1d964443d25625781 | [
"MIT"
] | 3 | 2019-11-02T10:50:29.000Z | 2020-02-09T02:50:48.000Z | import torch
import torch.nn as nn
from torch.distributions import Bernoulli
from src.modules.attn import MAB, PMA, SAB, ISAB, ISABStack
from src.utils import *
from src.modules.mlp import *
class EdgePredictor(nn.Module):
def __init__(self, embedding_dim, device):
super().__init__()
self.pairwi... | 35.46875 | 78 | 0.61674 | import torch
import torch.nn as nn
from torch.distributions import Bernoulli
from src.modules.attn import MAB, PMA, SAB, ISAB, ISABStack
from src.utils import *
from src.modules.mlp import *
class EdgePredictor(nn.Module):
def __init__(self, embedding_dim, device):
super().__init__()
self.pairwi... | true | true |
f72c22ad9e0dc3e5f4ab51f0e1e77ab067f3acac | 14,720 | py | Python | CybORG/CybORG/Tests/test_sim/test_Actions/test_BlueActions/test_blue_analyse.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 18 | 2021-08-20T15:07:55.000Z | 2022-03-11T12:05:15.000Z | CybORG/CybORG/Tests/test_sim/test_Actions/test_BlueActions/test_blue_analyse.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 7 | 2021-11-09T06:46:58.000Z | 2022-03-31T12:35:06.000Z | CybORG/CybORG/Tests/test_sim/test_Actions/test_BlueActions/test_blue_analyse.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 13 | 2021-08-17T00:26:31.000Z | 2022-03-29T20:06:45.000Z | # These tests check that the Blue Monitor action is working vs Abstract Red Actions.
# tests need to check that a range of inputs result in the correct changes to the state and return the correct obs
# tests should establish varying environmental states that results in these actions performing differently
import ... | 48.580858 | 114 | 0.640014 |
import inspect
from CybORG import CybORG
from CybORG.Shared.Actions import DiscoverRemoteSystems, DiscoverNetworkServices, ExploitRemoteService, \
PrivilegeEscalate, Impact, Analyse
from CybORG.Shared.Enums import TrinaryEnum, FileType, Path
from CybORG.Tests.EphemeralPort import Win2008EphemeralPort, LinuxEp... | true | true |
f72c237205ee71fae08437e7206ee77f08a6cd89 | 802 | py | Python | mfgp/task2/init_train_idxs.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | null | null | null | mfgp/task2/init_train_idxs.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | 3 | 2021-08-31T08:53:49.000Z | 2021-10-05T15:10:42.000Z | mfgp/task2/init_train_idxs.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | null | null | null | # Run `init_train_idxs.py <int: dataset size> <int: initial training set size>`:
# Creates a `train_idxs.npz` file with the initial set of training indices.
# e.g `python init_train_idxs.py 64000 1000`
import sys
import numpy as np
from sklearn.model_selection import train_test_split
dataset_size = int(sys.argv[1])... | 40.1 | 115 | 0.794264 |
import sys
import numpy as np
from sklearn.model_selection import train_test_split
dataset_size = int(sys.argv[1])
init_trainset_size = int(sys.argv[2])
validation_set_size = 500
np.random.seed(1)
train_idxs, remaining_idxs = train_test_split(range(dataset_size), train_size = init_trainset_size, random_state=0)... | true | true |
f72c2414f2962eb27d54c0fb810c1358dceaa89f | 3,325 | py | Python | tools/visualize_json_results.py | hhy-ee/PedestrianDetection-NohNMS | 482078a6bd0ff8cf03fbf7f6988e475f75c56e57 | [
"Apache-2.0"
] | null | null | null | tools/visualize_json_results.py | hhy-ee/PedestrianDetection-NohNMS | 482078a6bd0ff8cf03fbf7f6988e475f75c56e57 | [
"Apache-2.0"
] | null | null | null | tools/visualize_json_results.py | hhy-ee/PedestrianDetection-NohNMS | 482078a6bd0ff8cf03fbf7f6988e475f75c56e57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import json
import numpy as np
import os
from collections import defaultdict
import cv2
import tqdm
from fvcore.common.file_io import PathManager
from detectron2.data import DatasetCatalog, MetadataCatalog
fro... | 34.635417 | 97 | 0.687519 |
import argparse
import json
import numpy as np
import os
from collections import defaultdict
import cv2
import tqdm
from fvcore.common.file_io import PathManager
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import Boxes, BoxMode, Instances
from detectron2.utils.logger impor... | true | true |
f72c262fa25643ba7ad1ef2d7e89c9bd6e9b9e00 | 1,084 | py | Python | redis_cache/compat.py | fu2re/django-redis-cache | 50807ae71bac0714ee625b443205153e9d917e54 | [
"BSD-3-Clause"
] | null | null | null | redis_cache/compat.py | fu2re/django-redis-cache | 50807ae71bac0714ee625b443205153e9d917e54 | [
"BSD-3-Clause"
] | null | null | null | redis_cache/compat.py | fu2re/django-redis-cache | 50807ae71bac0714ee625b443205153e9d917e54 | [
"BSD-3-Clause"
] | 1 | 2020-02-18T13:20:21.000Z | 2020-02-18T13:20:21.000Z | import sys
import django
PY3 = (sys.version_info >= (3,))
try:
# Django 1.5+
from django.utils.encoding import smart_text, smart_bytes
except ImportError:
# older Django, thus definitely Python 2
from django.utils.encoding import smart_unicode, smart_str
smart_text = smart_unicode
smart_bytes ... | 25.809524 | 89 | 0.714945 | import sys
import django
PY3 = (sys.version_info >= (3,))
try:
from django.utils.encoding import smart_text, smart_bytes
except ImportError:
from django.utils.encoding import smart_unicode, smart_str
smart_text = smart_unicode
smart_bytes = smart_str
if PY3:
bytes_type = bytes
else:
... | true | true |
f72c26bb4fa6463bbf958a86e7df8748e04888fa | 30,608 | py | Python | mwparserfromhell/wikicode.py | TheSandDoctor/mwparserfromhell | de15b8b64497d3386f133400b73dcaf36a131743 | [
"MIT"
] | null | null | null | mwparserfromhell/wikicode.py | TheSandDoctor/mwparserfromhell | de15b8b64497d3386f133400b73dcaf36a131743 | [
"MIT"
] | null | null | null | mwparserfromhell/wikicode.py | TheSandDoctor/mwparserfromhell | de15b8b64497d3386f133400b73dcaf36a131743 | [
"MIT"
] | null | null | null | #
# Copyright (C) 2012-2019 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | 44.945668 | 82 | 0.59785 |
import re
from itertools import chain
from .nodes import (Argument, Comment, ExternalLink, Heading, HTMLEntity,
Node, Tag, Template, Text, Wikilink)
from .smart_list.ListProxy import _ListProxy
from .string_mixin import StringMixIn
from .utils import parse_anything
__all__ = [... | true | true |
f72c26f1a5f1a4531136265e544d67ea32926477 | 539 | py | Python | vtstscripts-939/center.py | zybbigpy/VaspCZ | a652de66eec82e8618e71f0466296fabf66b5218 | [
"MIT"
] | 65 | 2019-09-16T12:00:58.000Z | 2022-03-17T04:43:05.000Z | vtstscripts-939/center.py | yizhiwoniu/VaspCZ | 44b890cf18d649c428c21e3f8fadc3222453d84d | [
"MIT"
] | null | null | null | vtstscripts-939/center.py | yizhiwoniu/VaspCZ | 44b890cf18d649c428c21e3f8fadc3222453d84d | [
"MIT"
] | 23 | 2019-09-16T12:16:57.000Z | 2021-11-18T15:57:38.000Z | #!/usr/bin/env python
import aselite
from sys import argv, exit
if len(argv) < 2 or len(argv) > 3 or '-h' in argv:
print 'usage: center.py FILE [DISTANCE]'
print ' centers the structure in the current box and'
print ' optionally adds DISTANCE amount of vacuum to FILE'
print
exit(0)
... | 21.56 | 68 | 0.656772 |
import aselite
from sys import argv, exit
if len(argv) < 2 or len(argv) > 3 or '-h' in argv:
print 'usage: center.py FILE [DISTANCE]'
print ' centers the structure in the current box and'
print ' optionally adds DISTANCE amount of vacuum to FILE'
print
exit(0)
filename = argv[1]
i... | false | true |
f72c27667d2dfd2d0ef541566592c06f430e047b | 147 | py | Python | scene/__init__.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | scene/__init__.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | scene/__init__.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | from .camera import *
from .obj_file import *
from .obj_parser import *
from .ray_tracer import *
from .scene_parser import *
from .world import *
| 21 | 27 | 0.755102 | from .camera import *
from .obj_file import *
from .obj_parser import *
from .ray_tracer import *
from .scene_parser import *
from .world import *
| true | true |
f72c27de3695f8b7dc7c5ae95c8a39f24e92433e | 10,650 | py | Python | darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/update_vnic_details.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/update_vnic_details.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/update_vnic_details.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | 1 | 2020-06-25T03:12:58.000Z | 2020-06-25T03:12:58.000Z | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 35.264901 | 245 | 0.65615 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class UpdateVnicDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'defined_tags': 'dict... | true | true |
f72c287955fbff99748da09097b2149ee342155e | 2,564 | py | Python | smartrecruiters_python_client/models/json_patch.py | roksela/smartrecruiters-python-client | 6d0849d173a3d6718b5f0769098f4c76857f637d | [
"MIT"
] | 5 | 2018-03-27T08:20:13.000Z | 2022-03-30T06:23:38.000Z | smartrecruiters_python_client/models/json_patch.py | roksela/smartrecruiters-python-client | 6d0849d173a3d6718b5f0769098f4c76857f637d | [
"MIT"
] | null | null | null | smartrecruiters_python_client/models/json_patch.py | roksela/smartrecruiters-python-client | 6d0849d173a3d6718b5f0769098f4c76857f637d | [
"MIT"
] | 2 | 2018-12-05T04:48:37.000Z | 2020-12-17T12:12:12.000Z | # coding: utf-8
"""
Unofficial python library for the SmartRecruiters API
The SmartRecruiters API provides a platform to integrate services or applications, build apps and create fully customizable career sites. It exposes SmartRecruiters functionality and allows to connect and build software enhancing it.
... | 27.276596 | 237 | 0.543682 |
from pprint import pformat
from six import iteritems
import re
class JSONPatch(object):
def __init__(self):
self.swagger_types = {
}
self.attribute_map = {
}
def to_dict(self):
result = {}
for attr, _ in iteritems(self.swagger_t... | true | true |
f72c2931d18a600dc4eaf9f2b95c5f5248adbea1 | 900 | py | Python | transmissionServer.py | crate19970523/yoloKnifeCallPolice- | 47b716dbacdd0d31282d13e0ec957711b3f967ca | [
"MIT"
] | null | null | null | transmissionServer.py | crate19970523/yoloKnifeCallPolice- | 47b716dbacdd0d31282d13e0ec957711b3f967ca | [
"MIT"
] | null | null | null | transmissionServer.py | crate19970523/yoloKnifeCallPolice- | 47b716dbacdd0d31282d13e0ec957711b3f967ca | [
"MIT"
] | null | null | null | #coding:utf-8
from flask import request, Flask
import time
import os
app = Flask(__name__)
@app.route("/", methods=['POST'])
def get_frame():
start_time = time.time()
upload_file = request.files['file']
old_file_name = upload_file.filename
if upload_file:
file_path = os.path.join('./imgtest/', ... | 31.034483 | 77 | 0.622222 |
from flask import request, Flask
import time
import os
app = Flask(__name__)
@app.route("/", methods=['POST'])
def get_frame():
start_time = time.time()
upload_file = request.files['file']
old_file_name = upload_file.filename
if upload_file:
file_path = os.path.join('./imgtest/', old_file_name... | true | true |
f72c298f250b50e48003137adac62548fe42bbfa | 721 | py | Python | tests/test_split_audio_file.py | greenkeytech/greenkey-asrtoolkit | f9a5990ee5c67b85dd8ff763777c986b03252ee5 | [
"Apache-2.0"
] | 31 | 2019-08-03T08:42:37.000Z | 2022-01-12T18:00:11.000Z | tests/test_split_audio_file.py | greenkeytech/greenkey-asrtoolkit | f9a5990ee5c67b85dd8ff763777c986b03252ee5 | [
"Apache-2.0"
] | 28 | 2019-07-29T17:58:17.000Z | 2021-08-20T14:30:25.000Z | tests/test_split_audio_file.py | greenkeytech/greenkey-asrtoolkit | f9a5990ee5c67b85dd8ff763777c986b03252ee5 | [
"Apache-2.0"
] | 12 | 2019-07-29T13:16:41.000Z | 2022-02-20T21:19:35.000Z | #!/usr/bin/env python
"""
Test audio file splitter
"""
import os
from asrtoolkit.split_audio_file import split_audio_file
from utils import get_test_dir
test_dir = get_test_dir(__file__)
def test_split_audio_file():
"""
Test audio file splitter
"""
split_audio_file(
f"{test_dir}/small-test-f... | 20.027778 | 56 | 0.660194 |
import os
from asrtoolkit.split_audio_file import split_audio_file
from utils import get_test_dir
test_dir = get_test_dir(__file__)
def test_split_audio_file():
split_audio_file(
f"{test_dir}/small-test-file.mp3",
f"{test_dir}/small-test-file.stm",
f"{test_dir}/split",
)
assert ... | true | true |
f72c29994545a8752c8d6412f035b921d01d390f | 4,755 | py | Python | tests/test_parvec.py | DaveMcEwan/dmppl | 68e8a121d4591360080cd40121add1796ae48a1b | [
"MIT"
] | 1 | 2020-05-05T19:46:43.000Z | 2020-05-05T19:46:43.000Z | tests/test_parvec.py | DaveMcEwan/dmppl | 68e8a121d4591360080cd40121add1796ae48a1b | [
"MIT"
] | null | null | null | tests/test_parvec.py | DaveMcEwan/dmppl | 68e8a121d4591360080cd40121add1796ae48a1b | [
"MIT"
] | null | null | null | from dmppl.scripts.parvec import entryPoint
from dmppl.base import rdTxt
from dmppl.test import runEntryPoint
import os
import tempfile
import shutil
import sys
import unittest
class Test_Parvec(unittest.TestCase): # {{{
def setUp(self):
# Different PRNGs between CPython versions.
# Check against... | 30.876623 | 83 | 0.63428 | from dmppl.scripts.parvec import entryPoint
from dmppl.base import rdTxt
from dmppl.test import runEntryPoint
import os
import tempfile
import shutil
import sys
import unittest
class Test_Parvec(unittest.TestCase):
def setUp(self):
self.knownPrng = sys.version_info[:2] in [(3,... | true | true |
f72c29c259a32921c65201a24cdc494eaddc5c96 | 3,974 | gyp | Python | gyp/freetype.gyp | Frankie-666/color-emoji.skia | f1634a9952086155b9069d49ab91f1fa43b5ec6a | [
"BSD-3-Clause"
] | 1 | 2018-06-18T03:20:08.000Z | 2018-06-18T03:20:08.000Z | gyp/freetype.gyp | Frankie-666/color-emoji.skia | f1634a9952086155b9069d49ab91f1fa43b5ec6a | [
"BSD-3-Clause"
] | null | null | null | gyp/freetype.gyp | Frankie-666/color-emoji.skia | f1634a9952086155b9069d49ab91f1fa43b5ec6a | [
"BSD-3-Clause"
] | null | null | null | {
'targets': [
{
'target_name': 'freetype',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [
# base components (required)
'../third_party/externals/freetype/src/base/ftsystem.c',
'../third_party/externals/freetype/src/base/ftinit.c',
'.... | 45.678161 | 111 | 0.606945 | {
'targets': [
{
'target_name': 'freetype',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [
'../third_party/externals/freetype/src/base/ftsystem.c',
'../third_party/externals/freetype/src/base/ftinit.c',
'../third_party/externals/free... | true | true |
f72c2a8a8a6c7d963cd917f661bb29b5ba4d5351 | 12,831 | py | Python | utils/data_utils.py | joshchang1112/gcnn-survey-paper | 591af8d6c4374378831cab2cdec79575e2540d79 | [
"Apache-2.0"
] | 155 | 2019-12-18T19:01:02.000Z | 2022-03-12T16:34:06.000Z | utils/data_utils.py | google/gcnn-survey-paper | 591af8d6c4374378831cab2cdec79575e2540d79 | [
"Apache-2.0"
] | null | null | null | utils/data_utils.py | google/gcnn-survey-paper | 591af8d6c4374378831cab2cdec79575e2540d79 | [
"Apache-2.0"
] | 23 | 2020-05-11T12:39:58.000Z | 2022-03-04T09:13:58.000Z | #Copyright 2018 Google LLC
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, softwa... | 34.772358 | 80 | 0.691996 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import pickle as pkl
import sys
import networkx as nx
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
import tensorflow as tf
from third... | true | true |
f72c2b187dd8c532b6839213766774021ef6ff74 | 33 | py | Python | tests/__init__.py | yoophi/flask-google-login-example | 57cbbcbd054a6ba47c2a492950bf500b6b595b7d | [
"MIT"
] | null | null | null | tests/__init__.py | yoophi/flask-google-login-example | 57cbbcbd054a6ba47c2a492950bf500b6b595b7d | [
"MIT"
] | null | null | null | tests/__init__.py | yoophi/flask-google-login-example | 57cbbcbd054a6ba47c2a492950bf500b6b595b7d | [
"MIT"
] | null | null | null | """Unit test package for app."""
| 16.5 | 32 | 0.636364 | true | true | |
f72c2cf7b738c597ce705f662cdf1e0bb2603530 | 323 | py | Python | mmcap/models/utils/__init__.py | hnp0411/mmcaptioning | 47bcdee3734cdaaa96a34e927cdec5cc43cab538 | [
"Apache-2.0"
] | null | null | null | mmcap/models/utils/__init__.py | hnp0411/mmcaptioning | 47bcdee3734cdaaa96a34e927cdec5cc43cab538 | [
"Apache-2.0"
] | null | null | null | mmcap/models/utils/__init__.py | hnp0411/mmcaptioning | 47bcdee3734cdaaa96a34e927cdec5cc43cab538 | [
"Apache-2.0"
] | null | null | null | from .gaussian_target import gaussian_radius, gen_gaussian_target
from .res_layer import ResLayer
from .position_embedding_2d import PositionEmbeddingSine
from .sampling import topktopp
__all__ = ['ResLayer',
'gaussian_radius', 'gen_gaussian_target',
'PositionEmbeddingSine',
'topktopp... | 32.3 | 65 | 0.749226 | from .gaussian_target import gaussian_radius, gen_gaussian_target
from .res_layer import ResLayer
from .position_embedding_2d import PositionEmbeddingSine
from .sampling import topktopp
__all__ = ['ResLayer',
'gaussian_radius', 'gen_gaussian_target',
'PositionEmbeddingSine',
'topktopp... | true | true |
f72c2daa1aa4397686149633191ba4e69a6e8ed2 | 425 | py | Python | MachineLearning/DecisionTree/loan_delinquency.py | yexianyi/AI_Practice | 80499ab3a06ac055641aa069fe1e37864c9e41c4 | [
"Apache-2.0"
] | null | null | null | MachineLearning/DecisionTree/loan_delinquency.py | yexianyi/AI_Practice | 80499ab3a06ac055641aa069fe1e37864c9e41c4 | [
"Apache-2.0"
] | null | null | null | MachineLearning/DecisionTree/loan_delinquency.py | yexianyi/AI_Practice | 80499ab3a06ac055641aa069fe1e37864c9e41c4 | [
"Apache-2.0"
] | null | null | null | '''
Decision Tree
Predict if it is possible to default on the loan
'''
import numpy as np
from sklearn import tree
data = np.genfromtxt("exercise.csv", delimiter=",")
# get train data set
x_data = data[1:, 1:-1]
# get test data set
y_data = data[1:, -1]
print(x_data)
print(y_data)
# Create decision tree
dtree = tree... | 20.238095 | 55 | 0.734118 | import numpy as np
from sklearn import tree
data = np.genfromtxt("exercise.csv", delimiter=",")
x_data = data[1:, 1:-1]
y_data = data[1:, -1]
print(x_data)
print(y_data)
dtree = tree.DecisionTreeClassifier(min_samples_leaf=5)
dtree.fit(x_data, y_data)
print(dtree.score(x_data, y_data))
| true | true |
f72c2df55f1cc8270d405748ec5245b4671cc4a9 | 1,680 | py | Python | test/test_flac3d.py | ffilotto/meshio | 4413be41e6a63e33273665986f42dab80d585d10 | [
"MIT"
] | null | null | null | test/test_flac3d.py | ffilotto/meshio | 4413be41e6a63e33273665986f42dab80d585d10 | [
"MIT"
] | null | null | null | test/test_flac3d.py | ffilotto/meshio | 4413be41e6a63e33273665986f42dab80d585d10 | [
"MIT"
] | null | null | null | import copy
import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"mesh, binary, data",
[
(helpers.tet_mesh, False, []),
(helpers.hex_mesh, False, []),
(helpers.tet_mesh, False, [1, 2]),
(helpers.tet_mesh, True, []),
... | 25.454545 | 83 | 0.583333 | import copy
import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"mesh, binary, data",
[
(helpers.tet_mesh, False, []),
(helpers.hex_mesh, False, []),
(helpers.tet_mesh, False, [1, 2]),
(helpers.tet_mesh, True, []),
... | true | true |
f72c2f6aa5e33817498aeaf30c0f710fd5347dc0 | 471 | py | Python | examples/idioms/programs/177.3241-find-files-with-a-given-list-of-filename-extensions.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 31 | 2020-05-02T13:34:26.000Z | 2021-06-06T17:25:52.000Z | examples/idioms/programs/177.3241-find-files-with-a-given-list-of-filename-extensions.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 108 | 2019-11-18T19:41:52.000Z | 2022-03-18T13:58:17.000Z | examples/idioms/programs/177.3241-find-files-with-a-given-list-of-filename-extensions.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 4 | 2020-05-19T08:57:44.000Z | 2020-09-21T08:53:46.000Z | """Find files with a given list of filename extensions.
Construct a list _L that contains all filenames that have the extension ".jpg" , ".jpeg" or ".png" in directory _D and all it's subdirectories.
Source: Bart
"""
# Implementation author: charlax
# Created on 2019-09-27T11:33:27.420533Z
# Last modified on 2019-09... | 27.705882 | 143 | 0.713376 |
import glob
import itertools
list(itertools.chain(*(glob.glob("*/**.%s" % ext) for ext in ["jpg", "jpeg", "png"])))
| true | true |
f72c31469cfb67208d5848f60740b7c718ec496d | 160 | py | Python | src/battery/battery.py | BigOz/flourish | a45f9d0290878c69237fdd1949ee42f9e6039df9 | [
"BSD-2-Clause"
] | null | null | null | src/battery/battery.py | BigOz/flourish | a45f9d0290878c69237fdd1949ee42f9e6039df9 | [
"BSD-2-Clause"
] | null | null | null | src/battery/battery.py | BigOz/flourish | a45f9d0290878c69237fdd1949ee42f9e6039df9 | [
"BSD-2-Clause"
] | null | null | null | class Battery:
def __init__(self, evaluator):
raise NotImplementedError
def get_action(self, current_state):
raise NotImplementedError
| 22.857143 | 40 | 0.7125 | class Battery:
def __init__(self, evaluator):
raise NotImplementedError
def get_action(self, current_state):
raise NotImplementedError
| true | true |
f72c3198aa025287611b7e30ff0d1259ec7834b8 | 8,969 | py | Python | cache_dependencies/tests/test_transaction.py | Tusky/cache-dependencies | 6c19d0c2adfce19c3fdc53ad5704eddc6d84e106 | [
"BSD-3-Clause"
] | 3 | 2017-08-08T20:06:56.000Z | 2018-09-19T03:16:20.000Z | cache_dependencies/tests/test_transaction.py | Tusky/cache-dependencies | 6c19d0c2adfce19c3fdc53ad5704eddc6d84e106 | [
"BSD-3-Clause"
] | 1 | 2017-10-24T23:11:32.000Z | 2017-10-24T23:11:32.000Z | cache_dependencies/tests/test_transaction.py | Tusky/cache-dependencies | 6c19d0c2adfce19c3fdc53ad5704eddc6d84e106 | [
"BSD-3-Clause"
] | 8 | 2017-10-24T07:43:56.000Z | 2021-06-17T07:03:02.000Z | import time
import unittest
from cache_dependencies import interfaces, transaction
try:
from unittest import mock
except ImportError:
import mock
try:
str = unicode # Python 2.* compatible
string_types = (basestring,)
integer_types = (int, long)
except NameError:
string_types = (str,)
in... | 38.659483 | 97 | 0.721485 | import time
import unittest
from cache_dependencies import interfaces, transaction
try:
from unittest import mock
except ImportError:
import mock
try:
str = unicode
string_types = (basestring,)
integer_types = (int, long)
except NameError:
string_types = (str,)
integer_types = (int,)
... | true | true |
f72c31f2bcdc0ad3367f05a6e93c9a41b1a34424 | 1,886 | py | Python | src/oci/data_labeling_service_dataplane/models/text_dataset_format_details.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/data_labeling_service_dataplane/models/text_dataset_format_details.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/data_labeling_service_dataplane/models/text_dataset_format_details.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 37.72 | 245 | 0.697243 |
from .dataset_format_details import DatasetFormatDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class TextDatasetFormatDetails(DatasetFormatDetails):
def __init__(self... | true | true |
f72c32112bb05acf4043ba5c15ccde4c05c4d6f3 | 24,352 | py | Python | compiler/characterizer/model_check.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | 1 | 2022-02-17T22:12:46.000Z | 2022-02-17T22:12:46.000Z | compiler/characterizer/model_check.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | null | null | null | compiler/characterizer/model_check.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | null | null | null | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import sys,re,shutil
import debug
import tech
im... | 54.115556 | 182 | 0.627217 |
import sys,re,shutil
import debug
import tech
import math
from .stimuli import *
from .trim_spice import *
from .charutils import *
import utils
from globals import OPTS
from .delay import delay
from .measurements import *
class model_check(delay):
def __init__(self, sram, spfile, corner, custom_delaychain... | true | true |
f72c33ad93ae6e46739f72e67c233be7339ce4cc | 1,937 | py | Python | .ignore/old/SDN_MininetUtils.py | souvikdas95/SDN_VideoStreaming | a75a77a1d2a087c96102b2c02f5a67d3a90f1fa2 | [
"Apache-2.0"
] | 4 | 2018-04-26T20:33:15.000Z | 2022-01-20T22:43:08.000Z | .ignore/old/SDN_MininetUtils.py | souvikdas95/SDN_VideoStreaming | a75a77a1d2a087c96102b2c02f5a67d3a90f1fa2 | [
"Apache-2.0"
] | null | null | null | .ignore/old/SDN_MininetUtils.py | souvikdas95/SDN_VideoStreaming | a75a77a1d2a087c96102b2c02f5a67d3a90f1fa2 | [
"Apache-2.0"
] | 3 | 2019-05-02T08:51:20.000Z | 2021-04-02T15:29:52.000Z | #!/usr/bin/python
import mininet.util;
from mininet.util import quietRun, moveIntf;
def _makeIntfPair( intf1, intf2, addr1=None, addr2=None, node1=None, node2=None,
deleteIntfs=True, runCmd=None ):
"""Make a veth pair connnecting new interfaces intf1 and intf2
intf1: name for interfac... | 35.87037 | 81 | 0.663913 |
import mininet.util;
from mininet.util import quietRun, moveIntf;
def _makeIntfPair( intf1, intf2, addr1=None, addr2=None, node1=None, node2=None,
deleteIntfs=True, runCmd=None ):
if deleteIntfs:
quietRun( 'ip link del ' + intf1, shell=True )
quietRun( 'ip link del ' + intf2, ... | true | true |
f72c344a4be417fe87d7e7e8ebbc0ea10789d3b1 | 22,433 | py | Python | nuitka/specs/BuiltinParameterSpecs.py | gdementen/Nuitka | 1f12be2364d07ffb168a7302dde94cb25eca9a70 | [
"Apache-2.0"
] | 5,421 | 2018-09-24T08:04:06.000Z | 2022-03-31T20:02:37.000Z | venv/Lib/site-packages/nuitka/specs/BuiltinParameterSpecs.py | matthijsvanvliet/raytracing-python | 73d692b47330ab94eedde579a51063e3a907e92b | [
"MIT"
] | 1,348 | 2018-09-22T13:41:00.000Z | 2022-03-31T22:33:40.000Z | venv/Lib/site-packages/nuitka/specs/BuiltinParameterSpecs.py | matthijsvanvliet/raytracing-python | 73d692b47330ab94eedde579a51063e3a907e92b | [
"MIT"
] | 396 | 2018-09-28T15:37:03.000Z | 2022-03-29T10:52:09.000Z | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 33.432191 | 88 | 0.642179 |
from __future__ import print_function
import math
from nuitka.__past__ import builtins
from nuitka.PythonVersions import python_version
from nuitka.Tracing import optimization_logger
from .ParameterSpecs import ParameterSpec, TooManyArguments, matchCall
class BuiltinParameterSpec(ParameterSpec):
... | true | true |
f72c344f2c08cfd3448f089e38a1116d9b085c4c | 17,366 | py | Python | docker-images/taigav2/taiga-back/settings/common.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | 1 | 2017-05-29T19:01:06.000Z | 2017-05-29T19:01:06.000Z | docker-images/taigav2/taiga-back/settings/common.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | null | null | null | docker-images/taigav2/taiga-back/settings/common.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | 31.632058 | 109 | 0.620293 |
import os.path, sys, os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
APPEND_SLASH = False
ALLOWED_HOSTS = ["*"]
ADMINS = (
("Admin", "example@example.com"),
)
DEBUG = False
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "taiga",
... | true | true |
f72c3524f818483a439794d6f178598c2f531f0c | 773 | py | Python | models/product.py | KennyLingineni/MiniAmazon | 95c72d3693466ca2265d0e13f2cb172e1a98c260 | [
"Unlicense"
] | null | null | null | models/product.py | KennyLingineni/MiniAmazon | 95c72d3693466ca2265d0e13f2cb172e1a98c260 | [
"Unlicense"
] | null | null | null | models/product.py | KennyLingineni/MiniAmazon | 95c72d3693466ca2265d0e13f2cb172e1a98c260 | [
"Unlicense"
] | null | null | null | from MiniAmazon.models import db
def search_by_name(query):
#Search for the product here
db_query = {'name': query}
matchingproducts = db['products'].find(db_query) # Products is the table/collection. It returns a cursor(pointer).Cursor is a type of Generator.
if matchingproducts:
return list(... | 33.608696 | 149 | 0.711514 | from MiniAmazon.models import db
def search_by_name(query):
db_query = {'name': query}
matchingproducts = db['products'].find(db_query)
if matchingproducts:
return list(matchingproducts)
else:
return []
def add_product(producttobeadded):
db['products'].insert_one(produ... | true | true |
f72c35766d755e29c14dd797ad91e44ab34914bc | 1,757 | py | Python | loading.py | hawkarcane/Hangman | 905640b087b747e6934ed7f18829b12784d0ed08 | [
"MIT"
] | null | null | null | loading.py | hawkarcane/Hangman | 905640b087b747e6934ed7f18829b12784d0ed08 | [
"MIT"
] | null | null | null | loading.py | hawkarcane/Hangman | 905640b087b747e6934ed7f18829b12784d0ed08 | [
"MIT"
] | null | null | null | #!/usr/bin/python
##### ~ http://stackoverflow.com/questions/7960600/python-tkinter-display-animated-gif-using-pil ~
## source of code can be found at the above web page, I have modified the code to suit my needs.
from Tkinter import *
from PIL import Image, ImageTk
class MyLabel(Label):
def __init__(self, mas... | 25.463768 | 98 | 0.59078 |
)
self.frames = [ImageTk.PhotoImage(first)]
Label.__init__(self, master, image=self.frames[0],
highlightthickness=0, bg='white')
temp = seq[0]
for image in seq[1:]:
temp.paste(image)
frame = temp.convert('RGBA')
self.frames.a... | true | true |
f72c37376707907e2c5dcac2d81f5c1e1aad10ec | 397 | py | Python | maillerApp/wsgi.py | Stblacq/Xmailer | 37cfd79f4c4b616fd449e78ef5587d1300090063 | [
"bzip2-1.0.6"
] | null | null | null | maillerApp/wsgi.py | Stblacq/Xmailer | 37cfd79f4c4b616fd449e78ef5587d1300090063 | [
"bzip2-1.0.6"
] | null | null | null | maillerApp/wsgi.py | Stblacq/Xmailer | 37cfd79f4c4b616fd449e78ef5587d1300090063 | [
"bzip2-1.0.6"
] | null | null | null | """
WSGI config for maillerApp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maillerApp.settings')
application = get_wsgi_application()
| true | true |
f72c37cd1328712be9f8a12af2cea85e0bb1765d | 222,324 | py | Python | nova/tests/virt/libvirt/test_libvirt.py | melwitt/nova | 6c8706b70c3bb386e01742116306a0a7942956be | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/libvirt/test_libvirt.py | melwitt/nova | 6c8706b70c3bb386e01742116306a0a7942956be | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/libvirt/test_libvirt.py | melwitt/nova | 6c8706b70c3bb386e01742116306a0a7942956be | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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
#
# ... | 41.517087 | 79 | 0.568962 |
import copy
import errno
import eventlet
import fixtures
import json
import mox
import os
import re
import shutil
import tempfile
from lxml import etree
from oslo.config import cfg
from xml.dom import minidom
from nova.api.ec2 import cloud
from nova.compute import flavors
from nova.compute import pow... | false | true |
f72c3830b52635d5830fd38ce38096456c2b9555 | 388 | py | Python | bbb/migrations/0007_room_hangout_room.py | cmd-ev/voctoconf | 5d2c1ca4f1da01b66983f5a562eb8eb6babe0452 | [
"MIT"
] | 21 | 2020-08-24T13:27:03.000Z | 2021-10-15T09:17:46.000Z | bbb/migrations/0007_room_hangout_room.py | cmd-ev/voctoconf | 5d2c1ca4f1da01b66983f5a562eb8eb6babe0452 | [
"MIT"
] | null | null | null | bbb/migrations/0007_room_hangout_room.py | cmd-ev/voctoconf | 5d2c1ca4f1da01b66983f5a562eb8eb6babe0452 | [
"MIT"
] | 5 | 2020-08-25T16:34:51.000Z | 2021-02-19T04:48:10.000Z | # Generated by Django 2.2.15 on 2020-08-14 21:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bbb', '0006_auto_20200813_1954'),
]
operations = [
migrations.AddField(
model_name='room',
name='hangout_room',
... | 20.421053 | 53 | 0.600515 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bbb', '0006_auto_20200813_1954'),
]
operations = [
migrations.AddField(
model_name='room',
name='hangout_room',
field=models.BooleanField(default=False... | true | true |
f72c386148900925f8177edd4f614faab95b090b | 704 | py | Python | var/spack/repos/builtin/packages/r-biocversion/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-biocversion/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-biocversion/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBiocversion(RPackage):
"""Set the appropriate version of Bioconductor packages.
This... | 32 | 73 | 0.72017 |
from spack import *
class RBiocversion(RPackage):
bioc = "BiocVersion"
version('3.14.0', commit='aa56d93d0ea5dcdbf301f120502981740fd91e1e')
version('3.12.0', commit='23b971963c6b73550a7e330dab5a046d58ce0223')
depends_on('r@4.0.0:', type=('build', 'run'))
depends_on('r@4.1.0:', type=('build... | true | true |
f72c389a4d7bf918cd68d55d1048f404a1165eda | 274,814 | py | Python | xarray/core/dataset.py | aha66/xarray | 3cbd21aa8fd3a57c0dd324f2a276d83829518331 | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/core/dataset.py | aha66/xarray | 3cbd21aa8fd3a57c0dd324f2a276d83829518331 | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/core/dataset.py | aha66/xarray | 3cbd21aa8fd3a57c0dd324f2a276d83829518331 | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import copy
import datetime
import functools
import inspect
import sys
import warnings
from collections import defaultdict
from distutils.version import LooseVersion
from html import escape
from numbers import Number
from operator import methodcaller
from pathlib import Path
from typing import (
TYPE_CHECKING,
... | 37.573694 | 124 | 0.56107 | import copy
import datetime
import functools
import inspect
import sys
import warnings
from collections import defaultdict
from distutils.version import LooseVersion
from html import escape
from numbers import Number
from operator import methodcaller
from pathlib import Path
from typing import (
TYPE_CHECKING,
... | true | true |
f72c3934b0697c32c252b1d2e817e435900da1e3 | 441 | py | Python | metaci/plan/migrations/0018_planrepository_active.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 48 | 2018-10-24T14:52:06.000Z | 2022-03-25T21:14:50.000Z | metaci/plan/migrations/0018_planrepository_active.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 2,034 | 2018-10-31T20:59:16.000Z | 2022-03-22T21:38:03.000Z | metaci/plan/migrations/0018_planrepository_active.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 27 | 2018-12-24T18:16:23.000Z | 2021-12-15T17:57:27.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-09-13 23:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("plan", "0016_auto_20180904_1457")]
operations = [
migrations.AddField(
mode... | 23.210526 | 56 | 0.643991 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("plan", "0016_auto_20180904_1457")]
operations = [
migrations.AddField(
model_name="planrepository",
name="active",
field=mo... | true | true |
f72c39bc796a19aeb0f55dc3bee1129236c8a00e | 111,695 | py | Python | salt/grains/core.py | MeAndTheFirefly/salt | 77fc3ec3ee25c1b769cc66ddee09067d18080844 | [
"Apache-2.0"
] | 2 | 2016-11-14T15:08:53.000Z | 2016-11-20T09:25:30.000Z | salt/grains/core.py | MeAndTheFirefly/salt | 77fc3ec3ee25c1b769cc66ddee09067d18080844 | [
"Apache-2.0"
] | 3 | 2021-03-31T19:53:24.000Z | 2021-12-13T20:46:19.000Z | salt/grains/core.py | MeAndTheFirefly/salt | 77fc3ec3ee25c1b769cc66ddee09067d18080844 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:32:02.000Z | 2020-11-06T11:01:18.000Z | # -*- coding: utf-8 -*-
"""
The static grains, these are the core, or built in grains.
When grains are loaded they are not loaded in the same way that modules are
loaded, grain functions are detected and executed, the functions MUST
return a dict which will be applied to the main grains dict. This module
will always b... | 36.911765 | 124 | 0.528985 |
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import hashlib
import locale
import logging
import os
import platform
import re
import socket
import sys
import time
import uuid
from errno import EACCES, EPERM
import distro
import salt.exceptions
import salt.log
import salt... | true | true |
f72c39d04f46b4659fec28e1537a34671c4a461f | 439 | py | Python | people/templatetags/people_extras.py | hayatbayramolsa/website | 22a00a1de8b5902c559e4b48df27fa5c1329f16a | [
"WTFPL"
] | 1 | 2020-02-07T17:38:14.000Z | 2020-02-07T17:38:14.000Z | people/templatetags/people_extras.py | hayatbayramolsa/website | 22a00a1de8b5902c559e4b48df27fa5c1329f16a | [
"WTFPL"
] | null | null | null | people/templatetags/people_extras.py | hayatbayramolsa/website | 22a00a1de8b5902c559e4b48df27fa5c1329f16a | [
"WTFPL"
] | null | null | null | from django import template
register = template.Library()
def fontawesome(icon_name, size=""):
"""
Generate fontawesome syntax for HTML.
Usage:
{% fontawesome "iconname" %}
{% fontawesome "iconname" "size" %}
Size values are: lg, 2x, 3x, 4x, 5x
"""
if len(size) > 0:
... | 19.086957 | 60 | 0.587699 | from django import template
register = template.Library()
def fontawesome(icon_name, size=""):
if len(size) > 0:
size = "fa-%s" % size
return '<i class="fa fa-%s %s"></i>' % (icon_name, size)
register.simple_tag(fontawesome)
| true | true |
f72c3a32e58db3f2d9a4b04faa87382ae4209bcf | 314 | py | Python | symarray/symarray/calculus/tests/test_arrays.py | tonyfast/uarray | 72fe4a0b86b26208747c95c828c66b8284d435d4 | [
"BSD-3-Clause"
] | null | null | null | symarray/symarray/calculus/tests/test_arrays.py | tonyfast/uarray | 72fe4a0b86b26208747c95c828c66b8284d435d4 | [
"BSD-3-Clause"
] | null | null | null | symarray/symarray/calculus/tests/test_arrays.py | tonyfast/uarray | 72fe4a0b86b26208747c95c828c66b8284d435d4 | [
"BSD-3-Clause"
] | null | null | null |
from symarray.calculus.integers import Integer
from symarray.calculus.arrays import Array
from symarray.shape import NDShape
def test_basic():
a = Array('a')
b = Array('b', shape=NDShape((Integer('n1'), Integer('n2'))))
n = Integer('n')
expr = a+n*a+2+b
print(expr.shape)
print(expr[1])
| 22.428571 | 65 | 0.659236 |
from symarray.calculus.integers import Integer
from symarray.calculus.arrays import Array
from symarray.shape import NDShape
def test_basic():
a = Array('a')
b = Array('b', shape=NDShape((Integer('n1'), Integer('n2'))))
n = Integer('n')
expr = a+n*a+2+b
print(expr.shape)
print(expr[1])
| true | true |
f72c3ac1f20334925f3e4c702afd2d9868b7b904 | 3,221 | py | Python | u-tokyo/2018-summer/dataset.py | PandaDrunkard/proex | c303f051721d9f271d8187957a4458dc5f4558b1 | [
"MIT"
] | null | null | null | u-tokyo/2018-summer/dataset.py | PandaDrunkard/proex | c303f051721d9f271d8187957a4458dc5f4558b1 | [
"MIT"
] | null | null | null | u-tokyo/2018-summer/dataset.py | PandaDrunkard/proex | c303f051721d9f271d8187957a4458dc5f4558b1 | [
"MIT"
] | null | null | null | import math
def load_image(filename, append_index=False):
content = [line.strip().split(' ') for line in open(filename)][0]
r = list(map(int, content[0::3]))
g = list(map(int, content[1::3]))
b = list(map(int, content[2::3]))
if append_index:
return list(zip(r,g,b,range(len(r))))
else:
... | 30.386792 | 69 | 0.535548 | import math
def load_image(filename, append_index=False):
content = [line.strip().split(' ') for line in open(filename)][0]
r = list(map(int, content[0::3]))
g = list(map(int, content[1::3]))
b = list(map(int, content[2::3]))
if append_index:
return list(zip(r,g,b,range(len(r))))
else:
... | true | true |
f72c3b061208c98f8b6103c531da45e38011c75c | 92,091 | py | Python | pandas/util/testing.py | mimikaTU/pandas | 573d4e7e1b354e7ee0cb12280ec58835207106ea | [
"BSD-3-Clause"
] | 1 | 2020-01-18T09:57:03.000Z | 2020-01-18T09:57:03.000Z | pandas/util/testing.py | Kaya176/pandas | 4fb963b6a3261940de5891323a8d217087a2a9a1 | [
"BSD-3-Clause"
] | 1 | 2018-03-22T16:06:03.000Z | 2018-03-22T16:06:03.000Z | pandas/util/testing.py | Kaya176/pandas | 4fb963b6a3261940de5891323a8d217087a2a9a1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
# pylint: disable-msg=W0402
import re
import string
import sys
import tempfile
import warnings
import inspect
import os
import subprocess
import locale
import traceback
from datetime import datetime
from functools import wraps
from contextlib import contextmanager
from numpy.random im... | 32.854442 | 79 | 0.611059 | from __future__ import division
import re
import string
import sys
import tempfile
import warnings
import inspect
import os
import subprocess
import locale
import traceback
from datetime import datetime
from functools import wraps
from contextlib import contextmanager
from numpy.random import randn, rand
import num... | true | true |
f72c3bbbbfb56f466b8bb7c5ad7d122e79a30a61 | 22,903 | py | Python | app/venv/lib/python2.7/site-packages/numpy/distutils/mingw32ccompiler.py | anaheino/Ufo-sightings-map | 64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc | [
"MIT"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | app/venv/lib/python2.7/site-packages/numpy/distutils/mingw32ccompiler.py | anaheino/Ufo-sightings-map | 64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc | [
"MIT"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | app/venv/lib/python2.7/site-packages/numpy/distutils/mingw32ccompiler.py | anaheino/Ufo-sightings-map | 64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc | [
"MIT"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | """
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
from __future__ import division, absolute_import, p... | 38.171667 | 176 | 0.590752 | from __future__ import division, absolute_import, print_function
import os
import sys
import subprocess
import re
import numpy.distutils.ccompiler
if sys.version_info[0] < 3:
from . import log
else:
from numpy.distutils import log
# --> this is done in numpy/distutils/ccompiler.py
# 3. Force windows t... | true | true |
f72c3c1f7ed42aa55a23fb88c63f41612e677e8b | 203 | py | Python | pyBrematic/utils/__init__.py | d-Rickyy-b/Brematic-Controller | 878ace569ff7df0617a35f595cb74244c21ebb9c | [
"MIT"
] | 11 | 2018-05-02T21:31:57.000Z | 2021-11-09T11:40:47.000Z | pyBrematic/utils/__init__.py | d-Rickyy-b/Brematic-Controller | 878ace569ff7df0617a35f595cb74244c21ebb9c | [
"MIT"
] | 20 | 2018-05-01T14:32:59.000Z | 2022-02-14T21:53:58.000Z | pyBrematic/utils/__init__.py | d-Rickyy-b/Brematic-Controller | 878ace569ff7df0617a35f595cb74244c21ebb9c | [
"MIT"
] | 5 | 2018-11-08T15:35:48.000Z | 2020-12-27T18:28:44.000Z | # -*- coding: utf-8 -*-
from .encoding import DataEncoder
from .rand import Rand
from .singleton import singleton
from .storage import Storage
__all__ = ["singleton", "Storage", "DataEncoder", "Rand"]
| 22.555556 | 57 | 0.724138 |
from .encoding import DataEncoder
from .rand import Rand
from .singleton import singleton
from .storage import Storage
__all__ = ["singleton", "Storage", "DataEncoder", "Rand"]
| true | true |
f72c3cb0514457777ed5fb9a0b71f43e86fde81c | 4,523 | py | Python | caw/tests/test_e2e.py | FNNDSC/caw | a41761c4502481f6ccb60ef6e9956464c9b30eb9 | [
"MIT"
] | null | null | null | caw/tests/test_e2e.py | FNNDSC/caw | a41761c4502481f6ccb60ef6e9956464c9b30eb9 | [
"MIT"
] | 11 | 2021-04-23T21:25:29.000Z | 2022-03-14T02:40:26.000Z | caw/tests/test_e2e.py | FNNDSC/caw | a41761c4502481f6ccb60ef6e9956464c9b30eb9 | [
"MIT"
] | 1 | 2021-10-17T16:18:30.000Z | 2021-10-17T16:18:30.000Z | """
An end-to-end test which performs the following:
1. creates a ChRIS user account.
2. caw login
3. caw search
4. caw upload --pipeline ...
5. caw download
6. caw logout
"""
import os
import unittest
import random
import string
import requests
import subprocess as sp
from tempfile import NamedTemporaryFile, Tempor... | 34.007519 | 147 | 0.554941 |
import os
import unittest
import random
import string
import requests
import subprocess as sp
from tempfile import NamedTemporaryFile, TemporaryDirectory
from time import sleep
from glob import iglob
def random_string(length=12) -> str:
return ''.join(random.choice(string.ascii_letters) for x in range(length))
... | true | true |
f72c3ce1384bcf313ac21687415c8302c74d8838 | 5,540 | py | Python | clothingBot.py | MohamedBengezi/clothingBot | da48eec8548579be70e6990b991af8d0d9aa9c77 | [
"MIT"
] | null | null | null | clothingBot.py | MohamedBengezi/clothingBot | da48eec8548579be70e6990b991af8d0d9aa9c77 | [
"MIT"
] | 3 | 2021-03-31T19:37:57.000Z | 2021-12-13T20:32:40.000Z | clothingBot.py | MohamedBengezi/clothingBot | da48eec8548579be70e6990b991af8d0d9aa9c77 | [
"MIT"
] | null | null | null | import sys
import json
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptio... | 31.657143 | 85 | 0.638809 | import sys
import json
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptio... | true | true |
f72c3d058896a02a0504926742ddd9e972b29447 | 15,106 | py | Python | twilio/rest/conversations/v1/service/configuration/notification.py | timgates42/twilio-python | ef29d03a4857b62b616df4a8f4f2b7c294afbb99 | [
"MIT"
] | 2 | 2022-01-13T10:58:03.000Z | 2022-03-16T07:12:17.000Z | venv/Lib/site-packages/twilio/rest/conversations/v1/service/configuration/notification.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 9 | 2018-05-07T21:59:44.000Z | 2022-01-29T22:49:29.000Z | venv/Lib/site-packages/twilio/rest/conversations/v1/service/configuration/notification.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 4 | 2021-03-25T09:00:08.000Z | 2021-08-05T06:54:23.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | 42.672316 | 163 | 0.693632 |
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class NotificationList(ListResource):
def __init__(self, version, chat_service_... | true | true |
f72c3d8a0d20aa867b3ae48210aa041fe0e1ebf3 | 516 | py | Python | env/Lib/site-packages/plotly/validators/violin/_points.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/violin/_points.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/violin/_points.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class PointsValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="points", parent_name="violin", **kwargs):
super(PointsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 34.4 | 77 | 0.622093 | import _plotly_utils.basevalidators
class PointsValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="points", parent_name="violin", **kwargs):
super(PointsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f72c3deb6a646c951f899749fe2ceefc65d3ed16 | 5,534 | py | Python | plotly/graph_objs/layout/scene/_domain.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | null | null | null | plotly/graph_objs/layout/scene/_domain.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | null | null | null | plotly/graph_objs/layout/scene/_domain.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | from plotly.basedatatypes import BaseLayoutHierarchyType
import copy
class Domain(BaseLayoutHierarchyType):
# column
# ------
@property
def column(self):
"""
If there is a layout grid, use the domain for this column in
the grid for this scene subplot .
The 'column... | 27.809045 | 71 | 0.527647 | from plotly.basedatatypes import BaseLayoutHierarchyType
import copy
class Domain(BaseLayoutHierarchyType):
@property
def column(self):
return self['column']
@column.setter
def column(self, val):
self['column'] = val
@property
def row(self):
retur... | true | true |
f72c3e5bb5282a9d3bfbafdfee816454ab692053 | 64,538 | py | Python | tests/test_scottbrian_algo1/test_algo_api.py | ScottBrian/scottbrian_algo1 | 57cd8fc5674507db51b1c887d5f9a68462b0ca9d | [
"MIT"
] | null | null | null | tests/test_scottbrian_algo1/test_algo_api.py | ScottBrian/scottbrian_algo1 | 57cd8fc5674507db51b1c887d5f9a68462b0ca9d | [
"MIT"
] | null | null | null | tests/test_scottbrian_algo1/test_algo_api.py | ScottBrian/scottbrian_algo1 | 57cd8fc5674507db51b1c887d5f9a68462b0ca9d | [
"MIT"
] | null | null | null | """test_algo_api.py module."""
# from datetime import datetime, timedelta
import pytest
# import sys
# from pathlib import Path
import numpy as np
import pandas as pd # type: ignore
import string
import math
from typing import Any, List, NamedTuple
# from typing_extensions import Final
from ibapi.tag_value import T... | 37.133487 | 79 | 0.562754 |
import pytest
import numpy as np
import pandas as pd
import string
import math
from typing import Any, List, NamedTuple
from ibapi.tag_value import TagValue
from ibapi.contract import ComboLeg
from ibapi.contract import DeltaNeutralContract
from ibapi.contract import Contract, ContractDetails
from scottbr... | true | true |
f72c3eaefc009d0112c0c6fa0eb8a060a2d74f83 | 13,353 | py | Python | cryptoapis/model/inline_response40084.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | cryptoapis/model/inline_response40084.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | cryptoapis/model/inline_response40084.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 46.852632 | 484 | 0.59642 |
import re
import sys
from cryptoapis.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenA... | true | true |
f72c3f4ba1a384299dbf753da7d0c4ce5d5a213d | 117 | py | Python | App/pogress.py | MarioTiara/MarioTiara-RD-Detection-Ensemble-CNN | 95101b942a7e51078bfe643021e745e51e82516f | [
"MIT"
] | null | null | null | App/pogress.py | MarioTiara/MarioTiara-RD-Detection-Ensemble-CNN | 95101b942a7e51078bfe643021e745e51e82516f | [
"MIT"
] | null | null | null | App/pogress.py | MarioTiara/MarioTiara-RD-Detection-Ensemble-CNN | 95101b942a7e51078bfe643021e745e51e82516f | [
"MIT"
] | null | null | null | from tqdm import tqdm,trange
from time import sleep
for i in trange(20):
sleep(0.1)
pass
raise SystemExit
| 11.7 | 28 | 0.709402 | from tqdm import tqdm,trange
from time import sleep
for i in trange(20):
sleep(0.1)
pass
raise SystemExit
| true | true |
f72c409dd9d8c1ef88d4e1e5c1f5d52fa3e3b565 | 546 | py | Python | manage.py | C-PRONCE/django-project | 573402850462a73bd8750118f74e2b36aa650ded | [
"MIT"
] | null | null | null | manage.py | C-PRONCE/django-project | 573402850462a73bd8750118f74e2b36aa650ded | [
"MIT"
] | null | null | null | manage.py | C-PRONCE/django-project | 573402850462a73bd8750118f74e2b36aa650ded | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "second_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Djang... | 34.125 | 78 | 0.690476 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "second_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's ... | true | true |
f72c41aed18c0d9acc5d31e93cff1a2cecca0807 | 2,225 | py | Python | test/ux/components/model/test_repository.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | test/ux/components/model/test_repository.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | test/ux/components/model/test_repository.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"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... | 36.47541 | 84 | 0.720899 |
import unittest
from neural_compressor.ux.components.model.repository import ModelRepository
from neural_compressor.ux.utils.consts import Frameworks
from neural_compressor.ux.utils.exceptions import NotFoundException
class TestModelRepository(unittest.TestCase):
def test_onnx_is_model_path(self)... | true | true |
f72c41f790310bb3e579547708ef92adbef03768 | 4,008 | py | Python | unit_test/test_interface.py | riven314/capstone_dash_interface | 5eab25f4c15ad09aa889554820231175b0a3ed28 | [
"CC0-1.0"
] | 1 | 2019-12-10T14:59:12.000Z | 2019-12-10T14:59:12.000Z | unit_test/test_interface.py | riven314/capstone_dash_interface | 5eab25f4c15ad09aa889554820231175b0a3ed28 | [
"CC0-1.0"
] | null | null | null | unit_test/test_interface.py | riven314/capstone_dash_interface | 5eab25f4c15ad09aa889554820231175b0a3ed28 | [
"CC0-1.0"
] | 1 | 2020-01-01T12:24:51.000Z | 2020-01-01T12:24:51.000Z | """
test the following:
model + scene understanding + interface
"""
import os
import sys
PATH = os.path.join(os.getcwd(), '..')
sys.path.append(PATH)
import cv2
from PyQt5.QtGui import QImage, QColor, QPixmap
from PyQt5.QtWidgets import QApplication
import qtmodern.styles
import qtmodern.windows
from l... | 38.538462 | 102 | 0.643214 | import os
import sys
PATH = os.path.join(os.getcwd(), '..')
sys.path.append(PATH)
import cv2
from PyQt5.QtGui import QImage, QColor, QPixmap
from PyQt5.QtWidgets import QApplication
import qtmodern.styles
import qtmodern.windows
from layout import Layout
from pyqt_utils import convert_qimg
from scene_sum... | true | true |
f72c4215bb8a7b8efd6c3aee4ac1b1fb3af3b383 | 6,434 | py | Python | userbot/__init__.py | PRUDHVI-BOT/apple | daae0ca57f42c6a924a59bfd800b92e2a6c6115e | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/__init__.py | PRUDHVI-BOT/apple | daae0ca57f42c6a924a59bfd800b92e2a6c6115e | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/__init__.py | PRUDHVI-BOT/apple | daae0ca57f42c6a924a59bfd800b92e2a6c6115e | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot initialization. """
import os
from sys import version_info
from logging import basicConfig, getLogger, IN... | 32.17 | 143 | 0.713864 |
import os
from sys import version_info
from logging import basicConfig, getLogger, INFO, DEBUG
from distutils.util import strtobool as sb
from pylast import LastFMNetwork, md5
from pySmartDL import SmartDL
from dotenv import load_dotenv
from requests import get
from telethon import TelegramClient
from telethon.... | true | true |
f72c4479ad5d2532a05900a83c5526eec00f800e | 13,381 | py | Python | src/rkd_harbor/tasks/deployment/base.py | attawayinc/riotkit-harbor | baea9f6e856f18835d316e3adc01ced2b9aaebda | [
"Apache-2.0"
] | 14 | 2019-04-12T11:24:54.000Z | 2022-03-21T01:13:27.000Z | src/rkd_harbor/tasks/deployment/base.py | attawayinc/riotkit-harbor | baea9f6e856f18835d316e3adc01ced2b9aaebda | [
"Apache-2.0"
] | 37 | 2019-06-29T05:54:10.000Z | 2021-08-03T05:54:52.000Z | src/rkd_harbor/tasks/deployment/base.py | attawayinc/riotkit-harbor | baea9f6e856f18835d316e3adc01ced2b9aaebda | [
"Apache-2.0"
] | 2 | 2021-09-29T04:22:52.000Z | 2021-09-29T06:43:59.000Z | import os
import subprocess
from abc import ABC
from jinja2 import Environment
from jinja2 import FileSystemLoader
from jinja2 import StrictUndefined
from jinja2.exceptions import UndefinedError
from argparse import ArgumentParser
from rkd.api.contract import ExecutionContext
from rkd.yaml_parser import YamlFileLoader
... | 41.172308 | 120 | 0.603318 | import os
import subprocess
from abc import ABC
from jinja2 import Environment
from jinja2 import FileSystemLoader
from jinja2 import StrictUndefined
from jinja2.exceptions import UndefinedError
from argparse import ArgumentParser
from rkd.api.contract import ExecutionContext
from rkd.yaml_parser import YamlFileLoader
... | true | true |
f72c4540917b51bca7ea46963d819966d9f4ad33 | 103 | py | Python | code/test/__init__.py | fgitmichael/TestModeDisentangling | 022fbe5b49e847aeb110d89be1e0b1c28bcff01d | [
"MIT"
] | 1 | 2020-05-16T14:03:09.000Z | 2020-05-16T14:03:09.000Z | code/test/__init__.py | fgitmichael/TestModeDisentangling | 022fbe5b49e847aeb110d89be1e0b1c28bcff01d | [
"MIT"
] | null | null | null | code/test/__init__.py | fgitmichael/TestModeDisentangling | 022fbe5b49e847aeb110d89be1e0b1c28bcff01d | [
"MIT"
] | null | null | null | from .mode_actions_sampler import ModeActionSampler
from .disentangling_test import DisentanglingTester | 51.5 | 51 | 0.912621 | from .mode_actions_sampler import ModeActionSampler
from .disentangling_test import DisentanglingTester | true | true |
f72c462c3af80843d61e6f49c7378e99c77bb19c | 22,921 | py | Python | src/plant_energyse/openwind/academic/openWindAcComponent.py | WISDEM/Plant_EnergySE | 5ca898bf65b63fd1a87a40241591866f5f0b185a | [
"Apache-2.0"
] | 1 | 2019-02-26T17:54:14.000Z | 2019-02-26T17:54:14.000Z | src/plant_energyse/openwind/academic/openWindAcComponent.py | WISDEM/Plant_EnergySE | 5ca898bf65b63fd1a87a40241591866f5f0b185a | [
"Apache-2.0"
] | null | null | null | src/plant_energyse/openwind/academic/openWindAcComponent.py | WISDEM/Plant_EnergySE | 5ca898bf65b63fd1a87a40241591866f5f0b185a | [
"Apache-2.0"
] | 1 | 2021-04-19T18:40:39.000Z | 2021-04-19T18:40:39.000Z | # openWindAcComponent.py
# 2014 04 08
'''
Execute OpenWindAcademic as an OpenMDAO Component
After execute(), the following variables have been updated:
nTurbs
net_aep
gross_aep
They can be accessed through appropriate connections.
NOTE: Script file must contain an Optimize/Optimise... | 41.979853 | 137 | 0.590899 |
'''
Execute OpenWindAcademic as an OpenMDAO Component
After execute(), the following variables have been updated:
nTurbs
net_aep
gross_aep
They can be accessed through appropriate connections.
NOTE: Script file must contain an Optimize/Optimise operation - otherwise,
no resul... | false | true |
f72c464b80241ef5e87521b090940d0e329fe244 | 2,462 | py | Python | algotrader/trading/context.py | alexcwyu/python-trading | a494f602411a3ebfdecae002a16a5ea93fc7a046 | [
"Apache-2.0"
] | 17 | 2016-03-30T21:52:30.000Z | 2021-05-01T18:21:48.000Z | algotrader/trading/context.py | ajmal017/python-trading | a494f602411a3ebfdecae002a16a5ea93fc7a046 | [
"Apache-2.0"
] | 2 | 2016-10-04T19:29:05.000Z | 2017-02-01T19:24:39.000Z | algotrader/trading/context.py | ajmal017/python-trading | a494f602411a3ebfdecae002a16a5ea93fc7a046 | [
"Apache-2.0"
] | 9 | 2016-04-24T05:05:26.000Z | 2020-05-03T13:01:34.000Z | from algotrader import Context
from algotrader.model.model_factory import ModelFactory
from algotrader.provider import ProviderManager
from algotrader.provider.broker import Broker
from algotrader.provider.datastore import DataStore
from algotrader.provider.feed import Feed
from algotrader.strategy import StrategyManag... | 42.448276 | 102 | 0.750203 | from algotrader import Context
from algotrader.model.model_factory import ModelFactory
from algotrader.provider import ProviderManager
from algotrader.provider.broker import Broker
from algotrader.provider.datastore import DataStore
from algotrader.provider.feed import Feed
from algotrader.strategy import StrategyManag... | true | true |
f72c464dc5c8ee869e61bd1a0fbcf6cc63feb838 | 3,082 | py | Python | lispy/lisp.py | fucangyu/myself-impls | 9fd2730f9e0e12f95559d2f4e41c34b670441428 | [
"MIT"
] | 3 | 2019-01-04T12:54:16.000Z | 2019-01-13T07:08:10.000Z | lispy/lisp.py | fucangyu/myself-impls | 9fd2730f9e0e12f95559d2f4e41c34b670441428 | [
"MIT"
] | null | null | null | lispy/lisp.py | fucangyu/myself-impls | 9fd2730f9e0e12f95559d2f4e41c34b670441428 | [
"MIT"
] | 1 | 2019-08-27T18:29:53.000Z | 2019-08-27T18:29:53.000Z | import math
import operator as op
from collections import ChainMap as Environment
Symbol = str
List = list
Number = (int, float)
def parse(program: str):
return read_from_tokens(tokenize(program))
def tokenize(raw):
return raw.replace('(', ' ( ').replace(')', ' ) ').split()
def read_from_tokens(tokens: l... | 23.172932 | 64 | 0.508436 | import math
import operator as op
from collections import ChainMap as Environment
Symbol = str
List = list
Number = (int, float)
def parse(program: str):
return read_from_tokens(tokenize(program))
def tokenize(raw):
return raw.replace('(', ' ( ').replace(')', ' ) ').split()
def read_from_tokens(tokens: l... | true | true |
f72c46adb32a8a5bb98d87da7bfcaf092e3eb79b | 19,109 | py | Python | logs/management/commands/import_log.py | ahemery/ezreports | 9ff0f472ff0f0efd06c8315b99084bd723b0e2f9 | [
"Apache-2.0"
] | null | null | null | logs/management/commands/import_log.py | ahemery/ezreports | 9ff0f472ff0f0efd06c8315b99084bd723b0e2f9 | [
"Apache-2.0"
] | null | null | null | logs/management/commands/import_log.py | ahemery/ezreports | 9ff0f472ff0f0efd06c8315b99084bd723b0e2f9 | [
"Apache-2.0"
] | null | null | null | import csv
import glob
import os
import pycurl
import re
import ldap3
from datetime import date, timedelta, datetime
from dateutil.parser import parse
from django.core.management.base import BaseCommand, CommandError
from django.db import connection
from django.db.models import Max
from django.utils.text import slugify... | 41.905702 | 117 | 0.487676 | import csv
import glob
import os
import pycurl
import re
import ldap3
from datetime import date, timedelta, datetime
from dateutil.parser import parse
from django.core.management.base import BaseCommand, CommandError
from django.db import connection
from django.db.models import Max
from django.utils.text import slugify... | true | true |
f72c46cc6e6046ea77fc6de5d29eb113534e9e14 | 9,731 | py | Python | tools/rosunit/test/test_junitxml.py | dodsonmg/ros | f1ce3d9d36e8df9dcdca6b37086aabb7f3e202d3 | [
"BSD-3-Clause"
] | null | null | null | tools/rosunit/test/test_junitxml.py | dodsonmg/ros | f1ce3d9d36e8df9dcdca6b37086aabb7f3e202d3 | [
"BSD-3-Clause"
] | null | null | null | tools/rosunit/test/test_junitxml.py | dodsonmg/ros | f1ce3d9d36e8df9dcdca6b37086aabb7f3e202d3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code... | 42.679825 | 176 | 0.631795 |
import os
import io
import sys
import unittest
import tempfile
import shutil
junitxml = None
.filename = os.path.join(directory, filename)
self.suites = suites
self.noSuitesRoot = noSuitesRoot
class MockSuite():
def __init__(self, cases, name, tests = 0... | true | true |
f72c4791408d215f1552686fbe6b4975707a7ebe | 63 | py | Python | python/testData/refactoring/changeSignature/keywordOnlyMove.before.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/changeSignature/keywordOnlyMove.before.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/changeSignature/keywordOnlyMove.before.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def f<caret>(*, param1, param2):
pass
f(param1=1, param2=2) | 12.6 | 32 | 0.634921 | def f<caret>(*, param1, param2):
pass
f(param1=1, param2=2) | false | true |
f72c48af45b656ece0447e4d40290a0102816591 | 20,906 | py | Python | odoo/base-addons/sale/tests/test_sale_product_attribute_value_config.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/sale/tests/test_sale_product_attribute_value_config.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/sale/tests/test_sale_product_attribute_value_config.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields
from odoo.addons.product.tests.test_product_attribute_value_config import TestProductAttributeValueSetup
from odoo.tests import tagged
class TestSaleProductAttributeValueSetup(TestProductAttribu... | 51.114914 | 120 | 0.69162 |
from odoo import fields
from odoo.addons.product.tests.test_product_attribute_value_config import TestProductAttributeValueSetup
from odoo.tests import tagged
class TestSaleProductAttributeValueSetup(TestProductAttributeValueSetup):
def _setup_currency(self, currency_ratio=2):
from_currency = self.comp... | true | true |
f72c490d26e31fc870e558ebe85f5de8ccd13aa9 | 4,921 | py | Python | src/btfs/firebase_dc.py | mikespub-org/mar10-clouddav | dabfe2832438667ca5ff960e9273fceae9280f15 | [
"MIT"
] | 2 | 2021-03-01T10:27:41.000Z | 2021-11-04T21:27:12.000Z | src/btfs/firebase_dc.py | mikespub-org/mar10-clouddav | dabfe2832438667ca5ff960e9273fceae9280f15 | [
"MIT"
] | 1 | 2022-03-07T09:09:21.000Z | 2022-03-07T09:09:21.000Z | src/btfs/firebase_dc.py | mikespub-org/mar10-clouddav | dabfe2832438667ca5ff960e9273fceae9280f15 | [
"MIT"
] | 1 | 2020-10-17T07:35:37.000Z | 2020-10-17T07:35:37.000Z | # (c) 2009-2019 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Implementation of a domain controller that allows users to authenticate via the
Google Identity Platform - based on Firebase Authentication... | 44.333333 | 104 | 0.633611 |
from wsgidav import util
from wsgidav.dc.base_dc import BaseDomainController
from .sessions import get_current_session
__docformat__ = "reStructuredText"
_logger = util.get_module_logger(__name__)
class FirebaseDomainController(BaseDomainController):
known_roles = ("admin", "editor", "reader", "browser", "no... | true | true |
f72c4c832d99aaf2b05ca354a98a00fc55c755f2 | 1,232 | py | Python | paper_simulation_scripts/run_one_job.py | bsierieb1/SCDCdm_public | 4cd3460a598fad01cb556dc1fb86f63d805ee052 | [
"BSD-3-Clause"
] | 1 | 2021-03-31T10:44:48.000Z | 2021-03-31T10:44:48.000Z | paper_simulation_scripts/run_one_job.py | neurogenomics/scCODA | db610c1bda904f79a8142da767cf8e62d1cd8d32 | [
"BSD-3-Clause"
] | null | null | null | paper_simulation_scripts/run_one_job.py | neurogenomics/scCODA | db610c1bda904f79a8142da767cf8e62d1cd8d32 | [
"BSD-3-Clause"
] | null | null | null | """
This script is executed in each job on the server to run simulation studies on all the parameters that are passed to it
"""
import sys
import ast
import numpy as np
from scdcdm.util import multi_parameter_sampling as mult
# Convert string parameters to lists
cases = ast.literal_eval(sys.argv[1])
print("cases:", c... | 32.421053 | 131 | 0.719156 | import sys
import ast
import numpy as np
from scdcdm.util import multi_parameter_sampling as mult
cases = ast.literal_eval(sys.argv[1])
print("cases:", cases)
K = ast.literal_eval(sys.argv[2])
print("K:", K)
n_total = ast.literal_eval(sys.argv[3])
print("n_total:", n_total)
n_samples = ast.literal_eval(sys.argv[4])
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.