hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fa8089d93b66b8aca03d212d92328b5010be8f | 127 | py | Python | spyder_terminal/server/__init__.py | mrclary/spyder-terminal | 45b2a3ca1ebe7aad5fe2d18536199dfb57d43264 | [
"MIT"
] | 169 | 2017-03-12T00:42:45.000Z | 2022-03-16T20:03:55.000Z | spyder_terminal/server/__init__.py | mrclary/spyder-terminal | 45b2a3ca1ebe7aad5fe2d18536199dfb57d43264 | [
"MIT"
] | 200 | 2017-01-12T23:51:27.000Z | 2022-03-29T15:20:12.000Z | spyder_terminal/server/__init__.py | mrclary/spyder-terminal | 45b2a3ca1ebe7aad5fe2d18536199dfb57d43264 | [
"MIT"
] | 70 | 2017-01-13T00:08:59.000Z | 2022-03-31T19:05:47.000Z | """
This packages contains and implements a simple terminal server.
Creates virtual terminals via pexpect and websockets.
"""
| 21.166667 | 63 | 0.787402 | true | true | |
08fa812a556f04a11f7736cabc3fffd34730ae0e | 2,528 | py | Python | graph-tool-2.27/doc/mathjax.py | Znigneering/CSCI-3154 | bc318efc73d2a80025b98f5b3e4f7e4819e952e4 | [
"MIT"
] | 1 | 2015-08-04T19:41:53.000Z | 2015-08-04T19:41:53.000Z | graph-tool/doc/mathjax.py | johankaito/fufuka | 32a96ecf98ce305c2206c38443e58fdec88c788d | [
"Apache-2.0"
] | null | null | null | graph-tool/doc/mathjax.py | johankaito/fufuka | 32a96ecf98ce305c2206c38443e58fdec88c788d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.ext.mathjax
~~~~~~~~~~~~~~~~~~
Set up everything for use of MathJax (http://www.mathjax.org/)
to display math in HTML via JavaScript.
(c) Kevin Dunn, http://connectmv.com
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
from sphinx.app... | 38.892308 | 80 | 0.588212 |
from docutils import nodes
from sphinx.application import ExtensionError
from sphinx.ext.mathbase import setup_math as mathbase_setup
def html_visit_math(self, node):
self.body.append(self.starttag(node, 'span', '', CLASS='math'))
self.body.append(self.builder.config.mathjax_inline[0] + \
... | true | true |
08fa8134976df2e47301db40473c335274592f79 | 74,705 | py | Python | test/integration/smoke/test_accounts.py | marabesi/cloudstack | eaf235de17c09aa522ffc2d82e56fc7bb88b6ba5 | [
"Apache-2.0"
] | 14 | 2015-01-12T13:46:12.000Z | 2021-07-19T19:33:28.000Z | test/integration/smoke/test_accounts.py | marabesi/cloudstack | eaf235de17c09aa522ffc2d82e56fc7bb88b6ba5 | [
"Apache-2.0"
] | 2 | 2015-04-02T21:08:53.000Z | 2015-04-02T21:11:06.000Z | test/integration/smoke/test_accounts.py | marabesi/cloudstack | eaf235de17c09aa522ffc2d82e56fc7bb88b6ba5 | [
"Apache-2.0"
] | 8 | 2015-07-17T12:36:51.000Z | 2018-08-09T16:23:40.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.311851 | 126 | 0.558396 | from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import (random_gen,
cleanup_resources,
validateList)
from marvin.cloudstackAPI import *
from marvin.lib.base import (Domain,
Account,
... | true | true |
08fa81b23102f33904de9a7f2d0db47d9e0e4dba | 4,743 | py | Python | sdk/python/pulumi_azure_native/machinelearningservices/list_workspace_keys.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/list_workspace_keys.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/list_workspace_keys.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 46.960396 | 184 | 0.750791 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'ListWorkspaceKeysResult',
'AwaitableListWorkspaceKeysResult',
'list_workspace_keys',
]
@pulumi.output_type
class ListWorksp... | true | true |
08fa824b49c09acdfe3b69d6b46ab4bb1c49e852 | 729 | py | Python | app/core/management/commands/wait_for_db.py | alanhenschel/chat-app | 96e41f6c14c34e9fc13fee0cbc98376480168bf1 | [
"Apache-2.0"
] | null | null | null | app/core/management/commands/wait_for_db.py | alanhenschel/chat-app | 96e41f6c14c34e9fc13fee0cbc98376480168bf1 | [
"Apache-2.0"
] | null | null | null | app/core/management/commands/wait_for_db.py | alanhenschel/chat-app | 96e41f6c14c34e9fc13fee0cbc98376480168bf1 | [
"Apache-2.0"
] | null | null | null |
import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available"""
def handle(self, *args, **options):
"""Handle th... | 30.375 | 79 | 0.622771 |
import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while n... | true | true |
08fa82e686dde62ea527b5747518f0fca885f61c | 10,130 | py | Python | deps/v8/src/macros.py | loganfsmyth/node | 3288bc953230ba94e2e8bb61c903bbcf60dd810c | [
"BSD-2-Clause"
] | 2,494 | 2015-02-11T04:34:13.000Z | 2022-03-31T14:21:47.000Z | src/third_party/v8/src/macros.py | wujf/mongo | f2f48b749ded0c5585c798c302f6162f19336670 | [
"Apache-2.0"
] | 685 | 2015-02-11T17:14:26.000Z | 2021-04-13T09:58:39.000Z | src/third_party/v8/src/macros.py | wujf/mongo | f2f48b749ded0c5585c798c302f6162f19336670 | [
"Apache-2.0"
] | 442 | 2015-02-12T13:45:46.000Z | 2022-03-21T05:28:05.000Z | # Copyright 2006-2009 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of co... | 42.208333 | 115 | 0.690721 |
const NONE = 0;
const READ_ONLY = 1;
const DONT_ENUM = 2;
const DONT_DELETE = 4;
const GETTER = 0;
const SETTER = 1;
const kApiTagOffset = 0;
const kApiPropertyListOffset = 1;
const kApiSerialNumberOffset = 2;
const kApiConstructorOffset = 2;
const kApiPrototypeTempl... | false | true |
08fa844b38b57a2de48c396d3c8d7eaff17e31e0 | 3,056 | py | Python | currency-exchange/exchange.py | noritakaIzumi/exercism-python | d09c1392d4581b6a9c522fec4598ebb532284fb3 | [
"MIT"
] | null | null | null | currency-exchange/exchange.py | noritakaIzumi/exercism-python | d09c1392d4581b6a9c522fec4598ebb532284fb3 | [
"MIT"
] | null | null | null | currency-exchange/exchange.py | noritakaIzumi/exercism-python | d09c1392d4581b6a9c522fec4598ebb532284fb3 | [
"MIT"
] | null | null | null | """Currency Exchange
https://exercism.org/tracks/python/exercises/currency-exchange
"""
def exchange_money(budget: float, exchange_rate: float) -> float:
"""
:param budget: float - amount of money you are planning to exchange.
:param exchange_rate: float - unit value of the foreign currency.
:retur... | 29.960784 | 99 | 0.680955 |
def exchange_money(budget: float, exchange_rate: float) -> float:
return budget / exchange_rate
def get_change(budget: float, exchanging_value: int) -> float:
return budget - exchanging_value
def get_value_of_bills(denomination: int, number_of_bills: int) -> int:
return denomination * number_of_bil... | true | true |
08fa85535ca6db73c40ba084c39495bbf98698ab | 271 | py | Python | src/ball.py | IamFoka/py_pong | 0942223f2e76de04a9f3c49316140a5f7be9a914 | [
"MIT"
] | 1 | 2019-08-13T22:41:31.000Z | 2019-08-13T22:41:31.000Z | src/ball.py | IamFoka/py_pong | 0942223f2e76de04a9f3c49316140a5f7be9a914 | [
"MIT"
] | null | null | null | src/ball.py | IamFoka/py_pong | 0942223f2e76de04a9f3c49316140a5f7be9a914 | [
"MIT"
] | null | null | null | import pygame
class Ball(pygame.Rect):
def __init__(self, velocity, *args, **kwargs):
self.velocity = velocity
self.angle = 0
super().__init__(*args, **kwargs)
def move(self):
self.x += self.velocity
self.y += self.angle
| 22.583333 | 50 | 0.586716 | import pygame
class Ball(pygame.Rect):
def __init__(self, velocity, *args, **kwargs):
self.velocity = velocity
self.angle = 0
super().__init__(*args, **kwargs)
def move(self):
self.x += self.velocity
self.y += self.angle
| true | true |
08fa85c3bdca430fee9baba037e77969c8595d96 | 1,860 | py | Python | datamodel_code_generator/model/pydantic/base_model.py | konciergeMD/datamodel-code-generator | 898496ea0285b1eccf46c612cd6475779f3e3bd3 | [
"MIT"
] | null | null | null | datamodel_code_generator/model/pydantic/base_model.py | konciergeMD/datamodel-code-generator | 898496ea0285b1eccf46c612cd6475779f3e3bd3 | [
"MIT"
] | null | null | null | datamodel_code_generator/model/pydantic/base_model.py | konciergeMD/datamodel-code-generator | 898496ea0285b1eccf46c612cd6475779f3e3bd3 | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Any, DefaultDict, Dict, List, Mapping, Optional, Union
from datamodel_code_generator.imports import Import
from datamodel_code_generator.model import DataModel, DataModelField
from datamodel_code_generator.model.pydantic.types import get_data_type
from datamodel_code_generat... | 35.09434 | 76 | 0.682796 | from pathlib import Path
from typing import Any, DefaultDict, Dict, List, Mapping, Optional, Union
from datamodel_code_generator.imports import Import
from datamodel_code_generator.model import DataModel, DataModelField
from datamodel_code_generator.model.pydantic.types import get_data_type
from datamodel_code_generat... | true | true |
08fa869ee98b66d2adc73279c8fa036f22fa82d2 | 4,248 | py | Python | alipay/aop/api/response/AlipayEbppIndustryApplyflowQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayEbppIndustryApplyflowQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayEbppIndustryApplyflowQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayEbppIndustryApplyflowQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayEbppIndustryApplyflowQueryResponse, self).__init__()
self._abi... | 29.09589 | 113 | 0.649247 | import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayEbppIndustryApplyflowQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayEbppIndustryApplyflowQueryResponse, self).__init__()
self._ability_code = None
self._apply_flow_no =... | true | true |
08fa8754e283696c8cab5356359bb8893d30f2dd | 1,280 | py | Python | Antipsychotics_drugs.py | Georgekk45/thesis_project | 70bf8b8b591698239108e7b7cdf58ebe6958620b | [
"Apache-2.0"
] | 1 | 2020-09-26T21:28:09.000Z | 2020-09-26T21:28:09.000Z | Antipsychotics_drugs.py | Georgekk45/thesis_project | 70bf8b8b591698239108e7b7cdf58ebe6958620b | [
"Apache-2.0"
] | null | null | null | Antipsychotics_drugs.py | Georgekk45/thesis_project | 70bf8b8b591698239108e7b7cdf58ebe6958620b | [
"Apache-2.0"
] | null | null | null | #! /bin/python2
drugbank_file_path = 'drugbank.xml'
category_to_search = 'Antipsychotic Agents'
path_of_file_to_write = 'id_list.txt'
id_list = []
# first read the file
with open (drugbank_file_path) as inputfile:
# each line is an element of the 'data' list
data = inputfile.readlines()
# now parse the read f... | 37.647059 | 97 | 0.696875 |
drugbank_file_path = 'drugbank.xml'
category_to_search = 'Antipsychotic Agents'
path_of_file_to_write = 'id_list.txt'
id_list = []
with open (drugbank_file_path) as inputfile:
data = inputfile.readlines()
for index, element in enumerate(data):
if '<drug ' in element and '<drugbank-id prima... | true | true |
08fa87ec4d37d140269a950b3b8057662814ae81 | 13,730 | py | Python | cli/src/pcluster/aws/aws_resources.py | francesco-giordano/aws-parallelcluster | a81d0e84c46dc6f620a0cfef17dfe20176da35fb | [
"Apache-2.0"
] | null | null | null | cli/src/pcluster/aws/aws_resources.py | francesco-giordano/aws-parallelcluster | a81d0e84c46dc6f620a0cfef17dfe20176da35fb | [
"Apache-2.0"
] | null | null | null | cli/src/pcluster/aws/aws_resources.py | francesco-giordano/aws-parallelcluster | a81d0e84c46dc6f620a0cfef17dfe20176da35fb | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 35.11509 | 120 | 0.650401 | import logging
from pcluster.constants import (
LUSTRE,
OPENZFS,
PCLUSTER_IMAGE_BUILD_LOG_TAG,
PCLUSTER_IMAGE_CONFIG_TAG,
PCLUSTER_IMAGE_ID_TAG,
PCLUSTER_IMAGE_OS_TAG,
PCLUSTER_NODE_TYPE_TAG,
PCLUSTER_QUEUE_NAME_TAG,
PCLUSTER_S3_BUCKET_TAG,
PCLUSTER_S3_IMAGE_DIR_TAG,
PCLUSTE... | true | true |
08fa87ecf4ddf5c15253b8bce39d90c360de6932 | 5,368 | py | Python | posterior_visualization/aux_plt.py | zehsilva/prior-predictive-specification | 200291ca55469fd7d07df9ba68b82cdd51c31afc | [
"MIT"
] | null | null | null | posterior_visualization/aux_plt.py | zehsilva/prior-predictive-specification | 200291ca55469fd7d07df9ba68b82cdd51c31afc | [
"MIT"
] | null | null | null | posterior_visualization/aux_plt.py | zehsilva/prior-predictive-specification | 200291ca55469fd7d07df9ba68b82cdd51c31afc | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as mpatches
from matplotlib.ticker import FuncFormatter
import seaborn as sns; sns.set(); sns.set(font_scale=1.0); sns.set_style("white");
#import warnings
#warnings.filterwarnings("ignore... | 36.026846 | 124 | 0.621647 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as mpatches
from matplotlib.ticker import FuncFormatter
import seaborn as sns; sns.set(); sns.set(font_scale=1.0); sns.set_style("white");
GREEN = "limegreen"
BLUE = "dodgerblue"
RED = "... | true | true |
08fa8837918f14a01fe7bea6517841efa2dba8cd | 82 | py | Python | CodeWars/8 Kyu/Add Length.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/8 Kyu/Add Length.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/8 Kyu/Add Length.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def add_length(str_):
return ['{} {}'.format(a, len(a)) for a in str_.split()] | 41 | 60 | 0.597561 | def add_length(str_):
return ['{} {}'.format(a, len(a)) for a in str_.split()] | true | true |
08fa889717b237db311dfdcabae406a4d021d842 | 17,698 | py | Python | lightautoml/text/trainer.py | Zhurik/LightAutoML | 506d0602f40eca79ed0e5d58e7d4f71aeb1d8059 | [
"Apache-2.0"
] | null | null | null | lightautoml/text/trainer.py | Zhurik/LightAutoML | 506d0602f40eca79ed0e5d58e7d4f71aeb1d8059 | [
"Apache-2.0"
] | null | null | null | lightautoml/text/trainer.py | Zhurik/LightAutoML | 506d0602f40eca79ed0e5d58e7d4f71aeb1d8059 | [
"Apache-2.0"
] | 1 | 2021-12-08T13:52:45.000Z | 2021-12-08T13:52:45.000Z | """Main pytorch training and prediction class with Snapshots Ensemble."""
from copy import deepcopy
from typing import Optional, Dict, List, Callable, Union, Tuple
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
from tqdm import tqdm
f... | 32.236794 | 127 | 0.541643 |
from copy import deepcopy
from typing import Optional, Dict, List, Callable, Union, Tuple
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
from tqdm import tqdm
from .dp_utils import CustomDataParallel
try:
from apex import amp
exc... | true | true |
08fa896ec7e0dcf677e9b1e61cd22ad05dd7c95f | 7,396 | py | Python | Tests/scripts/utils/tests/log_utils_test.py | shubhamyadav-coditas/content | 9f53434e67eaaf45b5f13a132ce86246842185a9 | [
"MIT"
] | 1 | 2021-08-07T00:21:58.000Z | 2021-08-07T00:21:58.000Z | Tests/scripts/utils/tests/log_utils_test.py | shubhamyadav-coditas/content | 9f53434e67eaaf45b5f13a132ce86246842185a9 | [
"MIT"
] | 1 | 2022-01-19T13:41:51.000Z | 2022-01-19T15:00:05.000Z | Tests/scripts/utils/tests/log_utils_test.py | shubhamyadav-coditas/content | 9f53434e67eaaf45b5f13a132ce86246842185a9 | [
"MIT"
] | 2 | 2020-12-10T12:02:45.000Z | 2020-12-15T09:20:01.000Z | from threading import currentThread, Thread
from Tests.scripts.utils.log_util import ParallelLoggingManager
class TestParallelLoggingManager:
def test_queue_listener_sanity(self, tmp_path):
"""
Given:
- a ParallelLoggingManager
When:
- writing logs to the log file
... | 45.654321 | 116 | 0.654408 | from threading import currentThread, Thread
from Tests.scripts.utils.log_util import ParallelLoggingManager
class TestParallelLoggingManager:
def test_queue_listener_sanity(self, tmp_path):
log_file_path = f'{tmp_path}/log_file.log'
logging_manager = ParallelLoggingManager(log_file_path)
... | true | true |
08fa8a1e37ce3c0f2bae2ab7a0fc4325e85e81c5 | 138 | py | Python | UserAccount/apps.py | sonalibansal/Share-n-care-an-online-student-help-platform | b0eebb069c1e9ae05528678fd2152b36582fd69a | [
"MIT"
] | null | null | null | UserAccount/apps.py | sonalibansal/Share-n-care-an-online-student-help-platform | b0eebb069c1e9ae05528678fd2152b36582fd69a | [
"MIT"
] | null | null | null | UserAccount/apps.py | sonalibansal/Share-n-care-an-online-student-help-platform | b0eebb069c1e9ae05528678fd2152b36582fd69a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class UseraccountConfig(AppConfig):
name = 'UserAccount'
| 17.25 | 39 | 0.804348 | from __future__ import unicode_literals
from django.apps import AppConfig
class UseraccountConfig(AppConfig):
name = 'UserAccount'
| true | true |
08fa8a61880c13286ee2433af130175ec8621226 | 417 | py | Python | algorithm/sub_string.py | Akash671/CodeBlock | 7f430e457324b713158ed69cb207d4cf1e935b15 | [
"CC0-1.0"
] | 1 | 2021-04-26T13:00:18.000Z | 2021-04-26T13:00:18.000Z | algorithm/sub_string.py | Akash671/CodeBlock | 7f430e457324b713158ed69cb207d4cf1e935b15 | [
"CC0-1.0"
] | null | null | null | algorithm/sub_string.py | Akash671/CodeBlock | 7f430e457324b713158ed69cb207d4cf1e935b15 | [
"CC0-1.0"
] | null | null | null | """
author : @akash kumar
github : https://github/Akash671
"""
def subarray(st,s):
if len(s)==0:
return 0
if s not in st:
st.add(s)
for i in range(len(s)):
t=list(s).copy()
t.remove(s[i])
t=''.join(t)
subarray(st,t)
return
if __name__=="__main__":
n=in... | 14.37931 | 32 | 0.498801 |
def subarray(st,s):
if len(s)==0:
return 0
if s not in st:
st.add(s)
for i in range(len(s)):
t=list(s).copy()
t.remove(s[i])
t=''.join(t)
subarray(st,t)
return
if __name__=="__main__":
n=int(input())
s=str(input())
st=set()
subarray(st,s)
f... | true | true |
08fa8a70e5aed482adb389d16410513c5466b733 | 611 | py | Python | application/main/routers/background_task.py | ChikkaUdayaSai/fastapi-template | 79a0b88770c01ee8328bee6a7e00d6e1c5c5b334 | [
"MIT"
] | null | null | null | application/main/routers/background_task.py | ChikkaUdayaSai/fastapi-template | 79a0b88770c01ee8328bee6a7e00d6e1c5c5b334 | [
"MIT"
] | null | null | null | application/main/routers/background_task.py | ChikkaUdayaSai/fastapi-template | 79a0b88770c01ee8328bee6a7e00d6e1c5c5b334 | [
"MIT"
] | 1 | 2021-11-18T07:16:42.000Z | 2021-11-18T07:16:42.000Z | from fastapi import BackgroundTasks
from fastapi.responses import JSONResponse
from fastapi.routing import APIRouter
from application.initializer import logger_instance
from application.main.services.background_service import BackgroundService
router = APIRouter()
logger = logger_instance.get_logger(__name__)
@rout... | 38.1875 | 78 | 0.828151 | from fastapi import BackgroundTasks
from fastapi.responses import JSONResponse
from fastapi.routing import APIRouter
from application.initializer import logger_instance
from application.main.services.background_service import BackgroundService
router = APIRouter()
logger = logger_instance.get_logger(__name__)
@rout... | true | true |
08fa8afc51203e5457365bd75085b14a9a3edb3b | 90 | py | Python | orbit/forecaster/__init__.py | juanitorduz/orbit | 850818077feb7bdfbeee6b49e38bce392ad6b465 | [
"Apache-2.0"
] | null | null | null | orbit/forecaster/__init__.py | juanitorduz/orbit | 850818077feb7bdfbeee6b49e38bce392ad6b465 | [
"Apache-2.0"
] | null | null | null | orbit/forecaster/__init__.py | juanitorduz/orbit | 850818077feb7bdfbeee6b49e38bce392ad6b465 | [
"Apache-2.0"
] | null | null | null | from .map import *
from .svi import *
from .full_bayes import *
from .forecaster import *
| 18 | 25 | 0.733333 | from .map import *
from .svi import *
from .full_bayes import *
from .forecaster import *
| true | true |
08fa8d19c64bc93ec30c9289fd414e873f7e396b | 1,238 | py | Python | tests.py | geospatial-jeff/cognition-datasources-srtm | 057a5d9ea2a6b8b7e740646dbdc2344e5e9da776 | [
"Apache-2.0"
] | null | null | null | tests.py | geospatial-jeff/cognition-datasources-srtm | 057a5d9ea2a6b8b7e740646dbdc2344e5e9da776 | [
"Apache-2.0"
] | null | null | null | tests.py | geospatial-jeff/cognition-datasources-srtm | 057a5d9ea2a6b8b7e740646dbdc2344e5e9da776 | [
"Apache-2.0"
] | null | null | null | from datasources import tests
from SRTM import SRTM
class SRTMTestCases(tests.BaseTestCases):
def _setUp(self):
self.datasource = SRTM
self.spatial = {
"type": "Polygon",
"coordinates": [
[
[
... | 28.790698 | 50 | 0.331987 | from datasources import tests
from SRTM import SRTM
class SRTMTestCases(tests.BaseTestCases):
def _setUp(self):
self.datasource = SRTM
self.spatial = {
"type": "Polygon",
"coordinates": [
[
[
... | true | true |
08fa8d26885c5d09421b6d4c4415ddea05af88ed | 5,724 | py | Python | python2/koans/about_methods.py | danielklintworth/python_koans | 2f8ea0dc5940f539c48899a4e75116186d55d9b6 | [
"MIT"
] | 1 | 2017-05-21T11:47:41.000Z | 2017-05-21T11:47:41.000Z | python2/koans/about_methods.py | danielklintworth/python_koans | 2f8ea0dc5940f539c48899a4e75116186d55d9b6 | [
"MIT"
] | null | null | null | python2/koans/about_methods.py | danielklintworth/python_koans | 2f8ea0dc5940f539c48899a4e75116186d55d9b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMethods in the Ruby Koans
#
from runner.koan import *
def my_global_function(a, b):
return a + b
class AboutMethods(Koan):
def test_calling_a_global_function(self):
self.assertEqual(5, my_global_function(2, 3))
# NOTE: ... | 33.670588 | 140 | 0.594514 |
from runner.koan import *
def my_global_function(a, b):
return a + b
class AboutMethods(Koan):
def test_calling_a_global_function(self):
self.assertEqual(5, my_global_function(2, 3))
def test_calling_functions_with_wrong_number_of_arguments(self):
try:
my_global_fu... | true | true |
08fa8d9b20910ce2ff5410e8d7757043ff98a92c | 3,404 | py | Python | src/slack/slack_json_factories/resp_json/attachment.py | yejingyu/jama-slack-integration | 55d1366d6cde3962e788afebe0001747cbe11fe8 | [
"MIT"
] | 1 | 2019-07-30T01:41:53.000Z | 2019-07-30T01:41:53.000Z | src/slack/slack_json_factories/resp_json/attachment.py | yejingyu/jama-slack-integration | 55d1366d6cde3962e788afebe0001747cbe11fe8 | [
"MIT"
] | 4 | 2018-11-16T05:56:06.000Z | 2018-11-29T05:07:52.000Z | src/slack/slack_json_factories/resp_json/attachment.py | yejingyu/jama-slack-integration | 55d1366d6cde3962e788afebe0001747cbe11fe8 | [
"MIT"
] | 6 | 2018-11-08T03:49:28.000Z | 2019-04-29T19:53:25.000Z | import os
def attachment_fail_response(item_id, description, response=None):
"""
Function takes in an item id, comment content, and a JSON object to create a message for Slack user.
See below link for documentation:
https://api.slack.com/docs/messages#composing_messages
Args:
item_id (stri... | 38.247191 | 114 | 0.573737 | import os
def attachment_fail_response(item_id, description, response=None):
resp = {
"text": "Can not upload attachment to item (id: " + item_id + ")",
"attachments": [
{
"title": "Description content",
"text": description
},
... | true | true |
08fa8e2e877590ac4d07054de5939c2d9eb19441 | 29,435 | py | Python | cinder/tests/test_fujitsu.py | kazum/cinder | 370b8e60c3166b289c8da924a227dd1bc63f8b8a | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_fujitsu.py | kazum/cinder | 370b8e60c3166b289c8da924a227dd1bc63f8b8a | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_fujitsu.py | kazum/cinder | 370b8e60c3166b289c8da924a227dd1bc63f8b8a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 FUJITSU LIMITED
# Copyright (c) 2012 EMC Corporation, 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.o... | 36.339506 | 79 | 0.632614 |
import os
import tempfile
import mock
from cinder import exception
from cinder.i18n import _LW
from cinder.openstack.common import log as logging
from cinder import test
import cinder.volume.drivers.fujitsu.eternus_dx_common as eternus_dx_common
import cinder.volume.drivers.fujitsu.eternus_dx_fc as eternus_dx_fc
imp... | false | true |
08fa8ea02944cac1116cabb9a636ee991a8cd1ad | 2,019 | py | Python | algorithms/dp/fib.py | E-G-C/algorithms | 5f1a7863818b016a62ff03a45980f7ec8a970a07 | [
"MIT"
] | 2 | 2022-03-05T17:08:14.000Z | 2022-03-10T07:15:58.000Z | algorithms/dp/fib.py | E-G-C/algorithms | 5f1a7863818b016a62ff03a45980f7ec8a970a07 | [
"MIT"
] | null | null | null | algorithms/dp/fib.py | E-G-C/algorithms | 5f1a7863818b016a62ff03a45980f7ec8a970a07 | [
"MIT"
] | null | null | null | '''
In mathematics, the Fibonacci numbers, commonly denoted Fn,
form a sequence, called the Fibonacci sequence,
such that each number is the sum of the two preceding ones,
starting from 0 and 1.
That is,
F0=0 , F1=1
and
Fn= F(n-1) + F(n-2)
The Fibonacci numbers are the numbers in the following integer sequence.... | 21.709677 | 72 | 0.614165 |
def fib_recursive(n):
assert n >= 0, 'n must be a positive integer'
if n <= 1:
return n
return fib_recursive(n-1) + fib_recursive(n-2)
def fib_list(n):
assert n >= 0, 'n must be a positive integer'
list_results = [0, 1]
for i in range(2, n+1):
list_results.append... | true | true |
08fa8ea19b8c34891ea8a1c53ab6831ebbaacb44 | 556 | py | Python | Spider/PocketLifeSpider/PocketLifeSpider/util/TypeUtils.py | wpwbb510582246/PocketFIlm | 356d057810fd48a77197fe0f00b1f2adccb02d39 | [
"MIT"
] | 17 | 2019-09-11T08:37:26.000Z | 2021-08-17T12:08:54.000Z | Spider/PocketLifeSpider/PocketLifeSpider/util/TypeUtils.py | wpwbb510582246/PocketFIlm | 356d057810fd48a77197fe0f00b1f2adccb02d39 | [
"MIT"
] | 20 | 2021-09-04T10:40:51.000Z | 2022-03-12T00:52:48.000Z | QQAlbumDownloader/util/TypeUtils.py | wpwbb510582246/QQAlbumDownloader | 29e8b71c5b46a8084b80e81179454e92b9058c1a | [
"MIT"
] | 8 | 2020-03-17T08:17:35.000Z | 2021-07-30T15:48:36.000Z |
class TypeUtils:
# 判断变量类型的函数
def typeof(variate):
type = None
if isinstance(variate, int):
type = "int"
elif isinstance(variate, str):
type = "str"
elif isinstance(variate, float):
type = "float"
elif isinstance(variate, list):
... | 27.8 | 40 | 0.510791 |
class TypeUtils:
def typeof(variate):
type = None
if isinstance(variate, int):
type = "int"
elif isinstance(variate, str):
type = "str"
elif isinstance(variate, float):
type = "float"
elif isinstance(variate, list):
type = ... | true | true |
08fa8f53584ef7d0118ec9e6945a8b2c5fd21d11 | 620 | py | Python | lib/services/server/setup.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/server/setup.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/server/setup.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
server
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from setuptools import setup, find_packages # noqa: H301
NAME = "ncloud-server"
VERSION = "1.1.3"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http... | 18.787879 | 75 | 0.675806 |
from setuptools import setup, find_packages
NAME = "ncloud-server"
VERSION = "1.1.3"
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
version=VERSION,
description="server",
keywords=["server"],
install_requires=REQUIRES,
packages=find_packages(... | true | true |
08fa8fc4e556f0d69d5f53ed5ea7b1870d38f7d8 | 2,149 | py | Python | examples/python/groveeldriver.py | g-vidal/upm | 8115c3b64468f22fb27053ba9dfc952ae0e32633 | [
"MIT"
] | 2 | 2017-06-19T13:14:30.000Z | 2018-07-12T06:17:49.000Z | examples/python/groveeldriver.py | g-vidal/upm | 8115c3b64468f22fb27053ba9dfc952ae0e32633 | [
"MIT"
] | 1 | 2018-11-13T18:03:56.000Z | 2018-11-14T18:17:57.000Z | examples/python/groveeldriver.py | g-vidal/upm | 8115c3b64468f22fb27053ba9dfc952ae0e32633 | [
"MIT"
] | 4 | 2017-03-06T14:39:59.000Z | 2018-06-28T11:07:41.000Z | #!/usr/bin/env python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | 35.229508 | 82 | 0.724988 |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_groveeldriver as upmGroveeldriver
def main():
myEldriver = upmGroveeldriver.GroveElDriver(2)
def SIGINTHandler(signum, frame):
raise SystemExit
def exitHandler():
print("Exiti... | true | true |
08fa8fd022a7526b05fcc5ec1d614a2a81c2f7e4 | 317 | py | Python | evaluation/npi-list-comprehension_2.py | sdlab-naist/Teddy-plus | 367aadbb30b80e1680156b88017f9bb2d78c539a | [
"0BSD"
] | null | null | null | evaluation/npi-list-comprehension_2.py | sdlab-naist/Teddy-plus | 367aadbb30b80e1680156b88017f9bb2d78c539a | [
"0BSD"
] | 65 | 2020-01-30T10:58:48.000Z | 2020-04-30T03:37:58.000Z | evaluation/npi-list-comprehension_2.py | MUICT-SERU/SP2019-TEDDY | 367aadbb30b80e1680156b88017f9bb2d78c539a | [
"ISC"
] | 1 | 2021-01-15T08:18:23.000Z | 2021-01-15T08:18:23.000Z | # Source: https://www.geeksforgeeks.org/comprehensions-in-python/
input_list = [1, 2, 3, 4, 5, 6, 7]
output_list = list()
# Using loop for constructing output dictionary
for var in input_list:
if var % 2 != 0:
output_dict[var] = var**3
print("Output Dictionary using for loop:", output_dict ) | 28.818182 | 65 | 0.665615 | input_list = [1, 2, 3, 4, 5, 6, 7]
output_list = list()
for var in input_list:
if var % 2 != 0:
output_dict[var] = var**3
print("Output Dictionary using for loop:", output_dict ) | true | true |
08fa910ddcb0cf07bdae876c04a3125717e20e65 | 1,502 | py | Python | CalculadoraSimples/calculadora.py | Drawiin/estrutura-de-dados | 41531709346c41397d7b87c9a9664401dfbd593f | [
"MIT"
] | 1 | 2020-03-31T00:21:14.000Z | 2020-03-31T00:21:14.000Z | CalculadoraSimples/calculadora.py | Drawiin/estrutura-de-dados | 41531709346c41397d7b87c9a9664401dfbd593f | [
"MIT"
] | null | null | null | CalculadoraSimples/calculadora.py | Drawiin/estrutura-de-dados | 41531709346c41397d7b87c9a9664401dfbd593f | [
"MIT"
] | null | null | null | def menu():
print('''
1- converter decimal para binário
2- converter binario para decimal
3- converter decimal para hexadecimal
4- converter hexadecimal para decimal
5- sair
''')
op = int(input())
return op
def decBinario(n):
numeroBinario = ''
while n != 0:
numeroB... | 22.088235 | 81 | 0.490679 | def menu():
print('''
1- converter decimal para binário
2- converter binario para decimal
3- converter decimal para hexadecimal
4- converter hexadecimal para decimal
5- sair
''')
op = int(input())
return op
def decBinario(n):
numeroBinario = ''
while n != 0:
numeroB... | true | true |
08fa912d9c44dac5f9cf3bf18a4b0bc3d7bd71db | 13,357 | py | Python | ManufacturingNet/shallow_learning_methods/all_classification_models.py | RishikeshMagar/ManufacturingNet | 96e8624f0932123968d599a3b7c6511cd03a349d | [
"MIT"
] | null | null | null | ManufacturingNet/shallow_learning_methods/all_classification_models.py | RishikeshMagar/ManufacturingNet | 96e8624f0932123968d599a3b7c6511cd03a349d | [
"MIT"
] | null | null | null | ManufacturingNet/shallow_learning_methods/all_classification_models.py | RishikeshMagar/ManufacturingNet | 96e8624f0932123968d599a3b7c6511cd03a349d | [
"MIT"
] | null | null | null | from contextlib import redirect_stderr, redirect_stdout
import io
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
from s... | 39.285294 | 122 | 0.645429 | from contextlib import redirect_stderr, redirect_stdout
import io
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
from s... | true | true |
08fa916720bb66cc3bfe6a3d748f2cc01ea8dac8 | 7,658 | py | Python | arelle/DialogLanguage.py | kris2kris/Arelle | d8eadc50bd90c1385d9191f6e0fa8e2dce7cfbd3 | [
"Apache-2.0"
] | 3 | 2015-03-29T01:39:44.000Z | 2021-10-05T23:08:01.000Z | arelle/DialogLanguage.py | selgamal/Arelle | 77d0a5c8dfea2f4b9830619af5a99b34c75f7636 | [
"Apache-2.0"
] | null | null | null | arelle/DialogLanguage.py | selgamal/Arelle | 77d0a5c8dfea2f4b9830619af5a99b34c75f7636 | [
"Apache-2.0"
] | 2 | 2015-03-30T16:17:31.000Z | 2019-06-18T15:16:47.000Z | '''
Created on Apr 7, 2012
@author: Mark V Systems Limited
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
import os
from tkinter import Toplevel, StringVar, N, S, E, W, EW, messagebox
try:
from tkinter.ttk import Frame, Button, Label, Entry
except ImportError:
from ttk import Frame, Button... | 48.163522 | 181 | 0.604335 | import os
from tkinter import Toplevel, StringVar, N, S, E, W, EW, messagebox
try:
from tkinter.ttk import Frame, Button, Label, Entry
except ImportError:
from ttk import Frame, Button, Label, Entry
from arelle.CntlrWinTooltip import ToolTip
from arelle.Locale import setDisableRTL
from arelle.UiUtil import grid... | true | true |
08fa91c67a00eb2ec61222d501cb783068c855f3 | 747 | py | Python | .history/my_classes/FirstClassFunctions/LambdaExpressions_20210704035002.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/LambdaExpressions_20210704035002.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/LambdaExpressions_20210704035002.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """[Lambda Expressions]
Lambda expressions are simply another way to create functions anonymous functions
keyword \ parameter list optional
\ \ the : is required, even for zero arguments
\ \ / / this expression is evaluated and returned when the lamb... | 26.678571 | 161 | 0.60241 | """[Lambda Expressions]
Lambda expressions are simply another way to create functions anonymous functions
keyword \ parameter list optional
\ \ the : is required, even for zero arguments
\ \ / / this expression is evaluated and returned when the lamb... | false | true |
08fa91d1d522446e697d17dfeb99b4989fbe0a92 | 2,998 | py | Python | wadeem/hooks.py | siddhantsinha-oodles/wadeem | 9076ff3bc05c3d4bc765c4f206d5e29f03cb257b | [
"MIT"
] | null | null | null | wadeem/hooks.py | siddhantsinha-oodles/wadeem | 9076ff3bc05c3d4bc765c4f206d5e29f03cb257b | [
"MIT"
] | null | null | null | wadeem/hooks.py | siddhantsinha-oodles/wadeem | 9076ff3bc05c3d4bc765c4f206d5e29f03cb257b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "wadeem"
app_title = "Wadeem"
app_publisher = "Siddhant"
app_description = "LMS"
app_icon = "octicon octicon-file-directory"
app_color = "pink"
app_email = "siddhant.sinha@oodlestechnologies.com"
app_lic... | 23.061538 | 78 | 0.670781 | from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "wadeem"
app_title = "Wadeem"
app_publisher = "Siddhant"
app_description = "LMS"
app_icon = "octicon octicon-file-directory"
app_color = "pink"
app_email = "siddhant.sinha@oodlestechnologies.com"
app_license = "MIT"
... | true | true |
08fa91fb67bbc26e2bcd379a574d561e3b2a018d | 539 | py | Python | sonosrestapi/playlist.py | hallo02/sonos-rest-api-wrapper | 6d2dca7dcf4b778c5cda57703df5f1c8eacb58e9 | [
"MIT"
] | null | null | null | sonosrestapi/playlist.py | hallo02/sonos-rest-api-wrapper | 6d2dca7dcf4b778c5cda57703df5f1c8eacb58e9 | [
"MIT"
] | null | null | null | sonosrestapi/playlist.py | hallo02/sonos-rest-api-wrapper | 6d2dca7dcf4b778c5cda57703df5f1c8eacb58e9 | [
"MIT"
] | 1 | 2019-10-13T09:45:35.000Z | 2019-10-13T09:45:35.000Z |
class Playlist:
def __init__ (self, id, name, type, trackcount, mySonos, houshold_id):
self.id = id
self.name = name
self.type = type
self.trackcount = trackcount
self.tracks = []
self.mySonos = mySonos
self.houshold_id = houshold_id
def load_tracks (se... | 28.368421 | 77 | 0.58256 |
class Playlist:
def __init__ (self, id, name, type, trackcount, mySonos, houshold_id):
self.id = id
self.name = name
self.type = type
self.trackcount = trackcount
self.tracks = []
self.mySonos = mySonos
self.houshold_id = houshold_id
def load_tracks (se... | true | true |
08fa929d0e69f63d3bde495208060248e42b0da3 | 6,205 | py | Python | test/functional/mempool_updatefromblock.py | ruvcoindev/ruvchain | 9c7c17823b1efb612e0adeb92f0cb1c62859f840 | [
"MIT"
] | 1 | 2022-03-18T17:26:58.000Z | 2022-03-18T17:26:58.000Z | test/functional/mempool_updatefromblock.py | ruvcoindev/ruvchain | 9c7c17823b1efb612e0adeb92f0cb1c62859f840 | [
"MIT"
] | null | null | null | test/functional/mempool_updatefromblock.py | ruvcoindev/ruvchain | 9c7c17823b1efb612e0adeb92f0cb1c62859f840 | [
"MIT"
] | 1 | 2022-01-17T09:17:52.000Z | 2022-01-17T09:17:52.000Z | #!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool descendants/ancestors information update.
Test mempool update of transaction descendants/ances... | 50.040323 | 145 | 0.626753 | import time
from decimal import Decimal
from test_framework.test_framework import RuvchainTestFramework
from test_framework.util import assert_equal
class MempoolUpdateFromBlockTest(RuvchainTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.extra_args = [['-limitdescendantsize=100... | true | true |
08fa9441af7bc1cccbc4d5a3f73df848e1349477 | 7,789 | py | Python | plugins/modules/oci_log_analytics_category_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_log_analytics_category_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_log_analytics_category_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 31.031873 | 153 | 0.647965 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_log_analytics_category_facts
short_description: Fetches details about one or mu... | true | true |
08fa954bca0cbfec133ea15df2f09f3c11d50026 | 5,317 | py | Python | build/plugins/swig.py | neer201/catboost_SE | 091d44aed29ebb40a4bf76ef67ee22cf9779263e | [
"Apache-2.0"
] | null | null | null | build/plugins/swig.py | neer201/catboost_SE | 091d44aed29ebb40a4bf76ef67ee22cf9779263e | [
"Apache-2.0"
] | null | null | null | build/plugins/swig.py | neer201/catboost_SE | 091d44aed29ebb40a4bf76ef67ee22cf9779263e | [
"Apache-2.0"
] | null | null | null | import re
import os
import _import_wrapper as iw
import _common as common
_SWIG_LIB_PATH = 'contrib/tools/swig/Lib'
_PREDEFINED_INCLUDES = [
os.path.join(_SWIG_LIB_PATH, 'python', 'python.swg'),
os.path.join(_SWIG_LIB_PATH, 'swig.swg'),
]
class Swig(iw.CustomCommand):
def __init__(self, path, unit):
... | 36.170068 | 150 | 0.580402 | import re
import os
import _import_wrapper as iw
import _common as common
_SWIG_LIB_PATH = 'contrib/tools/swig/Lib'
_PREDEFINED_INCLUDES = [
os.path.join(_SWIG_LIB_PATH, 'python', 'python.swg'),
os.path.join(_SWIG_LIB_PATH, 'swig.swg'),
]
class Swig(iw.CustomCommand):
def __init__(self, path, unit):
... | true | true |
08fa959ed12cf1cc31550719c0b0f225eaf0cf88 | 115,093 | py | Python | sympy/core/numbers.py | Syed-Areeb-Wadood/sympy | 4f9d65448af6e1f1c794d1bdeaec4abfb72796f1 | [
"BSD-3-Clause"
] | 2 | 2019-03-13T04:33:31.000Z | 2021-04-14T02:48:40.000Z | sympy/core/numbers.py | Syed-Areeb-Wadood/sympy | 4f9d65448af6e1f1c794d1bdeaec4abfb72796f1 | [
"BSD-3-Clause"
] | 2 | 2019-03-08T04:50:30.000Z | 2019-03-14T02:34:29.000Z | sympy/core/numbers.py | Syed-Areeb-Wadood/sympy | 4f9d65448af6e1f1c794d1bdeaec4abfb72796f1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
import decimal
import fractions
import math
import re as regex
from .containers import Tuple
from .sympify import converter, sympify, _sympify, SympifyError, _convert_numpy_types
from .singleton import S, Singleton
from .expr import Expr, AtomicExpr
from .decorators imp... | 29.855512 | 108 | 0.561529 | from __future__ import print_function, division
import decimal
import fractions
import math
import re as regex
from .containers import Tuple
from .sympify import converter, sympify, _sympify, SympifyError, _convert_numpy_types
from .singleton import S, Singleton
from .expr import Expr, AtomicExpr
from .decorators imp... | true | true |
08fa984d8a9124e5a33ad5ea46d77fdccbae2125 | 10,042 | py | Python | src/models/unets_do.py | Vole1/MC-CDP-BraTS2018 | 32430dc87d40c8d1f41092598c839e0b34f32e7c | [
"MIT"
] | 1 | 2021-12-29T09:11:12.000Z | 2021-12-29T09:11:12.000Z | src/models/unets_do.py | Vole1/MC-CDP-BraTS2018 | 32430dc87d40c8d1f41092598c839e0b34f32e7c | [
"MIT"
] | null | null | null | src/models/unets_do.py | Vole1/MC-CDP-BraTS2018 | 32430dc87d40c8d1f41092598c839e0b34f32e7c | [
"MIT"
] | null | null | null | from models.nasnet_do import NASNet_large_do
from models.xception_padding import Xception
from tensorflow.keras import Model
from tensorflow.keras.applications import DenseNet169
from tensorflow.keras.layers import UpSampling2D, Conv2D, BatchNormalization, Activation, concatenate, Add
from tensorflow.keras.utils import... | 44.830357 | 120 | 0.671679 | from models.nasnet_do import NASNet_large_do
from models.xception_padding import Xception
from tensorflow.keras import Model
from tensorflow.keras.applications import DenseNet169
from tensorflow.keras.layers import UpSampling2D, Conv2D, BatchNormalization, Activation, concatenate, Add
from tensorflow.keras.utils import... | true | true |
08fa989fcf2698a4fd5f0d1c60272418a9e3f60d | 15,764 | py | Python | python/ccxt/deribit.py | Richard-L-Johnson/ccxt1 | 903aa1288694f9192b15d22b945508661bdc8807 | [
"MIT"
] | 13 | 2019-01-26T14:41:37.000Z | 2022-03-26T03:33:12.000Z | python/ccxt/deribit.py | Richard-L-Johnson/ccxt1 | 903aa1288694f9192b15d22b945508661bdc8807 | [
"MIT"
] | 17 | 2018-10-02T04:43:13.000Z | 2018-11-01T17:07:37.000Z | python/ccxt/deribit.py | Richard-L-Johnson/ccxt1 | 903aa1288694f9192b15d22b945508661bdc8807 | [
"MIT"
] | 12 | 2018-12-24T02:19:02.000Z | 2022-03-26T05:04:25.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
cl... | 39.60804 | 186 | 0.498731 |
from ccxt.base.exchange import Exchange
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
class deribit (Exchange):
def describe(self):
return self.deep_extend(super(deribit, self).describe(), {
'id': 'deribit',
'name': 'Deribit',
... | true | true |
08fa99e9418ef133461521b66ea73308b4653723 | 5,356 | py | Python | src/tf_model_zoo/bninception/parse_caffe.py | KeVincenty/single_timestamps_action_recognition | 35a60bba81d2875a46e94bef247cd3554cc3f08b | [
"CC-BY-4.0"
] | null | null | null | src/tf_model_zoo/bninception/parse_caffe.py | KeVincenty/single_timestamps_action_recognition | 35a60bba81d2875a46e94bef247cd3554cc3f08b | [
"CC-BY-4.0"
] | null | null | null | src/tf_model_zoo/bninception/parse_caffe.py | KeVincenty/single_timestamps_action_recognition | 35a60bba81d2875a46e94bef247cd3554cc3f08b | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
import argparse
parser = argparse.ArgumentParser(description="Convert a Caffe model and its learned parameters to torch")
parser.add_argument('model', help='network spec, usually a ProtoBuf text message')
parser.add_argument('weights', help='network parameters, usually in a name like *.caffemode... | 33.475 | 105 | 0.558439 |
import argparse
parser = argparse.ArgumentParser(description="Convert a Caffe model and its learned parameters to torch")
parser.add_argument('model', help='network spec, usually a ProtoBuf text message')
parser.add_argument('weights', help='network parameters, usually in a name like *.caffemodel ')
parser.add_argume... | true | true |
08fa9a95e69e15b53f8d8d4be650669705992fac | 1,070 | py | Python | kubernetes/test/test_v1beta1_cluster_role_binding_list.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2019-07-12T05:38:06.000Z | 2019-07-12T05:38:06.000Z | kubernetes/test/test_v1beta1_cluster_role_binding_list.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_cluster_role_binding_list.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2021-05-18T12:25:56.000Z | 2021-05-18T12:25:56.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 23.777778 | 107 | 0.738318 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1beta1_cluster_role_binding_list import V1beta1ClusterRoleBindingList
class TestV1beta1ClusterRoleBindingList(unittest.TestCase):
... | true | true |
08fa9ace78810bd1f264c7dbbde3f8ec3e17d066 | 5,547 | py | Python | random/simple.py | LukeBailey181/addax | 8a1e855c34f6c836f7dc06157f37416d0b16750c | [
"MIT"
] | 3 | 2020-12-09T17:54:29.000Z | 2021-12-17T13:02:37.000Z | random/simple.py | LukeBailey181/addax | 8a1e855c34f6c836f7dc06157f37416d0b16750c | [
"MIT"
] | null | null | null | random/simple.py | LukeBailey181/addax | 8a1e855c34f6c836f7dc06157f37416d0b16750c | [
"MIT"
] | 2 | 2020-12-09T17:55:13.000Z | 2020-12-09T17:55:17.000Z | import os
import time
import random
from addax.data_structures.graph import Graph
from addax.utilities.dataIO import WriteGraph
from addax.visualize.graph import VisualizeGraph
def GenerateSimpleRandomGraphs(N, nnodes, nedges, directed):
"""
Generate a simple random graph that randomly chooses edges to co... | 39.906475 | 153 | 0.680548 | import os
import time
import random
from addax.data_structures.graph import Graph
from addax.utilities.dataIO import WriteGraph
from addax.visualize.graph import VisualizeGraph
def GenerateSimpleRandomGraphs(N, nnodes, nedges, directed):
for ii in range(N):
vertex_indices = random.sample(rang... | true | true |
08fa9b83633f3a1520b8409947cdb60231113823 | 9,161 | py | Python | moduledependency/cli.py | DonaldWhyte/module-dependency | 0c4a1bddf3901340f44c28501ff677f2e9caef70 | [
"MIT"
] | 5 | 2015-08-12T15:36:27.000Z | 2021-06-27T22:49:00.000Z | moduledependency/cli.py | DonaldWhyte/module-dependency | 0c4a1bddf3901340f44c28501ff677f2e9caef70 | [
"MIT"
] | null | null | null | moduledependency/cli.py | DonaldWhyte/module-dependency | 0c4a1bddf3901340f44c28501ff677f2e9caef70 | [
"MIT"
] | 1 | 2016-09-20T07:05:08.000Z | 2016-09-20T07:05:08.000Z | """Contains functionality for parsing commmand line arguments
into data that can be retrieved easily.
"""
import os
import re
from copy import deepcopy
class ArgumentProcessor:
"""Processes command line arguments and stores processed data in fields that can be accessed."""
# Options that must ... | 34.965649 | 116 | 0.59273 |
import os
import re
from copy import deepcopy
class ArgumentProcessor:
MANDATORY_OPTIONS = [("p", "project")]
USAGE_MESSAGE = """
Usage: python test.py
Type -h or --help to display this message.
===REQUIRED ARGUMENTS===
Set project to generate dependencies ... | true | true |
08fa9c25612b29fc8bbbd83c1963d31b8dada213 | 1,546 | py | Python | solution/76. minimum-window-substring.py | sundaycat/Leetcode-Practice | 65c3ab0f967331a095fd8a6eb2f3d7765cbf7d5a | [
"MIT"
] | null | null | null | solution/76. minimum-window-substring.py | sundaycat/Leetcode-Practice | 65c3ab0f967331a095fd8a6eb2f3d7765cbf7d5a | [
"MIT"
] | null | null | null | solution/76. minimum-window-substring.py | sundaycat/Leetcode-Practice | 65c3ab0f967331a095fd8a6eb2f3d7765cbf7d5a | [
"MIT"
] | null | null | null | '''
Add variable to keep track of the minimum substring
s: string
t: pattern
Input: s = "ADOBECODEBANC", t = "ABC" Output: "BANC"
'''
import math
class Solution:
def minWindow(self, s: str, pattern: str) -> str:
char_freq = {}
for i in range(len(pattern)):
char = pattern[i]... | 27.122807 | 71 | 0.445019 | import math
class Solution:
def minWindow(self, s: str, pattern: str) -> str:
char_freq = {}
for i in range(len(pattern)):
char = pattern[i]
if char not in char_freq:
char_freq[char] = 0
char_freq[char] += 1
start, end, ... | true | true |
08fa9d5cc65053803cc39950cb539737b1aeb813 | 18,369 | py | Python | chinese-books/converter.py | keanemachine/python-epub-builder | 85238e6708b50e4efc9cd538b31a7938969f2923 | [
"BSD-2-Clause"
] | 1 | 2016-05-22T13:54:37.000Z | 2016-05-22T13:54:37.000Z | chinese-books/converter.py | keanemachine/python-epub-builder | 85238e6708b50e4efc9cd538b31a7938969f2923 | [
"BSD-2-Clause"
] | null | null | null | chinese-books/converter.py | keanemachine/python-epub-builder | 85238e6708b50e4efc9cd538b31a7938969f2923 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python2
import sys, os.path
from pdfdevice import PDFDevice, PDFTextDevice
from pdffont import PDFUnicodeNotDefined
from pdftypes import LITERALS_DCT_DECODE
from pdfcolor import LITERAL_DEVICE_GRAY, LITERAL_DEVICE_RGB
from layout import LTContainer, LTPage, LTText, LTLine, LTRect, LTPolygon
from layout i... | 38.671579 | 110 | 0.533126 | import sys, os.path
from pdfdevice import PDFDevice, PDFTextDevice
from pdffont import PDFUnicodeNotDefined
from pdftypes import LITERALS_DCT_DECODE
from pdfcolor import LITERAL_DEVICE_GRAY, LITERAL_DEVICE_RGB
from layout import LTContainer, LTPage, LTText, LTLine, LTRect, LTPolygon
from layout import LTFigure, LTImage... | true | true |
08fa9d7e37ffc2479a190be33b76f1cf8c5c0c64 | 140 | py | Python | testers/__init__.py | pandrei7/cf-tests | 4211d2f8c94730a63ceb960cfe487d9d13f9596b | [
"MIT"
] | null | null | null | testers/__init__.py | pandrei7/cf-tests | 4211d2f8c94730a63ceb960cfe487d9d13f9596b | [
"MIT"
] | 2 | 2020-04-28T16:50:43.000Z | 2020-09-13T10:36:08.000Z | testers/__init__.py | pandrei7/cf-tests | 4211d2f8c94730a63ceb960cfe487d9d13f9596b | [
"MIT"
] | null | null | null | """This package exports various tester classes."""
from .reasonable_tester import ReasonableTester
from .strict_tester import StrictTester
| 28 | 50 | 0.828571 |
from .reasonable_tester import ReasonableTester
from .strict_tester import StrictTester
| true | true |
08fa9df441833ddaf16439a24464c46354c4a5d7 | 15,951 | py | Python | Doc/tools/extensions/pyspecific.py | ShivayStark/cpython | 37aa35e9eaca4947d8a298a3247469c66f4891f9 | [
"PSF-2.0"
] | 1 | 2020-04-25T07:55:21.000Z | 2020-04-25T07:55:21.000Z | Doc/tools/extensions/pyspecific.py | ShivayStark/cpython | 37aa35e9eaca4947d8a298a3247469c66f4891f9 | [
"PSF-2.0"
] | null | null | null | Doc/tools/extensions/pyspecific.py | ShivayStark/cpython | 37aa35e9eaca4947d8a298a3247469c66f4891f9 | [
"PSF-2.0"
] | 1 | 2019-10-08T12:57:48.000Z | 2019-10-08T12:57:48.000Z | # -*- coding: utf-8 -*-
"""
pyspecific.py
~~~~~~~~~~~~~
Sphinx extension with Python doc-specific markup.
:copyright: 2008-2014 by Georg Brandl.
:license: Python license.
"""
import re
import io
from os import path
from time import asctime
from pprint import pformat
from docutils.io import String... | 36.334852 | 90 | 0.64322 |
import re
import io
from os import path
from time import asctime
from pprint import pformat
from docutils.io import StringOutput
from docutils.parsers.rst import Directive
from docutils.utils import new_document
from docutils import nodes, utils
from sphinx import addnodes
from sphinx.builders import Builder
from sp... | true | true |
08fa9eef286acbfc8f9369c71fa412cc1c9ce455 | 1,640 | py | Python | workflow/tests/test_workflow.py | ajshedivy/tps | 8378fac392a4b20268c6033a920c84802f9938af | [
"MIT"
] | null | null | null | workflow/tests/test_workflow.py | ajshedivy/tps | 8378fac392a4b20268c6033a920c84802f9938af | [
"MIT"
] | 23 | 2019-12-16T16:38:12.000Z | 2022-02-15T16:20:45.000Z | workflow/tests/test_workflow.py | ajshedivy/tps | 8378fac392a4b20268c6033a920c84802f9938af | [
"MIT"
] | null | null | null | import os
import subprocess
class TestWorkflow:
@classmethod
def setup_method(self):
self.tps_root = os.getcwd()
self.config = os.path.join(
self.tps_root, 'workflow', 'tests', 'test_standards', 'test_default_config.yaml'
)
self.tps_runner = os.path.join(self.tps_... | 32.156863 | 92 | 0.593293 | import os
import subprocess
class TestWorkflow:
@classmethod
def setup_method(self):
self.tps_root = os.getcwd()
self.config = os.path.join(
self.tps_root, 'workflow', 'tests', 'test_standards', 'test_default_config.yaml'
)
self.tps_runner = os.path.join(self.tps_... | true | true |
08fa9f1bab5c2b7e24c9d8eedf6fc450ded1390f | 711 | py | Python | detection/configs/retinanet_dpt_s_fpn_1x_coco.py | CASIA-IVA-Lab/DPT | 62e6322b42f8de35d215aa3cdd458088161b5949 | [
"Apache-2.0"
] | 85 | 2021-07-07T06:54:06.000Z | 2022-03-08T03:03:37.000Z | detection/configs/retinanet_dpt_s_fpn_1x_coco.py | CASIA-IVA-Lab/DPT | 62e6322b42f8de35d215aa3cdd458088161b5949 | [
"Apache-2.0"
] | 11 | 2021-08-10T12:14:21.000Z | 2022-03-03T01:39:20.000Z | detection/configs/retinanet_dpt_s_fpn_1x_coco.py | CASIA-IVA-Lab/DPT | 62e6322b42f8de35d215aa3cdd458088161b5949 | [
"Apache-2.0"
] | 12 | 2021-08-02T09:04:24.000Z | 2021-10-03T12:03:43.000Z | _base_ = [
'_base_/models/retinanet_r50_fpn.py',
'_base_/datasets/coco_detection.py',
'_base_/default_runtime.py'
]
model = dict(
pretrained='pretrained/dpt_small.pth',
backbone=dict(
type='dpt_small',
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[64, 128,... | 24.517241 | 62 | 0.637131 | _base_ = [
'_base_/models/retinanet_r50_fpn.py',
'_base_/datasets/coco_detection.py',
'_base_/default_runtime.py'
]
model = dict(
pretrained='pretrained/dpt_small.pth',
backbone=dict(
type='dpt_small',
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[64, 128,... | true | true |
08faa02d3a6d0264eabc9a92aafba0b66d42b8a8 | 1,206 | py | Python | Arrays/Ceiling_in_a_sorted_array/solution.py | abhaydhiman/Pyalgo | 69efdd937041548234bf67a2bd0b962b6e60a556 | [
"MIT"
] | 1 | 2021-01-05T14:09:47.000Z | 2021-01-05T14:09:47.000Z | Arrays/Ceiling_in_a_sorted_array/solution.py | abhaydhiman/Pyalgo | 69efdd937041548234bf67a2bd0b962b6e60a556 | [
"MIT"
] | null | null | null | Arrays/Ceiling_in_a_sorted_array/solution.py | abhaydhiman/Pyalgo | 69efdd937041548234bf67a2bd0b962b6e60a556 | [
"MIT"
] | null | null | null | # Ceiling ------ bin search O(logn)
def ceiling(arr, start, end, x):
if x <= arr[start]:
return arr[start]
if x > arr[end]:
return -1
mid = (start + end) // 2
if arr[mid] == x:
return arr[mid]
elif x > arr[mid]:
if arr[mid + 1] >= x and (mid + 1) <= end... | 23.192308 | 52 | 0.468491 | def ceiling(arr, start, end, x):
if x <= arr[start]:
return arr[start]
if x > arr[end]:
return -1
mid = (start + end) // 2
if arr[mid] == x:
return arr[mid]
elif x > arr[mid]:
if arr[mid + 1] >= x and (mid + 1) <= end:
return arr[mid + 1]
... | true | true |
08faa29825847b6920b112f21ee9c46f68a89ba6 | 16,034 | py | Python | weasyl/test/test_submission.py | sl1-1/weasyl | d4f6bf3e33b85a2289a451d95d5b90ff24f5d539 | [
"Apache-2.0"
] | null | null | null | weasyl/test/test_submission.py | sl1-1/weasyl | d4f6bf3e33b85a2289a451d95d5b90ff24f5d539 | [
"Apache-2.0"
] | null | null | null | weasyl/test/test_submission.py | sl1-1/weasyl | d4f6bf3e33b85a2289a451d95d5b90ff24f5d539 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import datetime
import unittest
import pytest
import arrow
from libweasyl.models.helpers import CharSettings
from libweasyl import ratings
from libweasyl.models import site, users
import weasyl.define as d
from weasyl import blocktag, searchtag, submission, welcome
from weasyl... | 44.170799 | 120 | 0.668517 | from __future__ import absolute_import
import datetime
import unittest
import pytest
import arrow
from libweasyl.models.helpers import CharSettings
from libweasyl import ratings
from libweasyl.models import site, users
import weasyl.define as d
from weasyl import blocktag, searchtag, submission, welcome
from weasyl... | true | true |
08faa33e33898652805c8e20aed07152cb1a2a07 | 4,733 | py | Python | Python-Programs/ipv4classcheck.py | jayanibhagya/Hacktoberfest-2022 | b637c7576c0eb28744de34d5feee6971abe8bcbd | [
"MIT"
] | 1 | 2021-11-28T05:27:42.000Z | 2021-11-28T05:27:42.000Z | Python-Programs/ipv4classcheck.py | jayanibhagya/Hacktoberfest-2022 | b637c7576c0eb28744de34d5feee6971abe8bcbd | [
"MIT"
] | null | null | null | Python-Programs/ipv4classcheck.py | jayanibhagya/Hacktoberfest-2022 | b637c7576c0eb28744de34d5feee6971abe8bcbd | [
"MIT"
] | 3 | 2021-10-07T17:51:42.000Z | 2021-10-10T13:26:08.000Z | import sys
import math
def cont():
print("Do you want to continue ")
print("Press Y/N to continue and exit respectively")
inputchar=input()
if(inputchar=="Y" or inputchar=="y"):
switch()
elif(inputchar=="N" or inputchar=="n"):
sys.exit()
def switch():
print("-"*40)
print("1) Ch... | 36.976563 | 113 | 0.422142 | import sys
import math
def cont():
print("Do you want to continue ")
print("Press Y/N to continue and exit respectively")
inputchar=input()
if(inputchar=="Y" or inputchar=="y"):
switch()
elif(inputchar=="N" or inputchar=="n"):
sys.exit()
def switch():
print("-"*40)
print("1) Ch... | true | true |
08faa358a91ecf453baac1cf21decf6ddf2fd267 | 1,431 | py | Python | cdp_backend/tests/conftest.py | liamphmurphy/cdp-backend | f77ca6d02099dcea71da8378ddf742951a4665a7 | [
"MIT"
] | null | null | null | cdp_backend/tests/conftest.py | liamphmurphy/cdp-backend | f77ca6d02099dcea71da8378ddf742951a4665a7 | [
"MIT"
] | null | null | null | cdp_backend/tests/conftest.py | liamphmurphy/cdp-backend | f77ca6d02099dcea71da8378ddf742951a4665a7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Configuration for tests! There are a whole list of hooks you can define in this file to
run before, after, or to mutate how tests run. Commonly for most of our work, we use
this file to define top level fixtures that may be needed for tests throughout multiple
test fil... | 35.775 | 112 | 0.777778 |
from pathlib import Path
import pytest
@pytest.fixture
def resources_dir() -> Path:
return Path(__file__).parent / "resources"
EXAMPLE_VIDEO_FILENAME = "example_video.mp4"
EXAMPLE_MKV_VIDEO_FILENAME = "example_video.mkv"
EXAMPLE_VIDEO_HD_FILENAME = "example_video_large.mp4"
EXAMPLE_YOUTUBE_VIDEO_EMBEDDED = "... | true | true |
08faa3a6d2eb753b2c5659dad767e3d8d5fdbbde | 36,607 | py | Python | tensorflow/python/framework/function.py | Leopard-X/tensorflow | e4296aefff97e6edd3d7cee9a09b9dd77da4c034 | [
"Apache-2.0"
] | 5 | 2019-01-17T08:47:31.000Z | 2020-05-06T06:10:56.000Z | tensorflow/python/framework/function.py | Leopard-X/tensorflow | e4296aefff97e6edd3d7cee9a09b9dd77da4c034 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/function.py | Leopard-X/tensorflow | e4296aefff97e6edd3d7cee9a09b9dd77da4c034 | [
"Apache-2.0"
] | 3 | 2017-06-09T10:39:33.000Z | 2021-04-08T16:13:30.000Z | # Copyright 2015 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... | 33.864015 | 106 | 0.674461 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import hashlib
import re
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import function_pb2
from tensorflow.core.framework import op_def_pb2
from tensor... | true | true |
08faa40b88616c160d1ee7602e6fe495857f0c06 | 41,064 | py | Python | python/ccxt/async_support/idex.py | alok46/ccxt | ea94147e03e6974384727ead440a7cd2e80f7078 | [
"MIT"
] | 1 | 2019-10-30T13:32:54.000Z | 2019-10-30T13:32:54.000Z | python/ccxt/async_support/idex.py | alok46/ccxt | ea94147e03e6974384727ead440a7cd2e80f7078 | [
"MIT"
] | null | null | null | python/ccxt/async_support/idex.py | alok46/ccxt | ea94147e03e6974384727ead440a7cd2e80f7078 | [
"MIT"
] | 1 | 2020-08-06T16:32:05.000Z | 2020-08-06T16:32:05.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import A... | 40.657426 | 202 | 0.516316 |
from ccxt.async_support.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
class idex (Exchange):... | true | true |
08faa4aaaf90ee1d7a0ccde2a2e72a922390c7bb | 13,278 | py | Python | sleap/nn/model.py | Tyelab/sleap | 67b4b3e762571e70beadf940a64ed62d9481dafe | [
"BSD-3-Clause-Clear"
] | null | null | null | sleap/nn/model.py | Tyelab/sleap | 67b4b3e762571e70beadf940a64ed62d9481dafe | [
"BSD-3-Clause-Clear"
] | null | null | null | sleap/nn/model.py | Tyelab/sleap | 67b4b3e762571e70beadf940a64ed62d9481dafe | [
"BSD-3-Clause-Clear"
] | null | null | null | """This module defines the main SLEAP model class for defining a trainable model.
This is a higher level wrapper around `tf.keras.Model` that holds all the configuration
parameters required to construct the actual model. This allows for easy querying of the
model configuration without actually instantiating the model ... | 36.378082 | 88 | 0.580961 | import tensorflow as tf
import attr
from typing import List, TypeVar, Optional, Text, Tuple
import sleap
from sleap.nn.architectures import (
LeapCNN,
UNet,
Hourglass,
ResNetv1,
ResNet50,
ResNet101,
ResNet152,
UnetPretrainedEncoder,
IntermediateFeature,
)
from sleap.nn.heads import... | true | true |
08faa5487c0970937ceca85aed872d524ce09a9c | 1,095 | py | Python | openfst_python/test.py | sdli1995/openfst-python | e4125dafb121e5ef0bc05a3a7543d8e0d376f65f | [
"Apache-2.0"
] | null | null | null | openfst_python/test.py | sdli1995/openfst-python | e4125dafb121e5ef0bc05a3a7543d8e0d376f65f | [
"Apache-2.0"
] | null | null | null | openfst_python/test.py | sdli1995/openfst-python | e4125dafb121e5ef0bc05a3a7543d8e0d376f65f | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import unittest
import openfst_python as fst
class TestOpenFstPython(unittest.TestCase):
def test_simple(self):
f = fst.VectorFst()
s0 = f.add_state()
s1 = f.add_state()
s2 = f.add_state()
f.add_... | 29.594595 | 74 | 0.609132 | from __future__ import absolute_import
from __future__ import print_function
import unittest
import openfst_python as fst
class TestOpenFstPython(unittest.TestCase):
def test_simple(self):
f = fst.VectorFst()
s0 = f.add_state()
s1 = f.add_state()
s2 = f.add_state()
f.add_... | true | true |
08faa556ebac04ca49044cf817559e6a05a21ef7 | 2,319 | py | Python | kws_streaming/layers/preemphasis.py | kiss2u/google-research | 2cd66234656f9e2f4218ed90a2d8aa9cf3139093 | [
"Apache-2.0"
] | 7 | 2020-03-15T12:14:07.000Z | 2021-12-01T07:01:09.000Z | kws_streaming/layers/preemphasis.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | kws_streaming/layers/preemphasis.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2020-06-15T03:06:53.000Z | 2021-08-06T16:38:33.000Z | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 35.136364 | 74 | 0.705476 |
from kws_streaming.layers.compat import tf
class Preemphasis(tf.keras.layers.Layer):
def __init__(self, preemph=0.97, **kwargs):
super(Preemphasis, self).__init__(**kwargs)
self.preemph = preemph
def call(self, inputs, training=None):
frame_axis = inputs.shape.rank - 1
def make_fra... | true | true |
08faa66b77019b9a265ff78b6f325ec80435b9fe | 4,874 | py | Python | automancy/core/ffmpeg_encoders.py | IAmTheBlurr/Automancy | 0c52916cd01dda6bd34ef8d048c37e478dfabbb5 | [
"MIT"
] | null | null | null | automancy/core/ffmpeg_encoders.py | IAmTheBlurr/Automancy | 0c52916cd01dda6bd34ef8d048c37e478dfabbb5 | [
"MIT"
] | null | null | null | automancy/core/ffmpeg_encoders.py | IAmTheBlurr/Automancy | 0c52916cd01dda6bd34ef8d048c37e478dfabbb5 | [
"MIT"
] | null | null | null | """ ./core/ffmpeg_encoders.py -> Handlers for simplified ffmpeg use """
import subprocess
from typing import Union
class FFMPEGEncoders(object):
""" Handler for ffmpeg operations to simplify the process of starting encoders for Broadcaster events """
def __init__(self, environment: str, account_id: str, even... | 36.924242 | 168 | 0.625154 | import subprocess
from typing import Union
class FFMPEGEncoders(object):
def __init__(self, environment: str, account_id: str, event_id: str, source_input: str = '', desired_output: Union[str, list] = None, experimental_flags: str = ''):
self.environment = environment
self.account_id = account_id... | true | true |
08faa6a810dae2b72d2e5ce9451793f990d1d62f | 176 | py | Python | racegate.py | lbelella/racegate | 6ad6d4ae0d5f9e62c92bcd3052d0578a409fc2a9 | [
"MIT"
] | 1 | 2020-12-30T04:24:51.000Z | 2020-12-30T04:24:51.000Z | racegate.py | lbelella/racegate | 6ad6d4ae0d5f9e62c92bcd3052d0578a409fc2a9 | [
"MIT"
] | null | null | null | racegate.py | lbelella/racegate | 6ad6d4ae0d5f9e62c92bcd3052d0578a409fc2a9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import time
from race import Race, RaceState
current_race = Race(8)
current_race.start()
while current_race.State != RaceState.COMPLETE:
time.sleep(1)
| 17.6 | 47 | 0.755682 | import time
from race import Race, RaceState
current_race = Race(8)
current_race.start()
while current_race.State != RaceState.COMPLETE:
time.sleep(1)
| true | true |
08faa6ba2f96e9c2aa134a895cbf0ca42db24eff | 3,942 | py | Python | robot/mech/link.py | jbschwartz/robotpy | e28ee9fa00dd9deb856230d8bebf5142d41ad61b | [
"MIT"
] | 11 | 2019-06-13T01:48:59.000Z | 2020-12-29T12:17:17.000Z | robot/mech/link.py | jbschwartz/robotpy | e28ee9fa00dd9deb856230d8bebf5142d41ad61b | [
"MIT"
] | null | null | null | robot/mech/link.py | jbschwartz/robotpy | e28ee9fa00dd9deb856230d8bebf5142d41ad61b | [
"MIT"
] | 3 | 2019-07-30T02:49:12.000Z | 2021-12-12T22:39:07.000Z | import math
from collections import namedtuple
from typing import Iterable, Optional
from spatial import AABB, Intersection, Mesh, Ray, Transform, Vector3
from .joint import Joint
PhysicalProperties = namedtuple('PhysicalProperties', 'com moments volume', defaults=(None, None, None))
Moments = nam... | 32.578512 | 122 | 0.653475 | import math
from collections import namedtuple
from typing import Iterable, Optional
from spatial import AABB, Intersection, Mesh, Ray, Transform, Vector3
from .joint import Joint
PhysicalProperties = namedtuple('PhysicalProperties', 'com moments volume', defaults=(None, None, None))
Moments = nam... | true | true |
08faa6dd66ee54164b1434f2d77f12f8e591c61a | 10,881 | py | Python | src/cli/action.py | rpurgstaller/beanbot-personal-finance-manager | 4770a17549f368985445f7d56cdf8e1097e007b1 | [
"CC0-1.0"
] | null | null | null | src/cli/action.py | rpurgstaller/beanbot-personal-finance-manager | 4770a17549f368985445f7d56cdf8e1097e007b1 | [
"CC0-1.0"
] | null | null | null | src/cli/action.py | rpurgstaller/beanbot-personal-finance-manager | 4770a17549f368985445f7d56cdf8e1097e007b1 | [
"CC0-1.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import List
from PyInquirer import prompt
from examples import custom_style_3
from beancount.core.account_types import DEFAULT_ACCOUNT_TYPES
from sqlalchemy.sql.expression import false
from cli.prompt import CLASS_OPTION, CONFIRMATION_NAME, PATH_NAME, account_chooser, c... | 26.734644 | 209 | 0.577888 | from abc import ABC, abstractmethod
from typing import List
from PyInquirer import prompt
from examples import custom_style_3
from beancount.core.account_types import DEFAULT_ACCOUNT_TYPES
from sqlalchemy.sql.expression import false
from cli.prompt import CLASS_OPTION, CONFIRMATION_NAME, PATH_NAME, account_chooser, c... | true | true |
08faa6e346d87608842401ca4b6a729d26e4d632 | 6,977 | py | Python | blog/views/micropub.py | jacobian/jacobian.org | cacff78aa68cb1585a63c04ff5bd7fc484066730 | [
"Apache-2.0"
] | 8 | 2018-11-12T21:11:18.000Z | 2020-10-20T09:03:54.000Z | blog/views/micropub.py | jacobian/jacobian.org | cacff78aa68cb1585a63c04ff5bd7fc484066730 | [
"Apache-2.0"
] | 5 | 2018-11-28T12:56:57.000Z | 2020-02-05T21:56:48.000Z | blog/views/micropub.py | jacobian/jacobian.org | cacff78aa68cb1585a63c04ff5bd7fc484066730 | [
"Apache-2.0"
] | 5 | 2018-11-19T16:47:15.000Z | 2020-02-14T22:34:26.000Z | import json
import logging
import requests
from blog.models import Entry, Tag, Photo
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.urls import reverse
from django.utils.text import slugify
from django.utils.timezone import now
from django.views ... | 32.602804 | 92 | 0.590512 | import json
import logging
import requests
from blog.models import Entry, Tag, Photo
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.urls import reverse
from django.utils.text import slugify
from django.utils.timezone import now
from django.views ... | true | true |
08faa6ed682a17b32a1f1f26dca67363e885327e | 95 | py | Python | sparc/proxy/__init__.py | davisd50/sparc.proxy | 2639f3f79ee876451040f86d4483c4332b97cf6a | [
"MIT"
] | null | null | null | sparc/proxy/__init__.py | davisd50/sparc.proxy | 2639f3f79ee876451040f86d4483c4332b97cf6a | [
"MIT"
] | null | null | null | sparc/proxy/__init__.py | davisd50/sparc.proxy | 2639f3f79ee876451040f86d4483c4332b97cf6a | [
"MIT"
] | null | null | null | from .interfaces import ISparcProxyProvider
from .interfaces import IZopeInterfaceProviderProxy | 47.5 | 51 | 0.905263 | from .interfaces import ISparcProxyProvider
from .interfaces import IZopeInterfaceProviderProxy | true | true |
08faa72d1cd26b8797808eb2da4bed56cefa2fd3 | 390 | py | Python | backend/prog-hist/backend/src/code/test/playground/plot_error_01.py | halilagin/d3studies | fbcf50a845cd17bcb469a428afce9854b1b63971 | [
"CC0-1.0"
] | null | null | null | backend/prog-hist/backend/src/code/test/playground/plot_error_01.py | halilagin/d3studies | fbcf50a845cd17bcb469a428afce9854b1b63971 | [
"CC0-1.0"
] | null | null | null | backend/prog-hist/backend/src/code/test/playground/plot_error_01.py | halilagin/d3studies | fbcf50a845cd17bcb469a428afce9854b1b63971 | [
"CC0-1.0"
] | null | null | null | import code.book_plots as bp
import numpy as np
# bp.plot_errorbars([(160, 8, 'A'), (170, 8, 'B')],
# xlims=(145, 185), ylims=(-1, 1));
# bp.plot_errorbars([(160, 3, 'A'), (170, 9, 'B')],
# xlims=(145, 185), ylims=(-1, 1))
measurements = np.random.normal(165, 5, size=10000)
print('... | 30 | 53 | 0.558974 | import code.book_plots as bp
import numpy as np
measurements = np.random.normal(165, 5, size=10000)
print('Average of measurements is {:.4f}'.format(
measurements.mean())) | true | true |
08faaad34510b737a523a3a9f5e5dfb3e90e82f0 | 110 | py | Python | .ipynb_checkpoints/app-checkpoint.py | davisknowles/sqlalchemy-challenge | 54a8294cd0254e796887370a4abf8637f2f8895f | [
"ADSL"
] | null | null | null | .ipynb_checkpoints/app-checkpoint.py | davisknowles/sqlalchemy-challenge | 54a8294cd0254e796887370a4abf8637f2f8895f | [
"ADSL"
] | null | null | null | .ipynb_checkpoints/app-checkpoint.py | davisknowles/sqlalchemy-challenge | 54a8294cd0254e796887370a4abf8637f2f8895f | [
"ADSL"
] | null | null | null | %matplotlib inline
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
| 18.333333 | 31 | 0.827273 | %matplotlib inline
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
| false | true |
08faacd7d81bcd82ec5ae64b13b6c988d6e04c11 | 2,043 | py | Python | virtual/lib/python3.8/site-packages/flask_login/signals.py | Timoh97/JSC-Online | 299aec2c70fc63e5e9f9e107099db922b7333fb1 | [
"MIT"
] | null | null | null | virtual/lib/python3.8/site-packages/flask_login/signals.py | Timoh97/JSC-Online | 299aec2c70fc63e5e9f9e107099db922b7333fb1 | [
"MIT"
] | null | null | null | virtual/lib/python3.8/site-packages/flask_login/signals.py | Timoh97/JSC-Online | 299aec2c70fc63e5e9f9e107099db922b7333fb1 | [
"MIT"
] | null | null | null | from flask.signals import Namespace
_signals = Namespace()
#: Sent when a user is logged in. In addition to the app (which is the
#: sender), it is passed `user`, which is the user being logged in.
user_logged_in = _signals.signal("logged-in")
#: Sent when a user is logged out. In addition to the app (which is the
#... | 44.413043 | 79 | 0.75673 | from flask.signals import Namespace
_signals = Namespace()
user_logged_in = _signals.signal("logged-in")
user_logged_out = _signals.signal("logged-out")
user_loaded_from_cookie = _signals.signal("loaded-from-cookie")
user_loaded_from_header = _signals.signal("loaded-from-header")
user_loaded_from_request = _signa... | true | true |
08faad72cdde95f8f5ad6439d2a1ebc3eb24db19 | 3,561 | py | Python | cajas/webclient/views/create_office_movement.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/webclient/views/create_office_movement.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/webclient/views/create_office_movement.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | import copy
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views.generic import View
from cajas.boxes.models.box_don_juan import BoxDonJuan
from cajas.users.models.employee import Employee
from... | 39.566667 | 112 | 0.661331 | import copy
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views.generic import View
from cajas.boxes.models.box_don_juan import BoxDonJuan
from cajas.users.models.employee import Employee
from... | true | true |
08faaed6f42b6ff9493327c1d47e23b4622f60b0 | 3,985 | py | Python | kubernetes/client/models/v1_topology_selector_term.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | 1 | 2022-02-07T21:57:20.000Z | 2022-02-07T21:57:20.000Z | kubernetes/client/models/v1_topology_selector_term.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | 1 | 2022-03-01T03:37:57.000Z | 2022-03-01T03:37:57.000Z | kubernetes/client/models/v1_topology_selector_term.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.22
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 32.398374 | 124 | 0.632873 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1TopologySelectorTerm(object):
openapi_types = {
'match_label_expressions': 'list[V1TopologySelectorLabelRequirement]'
}
attribute_map = {
'match_label_expressions': 'matchLabelExpre... | true | true |
08faaff04ff25a577ca773de2f3e84cab2357c0b | 1,012 | py | Python | tests/test_slackclient.py | Doerge/python-slackclient | 66a85de57b11c5c726734dd51b3be57427f544e1 | [
"MIT"
] | null | null | null | tests/test_slackclient.py | Doerge/python-slackclient | 66a85de57b11c5c726734dd51b3be57427f544e1 | [
"MIT"
] | null | null | null | tests/test_slackclient.py | Doerge/python-slackclient | 66a85de57b11c5c726734dd51b3be57427f544e1 | [
"MIT"
] | 1 | 2021-03-26T23:50:31.000Z | 2021-03-26T23:50:31.000Z | from slackclient._client import SlackClient
from slackclient._channel import Channel
import json
import pytest
@pytest.fixture
def channel_created_fixture():
file_channel_created_data = open('tests/data/channel.created.json', 'r').read()
json_channel_created_data = json.loads(file_channel_created_data)
re... | 32.645161 | 95 | 0.80336 | from slackclient._client import SlackClient
from slackclient._channel import Channel
import json
import pytest
@pytest.fixture
def channel_created_fixture():
file_channel_created_data = open('tests/data/channel.created.json', 'r').read()
json_channel_created_data = json.loads(file_channel_created_data)
re... | true | true |
08fab090a063af8152e1285983d704494f88694f | 21,352 | py | Python | python/ccxt/lykke.py | ysdede/ccxt | c64cfdb0c364f4b965ef588bf67d1bdedad410a5 | [
"MIT"
] | 1 | 2021-01-12T07:03:55.000Z | 2021-01-12T07:03:55.000Z | python/ccxt/lykke.py | ysdede/ccxt | c64cfdb0c364f4b965ef588bf67d1bdedad410a5 | [
"MIT"
] | 3 | 2022-01-27T15:38:05.000Z | 2022-03-31T23:04:15.000Z | python/ccxt/lykke.py | RonSherfey/ccxt | c64cfdb0c364f4b965ef588bf67d1bdedad410a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.precise import Precise
class lykke(Exchange):
def describe(self):
ret... | 37.069444 | 126 | 0.457147 |
from ccxt.base.exchange import Exchange
from ccxt.base.precise import Precise
class lykke(Exchange):
def describe(self):
return self.deep_extend(super(lykke, self).describe(), {
'id': 'lykke',
'name': 'Lykke',
'countries': ['CH'],
'version': 'v1',
... | true | true |
08fab0ea32d74d25994aa891e3b0562d5c5af9c6 | 236 | py | Python | authors/apps/article/utils.py | andela/ah-olympians | f00edb358f42751cdf9405de5f29e2b21dacb7d5 | [
"BSD-3-Clause"
] | 2 | 2019-03-21T16:57:21.000Z | 2019-10-17T10:16:24.000Z | authors/apps/article/utils.py | andela/ah-olympians | f00edb358f42751cdf9405de5f29e2b21dacb7d5 | [
"BSD-3-Clause"
] | 17 | 2019-02-26T09:27:09.000Z | 2021-12-13T19:57:24.000Z | authors/apps/article/utils.py | andela/ah-olympians | f00edb358f42751cdf9405de5f29e2b21dacb7d5 | [
"BSD-3-Clause"
] | 2 | 2019-06-29T12:10:31.000Z | 2020-04-04T17:56:36.000Z |
def email_message(slug,report_message):
"""
the message function
"""
message = " This article with the following slug " + slug + " has been reported because of\n " \
+ report_message
return message
| 23.6 | 101 | 0.618644 |
def email_message(slug,report_message):
message = " This article with the following slug " + slug + " has been reported because of\n " \
+ report_message
return message
| true | true |
08fab16cb1d92ec02b4702283f8e6c819497af94 | 6,517 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/RadioButtonRenderer.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/RadioButtonRenderer.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/RadioButtonRenderer.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class RadioButtonRenderer(object):
""" Provides methods used to render an option button control (also known as a radio button) with or without visual styles. This class cannot be inherited. """
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return RadioButtonRenderer()
@s... | 65.828283 | 204 | 0.76569 | class RadioButtonRenderer(object):
def Instance(self):
return RadioButtonRenderer()
@staticmethod
def DrawParentBackground(g,bounds,childControl):
DrawRadioButton(g: Graphics,glyphLocation: Point,state: RadioButtonState)
Draws an option button control (also known as a radio button) in the specified s... | true | true |
08fab18a0e0e27cefc2963be7407dbed8271e52c | 8,626 | py | Python | lib/enthought/traits/tests/clone_test_case.py | mattfoster/matplotlib | 0b47697b19b77226c633ec6a3d74a2199a153315 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2016-05-08T18:33:12.000Z | 2016-05-08T18:33:12.000Z | lib/enthought/traits/tests/clone_test_case.py | mattfoster/matplotlib | 0b47697b19b77226c633ec6a3d74a2199a153315 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | lib/enthought/traits/tests/clone_test_case.py | mattfoster/matplotlib | 0b47697b19b77226c633ec6a3d74a2199a153315 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describ... | 30.373239 | 82 | 0.592395 | import unittest
from enthought.traits.api import HasTraits, Instance, Str, Any, Property
class Foo(HasTraits):
s = Str
class ClassWithAny(HasTraits):
x = Property
_x = Any
def _get_x(self):
return self._x
def _set_x(self,x):
self._x = x
class ClassWithInstance(HasTraits):
... | true | true |
08fab356a2ce1db48bc057d009dc0bcfbcfe9386 | 1,488 | py | Python | d20/a1.py | nikosgraser/aoc-2020 | f6b197eca161028f3e62cebc1b8e756898d545f5 | [
"0BSD"
] | null | null | null | d20/a1.py | nikosgraser/aoc-2020 | f6b197eca161028f3e62cebc1b8e756898d545f5 | [
"0BSD"
] | null | null | null | d20/a1.py | nikosgraser/aoc-2020 | f6b197eca161028f3e62cebc1b8e756898d545f5 | [
"0BSD"
] | null | null | null | from typing import List
class Tile:
def __init__(self, tile_id: str, tile_lines: List[str]):
self.tile_id = tile_id
self.raw_lines = tile_lines
self.borders = self.get_borders()
def get_borders(self):
return [
list(self.raw_lines[0]),
[line[-1] for line... | 28.615385 | 84 | 0.62836 | from typing import List
class Tile:
def __init__(self, tile_id: str, tile_lines: List[str]):
self.tile_id = tile_id
self.raw_lines = tile_lines
self.borders = self.get_borders()
def get_borders(self):
return [
list(self.raw_lines[0]),
[line[-1] for line... | true | true |
08fab35d7fbab546717c864ebb844b3048b952f4 | 1,929 | py | Python | invoicer/admin.py | gabrielhurley/django-invoicer | 11674908995104a029b3073ceda2787460ff2d8e | [
"BSD-3-Clause"
] | 3 | 2016-07-26T13:56:59.000Z | 2019-09-26T06:56:51.000Z | invoicer/admin.py | gabrielhurley/django-invoicer | 11674908995104a029b3073ceda2787460ff2d8e | [
"BSD-3-Clause"
] | null | null | null | invoicer/admin.py | gabrielhurley/django-invoicer | 11674908995104a029b3073ceda2787460ff2d8e | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from invoicer.models import *
class LineItemInline(admin.TabularInline):
model = LineItem
fields = ("item", "name", "cost", "price", "quantity", "taxable")
class InvoiceInline(admin.TabularInline):
fields = ("invoice_date", "status", "due_date", "company", )
readonly_... | 32.15 | 141 | 0.631415 | from django.contrib import admin
from invoicer.models import *
class LineItemInline(admin.TabularInline):
model = LineItem
fields = ("item", "name", "cost", "price", "quantity", "taxable")
class InvoiceInline(admin.TabularInline):
fields = ("invoice_date", "status", "due_date", "company", )
readonly_... | true | true |
08fab3e0adb5e559bb980500ad5ceebb59198281 | 1,158 | py | Python | python/paddle/callbacks.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/callbacks.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/callbacks.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 36.1875 | 74 | 0.746114 |
from .hapi.callbacks import Callback from .hapi.callbacks import ProgBarLogger from .hapi.callbacks import ModelCheckpoint from .hapi.callbacks import VisualDL from .hapi.callbacks import LRScheduler from .hapi.callbacks import EarlyStopping from .hapi.callbacks import ReduceLROnPlateau
__all__ = [ 'Callb... | true | true |
08fab4caeedb1864fd63e526dbc69ec1daa25037 | 13,799 | py | Python | simple-pipeline/1.sentiment-tweetpy-elasticsearch/twitter-streaming.py | huseinzol05/Gather-Tensorflow-Serving | c2a883e574f3d76ca9fce46880596526f0783c68 | [
"MIT"
] | 267 | 2018-10-24T05:28:04.000Z | 2019-12-24T19:06:14.000Z | piping/1.sentiment-tweetpy-elasticsearch/twitter-streaming.py | huseinzol05/Python-DevOps | a5d578fae7df369bd9e10175249db18fe2db989e | [
"MIT"
] | 4 | 2019-01-03T14:54:02.000Z | 2019-12-29T14:31:37.000Z | simple-pipeline/1.sentiment-tweetpy-elasticsearch/twitter-streaming.py | huseinzol05/Gather-Tensorflow-Serving | c2a883e574f3d76ca9fce46880596526f0783c68 | [
"MIT"
] | 83 | 2018-10-23T15:37:54.000Z | 2019-12-24T19:06:21.000Z | from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
import time
import json
from unidecode import unidecode
from datetime import datetime
from datetime import timedelta
import urllib.request
from urllib.parse import quote
from elasticsearch import Elasticsearch
from tweepy import Stream
import r... | 33.091127 | 80 | 0.358359 | from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
import time
import json
from unidecode import unidecode
from datetime import datetime
from datetime import timedelta
import urllib.request
from urllib.parse import quote
from elasticsearch import Elasticsearch
from tweepy import Stream
import r... | true | true |
08fab557c7751815b9426cc2216f1b37d26ca261 | 468 | py | Python | ecommerce/migrations/0003_position_vendor_code.py | fidals/blog | 2815b43d6724b142cc663a8cdc59d2afc9cad657 | [
"MIT"
] | 3 | 2017-05-05T12:01:54.000Z | 2018-03-06T21:33:04.000Z | ecommerce/migrations/0003_position_vendor_code.py | fidals/blog | 2815b43d6724b142cc663a8cdc59d2afc9cad657 | [
"MIT"
] | 172 | 2016-11-30T18:18:41.000Z | 2022-03-11T23:20:58.000Z | ecommerce/migrations/0003_position_vendor_code.py | fidals/blog | 2815b43d6724b142cc663a8cdc59d2afc9cad657 | [
"MIT"
] | 3 | 2017-09-25T17:11:46.000Z | 2020-04-17T09:14:43.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-05-26 16:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecommerce', '0002_auto_20161123_0936'),
]
operations = [
migrations.AddField(... | 22.285714 | 62 | 0.632479 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecommerce', '0002_auto_20161123_0936'),
]
operations = [
migrations.AddField(
model_name='position',
name='vendor_code',
... | true | true |
08fab7b10b081c11c6052f3bd0e5a3a8ce5b23a2 | 2,131 | py | Python | docs/conf.py | Landgate/Staff-Calibration | d4a929526604e4de086e3d7f8783ea66a68b4ece | [
"Apache-2.0"
] | 1 | 2021-11-23T05:48:41.000Z | 2021-11-23T05:48:41.000Z | docs/conf.py | Landgate/Staff-Calibration | d4a929526604e4de086e3d7f8783ea66a68b4ece | [
"Apache-2.0"
] | null | null | null | docs/conf.py | Landgate/Staff-Calibration | d4a929526604e4de086e3d7f8783ea66a68b4ece | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.934426 | 79 | 0.671985 |
import os
import sys
import django
sys.path.insert(0, os.path.abspath('..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'staff.settings'
django.setup()
project = 'Staff Calibration'
copyright = 'November 2020, Landgate'
author = 'Khandu'
version = '2020.0.1'
release = '2020.0.1'
extensions = ["sphinx.ext.autodoc",... | true | true |
08fab8241d7a2c397781bbfdfa8bcdfbedbd343e | 317 | py | Python | datemath.py | johnzastrow/weather | e0fc6e973d8fcb1d8cd31bf95c3e232fbfee8b03 | [
"MIT"
] | null | null | null | datemath.py | johnzastrow/weather | e0fc6e973d8fcb1d8cd31bf95c3e232fbfee8b03 | [
"MIT"
] | null | null | null | datemath.py | johnzastrow/weather | e0fc6e973d8fcb1d8cd31bf95c3e232fbfee8b03 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
particular_date = datetime(2019, 3, 6)
new_date = particular_date - timedelta(days=52)
print (new_date)
current_date = datetime.now()
print("Current Date: "+ str(current_date))
new_date = current_date - timedelta(days=52.1)
print ("With time delta: " + str(new_date)) | 35.222222 | 48 | 0.73817 | from datetime import datetime, timedelta
particular_date = datetime(2019, 3, 6)
new_date = particular_date - timedelta(days=52)
print (new_date)
current_date = datetime.now()
print("Current Date: "+ str(current_date))
new_date = current_date - timedelta(days=52.1)
print ("With time delta: " + str(new_date)) | true | true |
08fab83ca23519cae4f467fa9666e4b69119dc62 | 2,506 | py | Python | Balsn_CTF_2019/Need_some_flags/server/Need_some_flags_2/docker/share/server/server.py | sces60107/My-CTF-Challenges | 85fe38f31b416e232e5c6ea80eb7a9c69cb5dd5f | [
"MIT"
] | 3 | 2019-10-11T15:45:23.000Z | 2019-10-16T05:42:32.000Z | Balsn_CTF_2019/Need_some_flags/server/Need_some_flags_2/docker/share/server/server.py | sces60107/My-CTF-Challenges | 85fe38f31b416e232e5c6ea80eb7a9c69cb5dd5f | [
"MIT"
] | null | null | null | Balsn_CTF_2019/Need_some_flags/server/Need_some_flags_2/docker/share/server/server.py | sces60107/My-CTF-Challenges | 85fe38f31b416e232e5c6ea80eb7a9c69cb5dd5f | [
"MIT"
] | null | null | null | #!/usr/bin/python2
import tempfile
import os
import nonsecret
flag_count=0
edited=False
welcome='''
Welcome to BalsnCTF. We are so glad to see you guys here.
To host a CTF, we need tons of flags. Then I thought maybe you can help us.
We would appreciate it if you can provide us some flags.
'''
menu='''
[0] Write a ... | 23.420561 | 169 | 0.667598 | import tempfile
import os
import nonsecret
flag_count=0
edited=False
welcome='''
Welcome to BalsnCTF. We are so glad to see you guys here.
To host a CTF, we need tons of flags. Then I thought maybe you can help us.
We would appreciate it if you can provide us some flags.
'''
menu='''
[0] Write a flag
[1] Edit a fla... | false | true |
08fab96af30fb5ada95df7d831eab1b17ee31b5d | 1,860 | py | Python | beispielanwendungen/hallowelt/hallowelt2_menu2.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/hallowelt/hallowelt2_menu2.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/hallowelt/hallowelt2_menu2.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MainWindow(QtGui.QMainWindow):
def __init__(self, *args):
QtGui.QMainWindow.__init__(self, *args)
... | 30 | 84 | 0.67043 |
import sys
from PyQt4 import QtCore, QtGui
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MainWindow(QtGui.QMainWindow):
def __init__(self, *args):
QtGui.QMainWindow.__init__(self, *args)
self.createMenu()
... | true | true |
08fab97df465ca25d1a56afafabe60bf57e62991 | 75 | py | Python | jacdac/sound_player/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-15T21:30:36.000Z | 2022-02-15T21:30:36.000Z | jacdac/sound_player/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | null | null | null | jacdac/sound_player/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-08T19:32:45.000Z | 2022-02-08T19:32:45.000Z | # Autogenerated file.
from .client import SoundPlayerClient # type: ignore
| 25 | 52 | 0.8 | from .client import SoundPlayerClient | true | true |
08fab99a73b385c8bca01974458df820e27992ed | 3,038 | py | Python | app/airport/airport_config.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | app/airport/airport_config.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | app/airport/airport_config.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class AirportConfig(object):
def __init__(self, airport):
self.airport = airport
self.planes_config = planes_config_factory(
self.airport.planes_capacity)
self.staff_config = staff_config_factory(self.airport.planes_capacity)
self.resources_confi... | 40.506667 | 97 | 0.684332 |
class AirportConfig(object):
def __init__(self, airport):
self.airport = airport
self.planes_config = planes_config_factory(
self.airport.planes_capacity)
self.staff_config = staff_config_factory(self.airport.planes_capacity)
self.resources_config = ResourcesConfig(
... | true | true |
08faba7fb2c2bbc71dc62c93102a987c1e844901 | 7,813 | py | Python | tests/unit/triangle/test_triangle.py | cog-imperial/galini | b27e62b4e981818624f8dc315f0cadee2f7cbed2 | [
"Apache-2.0"
] | 14 | 2020-02-17T14:24:16.000Z | 2022-03-18T03:21:32.000Z | tests/unit/triangle/test_triangle.py | JackaChou/galini | b27e62b4e981818624f8dc315f0cadee2f7cbed2 | [
"Apache-2.0"
] | 7 | 2020-09-26T19:52:59.000Z | 2022-01-10T21:00:44.000Z | tests/unit/triangle/test_triangle.py | JackaChou/galini | b27e62b4e981818624f8dc315f0cadee2f7cbed2 | [
"Apache-2.0"
] | 5 | 2020-03-13T16:00:49.000Z | 2022-02-10T10:19:10.000Z | import pytest
import numpy as np
import pyomo.environ as aml
from suspect.pyomo import create_connected_model
from coramin.relaxations.iterators import relaxation_data_objects
from coramin.utils.coramin_enums import RelaxationSide
from coramin.relaxations.mccormick import PWMcCormickRelaxation
from coramin.relaxations.... | 29.934866 | 113 | 0.509663 | import pytest
import numpy as np
import pyomo.environ as aml
from suspect.pyomo import create_connected_model
from coramin.relaxations.iterators import relaxation_data_objects
from coramin.utils.coramin_enums import RelaxationSide
from coramin.relaxations.mccormick import PWMcCormickRelaxation
from coramin.relaxations.... | true | true |
08fabaee1e3e321eac8e4fc81a015a0383f78333 | 485 | py | Python | robottests/lib/PoTLib.py | PlatformOfTrust/connector-leanheat-with-tests | 3c9dd542264d9808e3f6c15728d70da99b3565f7 | [
"MIT"
] | null | null | null | robottests/lib/PoTLib.py | PlatformOfTrust/connector-leanheat-with-tests | 3c9dd542264d9808e3f6c15728d70da99b3565f7 | [
"MIT"
] | null | null | null | robottests/lib/PoTLib.py | PlatformOfTrust/connector-leanheat-with-tests | 3c9dd542264d9808e3f6c15728d70da99b3565f7 | [
"MIT"
] | null | null | null | import base64
import hashlib
import hmac
import json
def calculate_pot_signature(body, client_secret):
if isinstance(body, str):
body = json.loads(body)
body_string = json.dumps(
body,
sort_keys=True,
indent=None,
separators=(',', ': ')
).strip()
digest = hmac.... | 20.208333 | 49 | 0.608247 | import base64
import hashlib
import hmac
import json
def calculate_pot_signature(body, client_secret):
if isinstance(body, str):
body = json.loads(body)
body_string = json.dumps(
body,
sort_keys=True,
indent=None,
separators=(',', ': ')
).strip()
digest = hmac.... | true | true |
08fabb6fe0ea80f09168eb007810ba2ae3ee5f71 | 20,684 | py | Python | src/bxcommon/services/tx_sync_service.py | thabaptiser/bxcommon | ee8547c9fc68c71b8acf4ce0989a344681ea273c | [
"MIT"
] | null | null | null | src/bxcommon/services/tx_sync_service.py | thabaptiser/bxcommon | ee8547c9fc68c71b8acf4ce0989a344681ea273c | [
"MIT"
] | null | null | null | src/bxcommon/services/tx_sync_service.py | thabaptiser/bxcommon | ee8547c9fc68c71b8acf4ce0989a344681ea273c | [
"MIT"
] | null | null | null | import time
from typing import List, Optional, Set, Dict, Any, TYPE_CHECKING
from bxutils.logging import LogRecordType
from bxutils import logging
from bxcommon import constants
from bxcommon.connections.connection_type import ConnectionType
from bxcommon.messages.bloxroute.blocks_short_ids_serializer import BlockSho... | 42.824017 | 115 | 0.582818 | import time
from typing import List, Optional, Set, Dict, Any, TYPE_CHECKING
from bxutils.logging import LogRecordType
from bxutils import logging
from bxcommon import constants
from bxcommon.connections.connection_type import ConnectionType
from bxcommon.messages.bloxroute.blocks_short_ids_serializer import BlockSho... | true | true |
08fabb9ed5c09e727cf9fb9cbe4d811ad0cd9937 | 143,966 | py | Python | gui/qt/main_window.py | DanZlotnikov/electrum-domx | 00b138409b1c4441635d5a6ff7f568aba0ec4c52 | [
"MIT"
] | null | null | null | gui/qt/main_window.py | DanZlotnikov/electrum-domx | 00b138409b1c4441635d5a6ff7f568aba0ec4c52 | [
"MIT"
] | null | null | null | gui/qt/main_window.py | DanZlotnikov/electrum-domx | 00b138409b1c4441635d5a6ff7f568aba0ec4c52 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 41.086187 | 308 | 0.608053 | import sys, time, threading
import os, json, traceback
import shutil
import weakref
import webbrowser
import csv
from decimal import Decimal
import base64
from functools import partial
import argparse
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import PyQt5.QtCore as QtCore
from .exception_window import Exce... | true | true |
08fabcbe61251dde8cd0d29c2663d743835da810 | 12,187 | py | Python | kubernetes/client/models/v1beta1_webhook.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_webhook.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | 1 | 2021-04-30T20:41:19.000Z | 2021-04-30T20:41:19.000Z | venv/lib/python2.7/site-packages/kubernetes/client/models/v1beta1_webhook.py | 784134748/kubernetes-install | 5df59632c2619632e422948b667fb68eab9ff5be | [
"MIT"
] | 1 | 2020-05-09T07:16:55.000Z | 2020-05-09T07:16:55.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 45.304833 | 1,210 | 0.652991 |
from pprint import pformat
from six import iteritems
import re
class V1beta1Webhook(object):
swagger_types = {
'client_config': 'V1beta1WebhookClientConfig',
'failure_policy': 'str',
'name': 'str',
'namespace_selector': 'V1LabelSelector',
'rules': 'list[V1beta1RuleWith... | true | true |
08fabe42016a37c5e8704c1a8b967de1f76af91c | 758 | py | Python | apps/api/views/moudle_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | 1 | 2022-03-24T05:33:30.000Z | 2022-03-24T05:33:30.000Z | apps/api/views/moudle_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | apps/api/views/moudle_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import mixins
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from ..serializers import ModuleSerializer
from project.models import Mo... | 30.32 | 110 | 0.769129 |
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import mixins
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from ..serializers import ModuleSerializer
from project.models import Module
class ModuleViewS... | true | true |
08fac193d1ac22ed6ca0f8237c504ab1b54127b0 | 232 | py | Python | audit_sugar_utm/wsgi.py | ds-vologdin/audit-sugar-utm-2 | 2701392074ac6712954b1a1db7d8f749e6604055 | [
"MIT"
] | null | null | null | audit_sugar_utm/wsgi.py | ds-vologdin/audit-sugar-utm-2 | 2701392074ac6712954b1a1db7d8f749e6604055 | [
"MIT"
] | null | null | null | audit_sugar_utm/wsgi.py | ds-vologdin/audit-sugar-utm-2 | 2701392074ac6712954b1a1db7d8f749e6604055 | [
"MIT"
] | null | null | null | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'audit_sugar_utm.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
from configurations.wsgi import get_wsgi_application
application = get_wsgi_application()
| 25.777778 | 75 | 0.831897 | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'audit_sugar_utm.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
from configurations.wsgi import get_wsgi_application
application = get_wsgi_application()
| true | true |
08fac21976864daaa610382ecaafdd616e111c03 | 1,290 | py | Python | solutions/cs101_openjudge/18160.py | forxhunter/ComputingIntro | 50fa2ac030748626c694ec5c884c5ac32f0b42a8 | [
"Apache-2.0"
] | 1 | 2021-01-02T04:31:34.000Z | 2021-01-02T04:31:34.000Z | solutions/cs101_openjudge/18160.py | forxhunter/ComputingIntro | 50fa2ac030748626c694ec5c884c5ac32f0b42a8 | [
"Apache-2.0"
] | null | null | null | solutions/cs101_openjudge/18160.py | forxhunter/ComputingIntro | 50fa2ac030748626c694ec5c884c5ac32f0b42a8 | [
"Apache-2.0"
] | null | null | null | k = int(input())
chess = 'W'
empty = '.'
neighbour = [[0, -1], [0, 1], [1, 0], [-1, 0],[1,-1],[1,1],[-1,-1],[-1,1]]
def dfs(r, c, area, visited):
mianji = 1
visited[r][c] = 1
stack = []
stack.append([r, c])
while len(stack) != 0:
x, y = stack.pop()
for dx, dy in neighbour:
... | 26.326531 | 78 | 0.492248 | k = int(input())
chess = 'W'
empty = '.'
neighbour = [[0, -1], [0, 1], [1, 0], [-1, 0],[1,-1],[1,1],[-1,-1],[-1,1]]
def dfs(r, c, area, visited):
mianji = 1
visited[r][c] = 1
stack = []
stack.append([r, c])
while len(stack) != 0:
x, y = stack.pop()
for dx, dy in neighbour:
... | true | true |
08fac22152ca1d3faad801d5b23c9cc6ae0fe683 | 4,743 | py | Python | tools/lebedev/import_lebedev.py | dariusarnold/quadpy | 9dc7c1ebff99d15ae57ed9195cde94d97a599be8 | [
"MIT"
] | null | null | null | tools/lebedev/import_lebedev.py | dariusarnold/quadpy | 9dc7c1ebff99d15ae57ed9195cde94d97a599be8 | [
"MIT"
] | null | null | null | tools/lebedev/import_lebedev.py | dariusarnold/quadpy | 9dc7c1ebff99d15ae57ed9195cde94d97a599be8 | [
"MIT"
] | null | null | null | """
This little helper takes Lebedev point and weight data from [1] and produces JSON files.
[1]
https://people.sc.fsu.edu/~jburkardt/datasets/sphere_lebedev_rule/sphere_lebedev_rule.html
"""
import os
import re
import numpy
def read(filename):
data = numpy.loadtxt(filename)
azimuthal_polar = data[:, :2] / ... | 35.931818 | 90 | 0.53405 | import os
import re
import numpy
def read(filename):
data = numpy.loadtxt(filename)
azimuthal_polar = data[:, :2] / 180.0
weights = data[:, 2]
return azimuthal_polar, weights
def chunk_data(weights):
chunks = []
k = 0
ref_weight = 0.0
tol = 1.0e-12
while k < len(weights):
... | true | true |
08fac24d91381c79a479dd813fe6f394a1867bd9 | 15,151 | py | Python | zstacklib/zstacklib/utils/concurrentlog_handler.py | mchtech/zstack-utility | 18c7947b083b70b2b23f7f21992ca0ef09ac7e75 | [
"Apache-2.0"
] | null | null | null | zstacklib/zstacklib/utils/concurrentlog_handler.py | mchtech/zstack-utility | 18c7947b083b70b2b23f7f21992ca0ef09ac7e75 | [
"Apache-2.0"
] | null | null | null | zstacklib/zstacklib/utils/concurrentlog_handler.py | mchtech/zstack-utility | 18c7947b083b70b2b23f7f21992ca0ef09ac7e75 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Lowell Alleman
#
# 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 writin... | 45.092262 | 117 | 0.63349 | import os
import sys
from random import randint
from logging import Handler, LogRecord
from logging.handlers import BaseRotatingHandler
try:
import codecs
except ImportError:
codecs = None
# we should still be better off than with the standard RotattingFileHandler
# class, right? We do some rename checking...... | true | true |
08fac471b514a274483a38f6338836276fa85ee5 | 106 | py | Python | env/lib/python3.6/_collections_abc.py | jfairf01/OrgoWebsite | 62f25faa1cc174f91377a281e1cea1dd898b0b30 | [
"MIT"
] | 1 | 2017-04-14T11:23:03.000Z | 2017-04-14T11:23:03.000Z | env/lib/python3.6/_collections_abc.py | jfairf01/OrgoWebsite | 62f25faa1cc174f91377a281e1cea1dd898b0b30 | [
"MIT"
] | 3 | 2017-04-10T11:02:01.000Z | 2017-04-10T11:03:37.000Z | backend/py-server/flask/lib/python3.6/_collections_abc.py | achoy/cwapi | 582c77fdca7d0360b05f4fc9a7c1628490c2102d | [
"BSD-3-Clause"
] | null | null | null | /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_collections_abc.py | 106 | 106 | 0.830189 | /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_collections_abc.py | false | true |
08fac49c0d730cb3eaa85dd6ef027bdbf9cb9e9c | 1,496 | py | Python | language/patterns/composite.py | aliaksandr-klimovich/sandbox | adab6b18f3d78a891c38609abc71b5d7a751919c | [
"Unlicense"
] | 1 | 2020-12-25T18:21:18.000Z | 2020-12-25T18:21:18.000Z | language/patterns/composite.py | aliaksandr-klimovich/sandbox | adab6b18f3d78a891c38609abc71b5d7a751919c | [
"Unlicense"
] | 1 | 2021-02-11T15:05:59.000Z | 2021-02-11T15:05:59.000Z | language/patterns/composite.py | aliaksandr-klimovich/sandbox | adab6b18f3d78a891c38609abc71b5d7a751919c | [
"Unlicense"
] | null | null | null | # Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat
# individual objects and compositions of objects uniformly.
#
# https://en.wikipedia.org/wiki/Composite_pattern
from abc import ABC, abstractmethod
class Graphic(ABC):
@abstractmethod
def print(self):
... | 23.015385 | 104 | 0.705214 |
from abc import ABC, abstractmethod
class Graphic(ABC):
@abstractmethod
def print(self):
raise NotImplementedError()
class CompositeGraphic(Graphic):
def __init__(self):
self.graphics = []
def print(self):
for graphic in self.graphics:
graphic.print()
def ... | true | true |
08fac53e3aff9339d811111dd7c64a4354171da8 | 5,535 | py | Python | quantum/plugins/metaplugin/proxy_quantum_plugin.py | aristanetworks/arista-ovs-quantum | 8e7fe17cafa70c3346e2a5d70da2d6e2637c338e | [
"Apache-2.0"
] | null | null | null | quantum/plugins/metaplugin/proxy_quantum_plugin.py | aristanetworks/arista-ovs-quantum | 8e7fe17cafa70c3346e2a5d70da2d6e2637c338e | [
"Apache-2.0"
] | null | null | null | quantum/plugins/metaplugin/proxy_quantum_plugin.py | aristanetworks/arista-ovs-quantum | 8e7fe17cafa70c3346e2a5d70da2d6e2637c338e | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Nachi Ueno, NTT MCL, 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://ww... | 38.706294 | 79 | 0.660705 |
import logging
from quantum.db import api as db
from quantum.db import db_base_plugin_v2
from quantum.db import l3_db
from quantum.db import models_v2
from quantum.openstack.common import cfg
from quantumclient.common import exceptions
from quantumclient.v2_0 import client
LOG = logging.getLogger(__name__)
class ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.