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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790d1d3badf6fd562c1a03dd2abb2e15b574c694 | 5,753 | py | Python | manager.py | DenizShabani/TelegramMassDMBot | 826198d853bbf6498e44e573a7f2d249c0b0ba60 | [
"MIT"
] | 17 | 2022-02-23T08:06:21.000Z | 2022-03-26T19:03:41.000Z | manager.py | DenizShabani/TelegramMassDMBot | 826198d853bbf6498e44e573a7f2d249c0b0ba60 | [
"MIT"
] | 2 | 2022-03-21T22:34:23.000Z | 2022-03-25T20:55:25.000Z | manager.py | DenizShabani/TelegramMassDMBot | 826198d853bbf6498e44e573a7f2d249c0b0ba60 | [
"MIT"
] | 3 | 2022-02-23T07:20:01.000Z | 2022-03-26T19:03:50.000Z | import requests
from telethon.sync import TelegramClient
from telethon.errors.rpcerrorlist import PhoneNumberBannedError
import pickle, pyfiglet
from colorama import init, Fore
import os, random
from time import sleep
init()
lg = Fore.LIGHTGREEN_EX
w = Fore.WHITE
cy = Fore.CYAN
ye = Fore.YELLOW
r = Fore.RED
n = Fore.... | 34.244048 | 91 | 0.441161 | import requests
from telethon.sync import TelegramClient
from telethon.errors.rpcerrorlist import PhoneNumberBannedError
import pickle, pyfiglet
from colorama import init, Fore
import os, random
from time import sleep
init()
lg = Fore.LIGHTGREEN_EX
w = Fore.WHITE
cy = Fore.CYAN
ye = Fore.YELLOW
r = Fore.RED
n = Fore.... | true | true |
790d1e7ce77cb3ec1ec127f4498e640abbee98ce | 8,338 | py | Python | cmstack/hdfg/passes/flatten.py | he-actlab/cdstack | 38f605cfa299bf97b5875a19f9fd811a2671d56f | [
"Apache-2.0"
] | null | null | null | cmstack/hdfg/passes/flatten.py | he-actlab/cdstack | 38f605cfa299bf97b5875a19f9fd811a2671d56f | [
"Apache-2.0"
] | null | null | null | cmstack/hdfg/passes/flatten.py | he-actlab/cdstack | 38f605cfa299bf97b5875a19f9fd811a2671d56f | [
"Apache-2.0"
] | null | null | null |
from cmstack.hdfg import hdfgutils
from cmstack.hdfg.hdfg_pb2 import Component, ValueInfo
import logging
from . import is_literal, is_number
def flatten_graph(output_graph, graph, templates, context,edge_node_ids, arg_map):
components = {}
for e in graph.edge_info:
copy_edge = ValueInfo()
if... | 35.939655 | 155 | 0.598225 |
from cmstack.hdfg import hdfgutils
from cmstack.hdfg.hdfg_pb2 import Component, ValueInfo
import logging
from . import is_literal, is_number
def flatten_graph(output_graph, graph, templates, context,edge_node_ids, arg_map):
components = {}
for e in graph.edge_info:
copy_edge = ValueInfo()
if... | true | true |
790d1e95f401235dc60e86bb4bd99addf75fb901 | 1,217 | py | Python | synth.py | Global19/nodejs-memcache | 13c6e820fd8e7889ddaccceb8bff739ff5e4c4a0 | [
"Apache-2.0"
] | null | null | null | synth.py | Global19/nodejs-memcache | 13c6e820fd8e7889ddaccceb8bff739ff5e4c4a0 | [
"Apache-2.0"
] | null | null | null | synth.py | Global19/nodejs-memcache | 13c6e820fd8e7889ddaccceb8bff739ff5e4c4a0 | [
"Apache-2.0"
] | 1 | 2020-10-04T10:50:46.000Z | 2020-10-04T10:50:46.000Z | # Copyright 2020 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... | 32.891892 | 74 | 0.771569 |
import synthtool as s
import synthtool.gcp as gcp
import synthtool.languages.node as node
import logging
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICBazel()
versions = ['v1beta2']
name = 'memcache'
for version in versions:
library = gapic.node_library(name, version)
s.copy(library, excl... | true | true |
790d1ec1a21e2572f76463724a918a28f2ebd09a | 4,209 | py | Python | requirements.py | craig8/volttron | 2a954311d323effa3b79c2a53f6e8c3bb9664e1c | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2020-06-08T16:54:28.000Z | 2020-06-08T16:54:28.000Z | requirements.py | craig8/volttron | 2a954311d323effa3b79c2a53f6e8c3bb9664e1c | [
"Apache-2.0",
"BSD-2-Clause"
] | 8 | 2016-10-07T22:49:28.000Z | 2022-02-23T00:57:58.000Z | requirements.py | craig8/volttron | 2a954311d323effa3b79c2a53f6e8c3bb9664e1c | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | 30.948529 | 95 | 0.646947 |
option_requirements = [
('pyzmq', ['--zmq=bundled']),
]
install_requires = [
'gevent==20.6.1',
'greenlet==0.4.16',
'grequests',
'requests==2.23.0',
'ply',
'psutil',
'python-dateutil',
'pytz',
'PyYAML',
'pyzmq',
'setuptools',
... | true | true |
790d1f14d3c283e9a2c562fac9f050a8f233c75c | 2,965 | py | Python | qa/rpc-tests/test_framework/coverage.py | devilsan84/Devilcoin | cdb0e0c647ffc35113f3e42a06f99ce0e43f94ab | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/coverage.py | devilsan84/Devilcoin | cdb0e0c647ffc35113f3e42a06f99ce0e43f94ab | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/coverage.py | devilsan84/Devilcoin | cdb0e0c647ffc35113f3e42a06f99ce0e43f94ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The BitCore Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
This module contains utilities for doing coverage analysis on the RPC
interface.
It provides a way t... | 27.71028 | 79 | 0.660708 |
import os
REFERENCE_FILENAME = 'rpc_interface.txt'
class AuthServiceProxyWrapper(object):
def __init__(self, auth_service_proxy_instance, coverage_logfile=None):
self.auth_service_proxy_instance = auth_service_proxy_instance
self.coverage_logfile = coverage_logfile
def __getattr__(self... | true | true |
790d2055df1fbb87c99f2e8e1b90cb03dfa54398 | 1,279 | py | Python | tools/mo/openvino/tools/mo/front/tf/lrn_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2019-09-22T01:05:07.000Z | 2019-09-22T01:05:07.000Z | tools/mo/openvino/tools/mo/front/tf/lrn_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/openvino/tools/mo/front/tf/lrn_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2021-07-14T07:40:50.000Z | 2021-07-27T01:40:03.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.ops.lrn import AttributedLRN
class LRNExtractor(FrontExtractorOp):
"""
TF and IE(CAFFE) parameters in LRN differs in several places :
... | 39.96875 | 124 | 0.630962 |
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.ops.lrn import AttributedLRN
class LRNExtractor(FrontExtractorOp):
op = 'LRN'
enabled = True
@classmethod
def extract(cls, node):
pb = node.pb
AttributedLRN.update_node_stat(node, {
'a... | true | true |
790d21c79af84a7f25090e84dcdd8d931518d941 | 636 | py | Python | backend/manage.py | crowdbotics-apps/mobile-app-33660 | e59d5ffef0804b4ecd73c80e3ab186d77197f66d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/mobile-app-33660 | e59d5ffef0804b4ecd73c80e3ab186d77197f66d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/mobile-app-33660 | e59d5ffef0804b4ecd73c80e3ab186d77197f66d | [
"FTL",
"AML",
"RSA-MD"
] | 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', 'mobile_app_33660.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rai... | 28.909091 | 80 | 0.687107 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mobile_app_33660.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 an... | true | true |
790d21e4c0d1362d46fe167e54131980a0f98f84 | 1,100 | py | Python | services/migrations/0001_initial.py | KeoH/orchestrapi | 575e66a86c42b5c249fd943bb5f40c8c310139aa | [
"MIT"
] | 1 | 2021-07-05T19:37:37.000Z | 2021-07-05T19:37:37.000Z | services/migrations/0001_initial.py | KeoH/orchestrapi | 575e66a86c42b5c249fd943bb5f40c8c310139aa | [
"MIT"
] | 6 | 2020-06-05T19:30:52.000Z | 2021-07-05T19:28:53.000Z | services/migrations/0001_initial.py | KeoH/orchestrapi | 575e66a86c42b5c249fd943bb5f40c8c310139aa | [
"MIT"
] | 1 | 2020-05-15T23:58:24.000Z | 2020-05-15T23:58:24.000Z | # Generated by Django 2.1.3 on 2019-01-07 17:44
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import services.models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 33.333333 | 123 | 0.606364 |
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import services.models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Service',
fields=[
... | true | true |
790d22b68a1443e45ca84b0f533cf1ee3bbd8e1c | 804 | py | Python | res/manage.py | onap/vfc-gvnfm-vnfres | 2ff32469650ac5b6dc6b65d99cc27f3f7aab4161 | [
"Apache-2.0"
] | 1 | 2021-10-15T15:26:31.000Z | 2021-10-15T15:26:31.000Z | res/manage.py | onap/vfc-gvnfm-vnfres | 2ff32469650ac5b6dc6b65d99cc27f3f7aab4161 | [
"Apache-2.0"
] | null | null | null | res/manage.py | onap/vfc-gvnfm-vnfres | 2ff32469650ac5b6dc6b65d99cc27f3f7aab4161 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.956522 | 74 | 0.767413 |
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "res.settings")
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
790d23d902c426a29b4ab649a9e20f68721cacc7 | 6,254 | py | Python | PaddleRec/gnn/train.py | heavengate/models | f05c910f8a8e3105de8c2f1d81e83ca00d2c7ec7 | [
"Apache-2.0"
] | 2 | 2021-06-11T06:48:20.000Z | 2021-09-02T10:23:07.000Z | PaddleRec/gnn/train.py | heavengate/models | f05c910f8a8e3105de8c2f1d81e83ca00d2c7ec7 | [
"Apache-2.0"
] | null | null | null | PaddleRec/gnn/train.py | heavengate/models | f05c910f8a8e3105de8c2f1d81e83ca00d2c7ec7 | [
"Apache-2.0"
] | 1 | 2019-08-27T11:19:09.000Z | 2019-08-27T11:19:09.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... | 35.942529 | 108 | 0.633674 |
import numpy as np
import os
from functools import partial
import logging
import time
import paddle
import paddle.fluid as fluid
import argparse
import network
import reader
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger("fluid")
logger.setLevel(logging... | true | true |
790d23e406815d4ab43ab292998c7832ebe46b4e | 3,751 | py | Python | examples/r2021_arxiv_qcase_benzyne/_instruct_22.py | damazz/HQCA | b013ba68f86e42350913c4abc2e1c91695a429b7 | [
"Apache-2.0"
] | null | null | null | examples/r2021_arxiv_qcase_benzyne/_instruct_22.py | damazz/HQCA | b013ba68f86e42350913c4abc2e1c91695a429b7 | [
"Apache-2.0"
] | null | null | null | examples/r2021_arxiv_qcase_benzyne/_instruct_22.py | damazz/HQCA | b013ba68f86e42350913c4abc2e1c91695a429b7 | [
"Apache-2.0"
] | 1 | 2021-08-10T00:20:09.000Z | 2021-08-10T00:20:09.000Z | import numpy as np
from hqca.core import *
from hqca.core.primitives import *
from hqca.tools import *
import sys
from numpy import sin as sin
from numpy import cos as cos
from copy import deepcopy as copy
class ExpPauli:
def __init__(self,vec):
v = np.asmatrix(vec)
if v.shape[0]>v.shape[1]:
... | 29.304688 | 68 | 0.466276 | import numpy as np
from hqca.core import *
from hqca.core.primitives import *
from hqca.tools import *
import sys
from numpy import sin as sin
from numpy import cos as cos
from copy import deepcopy as copy
class ExpPauli:
def __init__(self,vec):
v = np.asmatrix(vec)
if v.shape[0]>v.shape[1]:
... | true | true |
790d24e0781c70bc08d858d534ed2912997e3f80 | 6,626 | py | Python | peering_manager/settings.py | amtypaldos/peering-manager | a5a90f108849874e9acaa6827552535fa250a60e | [
"Apache-2.0"
] | null | null | null | peering_manager/settings.py | amtypaldos/peering-manager | a5a90f108849874e9acaa6827552535fa250a60e | [
"Apache-2.0"
] | null | null | null | peering_manager/settings.py | amtypaldos/peering-manager | a5a90f108849874e9acaa6827552535fa250a60e | [
"Apache-2.0"
] | null | null | null | # DO NOT EDIT THIS FILE!
#
# All configuration must be done in the `configuration.py` file.
# This file is part of the Peering Manager code and it will be overwritten with
# every code releases.
from __future__ import unicode_literals
import os
import socket
from django.contrib.messages import constants as messages
... | 28.195745 | 156 | 0.641111 |
from __future__ import unicode_literals
import os
import socket
from django.contrib.messages import constants as messages
from django.core.exceptions import ImproperlyConfigured
try:
from peering_manager import configuration
except ImportError:
raise ImproperlyConfigured(
'Configuration file is... | true | true |
790d24f66d9342c25b00bbbfdaf5613e710a751d | 58,754 | py | Python | tests/modeladmin/tests.py | vincepandolfo/django | 67cf5efa31acb2916034afb15610b700695dfcb0 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-01-11T06:27:15.000Z | 2017-01-11T06:27:15.000Z | tests/modeladmin/tests.py | vincepandolfo/django | 67cf5efa31acb2916034afb15610b700695dfcb0 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/modeladmin/tests.py | vincepandolfo/django | 67cf5efa31acb2916034afb15610b700695dfcb0 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from datetime import date
from django import forms
from django.contrib.admin import BooleanFieldListFilter, SimpleListFilter
from django.contrib.admin.options import (
HORIZONTAL, VERTICAL, ModelAdmin, TabularInline,
)
from django.contrib.admin.sites import AdminSite
from d... | 34.480047 | 116 | 0.622187 | from __future__ import unicode_literals
from datetime import date
from django import forms
from django.contrib.admin import BooleanFieldListFilter, SimpleListFilter
from django.contrib.admin.options import (
HORIZONTAL, VERTICAL, ModelAdmin, TabularInline,
)
from django.contrib.admin.sites import AdminSite
from d... | true | true |
790d25019235ab96857803e36b00ae9a3404355e | 2,159 | py | Python | documentstore_migracao/utils/extract_isis.py | patymori/document-store-migracao | 1320ef58de1484ca8383c29c1fea55c4b2d89e67 | [
"BSD-2-Clause"
] | 1 | 2019-11-21T12:35:36.000Z | 2019-11-21T12:35:36.000Z | documentstore_migracao/utils/extract_isis.py | patymori/document-store-migracao | 1320ef58de1484ca8383c29c1fea55c4b2d89e67 | [
"BSD-2-Clause"
] | 336 | 2019-04-01T14:06:37.000Z | 2022-03-21T22:16:55.000Z | documentstore_migracao/utils/extract_isis.py | patymori/document-store-migracao | 1320ef58de1484ca8383c29c1fea55c4b2d89e67 | [
"BSD-2-Clause"
] | 4 | 2019-03-28T13:32:04.000Z | 2020-04-17T18:03:19.000Z | import os
import logging
import json
from typing import Union, Dict, List
from documentstore_migracao.utils.isis2json import isis2json
logger = logging.getLogger(__name__)
class OutputContainer:
"""Classe que mimetiza a escrita de arquivos para a escrita em uma estrutura
de lista. Cada linha em um arquivo r... | 25.104651 | 82 | 0.633164 | import os
import logging
import json
from typing import Union, Dict, List
from documentstore_migracao.utils.isis2json import isis2json
logger = logging.getLogger(__name__)
class OutputContainer:
def __init__(self):
self._lines = []
def write(self, string: str) -> None:
try:
_st... | true | true |
790d254d2661f4cf5efcb99dab0345b6c649a88b | 4,350 | py | Python | torchvision/prototype/models/video/resnet.py | brianjo/vision | a8bde78130fd8c956780d85693d0f51912013732 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T14:11:12.000Z | 2022-03-08T14:11:12.000Z | torchvision/prototype/models/video/resnet.py | brianjo/vision | a8bde78130fd8c956780d85693d0f51912013732 | [
"BSD-3-Clause"
] | null | null | null | torchvision/prototype/models/video/resnet.py | brianjo/vision | a8bde78130fd8c956780d85693d0f51912013732 | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
from typing import Any, Callable, List, Optional, Sequence, Type, Union
from torch import nn
from torchvision.prototype.transforms import VideoClassificationEval
from torchvision.transforms.functional import InterpolationMode
from ....models.video.resnet import (
BasicBlock,
Basi... | 28.431373 | 119 | 0.644828 | from functools import partial
from typing import Any, Callable, List, Optional, Sequence, Type, Union
from torch import nn
from torchvision.prototype.transforms import VideoClassificationEval
from torchvision.transforms.functional import InterpolationMode
from ....models.video.resnet import (
BasicBlock,
Basi... | true | true |
790d2568757ada99e9c2e6d240a3c520fa2886d3 | 3,561 | py | Python | tests/utils.py | Neilblaze/websockets | c39268c4867e41d11c20f7859583761d52a04012 | [
"BSD-3-Clause"
] | 1 | 2021-03-04T06:10:30.000Z | 2021-03-04T06:10:30.000Z | tests/utils.py | Neilblaze/websockets | c39268c4867e41d11c20f7859583761d52a04012 | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | Neilblaze/websockets | c39268c4867e41d11c20f7859583761d52a04012 | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import contextlib
import email.utils
import functools
import logging
import os
import time
import unittest
DATE = email.utils.formatdate(usegmt=True)
class GeneratorTestCase(unittest.TestCase):
def assertGeneratorRunning(self, gen):
"""
Check that a generator-based coroutine hasn'... | 30.698276 | 79 | 0.663016 | import asyncio
import contextlib
import email.utils
import functools
import logging
import os
import time
import unittest
DATE = email.utils.formatdate(usegmt=True)
class GeneratorTestCase(unittest.TestCase):
def assertGeneratorRunning(self, gen):
next(gen)
def assertGeneratorReturns(self, gen):
... | true | true |
790d258c90c95ae815827212a0fd1da8191e3ca9 | 1,103 | py | Python | tests/test_clients/test_methods/test_errors/test_chat_not_found.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | tests/test_clients/test_methods/test_errors/test_chat_not_found.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | tests/test_clients/test_methods/test_errors/test_chat_not_found.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | import uuid
from http import HTTPStatus
import pytest
from botx.clients.methods.errors.chat_not_found import (
ChatNotFoundData,
ChatNotFoundError,
)
from botx.clients.methods.v3.chats.add_user import AddUser
from botx.concurrency import callable_to_coroutine
pytestmark = pytest.mark.asyncio
pytest_plugins =... | 26.902439 | 80 | 0.682684 | import uuid
from http import HTTPStatus
import pytest
from botx.clients.methods.errors.chat_not_found import (
ChatNotFoundData,
ChatNotFoundError,
)
from botx.clients.methods.v3.chats.add_user import AddUser
from botx.concurrency import callable_to_coroutine
pytestmark = pytest.mark.asyncio
pytest_plugins =... | true | true |
790d265552193003b0d3b4ace357dfe4ec873f3b | 786 | py | Python | 328-odd-even-linked-list/328-odd-even-linked-list.py | MayaScarlet/leetcode-python | 8ef0c5cadf2e975957085c0ef84a8c3d90a64b6a | [
"MIT"
] | null | null | null | 328-odd-even-linked-list/328-odd-even-linked-list.py | MayaScarlet/leetcode-python | 8ef0c5cadf2e975957085c0ef84a8c3d90a64b6a | [
"MIT"
] | null | null | null | 328-odd-even-linked-list/328-odd-even-linked-list.py | MayaScarlet/leetcode-python | 8ef0c5cadf2e975957085c0ef84a8c3d90a64b6a | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def oddEvenList(self, head: Optional[ListNode]) -> Optional[ListNode]:
if head is None:
return None
odd, even = ... | 27.103448 | 74 | 0.493639 |
class Solution:
def oddEvenList(self, head: Optional[ListNode]) -> Optional[ListNode]:
if head is None:
return None
odd, even = ListNode(), ListNode()
oddTail, evenTail = odd, even
count = 0
while head:
if count % 2 == 0:
... | true | true |
790d26ec5256f531073248f670b34a1c813b6507 | 2,260 | py | Python | sha2/py_sha256.py | ryos36/polyphony-tutorial | 8937f2b8e8136c3b5d55b2a6be6e8b6ab35b04e7 | [
"MIT"
] | 4 | 2018-05-04T01:08:49.000Z | 2021-01-21T07:09:00.000Z | sha2/py_sha256.py | ryos36/polyphony-tutorial | 8937f2b8e8136c3b5d55b2a6be6e8b6ab35b04e7 | [
"MIT"
] | null | null | null | sha2/py_sha256.py | ryos36/polyphony-tutorial | 8937f2b8e8136c3b5d55b2a6be6e8b6ab35b04e7 | [
"MIT"
] | 1 | 2020-06-02T08:41:54.000Z | 2020-06-02T08:41:54.000Z | _k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988... | 28.974359 | 60 | 0.553097 | _k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988... | true | true |
790d277cc871ed756813e2f1a58586fb075984d4 | 818 | py | Python | races/__init__.py | Belvarm/roguelike-tutorial | ea989c080b0f7dd61c38b5719ab8e502a45a0489 | [
"MIT"
] | null | null | null | races/__init__.py | Belvarm/roguelike-tutorial | ea989c080b0f7dd61c38b5719ab8e502a45a0489 | [
"MIT"
] | null | null | null | races/__init__.py | Belvarm/roguelike-tutorial | ea989c080b0f7dd61c38b5719ab8e502a45a0489 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Optional, Type, TYPE_CHECKING
import actor
from actions.ai import BasicMonster
import graphic
from inventory import Inventory
if TYPE_CHECKING:
from actions import Action
from location import Location
class Fighter(graphic.Graphic):
render_order = ... | 22.722222 | 70 | 0.683374 | from __future__ import annotations
from typing import Optional, Type, TYPE_CHECKING
import actor
from actions.ai import BasicMonster
import graphic
from inventory import Inventory
if TYPE_CHECKING:
from actions import Action
from location import Location
class Fighter(graphic.Graphic):
render_order = ... | true | true |
790d27f2700d35a73d7e035fce8a5923c6d24964 | 10,877 | py | Python | py/update_nginx_vhosts.py | bcoding/docker-host-scripts | edfb516266a991abf37b56e5e537ac9e93a6de26 | [
"Unlicense"
] | null | null | null | py/update_nginx_vhosts.py | bcoding/docker-host-scripts | edfb516266a991abf37b56e5e537ac9e93a6de26 | [
"Unlicense"
] | null | null | null | py/update_nginx_vhosts.py | bcoding/docker-host-scripts | edfb516266a991abf37b56e5e537ac9e93a6de26 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import common
import json
import docker_utils
nginx_sites_available = '/etc/nginx/sites-available'
CERT_DIR = '/root/certs'
import subprocess
def create_certificates(domains):
format_args = {'cert_dir': CERT_DIR}
import os.path
if not os.path.isfile(os.path.join(CERT_DIR, 'acmeCA.... | 38.708185 | 341 | 0.558886 |
import common
import json
import docker_utils
nginx_sites_available = '/etc/nginx/sites-available'
CERT_DIR = '/root/certs'
import subprocess
def create_certificates(domains):
format_args = {'cert_dir': CERT_DIR}
import os.path
if not os.path.isfile(os.path.join(CERT_DIR, 'acmeCA.key.deleteme')):
... | false | true |
790d281d9a6890459a8ef59f90819d90a838ec71 | 773 | py | Python | do-word-vector-model.py | mathieu-lacage/sophiaconf2018 | f4aa1f8fd6a0ba463a03335d9525e9194d94b0e3 | [
"MIT"
] | 1 | 2018-07-11T22:01:21.000Z | 2018-07-11T22:01:21.000Z | do-word-vector-model.py | mathieu-lacage/sophiaconf2018 | f4aa1f8fd6a0ba463a03335d9525e9194d94b0e3 | [
"MIT"
] | null | null | null | do-word-vector-model.py | mathieu-lacage/sophiaconf2018 | f4aa1f8fd6a0ba463a03335d9525e9194d94b0e3 | [
"MIT"
] | null | null | null | import optparse
import Utils
import gensim
def main():
parser = optparse.OptionParser()
parser.add_option('-d', '--dataset', default='sample')
parser.add_option('--size', default=300, type='int', help='vectors dimension. Default: %default')
parser.add_option('--window', default=5, type='int', help='wi... | 38.65 | 136 | 0.702458 | import optparse
import Utils
import gensim
def main():
parser = optparse.OptionParser()
parser.add_option('-d', '--dataset', default='sample')
parser.add_option('--size', default=300, type='int', help='vectors dimension. Default: %default')
parser.add_option('--window', default=5, type='int', help='wi... | true | true |
790d284d75eff85f735c2212c566822f71310c99 | 1,981 | py | Python | ooobuild/lo/form/x_positioning_listener.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/form/x_positioning_listener.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/form/x_positioning_listener.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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.377358 | 197 | 0.746593 |
import typing
from abc import abstractmethod
from ..lang.x_event_listener import XEventListener as XEventListener_c7230c4a
if typing.TYPE_CHECKING:
from ..lang.event_object import EventObject as EventObject_a3d70b03
class XPositioningListener(XEventListener_c7230c4a):
__ooo_ns__: str = 'com... | true | true |
790d28571a496b84aac1533406d3da1d53904569 | 6,878 | py | Python | docs/source/conf.py | cselab/CubismNova | cbd6876ae9b5864f82f3470b564132c92e0f2e00 | [
"BSD-2-Clause"
] | 9 | 2020-01-27T01:17:19.000Z | 2022-02-26T12:20:17.000Z | docs/source/conf.py | cselab/CubismNova | cbd6876ae9b5864f82f3470b564132c92e0f2e00 | [
"BSD-2-Clause"
] | null | null | null | docs/source/conf.py | cselab/CubismNova | cbd6876ae9b5864f82f3470b564132c92e0f2e00 | [
"BSD-2-Clause"
] | 1 | 2021-04-01T07:48:39.000Z | 2021-04-01T07:48:39.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.034934 | 79 | 0.664728 |
import re
import sphinx_rtd_theme
import subprocess as sp
project = 'CubismNova'
copyright = 'ETH Zurich'
author = 'Fabian Wermelinger'
sp.run('(cd .. && doxygen)', shell=True)
v = str(sp.check_output('git describe --abbrev=0', shell=True))
version = '.'.join(v.split('.')[:2])
release = v
... | true | true |
790d294ef329695d1bf4f217ad39e15c34ee8dc8 | 3,406 | py | Python | win32com/test/testStorage.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | 3 | 2016-11-24T03:57:22.000Z | 2019-02-27T15:19:50.000Z | Lib/site-packages/win32com/test/testStorage.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | 67 | 2016-10-19T01:23:47.000Z | 2016-12-14T04:30:38.000Z | Lib/site-packages/win32com/test/testStorage.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | 4 | 2021-02-11T03:51:39.000Z | 2021-02-12T05:10:43.000Z | from win32com import storagecon
import pythoncom, os, win32api
import win32com.test.util
import unittest
class TestEnum(win32com.test.util.TestCase):
def testit(self):
fname, tmp = win32api.GetTempFileName(win32api.GetTempPath(),'stg')
m=storagecon.STGM_READWRITE | storagecon.STGM_SHARE_E... | 54.935484 | 167 | 0.644745 | from win32com import storagecon
import pythoncom, os, win32api
import win32com.test.util
import unittest
class TestEnum(win32com.test.util.TestCase):
def testit(self):
fname, tmp = win32api.GetTempFileName(win32api.GetTempPath(),'stg')
m=storagecon.STGM_READWRITE | storagecon.STGM_SHARE_E... | true | true |
790d297231d8844da46107086b521371549c91af | 531 | py | Python | ccal/make_reflecting_grid.py | alex-wenzel/ccal | 74dfc604d93e6ce9e12f34a828b601618df51faa | [
"MIT"
] | null | null | null | ccal/make_reflecting_grid.py | alex-wenzel/ccal | 74dfc604d93e6ce9e12f34a828b601618df51faa | [
"MIT"
] | null | null | null | ccal/make_reflecting_grid.py | alex-wenzel/ccal | 74dfc604d93e6ce9e12f34a828b601618df51faa | [
"MIT"
] | null | null | null | from .check_nd_array_for_bad import check_nd_array_for_bad
def make_reflecting_grid(grid, reflecting_grid_value, raise_for_bad=True):
check_nd_array_for_bad(grid, raise_for_bad=raise_for_bad)
reflecting_grid = grid.copy()
for i, grid_value in enumerate(reflecting_grid):
if grid_value < reflect... | 25.285714 | 74 | 0.730697 | from .check_nd_array_for_bad import check_nd_array_for_bad
def make_reflecting_grid(grid, reflecting_grid_value, raise_for_bad=True):
check_nd_array_for_bad(grid, raise_for_bad=raise_for_bad)
reflecting_grid = grid.copy()
for i, grid_value in enumerate(reflecting_grid):
if grid_value < reflect... | true | true |
790d2988fdeebf0e2f1b10f4c63a81871e7ee883 | 17,901 | py | Python | sdk/python/pulumi_alicloud/bastionhost/host_group_account_user_group_attachment.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 42 | 2019-03-18T06:34:37.000Z | 2022-03-24T07:08:57.000Z | sdk/python/pulumi_alicloud/bastionhost/host_group_account_user_group_attachment.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 152 | 2019-04-15T21:03:44.000Z | 2022-03-29T18:00:57.000Z | sdk/python/pulumi_alicloud/bastionhost/host_group_account_user_group_attachment.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2020-08-26T17:30:07.000Z | 2021-07-05T01:37:45.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 46.496104 | 171 | 0.669572 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['HostGroupAccountUserGroupAttachmentArgs', 'HostGroupAccountUserGroupAttachment']
@pulumi.input_type
class HostGroupAccountUserGroupAttachmentArgs:
def ... | true | true |
790d29c307d811537cc3f4315ef145e0729785ce | 1,380 | py | Python | buildtools/test_examples.py | loicgasser/ngeo | 03a9376d281f9b4bff8a4b572ad73ef5a8df41f3 | [
"MIT"
] | 17 | 2015-01-14T08:40:22.000Z | 2021-05-08T04:39:50.000Z | buildtools/test_examples.py | haoyunZhou/ngeo | 340ca60786470f10cf2d9e5c69c203af1589040c | [
"MIT"
] | 1,477 | 2015-01-05T09:58:41.000Z | 2022-03-18T11:07:09.000Z | buildtools/test_examples.py | haoyunZhou/ngeo | 340ca60786470f10cf2d9e5c69c203af1589040c | [
"MIT"
] | 14 | 2015-07-24T07:33:13.000Z | 2021-03-02T13:51:48.000Z | #!/usr/bin/python
import re
import sys
import glob
import subprocess
BLACKLIST = [
"googlestreetview"
]
def main():
if len(sys.argv) > 1:
split_current, split_number = (int(v) for v in sys.argv[1].split("/"))
split_current = split_current - 1
else:
split_current, split_number = ... | 31.363636 | 114 | 0.603623 |
import re
import sys
import glob
import subprocess
BLACKLIST = [
"googlestreetview"
]
def main():
if len(sys.argv) > 1:
split_current, split_number = (int(v) for v in sys.argv[1].split("/"))
split_current = split_current - 1
else:
split_current, split_number = (0, 1)
return... | true | true |
790d2b638700d84286592446f58d247ce9a6ad3d | 1,369 | py | Python | test/experiments/bench.py | aleyooop/realm-core | 9874d5164927ea39273b241a5af14b596a3233e9 | [
"Apache-2.0"
] | 977 | 2016-09-27T12:54:24.000Z | 2022-03-29T08:08:47.000Z | test/experiments/bench.py | aleyooop/realm-core | 9874d5164927ea39273b241a5af14b596a3233e9 | [
"Apache-2.0"
] | 2,265 | 2016-09-27T13:01:26.000Z | 2022-03-31T17:55:37.000Z | test/experiments/bench.py | aleyooop/realm-core | 9874d5164927ea39273b241a5af14b596a3233e9 | [
"Apache-2.0"
] | 154 | 2016-09-27T14:02:56.000Z | 2022-03-27T14:51:00.000Z | import subprocess
subprocess.call(["/usr/bin/python", "innotest.py"])
print "1-0"
subprocess.call(["/usr/bin/time","-v","-otiming", "./innotest", "0", "1", "0"])
print "4-0"
subprocess.call(["/usr/bin/time","-v","-otiming","--append","./innotest", "0", "4", "0"])
print "8-0"
subprocess.call(["/usr/bin/tim... | 44.16129 | 95 | 0.569759 | import subprocess
subprocess.call(["/usr/bin/python", "innotest.py"])
print "1-0"
subprocess.call(["/usr/bin/time","-v","-otiming", "./innotest", "0", "1", "0"])
print "4-0"
subprocess.call(["/usr/bin/time","-v","-otiming","--append","./innotest", "0", "4", "0"])
print "8-0"
subprocess.call(["/usr/bin/tim... | false | true |
790d2bbb0ec468df2b33e0107eed7a3f93190796 | 1,330 | py | Python | locate.py | jdnietov/wazeReading | 2b4567d7d32ba260d462ab95e1424f6d92090c17 | [
"MIT"
] | 2 | 2020-06-09T12:15:08.000Z | 2020-10-03T07:37:31.000Z | locate.py | jdnietov/wazeReading | 2b4567d7d32ba260d462ab95e1424f6d92090c17 | [
"MIT"
] | null | null | null | locate.py | jdnietov/wazeReading | 2b4567d7d32ba260d462ab95e1424f6d92090c17 | [
"MIT"
] | null | null | null | """This module takes the data.log file produced by main.cpp and
fetches Bogota's addresses based on the coordinates in the file.
TODO: check if system has requirements - if not, install them
* requests
* subprocess (upcoming)
TODO: include exact time of match
TODO: progress bar
FIXME: select best from multiple addres... | 24.62963 | 86 | 0.630827 |
import requests
GOOGLE_MAPS_API_URL = 'http://maps.googleapis.com/maps/api/geocode/json'
LOGNAME = "data-wr.log"
DATANAME = "data-wr-addr.log"
def main():
logfile = open(LOGNAME, "r")
datafile = open(DATANAME, "w")
logfile.readline()
print("fetching addresses...")
line = logfile.readline()... | true | true |
790d2df7fcda33af8f8f131cae867deb7bb8f242 | 792 | py | Python | useful_scripts/split.py | UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data | 84b3c792fcea5c618737855cd0d65c7b7b6e16f6 | [
"MIT"
] | 6 | 2021-03-04T06:16:55.000Z | 2022-01-11T07:12:16.000Z | useful_scripts/split.py | UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data | 84b3c792fcea5c618737855cd0d65c7b7b6e16f6 | [
"MIT"
] | null | null | null | useful_scripts/split.py | UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data | 84b3c792fcea5c618737855cd0d65c7b7b6e16f6 | [
"MIT"
] | 2 | 2021-04-07T01:43:19.000Z | 2021-12-06T14:47:36.000Z | import os
import shutil
#for i in range(8050,8051):
# old=str(i) + '.bin'
# new="../new/"+'%06d.bin' % i
# shutil.move(old,new)
file1 = open('a.txt', 'r')
Lines = file1.readlines()
file2 = open('b.txt', 'r')
Lines2 = file2.readlines()
calib_DIR='./calib/'
img_DIR='./image_2/'
label_DIR='./label_2/'
pcl_... | 26.4 | 72 | 0.655303 | import os
import shutil
file1 = open('a.txt', 'r')
Lines = file1.readlines()
file2 = open('b.txt', 'r')
Lines2 = file2.readlines()
calib_DIR='./calib/'
img_DIR='./image_2/'
label_DIR='./label_2/'
pcl_DIR='./velodyne/'
for line in Lines2:
line=line.rstrip()
print(line)
pcl_fname=line+'.bin'
... | true | true |
790d2ed14bdd402028a265d0e74f8c436e448b5c | 4,659 | py | Python | examples/versioned_rows/versioned_rows_w_versionid.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 2 | 2021-08-31T14:37:34.000Z | 2021-11-17T14:09:59.000Z | examples/versioned_rows/versioned_rows_w_versionid.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 1 | 2021-01-25T09:53:34.000Z | 2021-01-25T09:53:35.000Z | examples/versioned_rows/versioned_rows_w_versionid.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 2 | 2021-01-10T10:49:52.000Z | 2021-01-13T09:34:27.000Z | """Illustrates a method to intercept changes on objects, turning
an UPDATE statement on a single row into an INSERT statement, so that a new
row is inserted with the new data, keeping the old row intact.
This example adds a numerical version_id to the Versioned class as well
as the ability to see which row is the most... | 26.322034 | 78 | 0.683408 | from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import event
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy.ext.declarativ... | true | true |
790d305c4c82dbbdb373cbd1da0b2ee0f0a34716 | 964 | py | Python | genestack_client/unaligned_reads.py | genestack/python-client | 083eb0508dc99c7575ba7f115595f2535f007583 | [
"MIT"
] | 2 | 2017-08-30T22:32:59.000Z | 2021-07-20T10:08:23.000Z | genestack_client/unaligned_reads.py | genestack/python-client | 083eb0508dc99c7575ba7f115595f2535f007583 | [
"MIT"
] | 58 | 2015-10-19T08:36:00.000Z | 2020-12-07T13:48:17.000Z | genestack_client/unaligned_reads.py | genestack/python-client | 083eb0508dc99c7575ba7f115595f2535f007583 | [
"MIT"
] | 6 | 2015-10-21T21:43:45.000Z | 2021-01-06T20:33:53.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import *
from builtins import object
READS_LOCATION = 'genest... | 21.422222 | 54 | 0.698133 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import *
from builtins import object
READS_LOCATION = 'genestack.location:reads'
REA... | true | true |
790d30a5ac77cee86f9c0feb7e0f532a8157e19e | 4,447 | py | Python | zdb/drawing/generate_html.py | shane-breeze/zdb-analysis | d00b154368e0bcde6a2415727d8ba7012521fba1 | [
"MIT"
] | null | null | null | zdb/drawing/generate_html.py | shane-breeze/zdb-analysis | d00b154368e0bcde6a2415727d8ba7012521fba1 | [
"MIT"
] | 2 | 2019-04-22T15:11:38.000Z | 2019-10-28T14:35:17.000Z | zdb/drawing/generate_html.py | shane-breeze/zdb-analysis | d00b154368e0bcde6a2415727d8ba7012521fba1 | [
"MIT"
] | null | null | null | import os
from dominate import document
import dominate.tags as tags
import shlex
import subprocess as sp
from tqdm.auto import tqdm
style = (
"""
#myInput {
background-image: url('/css/searchicon.png'); /* Add a search icon to input */
background-position: 10px 12px; /* Position the search icon */
background-re... | 32.224638 | 98 | 0.54756 | import os
from dominate import document
import dominate.tags as tags
import shlex
import subprocess as sp
from tqdm.auto import tqdm
style = (
"""
#myInput {
background-image: url('/css/searchicon.png'); /* Add a search icon to input */
background-position: 10px 12px; /* Position the search icon */
background-re... | true | true |
790d325de15e853276794af0de33ed55b12ea191 | 26,410 | py | Python | simulator_control/simulator_util.py | izinga/xctestrunner | 799193e6ff1ce2feafe5077c3a4155760f5f723a | [
"Apache-2.0"
] | 1 | 2019-12-21T00:07:00.000Z | 2019-12-21T00:07:00.000Z | simulator_control/simulator_util.py | ios-bazel-users/xctestrunner | 5c2d20ab829efc18dfc507269820c7a0609187b7 | [
"Apache-2.0"
] | null | null | null | simulator_control/simulator_util.py | ios-bazel-users/xctestrunner | 5c2d20ab829efc18dfc507269820c7a0609187b7 | [
"Apache-2.0"
] | 1 | 2021-11-23T05:00:00.000Z | 2021-11-23T05:00:00.000Z | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 38.611111 | 80 | 0.699356 |
import json
import logging
import os
import pwd
import re
import shutil
import subprocess
import time
from shared import ios_constants
from shared import ios_errors
from shared import plist_util
from shared import xcode_info_util
from simulator_control import simtype_profile
_SIMULATOR_STATES_MAPPING =... | true | true |
790d325e7f78793db587c57e262cb3e64ce06a05 | 3,277 | py | Python | src/rosrepo/cmd_clean.py | fkie/rosrepo | 13cdf89e32f0c370d106a61540b0cd102675daf9 | [
"Apache-2.0"
] | 5 | 2016-09-06T08:02:10.000Z | 2018-06-10T20:45:21.000Z | src/rosrepo/cmd_clean.py | fkie/rosrepo | 13cdf89e32f0c370d106a61540b0cd102675daf9 | [
"Apache-2.0"
] | 2 | 2019-03-11T21:44:50.000Z | 2020-03-17T09:20:47.000Z | src/rosrepo/cmd_clean.py | fkie/rosrepo | 13cdf89e32f0c370d106a61540b0cd102675daf9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: Timo Röhling
#
# Copyright 2016 Fraunhofer FKIE
#
# 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 a... | 39.481928 | 131 | 0.676533 |
from .workspace import get_workspace_location, get_workspace_state, resolve_this, find_ros_root
from .config import Config
from .cache import Cache
from .ui import msg, warning, fatal, show_conflicts
from .util import call_process, PIPE
from .resolver import find_dependees
import os
try:
from ... | true | true |
790d332218d7579e252524bfddb5c57cef5aeced | 5,527 | py | Python | mtgjson5/compiled_classes/mtgjson_enum_values.py | 0az/mtgjson | 64e4e0a452911418e608df932fbf12af5dcb1a35 | [
"MIT"
] | null | null | null | mtgjson5/compiled_classes/mtgjson_enum_values.py | 0az/mtgjson | 64e4e0a452911418e608df932fbf12af5dcb1a35 | [
"MIT"
] | null | null | null | mtgjson5/compiled_classes/mtgjson_enum_values.py | 0az/mtgjson | 64e4e0a452911418e608df932fbf12af5dcb1a35 | [
"MIT"
] | null | null | null | """
MTGJSON EnumValues Object
"""
import json
import logging
import pathlib
from typing import Any, Dict, List, Union
from ..compiled_classes.mtgjson_all_printings import MtgjsonAllPrintingsObject
from ..consts import OUTPUT_PATH
from ..utils import sort_internal_lists
from .mtgjson_structures import MtgjsonStructures... | 35.658065 | 87 | 0.564502 | import json
import logging
import pathlib
from typing import Any, Dict, List, Union
from ..compiled_classes.mtgjson_all_printings import MtgjsonAllPrintingsObject
from ..consts import OUTPUT_PATH
from ..utils import sort_internal_lists
from .mtgjson_structures import MtgjsonStructuresObject
LOGGER = logging.getLogger... | true | true |
790d33e0ea2fbbf035d535622ae8ec9f4d3c9764 | 2,745 | py | Python | 01_Introduction/C0106_operations.py | zhuyuanxiang/tensorflow_cookbook | 57d7ee719385ddd249a67c3a85bd336e884a67e5 | [
"MIT"
] | 7 | 2019-11-30T05:42:47.000Z | 2021-10-09T03:02:19.000Z | 01_Introduction/C0106_operations.py | zhuyuanxiang/tensorflow_cookbook | 57d7ee719385ddd249a67c3a85bd336e884a67e5 | [
"MIT"
] | null | null | null | 01_Introduction/C0106_operations.py | zhuyuanxiang/tensorflow_cookbook | 57d7ee719385ddd249a67c3a85bd336e884a67e5 | [
"MIT"
] | 2 | 2019-12-05T06:44:48.000Z | 2021-10-09T03:02:20.000Z | # -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : 526614962@qq.com
@site : https://github.com/zhuyuanxiang/tensorflow_cookbook
---------------------------
@Software : PyCharm
@Project : TensorFlow_Machine_Learning_Cookbook
@File : C0106_operations.py
@Version : v0.1... | 30.842697 | 99 | 0.637887 |
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import sklearn
import tensorflow as tf
import winsound
from tensorflow.python.framework import ops
from tools import show_values
np.set_printoptions(precision = 8, suppress = True, threshold = np.inf, linewidth = 200)
np.random.seed(42)
... | true | true |
790d34d501f0113b2f8b6c70872c3f6647520f89 | 36,551 | py | Python | repro_eval/Evaluator.py | irgroup/repro_eval | 35a4cf083dbb5f4b29d6ef602a604f0686a537c9 | [
"MIT"
] | 8 | 2020-10-27T02:11:53.000Z | 2022-03-02T11:00:10.000Z | repro_eval/Evaluator.py | irgroup/repro_eval | 35a4cf083dbb5f4b29d6ef602a604f0686a537c9 | [
"MIT"
] | 2 | 2021-01-25T19:59:39.000Z | 2021-12-07T09:29:01.000Z | repro_eval/Evaluator.py | irgroup/repro_eval | 35a4cf083dbb5f4b29d6ef602a604f0686a537c9 | [
"MIT"
] | 1 | 2021-04-16T16:21:16.000Z | 2021-04-16T16:21:16.000Z | import pytrec_eval
from repro_eval.util import trim, break_ties
from repro_eval.measure.statistics import ttest
from repro_eval.measure.overall_effects import ER, deltaRI
from repro_eval.measure.document_order import ktau_union as ktu, RBO
from repro_eval.measure.effectiveness import rmse as RMSE, nrmse as nRMSE
from r... | 59.723856 | 143 | 0.643019 | import pytrec_eval
from repro_eval.util import trim, break_ties
from repro_eval.measure.statistics import ttest
from repro_eval.measure.overall_effects import ER, deltaRI
from repro_eval.measure.document_order import ktau_union as ktu, RBO
from repro_eval.measure.effectiveness import rmse as RMSE, nrmse as nRMSE
from r... | true | true |
790d36e269dec80ce659412977caceb67a23b71f | 9,455 | py | Python | tests/unit/modules/test_boto_elb.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_boto_elb.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2017-07-10T21:44:39.000Z | 2017-07-10T21:44:39.000Z | tests/unit/modules/test_boto_elb.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | import logging
import os.path
from copy import deepcopy
import pkg_resources
import salt.config
import salt.loader
import salt.modules.boto_elb as boto_elb
import salt.utils.versions
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import T... | 38.279352 | 91 | 0.696563 | import logging
import os.path
from copy import deepcopy
import pkg_resources
import salt.config
import salt.loader
import salt.modules.boto_elb as boto_elb
import salt.utils.versions
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import T... | true | true |
790d374b8e55abde416cd25922fb73cbf1bcc3be | 174 | py | Python | bookworm/__init__.py | xingkong0113/bookworm | 7214067f48e7a951198806a1f9170e3fd8fc0cce | [
"MIT"
] | 36 | 2020-11-15T03:21:39.000Z | 2022-03-05T01:11:26.000Z | bookworm/__init__.py | xingkong0113/bookworm | 7214067f48e7a951198806a1f9170e3fd8fc0cce | [
"MIT"
] | 90 | 2020-10-06T14:46:07.000Z | 2022-03-31T03:03:34.000Z | bookworm/__init__.py | xingkong0113/bookworm | 7214067f48e7a951198806a1f9170e3fd8fc0cce | [
"MIT"
] | 20 | 2020-09-30T17:40:44.000Z | 2022-03-17T19:59:53.000Z | # coding: utf-8
import gettext
# Make the gettext function _() available in the global namespace, even if no i18n is in use
gettext.install("bookworm", names=["ngettext"])
| 24.857143 | 92 | 0.741379 |
import gettext
gettext.install("bookworm", names=["ngettext"])
| true | true |
790d383757ed9f0cd5efae16d455b27a87b825d9 | 1,368 | py | Python | farmblr/blog/migrations/0001_initial.py | Nemwel-Boniface/Farmblr | ca755e08a6510ef421bb6fd898b489a963831b56 | [
"MIT"
] | 3 | 2022-02-25T09:12:47.000Z | 2022-03-11T09:02:35.000Z | farmblr/blog/migrations/0001_initial.py | Nemwel-Boniface/Farmblr | ca755e08a6510ef421bb6fd898b489a963831b56 | [
"MIT"
] | null | null | null | farmblr/blog/migrations/0001_initial.py | Nemwel-Boniface/Farmblr | ca755e08a6510ef421bb6fd898b489a963831b56 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2021-10-12 22:38
import blog.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migr... | 38 | 134 | 0.590643 |
import blog.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Post',
... | true | true |
790d3874f140ed423064f140796a7dd6ee92cf5a | 5,769 | py | Python | mitsubishi_central_controller/CentralController.py | adgelbfish/mitsubishi-central-controller2 | 8767a3b24023d7c8b4148350139f78c91760b0cd | [
"MIT"
] | null | null | null | mitsubishi_central_controller/CentralController.py | adgelbfish/mitsubishi-central-controller2 | 8767a3b24023d7c8b4148350139f78c91760b0cd | [
"MIT"
] | null | null | null | mitsubishi_central_controller/CentralController.py | adgelbfish/mitsubishi-central-controller2 | 8767a3b24023d7c8b4148350139f78c91760b0cd | [
"MIT"
] | null | null | null | from mitsubishi_central_controller.util.ControllerDictBuilder import ControllerDictBuilder
import aiohttp
import asyncio
from mitsubishi_central_controller.util.dict_utils import get_group_list_from_dict, get_system_data_from_dict, \
get_single_bulk_from_dict, get_single_racsw_from_dict, get_single_energycontrol_f... | 44.72093 | 120 | 0.729243 | from mitsubishi_central_controller.util.ControllerDictBuilder import ControllerDictBuilder
import aiohttp
import asyncio
from mitsubishi_central_controller.util.dict_utils import get_group_list_from_dict, get_system_data_from_dict, \
get_single_bulk_from_dict, get_single_racsw_from_dict, get_single_energycontrol_f... | true | true |
790d388f4c350aca4588a6316cae497aee15325b | 1,004 | py | Python | shop/cascade/settings.py | haitwang-cloud/django-shop | 8ac767a42022d66d226c0bb342f16ac3df3ca30b | [
"BSD-3-Clause"
] | 2 | 2019-10-17T09:03:40.000Z | 2019-10-17T09:08:54.000Z | shop/cascade/settings.py | haitwang-cloud/django-shop | 8ac767a42022d66d226c0bb342f16ac3df3ca30b | [
"BSD-3-Clause"
] | 10 | 2020-06-05T19:26:54.000Z | 2022-03-11T23:33:14.000Z | shop/cascade/settings.py | haitwang-cloud/django-shop | 8ac767a42022d66d226c0bb342f16ac3df3ca30b | [
"BSD-3-Clause"
] | 1 | 2022-02-18T18:03:17.000Z | 2022-02-18T18:03:17.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from cmsplugin_cascade.extra_fields.config import PluginExtraFieldsConfig
CASCADE_PLUGINS = getattr(settings, 'SHOP_CASCADE_PLUGINS',
('auth', 'breadcrumb', 'catalog', 'cart', 'checkout', 'extensions', 'order', 'proc... | 38.615385 | 106 | 0.685259 |
from __future__ import unicode_literals
from django.conf import settings
from cmsplugin_cascade.extra_fields.config import PluginExtraFieldsConfig
CASCADE_PLUGINS = getattr(settings, 'SHOP_CASCADE_PLUGINS',
('auth', 'breadcrumb', 'catalog', 'cart', 'checkout', 'extensions', 'order', 'processbar', 'search',))
... | true | true |
790d389f0491ab6f0cebe2e02717a1e3689b0a1b | 2,368 | py | Python | csm_test_utils/message.py | opentelekomcloud-infra/csm-test-utils | ec3c4a6bf4d4806e76d0d8dfcfe024c39c9a0e36 | [
"Apache-2.0"
] | 1 | 2021-02-08T08:53:01.000Z | 2021-02-08T08:53:01.000Z | csm_test_utils/message.py | opentelekomcloud-infra/csm-test-utils | ec3c4a6bf4d4806e76d0d8dfcfe024c39c9a0e36 | [
"Apache-2.0"
] | 22 | 2019-10-21T15:10:14.000Z | 2021-04-07T07:27:20.000Z | csm_test_utils/message.py | opentelekomcloud-infra/csm-test-utils | ec3c4a6bf4d4806e76d0d8dfcfe024c39c9a0e36 | [
"Apache-2.0"
] | 1 | 2021-02-08T08:53:07.000Z | 2021-02-08T08:53:07.000Z | import datetime
import json
import logging
import socket
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
class Base(dict):
"""Base metric class"""
def __init__(
self,
name: str,
environment: str,
zone: str,
timestamp: str = None
):
supe... | 26.021978 | 71 | 0.559966 | import datetime
import json
import logging
import socket
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
class Base(dict):
def __init__(
self,
name: str,
environment: str,
zone: str,
timestamp: str = None
):
super().__init__()
self[... | true | true |
790d3924b5c67002e392f6b99b27e9fb61c158bd | 2,089 | py | Python | test/ProbePlacement_multi/parallel/optimization_setup.py | kant/GlennOPT | ca816c3708a2db5b98f8f1a7885305a8e18e179e | [
"NASA-1.3"
] | null | null | null | test/ProbePlacement_multi/parallel/optimization_setup.py | kant/GlennOPT | ca816c3708a2db5b98f8f1a7885305a8e18e179e | [
"NASA-1.3"
] | null | null | null | test/ProbePlacement_multi/parallel/optimization_setup.py | kant/GlennOPT | ca816c3708a2db5b98f8f1a7885305a8e18e179e | [
"NASA-1.3"
] | null | null | null | """
Simple, non parallel optimization set up example.
"""
import sys,os
sys.path.insert(0,'../../../')
from glennopt.base import Parameter
from glennopt.helpers import mutation_parameters, de_mutation_type
from glennopt.optimizers import NSGA3
from glennopt.DOE import Default,CCD,FullFactorial,LatinHyperCube
impor... | 33.693548 | 125 | 0.760651 | import sys,os
sys.path.insert(0,'../../../')
from glennopt.base import Parameter
from glennopt.helpers import mutation_parameters, de_mutation_type
from glennopt.optimizers import NSGA3
from glennopt.DOE import Default,CCD,FullFactorial,LatinHyperCube
import numpy as np
import os
doe = LatinHyperCube(samples=128,leve... | true | true |
790d39801728b257bdacbd05420a76bd70f11934 | 932 | py | Python | game.py | sabdllah/03-Text-adventure | ec6f6cdab29811dd77daff064a2748d9638a2667 | [
"MIT"
] | null | null | null | game.py | sabdllah/03-Text-adventure | ec6f6cdab29811dd77daff064a2748d9638a2667 | [
"MIT"
] | null | null | null | game.py | sabdllah/03-Text-adventure | ec6f6cdab29811dd77daff064a2748d9638a2667 | [
"MIT"
] | null | null | null | answer = input ("Would you like to play?")
if answer.lower().strip() == "yes":
print ("Yay! Let's get started.")
answer = input ("You have reached an apple tree, would you like to pick an apple?").lower ().strip()
if answer == "yes":
answer = input ("would you like to eat the apple?")
if ... | 33.285714 | 131 | 0.562232 | answer = input ("Would you like to play?")
if answer.lower().strip() == "yes":
print ("Yay! Let's get started.")
answer = input ("You have reached an apple tree, would you like to pick an apple?").lower ().strip()
if answer == "yes":
answer = input ("would you like to eat the apple?")
if ... | false | true |
790d39c6d35aec6c26cc29f9915c24a0804dafe8 | 409 | py | Python | Lib/test/test_distutils.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 953 | 2021-10-08T17:12:34.000Z | 2022-03-31T18:31:50.000Z | Lib/test/test_distutils.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 27 | 2021-10-13T20:54:09.000Z | 2022-03-27T14:41:13.000Z | Lib/test/test_distutils.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 42 | 2021-10-08T16:05:57.000Z | 2022-03-18T13:06:12.000Z | """Tests for distutils.
The tests for distutils are defined in the distutils.tests package;
the test_suite() function there returns a test suite that's ready to
be run.
"""
import distutils.tests
import test.support
def load_tests(*_):
# used by unittest
return distutils.tests.test_suite()
def tearDownMod... | 17.782609 | 68 | 0.731051 |
import distutils.tests
import test.support
def load_tests(*_):
return distutils.tests.test_suite()
def tearDownModule():
test.support.reap_children()
if __name__ == "__main__":
unittest.main()
| true | true |
790d3a5e0044f9cab6dfde7bd011d2a2d79f547a | 3,135 | py | Python | Django/session_words/session_words/settings.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | null | null | null | Django/session_words/session_words/settings.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | 8 | 2020-06-06T01:02:06.000Z | 2022-03-12T00:24:13.000Z | Django/session_words/session_words/settings.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | null | null | null | """
Django settings for session_words project.
Generated by 'django-admin startproject' using Django 1.11.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
im... | 25.696721 | 91 | 0.698565 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'u@cj5-77l85mz0t186p6@1c(d607sgv(0t5lm!4h$ok8to&h@v'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'apps.main',
'django.contrib.admin',
'django.contrib.auth',
'djang... | true | true |
790d3c676315e9ecbb552fc0aaff117b49326325 | 1,350 | py | Python | output/models/ms_data/complex_type/ct_i040_xsd/ct_i040.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/element/elem_t003_xsd/elem_t003.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/element/elem_t007_xsd/elem_t007.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Dict, Optional
@dataclass
class FooType:
class Meta:
name = "fooType"
foo_ele1: Optional[str] = field(
default=None,
metadata={
"name": "fooEle1",
"type": "Element",
"namespace": "",
... | 19.285714 | 45 | 0.479259 | from dataclasses import dataclass, field
from typing import Dict, Optional
@dataclass
class FooType:
class Meta:
name = "fooType"
foo_ele1: Optional[str] = field(
default=None,
metadata={
"name": "fooEle1",
"type": "Element",
"namespace": "",
... | true | true |
790d3cc8be6c56fb8f97a283ca95855e6ca2c466 | 405 | py | Python | blog/migrations/0002_auto_20190209_0235.py | muntakim1/mblog | dd3104220ce77f63e362d157e62e3ce93b0e7cea | [
"MIT"
] | 2 | 2019-05-06T13:57:44.000Z | 2020-02-19T04:12:33.000Z | blog/migrations/0002_auto_20190209_0235.py | muntakim1/mblog | dd3104220ce77f63e362d157e62e3ce93b0e7cea | [
"MIT"
] | 2 | 2019-10-21T19:54:44.000Z | 2019-12-29T14:56:47.000Z | blog/migrations/0002_auto_20190209_0235.py | muntakim1/mblog | dd3104220ce77f63e362d157e62e3ce93b0e7cea | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-02-08 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='post',
name='image',
field=m... | 21.315789 | 86 | 0.582716 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='post',
name='image',
field=models.ImageField(blank=True, null=True, upload_... | true | true |
790d3dcf0c2c3850b605f2b50d45d01b72f40000 | 2,260 | py | Python | serpent_server/server.py | ChrisCalderon/SerpentServer | da6e17e468bd93197183cad16a01cb6f233f7344 | [
"MIT"
] | null | null | null | serpent_server/server.py | ChrisCalderon/SerpentServer | da6e17e468bd93197183cad16a01cb6f233f7344 | [
"MIT"
] | null | null | null | serpent_server/server.py | ChrisCalderon/SerpentServer | da6e17e468bd93197183cad16a01cb6f233f7344 | [
"MIT"
] | null | null | null | from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from .redirect import RedirectHandler
import threading
import ssl
__all__ = ['ThreadedServer', 'SecureServer']
class ThreadedServer(ThreadingMixIn, HTTPServer):
protocol_version = 'HTTP/1.1'
def __init__(self,... | 34.242424 | 78 | 0.574779 | from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from .redirect import RedirectHandler
import threading
import ssl
__all__ = ['ThreadedServer', 'SecureServer']
class ThreadedServer(ThreadingMixIn, HTTPServer):
protocol_version = 'HTTP/1.1'
def __init__(self,... | true | true |
790d3ee93addca429835b9a703e987f4b06b772c | 1,244 | py | Python | faces.py | clevtech/core_control_zhuldyz | 68e62a363e874692b5cc54ff651b63a00b58f1cf | [
"MIT"
] | null | null | null | faces.py | clevtech/core_control_zhuldyz | 68e62a363e874692b5cc54ff651b63a00b58f1cf | [
"MIT"
] | null | null | null | faces.py | clevtech/core_control_zhuldyz | 68e62a363e874692b5cc54ff651b63a00b58f1cf | [
"MIT"
] | null | null | null | import cv2
cap = cv2.VideoCapture(1)
cap.set(3, 640) #WIDTH
cap.set(4, 480) #HEIGHT
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
while True:
# while True:
# ret, frame = cap.read()
#
# # Our operations on the frame come here
# gray = cv2.cvtColor(frame, ... | 26.468085 | 75 | 0.578778 | import cv2
cap = cv2.VideoCapture(1)
cap.set(3, 640)
cap.set(4, 480)
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
while True:
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray,... | true | true |
790d3f268dc6c97ef74323a266cd51779316c412 | 633 | py | Python | test_batched_inv_mp.py | eldrin/wmf | 7a4d72e47034f4289ea3c73d28886eabd6ab5762 | [
"MIT"
] | 79 | 2015-01-27T00:11:03.000Z | 2021-08-21T14:48:33.000Z | test_batched_inv_mp.py | eldrin/wmf | 7a4d72e47034f4289ea3c73d28886eabd6ab5762 | [
"MIT"
] | 4 | 2017-05-01T21:30:08.000Z | 2018-07-26T09:30:08.000Z | test_batched_inv_mp.py | eldrin/wmf | 7a4d72e47034f4289ea3c73d28886eabd6ab5762 | [
"MIT"
] | 23 | 2015-04-29T01:41:53.000Z | 2020-03-25T01:54:30.000Z | import numpy as np
import wmf
import batched_inv
import batched_inv_mp
import solve_mp
import solve_gpu
np.random.seed(123)
B = np.load("test_matrix.pkl")
S = wmf.log_surplus_confidence_matrix(B, alpha=2.0, epsilon=1e-6)
num_factors = 40 + 1
num_iterations = 1
batch_size = 1000
solve = batched_inv.solve_sequentia... | 24.346154 | 142 | 0.793049 | import numpy as np
import wmf
import batched_inv
import batched_inv_mp
import solve_mp
import solve_gpu
np.random.seed(123)
B = np.load("test_matrix.pkl")
S = wmf.log_surplus_confidence_matrix(B, alpha=2.0, epsilon=1e-6)
num_factors = 40 + 1
num_iterations = 1
batch_size = 1000
solve = batched_inv.solve_sequentia... | true | true |
790d406bc2c98191db89bdc4c097a150bf664082 | 205 | py | Python | client/util/html/tooling/base/document/ScriptElement.py | vincihb/stock-price-predictor | 17f46bed7360817835a160ea4f1a6e057de4032d | [
"MIT"
] | null | null | null | client/util/html/tooling/base/document/ScriptElement.py | vincihb/stock-price-predictor | 17f46bed7360817835a160ea4f1a6e057de4032d | [
"MIT"
] | 1 | 2021-06-02T03:12:17.000Z | 2021-06-02T03:12:17.000Z | client/util/html/tooling/base/document/ScriptElement.py | vincihb/stock-price-predictor | 17f46bed7360817835a160ea4f1a6e057de4032d | [
"MIT"
] | null | null | null | from client.util.html.tooling.base.HTMLElement import HTMLElement
class ScriptElement(HTMLElement):
def __init__(self, src):
super().__init__('script')
self.set_attribute('src', src)
| 25.625 | 65 | 0.712195 | from client.util.html.tooling.base.HTMLElement import HTMLElement
class ScriptElement(HTMLElement):
def __init__(self, src):
super().__init__('script')
self.set_attribute('src', src)
| true | true |
790d40ac4ba26b892211d776e213de7ad820a9e8 | 2,429 | py | Python | src/convert_to_wav.py | mori97/U-Net_MUSDB18 | d452f0e6378c1d74e823dcb1e95d92307f4dea46 | [
"MIT"
] | 5 | 2020-02-06T05:44:08.000Z | 2021-07-21T07:16:49.000Z | src/convert_to_wav.py | mori97/U-Net_MUSDB18 | d452f0e6378c1d74e823dcb1e95d92307f4dea46 | [
"MIT"
] | 2 | 2021-06-21T11:09:30.000Z | 2021-07-12T07:35:09.000Z | src/convert_to_wav.py | mori97/U-Net_MUSDB18 | d452f0e6378c1d74e823dcb1e95d92307f4dea46 | [
"MIT"
] | 1 | 2021-06-05T03:13:12.000Z | 2021-06-05T03:13:12.000Z | """Convert MUSDB18 dataset to .wav format.
Output .wav files contain 5 channels
- `0` - The mixture,
- `1` - The drums,
- `2` - The bass,
- `3` - The rest of the accompaniment,
- `4` - The vocals.
"""
import argparse
import os
import subprocess
import tempfile
import librosa
import numpy as np
import soundfile as sf
... | 35.202899 | 78 | 0.558666 | import argparse
import os
import subprocess
import tempfile
import librosa
import numpy as np
import soundfile as sf
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('origin_dataset_dir',
help='Path of the original dataset (.mp4)',
... | true | true |
790d40e3b0a8176ed05f1b4dbc9c9d5c3395aefe | 6,373 | gyp | Python | android_webview/native/webview_native.gyp | tmpsantos/chromium | 802d4aeeb33af25c01ee5994037bbf14086d4ac0 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | android_webview/native/webview_native.gyp | tmpsantos/chromium | 802d4aeeb33af25c01ee5994037bbf14086d4ac0 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | android_webview/native/webview_native.gyp | tmpsantos/chromium | 802d4aeeb33af25c01ee5994037bbf14086d4ac0 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 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.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'webview_native',
'type': 'static_library',
'depende... | 40.852564 | 97 | 0.637376 |
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'webview_native',
'type': 'static_library',
'dependencies': [
'../../base/base.gyp:base_static',
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../... | true | true |
790d417c3a4c2e214fc4b7b647e87ecfc9d01f41 | 1,456 | py | Python | tests/test_quom/test_source_directory.py | Chaoses-Ib/quom | 8d13a41baea1a930d27a869ff468aa72fe25b100 | [
"MIT"
] | 1 | 2021-07-31T18:29:24.000Z | 2021-07-31T18:29:24.000Z | tests/test_quom/test_source_directory.py | Chaoses-Ib/quom | 8d13a41baea1a930d27a869ff468aa72fe25b100 | [
"MIT"
] | null | null | null | tests/test_quom/test_source_directory.py | Chaoses-Ib/quom | 8d13a41baea1a930d27a869ff468aa72fe25b100 | [
"MIT"
] | null | null | null | import os
from io import StringIO
from pathlib import Path
from quom import Quom
from quom.__main__ import main
FILE_MAIN_HPP = """
int foo = 3;
int foo();
"""
FILE_MAIN_CPP = """
int foo() { return 42; }
"""
RESULT = """
int foo = 3;
int foo();
int foo() { return 42; }
"""
def test_source_directory(fs):
o... | 23.111111 | 85 | 0.618132 | import os
from io import StringIO
from pathlib import Path
from quom import Quom
from quom.__main__ import main
FILE_MAIN_HPP = """
int foo = 3;
int foo();
"""
FILE_MAIN_CPP = """
int foo() { return 42; }
"""
RESULT = """
int foo = 3;
int foo();
int foo() { return 42; }
"""
def test_source_directory(fs):
o... | true | true |
790d42b29d4886095215195ac111bf47a488281a | 1,771 | py | Python | examples/ad_manager/v201811/activity_service/get_all_activities.py | beamc83/python-googleads | 6039d08e2d85850a46a70f24359d362ffde2f7ed | [
"Apache-2.0"
] | 2 | 2019-07-11T13:01:56.000Z | 2019-07-11T13:01:58.000Z | examples/ad_manager/v201811/activity_service/get_all_activities.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201811/activity_service/get_all_activities.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | 1 | 2020-07-19T14:24:05.000Z | 2020-07-19T14:24:05.000Z | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 34.72549 | 79 | 0.730661 |
"""This example gets all activities.
"""
from googleads import ad_manager
def main(client):
activity_service = client.GetService('ActivityService', version='v201811')
statement = ad_manager.StatementBuilder(version='v201811')
while True:
response = activity_service.getActiviti... | false | true |
790d455c9de574f94746f67e49a9c645288fbe6f | 391 | py | Python | script_2.py | bhattbhavesh91/docly-demo | 78d1a412ff0dd9ed913b5890c7dee3defa96e59f | [
"Apache-2.0"
] | 2 | 2020-11-27T16:53:46.000Z | 2020-11-30T18:29:45.000Z | script_2.py | bharathjinka09/docly-demo | abe4e31282855ba6349f3eafb790af7fd44b25ea | [
"Apache-2.0"
] | null | null | null | script_2.py | bharathjinka09/docly-demo | abe4e31282855ba6349f3eafb790af7fd44b25ea | [
"Apache-2.0"
] | 1 | 2020-11-27T16:53:50.000Z | 2020-11-27T16:53:50.000Z | def calculate_critical_value(size : int, alpha : float) -> float:
t_dist = stats.t.ppf(1 - alpha / (2 * size), size - 2)
numerator = (size - 1) * np.sqrt(np.square(t_dist))
denominator = np.sqrt(size) * np.sqrt(size - 2 + np.square(t_dist))
critical_value = numerator / denominator
print("Grubbs... | 55.857143 | 72 | 0.659847 | def calculate_critical_value(size : int, alpha : float) -> float:
t_dist = stats.t.ppf(1 - alpha / (2 * size), size - 2)
numerator = (size - 1) * np.sqrt(np.square(t_dist))
denominator = np.sqrt(size) * np.sqrt(size - 2 + np.square(t_dist))
critical_value = numerator / denominator
print("Grubbs... | true | true |
790d471ac45976f00d4a6a1b21e1602503be07f2 | 2,903 | py | Python | create_pdb_annotations.py | stephenshank/taed-pv | 9b40f0abbe90312e50a1cf57a794609c3ebdf02b | [
"MIT"
] | null | null | null | create_pdb_annotations.py | stephenshank/taed-pv | 9b40f0abbe90312e50a1cf57a794609c3ebdf02b | [
"MIT"
] | null | null | null | create_pdb_annotations.py | stephenshank/taed-pv | 9b40f0abbe90312e50a1cf57a794609c3ebdf02b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 4 17:07:18 2016
@author: sshank
"""
# Print out the required annotations at the moment... change to put into MySQL
from Bio.Seq import Seq
from Bio import AlignIO
from Bio.SeqRecord import SeqRecord
from argparse import ArgumentParser
parser = ArgumentParser()
rst_he... | 36.2875 | 90 | 0.635549 |
from Bio.Seq import Seq
from Bio import AlignIO
from Bio.SeqRecord import SeqRecord
from argparse import ArgumentParser
parser = ArgumentParser()
rst_help = 'Path to parsed RST file (created with parse_rst.py).'
parser.add_argument('-r', '--rst', metavar='RST', help=rst_help, dest='rst')
input_help = 'Path to inp... | true | true |
790d48fc9ee07093ca65a37b73e0a3c66616d9a7 | 13,802 | py | Python | codebase/datasets/adres_dataset.py | petercuret/woonfraude | 2602464f9b9a8bf901d89590b61205ba18fe697d | [
"MIT"
] | null | null | null | codebase/datasets/adres_dataset.py | petercuret/woonfraude | 2602464f9b9a8bf901d89590b61205ba18fe697d | [
"MIT"
] | null | null | null | codebase/datasets/adres_dataset.py | petercuret/woonfraude | 2602464f9b9a8bf901d89590b61205ba18fe697d | [
"MIT"
] | null | null | null | ####################################################################################################
"""
adres_dataset.py
This module implements several classes to perform dataset-specific downloading, saving and
data-transformation operations.
Written by Swaan Dekkers & Thomas Jongstra
"""
##########################... | 45.853821 | 184 | 0.624402 | sonen
# Gezinsverhouding (frequency count per klasse) (int/float).
gezinsverhouding = inhab.gezinsverhouding.value_counts()
for key in gezinsverhouding.keys():
val = gezinsverhouding[key]
adres.at[i, f'gezinsverhouding_{key}'] = va... | true | true |
790d4981cc1ea2aea3a28da4dcf1fa9ebe8a2314 | 2,270 | py | Python | scripts/framework-applications/export-framework-applications-at-close.py | alphagov-mirror/digitalmarketplace-scripts | 8a7ef9b2b5f5fffea6e012bd676b095a27d35101 | [
"MIT"
] | 1 | 2020-06-23T01:55:31.000Z | 2020-06-23T01:55:31.000Z | scripts/framework-applications/export-framework-applications-at-close.py | alphagov-mirror/digitalmarketplace-scripts | 8a7ef9b2b5f5fffea6e012bd676b095a27d35101 | [
"MIT"
] | 267 | 2015-10-12T12:43:52.000Z | 2021-08-19T10:38:55.000Z | scripts/framework-applications/export-framework-applications-at-close.py | alphagov-mirror/digitalmarketplace-scripts | 8a7ef9b2b5f5fffea6e012bd676b095a27d35101 | [
"MIT"
] | 7 | 2015-11-11T16:47:41.000Z | 2021-04-10T18:03:04.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
!!! This generally needs to be run right after the close of applications for a framework, and passed to product
!!! managers & CCS.
Generate a CSV with per-lot draft statistics for each supplier who registered interest in the framework,
whether or not they made a compl... | 33.382353 | 120 | 0.725551 |
import os
import sys
from datetime import datetime
from dmapiclient import DataAPIClient
from docopt import docopt
sys.path.insert(0, '.')
from dmscripts.export_framework_applications_at_close import GenerateFrameworkApplicationsCSV
from dmutils.env_helpers import get_api_endpoint_from_stage
if __name__ == "__main... | true | true |
790d49c171e041ae3b34c4e3c77a0cc920b3f778 | 99,352 | py | Python | jax/experimental/jax2tf/jax2tf.py | ho-oto/jax | e0f285fd218aa704fa65c47ab6e7695f4a38ddbd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/jax2tf/jax2tf.py | ho-oto/jax | e0f285fd218aa704fa65c47ab6e7695f4a38ddbd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/jax2tf/jax2tf.py | ho-oto/jax | e0f285fd218aa704fa65c47ab6e7695f4a38ddbd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2020 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, ... | 38.809375 | 133 | 0.704374 |
import functools
import re
import string
from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union
import jax
from jax import ad_util, api_util, config
from jax._src import api
from jax import core, custom_derivatives, dtypes
from jax import linear_util as lu
from jax import... | true | true |
790d4a9b5b3baf0348c6de1a41ad3f16a13f894d | 881 | py | Python | tests/test_flare_io.py | sh-divya/flare | 93219ff03df10528abb8f7a5309f15f7899a3f12 | [
"MIT"
] | null | null | null | tests/test_flare_io.py | sh-divya/flare | 93219ff03df10528abb8f7a5309f15f7899a3f12 | [
"MIT"
] | null | null | null | tests/test_flare_io.py | sh-divya/flare | 93219ff03df10528abb8f7a5309f15f7899a3f12 | [
"MIT"
] | null | null | null | import pytest
pmgout = pytest.importorskip("pymatgen.io.vasp.outputs")
Vasprun = pmgout.Vasprun
import os
import numpy as np
from flare.struc import Structure, get_unique_species
from flare.dft_interface.vasp_util import md_trajectory_from_vasprun
from flare.utils.flare_io import md_trajectory_to_file, md_trajectory_f... | 35.24 | 84 | 0.779796 | import pytest
pmgout = pytest.importorskip("pymatgen.io.vasp.outputs")
Vasprun = pmgout.Vasprun
import os
import numpy as np
from flare.struc import Structure, get_unique_species
from flare.dft_interface.vasp_util import md_trajectory_from_vasprun
from flare.utils.flare_io import md_trajectory_to_file, md_trajectory_f... | true | true |
790d4ab1943eea88064a1e0518a78d11f3258595 | 636 | py | Python | run_tests.py | djpetti/rhodopsin | 97bdb9a6ba3c29b1fe1dd1e60b0b41e5a247ccf1 | [
"MIT"
] | null | null | null | run_tests.py | djpetti/rhodopsin | 97bdb9a6ba3c29b1fe1dd1e60b0b41e5a247ccf1 | [
"MIT"
] | null | null | null | run_tests.py | djpetti/rhodopsin | 97bdb9a6ba3c29b1fe1dd1e60b0b41e5a247ccf1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import unittest
""" Script to run the Python tests. """
def run_python_tests():
""" Runs the Python tests.
Returns:
True if the tests all succeed, False if there are failures. """
print("Starting tests...")
loader = unittest.TestLoader()
# Get the directory this module i... | 21.2 | 68 | 0.712264 |
import os
import unittest
def run_python_tests():
print("Starting tests...")
loader = unittest.TestLoader()
dir_path = os.path.dirname(os.path.realpath(__file__))
suite = loader.discover("rhodopsin/tests", top_level_dir=dir_path)
test_result = unittest.TextTestRunner(verbosity=2).run(suite)
if n... | true | true |
790d4bbada6c11a5360442f4fb288451faab61d1 | 3,901 | py | Python | Python Projects/A Number Guesser(2 modes).py | Kaique-Apolinario/Python-projects | 88ddbe2cb41720c1f26006b2053bf7a1a88d78db | [
"MIT"
] | null | null | null | Python Projects/A Number Guesser(2 modes).py | Kaique-Apolinario/Python-projects | 88ddbe2cb41720c1f26006b2053bf7a1a88d78db | [
"MIT"
] | null | null | null | Python Projects/A Number Guesser(2 modes).py | Kaique-Apolinario/Python-projects | 88ddbe2cb41720c1f26006b2053bf7a1a88d78db | [
"MIT"
] | null | null | null | import random
from time import sleep
def Guess():
global attempts
# If the user choose anything but a number between 0 and 10, they will get stuck in loop.
while True:
try:
attempts += 1 # This will count every attempt made by the user
user_number = int(input().replace(' '... | 36.457944 | 127 | 0.5596 | import random
from time import sleep
def Guess():
global attempts
while True:
try:
attempts += 1
user_number = int(input().replace(' ', ''))
except:
print("You should put a number between 0 and 10 <3")
else:
if user_number > 10 or ... | true | true |
790d4da49d1de4ac4b1333435c4bfff56262dac9 | 45,664 | py | Python | FontTools/fontTools/ttLib/tables/_c_m_a_p.py | johanoren/IncrementalNumbers_Fusion360 | dd2655ff44d80853b24dabde2f3b523ef470673d | [
"MIT"
] | null | null | null | FontTools/fontTools/ttLib/tables/_c_m_a_p.py | johanoren/IncrementalNumbers_Fusion360 | dd2655ff44d80853b24dabde2f3b523ef470673d | [
"MIT"
] | 1 | 2019-09-10T11:50:51.000Z | 2019-09-10T11:50:51.000Z | FontTools/fontTools/ttLib/tables/_c_m_a_p.py | johanoren/IncrementalNumbers_Fusion360 | dd2655ff44d80853b24dabde2f3b523ef470673d | [
"MIT"
] | null | null | null | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import safeEval, readHex
from fontTools.misc.encodingTools import getEncoding
from fontTools.ttLib import getSearchRange
from fontTools.unicode import Unicode
from . import DefaultTable
impor... | 35.289026 | 192 | 0.698888 | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import safeEval, readHex
from fontTools.misc.encodingTools import getEncoding
from fontTools.ttLib import getSearchRange
from fontTools.unicode import Unicode
from . import DefaultTable
impor... | true | true |
790d4dc332f8c6d87a412245bf6606b6e879871c | 1,282 | py | Python | tethys_datasets/migrations/0003_spatialdatasetservice.py | CI-WATER/django-tethys_datasets | 504963a720693931a1fa1a899d5492548672216f | [
"BSD-2-Clause"
] | null | null | null | tethys_datasets/migrations/0003_spatialdatasetservice.py | CI-WATER/django-tethys_datasets | 504963a720693931a1fa1a899d5492548672216f | [
"BSD-2-Clause"
] | null | null | null | tethys_datasets/migrations/0003_spatialdatasetservice.py | CI-WATER/django-tethys_datasets | 504963a720693931a1fa1a899d5492548672216f | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tethys_datasets', '0002_auto_20150119_1756'),
]
operations = [
migrations.CreateModel(
name='SpatialDatasetServi... | 40.0625 | 227 | 0.613885 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tethys_datasets', '0002_auto_20150119_1756'),
]
operations = [
migrations.CreateModel(
name='SpatialDatasetService',
fields... | true | true |
790d4dda347c97ee25f917fd744920903b8f9127 | 17,962 | py | Python | src/webparse.py | neilchristanto/ValDashboard | d62d04020081c114c67d80e52726ad827a180ba0 | [
"MIT"
] | null | null | null | src/webparse.py | neilchristanto/ValDashboard | d62d04020081c114c67d80e52726ad827a180ba0 | [
"MIT"
] | null | null | null | src/webparse.py | neilchristanto/ValDashboard | d62d04020081c114c67d80e52726ad827a180ba0 | [
"MIT"
] | null | null | null | import re
import pandas as pd
import requests
from lxml import html as lhtml
from fake_useragent import UserAgent
import logging
WS_TO_STR = 0
WS_SRC = 1
WS_PATH = 2
WS_CACHE = 3
class WebParse:
websource = {
# Readable Source unique path caching
... | 34.945525 | 111 | 0.512137 | import re
import pandas as pd
import requests
from lxml import html as lhtml
from fake_useragent import UserAgent
import logging
WS_TO_STR = 0
WS_SRC = 1
WS_PATH = 2
WS_CACHE = 3
class WebParse:
websource = {
"mkt_cap" : ['Mkt Cap' , "ycharts" , "market_cap", 0],
... | true | true |
790d4ede53c7228132c3f5ffea1e40feaf48a6ff | 854 | py | Python | setup.py | dilawar/tinypandas | 439a1994b6167628ecbddb37369bffd20813c24c | [
"BSD-3-Clause"
] | null | null | null | setup.py | dilawar/tinypandas | 439a1994b6167628ecbddb37369bffd20813c24c | [
"BSD-3-Clause"
] | null | null | null | setup.py | dilawar/tinypandas | 439a1994b6167628ecbddb37369bffd20813c24c | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("README.md") as f:
readme = f.read()
classifiers = [
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
]
setup(
... | 26.6875 | 73 | 0.651054 | import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("README.md") as f:
readme = f.read()
classifiers = [
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
]
setup(
... | true | true |
790d4f0d7fb7dc0745fb4aa116d107f1b4abf0fd | 2,940 | py | Python | tests/support/copyartifacts.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/support/copyartifacts.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/support/copyartifacts.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
Script for copying back xml junit files from tests
"""
import argparse # pylint: disable=minimum-python-version
import os
import subprocess
import paramiko
import salt.utils.yaml
class DownloadArtifacts:
def __init__(self, instance, artifacts):
self.instance = instance
self.artifacts = arti... | 33.033708 | 88 | 0.593537 |
import argparse
import os
import subprocess
import paramiko
import salt.utils.yaml
class DownloadArtifacts:
def __init__(self, instance, artifacts):
self.instance = instance
self.artifacts = artifacts
self.transport = self.setup_transport()
self.sftpclient = paramiko.SFTPClient... | true | true |
790d50f20b8da66c44adfcff9c0fea07ddb6a0ce | 53,839 | py | Python | mindaffectBCI/decoder/UtopiaDataInterface.py | CkiChen/pymindaffectBCI | 0119145a8b280c776f4c4e6cd776fed0f0156404 | [
"MIT"
] | 1 | 2021-04-25T02:07:13.000Z | 2021-04-25T02:07:13.000Z | mindaffectBCI/decoder/UtopiaDataInterface.py | CkiChen/pymindaffectBCI | 0119145a8b280c776f4c4e6cd776fed0f0156404 | [
"MIT"
] | null | null | null | mindaffectBCI/decoder/UtopiaDataInterface.py | CkiChen/pymindaffectBCI | 0119145a8b280c776f4c4e6cd776fed0f0156404 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019 MindAffect B.V.
# Author: Jason Farquhar <jason@mindaffect.nl>
# This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>.
#
# pymindaffectBCI is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | 38.649677 | 150 | 0.566207 |
from mindaffectBCI.utopiaclient import UtopiaClient, Subscribe, StimulusEvent, NewTarget, Selection, DataPacket, UtopiaMessage, SignalQuality
from collections import deque
from mindaffectBCI.decoder.utils import RingBuffer, extract_ringbuffer_segment
from mindaffectBCI.decoder.lower_bound_tracker impo... | true | true |
790d51d6cd4cc81c554bb2826bb40447876b43d6 | 3,885 | py | Python | tools/erpc/basic_codec.py | openlunar/fc-bootloader | 793e42ea0095a5d1d767c1eca7e1d3a27b7f5599 | [
"Unlicense",
"MIT"
] | 1 | 2020-08-23T20:24:19.000Z | 2020-08-23T20:24:19.000Z | tools/erpc/basic_codec.py | openlunar/fc-bootloader | 793e42ea0095a5d1d767c1eca7e1d3a27b7f5599 | [
"Unlicense",
"MIT"
] | 1 | 2020-08-24T00:41:48.000Z | 2020-08-24T02:17:44.000Z | tools/erpc/basic_codec.py | openlunar/fc-bootloader | 793e42ea0095a5d1d767c1eca7e1d3a27b7f5599 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015 Freescale Semiconductor, Inc.
# Copyright 2016-2017 NXP
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
import struct
from .codec import (MessageType, MessageInfo, Codec, CodecError)
class BasicCodec(Codec):
## Version of this codec.
BASIC_CODEC_VER... | 25.559211 | 93 | 0.60592 |
import struct
from .codec import (MessageType, MessageInfo, Codec, CodecError)
class BasicCodec(Codec):
= 1
def start_write_message(self, msgInfo):
header = (self.BASIC_CODEC_VERSION << 24) \
| ((msgInfo.service & 0xff) << 16) \
| ((msgInfo.requ... | true | true |
790d5615d3562c6caefacfcf222dab4687b95031 | 4,419 | py | Python | venv/lib/python3.6/site-packages/requests_mock/request.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 1 | 2020-11-02T15:00:52.000Z | 2020-11-02T15:00:52.000Z | venv/lib/python3.6/site-packages/requests_mock/request.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/requests_mock/request.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 1 | 2020-11-09T16:11:07.000Z | 2020-11-09T16:11:07.000Z | # 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, software
# distributed under ... | 27.110429 | 79 | 0.630686 |
import copy
import json
import requests
import six
from six.moves.urllib import parse as urlparse
class _RequestObjectProxy(object):
def __init__(self, request, **kwargs):
self._request = request
self._matcher = None
self._url_parts_ = None
self._qs = None
... | true | true |
790d56a58b51f072fa37a6b7c101ec16af0ffa1c | 4,987 | py | Python | gen/interface.py | Rioghasarig/trlu | 10aa768f6cf58be17d76923daecae2c70867f5e2 | [
"X11"
] | 21 | 2015-03-14T03:19:00.000Z | 2022-03-30T05:56:38.000Z | gen/interface.py | Rioghasarig/trlu | 10aa768f6cf58be17d76923daecae2c70867f5e2 | [
"X11"
] | 5 | 2015-01-03T13:02:30.000Z | 2020-10-06T16:58:28.000Z | gen/interface.py | Rioghasarig/trlu | 10aa768f6cf58be17d76923daecae2c70867f5e2 | [
"X11"
] | 5 | 2015-06-05T08:25:37.000Z | 2021-09-30T11:12:55.000Z | #!/usr/bin/env python3
import io
def parse_org_table(table_lines):
# remove separator row
table_lines.pop(1)
table_list = [[b.strip() for b in a[1:-2].split('|')] for a in table_lines]
# get column list
column_list = table_list.pop(0)
#print(column_names)
# organize table data
table_da... | 32.594771 | 90 | 0.620413 |
import io
def parse_org_table(table_lines):
table_lines.pop(1)
table_list = [[b.strip() for b in a[1:-2].split('|')] for a in table_lines]
column_list = table_list.pop(0)
table_data = []
for param in table_list:
param_dict = {}
for column, value in zip(column_l... | true | true |
790d56c7bb7566425f8df84756f87444a8e96569 | 8,105 | py | Python | batracker/signal_detection/detection.py | thejasvibr/batracker | def2ae9a0f18df0b9b95d67a203d2afd8be0f2ce | [
"MIT"
] | null | null | null | batracker/signal_detection/detection.py | thejasvibr/batracker | def2ae9a0f18df0b9b95d67a203d2afd8be0f2ce | [
"MIT"
] | null | null | null | batracker/signal_detection/detection.py | thejasvibr/batracker | def2ae9a0f18df0b9b95d67a203d2afd8be0f2ce | [
"MIT"
] | null | null | null | '''
Deals with the actual detection of signals in multichannel audio files.
There are two problems that need to solved while detecting a signal of interest.
#. within-channel signal detection
#. across-channel correspondence matching
Within-channel signal detection
-------------------------------
This task in... | 33.912134 | 128 | 0.672424 |
import matplotlib.pyplot as plt
plt.rcParams['agg.path.chunksize']=10000
import numpy as np
import scipy.signal as signal
import scipy.io.wavfile as wav
import scipy.ndimage as ndimage
import tqdm
from batracker.common_dsp.sigproc import *
def cross_channel_threshold_detector(multichannel, fs, **kwargs):
sample... | true | true |
790d573c720b423748239250a55bc07862a053db | 3,014 | py | Python | test/test_lstm2d_cell.py | FlorianPfisterer/2D-LSTM-Seq2Seq | 1b07273fc73237259ae99eabfc509f54ad233ccf | [
"MIT"
] | 28 | 2019-04-11T19:03:27.000Z | 2022-03-08T07:32:56.000Z | test/test_lstm2d_cell.py | FlorianPfisterer/2D-LSTM-Seq2Seq | 1b07273fc73237259ae99eabfc509f54ad233ccf | [
"MIT"
] | 1 | 2018-12-18T17:23:29.000Z | 2018-12-18T17:23:29.000Z | test/test_lstm2d_cell.py | FlorianPfisterer/2d-seq2seq | 1b07273fc73237259ae99eabfc509f54ad233ccf | [
"MIT"
] | 6 | 2019-04-11T19:03:29.000Z | 2021-11-23T13:31:34.000Z | from unittest import TestCase
import torch
from model.lstm2d_cell import LSTM2dCell
class LSTM2dCellTest(TestCase):
"""
Unit tests for the 2D-LSTM cell.
"""
embed_dim = 50
encoder_state_dim = 20
input_dim = 2 * encoder_state_dim + embed_dim
cell_state_dim = 25
batch_size = 42
def ... | 42.450704 | 115 | 0.675514 | from unittest import TestCase
import torch
from model.lstm2d_cell import LSTM2dCell
class LSTM2dCellTest(TestCase):
embed_dim = 50
encoder_state_dim = 20
input_dim = 2 * encoder_state_dim + embed_dim
cell_state_dim = 25
batch_size = 42
def setUp(self):
torch.manual_seed(42)
s... | true | true |
790d57b676bc83661ce64849f5d68313fc98cf35 | 8,488 | py | Python | bidir_dijkstra.py | colon3ltocard/pythonalgorithms | 60e2a46d4e53430570142f79e9930b02c3f89ed0 | [
"MIT"
] | null | null | null | bidir_dijkstra.py | colon3ltocard/pythonalgorithms | 60e2a46d4e53430570142f79e9930b02c3f89ed0 | [
"MIT"
] | null | null | null | bidir_dijkstra.py | colon3ltocard/pythonalgorithms | 60e2a46d4e53430570142f79e9930b02c3f89ed0 | [
"MIT"
] | null | null | null | """
Visualizing bidirectionnal Dijkstra
using matplotlib
"""
import sys
from dataclasses import dataclass
from heapq import heappush, heappop
from itertools import permutations
from collections import defaultdict
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.animation as animation
from dijkst... | 28.38796 | 112 | 0.521206 | import sys
from dataclasses import dataclass
from heapq import heappush, heappop
from itertools import permutations
from collections import defaultdict
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.animation as animation
from dijkstra import (
Node,
generate_random_graph,
build_sh... | true | true |
790d581890de64f1e5155e44980aa6fdd0e58cb9 | 7,023 | py | Python | djadmin2/core.py | PowerOlive/django-admin2 | 5fa267064358f9017c60a366c316c7f527d45fb2 | [
"BSD-3-Clause"
] | null | null | null | djadmin2/core.py | PowerOlive/django-admin2 | 5fa267064358f9017c60a366c316c7f527d45fb2 | [
"BSD-3-Clause"
] | null | null | null | djadmin2/core.py | PowerOlive/django-admin2 | 5fa267064358f9017c60a366c316c7f527d45fb2 | [
"BSD-3-Clause"
] | null | null | null | """
WARNING: This file about to undergo major refactoring by @pydanny per
Issue #99.
"""
from importlib import import_module
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
from . import apiviews
from . import types
from . import utils
from . i... | 33.927536 | 81 | 0.581803 | from importlib import import_module
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
from . import apiviews
from . import types
from . import utils
from . import views
class Admin2(object):
index_view = views.IndexView
login_view = vie... | true | true |
790d588fc2f69b62d0c9d565aec9181eeb2a9265 | 41,090 | py | Python | auto/auto_visualizer/auto_visualizer.py | lu-w/criticality-recognition | 5ad2e12699ad4bf2d7f60ce9e30f26110adce436 | [
"MIT"
] | 4 | 2022-03-13T19:33:43.000Z | 2022-03-15T22:20:36.000Z | auto/auto_visualizer/auto_visualizer.py | lu-w/criticality-recognition | 5ad2e12699ad4bf2d7f60ce9e30f26110adce436 | [
"MIT"
] | null | null | null | auto/auto_visualizer/auto_visualizer.py | lu-w/criticality-recognition | 5ad2e12699ad4bf2d7f60ce9e30f26110adce436 | [
"MIT"
] | null | null | null | # Visualizer is for debugging purposes only
import logging
import math
import random
import threading
import http.server
import socketserver
import os
import re
from shapely import wkt
import matplotlib.pyplot as plt
import mpld3
import screeninfo
import tempfile
import webbrowser
import owlready2
from shapely import ... | 49.091995 | 298 | 0.497785 |
import logging
import math
import random
import threading
import http.server
import socketserver
import os
import re
from shapely import wkt
import matplotlib.pyplot as plt
import mpld3
import screeninfo
import tempfile
import webbrowser
import owlready2
from shapely import geometry
import numpy as np
from tqdm impor... | true | true |
790d5992da630a40a86c8810a5401e44f3416c9f | 693 | py | Python | train.py | Wang-jiahao/SimDeblur | 31d88e1fbec91d5cc9062f4a46538e4ba806ab29 | [
"MIT"
] | 1 | 2021-04-30T16:47:40.000Z | 2021-04-30T16:47:40.000Z | train.py | Wang-jiahao/SimDeblur | 31d88e1fbec91d5cc9062f4a46538e4ba806ab29 | [
"MIT"
] | null | null | null | train.py | Wang-jiahao/SimDeblur | 31d88e1fbec91d5cc9062f4a46538e4ba806ab29 | [
"MIT"
] | null | null | null | """ ************************************************
* fileName: train.py
* desc: The training file for SimDeblur,
pay much attention to your constructed configs.
* author: mingdeng_cao
* date: 2021/07/14 17:26
* last revised: Reformat the file
************************************************ """
from simdebl... | 23.896552 | 60 | 0.613276 |
from simdeblur.config import build_config, merge_args
from simdeblur.engine.parse_arguments import parse_arguments
from simdeblur.engine.trainer import Trainer
def main():
args = parse_arguments()
cfg = build_config(args.config_file)
cfg = merge_args(cfg, args)
cfg.args = args
trainer = Traine... | true | true |
790d59ca15f689024a7543b37ff6b13ba78de648 | 5,051 | py | Python | buffer/in-vicinity-python/hci/PySide/TopPhonon/capabilities.py | zaqwes8811/coordinator-tasks | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | buffer/in-vicinity-python/hci/PySide/TopPhonon/capabilities.py | zaqwes8811/coordinator-tasks | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | 15 | 2015-03-07T12:46:41.000Z | 2015-04-11T09:08:36.000Z | buffer/in-vicinity-python/hci/PySide/TopPhonon/capabilities.py | zaqwes8811/micro-apps | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2007-2008 Trolltech ASA. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## Licensees holding a valid Qt License Agreement may use this file in
## accordance... | 35.822695 | 89 | 0.643833 | true | true | |
790d59e637abf096a630cb25b5eeb1af0ca229d7 | 3,474 | py | Python | trainings/workshop1/step13/network_outage.py | jochenparm/moler | 0253d677e0ef150206758c7991197ba5687d0965 | [
"BSD-3-Clause"
] | 57 | 2018-02-20T08:16:47.000Z | 2022-03-28T10:36:57.000Z | trainings/workshop1/step13/network_outage.py | jochenparm/moler | 0253d677e0ef150206758c7991197ba5687d0965 | [
"BSD-3-Clause"
] | 377 | 2018-07-19T11:56:27.000Z | 2021-07-09T13:08:12.000Z | trainings/workshop1/step13/network_outage.py | jochenparm/moler | 0253d677e0ef150206758c7991197ba5687d0965 | [
"BSD-3-Clause"
] | 24 | 2018-04-14T20:49:40.000Z | 2022-03-29T10:44:26.000Z | import os.path
import time
from moler.config import load_config
from moler.device.device import DeviceFactory
from moler.util.moler_test import MolerTest
def outage_callback(device_name, ping_times):
MolerTest.info("Network outage on {}".format(device_name))
ping_times["lost_connection_time"] = time.time()
... | 38.6 | 118 | 0.658031 | import os.path
import time
from moler.config import load_config
from moler.device.device import DeviceFactory
from moler.util.moler_test import MolerTest
def outage_callback(device_name, ping_times):
MolerTest.info("Network outage on {}".format(device_name))
ping_times["lost_connection_time"] = time.time()
... | true | true |
790d5a216fcf8c3cfe59aec5e71b20db983da110 | 696 | py | Python | Modulo-03/ex105/ex105.py | Matheus-Henrique-Burey/Curso-de-Python | 448aebaab96527affa1e45897a662bb0407c11c6 | [
"MIT"
] | null | null | null | Modulo-03/ex105/ex105.py | Matheus-Henrique-Burey/Curso-de-Python | 448aebaab96527affa1e45897a662bb0407c11c6 | [
"MIT"
] | null | null | null | Modulo-03/ex105/ex105.py | Matheus-Henrique-Burey/Curso-de-Python | 448aebaab96527affa1e45897a662bb0407c11c6 | [
"MIT"
] | null | null | null | def notas(*n, sit=False):
"""
Função para analisar notas e situação de varios alunos.
:param n: Uma ou mais notas dos alunos (aceita varias)
:param sit: Valor opcional, indicando se deve ou não adicionar a situação.
:return: Dicionario com varias informações sobre a situação da turma.
"""
di... | 25.777778 | 78 | 0.566092 | def notas(*n, sit=False):
dic = dict()
dic["total"] = len(n)
dic["maior"] = max(n)
dic["menor"] = min(n)
dic["media"] = sum(n) / len(n)
if sit:
if media < 5:
dic["situação"] = "Critica"
elif media < 7:
dic["situação"] = "Rasoavel"
else:
... | true | true |
790d5a28dd4f45cfc5d34c37f4be62843139231e | 2,482 | py | Python | src/wi/utils/__init__.py | cc1-cloud/cc1 | 8113673fa13b6fe195cea99dedab9616aeca3ae8 | [
"Apache-2.0"
] | 11 | 2015-05-06T14:16:54.000Z | 2022-02-08T23:21:31.000Z | src/wi/utils/__init__.py | fortress-shell/cc1 | 8113673fa13b6fe195cea99dedab9616aeca3ae8 | [
"Apache-2.0"
] | 1 | 2015-10-30T21:08:11.000Z | 2015-10-30T21:08:11.000Z | src/wi/utils/__init__.py | fortress-shell/cc1 | 8113673fa13b6fe195cea99dedab9616aeca3ae8 | [
"Apache-2.0"
] | 5 | 2016-02-12T22:01:38.000Z | 2021-12-06T16:56:54.000Z | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | 30.268293 | 78 | 0.705077 |
import logging
import os
from time import time
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from common.utils import ServerProxy
from wi.utils.exceptions import RestErrorException
from wi.utils.messages_ajax import error, success
from wi.utils.messages_c... | true | true |
790d5a6dd53adfe9d64ffe524359d21bd2324394 | 1,658 | py | Python | ellcircle_detect.py | Thinkin99/intelligent_visionforce_assemble | bc3a443ae1c242b1bc83ec670630d46f7403a17f | [
"Apache-2.0"
] | null | null | null | ellcircle_detect.py | Thinkin99/intelligent_visionforce_assemble | bc3a443ae1c242b1bc83ec670630d46f7403a17f | [
"Apache-2.0"
] | null | null | null | ellcircle_detect.py | Thinkin99/intelligent_visionforce_assemble | bc3a443ae1c242b1bc83ec670630d46f7403a17f | [
"Apache-2.0"
] | null | null | null | import time
import cv2
import numpy as np
j = 1
while 1:
path = 'Bearing/' + str(j) + '.jpg'
img = cv2.imread(path)
img_copy = img.copy()
img = cv2.blur(img, (1, 1))
gray = cv2.cvtColor(img_copy, cv2.COLOR_BGR2GRAY)
# flag, img_copy = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
imgra... | 34.541667 | 120 | 0.496984 | import time
import cv2
import numpy as np
j = 1
while 1:
path = 'Bearing/' + str(j) + '.jpg'
img = cv2.imread(path)
img_copy = img.copy()
img = cv2.blur(img, (1, 1))
gray = cv2.cvtColor(img_copy, cv2.COLOR_BGR2GRAY)
imgray = cv2.Canny(img_copy, 600, 100, 3)
ret, thresh = cv2.... | true | true |
790d5aed153b8ce9ec1d61f79005155787745b8a | 3,174 | py | Python | docker/nwchem/src/run.py | bnmajor/mongochemdeploy | 84179082889664140c4f0133c70bd839663dd307 | [
"BSD-3-Clause"
] | 9 | 2017-03-27T19:22:09.000Z | 2021-06-28T11:45:50.000Z | docker/nwchem/src/run.py | bnmajor/mongochemdeploy | 84179082889664140c4f0133c70bd839663dd307 | [
"BSD-3-Clause"
] | 50 | 2015-09-25T20:11:41.000Z | 2021-12-22T19:39:10.000Z | docker/nwchem/src/run.py | bnmajor/mongochemdeploy | 84179082889664140c4f0133c70bd839663dd307 | [
"BSD-3-Clause"
] | 7 | 2017-11-02T17:20:46.000Z | 2021-03-10T07:36:00.000Z | import os
import subprocess
import jinja2
import json
import openchemistry as oc
def run_calculation(geometry_file, output_file, params, scratch_dir):
# Read in the geometry from the geometry file
# This container expects the geometry file to be in .xyz format
with open(geometry_file) as f:
xyz_s... | 36.068182 | 127 | 0.640832 | import os
import subprocess
import jinja2
import json
import openchemistry as oc
def run_calculation(geometry_file, output_file, params, scratch_dir):
with open(geometry_file) as f:
xyz_structure = f.read()
xyz_structure = xyz_structure.split('\n')[2:]
xyz_stru... | true | true |
790d5bdef23bef149e8eb1afa9cdecb9ce458e6e | 43,170 | py | Python | research/object_detection/metrics/coco_tools.py | bamdada/UdacityProj10FinaltfModels | 4701bfbc924539860f610fa4ceae484a7bf194c6 | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | research/object_detection/metrics/coco_tools.py | akshayjaryal603/models | db39ef826193d0802f644ba30397242a7272676e | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | research/object_detection/metrics/coco_tools.py | akshayjaryal603/models | db39ef826193d0802f644ba30397242a7272676e | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 45.346639 | 80 | 0.668937 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import copy
import time
import numpy as np
from pycocotools import coco
from pycocotools import cocoeval
from pycocotools import mask
import six
from six.move... | true | true |
790d5bec496a69c428cf6f382ef3dd9adebad7fa | 1,085 | py | Python | learning/model/keras_model_resave.py | eugene-vasilev/Automatic-Tool-Annotation-for-CATARACT-Surgery | 795be1dea5af28919e8696103f801d5d529f6067 | [
"MIT"
] | 1 | 2020-02-22T17:39:09.000Z | 2020-02-22T17:39:09.000Z | learning/model/keras_model_resave.py | eugene-vasilev/Automatic-Tool-Annotation-for-CATARACT-Surgery | 795be1dea5af28919e8696103f801d5d529f6067 | [
"MIT"
] | null | null | null | learning/model/keras_model_resave.py | eugene-vasilev/Automatic-Tool-Annotation-for-CATARACT-Surgery | 795be1dea5af28919e8696103f801d5d529f6067 | [
"MIT"
] | null | null | null | from keras.models import load_model
from glob import glob
from metrics import auc, precision, recall, f1
def save_json(model, path):
model_json = model.to_json()
with open(path, "w") as json_file:
json_file.write(model_json)
def save_weights(model, path):
model.save_weights(path)
def resave_mo... | 33.90625 | 74 | 0.588018 | from keras.models import load_model
from glob import glob
from metrics import auc, precision, recall, f1
def save_json(model, path):
model_json = model.to_json()
with open(path, "w") as json_file:
json_file.write(model_json)
def save_weights(model, path):
model.save_weights(path)
def resave_mo... | true | true |
790d5c2e844e7a3211b9acadc48b08cf64d7732d | 8,952 | py | Python | tests/components/script/test_init.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | tests/components/script/test_init.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | tests/components/script/test_init.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """The tests for the Script component."""
# pylint: disable=protected-access
import unittest
from unittest.mock import patch, Mock
from homeassistant.components import script
from homeassistant.components.script import DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_NAME, SERVICE_RELOAD, SERVICE_TOGG... | 29.544554 | 79 | 0.535188 |
import unittest
from unittest.mock import patch, Mock
from homeassistant.components import script
from homeassistant.components.script import DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_NAME, SERVICE_RELOAD, SERVICE_TOGGLE,
SERVICE_TURN_OFF, SERVICE_TURN_ON, EVENT_SCRIPT_STARTED)
from homeas... | true | true |
790d5c7a78474a22a866df13bf200475baa77d34 | 13,928 | py | Python | tests/contrib/psycopg/test_psycopg.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/psycopg/test_psycopg.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2022-02-16T09:35:37.000Z | 2022-03-04T16:48:45.000Z | tests/contrib/psycopg/test_psycopg.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-02-11T16:34:22.000Z | 2022-02-11T16:34:22.000Z | # stdlib
import time
from unittest import skipIf
# 3p
import psycopg2
from psycopg2 import extensions
from psycopg2 import extras
from ddtrace import Pin
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.psycopg.patch import PSYCOPG2_VERSION
from ddtrace.contrib.psycopg.patch import patch
f... | 34.733167 | 119 | 0.603389 |
import time
from unittest import skipIf
import psycopg2
from psycopg2 import extensions
from psycopg2 import extras
from ddtrace import Pin
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.psycopg.patch import PSYCOPG2_VERSION
from ddtrace.contrib.psycopg.patch import patch
from ddtrace.... | true | true |
790d5c7b4e13d0e262feacd50602645e6abc25e3 | 403 | py | Python | exceptions.py | Adriantsh/astr-119 | e4ffd18f62d47a06a89732294cdd425fe487a8b0 | [
"MIT"
] | null | null | null | exceptions.py | Adriantsh/astr-119 | e4ffd18f62d47a06a89732294cdd425fe487a8b0 | [
"MIT"
] | 3 | 2020-10-08T04:18:57.000Z | 2020-10-08T23:05:59.000Z | exceptions.py | Adriantsh/astr-119 | e4ffd18f62d47a06a89732294cdd425fe487a8b0 | [
"MIT"
] | null | null | null | #python exceptions let you deal with
#unexpected results
try:
print(a) #this will throw an exception since a is not found
except:
print("a is not defined!")
#there are specific errors in python
try:
print(a) #this will throw a NameError
except NameError:
print("a is still not defined")
except:
print("Somethin... | 21.210526 | 61 | 0.744417 |
try:
print(a)
except:
print("a is not defined!")
try:
print(a)
except NameError:
print("a is still not defined")
except:
print("Something else went wrong.")
print(a) | true | true |
790d5d1d5ad05b3877b8430984bb1e4af05d3d0e | 8,799 | py | Python | FWCore/GuiBrowsers/python/Vispa/Plugins/EdmBrowser/ParticleDataList.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | FWCore/GuiBrowsers/python/Vispa/Plugins/EdmBrowser/ParticleDataList.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | FWCore/GuiBrowsers/python/Vispa/Plugins/EdmBrowser/ParticleDataList.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | class ParticleData(object):
""" Class for holding particle data such as charge.
"""
def __init__(self, charge=0):
self.charge=charge
def __repr__(self):
return "charge="+str(self.charge)
class ParticleDataList(object):
""" Class for generic handling particle ids, names and ... | 42.921951 | 278 | 0.585521 | class ParticleData(object):
def __init__(self, charge=0):
self.charge=charge
def __repr__(self):
return "charge="+str(self.charge)
class ParticleDataList(object):
def __init__(self, list=None):
self._list = []
if list != None:
self._list = list
... | true | true |
790d6040ee982da08b0b75a51da6af5a7a5cbee4 | 1,155 | py | Python | script/eval_test.py | rozentill/Front2Back | c14e77d3cea923026129de9f04f32327d6ee4381 | [
"Apache-2.0"
] | 5 | 2020-04-01T12:48:01.000Z | 2022-03-29T07:43:27.000Z | script/eval_test.py | rozentill/Front2Back | c14e77d3cea923026129de9f04f32327d6ee4381 | [
"Apache-2.0"
] | null | null | null | script/eval_test.py | rozentill/Front2Back | c14e77d3cea923026129de9f04f32327d6ee4381 | [
"Apache-2.0"
] | null | null | null | import os
from os.path import join
import csv
def main_eval_gt():
metro = "metro\\metro"
cls_set = [
"02691156",
"02828884",
"02933112",
"02958343",
"03001627",
"03211117",
"03636649",
"03691459",
"04090263",
"04256520",
"04379243",
"04401088",
"04530566"
]
for c in range(0, 13):
... | 19.576271 | 114 | 0.603463 | import os
from os.path import join
import csv
def main_eval_gt():
metro = "metro\\metro"
cls_set = [
"02691156",
"02828884",
"02933112",
"02958343",
"03001627",
"03211117",
"03636649",
"03691459",
"04090263",
"04256520",
"04379243",
"04401088",
"04530566"
]
for c in range(0, 13):
... | true | true |
790d604b881152b566a82646c92e8db868f9689f | 6,830 | py | Python | fcos_core/modeling/roi_heads/box_head/inference.py | qilei123/FCOS | 53d355456460a2a45830e3953508f41173ddb9bf | [
"BSD-2-Clause"
] | null | null | null | fcos_core/modeling/roi_heads/box_head/inference.py | qilei123/FCOS | 53d355456460a2a45830e3953508f41173ddb9bf | [
"BSD-2-Clause"
] | null | null | null | fcos_core/modeling/roi_heads/box_head/inference.py | qilei123/FCOS | 53d355456460a2a45830e3953508f41173ddb9bf | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
from fcos_core.structures.bounding_box import BoxList
from fcos_core.structures.boxlist_ops import boxlist_nms
from fcos_core.structures.boxlist_ops import cat_boxlist
from ... | 39.479769 | 89 | 0.623865 |
import torch
import torch.nn.functional as F
from torch import nn
from fcos_core.structures.bounding_box import BoxList
from fcos_core.structures.boxlist_ops import boxlist_nms
from fcos_core.structures.boxlist_ops import cat_boxlist
from fcos_core.modeling.box_coder import BoxCoder
class PostProcessor(nn... | true | true |
790d60be3d2c7f08742921cb5bba0c23b86c21a9 | 1,672 | py | Python | main.py | shihu/qr-reader | 66a7526e31c854f4b067ebe8f3254ab579dbe464 | [
"MIT"
] | null | null | null | main.py | shihu/qr-reader | 66a7526e31c854f4b067ebe8f3254ab579dbe464 | [
"MIT"
] | null | null | null | main.py | shihu/qr-reader | 66a7526e31c854f4b067ebe8f3254ab579dbe464 | [
"MIT"
] | null | null | null | from __future__ import print_function
from flask import Flask, Response
from pyzbar import pyzbar
from picamera.array import PiRGBArray
from picamera import PiCamera
from datetime import datetime
import numpy as np
import cv2
import time
camera = PiCamera()
camera.resolution = (640, 480)
camera.framerate = 32
rawCap... | 26.539683 | 73 | 0.623206 | from __future__ import print_function
from flask import Flask, Response
from pyzbar import pyzbar
from picamera.array import PiRGBArray
from picamera import PiCamera
from datetime import datetime
import numpy as np
import cv2
import time
camera = PiCamera()
camera.resolution = (640, 480)
camera.framerate = 32
rawCap... | true | true |
790d60c732d0cc1bb267357fc2cc662fad7ff447 | 1,745 | py | Python | tortoise/exceptions.py | asitm9/tortoise-orm | 0d14fc0b86852eed3b96989036938d77d248967c | [
"Apache-2.0"
] | 2 | 2020-06-24T09:30:52.000Z | 2020-09-22T13:45:59.000Z | tortoise/exceptions.py | Tomes111/tortoise-orm | 8b55499a228e44f33fec9099f4d559c77c73beb7 | [
"Apache-2.0"
] | null | null | null | tortoise/exceptions.py | Tomes111/tortoise-orm | 8b55499a228e44f33fec9099f4d559c77c73beb7 | [
"Apache-2.0"
] | null | null | null | class BaseORMException(Exception):
"""
Base ORM Exception.
"""
class FieldError(BaseORMException):
"""
The FieldError exception is raised when there is a problem with a model field.
"""
class ParamsError(BaseORMException):
"""
The ParamsError is raised when function can not be run wi... | 24.236111 | 102 | 0.716905 | class BaseORMException(Exception):
class FieldError(BaseORMException):
class ParamsError(BaseORMException):
class ConfigurationError(BaseORMException):
class TransactionManagementError(BaseORMException):
class OperationalError(BaseORMException):
class IntegrityError(OperationalError):
class NoValuesFetche... | true | true |
790d6164c9ea51e68107b6a91784b90f51447447 | 35,023 | py | Python | jenkins/bootstrap.py | Acidburn0zzz/test-infra | ad19d04798049201a82c70639900bba593e740d6 | [
"Apache-2.0"
] | 1 | 2018-05-25T17:02:06.000Z | 2018-05-25T17:02:06.000Z | jenkins/bootstrap.py | Acidburn0zzz/test-infra | ad19d04798049201a82c70639900bba593e740d6 | [
"Apache-2.0"
] | 3 | 2021-03-20T05:23:47.000Z | 2021-03-20T05:35:10.000Z | jenkins/bootstrap.py | Acidburn0zzz/test-infra | ad19d04798049201a82c70639900bba593e740d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.163655 | 119 | 0.608115 |
"""Bootstraps starting a test job.
The following should already be done:
git checkout http://k8s.io/test-infra
cd $WORKSPACE
test-infra/jenkins/bootstrap.py <--repo=R || --bare> <--job=J> <--pull=P || --branch=B>
The bootstrapper now does the following:
# Note start time
# check out repoe... | false | true |
790d629d64a74f9cb75fd24c59994a2a6d1221e7 | 39,787 | py | Python | test/dialect/mysql/test_reflection.py | lxl0928/timi_sqlalchemy | ebd3abc1e7bc23f211ef11ed05ef821233d066cc | [
"MIT"
] | 1 | 2021-09-04T18:25:05.000Z | 2021-09-04T18:25:05.000Z | test/dialect/mysql/test_reflection.py | lxl0928/timi_sqlalchemy | ebd3abc1e7bc23f211ef11ed05ef821233d066cc | [
"MIT"
] | null | null | null | test/dialect/mysql/test_reflection.py | lxl0928/timi_sqlalchemy | ebd3abc1e7bc23f211ef11ed05ef821233d066cc | [
"MIT"
] | 21 | 2017-11-13T13:23:27.000Z | 2019-10-07T02:00:52.000Z | # coding: utf-8
import re
from sqlalchemy import BigInteger
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import DDL
from sqlalchemy import DefaultClause
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import Index
from sqlalche... | 35.085538 | 79 | 0.487647 |
import re
from sqlalchemy import BigInteger
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import DDL
from sqlalchemy import DefaultClause
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import Index
from sqlalchemy import inspe... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.