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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75568e0cf2908076be87de899369752a24a0800 | 8,704 | py | Python | hdfs_namenode/check.py | serverdensity/sd-agent-core-plugins | 1ba9b44c89bc4c5d647fc537897dd6aee9529f6b | [
"BSD-3-Clause"
] | 5 | 2018-04-09T09:53:04.000Z | 2021-07-02T05:37:41.000Z | hdfs_namenode/check.py | serverdensity/sd-agent-core-plugins | 1ba9b44c89bc4c5d647fc537897dd6aee9529f6b | [
"BSD-3-Clause"
] | 19 | 2018-01-24T15:23:47.000Z | 2020-07-14T14:30:53.000Z | hdfs_namenode/check.py | serverdensity/sd-agent-core-plugins | 1ba9b44c89bc4c5d647fc537897dd6aee9529f6b | [
"BSD-3-Clause"
] | 5 | 2018-05-31T22:06:19.000Z | 2019-04-25T20:00:24.000Z | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
'''
HDFS NameNode Metrics
---------------------
hdfs.namenode.capacity_total Total disk capacity in bytes
hdfs.namenode.capacity_used Disk usage in bytes
hdfs.namenode.capac... | 39.926606 | 122 | 0.658778 |
from urlparse import urljoin
import requests
from requests.exceptions import Timeout, HTTPError, InvalidURL, ConnectionError
from simplejson import JSONDecodeError
from checks import AgentCheck
JMX_SERVICE_CHECK = 'hdfs.namenode.jmx.can_connect'
JMX_PATH = 'jmx'
HDFS_NAME_SYSTEM_STATE_BEAN = 'Hadoop:se... | true | true |
f75568e3ff884fcbaec17f2a48293fd8891573d6 | 253 | py | Python | plugins/DOACCOUNTSTABLE/modularity.py | Southampton-RSG/wdra-extender | cfbcc8633ef13002a8f0266c782380c9c6f4ae55 | [
"BSD-3-Clause"
] | null | null | null | plugins/DOACCOUNTSTABLE/modularity.py | Southampton-RSG/wdra-extender | cfbcc8633ef13002a8f0266c782380c9c6f4ae55 | [
"BSD-3-Clause"
] | 28 | 2020-07-10T14:05:18.000Z | 2022-02-01T15:31:16.000Z | plugins/DOACCOUNTSTABLE/modularity.py | Southampton-RSG/wdra-extender | cfbcc8633ef13002a8f0266c782380c9c6f4ae55 | [
"BSD-3-Clause"
] | null | null | null | import community as community_louvain
import networkx as nx
import sys
G = nx.read_weighted_edgelist(sys.argv[1])
# compute the best partition
partition = community_louvain.best_partition(G)
for n in partition.keys() :
print(n,"\t",partition[n])
| 21.083333 | 47 | 0.766798 | import community as community_louvain
import networkx as nx
import sys
G = nx.read_weighted_edgelist(sys.argv[1])
partition = community_louvain.best_partition(G)
for n in partition.keys() :
print(n,"\t",partition[n])
| true | true |
f75569f2a9460481d0cfc3bd2c67300423327e6c | 697 | py | Python | shakenfist/alembic/versions/a61092f784b7_add_network_table.py | bradh/shakenfist | a3174c2826ca722ccdd97d39c3ccdd0f0756086f | [
"Apache-2.0"
] | null | null | null | shakenfist/alembic/versions/a61092f784b7_add_network_table.py | bradh/shakenfist | a3174c2826ca722ccdd97d39c3ccdd0f0756086f | [
"Apache-2.0"
] | null | null | null | shakenfist/alembic/versions/a61092f784b7_add_network_table.py | bradh/shakenfist | a3174c2826ca722ccdd97d39c3ccdd0f0756086f | [
"Apache-2.0"
] | null | null | null | """Add network table.
Revision ID: a61092f784b7
Revises: 37e174f84517
Create Date: 2020-01-13 07:31:21.905820
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "a61092f784b7"
down_revision = "37e174f84517"
branch_labels = None
depends_on = None
def upgrade():
... | 21.121212 | 59 | 0.662841 | from alembic import op
import sqlalchemy as sa
revision = "a61092f784b7"
down_revision = "37e174f84517"
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
'networks',
sa.Column('uuid', sa.String(36), primary_key=True),
sa.Column('vxid', sa.Integer),
sa.Column... | true | true |
f7556b0b7615d1b455fb59bd6e148a01e9916964 | 5,685 | py | Python | src/_pytest/mark/__init__.py | tech-chad/pytest | 15d5e8cd97c621cf558d154a5760519468770199 | [
"MIT"
] | null | null | null | src/_pytest/mark/__init__.py | tech-chad/pytest | 15d5e8cd97c621cf558d154a5760519468770199 | [
"MIT"
] | null | null | null | src/_pytest/mark/__init__.py | tech-chad/pytest | 15d5e8cd97c621cf558d154a5760519468770199 | [
"MIT"
] | null | null | null | """ generic mechanism for marking and selecting python functions. """
import warnings
from typing import Optional
from .legacy import matchkeyword
from .legacy import matchmark
from .structures import EMPTY_PARAMETERSET_OPTION
from .structures import get_empty_parameterset_mark
from .structures import Mark
from .struc... | 32.301136 | 89 | 0.662973 | import warnings
from typing import Optional
from .legacy import matchkeyword
from .legacy import matchmark
from .structures import EMPTY_PARAMETERSET_OPTION
from .structures import get_empty_parameterset_mark
from .structures import Mark
from .structures import MARK_GEN
from .structures import MarkDecorator
from .stru... | true | true |
f7556c15e2fe435b6be17fb0bd2c1d3e795b831d | 1,015 | py | Python | zhusuan_of/variational/elbo.py | Oneflow-Inc/Zhusuan-Oneflow | a97f0d4e86a34147799c8904ecc035b593d5f280 | [
"MIT"
] | 1 | 2021-07-05T04:04:02.000Z | 2021-07-05T04:04:02.000Z | zhusuan_of/variational/elbo.py | Oneflow-Inc/Zhusuan-Oneflow | a97f0d4e86a34147799c8904ecc035b593d5f280 | [
"MIT"
] | null | null | null | zhusuan_of/variational/elbo.py | Oneflow-Inc/Zhusuan-Oneflow | a97f0d4e86a34147799c8904ecc035b593d5f280 | [
"MIT"
] | null | null | null | """ ELBO """
import oneflow.experimental as flow
class ELBO(flow.nn.Module):
def __init__(self, generator, variational):
super(ELBO, self).__init__()
self.generator = generator
self.variational = variational
def log_joint(self, nodes):
log_joint_ = None
for n_name in n... | 26.025641 | 59 | 0.590148 |
import oneflow.experimental as flow
class ELBO(flow.nn.Module):
def __init__(self, generator, variational):
super(ELBO, self).__init__()
self.generator = generator
self.variational = variational
def log_joint(self, nodes):
log_joint_ = None
for n_name in nodes.keys():
... | true | true |
f7556d3db015ccd4ee54c5f5332ca29581953827 | 5,088 | py | Python | src/tankoh2/control_doe.py | sfreund-DLR/tankoh2 | 92ff080f7034a7eb1cdabed5089c79fd01af4d11 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | src/tankoh2/control_doe.py | sfreund-DLR/tankoh2 | 92ff080f7034a7eb1cdabed5089c79fd01af4d11 | [
"MIT",
"BSD-3-Clause"
] | 27 | 2021-11-03T19:53:00.000Z | 2022-03-28T12:43:30.000Z | src/tankoh2/control_doe.py | sfreund-DLR/tankoh2 | 92ff080f7034a7eb1cdabed5089c79fd01af4d11 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """create DOEs and execute design workflow
Caution:
This module requires fa_pytuils and delismm!
Please contatct the developers for these additional packages.
"""
import os
from collections import OrderedDict
import datetime
import numpy as np
import matplotlib.pyplot as plt
from delismm.model.doe import LatinizedCe... | 37.411765 | 147 | 0.652123 |
import os
from collections import OrderedDict
import datetime
import numpy as np
import matplotlib.pyplot as plt
from delismm.model.doe import LatinizedCentroidalVoronoiTesselation, DOEfromFile
from delismm.model.samplecalculator import getY
from delismm.model.customsystemfunction import BoundsHandler, AbstractTarget... | true | true |
f7556de391979aba1412d9f1c439b06532b8b5f6 | 926 | py | Python | webviz_config/generic_plugins/_example_data_download.py | anders-kiaer/webviz-conf | 3390ec36db7cda3ad3203ac7654e008125fa81ef | [
"MIT"
] | 44 | 2019-04-07T18:46:00.000Z | 2022-03-28T02:35:58.000Z | webviz_config/generic_plugins/_example_data_download.py | anders-kiaer/webviz-conf | 3390ec36db7cda3ad3203ac7654e008125fa81ef | [
"MIT"
] | 312 | 2019-03-29T11:49:53.000Z | 2022-03-07T12:06:34.000Z | webviz_config/generic_plugins/_example_data_download.py | anders-kiaer/webviz-conf | 3390ec36db7cda3ad3203ac7654e008125fa81ef | [
"MIT"
] | 46 | 2019-03-29T07:23:16.000Z | 2022-03-28T02:35:59.000Z | from typing import Optional
from dash import html, Dash
from .. import WebvizPluginABC, EncodedFile
class ExampleDataDownload(WebvizPluginABC):
def __init__(self, app: Dash, title: str):
super().__init__()
self.title = title
self.set_callbacks(app)
@property
def layout(self) ->... | 28.9375 | 86 | 0.574514 | from typing import Optional
from dash import html, Dash
from .. import WebvizPluginABC, EncodedFile
class ExampleDataDownload(WebvizPluginABC):
def __init__(self, app: Dash, title: str):
super().__init__()
self.title = title
self.set_callbacks(app)
@property
def layout(self) ->... | true | true |
f7556dee10906cd44078f241419e97e179e09674 | 2,474 | py | Python | tests/unit_test/test_post_runs/nextflow/test_params_outdir_with_docker.py | kinow/sapporo-service | 0abca6deeb199c524eaec87ae35388c419d9352a | [
"Apache-2.0"
] | 2 | 2021-11-10T22:57:03.000Z | 2022-03-02T08:23:25.000Z | tests/unit_test/test_post_runs/nextflow/test_params_outdir_with_docker.py | kinow/sapporo-service | 0abca6deeb199c524eaec87ae35388c419d9352a | [
"Apache-2.0"
] | 9 | 2021-11-11T04:40:41.000Z | 2022-03-23T01:07:52.000Z | tests/unit_test/test_post_runs/nextflow/test_params_outdir_with_docker.py | kinow/sapporo-service | 0abca6deeb199c524eaec87ae35388c419d9352a | [
"Apache-2.0"
] | 4 | 2021-10-06T06:01:30.000Z | 2022-03-17T10:53:42.000Z | #!/usr/bin/env python3
# coding: utf-8
# pylint: disable=subprocess-run-check, unused-argument, import-outside-toplevel
import json
import shlex
import subprocess
from time import sleep
from sapporo.model import RunId
from . import SCRIPT_DIR, TEST_HOST, TEST_PORT
def post_runs_params_outdir_with_docker() -> RunId:... | 37.484848 | 84 | 0.633791 |
import json
import shlex
import subprocess
from time import sleep
from sapporo.model import RunId
from . import SCRIPT_DIR, TEST_HOST, TEST_PORT
def post_runs_params_outdir_with_docker() -> RunId:
script_path = SCRIPT_DIR.joinpath("params_outdir_with_docker/post_runs.sh")
proc = subprocess.run(shlex.spli... | true | true |
f7556e25229349066f2d94157783b072b50c5a14 | 4,050 | py | Python | tests/st/func/datavisual/conftest.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 216 | 2020-03-28T02:11:56.000Z | 2022-03-31T06:20:09.000Z | tests/st/func/datavisual/conftest.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 13 | 2020-03-31T03:00:12.000Z | 2021-01-03T13:01:06.000Z | tests/st/func/datavisual/conftest.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 21 | 2020-03-28T02:41:06.000Z | 2021-11-24T12:20:25.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 36.818182 | 114 | 0.695309 |
import os
import shutil
from unittest.mock import Mock
import pytest
from flask import Response
from mindinsight.conf import settings
from mindinsight.datavisual.data_transform import data_manager
from mindinsight.datavisual.data_transform.data_manager import DataManager
from mindinsight.datavisual.data... | true | true |
f7556eed9a816adf619909685628c47ce1beb96a | 359 | py | Python | pythonCode/textProBarV3.py | eatmore/python_practice | c6a773c8d24182b23a86fd9b66b27b5ff948b258 | [
"MIT"
] | null | null | null | pythonCode/textProBarV3.py | eatmore/python_practice | c6a773c8d24182b23a86fd9b66b27b5ff948b258 | [
"MIT"
] | null | null | null | pythonCode/textProBarV3.py | eatmore/python_practice | c6a773c8d24182b23a86fd9b66b27b5ff948b258 | [
"MIT"
] | 1 | 2020-03-12T06:05:38.000Z | 2020-03-12T06:05:38.000Z | #textProBarV3
import time
scale = 50
print('执行开始'.center(scale//2, '-'))
start = time.perf_counter()
for i in range(scale + 1):
a = '*' * i
b = '*' * (scale - i)
c = (i/scale) * 100
dur = time.perf_counter() - start
print('\r{:^3.0f}%[{}->{}]{:2f}s'.format(c,a,b,dur), end='')
time.sleep(0.2)
pri... | 27.615385 | 64 | 0.532033 |
import time
scale = 50
print('执行开始'.center(scale//2, '-'))
start = time.perf_counter()
for i in range(scale + 1):
a = '*' * i
b = '*' * (scale - i)
c = (i/scale) * 100
dur = time.perf_counter() - start
print('\r{:^3.0f}%[{}->{}]{:2f}s'.format(c,a,b,dur), end='')
time.sleep(0.2)
print('\n' + '执行... | true | true |
f7556ef053d5f0df7891b3fe075310633ef4babd | 1,031 | py | Python | crslab/config/__init__.py | hcmus-nlp-chatbot/CRSLab | b3ab262a4ad93cbae98fe66541eb735377768a35 | [
"MIT"
] | 315 | 2021-01-05T06:31:57.000Z | 2022-03-16T21:12:23.000Z | crslab/config/__init__.py | hcmus-nlp-chatbot/CRSLab | b3ab262a4ad93cbae98fe66541eb735377768a35 | [
"MIT"
] | 23 | 2021-01-09T05:43:26.000Z | 2022-03-28T21:05:49.000Z | crslab/config/__init__.py | hcmus-nlp-chatbot/CRSLab | b3ab262a4ad93cbae98fe66541eb735377768a35 | [
"MIT"
] | 71 | 2021-01-05T06:31:59.000Z | 2022-03-06T06:30:35.000Z | # -*- encoding: utf-8 -*-
# @Time : 2020/12/22
# @Author : Xiaolei Wang
# @email : wxl1999@foxmail.com
# UPDATE
# @Time : 2020/12/29
# @Author : Xiaolei Wang
# @email : wxl1999@foxmail.com
"""Config module which loads parameters for the whole system.
Attributes:
SAVE_PATH (str): where sys... | 31.242424 | 106 | 0.71193 |
import os
from os.path import dirname, realpath
from .config import Config
ROOT_PATH = dirname(dirname(dirname(realpath(__file__))))
SAVE_PATH = os.path.join(ROOT_PATH, 'save')
DATA_PATH = os.path.join(ROOT_PATH, 'data')
DATASET_PATH = os.path.join(DATA_PATH, 'dataset')
MODEL_PATH = os.path.join(DATA_PATH,... | true | true |
f7556f22d658a2543e96da445f80cc67662227f2 | 1,010 | py | Python | audio_annotator/audio_annotator/create_spectrograms.py | Redict/rg_sound_generation | 6db8826d0797650bc5c1555a60cc9c6b3f82050d | [
"MIT"
] | null | null | null | audio_annotator/audio_annotator/create_spectrograms.py | Redict/rg_sound_generation | 6db8826d0797650bc5c1555a60cc9c6b3f82050d | [
"MIT"
] | null | null | null | audio_annotator/audio_annotator/create_spectrograms.py | Redict/rg_sound_generation | 6db8826d0797650bc5c1555a60cc9c6b3f82050d | [
"MIT"
] | null | null | null | import os
import librosa
import librosa.display
import matplotlib.pyplot as plt
from tqdm import tqdm
def create_spectrograms():
audio_dir = os.path.join('audio_annotator', 'static')
files = [x for x in os.listdir(audio_dir) if x.lower().endswith('.wav')]
for f in tqdm(files):
audio_path = os.pa... | 24.634146 | 77 | 0.572277 | import os
import librosa
import librosa.display
import matplotlib.pyplot as plt
from tqdm import tqdm
def create_spectrograms():
audio_dir = os.path.join('audio_annotator', 'static')
files = [x for x in os.listdir(audio_dir) if x.lower().endswith('.wav')]
for f in tqdm(files):
audio_path = os.pa... | true | true |
f7557011909d0e4fc553dddafd4131d4036391df | 1,201 | py | Python | azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 31.605263 | 82 | 0.587011 |
from msrest.serialization import Model
class Filters(Model):
_validation = {
'site': {'readonly': True},
}
_attribute_map = {
'site': {'key': 'site', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(Filters, self).__init__(**kwargs)
self.s... | true | true |
f75571393eb8d65b118a89922b9eff34224fa712 | 2,961 | py | Python | model-optimizer/extensions/ops/gatherelements.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/ops/gatherelements.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 19 | 2021-03-26T08:11:00.000Z | 2022-02-21T13:06:26.000Z | model-optimizer/extensions/ops/gatherelements.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 1 | 2021-07-28T17:30:46.000Z | 2021-07-28T17:30:46.000Z | """
Copyright (C) 2017-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 38.960526 | 109 | 0.582236 |
import numpy as np
from mo.graph.graph import Node, Graph
from mo.ops.op import Op, PermuteAttrs
class GatherElements(Op):
op = 'GatherElements'
def __init__(self, graph: Graph, attrs: dict):
super().__init__(graph, {
'op': self.op,
'type': self.op,
'version': 'o... | true | true |
f755714cb30ae4ee3e850bb3aa37c704efc23597 | 793 | py | Python | odoo-13.0/addons/l10n_th/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/l10n_th/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/l10n_th/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Thailand - Accounting',
'version': '2.0',
'category': 'Localization',
'description': """
Chart of Accounts for Thailand.
===============================
Thai accounting chart and localization.... | 28.321429 | 74 | 0.604035 |
{
'name': 'Thailand - Accounting',
'version': '2.0',
'category': 'Localization',
'description': """
Chart of Accounts for Thailand.
===============================
Thai accounting chart and localization.
""",
'author': 'Almacom',
'website': 'http://almacom.co.th/',
'depends': ['accou... | true | true |
f75572117bb91851c03f67e8e308f4051011419b | 1,139 | py | Python | models/svm_model.py | Code-the-Change-YYC/YW-NLP | a2ff0c96f449e81998fca6fa083350cf22eac382 | [
"MIT"
] | 1 | 2020-10-09T22:02:41.000Z | 2020-10-09T22:02:41.000Z | models/svm_model.py | Code-the-Change-YYC/YW-NLP | a2ff0c96f449e81998fca6fa083350cf22eac382 | [
"MIT"
] | 21 | 2020-04-19T20:08:25.000Z | 2021-05-17T02:37:14.000Z | models/svm_model.py | Code-the-Change-YYC/YW-NLP-Report-Classifier | a2ff0c96f449e81998fca6fa083350cf22eac382 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.pipeline import Pipeline
from models.model import Model, ArrayLike
from preprocess.report_data import ReportData
from preprocess.report_data_d import ColName
from training.description_classification.utils import load_svm, SVMPipeline
class SVMDescriptionClf(Model[SVMPipeline]):
"... | 29.973684 | 91 | 0.703248 | import numpy as np
from sklearn.pipeline import Pipeline
from models.model import Model, ArrayLike
from preprocess.report_data import ReportData
from preprocess.report_data_d import ColName
from training.description_classification.utils import load_svm, SVMPipeline
class SVMDescriptionClf(Model[SVMPipeline]):
_... | true | true |
f7557247c15c32c7e234411b907cd4238878c24b | 3,455 | py | Python | google/ads/google_ads/v6/proto/services/geographic_view_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/services/geographic_view_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/services/geographic_view_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.ads.google_ads.v6.proto.resources import geographic_view_pb2 as google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_geographic__view__pb2
from goog... | 44.294872 | 166 | 0.747323 |
import grpc
from google.ads.google_ads.v6.proto.resources import geographic_view_pb2 as google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_geographic__view__pb2
from google.ads.google_ads.v6.proto.services import geographic_view_service_pb2 as google_dot_ads_dot_googleads_dot_v6_dot_services_dot_geographic__view__... | true | true |
f755724ef429dd3cc0193adce9a01db66593082c | 4,944 | py | Python | test/functional/p2p_invalid_block.py | BimboPolitics/BimboCoin | 884fe6f38ff90ad03c70935705651554af30d0a4 | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_block.py | BimboPolitics/BimboCoin | 884fe6f38ff90ad03c70935705651554af30d0a4 | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_block.py | BimboPolitics/BimboCoin | 884fe6f38ff90ad03c70935705651554af30d0a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 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 node responses to invalid blocks.
In this test we connect to one node over p2p, and test block re... | 37.172932 | 111 | 0.65716 |
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, TestInstance, RejectResult
from test_framework.blocktools import *
from test_framework.mininode import network_thread_start
import copy
import time
class InvalidBlo... | true | true |
f75573609b68c405108fb5280f97a4495059883d | 3,398 | py | Python | build/scripts/code_generation.py | swiesenhuetter/ApprovalTests.cpp | c6343d7a3a7f4afdf9a0d477091ac3d21808582a | [
"Apache-2.0"
] | null | null | null | build/scripts/code_generation.py | swiesenhuetter/ApprovalTests.cpp | c6343d7a3a7f4afdf9a0d477091ac3d21808582a | [
"Apache-2.0"
] | null | null | null | build/scripts/code_generation.py | swiesenhuetter/ApprovalTests.cpp | c6343d7a3a7f4afdf9a0d477091ac3d21808582a | [
"Apache-2.0"
] | null | null | null | import os
from scripts import version
from scripts.embed import create_single_header_file
from scripts.multiline_string_utilities import remove_indentation
from scripts.release_constants import release_constants
from scripts.release_details import ReleaseDetails
from scripts.single_header_file import SingleHeaderFile
... | 41.950617 | 108 | 0.67628 | import os
from scripts import version
from scripts.embed import create_single_header_file
from scripts.multiline_string_utilities import remove_indentation
from scripts.release_constants import release_constants
from scripts.release_details import ReleaseDetails
from scripts.single_header_file import SingleHeaderFile
... | true | true |
f75575298ed1ac82ce459a6e930f5952f49f75d8 | 57,008 | py | Python | consoleme/celery_tasks/celery_tasks.py | sheikhrachel/consoleme | 555971db5d7c47d4fab52ab8add7716582db3c22 | [
"Apache-2.0"
] | null | null | null | consoleme/celery_tasks/celery_tasks.py | sheikhrachel/consoleme | 555971db5d7c47d4fab52ab8add7716582db3c22 | [
"Apache-2.0"
] | null | null | null | consoleme/celery_tasks/celery_tasks.py | sheikhrachel/consoleme | 555971db5d7c47d4fab52ab8add7716582db3c22 | [
"Apache-2.0"
] | null | null | null | """
This module controls defines celery tasks and their applicable schedules. The celery beat server and workers will start
when invoked. Please add internal-only celery tasks to the celery_tasks plugin.
When ran in development mode (CONFIG_LOCATION=<location of development.yaml configuration file. To run both the cel... | 36.614001 | 120 | 0.64619 | from __future__ import absolute_import
import json
import os
import sys
import time
from datetime import datetime, timedelta
from typing import Any, Dict, List, Tuple, Union
import celery
import sentry_sdk
import ujson
from asgiref.sync import async_to_sync
from billiard.exceptions import SoftTimeLimitExceeded
from... | true | true |
f75575b77283fe02fd1530867461f4f1c8483719 | 196 | py | Python | interview/tasks.py | xiang12835/django-recruitment | 9b82e00a03d88b6e564e24c52b2f70328d371b23 | [
"MIT"
] | null | null | null | interview/tasks.py | xiang12835/django-recruitment | 9b82e00a03d88b6e564e24c52b2f70328d371b23 | [
"MIT"
] | null | null | null | interview/tasks.py | xiang12835/django-recruitment | 9b82e00a03d88b6e564e24c52b2f70328d371b23 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from celery import shared_task
from libs.bot import dingtalk
@shared_task
def send_dingtalk_message(message):
dingtalk.send(message) | 24.5 | 56 | 0.836735 | from __future__ import absolute_import, unicode_literals
from celery import shared_task
from libs.bot import dingtalk
@shared_task
def send_dingtalk_message(message):
dingtalk.send(message) | true | true |
f75575bca85aec503e01004e2bdb51144f9f6dd3 | 12,077 | py | Python | stubs.min/System/Windows/Media/Animation_parts/RectAnimation.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Windows/Media/Animation_parts/RectAnimation.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Media/Animation_parts/RectAnimation.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class RectAnimation(RectAnimationBase,ISealable,IAnimatable,IResource):
"""
Animates the value of a System.Windows.Rect property between two target values using linear interpolation.
RectAnimation()
RectAnimation(toValue: Rect,duration: Duration)
RectAnimation(toValue: Rect,duration: Duration,fillBehav... | 38.461783 | 215 | 0.725594 | class RectAnimation(RectAnimationBase,ISealable,IAnimatable,IResource):
System.Windows.Freezable.IsFrozen property is true.
"""
"""
pass
Returns: The new instance.
"""
cannot be made read-only,with the side effect of having begun to change the
frozen status of this object.
sour... | true | true |
f75577977fa7e7e800a1dba2148545dce1045f73 | 16,184 | py | Python | ceres/plotting/manager.py | yjiangnan/ceres-combineharvester | ed32d5e2564cd0082fa5bf5733e707f06abc2045 | [
"Apache-2.0"
] | null | null | null | ceres/plotting/manager.py | yjiangnan/ceres-combineharvester | ed32d5e2564cd0082fa5bf5733e707f06abc2045 | [
"Apache-2.0"
] | null | null | null | ceres/plotting/manager.py | yjiangnan/ceres-combineharvester | ed32d5e2564cd0082fa5bf5733e707f06abc2045 | [
"Apache-2.0"
] | null | null | null | import logging
import threading
import time
import traceback
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from blspy import G1Element
from chiapos import DiskProver
from ceres.consensus.pos_quality import UI_ACTUAL... | 44.461538 | 121 | 0.602879 | import logging
import threading
import time
import traceback
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from blspy import G1Element
from chiapos import DiskProver
from ceres.consensus.pos_quality import UI_ACTUAL... | true | true |
f75577d5319420a5660c722ff23311e2cd966116 | 3,618 | py | Python | virt/ansible-2.7.0/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-2.7.0/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-2.7.0/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import yaml
from ansible.module_utils._text import to_tex... | 33.192661 | 113 | 0.576285 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import yaml
from ansible.module_utils._text import to_text
from ansible.parsing.metadata import extract_metadata
from ansible.parsing.yaml.loader import AnsibleLoader
try:
from __main__ import display
except Im... | true | true |
f7557912363ffb1b1fcb8fd9d42a6591c8c5ef2e | 6,869 | py | Python | evkit/utils/viz/core.py | joel99/midlevel-reps | f0b4a4d8ccf09a0488cd18af24723172aff99446 | [
"MIT"
] | 120 | 2019-04-22T04:45:28.000Z | 2022-03-23T01:53:17.000Z | evkit/utils/viz/core.py | joel99/midlevel-reps | f0b4a4d8ccf09a0488cd18af24723172aff99446 | [
"MIT"
] | 14 | 2019-06-12T08:21:21.000Z | 2021-08-25T15:36:58.000Z | evkit/utils/viz/core.py | joel99/midlevel-reps | f0b4a4d8ccf09a0488cd18af24723172aff99446 | [
"MIT"
] | 19 | 2019-06-19T07:00:36.000Z | 2022-03-24T07:18:30.000Z | import numpy as np
from skimage.transform import resize
import skimage
import torchvision.utils as tvutils
import torch
def rescale_for_display( batch, rescale=True, normalize=False ):
'''
Prepares network output for display by optionally rescaling from [-1,1],
and by setting some pixels to the ... | 36.73262 | 145 | 0.631096 | import numpy as np
from skimage.transform import resize
import skimage
import torchvision.utils as tvutils
import torch
def rescale_for_display( batch, rescale=True, normalize=False ):
if rescale:
display_batch = [ rescale_image( im.copy(), new_scale=[0, 1], current_scale=[-1, 1] )
... | true | true |
f755797706a7223cbc77709e58e18271fc0c1b5e | 24,401 | py | Python | graalpython/lib-python/3/sysconfig.py | transposit/graalpython | adadf5f211cc67a14bb3aca7c61219513d036b13 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | 1 | 2019-05-28T13:04:32.000Z | 2019-05-28T13:04:32.000Z | graalpython/lib-python/3/sysconfig.py | transposit/graalpython | adadf5f211cc67a14bb3aca7c61219513d036b13 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | graalpython/lib-python/3/sysconfig.py | transposit/graalpython | adadf5f211cc67a14bb3aca7c61219513d036b13 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | """Access to Python's configuration information."""
import os
import sys
from os.path import pardir, realpath
__all__ = [
'get_config_h_filename',
'get_config_var',
'get_config_vars',
'get_makefile_filename',
'get_path',
'get_path_names',
'get_paths',
'get_platform',
'get_python_ve... | 34.416079 | 80 | 0.597435 |
import os
import sys
from os.path import pardir, realpath
__all__ = [
'get_config_h_filename',
'get_config_var',
'get_config_vars',
'get_makefile_filename',
'get_path',
'get_path_names',
'get_paths',
'get_platform',
'get_python_version',
'get_scheme_names',
'parse_config_h'... | true | true |
f75579d25275819f4ead6505cc67a94c75578d3c | 78 | py | Python | run.py | Tururocks101/Blog | 147c3b9533c2c10c13999d1e0fc314e3ab3a8cc2 | [
"MIT",
"Unlicense"
] | null | null | null | run.py | Tururocks101/Blog | 147c3b9533c2c10c13999d1e0fc314e3ab3a8cc2 | [
"MIT",
"Unlicense"
] | null | null | null | run.py | Tururocks101/Blog | 147c3b9533c2c10c13999d1e0fc314e3ab3a8cc2 | [
"MIT",
"Unlicense"
] | null | null | null | from flaskvlog import app
if __name__ == '__main__':
app.run(debug=True)
| 15.6 | 26 | 0.705128 | from flaskvlog import app
if __name__ == '__main__':
app.run(debug=True)
| true | true |
f7557ce9e0801ec387ee992db0296e71ae553496 | 7,434 | py | Python | tests/conftest.py | ltalirz/aiida-quantumespresso | 4a57750dba4e09cf4a1c51a391ba9e385c1318ba | [
"MIT"
] | null | null | null | tests/conftest.py | ltalirz/aiida-quantumespresso | 4a57750dba4e09cf4a1c51a391ba9e385c1318ba | [
"MIT"
] | null | null | null | tests/conftest.py | ltalirz/aiida-quantumespresso | 4a57750dba4e09cf4a1c51a391ba9e385c1318ba | [
"MIT"
] | null | null | null | # pylint: disable=redefined-outer-name
"""Initialise a text database and profile for pytest."""
from __future__ import absolute_import
import io
import os
import shutil
import tempfile
import pytest
from aiida.manage.fixtures import fixture_manager
@pytest.fixture(scope='session')
def fixture_environment():
"""... | 33.638009 | 119 | 0.69774 |
from __future__ import absolute_import
import io
import os
import shutil
import tempfile
import pytest
from aiida.manage.fixtures import fixture_manager
@pytest.fixture(scope='session')
def fixture_environment():
with fixture_manager() as manager:
yield manager
@pytest.fixture(scope='session')
def fi... | true | true |
f7557d95cabbf44237c907782b2f2852671d8d2b | 2,783 | py | Python | tests/url_builder_test.py | TRottinger/discord-randomify | a99ab792a1835271dfae2174f08c542581b9d0e9 | [
"MIT"
] | null | null | null | tests/url_builder_test.py | TRottinger/discord-randomify | a99ab792a1835271dfae2174f08c542581b9d0e9 | [
"MIT"
] | null | null | null | tests/url_builder_test.py | TRottinger/discord-randomify | a99ab792a1835271dfae2174f08c542581b9d0e9 | [
"MIT"
] | 2 | 2020-10-27T03:53:39.000Z | 2020-10-30T00:29:11.000Z | import unittest
from unittest import TestCase
from utils import url_builder
import re
class UrlBuilderTests(TestCase):
def test_url_builder_no_args(self):
test_url = "https://my.test/url"
built_url = url_builder.build_url(test_url)
self.assertEqual(built_url, test_url)
def test_url_bu... | 36.618421 | 109 | 0.63313 | import unittest
from unittest import TestCase
from utils import url_builder
import re
class UrlBuilderTests(TestCase):
def test_url_builder_no_args(self):
test_url = "https://my.test/url"
built_url = url_builder.build_url(test_url)
self.assertEqual(built_url, test_url)
def test_url_bu... | true | true |
f7557e97156941e604a93790a20470223828e158 | 447 | py | Python | xsconnect/peripheralboards/StickIt_Buttons_V2.py | xesscorp/xsconnect | b08b2e24e7a017d9f87ad4651f82915179f1fd52 | [
"MIT"
] | null | null | null | xsconnect/peripheralboards/StickIt_Buttons_V2.py | xesscorp/xsconnect | b08b2e24e7a017d9f87ad4651f82915179f1fd52 | [
"MIT"
] | 1 | 2017-01-26T12:09:44.000Z | 2021-03-07T14:13:14.000Z | xsconnect/peripheralboards/StickIt_Buttons_V2.py | xesscorp/xsconnect | b08b2e24e7a017d9f87ad4651f82915179f1fd52 | [
"MIT"
] | 1 | 2021-08-16T07:31:24.000Z | 2021-08-16T07:31:24.000Z | brd = {
'name': ('StickIt! Buttons V2'),
'port': {
'pmod': {
'default' : {
'b0': 'd0',
'b1': 'd1',
'b2': 'd2',
'b3': 'd3'
}
},
'wing': {
'default' : {
'b0': 'd... | 20.318182 | 37 | 0.181208 | brd = {
'name': ('StickIt! Buttons V2'),
'port': {
'pmod': {
'default' : {
'b0': 'd0',
'b1': 'd1',
'b2': 'd2',
'b3': 'd3'
}
},
'wing': {
'default' : {
'b0': 'd... | true | true |
f7557f86e405b7cc18d3a488f1f0b8e6ab4175e8 | 2,553 | py | Python | dateparser/data/date_translation_data/shi.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/shi.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/shi.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | info = {
"name": "shi",
"date_order": "DMY",
"january": [
"ⵉⵏⵏ",
"ⵉⵏⵏⴰⵢⵔ"
],
"february": [
"ⴱⵕⴰ",
"ⴱⵕⴰⵢⵕ"
],
"march": [
"ⵎⴰⵕ",
"ⵎⴰⵕⵚ"
],
"april": [
"ⵉⴱⵔ",
"ⵉⴱⵔⵉⵔ"
],
"may": [
"ⵎⴰⵢ",
"ⵎⴰⵢⵢⵓ"
],... | 15.017647 | 26 | 0.262045 | info = {
"name": "shi",
"date_order": "DMY",
"january": [
"ⵉⵏⵏ",
"ⵉⵏⵏⴰⵢⵔ"
],
"february": [
"ⴱⵕⴰ",
"ⴱⵕⴰⵢⵕ"
],
"march": [
"ⵎⴰⵕ",
"ⵎⴰⵕⵚ"
],
"april": [
"ⵉⴱⵔ",
"ⵉⴱⵔⵉⵔ"
],
"may": [
"ⵎⴰⵢ",
"ⵎⴰⵢⵢⵓ"
],... | true | true |
f7558054da689f90e7252eaf0c09d3be7d30e005 | 954 | py | Python | ecommerce/apps/shipments/views.py | crstnrm/ecommerce | 72e757b1ecc7b2dfeecabe0ff06ee9797815dc8e | [
"MIT"
] | null | null | null | ecommerce/apps/shipments/views.py | crstnrm/ecommerce | 72e757b1ecc7b2dfeecabe0ff06ee9797815dc8e | [
"MIT"
] | null | null | null | ecommerce/apps/shipments/views.py | crstnrm/ecommerce | 72e757b1ecc7b2dfeecabe0ff06ee9797815dc8e | [
"MIT"
] | null | null | null | from rest_framework.response import Response
from rest_framework import status
from shipments.logic import ShipmentLogic
from ecommerce.core.views import BaseDetailView, BaseView
from ecommerce.views import BaseAPIView
class ShipmentView(BaseView):
def __init__(self):
super().__init__()
self.lo... | 24.461538 | 65 | 0.721174 | from rest_framework.response import Response
from rest_framework import status
from shipments.logic import ShipmentLogic
from ecommerce.core.views import BaseDetailView, BaseView
from ecommerce.views import BaseAPIView
class ShipmentView(BaseView):
def __init__(self):
super().__init__()
self.lo... | true | true |
f75580dc7632be7a62b073d4343e62b142f2d120 | 2,765 | py | Python | warehouse/http.py | hickford/warehouse | 87d3403b3e09d1213177133744f20430fca030ca | [
"Apache-2.0"
] | 1 | 2019-01-31T02:44:40.000Z | 2019-01-31T02:44:40.000Z | warehouse/http.py | hickford/warehouse | 87d3403b3e09d1213177133744f20430fca030ca | [
"Apache-2.0"
] | 1 | 2016-09-14T00:57:23.000Z | 2016-09-14T00:57:23.000Z | warehouse/http.py | hickford/warehouse | 87d3403b3e09d1213177133744f20430fca030ca | [
"Apache-2.0"
] | 1 | 2020-11-05T09:46:12.000Z | 2020-11-05T09:46:12.000Z | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 40.072464 | 77 | 0.719711 |
from werkzeug.datastructures import ResponseCacheControl
from werkzeug.http import parse_cache_control_header
from werkzeug.wrappers import (
BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin,
AuthorizationMixin, CommonRequestDescriptorsMixin,
BaseResponse, ETagResponseMixin, Response... | true | true |
f755810588beb09f093032f9e12a906cade7f753 | 2,796 | py | Python | Assignment-2 Hill Climbing and Simulated Annealing/Simulate Annealing/SimulatedAnnealing.py | mangesh2102000/CS571-AI-Lab | e1243030af2db1420c68ec6821aab470126fb3b0 | [
"MIT"
] | 2 | 2021-12-25T09:42:46.000Z | 2022-02-15T15:58:32.000Z | Assignment-2 Hill Climbing and Simulated Annealing/Simulate Annealing/SimulatedAnnealing.py | mangesh2102000/CS571-AI-Lab | e1243030af2db1420c68ec6821aab470126fb3b0 | [
"MIT"
] | null | null | null | Assignment-2 Hill Climbing and Simulated Annealing/Simulate Annealing/SimulatedAnnealing.py | mangesh2102000/CS571-AI-Lab | e1243030af2db1420c68ec6821aab470126fb3b0 | [
"MIT"
] | null | null | null | # Simulated Annealing Algorithm
# Import Required Functionalities
from puzzle import Puzzle, heuristicFuncList, heuristics
from heapq import heappush, heappop
from time import time
import random
from math import exp, log
def coolingFunc(maxTemperature, iteration, choice):
if choice == 1:
return maxTemper... | 25.888889 | 88 | 0.715665 |
from puzzle import Puzzle, heuristicFuncList, heuristics
from heapq import heappush, heappop
from time import time
import random
from math import exp, log
def coolingFunc(maxTemperature, iteration, choice):
if choice == 1:
return maxTemperature*(0.9**iteration)
elif choice == 2:
return maxTe... | true | true |
f75581cf576733ade07c6aaaa613536cefe24870 | 1,209 | py | Python | paula_threetiers/paula_crud/updatePub.py | pieperpaula/threetiersPP | 2ee13d7e3618b55580267fdf3aea2aeddbd659eb | [
"MIT"
] | null | null | null | paula_threetiers/paula_crud/updatePub.py | pieperpaula/threetiersPP | 2ee13d7e3618b55580267fdf3aea2aeddbd659eb | [
"MIT"
] | null | null | null | paula_threetiers/paula_crud/updatePub.py | pieperpaula/threetiersPP | 2ee13d7e3618b55580267fdf3aea2aeddbd659eb | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect
from flaskext.mysql import MySQL
# web application
app = Flask(__name__)
# connect to db
mysql = MySQL()
app.config['MYSQL_DATABASE_USER'] = 'root'
app.config['MYSQL_DATABASE_PASSWORD'] = '~~keowee.27~~'
app.config['MYSQL_DATABASE_DB'] = 'book_business'
app.... | 29.487805 | 89 | 0.689826 | from flask import Flask, render_template, request, redirect
from flaskext.mysql import MySQL
app = Flask(__name__)
mysql = MySQL()
app.config['MYSQL_DATABASE_USER'] = 'root'
app.config['MYSQL_DATABASE_PASSWORD'] = '~~keowee.27~~'
app.config['MYSQL_DATABASE_DB'] = 'book_business'
app.config['MYSQL_DATABASE_HOST'] = ... | true | true |
f7558373d643038814b46d9b0c3622df85c49c3c | 14,668 | py | Python | sdk/python/pulumi_azure_native/desktopvirtualization/v20190123preview/workspace.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/desktopvirtualization/v20190123preview/workspace.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/desktopvirtualization/v20190123preview/workspace.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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
__... | 48.730897 | 2,314 | 0.675416 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['WorkspaceArgs', 'Workspace']
@pulumi.input_type
class WorkspaceArgs:
def __init__(__self__, *,
resource_group_name: pulumi.Input[str]... | true | true |
f75583982f80989213c05dafd4aac58f0d7ff6ac | 32,903 | py | Python | nextdl/extractor/brightcove.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | 1 | 2021-12-19T13:55:20.000Z | 2021-12-19T13:55:20.000Z | nextdl/extractor/brightcove.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | nextdl/extractor/brightcove.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import base64
import re
import struct
from ..compat import (compat_etree_fromstring, compat_HTTPError,
compat_parse_qs, compat_urllib_parse_urlparse,
compat_urlparse, compat_xml_parse_error)
from ..utils import (Extrac... | 41.91465 | 481 | 0.507765 |
from __future__ import unicode_literals
import base64
import re
import struct
from ..compat import (compat_etree_fromstring, compat_HTTPError,
compat_parse_qs, compat_urllib_parse_urlparse,
compat_urlparse, compat_xml_parse_error)
from ..utils import (ExtractorError, Unsup... | true | true |
f75583cae7c44ca572634fce743e219c8fb0900f | 840 | py | Python | workspacefolder/task/windows_tool_search.py | ousttrue/Duck | 204b95b9f7121b9284a4dfb329d30e0acb41c79e | [
"MIT"
] | null | null | null | workspacefolder/task/windows_tool_search.py | ousttrue/Duck | 204b95b9f7121b9284a4dfb329d30e0acb41c79e | [
"MIT"
] | null | null | null | workspacefolder/task/windows_tool_search.py | ousttrue/Duck | 204b95b9f7121b9284a4dfb329d30e0acb41c79e | [
"MIT"
] | null | null | null | import pathlib
import os
from typing import Optional
import vswhere
def find_cmake() -> Optional[pathlib.Path]:
# search in PATH
for p in os.getenv('PATH').split(';'):
cmake = pathlib.Path(p) / 'cmake.exe'
if cmake.exists():
return cmake
# default path
cmake = pathlib.Path... | 26.25 | 91 | 0.607143 | import pathlib
import os
from typing import Optional
import vswhere
def find_cmake() -> Optional[pathlib.Path]:
for p in os.getenv('PATH').split(';'):
cmake = pathlib.Path(p) / 'cmake.exe'
if cmake.exists():
return cmake
cmake = pathlib.Path("C:/Program Files/CMake/bin/c... | true | true |
f75584540d3a21ae3f763c110990182e21a64994 | 642 | py | Python | homeassistant/components/script/logbook.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/script/logbook.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/script/logbook.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Describe logbook events."""
from homeassistant.const import ATTR_ENTITY_ID, ATTR_NAME
from homeassistant.core import callback
from . import DOMAIN, EVENT_SCRIPT_STARTED
@callback
def async_describe_events(hass, async_describe_event):
"""Describe logbook events."""
@callback
def async_describe_logbook... | 27.913043 | 84 | 0.691589 | from homeassistant.const import ATTR_ENTITY_ID, ATTR_NAME
from homeassistant.core import callback
from . import DOMAIN, EVENT_SCRIPT_STARTED
@callback
def async_describe_events(hass, async_describe_event):
@callback
def async_describe_logbook_event(event):
data = event.data
return {
... | true | true |
f755846412ffcf21c88223297f15be3d83e563d6 | 8,906 | py | Python | backend/group/tests.py | skku-npc/SKKU_Coding_Platform | 1d972e8922484cf94f6735fd08b2565e5d3517d0 | [
"MIT"
] | 1 | 2022-03-30T14:03:23.000Z | 2022-03-30T14:03:23.000Z | backend/group/tests.py | skku-npc/SKKU_Coding_Platform | 1d972e8922484cf94f6735fd08b2565e5d3517d0 | [
"MIT"
] | 56 | 2022-02-19T08:13:48.000Z | 2022-03-25T10:17:07.000Z | backend/group/tests.py | skku-npc/SKKU_Coding_Platform | 1d972e8922484cf94f6735fd08b2565e5d3517d0 | [
"MIT"
] | 1 | 2022-03-25T15:02:46.000Z | 2022-03-25T15:02:46.000Z | from utils.api.tests import APITestCase
from .models import GroupRegistrationRequest, Group
class GroupRegistrationRequestAPITest(APITestCase):
def setUp(self):
self.create_super_admin()
self.url = self.reverse("group_registration_request_api")
self.data = {
"name": "SKKUding",... | 39.40708 | 149 | 0.650797 | from utils.api.tests import APITestCase
from .models import GroupRegistrationRequest, Group
class GroupRegistrationRequestAPITest(APITestCase):
def setUp(self):
self.create_super_admin()
self.url = self.reverse("group_registration_request_api")
self.data = {
"name": "SKKUding",... | true | true |
f755857ec701a383353fc15a4445ee6245290999 | 411 | py | Python | src/dragdrop/urls.py | vdmann/cse-360-image-hosting-website | ad71c082353af4c10dcafd7381415d932cbfabc9 | [
"MIT"
] | null | null | null | src/dragdrop/urls.py | vdmann/cse-360-image-hosting-website | ad71c082353af4c10dcafd7381415d932cbfabc9 | [
"MIT"
] | null | null | null | src/dragdrop/urls.py | vdmann/cse-360-image-hosting-website | ad71c082353af4c10dcafd7381415d932cbfabc9 | [
"MIT"
] | 2 | 2015-02-25T23:05:21.000Z | 2021-11-07T13:15:08.000Z | from django.conf.urls import patterns, include, url
from django.conf import settings
# Serving files uploaded by a user during development
from django.conf.urls.static import static
urlpatterns = patterns('',
url(r'^$', 'dragdrop.views.DraggingAndDropping', name='DraggingAndDropping'),
)
# this is to deploy static... | 37.363636 | 81 | 0.776156 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = patterns('',
url(r'^$', 'dragdrop.views.DraggingAndDropping', name='DraggingAndDropping'),
)
| true | true |
f75587d839fffcf03901779a0b65126190b9d481 | 5,307 | py | Python | tools/wptrunner/wptrunner/browsers/android_weblayer.py | FarooqAR/wpt | b3ec19cc197ab727dcfea1c03f8af1e37e6a8007 | [
"BSD-3-Clause"
] | 2 | 2020-04-16T18:41:05.000Z | 2021-01-30T04:33:07.000Z | tools/wptrunner/wptrunner/browsers/android_weblayer.py | FarooqAR/wpt | b3ec19cc197ab727dcfea1c03f8af1e37e6a8007 | [
"BSD-3-Clause"
] | 21 | 2021-03-31T19:48:22.000Z | 2022-03-12T00:24:53.000Z | tools/wptrunner/wptrunner/browsers/android_weblayer.py | FarooqAR/wpt | b3ec19cc197ab727dcfea1c03f8af1e37e6a8007 | [
"BSD-3-Clause"
] | 2 | 2021-01-05T23:43:46.000Z | 2021-01-07T23:36:34.000Z | import subprocess
from .base import Browser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier # noqa: F401
from .chrome import executor_kwargs as chrome_executor_kwargs
from ..webdriver_server import ChromeDriverServer
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # n... | 39.022059 | 91 | 0.635764 | import subprocess
from .base import Browser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier
from .chrome import executor_kwargs as chrome_executor_kwargs
from ..webdriver_server import ChromeDriverServer
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor,
... | true | true |
f75588051498afbc415662e6c74bbae5a171d6d9 | 11,790 | py | Python | Lib/test/eintrdata/eintr_tester.py | pelotoncycle/cpython-fork | 1ab99a0e912aac9c3f16555f23284d7e381f2f69 | [
"PSF-2.0"
] | 70 | 2015-06-20T17:59:24.000Z | 2021-05-03T02:01:49.000Z | Lib/test/eintrdata/eintr_tester.py | sky-skynet/Python3 | b816507f56ee14b730b7ab52a61eb17f9eb9d815 | [
"PSF-2.0"
] | 16 | 2015-06-11T14:57:43.000Z | 2016-12-03T00:22:13.000Z | Lib/test/eintrdata/eintr_tester.py | sky-skynet/Python3 | b816507f56ee14b730b7ab52a61eb17f9eb9d815 | [
"PSF-2.0"
] | 36 | 2015-05-15T20:30:44.000Z | 2020-11-14T19:31:40.000Z | """
This test suite exercises some system calls subject to interruption with EINTR,
to check that it is actually handled transparently.
It is intended to be run by the main test suite within a child process, to
ensure there is no background thread running (so that signals are delivered to
the correct thread).
Signals a... | 31.27321 | 79 | 0.589567 |
import io
import os
import select
import signal
import socket
import time
import unittest
from test import support
@unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
class EINTRBaseTest(unittest.TestCase):
signal_delay = 0.1
signal_period = 0.1
sleep_time = 0... | true | true |
f75588ca91b971b4a06c00c380a8e4659917a826 | 2,109 | py | Python | aliyun-python-sdk-drds/aliyunsdkdrds/request/v20190123/SubmitSwitchTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-drds/aliyunsdkdrds/request/v20190123/SubmitSwitchTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-drds/aliyunsdkdrds/request/v20190123/SubmitSwitchTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 34.016129 | 77 | 0.761972 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkdrds.endpoint import endpoint_data
class SubmitSwitchTaskRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Drds', '2019-01-23', 'SubmitSwitchTask','drds')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
f755896c8b5fc1ffd96807551b162d0749124da4 | 1,721 | py | Python | configurator/quicktest/report_example.py | ClockworkOrigins/m2etis | 3b9c0f98c172f48889e75fe0b80a61a0e47670f5 | [
"Apache-2.0"
] | 2 | 2016-01-24T22:08:27.000Z | 2017-01-01T13:06:44.000Z | configurator/quicktest/report_example.py | ClockworkOrigins/m2etis | 3b9c0f98c172f48889e75fe0b80a61a0e47670f5 | [
"Apache-2.0"
] | null | null | null | configurator/quicktest/report_example.py | ClockworkOrigins/m2etis | 3b9c0f98c172f48889e75fe0b80a61a0e47670f5 | [
"Apache-2.0"
] | null | null | null | __author__ = 'amw'
from configurator.persistence.PersistenceManager import PersistenceManager
from Reporting import plot3d, plot2d, create_dataset, create_plot_matrix
# Initialise database config
db_config = {"hostname": "localhost", "port": "27017", "db_name": "sianwahl_test", "collection_name": "test"}
#
# 2d exam... | 43.025 | 115 | 0.676932 | __author__ = 'amw'
from configurator.persistence.PersistenceManager import PersistenceManager
from Reporting import plot3d, plot2d, create_dataset, create_plot_matrix
db_config = {"hostname": "localhost", "port": "27017", "db_name": "sianwahl_test", "collection_name": "test"}
tag = "channel0_all_no_flux"
x_par... | true | true |
f75589efd7c0e17b9ac003f80a1178023e231a53 | 4,811 | py | Python | python-client/swagger_client/models/bucket.py | gabisurita/kinto-codegen-tutorial | b5921ec603df031f9ff25683b7a3fbed5af79094 | [
"MIT"
] | 2 | 2017-03-02T13:12:24.000Z | 2017-10-22T10:31:09.000Z | python-client/swagger_client/models/bucket.py | gabisurita/kinto-codegen-tutorial | b5921ec603df031f9ff25683b7a3fbed5af79094 | [
"MIT"
] | null | null | null | python-client/swagger_client/models/bucket.py | gabisurita/kinto-codegen-tutorial | b5921ec603df031f9ff25683b7a3fbed5af79094 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
kinto
Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch ... | 31.444444 | 938 | 0.594055 |
from pprint import pformat
from six import iteritems
import re
class Bucket(object):
def __init__(self, data=None, permissions=None):
self.swagger_types = {
'data': 'object',
'permissions': 'BucketPermissions'
}
self.attribute_map = {
'data': 'data',... | true | true |
f7558a6e333c475a2399cad7a8f680181192c633 | 17,094 | py | Python | hgext/convert/git.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | hgext/convert/git.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | hgext/convert/git.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # git.py - git support for the convert extension
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import os
from mercurial.i... | 35.538462 | 80 | 0.503803 |
from __future__ import absolute_import
import os
from mercurial.i18n import _
from mercurial import (
config,
error,
node as nodemod,
)
from . import (
common,
)
class submodule(object):
def __init__(self, path, node, url):
self.path = path
self.node = node
self.url... | true | true |
f7558ac5ccfb283d83840252a788db94af76e9e6 | 605 | py | Python | c2cwsgiutils/sql_profiler/__init__.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cwsgiutils/sql_profiler/__init__.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cwsgiutils/sql_profiler/__init__.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """
A view (URL=/sql_provider) allowing to enabled/disable a SQL spy that runs an "EXPLAIN ANALYZE" on
every SELECT query going through SQLAlchemy.
"""
import logging
import pyramid.request
from c2cwsgiutils import auth
ENV_KEY = "C2C_SQL_PROFILER_ENABLED"
CONFIG_KEY = "c2c.sql_profiler_enabled"
LOG = logging.getLog... | 24.2 | 98 | 0.73719 | import logging
import pyramid.request
from c2cwsgiutils import auth
ENV_KEY = "C2C_SQL_PROFILER_ENABLED"
CONFIG_KEY = "c2c.sql_profiler_enabled"
LOG = logging.getLogger(__name__)
repository = None
def init(config: pyramid.config.Configurator) -> None:
if auth.is_enabled(config, ENV_KEY, CONFIG_KEY):
fr... | true | true |
f7558b1b360903fc34464b87e16f87bdac1551e8 | 63 | py | Python | python/testData/refactoring/inlineFunction/star.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/inlineFunction/star.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/testData/refactoring/inlineFunction/star.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def foo(*args, **kwargs):
pass
fo<caret>o(1, 2, 3, x = 4)
| 12.6 | 26 | 0.52381 | def foo(*args, **kwargs):
pass
fo<caret>o(1, 2, 3, x = 4)
| true | true |
f7558be278865a88ffc7e71cd2bd7330acee878d | 5,461 | py | Python | cvelib/cve_api.py | zmanion/cvelib | 158666d31171eeb3d8fb33a8cbc12a48914dab3f | [
"MIT"
] | null | null | null | cvelib/cve_api.py | zmanion/cvelib | 158666d31171eeb3d8fb33a8cbc12a48914dab3f | [
"MIT"
] | null | null | null | cvelib/cve_api.py | zmanion/cvelib | 158666d31171eeb3d8fb33a8cbc12a48914dab3f | [
"MIT"
] | null | null | null | from urllib.parse import urljoin
import requests
class CveApiError(Exception):
"""Raise when encountering errors returned by the CVE API."""
pass
class CveApi:
ENVS = {
"prod": "https://cveawg.mitre.org/api/",
"dev": "https://cveawg-dev.mitre.org/api/",
"test": "https://cveawg-... | 34.783439 | 97 | 0.599158 | from urllib.parse import urljoin
import requests
class CveApiError(Exception):
pass
class CveApi:
ENVS = {
"prod": "https://cveawg.mitre.org/api/",
"dev": "https://cveawg-dev.mitre.org/api/",
"test": "https://cveawg-test.mitre.org/api/",
}
USER_ROLES = ("ADMIN",)
def _... | true | true |
f7558c296e65b1444105b50da55fccead9e1614f | 20,296 | py | Python | deeppavlov/models/preprocessors/squad_preprocessor.py | xbodx/DeepPavlov | 4b60bf162df4294b8b0db3b72786cdd699c674fa | [
"Apache-2.0"
] | 2 | 2021-06-24T01:20:26.000Z | 2021-07-15T13:28:15.000Z | deeppavlov/models/preprocessors/squad_preprocessor.py | xbodx/DeepPavlov | 4b60bf162df4294b8b0db3b72786cdd699c674fa | [
"Apache-2.0"
] | 1 | 2021-05-10T00:29:28.000Z | 2021-05-10T00:31:00.000Z | deeppavlov/models/preprocessors/squad_preprocessor.py | xbodx/DeepPavlov | 4b60bf162df4294b8b0db3b72786cdd699c674fa | [
"Apache-2.0"
] | 2 | 2022-03-15T07:32:06.000Z | 2022-03-17T05:25:27.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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... | 40.349901 | 120 | 0.582578 |
import bisect
import pickle
import unicodedata
from collections import Counter
from logging import getLogger
from pathlib import Path
from typing import Tuple, List, Union
import numpy as np
from nltk import word_tokenize
from tqdm import tqdm
from deeppavlov.core.commands.utils import expand_path
from... | true | true |
f7558c9566014f8020b9a7cf25b92ba44c22639f | 572 | py | Python | src/py42/sdk/queries/fileevents/filters/__init__.py | code42/py42 | ae748ea737ddcc89a92b2cf17b7e0433198d60bc | [
"MIT"
] | 21 | 2020-04-21T20:33:08.000Z | 2022-02-24T19:09:52.000Z | src/py42/sdk/queries/fileevents/filters/__init__.py | code42/py42 | ae748ea737ddcc89a92b2cf17b7e0433198d60bc | [
"MIT"
] | 255 | 2020-03-31T18:56:17.000Z | 2022-03-29T17:16:54.000Z | src/py42/sdk/queries/fileevents/filters/__init__.py | code42/py42 | ae748ea737ddcc89a92b2cf17b7e0433198d60bc | [
"MIT"
] | 14 | 2020-03-31T19:11:26.000Z | 2022-03-14T20:42:51.000Z | from py42.sdk.queries.fileevents.filters.activity_filter import *
from py42.sdk.queries.fileevents.filters.cloud_filter import *
from py42.sdk.queries.fileevents.filters.device_filter import *
from py42.sdk.queries.fileevents.filters.email_filter import *
from py42.sdk.queries.fileevents.filters.event_filter import *
f... | 57.2 | 65 | 0.842657 | from py42.sdk.queries.fileevents.filters.activity_filter import *
from py42.sdk.queries.fileevents.filters.cloud_filter import *
from py42.sdk.queries.fileevents.filters.device_filter import *
from py42.sdk.queries.fileevents.filters.email_filter import *
from py42.sdk.queries.fileevents.filters.event_filter import *
f... | true | true |
f7558cbd64b953d5e74dbf7e1c6fcf75e0741d45 | 15,079 | py | Python | google/cloud/sql/v1/sql-v1-py/google/cloud/sql_v1/services/sql_backup_runs_service/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/sql/v1/sql-v1-py/google/cloud/sql_v1/services/sql_backup_runs_service/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/sql/v1/sql-v1-py/google/cloud/sql_v1/services/sql_backup_runs_service/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.744807 | 95 | 0.627959 |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth
from google.auth import credentials as ga_credentials
from google.auth.transport.grpc ... | true | true |
f7558dd96b928bcb2cb8846545656c7e5515ffa1 | 940 | py | Python | twitter/stream.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | twitter/stream.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | twitter/stream.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | from threading import Thread
import tweepy
import csv
import sys
from datetime import datetime,timedelta
from time import sleep
try:
from twitter.Status import Status
from twitter.search import gettweets_bykeyword
from twitter.search import get_api
from twitter.Database import Database_connection as db_
except... | 26.857143 | 100 | 0.754255 | from threading import Thread
import tweepy
import csv
import sys
from datetime import datetime,timedelta
from time import sleep
try:
from twitter.Status import Status
from twitter.search import gettweets_bykeyword
from twitter.search import get_api
from twitter.Database import Database_connection as db_
except... | true | true |
f7558de06abd1699533ce89a0abc10327d1efd2f | 148,094 | py | Python | conans/client/migrations_settings.py | Wonders11/conan | 28ec09f6cbf1d7e27ec27393fd7bbc74891e74a8 | [
"MIT"
] | null | null | null | conans/client/migrations_settings.py | Wonders11/conan | 28ec09f6cbf1d7e27ec27393fd7bbc74891e74a8 | [
"MIT"
] | null | null | null | conans/client/migrations_settings.py | Wonders11/conan | 28ec09f6cbf1d7e27ec27393fd7bbc74891e74a8 | [
"MIT"
] | null | null | null | settings_1_9_0 = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc64le, ppc64, armv6, armv7, armv7hf, armv8, sparc, sparcv9, mips, mips64, avr, armv7s, armv7k]
# Only for building cross compil... | 47.679974 | 290 | 0.527516 | settings_1_9_0 = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc64le, ppc64, armv6, armv7, armv7hf, armv8, sparc, sparcv9, mips, mips64, avr, armv7s, armv7k]
# Only for building cross compil... | true | true |
f7558e6656f9df4fd62e1fb0aef249a5b5895fce | 4,008 | py | Python | parler/cache.py | nephila/django-parler | 4c747519d9f119d9a99f51ffc5888e290f601d6d | [
"Apache-2.0"
] | null | null | null | parler/cache.py | nephila/django-parler | 4c747519d9f119d9a99f51ffc5888e290f601d6d | [
"Apache-2.0"
] | null | null | null | parler/cache.py | nephila/django-parler | 4c747519d9f119d9a99f51ffc5888e290f601d6d | [
"Apache-2.0"
] | null | null | null | from django.core.cache import cache
from django.utils import six
from parler import appsettings
from parler.utils import get_language_settings
if six.PY3:
long = int
def get_object_cache_keys(instance):
"""
Return the cache keys associated with an object.
"""
if not instance.pk or instance._state... | 33.4 | 135 | 0.723802 | from django.core.cache import cache
from django.utils import six
from parler import appsettings
from parler.utils import get_language_settings
if six.PY3:
long = int
def get_object_cache_keys(instance):
if not instance.pk or instance._state.adding:
return []
keys = []
for language in in... | true | true |
f7558e78af80728354ad5ea0a081092a09e047eb | 1,490 | py | Python | dvq/data/cifar10.py | zhangbo2008/vqvae_pytorch | 98f2f2386328245ae26ac999528c7dda57680aca | [
"MIT"
] | null | null | null | dvq/data/cifar10.py | zhangbo2008/vqvae_pytorch | 98f2f2386328245ae26ac999528c7dda57680aca | [
"MIT"
] | null | null | null | dvq/data/cifar10.py | zhangbo2008/vqvae_pytorch | 98f2f2386328245ae26ac999528c7dda57680aca | [
"MIT"
] | null | null | null | from torch.utils.data import DataLoader
from torchvision import transforms as T
from torchvision.datasets import CIFAR10
import pytorch_lightning as pl
class CIFAR10Data(pl.LightningDataModule):
""" returns cifar-10 examples in floats in range [0,1] """
def __init__(self, args):
super().__init__()
... | 28.113208 | 96 | 0.574497 | from torch.utils.data import DataLoader
from torchvision import transforms as T
from torchvision.datasets import CIFAR10
import pytorch_lightning as pl
class CIFAR10Data(pl.LightningDataModule):
def __init__(self, args):
super().__init__()
self.a=args
def train_dataloader(self):
... | true | true |
f7558f93bbac5ce1e6e2f1e6e0958eee270609b9 | 729 | py | Python | anuvaad-etl/anuvaad-nmt-models-fetch/src/models/response.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 15 | 2021-01-08T08:42:30.000Z | 2022-03-12T17:52:15.000Z | anuvaad-etl/anuvaad-nmt-models-fetch/src/models/response.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 16 | 2021-01-21T01:38:51.000Z | 2022-01-20T08:59:52.000Z | anuvaad-etl/anuvaad-nmt-models-fetch/src/models/response.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 25 | 2020-08-26T11:25:38.000Z | 2022-03-29T04:40:21.000Z | from flask import jsonify
class CustomResponse :
def __init__(self, statuscode, data):
self.statuscode = {"status":statuscode, "response_body" : data}
self.response = {"status":statuscode, "data" : data}
self.data_out = data
def getres(self):
return jsonify(self.statuscode)... | 25.137931 | 71 | 0.632373 | from flask import jsonify
class CustomResponse :
def __init__(self, statuscode, data):
self.statuscode = {"status":statuscode, "response_body" : data}
self.response = {"status":statuscode, "data" : data}
self.data_out = data
def getres(self):
return jsonify(self.statuscode)... | true | true |
f755902bec65850ed0d5d18493490e83b6d22f0a | 1,604 | py | Python | test/test_verve_response_notification_list.py | iEngage/python-sdk | 76cc6ed697d7599ce9af74124c12d33ad5aff419 | [
"Apache-2.0"
] | null | null | null | test/test_verve_response_notification_list.py | iEngage/python-sdk | 76cc6ed697d7599ce9af74124c12d33ad5aff419 | [
"Apache-2.0"
] | null | null | null | test/test_verve_response_notification_list.py | iEngage/python-sdk | 76cc6ed697d7599ce9af74124c12d33ad5aff419 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
iEngage 2.0 API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 2.0
Generated by: https://github.com/swagger-api/swagge... | 29.703704 | 186 | 0.749377 |
from __future__ import absolute_import
import os
import sys
import unittest
import iengage_client
from iengage_client.rest import ApiException
from iengage_client.models.verve_response_notification_list import VerveResponseNotificationList
class TestVerveResponseNotificationList(unittest.TestCase):
def setU... | true | true |
f75590f8121842e2e0fff61df3c067fb6356c39e | 2,996 | py | Python | labs/lab-06/plot_words_step3.py | BianoBonzo/oss-repo-template | 82b25d9880e8e6a7b4d72070939b4a4b4a20dd2d | [
"MIT"
] | null | null | null | labs/lab-06/plot_words_step3.py | BianoBonzo/oss-repo-template | 82b25d9880e8e6a7b4d72070939b4a4b4a20dd2d | [
"MIT"
] | null | null | null | labs/lab-06/plot_words_step3.py | BianoBonzo/oss-repo-template | 82b25d9880e8e6a7b4d72070939b4a4b4a20dd2d | [
"MIT"
] | null | null | null | """
=====
Words
=====
Words/Ladder Graph
------------------
Generate an undirected graph over the 5757 5-letter words in the
datafile `words_dat.txt.gz`. Two words are connected by an edge
if they differ in one letter, resulting in 14,135 edges. This example
is described in Section 1.1 in Knuth's book (see [1]_ and [... | 32.215054 | 76 | 0.560414 |
import gzip
from string import ascii_lowercase as lowercase
import networkx as nx
from itertools import permutations
def generate_graph(words):
G = nx.Graph(name="words")
lookup = dict((c, lowercase.index(c)) for c in lowercase)
def edit_distance_one(word):
p = list(permutations(... | true | true |
f7559229da4deebb4d14fd3afc78c0b81e0cab6e | 405 | py | Python | py_codes/037metaclass.py | fusugz/lifeisshort | 46bb2cf7fcdba57df5f9247c4d45dac83cb526d7 | [
"MIT"
] | 2 | 2017-05-23T10:22:18.000Z | 2017-07-03T15:14:55.000Z | py_codes/037metaclass.py | fusugz/lifeisshort | 46bb2cf7fcdba57df5f9247c4d45dac83cb526d7 | [
"MIT"
] | null | null | null | py_codes/037metaclass.py | fusugz/lifeisshort | 46bb2cf7fcdba57df5f9247c4d45dac83cb526d7 | [
"MIT"
] | null | null | null | #!usr/bin/emv python3
# -*- coding: utf-8 -*-
# metaclass是创建类,所以必须从`type`类型派生
class ListMetaclass(type):
def __new__(cls, name, bases, attrs):
attrs['add'] = lambda self, value: self.append(value)
return type.__new__(cls, name, bases, attrs)
# 指示使用ListMetaclass来定制类
class MyList(list, metaclass=Lis... | 20.25 | 61 | 0.666667 |
class ListMetaclass(type):
def __new__(cls, name, bases, attrs):
attrs['add'] = lambda self, value: self.append(value)
return type.__new__(cls, name, bases, attrs)
class MyList(list, metaclass=ListMetaclass):
pass
L = MyList()
L.add(1)
L.add(2)
L.add(3)
L.add('END')
print(L)
| true | true |
f755923eb296326ea5dcc27a58b53a41924fc826 | 31,050 | py | Python | language/serene/training.py | Xtuden-com/language | 70c0328968d5ffa1201c6fdecde45bbc4fec19fc | [
"Apache-2.0"
] | 1,199 | 2018-10-16T01:30:18.000Z | 2022-03-31T21:05:24.000Z | language/serene/training.py | Xtuden-com/language | 70c0328968d5ffa1201c6fdecde45bbc4fec19fc | [
"Apache-2.0"
] | 116 | 2018-10-18T03:31:46.000Z | 2022-03-24T13:40:50.000Z | language/serene/training.py | Xtuden-com/language | 70c0328968d5ffa1201c6fdecde45bbc4fec19fc | [
"Apache-2.0"
] | 303 | 2018-10-22T12:35:12.000Z | 2022-03-27T17:38:17.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 36.876485 | 92 | 0.681063 |
import json
import os
from absl import logging
import dataclasses
from language.serene import callbacks
from language.serene import fever_tfds
from language.serene import layers
from language.serene import losses
from language.serene import model
from language.serene import preprocessing
from language... | true | true |
f7559262817be18b0676abe92c562d31074fe587 | 2,413 | py | Python | py/tests/package_win32.py | radrow/aeternity | 4aaf3389cd2e8b7a340e58b7d9e95ada55607f80 | [
"ISC"
] | 1 | 2019-10-01T08:02:20.000Z | 2019-10-01T08:02:20.000Z | py/tests/package_win32.py | radrow/aeternity | 4aaf3389cd2e8b7a340e58b7d9e95ada55607f80 | [
"ISC"
] | null | null | null | py/tests/package_win32.py | radrow/aeternity | 4aaf3389cd2e8b7a340e58b7d9e95ada55607f80 | [
"ISC"
] | null | null | null | import os
import re
import sys
import argparse
def existing_empty_dir(s):
if s == "":
msg = "{} is not a non-empty directory path".format(s)
raise argparse.ArgumentTypeError(msg)
v = os.path.abspath(s)
if not os.path.isdir(v):
msg = ("Path {} is not an existing directory "
... | 32.173333 | 94 | 0.643597 | import os
import re
import sys
import argparse
def existing_empty_dir(s):
if s == "":
msg = "{} is not a non-empty directory path".format(s)
raise argparse.ArgumentTypeError(msg)
v = os.path.abspath(s)
if not os.path.isdir(v):
msg = ("Path {} is not an existing directory "
... | true | true |
f755934e60d6d4be3db63dede85732d4e6ccc082 | 1,506 | py | Python | nomadgram/images/migrations/0003_auto_20171102_2248.py | marrywill/nomadgram | c10c3f4cb1dfc833d2ef1e74caeee0ed420eacdd | [
"MIT"
] | 2 | 2018-07-13T00:50:15.000Z | 2019-08-30T09:58:44.000Z | nomadgram/images/migrations/0003_auto_20171102_2248.py | marrywill/nomadgram | c10c3f4cb1dfc833d2ef1e74caeee0ed420eacdd | [
"MIT"
] | null | null | null | nomadgram/images/migrations/0003_auto_20171102_2248.py | marrywill/nomadgram | c10c3f4cb1dfc833d2ef1e74caeee0ed420eacdd | [
"MIT"
] | 2 | 2017-11-01T19:03:42.000Z | 2019-11-15T02:10:12.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-02 13:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | 34.227273 | 121 | 0.63081 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('images', '0002_like'),
]
... | true | true |
f7559380626572a65d2714f7ae6069138c16c82a | 4,805 | py | Python | test/test_ssl.py | ssbarnea/urllib3 | d3424aa41833dbac4958ddefda9a1de9ee8311e5 | [
"MIT"
] | null | null | null | test/test_ssl.py | ssbarnea/urllib3 | d3424aa41833dbac4958ddefda9a1de9ee8311e5 | [
"MIT"
] | 4 | 2020-04-18T01:45:22.000Z | 2020-04-23T21:46:42.000Z | test/test_ssl.py | ssbarnea/urllib3 | d3424aa41833dbac4958ddefda9a1de9ee8311e5 | [
"MIT"
] | 1 | 2020-03-20T00:35:41.000Z | 2020-03-20T00:35:41.000Z | import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
from test import notPyPy2
@pytest.mark.parametrize(
"addr",
[
# IPv6
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
# IPv4
"127.0.0.1",
"8.8.8.8",
... | 28.264706 | 88 | 0.677627 | import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
from test import notPyPy2
@pytest.mark.parametrize(
"addr",
[
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
"127.0.0.1",
"8.8.8.8",
b"127.... | true | true |
f75594262a7cd79de430e1711751bf3a39dc594c | 2,470 | py | Python | aliyun-python-sdk-slb/aliyunsdkslb/request/v20140515/DescribeLoadBalancerTCPListenerAttributeRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-slb/aliyunsdkslb/request/v20140515/DescribeLoadBalancerTCPListenerAttributeRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-slb/aliyunsdkslb/request/v20140515/DescribeLoadBalancerTCPListenerAttributeRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 36.323529 | 99 | 0.779757 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkslb.endpoint import endpoint_data
class DescribeLoadBalancerTCPListenerAttributeRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Slb', '2014-05-15', 'DescribeLoadBalancerTCPListenerAttribute','slb')
self.set_method(... | true | true |
f75594a546e15c4e3aec12aeb9b10b46cc891649 | 9,408 | py | Python | homeassistant/scripts/check_config.py | kristianheljas/homeassistant-core | eb7220ff262fe81d53c929884107bcedc8af7850 | [
"Apache-2.0"
] | null | null | null | homeassistant/scripts/check_config.py | kristianheljas/homeassistant-core | eb7220ff262fe81d53c929884107bcedc8af7850 | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/scripts/check_config.py | kristianheljas/homeassistant-core | eb7220ff262fe81d53c929884107bcedc8af7850 | [
"Apache-2.0"
] | null | null | null | """Script to check the configuration file."""
import argparse
import asyncio
from collections import OrderedDict
from collections.abc import Mapping, Sequence
from glob import glob
import logging
import os
from typing import Any, Callable, Dict, List, Tuple
from unittest.mock import patch
from homeassistant import boo... | 34.973978 | 88 | 0.60693 | import argparse
import asyncio
from collections import OrderedDict
from collections.abc import Mapping, Sequence
from glob import glob
import logging
import os
from typing import Any, Callable, Dict, List, Tuple
from unittest.mock import patch
from homeassistant import bootstrap, core
from homeassistant.config import ... | true | true |
f75594efe43761198b2393d7e4c2eba86cbe05dd | 1,013 | py | Python | test/test1/test1.py | stanislawbartkowski/CivPython | 9228d085848dcbe1c9ac9dbefe54371c32fc5e74 | [
"Apache-2.0"
] | 2 | 2019-04-30T23:29:59.000Z | 2019-05-04T00:43:49.000Z | test/test1/test1.py | stanislawbartkowski/CivPython | 9228d085848dcbe1c9ac9dbefe54371c32fc5e74 | [
"Apache-2.0"
] | null | null | null | test/test1/test1.py | stanislawbartkowski/CivPython | 9228d085848dcbe1c9ac9dbefe54371c32fc5e74 | [
"Apache-2.0"
] | null | null | null | '''
Created on 3 lut 2019
@author: civ
'''
import unittest
import sys
print(sys.path)
from com.civ.rest import CivRest as C
from com.civ.play.Play import TestGame
from helper import TestHelper
class Test(unittest.TestCase):
def setUp(self):
C.registerAutom()
# @unittest.skip("demonstrating sk... | 22.021739 | 72 | 0.594274 | import unittest
import sys
print(sys.path)
from com.civ.rest import CivRest as C
from com.civ.play.Play import TestGame
from helper import TestHelper
class Test(unittest.TestCase):
def setUp(self):
C.registerAutom()
def test1(self):
print("Simple test for single player game")
... | true | true |
f75595781fbd8d1585c69fef74349cb8da9d0806 | 2,680 | py | Python | catms.py | mouse-reeve/catms | 030d8afedbb03a3ff4e63eaf1ec9345bf79f35c5 | [
"MIT"
] | null | null | null | catms.py | mouse-reeve/catms | 030d8afedbb03a3ff4e63eaf1ec9345bf79f35c5 | [
"MIT"
] | 1 | 2017-03-15T23:35:18.000Z | 2017-03-15T23:35:18.000Z | catms.py | mouse-reeve/catms | 030d8afedbb03a3ff4e63eaf1ec9345bf79f35c5 | [
"MIT"
] | null | null | null | ''' get sms from a cat '''
from flask import Flask, request
import re
from random import choice, randint, sample
from twilio.rest import TwilioRestClient
import settings
app = Flask(__name__)
base_url = settings.BASE_URL
account_sid = settings.TWILIO_SID
auth_token = settings.TWILIO_TOKEN
number = settings.TWILIO_NUM... | 29.777778 | 80 | 0.535075 | from flask import Flask, request
import re
from random import choice, randint, sample
from twilio.rest import TwilioRestClient
import settings
app = Flask(__name__)
base_url = settings.BASE_URL
account_sid = settings.TWILIO_SID
auth_token = settings.TWILIO_TOKEN
number = settings.TWILIO_NUMBER
client = TwilioRestClie... | true | true |
f755968542a749c056ce45e2663393bd980cd2ca | 2,306 | py | Python | app/user/schema.py | hiroaki-yamamoto/django-graphql-trial | f7994cf4d8260c55cea2ce105d5241458b22d39d | [
"MIT"
] | null | null | null | app/user/schema.py | hiroaki-yamamoto/django-graphql-trial | f7994cf4d8260c55cea2ce105d5241458b22d39d | [
"MIT"
] | null | null | null | app/user/schema.py | hiroaki-yamamoto/django-graphql-trial | f7994cf4d8260c55cea2ce105d5241458b22d39d | [
"MIT"
] | null | null | null | # from django.conf import settings
from django.contrib.auth import get_user_model, authenticate, login, logout
import graphene
from graphene_django.types import DjangoObjectType
from .models import UserDetail
class BasicUserInfoType(DjangoObjectType):
"""Django basic user information."""
class Meta(object):... | 24.020833 | 75 | 0.645707 |
from django.contrib.auth import get_user_model, authenticate, login, logout
import graphene
from graphene_django.types import DjangoObjectType
from .models import UserDetail
class BasicUserInfoType(DjangoObjectType):
class Meta(object):
model = get_user_model()
class PublicBasicUserInfoType(DjangoObj... | true | true |
f7559742c6384db86bb6810426d22dfa397eb827 | 151 | py | Python | apps/devices/apps.py | valentinooodev/EVO_Home_Backend | 72cfb764e805b56a164bda1c9c9ebcc3c6da54c9 | [
"MIT"
] | null | null | null | apps/devices/apps.py | valentinooodev/EVO_Home_Backend | 72cfb764e805b56a164bda1c9c9ebcc3c6da54c9 | [
"MIT"
] | null | null | null | apps/devices/apps.py | valentinooodev/EVO_Home_Backend | 72cfb764e805b56a164bda1c9c9ebcc3c6da54c9 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DevicesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.devices'
| 21.571429 | 56 | 0.761589 | from django.apps import AppConfig
class DevicesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.devices'
| true | true |
f75597470ed2bb7fd2fe3af55b64a2cbba5b2c0f | 1,976 | py | Python | taiga/userstorage/models.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | null | null | null | taiga/userstorage/models.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | 12 | 2019-11-25T14:08:32.000Z | 2021-06-24T10:35:51.000Z | taiga/userstorage/models.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | 49.4 | 90 | 0.705972 |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from taiga.base.db.models.fields import JSONField
class StorageEntry(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=False, null=False,
... | true | true |
f7559786462a5b4a1b581e880717226bd0da4be0 | 756 | py | Python | setup.py | mtreinish/powerpyspice | 4281f9c41dfc4d7dc459f51215e0f253228ad6d5 | [
"Apache-2.0"
] | 1 | 2015-11-29T15:27:36.000Z | 2015-11-29T15:27:36.000Z | setup.py | mtreinish/powerpyspice | 4281f9c41dfc4d7dc459f51215e0f253228ad6d5 | [
"Apache-2.0"
] | null | null | null | setup.py | mtreinish/powerpyspice | 4281f9c41dfc4d7dc459f51215e0f253228ad6d5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013 Matthew Treinish
#
# 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... | 28 | 69 | 0.746032 |
import setuptools
try:
import multiprocessing
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
| true | true |
f75597c7d591d460e658f259cece1fa2b3caa51c | 3,552 | py | Python | whetlab/server/http_client/__init__.py | schevalier/Whetlab-Python-Client | e934424e9ca6f06617a6421509d13c0cc87777e7 | [
"BSD-4-Clause"
] | 4 | 2015-07-31T12:47:36.000Z | 2021-04-14T16:37:55.000Z | whetlab/server/http_client/__init__.py | schevalier/Whetlab-Python-Client | e934424e9ca6f06617a6421509d13c0cc87777e7 | [
"BSD-4-Clause"
] | null | null | null | whetlab/server/http_client/__init__.py | schevalier/Whetlab-Python-Client | e934424e9ca6f06617a6421509d13c0cc87777e7 | [
"BSD-4-Clause"
] | 3 | 2016-03-25T02:23:09.000Z | 2018-05-04T03:09:02.000Z | import requests
import copy
import platform
import os
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
from .auth_handler import AuthHandler
from .error_handler import ErrorHandler
from .request_handler import RequestHandler
from .response import Response
from .response_handler import Respon... | 25.371429 | 82 | 0.706644 | import requests
import copy
import platform
import os
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
from .auth_handler import AuthHandler
from .error_handler import ErrorHandler
from .request_handler import RequestHandler
from .response import Response
from .response_handler import Respon... | true | true |
f75599ec9c7ad07b7956e082a63fe2a8402279a1 | 37,350 | py | Python | example/dj/apps/app/tests/utils.py | cedel1/django-auth-token | fc108468de8952c05c067e37bd0aa024345d86e3 | [
"BSD-3-Clause"
] | 6 | 2018-07-03T13:06:27.000Z | 2021-02-26T22:46:34.000Z | example/dj/apps/app/tests/utils.py | cedel1/django-auth-token | fc108468de8952c05c067e37bd0aa024345d86e3 | [
"BSD-3-Clause"
] | 9 | 2018-07-18T09:00:46.000Z | 2021-09-22T17:41:34.000Z | example/dj/apps/app/tests/utils.py | cedel1/django-auth-token | fc108468de8952c05c067e37bd0aa024345d86e3 | [
"BSD-3-Clause"
] | 5 | 2018-10-26T11:00:16.000Z | 2021-06-29T15:24:17.000Z | import re
import string
from datetime import timedelta
from unittest import mock
from freezegun import freeze_time
from django.core.management import call_command
from django.utils.timezone import now
from django.test import override_settings
from django.test.client import RequestFactory
from germanium.decorators ... | 50.747283 | 120 | 0.731325 | import re
import string
from datetime import timedelta
from unittest import mock
from freezegun import freeze_time
from django.core.management import call_command
from django.utils.timezone import now
from django.test import override_settings
from django.test.client import RequestFactory
from germanium.decorators ... | true | true |
f7559a8f591c2d023420c78c92204352a785958c | 865 | py | Python | centroid_taxonomy.py | Tancata/phylo | fb397c31b5cf4cea3c1513391b330e715da2d603 | [
"MIT"
] | 5 | 2020-11-02T06:23:36.000Z | 2021-09-07T01:35:35.000Z | centroid_taxonomy.py | Tancata/phylo | fb397c31b5cf4cea3c1513391b330e715da2d603 | [
"MIT"
] | 1 | 2021-11-10T13:34:23.000Z | 2021-11-10T16:53:02.000Z | centroid_taxonomy.py | Tancata/phylo | fb397c31b5cf4cea3c1513391b330e715da2d603 | [
"MIT"
] | 4 | 2018-07-17T13:35:20.000Z | 2021-07-09T18:28:44.000Z | from ete3 import Tree
import sys
tree = Tree(sys.argv[1])
centroid_tips = []
reference_tips = []
for leaf in tree:
if leaf.name.startswith("centroid"):
centroid_tips.append(leaf.name)
else:
reference_tips.append(leaf.name)
#print("CENTROIDS:")
#print(centroid_tips)
#print("REFERENCES:")
#print(... | 27.903226 | 101 | 0.700578 | from ete3 import Tree
import sys
tree = Tree(sys.argv[1])
centroid_tips = []
reference_tips = []
for leaf in tree:
if leaf.name.startswith("centroid"):
centroid_tips.append(leaf.name)
else:
reference_tips.append(leaf.name)
for tipname in centroid_tips:
to_keep = []
to_keep.extend(... | true | true |
f7559b01b8ba35af14500d27b61d0b0830bb159e | 8,886 | py | Python | src/WindowHandler.py | Wolfterro/Criador-De-Postagens | 9ee8e4727f6a25ae9aff2e4cbe3954ebbddb2d66 | [
"MIT"
] | 1 | 2017-03-26T04:05:07.000Z | 2017-03-26T04:05:07.000Z | src/WindowHandler.py | Wolfterro/Criador-De-Postagens | 9ee8e4727f6a25ae9aff2e4cbe3954ebbddb2d66 | [
"MIT"
] | null | null | null | src/WindowHandler.py | Wolfterro/Criador-De-Postagens | 9ee8e4727f6a25ae9aff2e4cbe3954ebbddb2d66 | [
"MIT"
] | 3 | 2020-03-01T21:34:59.000Z | 2021-02-03T17:18:28.000Z | # -*- coding: utf-8 -*-
'''
The MIT License (MIT)
Copyright (c) 2017 Wolfgang Almeida <wolfgang.almeida@yahoo.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, i... | 36.871369 | 119 | 0.627842 |
from __future__ import print_function
from PyQt4 import QtCore, QtGui
from os.path import expanduser
import os
import sys
import cgi
import ctypes
import hashlib
import datetime
import platform
from GlobalVars import GlobalVars
reload(sys)
sys.setdefaultencoding('utf-8')
try:
_f... | true | true |
f7559ba9236b79ea625312b7a5177080a9568b60 | 1,150 | py | Python | src/utilities.py | igordub/artificial-pdb-coord | 056c7e4a5b4181455f832f178ef9d7fe464d5cc8 | [
"MIT"
] | null | null | null | src/utilities.py | igordub/artificial-pdb-coord | 056c7e4a5b4181455f832f178ef9d7fe464d5cc8 | [
"MIT"
] | null | null | null | src/utilities.py | igordub/artificial-pdb-coord | 056c7e4a5b4181455f832f178ef9d7fe464d5cc8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script provides useful funcs to all other scripts
"""
import yaml
import glob
import os
def clean(flag="all"):
""" Cleans project directories.
"""
subdirs = ["raw", "interim", "processed"]
data_filepaths = []
pdb_filepaths = []
for subdir in subdir... | 26.744186 | 90 | 0.589565 |
import yaml
import glob
import os
def clean(flag="all"):
subdirs = ["raw", "interim", "processed"]
data_filepaths = []
pdb_filepaths = []
for subdir in subdirs:
data = glob.glob("data/{}/*".format(subdir))
data_filepaths.extend(data)
pdb = glob.glob("pdb/{}/*".form... | true | true |
f7559c4236e5f7b99874fdbdfbb10f508a69efc5 | 2,797 | py | Python | plugins/dbnd-docker/src/dbnd_docker/container_engine_config.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | plugins/dbnd-docker/src/dbnd_docker/container_engine_config.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | plugins/dbnd-docker/src/dbnd_docker/container_engine_config.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | import subprocess
from dbnd import parameter
from dbnd._core.parameter.validators import NonEmptyString
from dbnd._core.run.databand_run import DatabandRun
from dbnd._core.settings import EngineConfig
from targets.values.version_value import VersionStr
class ContainerEngineConfig(EngineConfig):
require_submit = ... | 37.293333 | 111 | 0.697176 | import subprocess
from dbnd import parameter
from dbnd._core.parameter.validators import NonEmptyString
from dbnd._core.run.databand_run import DatabandRun
from dbnd._core.settings import EngineConfig
from targets.values.version_value import VersionStr
class ContainerEngineConfig(EngineConfig):
require_submit = ... | true | true |
f7559c5d6e07ebbc4ec97ae2992ae2d46a1cf536 | 55,116 | py | Python | src/ui.py | etodd/a3p | 8a88705f4574767e1debdda88ba4f3aac0d1e674 | [
"MIT"
] | 19 | 2016-01-09T19:07:41.000Z | 2021-04-13T12:40:37.000Z | src/ui.py | etodd/a3p | 8a88705f4574767e1debdda88ba4f3aac0d1e674 | [
"MIT"
] | 2 | 2016-01-09T19:07:14.000Z | 2016-01-09T19:17:59.000Z | src/ui.py | etodd/a3p | 8a88705f4574767e1debdda88ba4f3aac0d1e674 | [
"MIT"
] | 8 | 2016-01-09T19:48:43.000Z | 2021-03-05T20:15:37.000Z | from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import *
import engine
import components
import controllers
import particles
import entities
import audio
from direct.gui.DirectGui import *
from direct.gui.OnscreenImage import OnscreenImage
from direct.gui.OnscreenText import OnscreenText... | 44.556184 | 1,244 | 0.696821 | from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import *
import engine
import components
import controllers
import particles
import entities
import audio
from direct.gui.DirectGui import *
from direct.gui.OnscreenImage import OnscreenImage
from direct.gui.OnscreenText import OnscreenText... | true | true |
f7559d08e19dd930601a7930643fe2ab03810360 | 3,484 | py | Python | apps/view/view-1.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | apps/view/view-1.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | apps/view/view-1.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2011-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | 31.963303 | 102 | 0.683984 | true | true | |
f7559da862c93d4f120be5656c85d3cfb1d72518 | 124 | py | Python | deep-learning-for-image-processing-master/pytorch_object_detection/train_coco_dataset/backbone/__init__.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | null | null | null | deep-learning-for-image-processing-master/pytorch_object_detection/train_coco_dataset/backbone/__init__.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | null | null | null | deep-learning-for-image-processing-master/pytorch_object_detection/train_coco_dataset/backbone/__init__.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | 2 | 2021-06-26T16:53:38.000Z | 2021-08-29T22:16:20.000Z | from .resnet50_fpn_model import resnet50_fpn_backbone
from .mobilenetv2_model import MobileNetV2
from .vgg_model import vgg
| 31 | 53 | 0.879032 | from .resnet50_fpn_model import resnet50_fpn_backbone
from .mobilenetv2_model import MobileNetV2
from .vgg_model import vgg
| true | true |
f7559e1025166670d8f5a9c67ea6bd3a2ad4f927 | 1,240 | py | Python | year2020/day04/test_reader.py | Sebaestschjin/advent-of-code | 5fd708efa355483fc0ccddf7548b62682662bcc8 | [
"MIT"
] | null | null | null | year2020/day04/test_reader.py | Sebaestschjin/advent-of-code | 5fd708efa355483fc0ccddf7548b62682662bcc8 | [
"MIT"
] | null | null | null | year2020/day04/test_reader.py | Sebaestschjin/advent-of-code | 5fd708efa355483fc0ccddf7548b62682662bcc8 | [
"MIT"
] | null | null | null | from assertpy import assert_that
import year2020.day04.reader as reader
def test_example():
lines = ['ecl:gry pid:860033327 eyr:2020 hcl:#fffffd\n',
'byr:1937 iyr:2017 cid:147 hgt:183cm\n',
'\n',
'iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884\n',
'hcl:#cfa07d... | 40 | 107 | 0.477419 | from assertpy import assert_that
import year2020.day04.reader as reader
def test_example():
lines = ['ecl:gry pid:860033327 eyr:2020 hcl:#fffffd\n',
'byr:1937 iyr:2017 cid:147 hgt:183cm\n',
'\n',
'iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884\n',
'hcl:#cfa07d... | true | true |
f7559e37838ce1b1eb75c7f182b0feb8d830b6be | 2,242 | py | Python | homeassistant/components/deconz/switch.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 1 | 2021-10-01T10:38:31.000Z | 2021-10-01T10:38:31.000Z | homeassistant/components/deconz/switch.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 66 | 2020-10-15T06:45:11.000Z | 2022-03-30T23:05:28.000Z | homeassistant/components/deconz/switch.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 1 | 2022-02-01T13:19:32.000Z | 2022-02-01T13:19:32.000Z | """Support for deCONZ switches."""
from pydeconz.light import Siren
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DOMAIN as DECONZ_DOMAIN, NEW_LIGHT, POWER_PLUGS
from .d... | 29.893333 | 78 | 0.678858 |
from pydeconz.light import Siren
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DOMAIN as DECONZ_DOMAIN, NEW_LIGHT, POWER_PLUGS
from .deconz_device import DeconzDevice
fr... | true | true |
f755a014a997300abc03b15f3ad734baaba690d1 | 1,505 | py | Python | mashpack/__init__.py | ColmMathews/mashpack | 0d5c05b5387feadfddc794734a4267849fa9a09b | [
"Apache-2.0"
] | 6 | 2018-01-17T03:06:38.000Z | 2018-01-23T03:02:59.000Z | mashpack/__init__.py | ColmMathews/mashpack | 0d5c05b5387feadfddc794734a4267849fa9a09b | [
"Apache-2.0"
] | 16 | 2018-01-17T18:22:41.000Z | 2018-02-26T22:07:48.000Z | mashpack/__init__.py | ColmMathews/mashpack | 0d5c05b5387feadfddc794734a4267849fa9a09b | [
"Apache-2.0"
] | 2 | 2019-09-01T21:59:13.000Z | 2022-02-08T00:35:33.000Z | # Copyright 2018 Seth Michael Larson
#
# 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 wr... | 28.396226 | 74 | 0.677741 |
from collections import namedtuple
__all__ = [
'Packer', 'Unpacker', 'ExtType',
'pack', 'packb', 'unpack', 'unpackb',
'dump', 'dumps', 'load', 'loads'
]
class ExtType(namedtuple('ExtType', ['code', 'data'])):
def __new__(cls, code, data):
if not isinstance(code, int):
... | true | true |
f755a04ab06548aee0eadec551318f2422559a5e | 745 | py | Python | src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.5625 | 99 | 0.656376 |
from ._data_collection_rule_associations_operations import DataCollectionRuleAssociationsOperations
from ._data_collection_rules_operations import DataCollectionRulesOperations
__all__ = [
'DataCollectionRuleAssociationsOperations',
'DataCollectionRulesOperations',
]
| true | true |
f755a0bee317b31e30c2b6f061e666fcd7bb20e8 | 462 | py | Python | JumpscaleLib/sal_zos/farm/FarmFactory.py | threefoldtech/jumpscale_lib9 | 03c1451133d777e5af106fcc6f75c1138bb997f2 | [
"Apache-2.0"
] | null | null | null | JumpscaleLib/sal_zos/farm/FarmFactory.py | threefoldtech/jumpscale_lib9 | 03c1451133d777e5af106fcc6f75c1138bb997f2 | [
"Apache-2.0"
] | 220 | 2018-07-29T08:37:17.000Z | 2019-08-05T15:01:27.000Z | JumpscaleLib/sal_zos/farm/FarmFactory.py | threefoldtech/jumpscale_lib9 | 03c1451133d777e5af106fcc6f75c1138bb997f2 | [
"Apache-2.0"
] | 1 | 2018-08-20T09:16:08.000Z | 2018-08-20T09:16:08.000Z | from .Farm import Farm
from jumpscale import j
JSBASE = j.application.jsbase_get_class()
class FarmFactory(JSBASE):
def __init__(self):
self.__jslocation__ = "j.sal_zos.farm"
JSBASE.__init__(self)
def get(self, farmer_iyo_org):
"""
Get sal for farm
Arguments:
... | 19.25 | 55 | 0.612554 | from .Farm import Farm
from jumpscale import j
JSBASE = j.application.jsbase_get_class()
class FarmFactory(JSBASE):
def __init__(self):
self.__jslocation__ = "j.sal_zos.farm"
JSBASE.__init__(self)
def get(self, farmer_iyo_org):
return Farm(farmer_iyo_org)
| true | true |
f755a10b1ba125e0e071638072427d59badb2eae | 2,909 | py | Python | revasbot/revas_console.py | iwo-strzebonski/SeleBot | 885b5b9ca264d9ee59200c4f7157250c85872fbe | [
"WTFPL"
] | null | null | null | revasbot/revas_console.py | iwo-strzebonski/SeleBot | 885b5b9ca264d9ee59200c4f7157250c85872fbe | [
"WTFPL"
] | null | null | null | revasbot/revas_console.py | iwo-strzebonski/SeleBot | 885b5b9ca264d9ee59200c4f7157250c85872fbe | [
"WTFPL"
] | null | null | null | from getpass import getpass
from typing import Any
class CLIColors: # pylint: disable=too-few-public-methods
'''
ANSI color codes used for printing colorful messages
'''
ENDC = '\033[0m'
class Foreground:
class Normal:
BLACK = '\033[30m'
RED = '\033[3... | 31.967033 | 139 | 0.499484 | from getpass import getpass
from typing import Any
class CLIColors:
ENDC = '\033[0m'
class Foreground:
class Normal:
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m... | true | true |
f755a2dfdfb2c7a38c3d4c8568e7b11d706482e7 | 370 | py | Python | api/models/post/migrations/0005_alter_post_options.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | null | null | null | api/models/post/migrations/0005_alter_post_options.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | 6 | 2021-08-06T16:30:03.000Z | 2021-12-11T05:30:02.000Z | api/models/post/migrations/0005_alter_post_options.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-23 15:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('post', '0004_alter_post_title'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'verbose_name': '게시글',... | 20.555556 | 75 | 0.597297 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('post', '0004_alter_post_title'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'verbose_name': '게시글', 'verbose_name_plural': '글 목록'},
),
... | true | true |
f755a40cabc8e1034852dbbc6ab510600cb80750 | 34,645 | py | Python | pygments/formatters/html.py | Liam-Stevens/pygments | 49f1a5c6d5734734edca3766f88a698c4172ff59 | [
"BSD-2-Clause"
] | null | null | null | pygments/formatters/html.py | Liam-Stevens/pygments | 49f1a5c6d5734734edca3766f88a698c4172ff59 | [
"BSD-2-Clause"
] | null | null | null | pygments/formatters/html.py | Liam-Stevens/pygments | 49f1a5c6d5734734edca3766f88a698c4172ff59 | [
"BSD-2-Clause"
] | null | null | null | """
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import functools
import os
import sys
import os.path
from io import StringIO
from pygments.formatter imp... | 35.790289 | 100 | 0.559879 |
import functools
import os
import sys
import os.path
from io import StringIO
from pygments.formatter import Formatter
from pygments.token import Token, Text, STANDARD_TYPES
from pygments.util import get_bool_opt, get_int_opt, get_list_opt
try:
import ctags
except ImportError:
ctags = None
__all__ = ['HtmlFo... | true | true |
f755a43c31bdcc6ab14746bb71b53d4747dc583e | 1,289 | py | Python | src/cone/fileupload/__init__.py | conestack/cone.fileupload | 066f601585a43bc72ed98da92c310b9cd173ba53 | [
"BSD-2-Clause"
] | 1 | 2019-07-09T12:52:47.000Z | 2019-07-09T12:52:47.000Z | src/cone/fileupload/__init__.py | conestack/cone.fileupload | 066f601585a43bc72ed98da92c310b9cd173ba53 | [
"BSD-2-Clause"
] | 1 | 2017-01-16T18:14:47.000Z | 2017-01-16T18:14:47.000Z | src/cone/fileupload/__init__.py | conestack/cone.fileupload | 066f601585a43bc72ed98da92c310b9cd173ba53 | [
"BSD-2-Clause"
] | null | null | null | from cone.app import cfg
from cone.app import main_hook
from cone.fileupload.browser import static_resources
import logging
logger = logging.getLogger('cone.fileupload')
@main_hook
def initialize_fileupload(config, global_config, settings):
# application startup initialization
# protected CSS
cfg.css.p... | 36.828571 | 89 | 0.774244 | from cone.app import cfg
from cone.app import main_hook
from cone.fileupload.browser import static_resources
import logging
logger = logging.getLogger('cone.fileupload')
@main_hook
def initialize_fileupload(config, global_config, settings):
cfg.css.protected.append('fileupload-static/fileupload/jquer... | true | true |
f755a4baac7e507681df315e9ff4840cfaa99d58 | 1,125 | py | Python | bedtools_2_21.py | meissnert/StarCluster-Plugins | a84dc5f62b5a37e7843c0fb4ac69011ecd766e51 | [
"MIT"
] | 1 | 2016-05-27T19:58:53.000Z | 2016-05-27T19:58:53.000Z | bedtools_2_21.py | meissnert/StarCluster-Plugins | a84dc5f62b5a37e7843c0fb4ac69011ecd766e51 | [
"MIT"
] | null | null | null | bedtools_2_21.py | meissnert/StarCluster-Plugins | a84dc5f62b5a37e7843c0fb4ac69011ecd766e51 | [
"MIT"
] | null | null | null | from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class BedtoolsInstaller(ClusterSetup):
def run(self, nodes, master, user, user_shell, volumes):
for node in nodes:
log.info("Installing Bedtools 2.21 on %s" % (node.alias))
node.ssh.execute('wget -c -P /opt/software/bedtools ... | 70.3125 | 140 | 0.750222 | from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class BedtoolsInstaller(ClusterSetup):
def run(self, nodes, master, user, user_shell, volumes):
for node in nodes:
log.info("Installing Bedtools 2.21 on %s" % (node.alias))
node.ssh.execute('wget -c -P /opt/software/bedtools ... | true | true |
f755a8a962a781446b6c5e9d190538b32eed220f | 17,582 | py | Python | polyjit/buildbot/builders/vara_phasar_master_dev.py | PolyJIT/buildbot | a6ac17c0bf7888bb8984e5c41ba18b02c2afa100 | [
"MIT"
] | null | null | null | polyjit/buildbot/builders/vara_phasar_master_dev.py | PolyJIT/buildbot | a6ac17c0bf7888bb8984e5c41ba18b02c2afa100 | [
"MIT"
] | null | null | null | polyjit/buildbot/builders/vara_phasar_master_dev.py | PolyJIT/buildbot | a6ac17c0bf7888bb8984e5c41ba18b02c2afa100 | [
"MIT"
] | 1 | 2019-11-09T12:34:43.000Z | 2019-11-09T12:34:43.000Z | import sys
import re
from collections import OrderedDict
from twisted.internet import defer
from polyjit.buildbot.builders import register
from polyjit.buildbot import slaves
from polyjit.buildbot.utils import (builder, define, git, ucmd, ucompile, cmd,
upload_file, ip, s_sbranch, ... | 42.882927 | 107 | 0.572176 | import sys
import re
from collections import OrderedDict
from twisted.internet import defer
from polyjit.buildbot.builders import register
from polyjit.buildbot import slaves
from polyjit.buildbot.utils import (builder, define, git, ucmd, ucompile, cmd,
upload_file, ip, s_sbranch, ... | true | true |
f755aa4c2f6daf1984e029cbc00311ff91d77916 | 1,875 | py | Python | ib/ext/ExecutionFilter.py | LewisW/IbPy | eb6ec62a3c578c650e6b98e56a9b6ed2c0a28f0f | [
"BSD-3-Clause"
] | 1,260 | 2015-01-05T01:38:43.000Z | 2022-03-28T14:08:02.000Z | ib/ext/ExecutionFilter.py | LewisW/IbPy | eb6ec62a3c578c650e6b98e56a9b6ed2c0a28f0f | [
"BSD-3-Clause"
] | 46 | 2015-01-04T15:37:17.000Z | 2019-10-24T09:53:40.000Z | ib/ext/ExecutionFilter.py | LewisW/IbPy | eb6ec62a3c578c650e6b98e56a9b6ed2c0a28f0f | [
"BSD-3-Clause"
] | 521 | 2015-01-01T14:26:01.000Z | 2022-03-26T16:22:36.000Z | #!/usr/bin/env python
""" generated source for module ExecutionFilter """
#
# Original file copyright original author(s).
# This file copyright Troy Melhase, troy@gci.net.
#
# WARNING: all changes to this file will be lost.
from ib.lib.overloading import overloaded
#
# * ExecutionFilter.java
# *
#
# package: com.... | 35.377358 | 410 | 0.653867 |
from ib.lib.overloading import overloaded
class ExecutionFilter(object):
m_clientId = 0
m_acctCode = ""
m_time = ""
m_symbol = ""
m_secType = ""
m_exchange = ""
m_side = ""
@overloaded
def __init__(self):
self.m_clientId = 0
@__init__.register(object, int,... | true | true |
f755add7c18e3c5b90627770995bbb3d44f4da2f | 33,761 | py | Python | sunpy/coordinates/frames.py | AthKouloumvakos/sunpy | a319336bb2deb7d495e52614970a4dd26a4b31fd | [
"BSD-2-Clause"
] | 1 | 2020-05-01T07:38:28.000Z | 2020-05-01T07:38:28.000Z | sunpy/coordinates/frames.py | Kate028/sunpy | 686a9c455e5b725feb005b91b74ce000368f0654 | [
"BSD-2-Clause"
] | null | null | null | sunpy/coordinates/frames.py | Kate028/sunpy | 686a9c455e5b725feb005b91b74ce000368f0654 | [
"BSD-2-Clause"
] | null | null | null | """
Common solar physics coordinate systems.
This submodule implements various solar physics coordinate frames for use with
the `astropy.coordinates` module.
"""
from contextlib import contextmanager
import numpy as np
import astropy.units as u
from astropy.coordinates import ConvertError, QuantityAttribute
from ast... | 45.622973 | 189 | 0.629573 | from contextlib import contextmanager
import numpy as np
import astropy.units as u
from astropy.coordinates import ConvertError, QuantityAttribute
from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMapping
from astropy.coordinates.representation import (
CartesianDifferential,
Cartes... | true | true |
f755ae3f077baa55594f7a199407bdca30b8fba6 | 1,245 | py | Python | sample_scraper/pipelines.py | stephanschielke/beatport-tracks-scraper | 450c597686bf2ca165fab241991f6c6ccde6b10c | [
"MIT"
] | null | null | null | sample_scraper/pipelines.py | stephanschielke/beatport-tracks-scraper | 450c597686bf2ca165fab241991f6c6ccde6b10c | [
"MIT"
] | null | null | null | sample_scraper/pipelines.py | stephanschielke/beatport-tracks-scraper | 450c597686bf2ca165fab241991f6c6ccde6b10c | [
"MIT"
] | null | null | null | import json
import os
import urllib.request
class SampleScraperPipeline(object):
def open_spider(self, spider):
"""
Write the results to a file.
:param spider: The spider used.
:return: None
"""
self.file = open('sample_urls.txt', 'w')
if spider.auto_downloa... | 28.953488 | 94 | 0.579116 | import json
import os
import urllib.request
class SampleScraperPipeline(object):
def open_spider(self, spider):
self.file = open('sample_urls.txt', 'w')
if spider.auto_download:
self.download_folder = './downloads/'
if not os.path.exists(self.download_folder):
... | true | true |
f755b00c021bb08efe65e181ffd0f63dd0b3920b | 20,099 | py | Python | tools/c7n_azure/c7n_azure/resources/sqldatabase.py | ncerny/cloud-custodian | c43831604534a2bbc9e2a01187354b77a9b44bdc | [
"Apache-2.0"
] | null | null | null | tools/c7n_azure/c7n_azure/resources/sqldatabase.py | ncerny/cloud-custodian | c43831604534a2bbc9e2a01187354b77a9b44bdc | [
"Apache-2.0"
] | 1 | 2021-04-30T21:13:50.000Z | 2021-04-30T21:13:50.000Z | tools/c7n_azure/c7n_azure/resources/sqldatabase.py | ncerny/cloud-custodian | c43831604534a2bbc9e2a01187354b77a9b44bdc | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 37.014733 | 138 | 0.672173 |
import abc
import enum
import logging
import six
from azure.mgmt.sql.models import BackupLongTermRetentionPolicy, DatabaseUpdate, Sku
from msrestazure.azure_exceptions import CloudError
from c7n.filters import Filter
from c7n.filters.core import PolicyValidationError
from c7n.utils import get_annotation... | true | true |
f755b014b268cf06a06cb7ca62cf4b6e0e015a83 | 4,210 | py | Python | maro/simulator/scenarios/cim/vessel.py | VinayaSathyanarayana/maro | 0ba55f36d89c235ef3af04efbac78b3885d8695d | [
"MIT"
] | 1 | 2020-09-30T09:31:05.000Z | 2020-09-30T09:31:05.000Z | maro/simulator/scenarios/cim/vessel.py | VinayaSathyanarayana/maro | 0ba55f36d89c235ef3af04efbac78b3885d8695d | [
"MIT"
] | null | null | null | maro/simulator/scenarios/cim/vessel.py | VinayaSathyanarayana/maro | 0ba55f36d89c235ef3af04efbac78b3885d8695d | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from math import floor
from maro.backends.frame import node, NodeBase, NodeAttribute
def gen_vessel_definition(stop_nums: tuple):
@node("vessels")
class Vessel(NodeBase):
# The capacity of vessel for transferring containers.
... | 35.677966 | 113 | 0.594537 |
from math import floor
from maro.backends.frame import node, NodeBase, NodeAttribute
def gen_vessel_definition(stop_nums: tuple):
@node("vessels")
class Vessel(NodeBase):
capacity = NodeAttribute("i")
empty = NodeAttribute("i")
full = NodeAttribute("i")... | true | true |
f755b0462494c8c56ef315c454c2130ad1187c1d | 43,828 | py | Python | src/instabot.py | cyberjinmics/master | 92b86c58331d800963a63d34dbb7ac967d553de1 | [
"MIT"
] | null | null | null | src/instabot.py | cyberjinmics/master | 92b86c58331d800963a63d34dbb7ac967d553de1 | [
"MIT"
] | null | null | null | src/instabot.py | cyberjinmics/master | 92b86c58331d800963a63d34dbb7ac967d553de1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from .userinfo import UserInfo
import datetime
import json
import logging
import time
import requests
from requests_toolbelt import MultipartEncoder
import uuid
import re
from .commentGen import commentGen
from .filesCoun... | 43.696909 | 232 | 0.526444 |
from __future__ import print_function
from .userinfo import UserInfo
import datetime
import json
import logging
import time
import requests
from requests_toolbelt import MultipartEncoder
import uuid
import re
from .commentGen import commentGen
from .filesCount import filesCount
from random import *
imp... | true | true |
f755b0addfd6d624b5043cd83913f414f47dcc07 | 8,977 | py | Python | crabageprediction/venv/Lib/site-packages/pandas/tests/frame/methods/test_values.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 3 | 2021-11-23T05:35:28.000Z | 2022-02-10T08:05:53.000Z | crabageprediction/venv/Lib/site-packages/pandas/tests/frame/methods/test_values.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 5 | 2022-02-13T14:38:04.000Z | 2022-02-15T00:13:07.000Z | crabageprediction/venv/Lib/site-packages/pandas/tests/frame/methods/test_values.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 5 | 2018-04-24T13:31:56.000Z | 2021-10-21T05:06:23.000Z | import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
NaT,
Series,
Timestamp,
date_range,
period_range,
)
import pandas._testing as tm
class TestDataFrameValues:
@td.skip_array_manager_invalid_test
def test_values(self, float_frame... | 32.762774 | 86 | 0.542275 | import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
NaT,
Series,
Timestamp,
date_range,
period_range,
)
import pandas._testing as tm
class TestDataFrameValues:
@td.skip_array_manager_invalid_test
def test_values(self, float_frame... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.