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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f756757a9a60c693d15ccd64b86f9ffd075acaae | 28,709 | py | Python | tools/callstats.py | LancerWang001/v8 | 42ff4531f590b901ade0a18bfd03e56485fe2452 | [
"BSD-3-Clause"
] | 20,995 | 2015-01-01T05:12:40.000Z | 2022-03-31T21:39:18.000Z | tools/callstats.py | Andrea-MariaDB-2/v8 | a0f0ebd7a876e8cb2210115adbfcffe900e99540 | [
"BSD-3-Clause"
] | 333 | 2020-07-15T17:06:05.000Z | 2021-03-15T12:13:09.000Z | tools/callstats.py | Andrea-MariaDB-2/v8 | a0f0ebd7a876e8cb2210115adbfcffe900e99540 | [
"BSD-3-Clause"
] | 4,523 | 2015-01-01T15:12:34.000Z | 2022-03-28T06:23:41.000Z | #!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''
Usage: callstats.py [-h] <command> ...
Optional arguments:
-h, --help show this help message and exit
Commands:
run ... | 36.901028 | 80 | 0.619004 |
from __future__ import print_function
import argparse
import json
import os
import re
import shutil
import subprocess
import sys
import tempfile
import operator
from callstats_groups import RUNTIME_CALL_STATS_GROUPS
import numpy
from math import sqrt
MAX_NOF_RETRIES = 5
def print_command(cmd_args):
def ... | true | true |
f756759341b46a297c81e1c388795ca0b1efee8e | 5,406 | py | Python | databuilder/databuilder/publisher/elasticsearch_publisher.py | jdavidheiser/amundsen | fc18c0ed0cca80f90d3d11436f2c73eb5e385235 | [
"Apache-2.0"
] | 139 | 2019-02-11T18:58:21.000Z | 2020-08-04T17:04:37.000Z | databuilder/databuilder/publisher/elasticsearch_publisher.py | jdavidheiser/amundsen | fc18c0ed0cca80f90d3d11436f2c73eb5e385235 | [
"Apache-2.0"
] | 260 | 2019-02-13T01:46:52.000Z | 2020-08-10T22:03:37.000Z | databuilder/databuilder/publisher/elasticsearch_publisher.py | jdavidheiser/amundsen | fc18c0ed0cca80f90d3d11436f2c73eb5e385235 | [
"Apache-2.0"
] | 139 | 2019-02-11T19:59:05.000Z | 2020-08-06T16:48:46.000Z | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import json
import logging
from typing import List
from elasticsearch.exceptions import NotFoundError
from pyhocon import ConfigTree
from databuilder.publisher.base_publisher import Publisher
from databuilder.publisher.elasticsea... | 42.566929 | 117 | 0.689789 |
import json
import logging
from typing import List
from elasticsearch.exceptions import NotFoundError
from pyhocon import ConfigTree
from databuilder.publisher.base_publisher import Publisher
from databuilder.publisher.elasticsearch_constants import TABLE_ELASTICSEARCH_INDEX_MAPPING
LOGGER = logging.getLogger(__n... | true | true |
f756767bcfd8661f49498dda90a5436d0749e2f5 | 1,025 | py | Python | setup.py | justheuristic/rpcudp | ec56638ce963a4ea49bc34ac407ec7c09bae816f | [
"MIT"
] | 87 | 2015-01-25T10:05:51.000Z | 2021-07-22T15:56:18.000Z | setup.py | justheuristic/rpcudp | ec56638ce963a4ea49bc34ac407ec7c09bae816f | [
"MIT"
] | 14 | 2015-05-18T13:45:27.000Z | 2021-02-05T13:46:10.000Z | setup.py | justheuristic/rpcudp | ec56638ce963a4ea49bc34ac407ec7c09bae816f | [
"MIT"
] | 34 | 2015-04-15T23:49:16.000Z | 2022-01-03T19:12:59.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
import rpcudp
setup(
name="rpcudp",
version=rpcudp.__version__,
description="Asynchronous RPC via UDP",
long_description=open("README.md", encoding='utf-8').read(),
long_description_content_type='text/markdown',
author="Brian Mul... | 34.166667 | 69 | 0.658537 |
from setuptools import setup, find_packages
import rpcudp
setup(
name="rpcudp",
version=rpcudp.__version__,
description="Asynchronous RPC via UDP",
long_description=open("README.md", encoding='utf-8').read(),
long_description_content_type='text/markdown',
author="Brian Muller",
author_emai... | true | true |
f7567698ec9b49382e136e75e4da99e592e3c367 | 159 | py | Python | backend/apps/flagged/apps.py | MAX-EINSTEIN/thecodejournalists | 4cfbca4b6bb13107dbeca1dc87e80b08d4a763c4 | [
"MIT"
] | 2 | 2021-06-24T13:15:41.000Z | 2021-06-25T12:32:00.000Z | backend/apps/flagged/apps.py | MAX-EINSTEIN/thecodejournalists | 4cfbca4b6bb13107dbeca1dc87e80b08d4a763c4 | [
"MIT"
] | null | null | null | backend/apps/flagged/apps.py | MAX-EINSTEIN/thecodejournalists | 4cfbca4b6bb13107dbeca1dc87e80b08d4a763c4 | [
"MIT"
] | 3 | 2021-07-02T17:38:25.000Z | 2021-07-02T17:41:10.000Z | from django.apps import AppConfig
class FlaggedConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'backend.apps.flagged'
| 22.714286 | 56 | 0.767296 | from django.apps import AppConfig
class FlaggedConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'backend.apps.flagged'
| true | true |
f75677a39d08cf436eea6a4c42d92451273934fb | 4,974 | py | Python | tern/extensions/scancode/executor.py | aditi137/tern | 2c216e52bb6fc45842fb664881ae3a049be1fd1a | [
"BSD-2-Clause"
] | null | null | null | tern/extensions/scancode/executor.py | aditi137/tern | 2c216e52bb6fc45842fb664881ae3a049be1fd1a | [
"BSD-2-Clause"
] | null | null | null | tern/extensions/scancode/executor.py | aditi137/tern | 2c216e52bb6fc45842fb664881ae3a049be1fd1a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""
Execute scancode
https://github.com/nexB/scancode-toolkit
This plugin does not support installation of scancode
The expected environment is as follows:
1. Create a python3 virtual envir... | 39.792 | 78 | 0.589666 |
import json
import logging
from tern.analyze.passthrough import get_filesystem_command
from tern.analyze.passthrough import get_file_command
from tern.classes.notice import Notice
from tern.classes.file_data import FileData
from tern.extensions.executor import Executor
from tern.utils import constants
from tern.... | true | true |
f7567869f0313d1476d6a28422d8cc49fbb97cb0 | 223 | py | Python | n_utils/tests/account_utils_test.py | MarkusNousiainenWebscale/nameless-deploy-tools | f39060d4c6835f1d2236d5ce236d7da09318e01e | [
"Apache-2.0"
] | null | null | null | n_utils/tests/account_utils_test.py | MarkusNousiainenWebscale/nameless-deploy-tools | f39060d4c6835f1d2236d5ce236d7da09318e01e | [
"Apache-2.0"
] | null | null | null | n_utils/tests/account_utils_test.py | MarkusNousiainenWebscale/nameless-deploy-tools | f39060d4c6835f1d2236d5ce236d7da09318e01e | [
"Apache-2.0"
] | null | null | null | from n_utils.account_utils import find_role_arn
def test_find_role_arn(mocker):
cloudformation = mocker.patch('n_utils.account_utils.cloudformation')
find_role_arn('foo')
cloudformation.assert_called_with()
| 22.3 | 73 | 0.793722 | from n_utils.account_utils import find_role_arn
def test_find_role_arn(mocker):
cloudformation = mocker.patch('n_utils.account_utils.cloudformation')
find_role_arn('foo')
cloudformation.assert_called_with()
| true | true |
f756786b919ed5b2ed79a9a66eaf1d91f01be6b3 | 1,468 | py | Python | disentanglement_lib/evaluation/metrics/beta_vae_test.py | jboilard1994/disentanglement_lib | 9cb6bdbafeb0247864f94d5c5c0853a310c86b9e | [
"Apache-2.0"
] | 1,280 | 2019-02-09T20:27:37.000Z | 2022-03-29T18:02:23.000Z | disentanglement_lib/evaluation/metrics/beta_vae_test.py | Jimmy-INL/disentanglement_lib | a64b8b9994a28fafd47ccd866b0318fa30a3c76c | [
"Apache-2.0"
] | 34 | 2019-02-14T23:18:01.000Z | 2021-11-23T00:55:54.000Z | disentanglement_lib/evaluation/metrics/beta_vae_test.py | Jimmy-INL/disentanglement_lib | a64b8b9994a28fafd47ccd866b0318fa30a3c76c | [
"Apache-2.0"
] | 199 | 2019-02-13T17:52:00.000Z | 2022-03-11T17:37:26.000Z | # coding=utf-8
# Copyright 2018 The DisentanglementLib Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 34.139535 | 74 | 0.769755 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from disentanglement_lib.data.ground_truth import dummy_data
from disentanglement_lib.evaluation.metrics import beta_vae
import numpy as np
class BetaVaeTest(... | true | true |
f75678cc388420796ee6a8f6c36db1f9894950b4 | 3,256 | py | Python | tools/MNNPythonOfflineQuant/mnn_offline_quant.py | JujuDel/MNN | 8a82f5c5a7ae37192784c2dbd6dfc8ca8833565a | [
"Apache-2.0"
] | 1 | 2021-06-01T03:02:29.000Z | 2021-06-01T03:02:29.000Z | tools/MNNPythonOfflineQuant/mnn_offline_quant.py | JujuDel/MNN | 8a82f5c5a7ae37192784c2dbd6dfc8ca8833565a | [
"Apache-2.0"
] | null | null | null | tools/MNNPythonOfflineQuant/mnn_offline_quant.py | JujuDel/MNN | 8a82f5c5a7ae37192784c2dbd6dfc8ca8833565a | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import time
import argparse
import numpy as np
import tqdm
import MNN
import yaml
from calibration_dataset import calibration_dataset
nn = MNN.nn
F = MNN.expr
def get_mnn_format(format_str):
fmt = str.lower(format_str)
if fmt == 'nchw':
return F.NCHW
elif fmt... | 27.133333 | 109 | 0.646192 | from __future__ import print_function
import time
import argparse
import numpy as np
import tqdm
import MNN
import yaml
from calibration_dataset import calibration_dataset
nn = MNN.nn
F = MNN.expr
def get_mnn_format(format_str):
fmt = str.lower(format_str)
if fmt == 'nchw':
return F.NCHW
elif fmt... | true | true |
f7567916333629bfeba9857fe4ea096d006303f1 | 18,747 | py | Python | networkx/algorithms/coloring/tests/test_coloring.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 1 | 2020-08-08T21:52:34.000Z | 2020-08-08T21:52:34.000Z | networkx/algorithms/coloring/tests/test_coloring.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 2 | 2019-11-13T03:48:53.000Z | 2021-02-15T16:52:09.000Z | networkx/algorithms/coloring/tests/test_coloring.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Greedy coloring test suite.
"""
__author__ = "\n".join(["Christian Olsson <chro@itu.dk>",
"Jan Aagaard Meier <jmei@itu.dk>",
"Henrik Haugbølle <hhau@itu.dk>",
"Jake VanderPlas <jakevdp@uw.edu>"])
import networkx as nx
... | 26.110028 | 79 | 0.451912 |
__author__ = "\n".join(["Christian Olsson <chro@itu.dk>",
"Jan Aagaard Meier <jmei@itu.dk>",
"Henrik Haugbølle <hhau@itu.dk>",
"Jake VanderPlas <jakevdp@uw.edu>"])
import networkx as nx
import pytest
is_coloring = nx.algorithms.coloring.equita... | true | true |
f7567a70ee46c2ec7e99a1f1951a4331dec058e2 | 1,265 | py | Python | core/migrations/0002_tasktemplate.py | Suleymanov2006/ansible-manager | 57397c12e49611a5cc6197ecd184222caabf1361 | [
"MIT"
] | 13 | 2017-03-18T06:03:43.000Z | 2020-02-15T03:42:28.000Z | core/migrations/0002_tasktemplate.py | Suleymanov2006/ansible-manager | 57397c12e49611a5cc6197ecd184222caabf1361 | [
"MIT"
] | 78 | 2017-03-17T18:16:32.000Z | 2018-10-26T11:58:20.000Z | core/migrations/0002_tasktemplate.py | Suleymanov2006/ansible-manager | 57397c12e49611a5cc6197ecd184222caabf1361 | [
"MIT"
] | 6 | 2017-03-19T13:41:29.000Z | 2019-09-11T21:36:52.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-19 20:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 40.806452 | 135 | 0.611858 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='TaskTemplate',
fields=[
('id', mode... | true | true |
f7567aef6e517998f8039c53f7625461f13d15e4 | 644 | py | Python | 3-python-poo (programacao orientada a objeto)/aula07-associacao/classes.py | Leodf/projetos-python | 64e6262e6535d92624ad50148634d881608a7523 | [
"MIT"
] | null | null | null | 3-python-poo (programacao orientada a objeto)/aula07-associacao/classes.py | Leodf/projetos-python | 64e6262e6535d92624ad50148634d881608a7523 | [
"MIT"
] | null | null | null | 3-python-poo (programacao orientada a objeto)/aula07-associacao/classes.py | Leodf/projetos-python | 64e6262e6535d92624ad50148634d881608a7523 | [
"MIT"
] | null | null | null |
class Escritor:
def __init__(self, nome):
self.__nome = nome
self.__ferramenta = None
@property
def nome(self):
return self.__nome
@property
def ferramenta(self):
return self.__ferramenta
@ferramenta.setter
def ferramenta(self, ferramenta):
self.__... | 20.125 | 43 | 0.627329 |
class Escritor:
def __init__(self, nome):
self.__nome = nome
self.__ferramenta = None
@property
def nome(self):
return self.__nome
@property
def ferramenta(self):
return self.__ferramenta
@ferramenta.setter
def ferramenta(self, ferramenta):
self.__... | true | true |
f7567b06514bcbd666c58a2cc65a85506320aef2 | 18,534 | py | Python | toontown/racing/DistributedRaceAI.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | null | null | null | toontown/racing/DistributedRaceAI.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | toontown/racing/DistributedRaceAI.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from otp.otpbase.PythonUtil import nonRepeatingRandomList
import DistributedGagAI, DistributedProjectileAI
from direct.task import Task
import random, time, Racer, RaceGlob... | 38.774059 | 254 | 0.598144 | from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from otp.otpbase.PythonUtil import nonRepeatingRandomList
import DistributedGagAI, DistributedProjectileAI
from direct.task import Task
import random, time, Racer, RaceGlob... | true | true |
f7567b920506252bfeaa282eb22088cde38ed2cc | 12,921 | py | Python | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_toeplitz.py | wataruhashimoto52/probability | 12e3f256544eadea6e863868da825614f4423eb0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_toeplitz.py | wataruhashimoto52/probability | 12e3f256544eadea6e863868da825614f4423eb0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_toeplitz.py | wataruhashimoto52/probability | 12e3f256544eadea6e863868da825614f4423eb0 | [
"Apache-2.0"
] | 1 | 2020-06-04T23:26:31.000Z | 2020-06-04T23:26:31.000Z | # Copyright 2020 The TensorFlow Probability Authors. All Rights Reserved.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# THIS FILE IS AUTO-GENERATED BY `gen_linear_operators.py`.
# DO NOT MODIFY DIRECTLY.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... | 41.546624 | 119 | 0.678043 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_probability.python.internal.backend.numpy import dtype as dtypes
from tensorflow_probability.python.internal.backend.numpy import ops
from tensorflow_probability... | true | true |
f7567bfbe1448ed205a5efce09ac351e293aa152 | 521 | py | Python | apps/goosepond/views/goosename/name_component.py | lymmers/lymmers.com | 661ab442c9b7ad459c6615afec8de7cbda58c176 | [
"MIT"
] | null | null | null | apps/goosepond/views/goosename/name_component.py | lymmers/lymmers.com | 661ab442c9b7ad459c6615afec8de7cbda58c176 | [
"MIT"
] | 5 | 2022-03-28T16:35:47.000Z | 2022-03-28T16:39:08.000Z | apps/goosepond/views/goosename/name_component.py | lymmers/lymmers.com | 661ab442c9b7ad459c6615afec8de7cbda58c176 | [
"MIT"
] | null | null | null | from django.views import View
from django.shortcuts import render
import logging
from apps.goosepond.utils.namegoosifier import goosify
log = logging.getLogger('goosepond')
class NameComponent(View):
def post(self, request):
"""Render the goosename component."""
gooseinput = request.POST.get("goos... | 27.421053 | 54 | 0.662188 | from django.views import View
from django.shortcuts import render
import logging
from apps.goosepond.utils.namegoosifier import goosify
log = logging.getLogger('goosepond')
class NameComponent(View):
def post(self, request):
gooseinput = request.POST.get("gooseinput")
log.critical(list(request.POS... | true | true |
f7567c0777e7db64ccae12ccabeb56e3a27edf66 | 8,211 | py | Python | networkx_mod/algorithms/flow/edmondskarp.py | movingpictures83/MATria | d3dbd0d15e00dbc26db39ace0663868180fdc471 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | networkx_mod/algorithms/flow/edmondskarp.py | movingpictures83/MATria | d3dbd0d15e00dbc26db39ace0663868180fdc471 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | networkx_mod/algorithms/flow/edmondskarp.py | movingpictures83/MATria | d3dbd0d15e00dbc26db39ace0663868180fdc471 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Edmonds-Karp algorithm for maximum flow problems.
"""
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
# Copyright (C) 2014 ysitu <ysitu@users.noreply.github.com>
# All rights reserved.
# BSD license.
import networkx_mod as nx
from networkx_mod.algorithms.flow.utils import *
__al... | 32.844 | 79 | 0.566435 |
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
import networkx_mod as nx
from networkx_mod.algorithms.flow.utils import *
__all__ = ['edmonds_karp']
def edmonds_karp_core(R, s, t, cutoff):
R_node = R.node
R_pred = R.pred
R_succ = R.succ
inf = R.graph['inf']
def augment(path):
... | true | true |
f7567c8e59cdf9cdf452a7850015ca4cc9df6441 | 1,744 | py | Python | src/functions/fixtures_offload.py | Gilbertly/kickoffai-sls-dataml | 5098e65c167cb59064c6273f15479cd5b0c53ad8 | [
"MIT"
] | 1 | 2022-03-04T06:55:13.000Z | 2022-03-04T06:55:13.000Z | src/functions/fixtures_offload.py | Gilbertly/kickoffai-sls-dataml | 5098e65c167cb59064c6273f15479cd5b0c53ad8 | [
"MIT"
] | null | null | null | src/functions/fixtures_offload.py | Gilbertly/kickoffai-sls-dataml | 5098e65c167cb59064c6273f15479cd5b0c53ad8 | [
"MIT"
] | null | null | null | import boto3
from datetime import datetime, timedelta
from os import environ
from src.functions.csv_dump import send_sql
rds_client = boto3.client("rds-data")
ddb_resource = boto3.resource("dynamodb")
shub_table = ddb_resource.Table(environ.get("TABLE_SHUB"))
shub_index = environ.get("SHUB_INDEX")
db_name = environ.ge... | 34.88 | 92 | 0.693234 | import boto3
from datetime import datetime, timedelta
from os import environ
from src.functions.csv_dump import send_sql
rds_client = boto3.client("rds-data")
ddb_resource = boto3.resource("dynamodb")
shub_table = ddb_resource.Table(environ.get("TABLE_SHUB"))
shub_index = environ.get("SHUB_INDEX")
db_name = environ.ge... | true | true |
f7567caa8a5fb7438cd782edea16b111741d59c3 | 555 | py | Python | test_box.py | HuiminHe/BugBot | ac121a37ac0b4858e5ed3849062c9bfaa47cb0fa | [
"MIT"
] | 9 | 2017-10-27T14:47:46.000Z | 2021-09-18T13:58:54.000Z | test_box.py | gaoqitong/BugBot | ac121a37ac0b4858e5ed3849062c9bfaa47cb0fa | [
"MIT"
] | null | null | null | test_box.py | gaoqitong/BugBot | ac121a37ac0b4858e5ed3849062c9bfaa47cb0fa | [
"MIT"
] | 4 | 2017-11-01T21:58:17.000Z | 2021-05-02T01:26:55.000Z | from simulator import Simulator, Map, Agent
from devices import Device
import numpy as np
import simulator_config
env = Simulator(simulator_config)
map = Map()
map.get_map_from_geom2d(env, kp=np.array([[-100, 100], [-100, -100], [100, -100], [100, 100]]))
robot = Agent(env, kp=np.array([[-2, 0], [2, 0]]), color=(1, 0... | 34.6875 | 102 | 0.652252 | from simulator import Simulator, Map, Agent
from devices import Device
import numpy as np
import simulator_config
env = Simulator(simulator_config)
map = Map()
map.get_map_from_geom2d(env, kp=np.array([[-100, 100], [-100, -100], [100, -100], [100, 100]]))
robot = Agent(env, kp=np.array([[-2, 0], [2, 0]]), color=(1, 0... | true | true |
f7567cbd4286bdb25fdfa3cf8a5fc37d27d21346 | 6,004 | py | Python | src/tfchain/polyfill/crypto.py | GlenDC/threefold-wallet-electron | 440662a793d98781eb3bbf415ba8a482abed0288 | [
"MIT"
] | null | null | null | src/tfchain/polyfill/crypto.py | GlenDC/threefold-wallet-electron | 440662a793d98781eb3bbf415ba8a482abed0288 | [
"MIT"
] | 201 | 2019-05-20T15:06:05.000Z | 2019-07-16T12:48:59.000Z | src/tfchain/polyfill/crypto.py | GlenDC/threefold-wallet-electron | 440662a793d98781eb3bbf415ba8a482abed0288 | [
"MIT"
] | 1 | 2019-12-20T21:45:39.000Z | 2019-12-20T21:45:39.000Z | import tfchain.polyfill.encoding.json as jsjson
import tfchain.polyfill.encoding.hex as jshex
from tfchain.polyfill.jsmods.sjcl import api as sjcl
from tfchain.polyfill.jsmods.blakejs import api as b2b
from tfchain.polyfill.jsmods.tweetnacljs import api as nacl
def random(n):
digest = ''
__pragma__("js", "{}", ""... | 27.290909 | 125 | 0.662059 | import tfchain.polyfill.encoding.json as jsjson
import tfchain.polyfill.encoding.hex as jshex
from tfchain.polyfill.jsmods.sjcl import api as sjcl
from tfchain.polyfill.jsmods.blakejs import api as b2b
from tfchain.polyfill.jsmods.tweetnacljs import api as nacl
def random(n):
digest = ''
__pragma__("js", "{}", ""... | true | true |
f7567cdfb04edb28b2d63eff7ab9196b6a9752d7 | 526 | py | Python | task/manage.py | BakanovKirill/3megawattTask | da7ece79753475cf80fb7796264ff53ea2ad4b9f | [
"MIT"
] | null | null | null | task/manage.py | BakanovKirill/3megawattTask | da7ece79753475cf80fb7796264ff53ea2ad4b9f | [
"MIT"
] | null | null | null | task/manage.py | BakanovKirill/3megawattTask | da7ece79753475cf80fb7796264ff53ea2ad4b9f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.dev')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you ... | 32.875 | 73 | 0.68251 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.dev')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed a... | true | true |
f7567eea8ade4e4fad5628a53df5e1610143ed9f | 3,543 | py | Python | bindings/python/ensmallen/datasets/string/candidatusaccumulibacterspsk02.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/candidatusaccumulibacterspsk02.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/candidatusaccumulibacterspsk02.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Candidatus Accumulibacter sp. SK-02.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: pro... | 33.742857 | 223 | 0.680779 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def CandidatusAccumulibacterSpSk02(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "g... | true | true |
f7567f16998b0e4b960d0bb1eb5df48a1f678e37 | 10,458 | py | Python | wooey/views/views.py | macdaliot/Wooey | 3a0f40e3b3ab4d905f9acc72f5cd5d6453e14834 | [
"BSD-3-Clause"
] | 1 | 2019-03-01T04:00:29.000Z | 2019-03-01T04:00:29.000Z | wooey/views/views.py | macdaliot/Wooey | 3a0f40e3b3ab4d905f9acc72f5cd5d6453e14834 | [
"BSD-3-Clause"
] | null | null | null | wooey/views/views.py | macdaliot/Wooey | 3a0f40e3b3ab4d905f9acc72f5cd5d6453e14834 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from collections import defaultdict
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.forms import FileField
from django.http import JsonResponse
fro... | 38.590406 | 175 | 0.632434 | from __future__ import absolute_import, unicode_literals
from collections import defaultdict
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.forms import FileField
from django.http import JsonResponse
fro... | true | true |
f75681c05a44876378873ffd2211cdb898d49da0 | 28,061 | py | Python | conda_build/source.py | grlee77/conda-build | ea99e2dc2fa473039dbeb73d92b3f5d5c59548fe | [
"BSD-3-Clause"
] | null | null | null | conda_build/source.py | grlee77/conda-build | ea99e2dc2fa473039dbeb73d92b3f5d5c59548fe | [
"BSD-3-Clause"
] | null | null | null | conda_build/source.py | grlee77/conda-build | ea99e2dc2fa473039dbeb73d92b3f5d5c59548fe | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import io
import locale
import os
from os.path import join, isdir, isfile, abspath, basename, exists, normpath, expanduser
import re
import shutil
from subprocess import CalledProcessError
import sys
import time
from .conda_interface import download, Te... | 41.75744 | 111 | 0.592602 | from __future__ import absolute_import, division, print_function
import io
import locale
import os
from os.path import join, isdir, isfile, abspath, basename, exists, normpath, expanduser
import re
import shutil
from subprocess import CalledProcessError
import sys
import time
from .conda_interface import download, Te... | true | true |
f75682165a70d4582f713e254d0be864a4b2d7a0 | 104 | py | Python | Lec3/Handouts/first/application.py | tim-ballard/CS50W | e8cd72ffb88171a2f7db6d21ed476845de7af719 | [
"MIT"
] | null | null | null | Lec3/Handouts/first/application.py | tim-ballard/CS50W | e8cd72ffb88171a2f7db6d21ed476845de7af719 | [
"MIT"
] | 4 | 2020-06-06T01:26:20.000Z | 2021-06-10T22:35:19.000Z | CS50_web_dev/src/src2/first/application.py | ChuaCheowHuan/web_app_DPTH | dd901e6359fe76f15b69701c53f76666c3219173 | [
"MIT"
] | 1 | 2020-05-09T15:21:34.000Z | 2020-05-09T15:21:34.000Z | from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello, world!"
| 13 | 26 | 0.653846 | from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello, world!"
| true | true |
f756824febb1da35d42d132d2f1776eb4148cb53 | 280 | py | Python | demos/assignment_4/problem_2.py | joeparis/CS161-Demos-Winter-19 | 613a93de9169fa4ee62538ff0ac93a9930b75fef | [
"MIT"
] | null | null | null | demos/assignment_4/problem_2.py | joeparis/CS161-Demos-Winter-19 | 613a93de9169fa4ee62538ff0ac93a9930b75fef | [
"MIT"
] | null | null | null | demos/assignment_4/problem_2.py | joeparis/CS161-Demos-Winter-19 | 613a93de9169fa4ee62538ff0ac93a9930b75fef | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# coding=utf-8
"""
Write a Python program that prints a table of n, n^2, and n^3 in right-aligned
columns for 1 >= n <= 10.</p>
"""
def main():
for n in range(1, 11):
print(f"{n:2} {n**2:3} {n**3:4}")
if __name__ == "__main__":
main()
| 16.470588 | 78 | 0.560714 |
def main():
for n in range(1, 11):
print(f"{n:2} {n**2:3} {n**3:4}")
if __name__ == "__main__":
main()
| true | true |
f756846850d5a094855f88c1643453f4dfb4d33f | 809 | py | Python | Lib/corpuscrawler/crawl_gub.py | cash/corpuscrawler | 8913fe1fb2b6bfdfbf2ba01d2ce88057b3b5ba3d | [
"Apache-2.0"
] | 95 | 2019-06-13T23:34:21.000Z | 2022-03-12T05:22:49.000Z | Lib/corpuscrawler/crawl_gub.py | sahwar/corpuscrawler | 8913fe1fb2b6bfdfbf2ba01d2ce88057b3b5ba3d | [
"Apache-2.0"
] | 31 | 2019-06-02T18:56:53.000Z | 2021-08-10T20:16:02.000Z | Lib/corpuscrawler/crawl_gub.py | sahwar/corpuscrawler | 8913fe1fb2b6bfdfbf2ba01d2ce88057b3b5ba3d | [
"Apache-2.0"
] | 35 | 2019-06-18T08:26:24.000Z | 2022-01-11T13:59:40.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.772727 | 74 | 0.770087 |
from __future__ import absolute_import, print_function, unicode_literals
from corpuscrawler.util import crawl_bibleis
def crawl(crawler):
out = crawler.get_output(language='gub')
crawl_bibleis(crawler, out, bible='GUBWBT')
| true | true |
f75684d0f07986c869ccf82924d4298a3e315ce9 | 2,241 | py | Python | test_cases/general/map/of/map/py/test_generate/parse.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 11 | 2019-06-26T05:56:41.000Z | 2021-03-28T16:44:16.000Z | test_cases/general/map/of/map/py/test_generate/parse.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 4 | 2019-10-18T14:43:59.000Z | 2020-04-02T19:12:07.000Z | test_cases/general/map/of/map/py/test_generate/parse.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 3 | 2019-06-17T07:39:03.000Z | 2020-04-01T14:01:23.000Z | # File automatically generated by mapry. DO NOT EDIT OR APPEND!
"""provides general structures and functions for parsing."""
import typing
import some.graph
class Error:
"""represents an error occurred while parsing."""
def __init__(self, ref: str, message: str) -> None:
"""
initializes ... | 27.666667 | 75 | 0.627845 |
import typing
import some.graph
class Error:
def __init__(self, ref: str, message: str) -> None:
self.ref = ref
self.message = message
class Errors:
def __init__(self, cap: int) -> None:
self.cap = cap
self._values = []
def add(self, ref: str, message: str) -> ... | true | true |
f7568515d7979fab7b013fa12cf1e59163605848 | 395 | py | Python | neurotech/wsgi.py | stevillis/full-stack-software-engineer-neurotech | d5673b7e05c97891b407b31ba71770074aea43ae | [
"MIT"
] | null | null | null | neurotech/wsgi.py | stevillis/full-stack-software-engineer-neurotech | d5673b7e05c97891b407b31ba71770074aea43ae | [
"MIT"
] | null | null | null | neurotech/wsgi.py | stevillis/full-stack-software-engineer-neurotech | d5673b7e05c97891b407b31ba71770074aea43ae | [
"MIT"
] | null | null | null | """
WSGI config for neurotech project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'neurotech.settings')
application = get_wsgi_application()
| true | true |
f75687f36b6fe3c4ce5e8a128806ab752dff9c0c | 3,917 | py | Python | functions_legacy/GraphicalLasso.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2021-04-10T13:24:30.000Z | 2022-03-26T08:20:42.000Z | functions_legacy/GraphicalLasso.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | null | null | null | functions_legacy/GraphicalLasso.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2019-08-13T22:02:17.000Z | 2022-02-09T17:49:12.000Z | import matplotlib.pyplot as plt
from numpy import array, ones, zeros, cov
plt.style.use('seaborn')
from fglasso import glasso
def GraphicalLasso(pop, lam, initStruct=None, approximate=0, warmInit=0, verbose=0, penalDiag=1, tolThreshold=1e-4, maxIter=1e4, w=None, theta=None):
# [w, theta, iter, avgTol, hasError] ... | 46.630952 | 149 | 0.683431 | import matplotlib.pyplot as plt
from numpy import array, ones, zeros, cov
plt.style.use('seaborn')
from fglasso import glasso
def GraphicalLasso(pop, lam, initStruct=None, approximate=0, warmInit=0, verbose=0, penalDiag=1, tolThreshold=1e-4, maxIter=1e4, w=None, theta=None):
... | true | true |
f756883310c42484a5770d226e8e2b8b824a7239 | 5,483 | py | Python | experimentor/models/action.py | aquilesC/experimentor | 1a70760912ef40f0e2aaee44ed1a1e5594fd5b45 | [
"MIT"
] | 4 | 2020-05-15T04:07:25.000Z | 2020-09-30T22:20:46.000Z | experimentor/models/action.py | aquilesC/experimentor | 1a70760912ef40f0e2aaee44ed1a1e5594fd5b45 | [
"MIT"
] | null | null | null | experimentor/models/action.py | aquilesC/experimentor | 1a70760912ef40f0e2aaee44ed1a1e5594fd5b45 | [
"MIT"
] | null | null | null | """
Action
======
An action is an event that gets triggered on a device. For example, a camera can have an action ``acquire`` or
``read``. They should normally be associated with the pressing of a button. Action is a handy decorator to register
methods on a model and have quick access to them when ... | 42.176923 | 120 | 0.672442 | from concurrent.futures.thread import ThreadPoolExecutor
import threading
class Action:
def __init__(self, method=None, **kwargs):
self.method = method
self.kwargs = kwargs
def __get__(self, instance, owner):
self.instance = instance
return self
def __set_name__(self, ow... | true | true |
f75689e247681d6beaf4f021c1cbf4a69de1f7b8 | 183 | py | Python | src/lamuda/messager/telegram.py | hanadumal/lamud | 092e036c4c1a0420b6f5c16148252288f42f3271 | [
"MIT"
] | null | null | null | src/lamuda/messager/telegram.py | hanadumal/lamud | 092e036c4c1a0420b6f5c16148252288f42f3271 | [
"MIT"
] | null | null | null | src/lamuda/messager/telegram.py | hanadumal/lamud | 092e036c4c1a0420b6f5c16148252288f42f3271 | [
"MIT"
] | null | null | null | import telegram
def send(buffer, sid, token):
"""
:param buffer:
:return:
"""
bot = telegram.Bot(token=token)
bot.send_message(chat_id=str(sid), text=buffer) | 18.3 | 51 | 0.622951 | import telegram
def send(buffer, sid, token):
bot = telegram.Bot(token=token)
bot.send_message(chat_id=str(sid), text=buffer) | true | true |
f7568a116218a7b511f44d7f4de6baed53693d71 | 4,075 | py | Python | src/problem2.py | walterae/08-Exam1-201930 | 97e7a3c5e0295f581d9620f892c8e9976654d87c | [
"MIT"
] | null | null | null | src/problem2.py | walterae/08-Exam1-201930 | 97e7a3c5e0295f581d9620f892c8e9976654d87c | [
"MIT"
] | null | null | null | src/problem2.py | walterae/08-Exam1-201930 | 97e7a3c5e0295f581d9620f892c8e9976654d87c | [
"MIT"
] | null | null | null | """
Exam 1, problem 2.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Audrey Walters.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
def main():
""" Calls the TEST functions in this module. """
test_fac... | 36.383929 | 79 | 0.485153 |
def main():
test_factor_sum()
def test_factor_sum():
| true | true |
f7568b835befaf300706ebeb114ac45a723104c3 | 851 | py | Python | setup.py | AYSung/comppyss | 093342790cc091763c92aa140f43841d8d50bb96 | [
"MIT"
] | null | null | null | setup.py | AYSung/comppyss | 093342790cc091763c92aa140f43841d8d50bb96 | [
"MIT"
] | null | null | null | setup.py | AYSung/comppyss | 093342790cc091763c92aa140f43841d8d50bb96 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="comppyss",
version="0.0.2",
author="Andrew Sung",
author_email="aysung300@gmail.com",
description="Python implementation of the CompPASS algorithm for scoring AE-MS exper... | 31.518519 | 96 | 0.663925 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="comppyss",
version="0.0.2",
author="Andrew Sung",
author_email="aysung300@gmail.com",
description="Python implementation of the CompPASS algorithm for scoring AE-MS exper... | true | true |
f7568be3d5eeaff16205ff55ac1c4e6b6ef907bb | 1,678 | py | Python | ch04/gradient_2d.py | OnsenTamagoYoshi/DeepLearningFromScratch | 006f80b63130829b142c04a88632287bcf5a61b0 | [
"MIT"
] | null | null | null | ch04/gradient_2d.py | OnsenTamagoYoshi/DeepLearningFromScratch | 006f80b63130829b142c04a88632287bcf5a61b0 | [
"MIT"
] | null | null | null | ch04/gradient_2d.py | OnsenTamagoYoshi/DeepLearningFromScratch | 006f80b63130829b142c04a88632287bcf5a61b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# cf.http://d.hatena.ne.jp/white_wheels/20100327/p3
import numpy as np
import matplotlib.pylab as plt
from mpl_toolkits.mplot3d import Axes3D
def _numerical_gradient_no_batch(f, x):
h = 1e-4 #0.0001
grad = np.zeros_like(x) #xと同じ形状の配列を作成
for idx in range(x.size):
tmp_val... | 24.318841 | 111 | 0.52503 |
import numpy as np
import matplotlib.pylab as plt
from mpl_toolkits.mplot3d import Axes3D
def _numerical_gradient_no_batch(f, x):
h = 1e-4
grad = np.zeros_like(x)
for idx in range(x.size):
tmp_val = x[idx]
x[idx] = tmp_val + h
fxh1 = f(x)
... | true | true |
f7568c1e207d95524bea82c452c6e6a9fc23ebb2 | 5,213 | py | Python | flask_mailman/backends/smtp.py | jugmac00/flask-mailman | 248b7d0376d2a2b4bafbf876869e853039963755 | [
"BSD-3-Clause"
] | null | null | null | flask_mailman/backends/smtp.py | jugmac00/flask-mailman | 248b7d0376d2a2b4bafbf876869e853039963755 | [
"BSD-3-Clause"
] | null | null | null | flask_mailman/backends/smtp.py | jugmac00/flask-mailman | 248b7d0376d2a2b4bafbf876869e853039963755 | [
"BSD-3-Clause"
] | null | null | null | """SMTP email backend class."""
import smtplib
import ssl
import threading
from flask_mailman.backends.base import BaseEmailBackend
from flask_mailman.message import sanitize_address
from flask_mailman.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
"""
A wrapper that manages the SMTP network con... | 39.793893 | 95 | 0.615576 | import smtplib
import ssl
import threading
from flask_mailman.backends.base import BaseEmailBackend
from flask_mailman.message import sanitize_address
from flask_mailman.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
def __init__(self, host=None, port=None, username=None, password=None,
... | true | true |
f7568e6a8dd80ec648cf3c333229272cc776edd1 | 4,980 | py | Python | test/model/concourse_test.py | jia-jerry/cc-utils | 01322d2acb7343c92138dcf0b6ac913b276525bc | [
"Apache-2.0"
] | null | null | null | test/model/concourse_test.py | jia-jerry/cc-utils | 01322d2acb7343c92138dcf0b6ac913b276525bc | [
"Apache-2.0"
] | null | null | null | test/model/concourse_test.py | jia-jerry/cc-utils | 01322d2acb7343c92138dcf0b6ac913b276525bc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 43.304348 | 99 | 0.67008 |
import pytest
import model.concourse as examinee
from model.base import ModelValidationError
class ConcourseTeamTest(object):
@pytest.fixture
def concourse_team_dict(self):
return {
'username': 'foo',
'password': 'baz',
'git_auth_team': 'foo:bar',
... | true | true |
f7568e9d7859c08aa3915144e85b52995789cbcf | 14,096 | py | Python | virtual_env/lib/python3.5/site-packages/urllib3/util/url.py | straydag/To_Due_Backend | ac91f5ebabe8e4f2b6db7faa5ccbd30ebdb4e3f6 | [
"MIT"
] | 160 | 2019-09-27T18:02:03.000Z | 2022-03-15T23:46:40.000Z | virtual_env/lib/python3.5/site-packages/urllib3/util/url.py | straydag/To_Due_Backend | ac91f5ebabe8e4f2b6db7faa5ccbd30ebdb4e3f6 | [
"MIT"
] | 127 | 2020-08-07T21:56:58.000Z | 2022-03-30T18:24:53.000Z | virtual_env/lib/python3.5/site-packages/urllib3/util/url.py | straydag/To_Due_Backend | ac91f5ebabe8e4f2b6db7faa5ccbd30ebdb4e3f6 | [
"MIT"
] | 31 | 2019-10-19T18:10:23.000Z | 2022-02-28T14:13:19.000Z | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... | 32.256293 | 88 | 0.562003 | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
NORMALIZABLE_SCHEMES = ("http", "https", None)
PERCENT_RE = re.compile(r"%[a-fA-... | true | true |
f7568eb3a5601bf9e9f5e5a856b632fdec98ee25 | 4,073 | py | Python | Medical_Sieve_Pipeline/Medical_Sieve_Model_Pipeline/estimator.py | JianhengHou/Medical-Sieve | cafb69054ef98cf2f42229ff73c93b6796f9fa91 | [
"MIT"
] | null | null | null | Medical_Sieve_Pipeline/Medical_Sieve_Model_Pipeline/estimator.py | JianhengHou/Medical-Sieve | cafb69054ef98cf2f42229ff73c93b6796f9fa91 | [
"MIT"
] | null | null | null | Medical_Sieve_Pipeline/Medical_Sieve_Model_Pipeline/estimator.py | JianhengHou/Medical-Sieve | cafb69054ef98cf2f42229ff73c93b6796f9fa91 | [
"MIT"
] | null | null | null | from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.metrics import hamming_loss
from sklearn.metrics import accuracy_score
from sklearn.metrics import multilabel_confusion_matrix
from sklearn.metrics import roc_auc_score
import numpy as np
import copy
def combinations(nums):
ans = [[]]
for row i... | 42.873684 | 129 | 0.662657 | from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.metrics import hamming_loss
from sklearn.metrics import accuracy_score
from sklearn.metrics import multilabel_confusion_matrix
from sklearn.metrics import roc_auc_score
import numpy as np
import copy
def combinations(nums):
ans = [[]]
for row i... | true | true |
f7568ef97f4f17d81ef5ed0fe0752015a3d1cc26 | 731 | py | Python | Python/21. MergeTwoSortedLists.py | ranisnehal/LeetCode-Solutions | 1dda6774cd971f0277c57b600193485856ac6e6b | [
"MIT"
] | 263 | 2020-10-05T18:47:29.000Z | 2022-03-31T19:44:46.000Z | Python/21. MergeTwoSortedLists.py | ranisnehal/LeetCode-Solutions | 1dda6774cd971f0277c57b600193485856ac6e6b | [
"MIT"
] | 1,264 | 2020-10-05T18:13:05.000Z | 2022-03-31T23:16:35.000Z | Python/21. MergeTwoSortedLists.py | ranisnehal/LeetCode-Solutions | 1dda6774cd971f0277c57b600193485856ac6e6b | [
"MIT"
] | 760 | 2020-10-05T18:22:51.000Z | 2022-03-29T06:06:20.000Z | # Merge two sorted linked lists and return it as a new sorted list.
# The new list should be made by splicing together the nodes of the first two lists.
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution... | 33.227273 | 84 | 0.574555 |
class Solution:
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
sorted_list = result = ListNode(None)
while l1 and l2:
if l1.val < l2.val:
result.next = l1
l1 = l1.next
else:
result.next = l2
... | true | true |
f7568f2b203759c16b5f9bbb316219c761236ebf | 12,801 | py | Python | dmclient/tars/__rpc.py | simplecelery/stellar_stream | 1e308394b101104538ae889232498e77e16cb17a | [
"MIT"
] | 9 | 2021-08-19T17:19:58.000Z | 2021-11-11T01:14:13.000Z | dmclient/tars/__rpc.py | simplecelery/stellar_stream | 1e308394b101104538ae889232498e77e16cb17a | [
"MIT"
] | 3 | 2021-09-23T03:20:59.000Z | 2022-03-10T06:31:24.000Z | dmclient/tars/__rpc.py | simplecelery/stellar_stream | 1e308394b101104538ae889232498e77e16cb17a | [
"MIT"
] | 9 | 2021-09-24T03:26:21.000Z | 2022-03-23T01:32:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: __rpc.py
# Tencent is pleased to support the open source community by making Tars available.
#
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file ex... | 28.961538 | 98 | 0.568627 |
import time
import argparse
from .__logger import tarsLogger
from .__logger import initLog
from .__trans import EndPointInfo
from .__TimeoutQueue import TimeoutQueue
from .__TimeoutQueue import QueueTimeout
from .__trans import FDReactor
from .__adapterproxy import AdapterProxyManager
from .__serv... | true | true |
f7568fd719f68e63eb96e721ce1b86ea1ae110d8 | 14,211 | py | Python | mark_tool.py | qq769747518/img_mark_tool | f195912bdbc396e51871d8ec7aed8e30c198f7de | [
"MIT"
] | 1 | 2019-12-12T02:36:39.000Z | 2019-12-12T02:36:39.000Z | mark_tool.py | qq769747518/img_mark_tool | f195912bdbc396e51871d8ec7aed8e30c198f7de | [
"MIT"
] | null | null | null | mark_tool.py | qq769747518/img_mark_tool | f195912bdbc396e51871d8ec7aed8e30c198f7de | [
"MIT"
] | null | null | null | import cv2
import shutil
import tkinter as tk
from PIL import Image, ImageTk
from tkinter.filedialog import askdirectory
import re
import os
import json
from collections import OrderedDict
from tkinter.messagebox import *
class Tk_window():
def __init__(self):
self.window = tk.Tk()
# 第2步,给窗口的可视化... | 41.311047 | 180 | 0.604954 | import cv2
import shutil
import tkinter as tk
from PIL import Image, ImageTk
from tkinter.filedialog import askdirectory
import re
import os
import json
from collections import OrderedDict
from tkinter.messagebox import *
class Tk_window():
def __init__(self):
self.window = tk.Tk()
self... | true | true |
f75691dd7e24881b0cec2b596e54cdc67ce47249 | 310 | py | Python | mirror/main.py | FrancescoSaverioZuppichini/mirror | db38362a8ce300bab04d86f2659d6d9bf516c850 | [
"MIT"
] | 234 | 2018-12-02T12:53:53.000Z | 2022-02-04T22:11:18.000Z | mirror/main.py | garain/mirror | a099f8eb87ec6517463123e514acaf63741136ea | [
"MIT"
] | 12 | 2019-01-06T17:38:34.000Z | 2022-02-27T21:35:23.000Z | mirror/main.py | garain/mirror | a099f8eb87ec6517463123e514acaf63741136ea | [
"MIT"
] | 23 | 2018-12-17T13:44:15.000Z | 2021-07-06T17:58:54.000Z | import webbrowser
from .App import App
def mirror(input, model, visualisations=[], port=5000, debug=False):
app = App(input, model, visualisations)
if not debug: webbrowser.open_new(f'http://localhost:{port}') # opens in default browser
app.run(host="0.0.0.0", port=port, use_reloader=debug)
| 28.181818 | 93 | 0.706452 | import webbrowser
from .App import App
def mirror(input, model, visualisations=[], port=5000, debug=False):
app = App(input, model, visualisations)
if not debug: webbrowser.open_new(f'http://localhost:{port}')
app.run(host="0.0.0.0", port=port, use_reloader=debug)
| true | true |
f75693119542904f019fb8585806ef811b69b403 | 4,233 | py | Python | pyqtgraph/examples/contextMenu.py | StSav012/pyqtgraph | 65e17c4e3707eb3bd4d91cdc13504d9b150f4360 | [
"MIT"
] | 1 | 2022-01-30T20:04:51.000Z | 2022-01-30T20:04:51.000Z | pyqtgraph/examples/contextMenu.py | StSav012/pyqtgraph | 65e17c4e3707eb3bd4d91cdc13504d9b150f4360 | [
"MIT"
] | null | null | null | pyqtgraph/examples/contextMenu.py | StSav012/pyqtgraph | 65e17c4e3707eb3bd4d91cdc13504d9b150f4360 | [
"MIT"
] | null | null | null | """
Demonstrates adding a custom context menu to a GraphicsItem
and extending the context menu of a ViewBox.
PyQtGraph implements a system that allows each item in a scene to implement its
own context menu, and for the menus of its parent items to be automatically
displayed as well.
"""
import pyqtgraph as pg
fr... | 30.673913 | 80 | 0.639735 |
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: context menu')
view = win.addViewBox()
zoom1 = view.menu.addAction('Zoom to box 1')
zoom2 = view.menu.addAction('Zoom to box 2')
def zoomTo1():
view.... | true | true |
f75693a6d7d474a87f5e0e475b97e1b6fa087a52 | 550 | py | Python | chatroom/connection/migrations/0003_auto_20180115_0808.py | shunobaka/2ID60-Web-Technology-PiedPiper | bee04cb880479dac599e5749159ede2196e175aa | [
"MIT"
] | null | null | null | chatroom/connection/migrations/0003_auto_20180115_0808.py | shunobaka/2ID60-Web-Technology-PiedPiper | bee04cb880479dac599e5749159ede2196e175aa | [
"MIT"
] | 14 | 2020-02-12T00:13:15.000Z | 2022-03-11T23:18:02.000Z | chatroom/connection/migrations/0003_auto_20180115_0808.py | shunobaka/2ID60-Web-Technology-PiedPiper | bee04cb880479dac599e5749159ede2196e175aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-15 07:08
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('connection', '0002_auto_20180113_1458'),
]
operati... | 25 | 111 | 0.658182 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('connection', '0002_auto_20180113_1458'),
]
operations = [
migrations.AlterField(
model_name='connecti... | true | true |
f756950f77a6685bd0fe0a85fcc65e41a789c524 | 50 | py | Python | nabla/__main__.py | salbrandi/nabla | 1e9d95224d2cefde92d74053418ee00ea01d2fc4 | [
"MIT"
] | null | null | null | nabla/__main__.py | salbrandi/nabla | 1e9d95224d2cefde92d74053418ee00ea01d2fc4 | [
"MIT"
] | null | null | null | nabla/__main__.py | salbrandi/nabla | 1e9d95224d2cefde92d74053418ee00ea01d2fc4 | [
"MIT"
] | null | null | null | import app as server
server.startserver('nabla')
| 12.5 | 27 | 0.78 | import app as server
server.startserver('nabla')
| true | true |
f75695bcf1dfc41cd3dc5f7ecee4fc4b39305980 | 686 | py | Python | app/core/migrations/0003_ingredient.py | lastlift/recipe-app-api | 07385c9ad0a2538a24d253c9f4dd90ffd155c153 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | lastlift/recipe-app-api | 07385c9ad0a2538a24d253c9f4dd90ffd155c153 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | lastlift/recipe-app-api | 07385c9ad0a2538a24d253c9f4dd90ffd155c153 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.27 on 2022-02-08 05:20
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... | 28.583333 | 118 | 0.618076 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingredient',
fields=[
... | true | true |
f756966c35e9bd0d87a2ba4f2d3967e695e0b05a | 6,344 | py | Python | metadata-ingestion/src/datahub/emitter/rest_emitter.py | chinmay-bhat/datahub | ab270a98ee541b993413a0ad68fd2c6ca14441eb | [
"Apache-2.0"
] | 1 | 2022-01-19T02:01:31.000Z | 2022-01-19T02:01:31.000Z | metadata-ingestion/src/datahub/emitter/rest_emitter.py | zhangheng08/datahub | 9b81fa428cfa10260b047c6656180f1d90a33978 | [
"Apache-2.0"
] | 1 | 2021-10-01T13:13:15.000Z | 2021-10-12T11:51:33.000Z | metadata-ingestion/src/datahub/emitter/rest_emitter.py | zhangheng08/datahub | 9b81fa428cfa10260b047c6656180f1d90a33978 | [
"Apache-2.0"
] | 5 | 2021-07-26T08:37:42.000Z | 2021-11-16T05:41:02.000Z | import itertools
import json
import logging
import shlex
from json.decoder import JSONDecodeError
from typing import List, Optional, Union
import requests
from requests.exceptions import HTTPError, RequestException
from datahub import __package_name__
from datahub.configuration.common import OperationalError
from dat... | 33.744681 | 188 | 0.612232 | import itertools
import json
import logging
import shlex
from json.decoder import JSONDecodeError
from typing import List, Optional, Union
import requests
from requests.exceptions import HTTPError, RequestException
from datahub import __package_name__
from datahub.configuration.common import OperationalError
from dat... | true | true |
f75697a790886baaa9a6d37b6e81f92b4a184f85 | 2,882 | py | Python | insights/client/constants.py | dougsland/insights-core | 4bde73b75d1b26c3ba98e9ca4c46f8cc1fa969ff | [
"Apache-2.0"
] | null | null | null | insights/client/constants.py | dougsland/insights-core | 4bde73b75d1b26c3ba98e9ca4c46f8cc1fa969ff | [
"Apache-2.0"
] | null | null | null | insights/client/constants.py | dougsland/insights-core | 4bde73b75d1b26c3ba98e9ca4c46f8cc1fa969ff | [
"Apache-2.0"
] | null | null | null | import os
from insights import package_info
class InsightsConstants(object):
app_name = 'insights-client'
auth_method = 'BASIC'
package_path = os.path.dirname(
os.path.dirname(os.path.abspath(__file__)))
sleep_time = 300
default_conf_dir = '/etc/insights-client'
default_conf_file = '/... | 58.816327 | 120 | 0.733865 | import os
from insights import package_info
class InsightsConstants(object):
app_name = 'insights-client'
auth_method = 'BASIC'
package_path = os.path.dirname(
os.path.dirname(os.path.abspath(__file__)))
sleep_time = 300
default_conf_dir = '/etc/insights-client'
default_conf_file = '/... | true | true |
f75697d625c635fc1ad5212e62f5a9d4297cb71c | 1,392 | py | Python | datepick.py | manzino0705/flask | 68e505ef41f26246693c033a115e08b92be0bca7 | [
"MIT"
] | null | null | null | datepick.py | manzino0705/flask | 68e505ef41f26246693c033a115e08b92be0bca7 | [
"MIT"
] | null | null | null | datepick.py | manzino0705/flask | 68e505ef41f26246693c033a115e08b92be0bca7 | [
"MIT"
] | 1 | 2021-07-26T23:58:08.000Z | 2021-07-26T23:58:08.000Z | import pymysql
import datetime
from flask import Flask, render_template, request
from cal import calday
def datepick(db_password, zone, infra, id):
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
password=db_password,
db=zone)
curs = conn.cursor()
m_... | 20.776119 | 67 | 0.555316 | import pymysql
import datetime
from flask import Flask, render_template, request
from cal import calday
def datepick(db_password, zone, infra, id):
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
password=db_password,
db=zone)
curs = conn.cursor()
m_... | true | true |
f75698b019ea0d15403e393b304862d490bb7795 | 50,416 | py | Python | nova/tests/unit/virt/libvirt/test_migration.py | daespinel/nova | 67c2eaf83bcd613c8b56e470899c4562b900b867 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_migration.py | daespinel/nova | 67c2eaf83bcd613c8b56e470899c4562b900b867 | [
"Apache-2.0"
] | 2 | 2021-03-31T19:41:37.000Z | 2021-12-13T20:33:53.000Z | nova/tests/unit/virt/libvirt/test_migration.py | daespinel/nova | 67c2eaf83bcd613c8b56e470899c4562b900b867 | [
"Apache-2.0"
] | 1 | 2020-07-22T20:27:41.000Z | 2020-07-22T20:27:41.000Z | # Copyright (c) 2016 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.544343 | 79 | 0.606038 |
from collections import deque
from lxml import etree
import mock
from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils import units
import six
from nova.compute import power_state
from nova import exception
from nova.network import model as network_model
from nova import objects
from nova... | true | true |
f756995c94b2be6ba19c16e92a74f757a5d99386 | 8,021 | py | Python | catalyst/rl/scripts/run_samplers.py | mike0sv/catalyst | 54597a3b3d78e5b6c3084dfc3c28185600c79c90 | [
"Apache-2.0"
] | 1 | 2020-04-18T03:09:20.000Z | 2020-04-18T03:09:20.000Z | catalyst/rl/scripts/run_samplers.py | mike0sv/catalyst | 54597a3b3d78e5b6c3084dfc3c28185600c79c90 | [
"Apache-2.0"
] | null | null | null | catalyst/rl/scripts/run_samplers.py | mike0sv/catalyst | 54597a3b3d78e5b6c3084dfc3c28185600c79c90 | [
"Apache-2.0"
] | 1 | 2021-12-20T07:32:25.000Z | 2021-12-20T07:32:25.000Z | #!/usr/bin/env python
# isort:skip_file
import os
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["MKL_NUM_THREADS"] = "1"
import argparse # noqa E402
import atexit # noqa E402
import copy # noqa E402
import multiprocessing as mp # noqa E402
import time # noqa E402
import torch # noqa E402
torch.set_num_threads... | 27.006734 | 79 | 0.619374 |
import os
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["MKL_NUM_THREADS"] = "1"
import argparse
import atexit
import copy
import multiprocessing as mp
import time
import torch
torch.set_num_threads(1)
from catalyst.rl.core import (
ExplorationHandler, Sampler, ValidSampler
)
from catalyst.rl.r... | true | true |
f75699b83b5bb1646479e9d397409b86b49c5130 | 2,253 | py | Python | general_algorithms/unique_paths_grid/src/solution.py | playandlearntocode/main | 2f2374b92b9af3fc11e2aedf13bf8c2240ece906 | [
"MIT"
] | 2 | 2022-01-25T10:34:08.000Z | 2022-03-16T17:17:09.000Z | general_algorithms/unique_paths_grid/src/solution.py | playandlearntocode/main | 2f2374b92b9af3fc11e2aedf13bf8c2240ece906 | [
"MIT"
] | null | null | null | general_algorithms/unique_paths_grid/src/solution.py | playandlearntocode/main | 2f2374b92b9af3fc11e2aedf13bf8c2240ece906 | [
"MIT"
] | 3 | 2022-01-24T23:56:22.000Z | 2022-02-24T20:46:11.000Z | '''
# Unique paths in a grid
A small example of using dynamic programming techniques for finding out the total number of unique paths between two points in a 2D grid.
Author:
Goran Trlin
Find more tutorials and code samples on:
https://playandlearntocode.com
'''
class Solution:
# camelCase is used at the LeetC... | 26.505882 | 137 | 0.447847 |
class Solution:
def unique_paths(self, m: int, n: int) -> int:
if m == 0 or n == 0:
return 0
if m == 1 and n == 1:
return 1
if m == 2 and n == 1:
return 1
if m == 1 and n == 2:
return 1
if m == 2 and n == 2:
... | true | true |
f7569bfb29145ae6d4ea355c92b3223507df2d9f | 265 | py | Python | Tests/Tests.py | SkyLined/mDebugOutput | 0ba3ae5e6118283449119a4942186cb55e47dfe6 | [
"CC-BY-4.0"
] | 2 | 2019-07-23T06:47:07.000Z | 2021-01-30T07:29:28.000Z | Tests/Tests.py | SkyLined/zyp | d5d68257d1bacff4781ad7af318d6922f0dbbd46 | [
"CC-BY-4.0"
] | null | null | null | Tests/Tests.py | SkyLined/zyp | d5d68257d1bacff4781ad7af318d6922f0dbbd46 | [
"CC-BY-4.0"
] | null | null | null | import os, sys;
sModulePath = os.path.dirname(__file__);
sys.path = [sModulePath] + [sPath for sPath in sys.path if sPath.lower() != sModulePath.lower()];
from fTestDependencies import fTestDependencies;
fTestDependencies();
# I should add some tests here.
pass;
| 26.5 | 97 | 0.750943 | import os, sys;
sModulePath = os.path.dirname(__file__);
sys.path = [sModulePath] + [sPath for sPath in sys.path if sPath.lower() != sModulePath.lower()];
from fTestDependencies import fTestDependencies;
fTestDependencies();
pass;
| true | true |
f7569c652a43bb73124fa48de12f0aafa079c174 | 22,692 | py | Python | operator/helm/split_resources.py | msteffen/seldon-core | 8aaa104de8c6e2a8138632022265271ec070ad1f | [
"Apache-2.0"
] | 4 | 2019-08-29T19:36:55.000Z | 2021-12-20T00:37:08.000Z | operator/helm/split_resources.py | msteffen/seldon-core | 8aaa104de8c6e2a8138632022265271ec070ad1f | [
"Apache-2.0"
] | 153 | 2020-02-03T10:48:40.000Z | 2021-08-02T10:31:51.000Z | operator/helm/split_resources.py | ellisvalentiner/seldon-core | 2cd0d88add06db7699ccfb41b4d850183402206d | [
"Apache-2.0"
] | 3 | 2019-10-27T17:56:52.000Z | 2021-02-21T17:06:03.000Z | import argparse
import glob
import re
import yaml
parser = argparse.ArgumentParser()
parser.add_argument("--prefix", default="xx", help="find files matching prefix")
parser.add_argument("--folder", required=True, help="Output folder")
args, _ = parser.parse_known_args()
HELM_SPARTAKUS_IF_START = "{{- if .Values.usag... | 43.976744 | 183 | 0.515292 | import argparse
import glob
import re
import yaml
parser = argparse.ArgumentParser()
parser.add_argument("--prefix", default="xx", help="find files matching prefix")
parser.add_argument("--folder", required=True, help="Output folder")
args, _ = parser.parse_known_args()
HELM_SPARTAKUS_IF_START = "{{- if .Values.usag... | true | true |
f7569e711786f22914d638d5034c5cfd84c7753c | 13,192 | py | Python | src/aihwkit/nn/modules/linear_mapped.py | todd-deshane/aihwkit | 07269e29731f9a6482d25326400437f6bef2fc94 | [
"Apache-2.0"
] | 133 | 2020-09-17T20:36:08.000Z | 2022-03-21T12:15:40.000Z | src/aihwkit/nn/modules/linear_mapped.py | todd-deshane/aihwkit | 07269e29731f9a6482d25326400437f6bef2fc94 | [
"Apache-2.0"
] | 140 | 2020-09-21T12:16:55.000Z | 2022-03-31T18:07:37.000Z | src/aihwkit/nn/modules/linear_mapped.py | todd-deshane/aihwkit | 07269e29731f9a6482d25326400437f6bef2fc94 | [
"Apache-2.0"
] | 53 | 2020-09-17T15:53:31.000Z | 2022-03-30T12:22:04.000Z | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modificatio... | 38.460641 | 99 | 0.614312 |
from typing import Optional, Tuple, List
from torch import Tensor, cat, split, no_grad
from torch.nn import Linear
from aihwkit.nn.functions import AnalogFunction
from aihwkit.nn.modules.base import AnalogModuleBase, RPUConfigAlias
from aihwkit.simulator.configs import SingleRPUConfig
from aihwkit.except... | true | true |
f7569e79289da685599f14871fa12c796b24fc5e | 1,697 | py | Python | ascii_error.py | rmorgan10/error_cat | 5d0c17f9636255f34926570e5ce4a4e49a47ddf9 | [
"MIT"
] | 3 | 2019-10-31T14:21:41.000Z | 2020-04-23T13:45:00.000Z | ascii_error.py | rmorgan10/error_cat | 5d0c17f9636255f34926570e5ce4a4e49a47ddf9 | [
"MIT"
] | null | null | null | ascii_error.py | rmorgan10/error_cat | 5d0c17f9636255f34926570e5ce4a4e49a47ddf9 | [
"MIT"
] | 1 | 2019-12-12T21:55:30.000Z | 2019-12-12T21:55:30.000Z | # A module to make your error messages less scary
import sys
from characters import AsciiCharacter
def output_ascii(err_message="You certainly messed something up."):
one_line = False
err_line_1 = err_message.split('--')[0]
try:
err_line_2 = err_message.split('--')[1]
except:
on... | 27.819672 | 90 | 0.46317 |
import sys
from characters import AsciiCharacter
def output_ascii(err_message="You certainly messed something up."):
one_line = False
err_line_1 = err_message.split('--')[0]
try:
err_line_2 = err_message.split('--')[1]
except:
one_line = True
err_line_2 = err_line_1
... | true | true |
f756a02c797075c5ba0d009801f110a6eb7a8519 | 8,493 | py | Python | qa/rpc-tests/cfund-paymentrequest-state-accept-expired-proposal.py | Ankh-Trust/electrum-core | 360efcd3d6907e342608e3d2dc7628d6be639619 | [
"MIT"
] | 2 | 2019-10-31T12:02:24.000Z | 2019-11-09T11:08:03.000Z | qa/rpc-tests/cfund-paymentrequest-state-accept-expired-proposal.py | Ankh-Trust/electrum-core | 360efcd3d6907e342608e3d2dc7628d6be639619 | [
"MIT"
] | null | null | null | qa/rpc-tests/cfund-paymentrequest-state-accept-expired-proposal.py | Ankh-Trust/electrum-core | 360efcd3d6907e342608e3d2dc7628d6be639619 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The NavCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ElectrumTestFramework
from test_framework.cfund_util import *
impor... | 41.837438 | 151 | 0.666313 |
from test_framework.test_framework import ElectrumTestFramework
from test_framework.cfund_util import *
import time
class CommunityFundPaymentRequestsTest(ElectrumTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 1
def setup_ne... | true | true |
f756a05db43f76e88044fe66b97083fdedac41a3 | 43,510 | py | Python | cwltool/workflow.py | hmenager/cwltool | 526f36f93655bfb098f766ff020708b5a707513a | [
"Apache-2.0"
] | null | null | null | cwltool/workflow.py | hmenager/cwltool | 526f36f93655bfb098f766ff020708b5a707513a | [
"Apache-2.0"
] | null | null | null | cwltool/workflow.py | hmenager/cwltool | 526f36f93655bfb098f766ff020708b5a707513a | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import copy
import datetime
import functools
import logging
import random
import tempfile
from collections import namedtuple
from typing import (Any, Callable, Dict, Generator, Iterable, List,
Mapping, MutableMapping, MutableSequence,
Optio... | 43.336653 | 115 | 0.556883 | from __future__ import absolute_import
import copy
import datetime
import functools
import logging
import random
import tempfile
from collections import namedtuple
from typing import (Any, Callable, Dict, Generator, Iterable, List,
Mapping, MutableMapping, MutableSequence,
Optio... | true | true |
f756a0e3fa44ca13101f8b58b79a5585e3abf3f4 | 12,751 | py | Python | samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py | BrMtssk/openapi-generator | 13f1c610d9ba8f3a4bbbe8ae0e7cb4d0a9b786c9 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py | BrMtssk/openapi-generator | 13f1c610d9ba8f3a4bbbe8ae0e7cb4d0a9b786c9 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py | BrMtssk/openapi-generator | 13f1c610d9ba8f3a4bbbe8ae0e7cb4d0a9b786c9 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Extension x-auth-id-alias
This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import io
import json
import logging
import re
import ssl
from ... | 42.082508 | 146 | 0.545291 |
import io
import json
import logging
import re
import ssl
from urllib.parse import urlencode
import certifi
import urllib3
from x_auth_id_alias.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
logger = logging.getLogger(__name__)
cla... | true | true |
f756a2b78dfa6db189d57ff1424659d5f2f5cd34 | 321 | py | Python | DesignPatterns/05_iterator/1_no_iterator/employee_collection.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | DesignPatterns/05_iterator/1_no_iterator/employee_collection.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | DesignPatterns/05_iterator/1_no_iterator/employee_collection.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | class Employees(object):
_employees = {}
_headcount = 0
def add_employee(self, employee):
self._headcount += 1
self._employees[self._headcount] = employee
def get_employee(self, i):
return self._employees[i]
@property
def headcount(self):
return self._headcount... | 21.4 | 51 | 0.635514 | class Employees(object):
_employees = {}
_headcount = 0
def add_employee(self, employee):
self._headcount += 1
self._employees[self._headcount] = employee
def get_employee(self, i):
return self._employees[i]
@property
def headcount(self):
return self._headcount... | true | true |
f756a31ffeece92f486e9c683b90296ddff59f1d | 4,213 | py | Python | anchore_engine/services/policy_engine/api/models/image_vulnerability_listing.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | anchore_engine/services/policy_engine/api/models/image_vulnerability_listing.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | anchore_engine/services/policy_engine/api/models/image_vulnerability_listing.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from anchore_engine.services.policy_engine.api.models.base_model_ import Model
from anchore_engine.services.policy_engine.api.models.legacy_vulnerability_report import ... | 29.669014 | 133 | 0.663423 |
from __future__ import absolute_import
from datetime import date, datetime
from typing import List, Dict
from anchore_engine.services.policy_engine.api.models.base_model_ import Model
from anchore_engine.services.policy_engine.api.models.legacy_vulnerability_report import LegacyVulnerabilityReport
from anchor... | true | true |
f756a3304cf1aef9a5d6ae57bf8a72af95f002b6 | 903 | py | Python | arakat-backend/pipeline_generator/family_base/BatchWriteToFile.py | ahmetfyildirim/arakat | 01cfebdb77cdcec5723b0dc9d7d597a3b288f9e1 | [
"Apache-2.0"
] | null | null | null | arakat-backend/pipeline_generator/family_base/BatchWriteToFile.py | ahmetfyildirim/arakat | 01cfebdb77cdcec5723b0dc9d7d597a3b288f9e1 | [
"Apache-2.0"
] | null | null | null | arakat-backend/pipeline_generator/family_base/BatchWriteToFile.py | ahmetfyildirim/arakat | 01cfebdb77cdcec5723b0dc9d7d597a3b288f9e1 | [
"Apache-2.0"
] | null | null | null | from domain.ErrorTypes import ErrorTypes
from validity import IncomingEdgeValidityChecker
from utils import CodeGenerationUtils
import os
def generate_code(args):
node = args["node"]
requireds_info = args["requireds_info"]
edges = args["edges"]
checklist={"df_count": {1}, "model_count": {0}}
erro... | 39.26087 | 220 | 0.665559 | from domain.ErrorTypes import ErrorTypes
from validity import IncomingEdgeValidityChecker
from utils import CodeGenerationUtils
import os
def generate_code(args):
node = args["node"]
requireds_info = args["requireds_info"]
edges = args["edges"]
checklist={"df_count": {1}, "model_count": {0}}
erro... | true | true |
f756a365eb88faf78cb6aede8290b8a9c12d348c | 1,560 | py | Python | ivi/agilent/agilent8596EM.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/agilent/agilent8596EM.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/agilent/agilent8596EM.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | 36.27907 | 77 | 0.753846 |
from .agilentBase8590E import *
class agilent8596EM(agilentBase8590E):
def __init__(self, *args, **kwargs):
self.__dict__.setdefault('_instrument_id', 'HP8596EM')
super(agilent8596EM, self).__init__(*args, **kwargs)
self._input_impedance = 50
self._frequency_... | true | true |
f756a4ae56c0cf79b240d9a1382239553947d5fb | 7,850 | py | Python | code/PH.py | LiuXiangMath/Hom-Complex-ML | e47d3af91e119d35af2c97312efd007adc7abfe5 | [
"Apache-2.0"
] | null | null | null | code/PH.py | LiuXiangMath/Hom-Complex-ML | e47d3af91e119d35af2c97312efd007adc7abfe5 | [
"Apache-2.0"
] | null | null | null | code/PH.py | LiuXiangMath/Hom-Complex-ML | e47d3af91e119d35af2c97312efd007adc7abfe5 | [
"Apache-2.0"
] | 1 | 2021-12-29T04:33:50.000Z | 2021-12-29T04:33:50.000Z | # -*- coding: utf-8 -*-
import numpy as np
def get_point_index(point,simplices):
for i in range(len(simplices)):
if simplices[i][2]==0:
if simplices[i][3]==point:
return i
def get_edge_index(edge,simplices):
for i in range(len(simplices)):
if simplice... | 31.526104 | 119 | 0.505223 |
import numpy as np
def get_point_index(point,simplices):
for i in range(len(simplices)):
if simplices[i][2]==0:
if simplices[i][3]==point:
return i
def get_edge_index(edge,simplices):
for i in range(len(simplices)):
if simplices[i][2]==1:
... | true | true |
f756a4b951f93a176478e164cdca404427459cb6 | 2,359 | py | Python | tests/test_client.py | xinxi1990/httprunner_test | 3b9a1097e63a108408955d395308bf273d29753d | [
"MIT"
] | 1 | 2018-08-14T02:52:54.000Z | 2018-08-14T02:52:54.000Z | tests/test_client.py | xinxi1990/httprunner_test | 3b9a1097e63a108408955d395308bf273d29753d | [
"MIT"
] | 1 | 2020-03-02T10:35:53.000Z | 2020-03-02T10:35:53.000Z | tests/test_client.py | xinxi1990/httprunner_test | 3b9a1097e63a108408955d395308bf273d29753d | [
"MIT"
] | null | null | null | from httprunner.built_in import setup_hook_prepare_kwargs
from httprunner.client import HttpSession
from httprunner.compat import bytes
from tests.base import ApiServerUnittest
class TestHttpClient(ApiServerUnittest):
def setUp(self):
super(TestHttpClient, self).setUp()
self.api_client = HttpSessi... | 32.315068 | 80 | 0.571429 | from httprunner.built_in import setup_hook_prepare_kwargs
from httprunner.client import HttpSession
from httprunner.compat import bytes
from tests.base import ApiServerUnittest
class TestHttpClient(ApiServerUnittest):
def setUp(self):
super(TestHttpClient, self).setUp()
self.api_client = HttpSessi... | true | true |
f756a65b02f044e400ead403974967598e39ec7a | 6,239 | py | Python | nanome/api/structure/residue.py | rramji/nanome-lib | 2806598af31cfb4bb6e16366f0b300d2ddcc9c13 | [
"MIT"
] | null | null | null | nanome/api/structure/residue.py | rramji/nanome-lib | 2806598af31cfb4bb6e16366f0b300d2ddcc9c13 | [
"MIT"
] | null | null | null | nanome/api/structure/residue.py | rramji/nanome-lib | 2806598af31cfb4bb6e16366f0b300d2ddcc9c13 | [
"MIT"
] | null | null | null | import nanome
from nanome.util import Logs
from nanome._internal._structure._residue import _Residue
from . import Base
class Residue(_Residue, Base):
RibbonMode = nanome.util.enums.RibbonMode
SecondaryStructure = nanome.util.enums.SecondaryStructure
def __init__(self):
super(Residue, self).__ini... | 27.008658 | 109 | 0.610995 | import nanome
from nanome.util import Logs
from nanome._internal._structure._residue import _Residue
from . import Base
class Residue(_Residue, Base):
RibbonMode = nanome.util.enums.RibbonMode
SecondaryStructure = nanome.util.enums.SecondaryStructure
def __init__(self):
super(Residue, self).__ini... | true | true |
f756a69c6c34fe76d3acd147e44dbd09300bac90 | 3,483 | py | Python | examples/taxi_service.py | sash-ko/simobility | 97317c488cc22d1d7c9ebf3c5811d1bac3a0b79c | [
"MIT"
] | 29 | 2020-01-22T20:02:40.000Z | 2022-01-11T18:51:24.000Z | examples/taxi_service.py | sash-ko/simobility | 97317c488cc22d1d7c9ebf3c5811d1bac3a0b79c | [
"MIT"
] | 7 | 2020-01-22T18:51:10.000Z | 2021-03-03T10:41:32.000Z | examples/taxi_service.py | sash-ko/simobility | 97317c488cc22d1d7c9ebf3c5811d1bac3a0b79c | [
"MIT"
] | 5 | 2020-01-27T19:37:27.000Z | 2022-03-16T14:24:14.000Z | """
Implementation of taxi service that operates with following logic:
1. Service find a list of candidate taxies for one booking
2. It sends requests to all candidate taxies
3. The first taxi driver that accepts the request takes the job
"""
from typing import List, Tuple
import random
from collections import defau... | 30.025862 | 81 | 0.659489 |
from typing import List, Tuple
import random
from collections import defaultdict
from simobility.core import Vehicle
from simobility.core import Booking
from simobility.core.tools import basic_booking_itinerary
class TaxiService:
def __init__(self, clock, taxi_drivers, dispatcher):
self.clock = clock
... | true | true |
f756a780cf1d8a64b3b16ed3e191ee4411861458 | 444 | py | Python | moodle/core/calendar/calendar_export_token.py | Hardikris/moodlepy | 8f5cb0cb4c2297e10f48396de681f6bb250f7751 | [
"MIT"
] | null | null | null | moodle/core/calendar/calendar_export_token.py | Hardikris/moodlepy | 8f5cb0cb4c2297e10f48396de681f6bb250f7751 | [
"MIT"
] | null | null | null | moodle/core/calendar/calendar_export_token.py | Hardikris/moodlepy | 8f5cb0cb4c2297e10f48396de681f6bb250f7751 | [
"MIT"
] | null | null | null | from moodle import MoodleWarning
from typing import List
from moodle.attr import dataclass, field
@dataclass
class CalendarExportToken:
"""Auth token for exporting a calendar.
token (str): The calendar permanent access token for calendar export.
warnings (List[MoodleWarning]): list of MoodleWarning
""... | 24.666667 | 73 | 0.72973 | from moodle import MoodleWarning
from typing import List
from moodle.attr import dataclass, field
@dataclass
class CalendarExportToken:
token: str
warnings: List[MoodleWarning] = field(factory=list)
def __str__(self):
return self.token
| true | true |
f756a8532b8edb8d1770b5bd603da4df07ed6008 | 111 | py | Python | call_def_to_main.py | MotiMatika/lemida_atsmit | 53baca5a7d76a1dc9723e6d7f11bb784efffdcd4 | [
"MIT"
] | null | null | null | call_def_to_main.py | MotiMatika/lemida_atsmit | 53baca5a7d76a1dc9723e6d7f11bb784efffdcd4 | [
"MIT"
] | null | null | null | call_def_to_main.py | MotiMatika/lemida_atsmit | 53baca5a7d76a1dc9723e6d7f11bb784efffdcd4 | [
"MIT"
] | null | null | null | def sum_num(x,y):
sum = x+y
return sum
def div_num(x,y):
div = x/y
return div
| 5.55 | 17 | 0.468468 | def sum_num(x,y):
sum = x+y
return sum
def div_num(x,y):
div = x/y
return div
| true | true |
f756ab2f736018bc700c5f0602b1fe3824ba90c9 | 3,788 | py | Python | contrib/macdeploy/custom_dsstore.py | cryptcoin-dev/cryptcoin | d9ee1250d07190014c89d0474430634bc2c7441c | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | cryptcoin-dev/cryptcoin | d9ee1250d07190014c89d0474430634bc2c7441c | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | cryptcoin-dev/cryptcoin | d9ee1250d07190014c89d0474430634bc2c7441c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 62.098361 | 1,817 | 0.728353 |
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': b'{{30... | true | true |
f756ac5c6b832e6cd84cba4cfcda14af24f64d7b | 5,781 | py | Python | room_booking_project/room_booking/views.py | alsanuz/room_booking_app | 12acc8fc0e5d9a3abe23eca1ea1d4ee88e732ccf | [
"Unlicense"
] | null | null | null | room_booking_project/room_booking/views.py | alsanuz/room_booking_app | 12acc8fc0e5d9a3abe23eca1ea1d4ee88e732ccf | [
"Unlicense"
] | null | null | null | room_booking_project/room_booking/views.py | alsanuz/room_booking_app | 12acc8fc0e5d9a3abe23eca1ea1d4ee88e732ccf | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib import messages
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.translation import... | 34.825301 | 99 | 0.640374 |
from __future__ import unicode_literals
from datetime import datetime
from django.contrib import messages
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.translation import gettext as _
from djan... | true | true |
f756adea102f08c296cb822bc4eb3289e6cb4262 | 5,661 | py | Python | compliance_checker/tests/test_suite.py | DanielJMaher/compliance-checker | 944220a4a7bd0e945d7b4e468ffb524af5eca5b2 | [
"Apache-2.0"
] | null | null | null | compliance_checker/tests/test_suite.py | DanielJMaher/compliance-checker | 944220a4a7bd0e945d7b4e468ffb524af5eca5b2 | [
"Apache-2.0"
] | 1 | 2017-12-04T10:43:20.000Z | 2017-12-11T17:21:03.000Z | compliance_checker/tests/test_suite.py | DanielJMaher/compliance-checker | 944220a4a7bd0e945d7b4e468ffb524af5eca5b2 | [
"Apache-2.0"
] | null | null | null | from pkg_resources import resource_filename
from compliance_checker.suite import CheckSuite
from compliance_checker.base import Result, BaseCheck
import numpy as np
import unittest
import os
static_files = {
'2dim' : resource_filename('compliance_checker', 'tests/data/2dim-grid.nc'),
'bad... | 42.246269 | 109 | 0.624448 | from pkg_resources import resource_filename
from compliance_checker.suite import CheckSuite
from compliance_checker.base import Result, BaseCheck
import numpy as np
import unittest
import os
static_files = {
'2dim' : resource_filename('compliance_checker', 'tests/data/2dim-grid.nc'),
'bad... | true | true |
f756ae227653519520f0bd98b581c55b1c370119 | 2,358 | py | Python | config/settings/local.py | Gilbishkosma/linkeep | fe981c2361a8372bb738218ad189982d38defdd9 | [
"MIT"
] | null | null | null | config/settings/local.py | Gilbishkosma/linkeep | fe981c2361a8372bb738218ad189982d38defdd9 | [
"MIT"
] | null | null | null | config/settings/local.py | Gilbishkosma/linkeep | fe981c2361a8372bb738218ad189982d38defdd9 | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... | 39.966102 | 97 | 0.586938 | from .base import *
from .base import env
= True
= env(
"DJANGO_SECRET_KEY",
default="ZJsn3zIjfJYO4FD9eNxyA42pkkodLMHcMXHJQ4sIZpMFaluMCk9lAYeczJS0CxGM",
)
= ["localhost", "0.0.0.0", "127.0.0.1"]
= {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATIO... | true | true |
f756ae3d4c2ff24bc22fec99aab63375b164b183 | 5,959 | py | Python | LungBoundaryCrop.py | gyungchan2110/ImageUtils | 618d032122d6eadeec4afc9fc6c6906fa71f0ff6 | [
"MIT"
] | null | null | null | LungBoundaryCrop.py | gyungchan2110/ImageUtils | 618d032122d6eadeec4afc9fc6c6906fa71f0ff6 | [
"MIT"
] | null | null | null | LungBoundaryCrop.py | gyungchan2110/ImageUtils | 618d032122d6eadeec4afc9fc6c6906fa71f0ff6 | [
"MIT"
] | null | null | null | # In[]
import cv2
import numpy as np
import os
from operator import eq
import random
import matplotlib.pyplot as plt
from skimage import io
import shutil
os.environ["CUDA_VISIBLE_DEVICES"]="0"
imgBase = "D:/[Data]/[Cardiomegaly]/1_ChestPA_Labeled_Baeksongyi/[PNG]_2_Generated_Data(2k)/Generated_Data_20180327_151... | 38.445161 | 175 | 0.667226 |
import cv2
import numpy as np
import os
from operator import eq
import random
import matplotlib.pyplot as plt
from skimage import io
import shutil
os.environ["CUDA_VISIBLE_DEVICES"]="0"
imgBase = "D:/[Data]/[Cardiomegaly]/1_ChestPA_Labeled_Baeksongyi/[PNG]_2_Generated_Data(2k)/Generated_Data_20180327_151800_2C... | true | true |
f756afe2f7b5112c4abcd60fb81c53970e3949f8 | 4,447 | py | Python | Twitter_Analysis/data_collector.py | GisaKaze/Python-Quarantine-Projects | 29fabcb7e4046e6f3e9a19403e6d2490fe4b9fc4 | [
"MIT"
] | 269 | 2020-03-24T11:52:17.000Z | 2022-03-30T17:13:27.000Z | Twitter_Analysis/data_collector.py | GisaKaze/Python-Quarantine-Projects | 29fabcb7e4046e6f3e9a19403e6d2490fe4b9fc4 | [
"MIT"
] | 11 | 2020-03-25T10:51:32.000Z | 2022-01-15T19:29:42.000Z | Twitter_Analysis/data_collector.py | GisaKaze/Python-Quarantine-Projects | 29fabcb7e4046e6f3e9a19403e6d2490fe4b9fc4 | [
"MIT"
] | 119 | 2020-03-24T12:20:12.000Z | 2022-01-26T20:18:00.000Z | import sqlite3
import json
from tqdm import tqdm
from text_analysis import senti_score,sentiment_analyzer
data=[]
with open('tweets.txt','r') as f:
raw_data=f.readlines()
for i in raw_data:
if len(i)>1:
data.append(i)
##################################################################################... | 41.175926 | 242 | 0.561727 | import sqlite3
import json
from tqdm import tqdm
from text_analysis import senti_score,sentiment_analyzer
data=[]
with open('tweets.txt','r') as f:
raw_data=f.readlines()
for i in raw_data:
if len(i)>1:
data.append(i)
| true | true |
f756b0c338af4df0f1a4d036900343a034dcf2a4 | 111 | py | Python | grand_geckos/database/__init__.py | imsofi/codejam-grand-geckos | 55aabf5fe127ee9618c1faa2fe8cc02af8054b80 | [
"0BSD"
] | 5 | 2021-07-10T02:57:10.000Z | 2021-08-02T20:20:10.000Z | grand_geckos/database/__init__.py | imsofi/codejam-grand-geckos | 55aabf5fe127ee9618c1faa2fe8cc02af8054b80 | [
"0BSD"
] | 12 | 2021-07-09T22:06:22.000Z | 2021-07-16T20:27:42.000Z | grand_geckos/database/__init__.py | imsofi/codejam-grand-geckos | 55aabf5fe127ee9618c1faa2fe8cc02af8054b80 | [
"0BSD"
] | 6 | 2021-07-09T20:55:04.000Z | 2021-08-30T19:40:34.000Z | from .DBWorker import DatabaseWorker
from .models import Base
Base.metadata.create_all(DatabaseWorker.engine)
| 22.2 | 47 | 0.846847 | from .DBWorker import DatabaseWorker
from .models import Base
Base.metadata.create_all(DatabaseWorker.engine)
| true | true |
f756b17c10d51b7b8bc5a4ff3d5b7de57359aa73 | 1,812 | py | Python | saleor/order/migrations/0084_auto_20200522_0522.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/order/migrations/0084_auto_20200522_0522.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/order/migrations/0084_auto_20200522_0522.py | aminziadna/saleor | 2e78fb5bcf8b83a6278af02551a104cfa555a1fb | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | # Generated by Django 3.0.6 on 2020-05-22 10:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("order", "0083_merge_20200421_0529"),
]
operations = [
migrations.AlterField(
model_name="orderevent",
name="type",
... | 40.266667 | 83 | 0.512141 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("order", "0083_merge_20200421_0529"),
]
operations = [
migrations.AlterField(
model_name="orderevent",
name="type",
field=models.CharField(
... | true | true |
f756b2916b49e5fc286b3277225f79f8a32a362d | 597 | py | Python | api/tests/e2e/test_add_pet.py | nicfix/monorepo-template | ec265d9e746b70e6a13a7a5e1e82f150b63a7ecf | [
"MIT"
] | 7 | 2020-06-03T06:52:22.000Z | 2021-12-27T07:02:45.000Z | api/tests/e2e/test_add_pet.py | nicfix/monorepo-template | ec265d9e746b70e6a13a7a5e1e82f150b63a7ecf | [
"MIT"
] | 12 | 2020-05-23T18:36:41.000Z | 2021-05-25T08:16:41.000Z | tests/e2e/test_add_pet.py | nicfix/py-ddd-microservice-boilerplate | 1844a8fde57dc5bbaacf6a71163beb7226041a0c | [
"MIT"
] | 1 | 2020-06-02T09:39:00.000Z | 2020-06-02T09:39:00.000Z | from starlette.testclient import TestClient
from pet_store.entrypoints.api import app
from tests.e2e.utils.e2e_test_case import E2ETestCase
class PetTestCase(E2ETestCase):
def test_add_pet(self):
client = TestClient(app)
body = {
'age': 12,
'name': 'Milú'
}
... | 22.111111 | 54 | 0.59129 | from starlette.testclient import TestClient
from pet_store.entrypoints.api import app
from tests.e2e.utils.e2e_test_case import E2ETestCase
class PetTestCase(E2ETestCase):
def test_add_pet(self):
client = TestClient(app)
body = {
'age': 12,
'name': 'Milú'
}
... | true | true |
f756b2f829536ba675f9d71ac2404de6de512c24 | 2,021 | py | Python | abosadmin/tutor/migrations/0012_auto_20150331_2042.py | abos5/pythontutor | eba451700def8bd98d74668d1b6cc08c0ccc0d3c | [
"MIT"
] | null | null | null | abosadmin/tutor/migrations/0012_auto_20150331_2042.py | abos5/pythontutor | eba451700def8bd98d74668d1b6cc08c0ccc0d3c | [
"MIT"
] | null | null | null | abosadmin/tutor/migrations/0012_auto_20150331_2042.py | abos5/pythontutor | eba451700def8bd98d74668d1b6cc08c0ccc0d3c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tutor', '0011_auto_20150331_2034'),
]
operations = [
migrations.CreateModel(
name='Female2',
fields=... | 32.079365 | 114 | 0.512123 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tutor', '0011_auto_20150331_2034'),
]
operations = [
migrations.CreateModel(
name='Female2',
fields=[
('id'... | true | true |
f756b44e2a9c9ca097c828d51d46ce430981b3ae | 8,709 | py | Python | docs/cookbook/complete-examples/pong/pong.py | tjguk/networkzero | 5b40e3a213f22dc82d2ce8d36925019eaaf2c06e | [
"MIT"
] | 39 | 2016-03-31T07:49:45.000Z | 2021-09-01T10:34:02.000Z | docs/cookbook/complete-examples/pong/pong.py | tjguk/networkzero | 5b40e3a213f22dc82d2ce8d36925019eaaf2c06e | [
"MIT"
] | 48 | 2016-04-07T20:22:44.000Z | 2021-09-26T18:12:01.000Z | docs/cookbook/complete-examples/pong/pong.py | tjguk/networkzero | 5b40e3a213f22dc82d2ce8d36925019eaaf2c06e | [
"MIT"
] | 15 | 2016-04-07T20:12:18.000Z | 2019-10-25T14:31:41.000Z | # Pong is a two-dimensional sports game that simulates table tennis.
# The player controls an in-game paddle by moving it vertically across
# the left side of the screen, and can compete against either a
# computer-controlled opponent or another player controlling a second
# paddle on the opposing side. Players use the... | 29.224832 | 78 | 0.598347 |
import random
WIDTH = 800
HEIGHT = 600
TITLE = 'pong'
MAIN_COLOR = 'yellow'
PADDLE_WIDTH = 15
PADDLE_HEIGHT = 100
TENNIS_BALL_RADIUS = 10
LEFT_PLAYER = "left"
RIGHT_PLAYER = "right"
class Paddle(Rect):
def __init__(self, start_x, start_y):
super().__init__(start_x, start_y, PADDLE_WIDTH, ... | true | true |
f756b5260b20045bcdb9a806cc758d03b12a17d7 | 637 | py | Python | tests/requests/valid/pp_02.py | CovenantEyes/gunicorn | 86020df41edaf5c085df66edcca521e4b26acae8 | [
"MIT"
] | null | null | null | tests/requests/valid/pp_02.py | CovenantEyes/gunicorn | 86020df41edaf5c085df66edcca521e4b26acae8 | [
"MIT"
] | null | null | null | tests/requests/valid/pp_02.py | CovenantEyes/gunicorn | 86020df41edaf5c085df66edcca521e4b26acae8 | [
"MIT"
] | null | null | null | from gunicorn.config import Config
cfg = Config()
cfg.set("proxy_protocol", True)
req1 = {
"method": "GET",
"uri": uri("/stuff/here?foo=bar"),
"version": (1, 1),
"headers": [
("SERVER", "http://127.0.0.1:5984"),
("CONTENT-TYPE", "application/json"),
("CONTENT-LENGTH", "14"),
... | 20.548387 | 46 | 0.519623 | from gunicorn.config import Config
cfg = Config()
cfg.set("proxy_protocol", True)
req1 = {
"method": "GET",
"uri": uri("/stuff/here?foo=bar"),
"version": (1, 1),
"headers": [
("SERVER", "http://127.0.0.1:5984"),
("CONTENT-TYPE", "application/json"),
("CONTENT-LENGTH", "14"),
... | true | true |
f756b5c3375de7742037aecd04df6bfac42a2911 | 1,099 | py | Python | frc_characterization/logger_analyzer/__init__.py | CodingWithFusion/frc-characterization | fe090ff541fcda1991f3339da91734168a18f1e5 | [
"Apache-2.0"
] | 30 | 2019-11-13T01:43:47.000Z | 2022-01-09T16:57:42.000Z | frc_characterization/logger_analyzer/__init__.py | CodingWithFusion/frc-characterization | fe090ff541fcda1991f3339da91734168a18f1e5 | [
"Apache-2.0"
] | 98 | 2019-11-11T17:13:06.000Z | 2021-06-12T18:00:53.000Z | frc_characterization/logger_analyzer/__init__.py | CodingWithFusion/frc-characterization | fe090ff541fcda1991f3339da91734168a18f1e5 | [
"Apache-2.0"
] | 44 | 2019-11-16T22:00:17.000Z | 2022-03-04T14:43:26.000Z | from mako.template import Template
import os
from importlib import import_module
import pathlib
import zipfile
# TODO: Replace with Python 3.9's importlib.resources.files() when it becomes min version
def files(package):
spec = import_module(package).__spec__
if spec.submodule_search_locations is None:
... | 31.4 | 89 | 0.713376 | from mako.template import Template
import os
from importlib import import_module
import pathlib
import zipfile
def files(package):
spec = import_module(package).__spec__
if spec.submodule_search_locations is None:
raise TypeError("{!r} is not a package".format(package))
package_directory = path... | true | true |
f756b7d59d96d928e2c0d076d21cba8b0e6a03e3 | 19,027 | py | Python | fireeye/src/fireeye.py | vxsh4d0w/connectors | d0beecfb1d2c75cc0d6443c48a3a6a4ef53549eb | [
"Apache-2.0"
] | null | null | null | fireeye/src/fireeye.py | vxsh4d0w/connectors | d0beecfb1d2c75cc0d6443c48a3a6a4ef53549eb | [
"Apache-2.0"
] | null | null | null | fireeye/src/fireeye.py | vxsh4d0w/connectors | d0beecfb1d2c75cc0d6443c48a3a6a4ef53549eb | [
"Apache-2.0"
] | null | null | null | import os
import yaml
import time
import requests
import json
import datetime
from urllib.parse import urlparse, parse_qs
from dateutil.parser import parse
from requests.auth import HTTPBasicAuth
from pycti import OpenCTIConnectorHelper, get_config_variable
searchable_types = [
"threat-actor",
"malware",
... | 43.942263 | 372 | 0.449467 | import os
import yaml
import time
import requests
import json
import datetime
from urllib.parse import urlparse, parse_qs
from dateutil.parser import parse
from requests.auth import HTTPBasicAuth
from pycti import OpenCTIConnectorHelper, get_config_variable
searchable_types = [
"threat-actor",
"malware",
... | true | true |
f756b806f7710298b7620e4659a63d8bf537f3a3 | 394 | py | Python | settings/baker_recipes.py | stanwood/traidoo-api | 83e8599f2eb54352988bac27e2d4acd30734816d | [
"MIT"
] | 3 | 2020-05-05T12:12:09.000Z | 2020-05-08T08:48:16.000Z | settings/baker_recipes.py | stanwood/traidoo-api | 83e8599f2eb54352988bac27e2d4acd30734816d | [
"MIT"
] | 160 | 2020-05-19T13:03:43.000Z | 2022-03-12T00:35:28.000Z | settings/baker_recipes.py | stanwood/traidoo-api | 83e8599f2eb54352988bac27e2d4acd30734816d | [
"MIT"
] | null | null | null | from faker import Faker
from model_bakery.recipe import Recipe, foreign_key
from users.baker_recipes import staff_user
fake = Faker()
setting = Recipe(
"settings.Setting",
central_logistics_company=True,
platform_user=foreign_key(staff_user),
deposit_vat=19,
mc_swiss_delivery_fee_vat=19,
)
glob... | 21.888889 | 77 | 0.763959 | from faker import Faker
from model_bakery.recipe import Recipe, foreign_key
from users.baker_recipes import staff_user
fake = Faker()
setting = Recipe(
"settings.Setting",
central_logistics_company=True,
platform_user=foreign_key(staff_user),
deposit_vat=19,
mc_swiss_delivery_fee_vat=19,
)
glob... | true | true |
f756b8582173eda0e850ec29e76ce7394021f4fb | 585 | py | Python | tests/basics/memoryview_itemsize.py | iotctl/pycopy | eeb841afea61b19800d054b3b289729665fc9aa4 | [
"MIT"
] | 663 | 2018-12-30T00:17:59.000Z | 2022-03-14T05:03:41.000Z | tests/basics/memoryview_itemsize.py | iotctl/pycopy | eeb841afea61b19800d054b3b289729665fc9aa4 | [
"MIT"
] | 41 | 2019-06-06T08:31:19.000Z | 2022-02-13T16:53:41.000Z | tests/basics/memoryview_itemsize.py | iotctl/pycopy | eeb841afea61b19800d054b3b289729665fc9aa4 | [
"MIT"
] | 60 | 2019-06-01T04:25:00.000Z | 2022-02-25T01:47:31.000Z | try:
from uarray import array
except ImportError:
try:
from array import array
except ImportError:
print("SKIP")
raise SystemExit
try:
memoryview(b'a').itemsize
except:
print("SKIP")
raise SystemExit
for code in ['b', 'h', 'i', 'q', 'f', 'd']:
print(memoryview(array... | 21.666667 | 54 | 0.652991 | try:
from uarray import array
except ImportError:
try:
from array import array
except ImportError:
print("SKIP")
raise SystemExit
try:
memoryview(b'a').itemsize
except:
print("SKIP")
raise SystemExit
for code in ['b', 'h', 'i', 'q', 'f', 'd']:
print(memoryview(array... | true | true |
f756b87a4e1e09254d4f9264eef7bc26340982bf | 389 | py | Python | tests/test_dbobject.py | pyinv/ymldb | 4a9d3c027ed08fdb30fcdf7424f732716eb034e8 | [
"MIT"
] | 1 | 2021-08-16T02:28:27.000Z | 2021-08-16T02:28:27.000Z | tests/test_dbobject.py | pyinv/ymldb | 4a9d3c027ed08fdb30fcdf7424f732716eb034e8 | [
"MIT"
] | null | null | null | tests/test_dbobject.py | pyinv/ymldb | 4a9d3c027ed08fdb30fcdf7424f732716eb034e8 | [
"MIT"
] | null | null | null | """Test that DBObject works as expected."""
from ymldb.dbobject import DBObject
from ymldb.location import Location
def test_dbobject_instantiation() -> None:
"""Test that we can create a DB Object."""
dbo = DBObject(raw_data={}, location=Location(container=[], name=""))
assert dbo.raw_data == {}
as... | 27.785714 | 73 | 0.686375 |
from ymldb.dbobject import DBObject
from ymldb.location import Location
def test_dbobject_instantiation() -> None:
dbo = DBObject(raw_data={}, location=Location(container=[], name=""))
assert dbo.raw_data == {}
assert dbo.location.name == ""
assert dbo.location.container == []
| true | true |
f756b92f495ce97296628b504385d59b12ad224f | 820 | py | Python | setup.py | bollwyvl/es6-widget-example | 0d9d93a8fe663600c2e3627e310a9f99b34af1e3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bollwyvl/es6-widget-example | 0d9d93a8fe663600c2e3627e310a9f99b34af1e3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bollwyvl/es6-widget-example | 0d9d93a8fe663600c2e3627e310a9f99b34af1e3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
# should be loaded below
__version__ = None
with open('es6widgetexample/_version.py') as version:
exec(version.read())
setup(
name="es6widgetexample",
version=__version__,
description="An evolving approach to creating a Jupyt... | 29.285714 | 86 | 0.658537 |
from setuptools import setup
__version__ = None
with open('es6widgetexample/_version.py') as version:
exec(version.read())
setup(
name="es6widgetexample",
version=__version__,
description="An evolving approach to creating a Jupyter widget with ES6 classes.",
author="Nicholas Bollweg",
aut... | true | true |
f756b9dac6c901e5b59eb81bdefb465c2d658360 | 745 | py | Python | vectors/cryptography_vectors/__about__.py | graingert/cryptography | 39a8385d58dc22fa5f0c7efff712ec12c0e2783a | [
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | vectors/cryptography_vectors/__about__.py | graingert/cryptography | 39a8385d58dc22fa5f0c7efff712ec12c0e2783a | [
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | vectors/cryptography_vectors/__about__.py | graingert/cryptography | 39a8385d58dc22fa5f0c7efff712ec12c0e2783a | [
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__... | 31.041667 | 79 | 0.751678 |
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "cryptography_vectors"
__summary__ = "Test vectors for the cryptography package."
__uri__ = "https://... | true | true |
f756b9eb1121a3beaad3fdecece9ddd318a4e69b | 1,044 | py | Python | H2H/User/admin.py | saefty/happy2help_backend | da4bbd8d18a122ec87fc9ebc655864f3789fd8a7 | [
"MIT"
] | null | null | null | H2H/User/admin.py | saefty/happy2help_backend | da4bbd8d18a122ec87fc9ebc655864f3789fd8a7 | [
"MIT"
] | 3 | 2020-02-11T23:35:05.000Z | 2021-06-10T21:05:39.000Z | H2H/User/admin.py | saefty/happy2help_backend | da4bbd8d18a122ec87fc9ebc655864f3789fd8a7 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from .models import Profile, HasSkill, Skill, Favourite
class ProfileInline(admin.StackedInline):
model = Profile
can_delete = False
... | 20.076923 | 64 | 0.75 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from .models import Profile, HasSkill, Skill, Favourite
class ProfileInline(admin.StackedInline):
model = Profile
can_delete = False
fields = ('birthday', 'credi... | true | true |
f756ba17189749f1d07459482322fb7dfa666727 | 5,508 | py | Python | src/cpu/StaticInstFlags.py | MRuan0306/gem5 | fa70478413e4650d0058cbfe81fd5ce362101994 | [
"BSD-3-Clause"
] | 16 | 2020-09-24T00:17:36.000Z | 2021-08-12T06:11:52.000Z | src/cpu/StaticInstFlags.py | MRuan0306/gem5 | fa70478413e4650d0058cbfe81fd5ce362101994 | [
"BSD-3-Clause"
] | 5 | 2021-01-27T23:09:06.000Z | 2022-01-07T03:19:39.000Z | src/cpu/StaticInstFlags.py | MRuan0306/gem5 | fa70478413e4650d0058cbfe81fd5ce362101994 | [
"BSD-3-Clause"
] | 15 | 2020-11-18T00:15:28.000Z | 2021-12-12T03:18:34.000Z | # Copyright (c) 2003-2005 The Regents of The University of Michigan
# Copyright (c) 2013 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source co... | 48.315789 | 77 | 0.674292 |
from m5.params import *
# behavior into the pipeline outside of fetch. Once we go to an exec-in-exec
# CPU model we should be able to get rid of these flags and implement this
# behavior via the execute() methods.
class StaticInstFlags(Enum):
wrapper_name = 'StaticInstFla... | true | true |
f756ba5f0c458dd71d5902b634a72d4c93345ab5 | 25,667 | py | Python | wwt_data_formats/__init__.py | imbasimba/wwt_data_formats | b8bb0b0643295bc00c97e5c6081f88cef5449e22 | [
"MIT"
] | null | null | null | wwt_data_formats/__init__.py | imbasimba/wwt_data_formats | b8bb0b0643295bc00c97e5c6081f88cef5449e22 | [
"MIT"
] | null | null | null | wwt_data_formats/__init__.py | imbasimba/wwt_data_formats | b8bb0b0643295bc00c97e5c6081f88cef5449e22 | [
"MIT"
] | null | null | null | # -*- mode: python; coding: utf-8 -*-
# Copyright 2019-2020 the .NET Foundation
# Licensed under the MIT License.
from __future__ import absolute_import, division, print_function
__all__ = """
indent_xml
LockedDownTraits
LockedXmlTraits
MetaLockedDownTraits
stringify_xml_doc
write_xml_doc
XmlSer
""".split()
from abc... | 34.041114 | 99 | 0.576655 |
from __future__ import absolute_import, division, print_function
__all__ = """
indent_xml
LockedDownTraits
LockedXmlTraits
MetaLockedDownTraits
stringify_xml_doc
write_xml_doc
XmlSer
""".split()
from abc import ABCMeta
from argparse import Namespace
from enum import Enum
from traitlets import (
Bool,
Floa... | true | true |
f756bbacaa6d6abc1b3907e5a1b9aba7c7ab3816 | 7,781 | py | Python | main.py | Tuppuraine/Moneyrobot | d7210acd384e869d8a04761937aaf16d65bb48f1 | [
"Apache-2.0"
] | null | null | null | main.py | Tuppuraine/Moneyrobot | d7210acd384e869d8a04761937aaf16d65bb48f1 | [
"Apache-2.0"
] | 3 | 2021-12-12T12:24:33.000Z | 2021-12-13T18:28:28.000Z | main.py | Tuppuraine/Moneyrobot | d7210acd384e869d8a04761937aaf16d65bb48f1 | [
"Apache-2.0"
] | 1 | 2021-12-13T20:42:15.000Z | 2021-12-13T20:42:15.000Z | # TEE PELI TÄHÄN
import pygame
import random
class Moneyrobot():
def __init__(self):
pygame.init()
self.lataa_kuvat()
self.taso = 0
self.kolikot = 0
self.korkeus = 640
self.leveys = 640
self.peli_ohi = False
self.kello = pygame.time.Clock()
s... | 42.059459 | 212 | 0.589898 |
import pygame
import random
class Moneyrobot():
def __init__(self):
pygame.init()
self.lataa_kuvat()
self.taso = 0
self.kolikot = 0
self.korkeus = 640
self.leveys = 640
self.peli_ohi = False
self.kello = pygame.time.Clock()
self.vasemmalle =... | true | true |
f756bc8d61c247848a7abd8a2a5303e269ccd697 | 308 | py | Python | src/2/2941.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 11 | 2020-09-20T15:17:11.000Z | 2022-03-17T12:43:33.000Z | src/2/2941.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 3 | 2021-10-30T07:51:36.000Z | 2022-03-09T05:19:23.000Z | src/2/2941.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 13 | 2021-01-21T03:19:08.000Z | 2022-03-28T10:44:58.000Z | """
2941. 크로아티아 알파벳
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 80 ms
해결 날짜: 2020년 9월 23일
"""
def main():
croatian = ['c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z=']
s = input()
for c in croatian:
s = s.replace(c, '.')
print(len(s))
if __name__ == '__main__':
main() | 14.666667 | 64 | 0.496753 |
def main():
croatian = ['c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z=']
s = input()
for c in croatian:
s = s.replace(c, '.')
print(len(s))
if __name__ == '__main__':
main() | true | true |
f756beaf4e0b74cbdef887843da1e30a6d960991 | 108,750 | py | Python | pysnmp-with-texts/EPPC-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/EPPC-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/EPPC-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module EPPC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EPPC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:05:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:1... | 143.469657 | 12,570 | 0.792809 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuild... | true | true |
f756bf52c7d86eb7a3c475621cea7f31e695b22d | 4,946 | py | Python | online_annotation_system/views.py | hitchhicker/Online-Annotation-System | df3120cfaf716b8022c76381dc025224fbf67871 | [
"MIT"
] | null | null | null | online_annotation_system/views.py | hitchhicker/Online-Annotation-System | df3120cfaf716b8022c76381dc025224fbf67871 | [
"MIT"
] | null | null | null | online_annotation_system/views.py | hitchhicker/Online-Annotation-System | df3120cfaf716b8022c76381dc025224fbf67871 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import os
import logging
from collections import defaultdict
from flask import render_template, jsonify, request, current_app, redirect, session
from flask_login import login_user, logout_user, login_required, current_user
from flask_principal import Identity, identity_changed, An... | 39.887097 | 134 | 0.685605 |
import base64
import os
import logging
from collections import defaultdict
from flask import render_template, jsonify, request, current_app, redirect, session
from flask_login import login_user, logout_user, login_required, current_user
from flask_principal import Identity, identity_changed, AnonymousIdentity
from w... | true | true |
f756bf9e72a6838f55cdfbffd52d193ba7611adb | 944 | py | Python | tests/fizz_buzz_test.py | Thavarshan/python-code-katas | 496d9224bbef3ee83a0e94f3a27b8e03159f84c5 | [
"MIT"
] | 14 | 2020-08-03T05:29:13.000Z | 2021-08-07T09:53:18.000Z | tests/fizz_buzz_test.py | Thavarshan/python-code-katas | 496d9224bbef3ee83a0e94f3a27b8e03159f84c5 | [
"MIT"
] | null | null | null | tests/fizz_buzz_test.py | Thavarshan/python-code-katas | 496d9224bbef3ee83a0e94f3a27b8e03159f84c5 | [
"MIT"
] | null | null | null | from src.katas import fizz_buzz
import unittest
class FizzBuzzTest(unittest.TestCase):
def test_it_return_fizz_for_multiples_of_three(self):
converter = fizz_buzz.FizzBuzz()
for number in [3, 6, 9, 12]:
self.assertEqual('Fizz', converter.convert(number))
def test_it_return_buzz_... | 31.466667 | 84 | 0.689619 | from src.katas import fizz_buzz
import unittest
class FizzBuzzTest(unittest.TestCase):
def test_it_return_fizz_for_multiples_of_three(self):
converter = fizz_buzz.FizzBuzz()
for number in [3, 6, 9, 12]:
self.assertEqual('Fizz', converter.convert(number))
def test_it_return_buzz_... | true | true |
f756c17c84e31a15367460638e609fa7f084c7b3 | 1,944 | py | Python | venv/lib/python3.9/site-packages/streamlit/proto/Favicon_pb2.py | CMU-IDS-2022/final-project-the-evaluators | 3b9262ad1a0f7315208a94a05ea1ce38e679d01d | [
"BSD-3-Clause"
] | 1 | 2022-01-17T02:58:50.000Z | 2022-01-17T02:58:50.000Z | venv/lib/python3.9/site-packages/streamlit/proto/Favicon_pb2.py | CMU-IDS-2022/final-project-the-evaluators | 3b9262ad1a0f7315208a94a05ea1ce38e679d01d | [
"BSD-3-Clause"
] | null | null | null | venv/lib/python3.9/site-packages/streamlit/proto/Favicon_pb2.py | CMU-IDS-2022/final-project-the-evaluators | 3b9262ad1a0f7315208a94a05ea1ce38e679d01d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: streamlit/proto/Favicon.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_datab... | 27.380282 | 123 | 0.755658 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='stre... | true | true |
f756c38a2b2ceba143c97fd684c53985837ee62d | 1,789 | py | Python | azure/servicefabric/models/replica_health_state.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/servicefabric/models/replica_health_state.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure/servicefabric/models/replica_health_state.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 37.270833 | 125 | 0.645612 |
from .entity_health_state import EntityHealthState
class ReplicaHealthState(EntityHealthState):
_validation = {
'service_kind': {'required': True},
}
_attribute_map = {
'aggregated_health_state': {'key': 'AggregatedHealthState', 'type': 'str'},
'partition_id': {'key': ... | true | true |
f756c42212d52d37328e60aeda3bdd317d85d6a1 | 19 | py | Python | datumaro/version.py | samrathkumawat1/cvat-json-dataumaro | 02e225814aecd54204ec14d6207d2655ff5f6f55 | [
"MIT"
] | null | null | null | datumaro/version.py | samrathkumawat1/cvat-json-dataumaro | 02e225814aecd54204ec14d6207d2655ff5f6f55 | [
"MIT"
] | null | null | null | datumaro/version.py | samrathkumawat1/cvat-json-dataumaro | 02e225814aecd54204ec14d6207d2655ff5f6f55 | [
"MIT"
] | null | null | null | VERSION = '0.1.6.1' | 19 | 19 | 0.578947 | VERSION = '0.1.6.1' | true | true |
f756c47cf3d0056b05b80bcae1d00637be07df89 | 10,872 | py | Python | sdk/python/pulumi_aws_native/panorama/package_version.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/panorama/package_version.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/panorama/package_version.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 41.026415 | 134 | 0.656733 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from ._enums import *
__all__ = ['PackageVersionArgs', 'PackageVersion']
@pulumi.input_type
class PackageVersionArgs:
def __init__(__self__, *,
pa... | true | true |
f756c4ebd6089fcee705263e140d7a6a8ec110a6 | 2,206 | py | Python | examples/cdl_example.py | binhtrantt/cornac | 2333e2463b1be5568a1c2da43d01401999f2dd3c | [
"Apache-2.0"
] | null | null | null | examples/cdl_example.py | binhtrantt/cornac | 2333e2463b1be5568a1c2da43d01401999f2dd3c | [
"Apache-2.0"
] | null | null | null | examples/cdl_example.py | binhtrantt/cornac | 2333e2463b1be5568a1c2da43d01401999f2dd3c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cornac Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 32.925373 | 111 | 0.733908 |
import cornac
from cornac.data import Reader
from cornac.datasets import citeulike
from cornac.eval_methods import RatioSplit
from cornac.data import TextModality
from cornac.data.text import BaseTokenizer
docs, item_ids = citeulike.load_text()
feedback = citeulike.load_feedback(reader=Reader(item_se... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.