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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7544f0c5f85a8bcc058a5c6cd72f1f35e3b7b30 | 4,551 | py | Python | ENV/lib/python3.6/site-packages/pyramid/paster.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | ENV/lib/python3.6/site-packages/pyramid/paster.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | ENV/lib/python3.6/site-packages/pyramid/paster.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | from pyramid.scripting import prepare
from pyramid.scripts.common import get_config_loader
def setup_logging(config_uri, global_conf=None):
"""
Set up Python logging with the filename specified via ``config_uri``
(a string in the form ``filename#sectionname``).
Extra defaults can optionally be specifi... | 40.633929 | 79 | 0.698528 | from pyramid.scripting import prepare
from pyramid.scripts.common import get_config_loader
def setup_logging(config_uri, global_conf=None):
loader = get_config_loader(config_uri)
loader.setup_logging(global_conf)
def get_app(config_uri, name=None, options=None):
loader = get_config_loader(config_uri)
... | true | true |
f7544fe1e35f0d42ae6be50aac482836c4abef11 | 1,021 | py | Python | tests/universal_functions_tests/true_divide_tests/broadcast.py | manopapad/legate.numpy | 896f4fd9b32db445da6cdabf7b78d523fca96936 | [
"Apache-2.0"
] | null | null | null | tests/universal_functions_tests/true_divide_tests/broadcast.py | manopapad/legate.numpy | 896f4fd9b32db445da6cdabf7b78d523fca96936 | [
"Apache-2.0"
] | null | null | null | tests/universal_functions_tests/true_divide_tests/broadcast.py | manopapad/legate.numpy | 896f4fd9b32db445da6cdabf7b78d523fca96936 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 26.179487 | 74 | 0.716944 |
import random
import numpy as np
import legate.numpy as lg
def test():
anp = np.random.randn(4, 5)
b = random.randint(1, 13)
a = lg.array(anp)
assert np.array_equal(lg.true_divide(a, b), np.true_divide(anp, b))
assert np.array_equal(lg.true_divide(b, a), np.true_divide... | true | true |
f7545139f8aa8a4049960100adf00482c131a711 | 3,832 | py | Python | Monty Hall/Monty Hall.py | 1218muskan/Python-mini-Projects | 726ac5604ced777d3bafa88fe03efb5fe113b599 | [
"MIT"
] | null | null | null | Monty Hall/Monty Hall.py | 1218muskan/Python-mini-Projects | 726ac5604ced777d3bafa88fe03efb5fe113b599 | [
"MIT"
] | null | null | null | Monty Hall/Monty Hall.py | 1218muskan/Python-mini-Projects | 726ac5604ced777d3bafa88fe03efb5fe113b599 | [
"MIT"
] | null | null | null | import random
import sys
# Ascii art - made of ascii characters
ALL_CLOSED = """
+------+ +------+ +------+
| | | | | |
| 1 | | 2 | | 3 |
| | | | | |
| | | | | |
| | | | | |
+------+ +------+ +------+"""
FIRST_GOAT = """
+------+ +-... | 24.253165 | 88 | 0.411795 | import random
import sys
ALL_CLOSED = """
+------+ +------+ +------+
| | | | | |
| 1 | | 2 | | 3 |
| | | | | |
| | | | | |
| | | | | |
+------+ +------+ +------+"""
FIRST_GOAT = """
+------+ +------+ +------+
| (( | | | |... | true | true |
f75453004f1e13abfdb09cd70d0534e93749c122 | 18,871 | py | Python | psi/context/plugin.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 2 | 2020-07-10T07:49:52.000Z | 2020-11-15T13:20:52.000Z | psi/context/plugin.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 1 | 2020-04-20T20:37:48.000Z | 2020-04-20T20:37:48.000Z | psi/context/plugin.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 3 | 2020-04-17T15:03:36.000Z | 2022-01-14T23:19:29.000Z | import logging
log = logging.getLogger(__name__)
import pickle as pickle
from copy import deepcopy
import numpy as np
from atom.api import Typed, Bool, Str, observe, Property
from enaml.application import deferred_call
from enaml.layout.api import InsertItem, InsertTab
from enaml.workbench.plugin import P... | 38.27789 | 93 | 0.622066 | import logging
log = logging.getLogger(__name__)
import pickle as pickle
from copy import deepcopy
import numpy as np
from atom.api import Typed, Bool, Str, observe, Property
from enaml.application import deferred_call
from enaml.layout.api import InsertItem, InsertTab
from enaml.workbench.plugin import P... | true | true |
f7545327792a3d76aca986324a1914e3c3f840b5 | 1,110 | py | Python | unplugged/services/admin/views/scheduler.py | fakegit/unplugged | 755227a5319ea443c3d8f1356380981430c80419 | [
"MIT"
] | 2 | 2019-07-17T15:45:25.000Z | 2021-08-10T18:27:43.000Z | unplugged/services/admin/views/scheduler.py | fakegit/unplugged | 755227a5319ea443c3d8f1356380981430c80419 | [
"MIT"
] | null | null | null | unplugged/services/admin/views/scheduler.py | fakegit/unplugged | 755227a5319ea443c3d8f1356380981430c80419 | [
"MIT"
] | 1 | 2019-11-23T08:30:40.000Z | 2019-11-23T08:30:40.000Z | from rest_framework import permissions, serializers, viewsets
from ....models import FailedToParseScheduleException, Schedule, parse_schedule_trigger
from .shared import ADMIN_RENDERER_CLASSES
class ScheduleSerializer(serializers.HyperlinkedModelSerializer):
plugin_id = serializers.IntegerField()
kwargs = se... | 30 | 87 | 0.723423 | from rest_framework import permissions, serializers, viewsets
from ....models import FailedToParseScheduleException, Schedule, parse_schedule_trigger
from .shared import ADMIN_RENDERER_CLASSES
class ScheduleSerializer(serializers.HyperlinkedModelSerializer):
plugin_id = serializers.IntegerField()
kwargs = se... | true | true |
f7545396270a77f42d1a95e8973344065f2ab681 | 55,275 | py | Python | sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.606436 | 135 | 0.664731 |
import functools
from copy import deepcopy
from typing import TYPE_CHECKING, Dict, Any, Union, cast, Mapping
from xml.etree.ElementTree import ElementTree
from azure.core.paging import ItemPaged
from azure.core.exceptions import ResourceNotFoundError
from azure.core.pipeline import Pipeline
from azure.core.pipe... | true | true |
f75453a7f3b4a0223035ecc8e49c01041eeeb289 | 7,759 | py | Python | ggshield/utils.py | GitGuardian/gg-shield | f3c480ec9726151855498112427bad5565b9c2f6 | [
"MIT"
] | 794 | 2020-06-23T12:37:36.000Z | 2021-07-09T15:58:11.000Z | ggshield/utils.py | GitGuardian/gg-shield | f3c480ec9726151855498112427bad5565b9c2f6 | [
"MIT"
] | 46 | 2020-06-27T18:13:41.000Z | 2021-07-12T10:49:00.000Z | ggshield/utils.py | GitGuardian/gg-shield | f3c480ec9726151855498112427bad5565b9c2f6 | [
"MIT"
] | 42 | 2020-06-28T08:31:15.000Z | 2021-07-09T15:58:14.000Z | import os
import re
import traceback
from enum import Enum
from typing import Iterable, List, Optional
import click
import urllib3
from pygitguardian import GGClient
from pygitguardian.models import Match
from requests import Session
from .text_utils import Line, LineCategory
REGEX_PATCH_HEADER = re.compile(
r"... | 28.630996 | 99 | 0.601624 | import os
import re
import traceback
from enum import Enum
from typing import Iterable, List, Optional
import click
import urllib3
from pygitguardian import GGClient
from pygitguardian.models import Match
from requests import Session
from .text_utils import Line, LineCategory
REGEX_PATCH_HEADER = re.compile(
r"... | true | true |
f754550f95d57ccf52957450c8bf23ef74b5db3d | 11,089 | py | Python | dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_platform.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 2,209 | 2016-11-20T10:32:58.000Z | 2022-03-31T20:51:27.000Z | dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_platform.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,074 | 2016-12-07T05:02:48.000Z | 2022-03-22T02:09:11.000Z | dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_platform.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 147 | 2016-12-11T04:13:28.000Z | 2022-03-27T14:50:00.000Z | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self): # issue3762
de... | 39.045775 | 113 | 0.518802 | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self):
def get(pytho... | true | true |
f754555bc986b02847e530d99d54c978f834e444 | 117 | py | Python | wafw00f/plugins/wallarm.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | 10 | 2015-08-31T10:38:24.000Z | 2021-09-30T06:39:13.000Z | wafw00f/plugins/wallarm.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | null | null | null | wafw00f/plugins/wallarm.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | 17 | 2015-07-24T20:40:23.000Z | 2021-01-08T19:41:18.000Z | #!/usr/bin/env python
NAME = 'Wallarm'
def is_waf(self):
return self.matchheader(('server', "nginx-wallarm"))
| 14.625 | 56 | 0.666667 |
NAME = 'Wallarm'
def is_waf(self):
return self.matchheader(('server', "nginx-wallarm"))
| true | true |
f7545569a2a5def0e1b180e52ae8eb829ba7cd54 | 366 | py | Python | src/package_controller/library/utils/git/format_commit_description.py | alexseitsinger/package_controller | 0ee896986cfa17a96bf9fb6afff35dd97f0b1211 | [
"BSD-2-Clause"
] | 2 | 2020-11-24T14:16:38.000Z | 2021-03-16T19:29:45.000Z | src/package_controller/library/utils/git/format_commit_description.py | alexseitsinger/package_controller | 0ee896986cfa17a96bf9fb6afff35dd97f0b1211 | [
"BSD-2-Clause"
] | 2 | 2020-11-25T01:00:45.000Z | 2020-11-25T01:59:58.000Z | src/package_controller/library/utils/git/format_commit_description.py | alexseitsinger/package_controller | 0ee896986cfa17a96bf9fb6afff35dd97f0b1211 | [
"BSD-2-Clause"
] | null | null | null | import textwrap
import re
from .format_commit_text import format_commit_text
RE_DESCRIPTION_DELIMITER = r"(?![\w\d])\.\s+"
def format_commit_description(description):
text = " ".join([
format_commit_text(x)
for x in re.split(RE_DESCRIPTION_DELIMITER, description)
if len(x)
])
ret... | 21.529412 | 64 | 0.68306 | import textwrap
import re
from .format_commit_text import format_commit_text
RE_DESCRIPTION_DELIMITER = r"(?![\w\d])\.\s+"
def format_commit_description(description):
text = " ".join([
format_commit_text(x)
for x in re.split(RE_DESCRIPTION_DELIMITER, description)
if len(x)
])
ret... | true | true |
f754563318feceac7088b40b3a94be0125581cda | 11,248 | py | Python | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 1 | 2021-06-10T23:59:44.000Z | 2021-06-10T23:59:44.000Z | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 1 | 2021-12-16T05:34:55.000Z | 2021-12-16T05:34:55.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.520548 | 80 | 0.676831 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.distributions.python.ops import distribution
from tensorflow.contrib.distributions.python.ops import distribution_util
from tensorflow.python.framework import ops
from ten... | true | true |
f754567f14c01a86e958e120364d0746992d6385 | 837 | py | Python | test/test_broadcast.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | null | null | null | test/test_broadcast.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | 1 | 2018-09-05T08:51:24.000Z | 2018-09-06T14:56:30.000Z | test/test_broadcast.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
RadioManager
RadioManager # noqa: E501
OpenAPI spec version: 2.0
Contact: support@pluxbox.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import radiomanager_sdk
from radiomanager_sdk.models.b... | 20.414634 | 79 | 0.692951 |
from __future__ import absolute_import
import unittest
import radiomanager_sdk
from radiomanager_sdk.models.broadcast import Broadcast
from radiomanager_sdk.rest import ApiException
class TestBroadcast(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testBr... | true | true |
f754571f9690bc4a3864af091aa06b05827178b6 | 1,524 | py | Python | app.py | Azmal16/Covid_Symptoms_Predict_with_Machine_Learning | d1e1fde73aa307bdbcfeac27088f49e4c1cb4555 | [
"MIT"
] | null | null | null | app.py | Azmal16/Covid_Symptoms_Predict_with_Machine_Learning | d1e1fde73aa307bdbcfeac27088f49e4c1cb4555 | [
"MIT"
] | null | null | null | app.py | Azmal16/Covid_Symptoms_Predict_with_Machine_Learning | d1e1fde73aa307bdbcfeac27088f49e4c1cb4555 | [
"MIT"
] | null | null | null | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['GET', 'POST'])
def predict():
'''
For renderin... | 41.189189 | 299 | 0.71063 | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['GET', 'POST'])
def predict():
int_features = [int(... | true | true |
f7545816d0f4e8c7cd324ed28315f1207c7259b7 | 2,965 | py | Python | qa/rpc-tests/test_framework/coverage.py | frkl/BitSend | aa64f4bfbda7459393b972e4c48f22081db6e233 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/coverage.py | frkl/BitSend | aa64f4bfbda7459393b972e4c48f22081db6e233 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/coverage.py | frkl/BitSend | aa64f4bfbda7459393b972e4c48f22081db6e233 | [
"MIT"
] | 1 | 2018-09-27T14:30:20.000Z | 2018-09-27T14:30:20.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
This module contains utilities for doing coverage analysis on the RPC
interface.
It provides a way t... | 27.71028 | 79 | 0.660708 |
import os
REFERENCE_FILENAME = 'rpc_interface.txt'
class AuthServiceProxyWrapper(object):
def __init__(self, auth_service_proxy_instance, coverage_logfile=None):
self.auth_service_proxy_instance = auth_service_proxy_instance
self.coverage_logfile = coverage_logfile
def __getattr__(self... | true | true |
f7545820e15b6c0f32fd8cbb50f34eca14f63117 | 1,600 | py | Python | nicos_sinq/camea/setups/mono_slit.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_sinq/camea/setups/mono_slit.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_sinq/camea/setups/mono_slit.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | description = 'Monochromator slit devices'
pvmcu = 'SQ:CAMEA:mcu2:'
devices = dict(
mst = device('nicos_ess.devices.epics.motor.EpicsMotor',
description = 'Monochromator slit top',
motorpv = pvmcu + 'mst',
errormsgpv = pvmcu + 'mst-MsgTxt',
precision = 0.02,
),
msb = device... | 32 | 72 | 0.584375 | description = 'Monochromator slit devices'
pvmcu = 'SQ:CAMEA:mcu2:'
devices = dict(
mst = device('nicos_ess.devices.epics.motor.EpicsMotor',
description = 'Monochromator slit top',
motorpv = pvmcu + 'mst',
errormsgpv = pvmcu + 'mst-MsgTxt',
precision = 0.02,
),
msb = device... | true | true |
f7545a3c7f77751719dc4e8c919522c02167474f | 29,384 | py | Python | jinja2/lexer.py | iomintz/jinja | 6b9eb6df5a7804ec4210bf449296aae71eb5cd3e | [
"BSD-3-Clause"
] | null | null | null | jinja2/lexer.py | iomintz/jinja | 6b9eb6df5a7804ec4210bf449296aae71eb5cd3e | [
"BSD-3-Clause"
] | null | null | null | jinja2/lexer.py | iomintz/jinja | 6b9eb6df5a7804ec4210bf449296aae71eb5cd3e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jinja2.lexer
~~~~~~~~~~~~
This module implements a Jinja / Python combination lexer. The
`Lexer` class provided by this module is used to do some preprocessing
for Jinja.
On the one hand it filters out invalid operators like the bitshift
operators we don't allow... | 38.612352 | 85 | 0.529097 |
import re
from ast import literal_eval
from collections import deque
from operator import itemgetter
from jinja2._compat import implements_iterator, intern, iteritems, text_type
from jinja2.exceptions import TemplateSyntaxError
from jinja2.utils import LRUCache
_lexer_cache = LRUCache(50)
whitespace_re = re.comp... | true | true |
f7545c4926f2b7992927d302fa2051000dc6afb1 | 1,272 | py | Python | DQM/DTMonitorClient/python/dtLocalTriggerSynchTest_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | DQM/DTMonitorClient/python/dtLocalTriggerSynchTest_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | DQM/DTMonitorClient/python/dtLocalTriggerSynchTest_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
triggerSynchTest = DQMEDHarvester("DTLocalTriggerSynchTest",
# prescale factor (in luminosity blocks) to perform client analysis
diagnosticPrescale = cms.untracked.int32(1),
# run in online environment
r... | 41.032258 | 100 | 0.664308 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
triggerSynchTest = DQMEDHarvester("DTLocalTriggerSynchTest",
diagnosticPrescale = cms.untracked.int32(1),
runOnline = cms.untracked.bool(True),
hwSources = cms.untracked.vstring('TM'),
... | true | true |
f7545da696637272071c3903ad528c0f4b497d4b | 851 | py | Python | bspump/declarative/expression/string/startswith.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 17 | 2019-02-14T09:26:03.000Z | 2022-03-11T09:23:52.000Z | bspump/declarative/expression/string/startswith.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 91 | 2019-05-06T18:59:02.000Z | 2022-01-11T06:22:32.000Z | bspump/declarative/expression/string/startswith.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 10 | 2019-04-23T08:48:58.000Z | 2022-02-13T14:24:28.000Z | from ...abc import Expression
from ..value.valueexpr import VALUE
class STARTSWITH(Expression):
Attributes = {
"What": ["str"],
"Prefix": ["str"],
}
Category = "String"
def __init__(self, app, *, arg_what, arg_prefix):
super().__init__(app)
if isinstance(arg_what, Expression):
self.What = arg_what... | 19.340909 | 55 | 0.690952 | from ...abc import Expression
from ..value.valueexpr import VALUE
class STARTSWITH(Expression):
Attributes = {
"What": ["str"],
"Prefix": ["str"],
}
Category = "String"
def __init__(self, app, *, arg_what, arg_prefix):
super().__init__(app)
if isinstance(arg_what, Expression):
self.What = arg_what... | true | true |
f7545dc0127aa6b50e531b8ce6e40a28592737bf | 3,196 | py | Python | spider/spider/settings.py | quheng/chalk | 7a52fd4a5c57703af59f7830b6f01be252f7ad0e | [
"MIT"
] | null | null | null | spider/spider/settings.py | quheng/chalk | 7a52fd4a5c57703af59f7830b6f01be252f7ad0e | [
"MIT"
] | null | null | null | spider/spider/settings.py | quheng/chalk | 7a52fd4a5c57703af59f7830b6f01be252f7ad0e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/... | 34.365591 | 109 | 0.775031 |
BOT_NAME = 'spider'
SPIDER_MODULES = ['spider.spiders']
NEWSPIDER_MODULE = 'spider.spiders'
RETRY_HTTP_CODES = [500, 503, 504, 400, 408, 404]
RETRY_TIMES = 5
ROBOTSTXT_OBEY = True
Y = 0.25
| true | true |
f7545e077e1aeaba035185e78b398987bec0b602 | 1,079 | py | Python | bilgisayfam/entry/manifest.py | tayfun/bilgisayfam | f2f9942be53abefc1caf31509553c46957195535 | [
"MIT"
] | 1 | 2016-10-03T19:30:04.000Z | 2016-10-03T19:30:04.000Z | bilgisayfam/entry/manifest.py | tayfun/bilgisayfam | f2f9942be53abefc1caf31509553c46957195535 | [
"MIT"
] | null | null | null | bilgisayfam/entry/manifest.py | tayfun/bilgisayfam | f2f9942be53abefc1caf31509553c46957195535 | [
"MIT"
] | null | null | null | from django.conf import settings
from pipeline import manifest
class StaticManifest(manifest.PipelineManifest):
def cache(self):
if getattr(settings, "PIPELINE_ENABLED", None) or not settings.DEBUG:
for package in self.packages:
if self.pcs:
filename = self... | 30.828571 | 77 | 0.567192 | from django.conf import settings
from pipeline import manifest
class StaticManifest(manifest.PipelineManifest):
def cache(self):
if getattr(settings, "PIPELINE_ENABLED", None) or not settings.DEBUG:
for package in self.packages:
if self.pcs:
filename = self... | true | true |
f7545e4cd8b1aaad73d65a4ca38489f43e3b6b7d | 6,533 | py | Python | neutron/agent/linux/bridge_lib.py | flavio-fernandes/neutron | 4a021306ad53c588dd9f8269124e7b0d49a2c752 | [
"Apache-2.0"
] | 4 | 2015-11-07T01:58:32.000Z | 2019-10-08T06:18:36.000Z | neutron/agent/linux/bridge_lib.py | flavio-fernandes/neutron | 4a021306ad53c588dd9f8269124e7b0d49a2c752 | [
"Apache-2.0"
] | null | null | null | neutron/agent/linux/bridge_lib.py | flavio-fernandes/neutron | 4a021306ad53c588dd9f8269124e7b0d49a2c752 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Intel Corporation.
# Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com>
# <isaku.yamahata at gmail com>
# All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Lic... | 33.502564 | 79 | 0.621154 |
import collections
import functools
import os
from pyroute2.netlink import exceptions as netlink_exceptions
from neutron.agent.linux import ip_lib
from neutron.privileged.agent.linux import ip_lib as priv_ip_lib
# devices are listed here (i.e. when using Xen)
BRIDGE_FS = "/sys/class/net/"
BRIDGE_I... | true | true |
f7545e61b3e6424f15ba7c352e497a128cdbf2b3 | 3,498 | py | Python | sdk/python/gnmi/samples/interface_gnmi_subscribe.py | viardant/ydk-gen | fbe17423d1e71f189a22fd6bd11f969474dfde6a | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-02-10T17:07:04.000Z | 2021-09-13T20:27:11.000Z | sdk/python/gnmi/samples/interface_gnmi_subscribe.py | viardant/ydk-gen | fbe17423d1e71f189a22fd6bd11f969474dfde6a | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2019-06-14T17:52:25.000Z | 2022-01-28T20:48:20.000Z | sdk/python/gnmi/samples/interface_gnmi_subscribe.py | viardant/ydk-gen | fbe17423d1e71f189a22fd6bd11f969474dfde6a | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2021-09-28T15:13:51.000Z | 2022-03-19T18:15:33.000Z | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... | 33 | 127 | 0.670669 |
from argparse import ArgumentParser
from urllib.parse import urlparse
from multiprocessing import Pool
import logging
from ydk.path import Repository
from ydk.filters import YFilter
from ydk.gnmi.providers import gNMIServiceProvider
from ydk.gnmi.services import gNMIService, gNMISubscription
from yd... | true | true |
f7545e86356efed4599d9c4051b6c466fc54cf00 | 3,240 | py | Python | lib/actions/sysprep.py | jakerogerz/glazier | 10ee390e79c5fe65933a2699da851e27c03f8c60 | [
"Apache-2.0"
] | null | null | null | lib/actions/sysprep.py | jakerogerz/glazier | 10ee390e79c5fe65933a2699da851e27c03f8c60 | [
"Apache-2.0"
] | null | null | null | lib/actions/sysprep.py | jakerogerz/glazier | 10ee390e79c5fe65933a2699da851e27c03f8c60 | [
"Apache-2.0"
] | 1 | 2019-11-25T10:56:20.000Z | 2019-11-25T10:56:20.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 36 | 80 | 0.652469 |
import logging
import re
from glazier.lib import timezone
from glazier.lib.actions.base import ActionError
from glazier.lib.actions.base import BaseAction
from gwinpy.net import dhcp
class SetUnattendTimeZone(BaseAction):
def _EditUnattend(self,
zone,
unattend... | true | true |
f7545eb46c00dbc8a2bd00cfa30a6f5ae58861ce | 1,982 | py | Python | models.py | rawheel/My_Unfollowers | fd8d72224e2e69b252d45cf4d6c1f81517cd6997 | [
"MIT"
] | 2 | 2021-02-16T22:51:48.000Z | 2021-03-18T10:21:40.000Z | models.py | rawheel/My_Unfollowers | fd8d72224e2e69b252d45cf4d6c1f81517cd6997 | [
"MIT"
] | null | null | null | models.py | rawheel/My_Unfollowers | fd8d72224e2e69b252d45cf4d6c1f81517cd6997 | [
"MIT"
] | null | null | null | import sqlite3
class myunfollowersdb:
def __init__(self):
self.connection = sqlite3.connect('database/myunfollowers.db')
self.cursor = self.connection.cursor()
def createTables(self):
self.cursor.execute("""CREATE TABLE "users" (
"userId" INTEGER NOT NULL,
... | 38.862745 | 154 | 0.601917 | import sqlite3
class myunfollowersdb:
def __init__(self):
self.connection = sqlite3.connect('database/myunfollowers.db')
self.cursor = self.connection.cursor()
def createTables(self):
self.cursor.execute("""CREATE TABLE "users" (
"userId" INTEGER NOT NULL,
... | true | true |
f7546042196d6b9b43414fee14f79a8860d287d2 | 10,537 | py | Python | ansible/roles/test/files/ptftests/ip_in_ip_tunnel_test.py | StormLiangMS/sonic-mgmt | bc592ffe6aa26ac838a60ed1e0604d9482aff0a7 | [
"Apache-2.0"
] | null | null | null | ansible/roles/test/files/ptftests/ip_in_ip_tunnel_test.py | StormLiangMS/sonic-mgmt | bc592ffe6aa26ac838a60ed1e0604d9482aff0a7 | [
"Apache-2.0"
] | null | null | null | ansible/roles/test/files/ptftests/ip_in_ip_tunnel_test.py | StormLiangMS/sonic-mgmt | bc592ffe6aa26ac838a60ed1e0604d9482aff0a7 | [
"Apache-2.0"
] | null | null | null | '''
Description: This file contains the IPinIP test for dualtor testbed
Usage: Examples of how to start this script
/usr/bin/ptf --test-dir ptftests ip_in_ip_tunnel_test.IpinIPTunnelTest --platform-dir ptftests --qlen=2000 --platform remote -t hash_key_list=['src-port', 'dst-port', 'src-mac... | 45.029915 | 563 | 0.603967 |
import logging
import random
from ipaddress import ip_address, IPv4Address
import ptf
from scapy.all import IP, IPv6, Ether
import ptf.packet as scapy
from ptf.base_tests import BaseTest
from ptf.mask import Mask
from ptf.testutils import *
PACKET_NUM = 10000
PACKET_NUM_FOR_NEGATIVE_CHECK = 100
DIFF = 0.25
SRC_... | true | true |
f7546057786c045b443bc411a87db6e1401ea8d1 | 3,239 | py | Python | devopsdjango/devopsdjango/settings.py | idylicaro/DevOps-django-study-case | ffd1d60e4774cdcb787adcf088871c93d47149ae | [
"MIT"
] | null | null | null | devopsdjango/devopsdjango/settings.py | idylicaro/DevOps-django-study-case | ffd1d60e4774cdcb787adcf088871c93d47149ae | [
"MIT"
] | null | null | null | devopsdjango/devopsdjango/settings.py | idylicaro/DevOps-django-study-case | ffd1d60e4774cdcb787adcf088871c93d47149ae | [
"MIT"
] | null | null | null | """
Django settings for devopsdjango project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from pa... | 26.120968 | 91 | 0.703921 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-tdr%xk!#2buvq78&n%0dfsp&u&n$ovg45kq3c%kgubatih(b7c'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
f7546090f063ba115fdb36ca96ecb0b1ae92a6a1 | 2,520 | py | Python | meiduo/meiduo/apps/verifications/views.py | Archer1314/MeiDuo_store | 50825e82aca3b82cd5354cd8a77d793cf32cfbcf | [
"MIT"
] | null | null | null | meiduo/meiduo/apps/verifications/views.py | Archer1314/MeiDuo_store | 50825e82aca3b82cd5354cd8a77d793cf32cfbcf | [
"MIT"
] | null | null | null | meiduo/meiduo/apps/verifications/views.py | Archer1314/MeiDuo_store | 50825e82aca3b82cd5354cd8a77d793cf32cfbcf | [
"MIT"
] | null | null | null | from django import http
from django.shortcuts import render
from meiduo.libs.captcha.captcha import captcha
# Create your views here.
from django.views.generic.base import View
from django_redis import get_redis_connection
from meiduo.utils.response_code import RETCODE
from random import randint
# from meiduo.libs.yunt... | 32.727273 | 99 | 0.669444 | from django import http
from django.shortcuts import render
from meiduo.libs.captcha.captcha import captcha
from django.views.generic.base import View
from django_redis import get_redis_connection
from meiduo.utils.response_code import RETCODE
from random import randint
import logging
from .constans import Constans
f... | true | true |
f75461beea573e4de5a72b2c5ccaf6d2f2f89cc8 | 184 | py | Python | tests/core/tests/manual_urls.py | pavanv/django-tastypie | b4ffc642aa56d25d3c577ccae0a03c820b71c4bc | [
"BSD-3-Clause"
] | 1,570 | 2015-02-03T10:19:33.000Z | 2022-03-29T10:34:18.000Z | tests/core/tests/manual_urls.py | pavanv/django-tastypie | b4ffc642aa56d25d3c577ccae0a03c820b71c4bc | [
"BSD-3-Clause"
] | 587 | 2015-02-06T13:59:23.000Z | 2022-03-09T22:56:30.000Z | tests/core/tests/manual_urls.py | pavanv/django-tastypie | b4ffc642aa56d25d3c577ccae0a03c820b71c4bc | [
"BSD-3-Clause"
] | 492 | 2015-02-07T06:18:36.000Z | 2022-03-29T19:06:44.000Z | from django.conf.urls import include, url
from core.tests.resources import NoteResource
note_resource = NoteResource()
urlpatterns = [
url(r'^', include(note_resource.urls)),
]
| 18.4 | 45 | 0.75 | from django.conf.urls import include, url
from core.tests.resources import NoteResource
note_resource = NoteResource()
urlpatterns = [
url(r'^', include(note_resource.urls)),
]
| true | true |
f75462cc6762847d893280e77ddc702e083c5fc7 | 1,862 | py | Python | tfx/utils/channel.py | yongsheng268/tfx | 6283fffb3ac81e2f213b4895fbe19623dfa9c4f5 | [
"Apache-2.0"
] | null | null | null | tfx/utils/channel.py | yongsheng268/tfx | 6283fffb3ac81e2f213b4895fbe19623dfa9c4f5 | [
"Apache-2.0"
] | null | null | null | tfx/utils/channel.py | yongsheng268/tfx | 6283fffb3ac81e2f213b4895fbe19623dfa9c4f5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. 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 law or a... | 36.509804 | 92 | 0.75188 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from typing import Dict, Iterable, List, Union, Text
from tensorflow.python.util import deprecation
from tfx import types
from tfx.types import channel_utils
@deprecation.deprecated(
None,... | true | true |
f7546364aa146d729cb8fd1cae565084e05c8ba3 | 26,533 | py | Python | pirates/leveleditor/worldData/A_GyedoVegasIsland.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/leveleditor/worldData/A_GyedoVegasIsland.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/leveleditor/worldData/A_GyedoVegasIsland.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import Point3, VBase3, Vec4, Vec3
objectStruct = {'Objects': {'1149705583.09Shochet': {'Type': 'Island','Name': 'VegasIsland','File': '','Environment': 'Interior','Minimap': False,'Objects': {'1149705605.5Shochet': {'Type': 'Locator Node','Name': 'portal_exterior_1','Hpr': VBase3(-18.331, 0.0, ... | 8,844.333333 | 26,324 | 0.659368 | from pandac.PandaModules import Point3, VBase3, Vec4, Vec3
objectStruct = {'Objects': {'1149705583.09Shochet': {'Type': 'Island','Name': 'VegasIsland','File': '','Environment': 'Interior','Minimap': False,'Objects': {'1149705605.5Shochet': {'Type': 'Locator Node','Name': 'portal_exterior_1','Hpr': VBase3(-18.331, 0.0, ... | true | true |
f75464eb2417f6921fea4d5a54f290d39a0d63db | 57,997 | py | Python | xls/dslx/ir_converter_test.py | AdrianaDJ/xls | c6672aec22a13a5761a8cd29968bf317177b95b7 | [
"Apache-2.0"
] | null | null | null | xls/dslx/ir_converter_test.py | AdrianaDJ/xls | c6672aec22a13a5761a8cd29968bf317177b95b7 | [
"Apache-2.0"
] | null | null | null | xls/dslx/ir_converter_test.py | AdrianaDJ/xls | c6672aec22a13a5761a8cd29968bf317177b95b7 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
#
# Copyright 2020 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 35.889233 | 177 | 0.580409 |
import subprocess
import sys
import textwrap
from typing import Text
from xls.common import runfiles
from xls.common import test_base
from xls.dslx import fakefs_test_util
from xls.dslx import ir_converter
from xls.dslx import parser_helpers
from xls.dslx import span
from xls.dslx import typecheck
fro... | true | true |
f7546548892429b56e2db33d12b6c843e8307cfa | 365 | py | Python | db_hammer/entity.py | liuzhuogood/db-hammer | 133eb09cb83cabb82690d35470e57232c350b79b | [
"MIT"
] | 3 | 2020-09-17T10:21:50.000Z | 2021-11-16T10:29:57.000Z | db_hammer/entity.py | liuzhuogood/db-hammer | 133eb09cb83cabb82690d35470e57232c350b79b | [
"MIT"
] | null | null | null | db_hammer/entity.py | liuzhuogood/db-hammer | 133eb09cb83cabb82690d35470e57232c350b79b | [
"MIT"
] | null | null | null | def table(name=None, primary_key="id", column_map=None):
"""数据据保存的表名"""
def decorate(clazz):
setattr(clazz, "__table_name__", clazz.__name__ if name is None else name)
setattr(clazz, "__primary_key__", primary_key)
setattr(clazz, "__column_map__", None if column_map is None else column_m... | 40.555556 | 84 | 0.687671 | def table(name=None, primary_key="id", column_map=None):
def decorate(clazz):
setattr(clazz, "__table_name__", clazz.__name__ if name is None else name)
setattr(clazz, "__primary_key__", primary_key)
setattr(clazz, "__column_map__", None if column_map is None else column_map)
return ... | true | true |
f75465956acb95b84baf23a39864e6040b0cc788 | 1,694 | py | Python | graphql/validation/rules/unique_operation_names.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 8 | 2020-03-23T21:34:02.000Z | 2021-11-12T11:27:45.000Z | graphql/validation/rules/unique_operation_names.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-14T22:22:29.000Z | 2022-03-16T19:26:37.000Z | graphql/validation/rules/unique_operation_names.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-23T12:06:23.000Z | 2022-02-13T05:33:32.000Z | from ...error import GraphQLError
from .base import ValidationRule
# Necessary for static type checking
if False: # flake8: noqa
from ..validation import ValidationContext
from ...language.ast import Document, OperationDefinition, Name
from typing import Any, List, Optional, Union, Dict
class UniqueOper... | 34.571429 | 87 | 0.650531 | from ...error import GraphQLError
from .base import ValidationRule
if False:
from ..validation import ValidationContext
from ...language.ast import Document, OperationDefinition, Name
from typing import Any, List, Optional, Union, Dict
class UniqueOperationNames(ValidationRule):
__slots__ = ("know... | true | true |
f75465a4880420e848377d5a02fdf798992c8f84 | 7,483 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/netconf/ce.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/plugins/netconf/ce.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/plugins/netconf/ce.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-10-30T12:48:24.000Z | 2020-10-30T12:48:24.000Z | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | 35.633333 | 118 | 0.643325 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import re
from ansible.module_utils._text import to_text, to_bytes, to_native
from ansible.errors import AnsibleConnectionFailure
from ansible.plugins.netconf import NetconfBase
from ansible.plugins.n... | true | true |
f75466b129b01c68d3fce5f5a7777e67f3622c63 | 13,045 | py | Python | app/tests/test_apis_memes.py | withshubh/memegen | 9667e0c6737334ca8ceb4347792e3df39ae52b3a | [
"MIT"
] | null | null | null | app/tests/test_apis_memes.py | withshubh/memegen | 9667e0c6737334ca8ceb4347792e3df39ae52b3a | [
"MIT"
] | null | null | null | app/tests/test_apis_memes.py | withshubh/memegen | 9667e0c6737334ca8ceb4347792e3df39ae52b3a | [
"MIT"
] | null | null | null | import json
from unittest.mock import AsyncMock, patch
import pytest
from .. import settings
def describe_list():
def describe_GET():
@pytest.mark.slow
def it_returns_example_image_urls(expect, client):
request, response = client.get("/images", timeout=10)
expect(response... | 41.544586 | 122 | 0.563051 | import json
from unittest.mock import AsyncMock, patch
import pytest
from .. import settings
def describe_list():
def describe_GET():
@pytest.mark.slow
def it_returns_example_image_urls(expect, client):
request, response = client.get("/images", timeout=10)
expect(response... | true | true |
f75467308c9e8656ac1b1c2e4498f821c311a6a3 | 3,246 | py | Python | examples/test_notify.py | jelitox/async-notify | d297c20e6dc4b524b7c5447cb07611f63a7a7848 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/test_notify.py | jelitox/async-notify | d297c20e6dc4b524b7c5447cb07611f63a7a7848 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/test_notify.py | jelitox/async-notify | d297c20e6dc4b524b7c5447cb07611f63a7a7848 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #from notify import Notify
from pathlib import Path, PurePath
from notify.models import Actor, Chat, Account, Message, BlockMessage, MailMessage
from notify import Notify
from notify.providers.dummy import Dummy
import asyncio
## Add two more providers: Twitter and Whatsapp via Twilio
# f = open(Path(__file__).paren... | 23.352518 | 93 | 0.628774 |
from pathlib import Path, PurePath
from notify.models import Actor, Chat, Account, Message, BlockMessage, MailMessage
from notify import Notify
from notify.providers.dummy import Dummy
import asyncio
",
"phone": "+34692817379"
}
}
user2 = {
"name": "Jesus Lara",
"account": {
"provider": "... | true | true |
f75468873998e3b53dc594e21faf62ce0ab343f1 | 2,690 | py | Python | dev_blog/settings/base.py | kylejuliandev/dev_blog_assignment | 272466cb591f9b45fb81c2a42e86b25bff3cd9ad | [
"MIT"
] | null | null | null | dev_blog/settings/base.py | kylejuliandev/dev_blog_assignment | 272466cb591f9b45fb81c2a42e86b25bff3cd9ad | [
"MIT"
] | null | null | null | dev_blog/settings/base.py | kylejuliandev/dev_blog_assignment | 272466cb591f9b45fb81c2a42e86b25bff3cd9ad | [
"MIT"
] | null | null | null | """
Django settings for dev_blog project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
import os
... | 26.9 | 91 | 0.689219 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfi... | true | true |
f7546951fd34bc3e09a149bbccdad1cdcf6cf3d0 | 107,407 | py | Python | src/gui.py | erbridge/NQr | ff98fedac45fee47d31a409c20d3b8667da884ad | [
"BSD-3-Clause"
] | null | null | null | src/gui.py | erbridge/NQr | ff98fedac45fee47d31a409c20d3b8667da884ad | [
"BSD-3-Clause"
] | null | null | null | src/gui.py | erbridge/NQr | ff98fedac45fee47d31a409c20d3b8667da884ad | [
"BSD-3-Clause"
] | null | null | null | """GUI class module."""
# TODO: Add library viewer with scoring, queueing and search funcionality using
# splitter window: top left - artist, top right - album, centre - tracks,
# bottom - details.
# TODO: Add delete file/directory menus, with confirmation?
# TODO: Add support for mulitple track selections... | 40.823641 | 86 | 0.596255 |
import configparser
import json
import os
import socket
import sys
import threading
import time
import errors
import events
import util
wx = util.wx
class SharedTrack:
def __init__(self, info):
self._info = info
for (key, value) in list(info.items()):
... | true | true |
f7546a487c7f20302dcc4292a85724b1b60c66ba | 3,868 | py | Python | tests/objective/system/policy/test_aggregate_carbon_tax_costs.py | blue-marble/gridpath | 66560ab084e1e2f4800e270090d5efc8f6ff01a6 | [
"Apache-2.0"
] | 44 | 2020-10-27T19:05:44.000Z | 2022-03-22T17:17:37.000Z | tests/objective/system/policy/test_aggregate_carbon_tax_costs.py | blue-marble/gridpath | 66560ab084e1e2f4800e270090d5efc8f6ff01a6 | [
"Apache-2.0"
] | 67 | 2020-10-08T22:36:53.000Z | 2022-03-22T22:58:33.000Z | tests/objective/system/policy/test_aggregate_carbon_tax_costs.py | blue-marble/gridpath | 66560ab084e1e2f4800e270090d5efc8f6ff01a6 | [
"Apache-2.0"
] | 21 | 2020-10-08T23:23:48.000Z | 2022-03-28T01:21:21.000Z | # Copyright 2021 (c) Crown Copyright, GC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.490566 | 81 | 0.648914 |
from __future__ import print_function
from builtins import str
from collections import OrderedDict
from importlib import import_module
import os.path
import sys
import unittest
from tests.common_functions import create_abstract_model, \
add_components_and_load_data
TEST_DATA_DIRECTORY = \
os.pa... | true | true |
f7546b56d8277c26dbdc86bb5b0ca111eb2c9bfe | 1,096 | py | Python | audit/views.py | praekelt/seed-control-interface-service | 2fd8850f94345ff07187c2fb296d111d44bff1d8 | [
"BSD-3-Clause"
] | null | null | null | audit/views.py | praekelt/seed-control-interface-service | 2fd8850f94345ff07187c2fb296d111d44bff1d8 | [
"BSD-3-Clause"
] | 12 | 2016-05-05T16:29:18.000Z | 2018-07-17T08:58:02.000Z | audit/views.py | praekeltfoundation/seed-control-interface-service | 2fd8850f94345ff07187c2fb296d111d44bff1d8 | [
"BSD-3-Clause"
] | 1 | 2016-09-28T09:32:13.000Z | 2016-09-28T09:32:13.000Z | import django_filters.rest_framework as filters
from rest_framework import generics
from rest_framework.pagination import CursorPagination
from rest_framework.permissions import IsAuthenticated
from .models import AuditLog
from .serializers import AuditLogSerializer
class ActionAtCursorPagination(CursorPagination):
... | 32.235294 | 77 | 0.733577 | import django_filters.rest_framework as filters
from rest_framework import generics
from rest_framework.pagination import CursorPagination
from rest_framework.permissions import IsAuthenticated
from .models import AuditLog
from .serializers import AuditLogSerializer
class ActionAtCursorPagination(CursorPagination):
... | true | true |
f7546bb20b2ec4ff38dd7c377a4c1ec41d1631e8 | 4,258 | py | Python | machine_learning/deep_learning/deep_learning/tweet_sentiment.py | everestocean/Algorithm | a7e2ce796daf50488420290176dc8c1ccccb109f | [
"MIT"
] | null | null | null | machine_learning/deep_learning/deep_learning/tweet_sentiment.py | everestocean/Algorithm | a7e2ce796daf50488420290176dc8c1ccccb109f | [
"MIT"
] | null | null | null | machine_learning/deep_learning/deep_learning/tweet_sentiment.py | everestocean/Algorithm | a7e2ce796daf50488420290176dc8c1ccccb109f | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
import keras
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.layers.convolutional import Conv1D
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import pandas as pd
import numpy as np
import s... | 32.257576 | 130 | 0.712776 |
import keras
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.layers.convolutional import Conv1D
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import pandas as pd
import numpy as np
import spacy
nlp=spacy.load("... | true | true |
f7546bc3af8c1914a828f64a8421f9e4b336e544 | 9,743 | py | Python | pontoon/administration/vcs.py | sudheesh001/pontoon | 046bb50113a76ff278de73036db395ea726cab43 | [
"BSD-3-Clause"
] | null | null | null | pontoon/administration/vcs.py | sudheesh001/pontoon | 046bb50113a76ff278de73036db395ea726cab43 | [
"BSD-3-Clause"
] | null | null | null | pontoon/administration/vcs.py | sudheesh001/pontoon | 046bb50113a76ff278de73036db395ea726cab43 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf8 -*-
from __future__ import absolute_import
import logging
import os
import subprocess
from django.conf import settings
log = logging.getLogger('pontoon')
class PullFromRepositoryException(Exception):
pass
class PullFromRepository(object):
def __init__(self, source, target):
se... | 28.655882 | 90 | 0.58873 |
from __future__ import absolute_import
import logging
import os
import subprocess
from django.conf import settings
log = logging.getLogger('pontoon')
class PullFromRepositoryException(Exception):
pass
class PullFromRepository(object):
def __init__(self, source, target):
self.source = source
... | true | true |
f7546c651ec9eee03b5162aeeba3cbbb6e6eda5e | 12,809 | py | Python | twill/utils.py | rickproza/twill | 7a98e4912a8ff929a94e35d35e7a027472ee4f46 | [
"MIT"
] | 13 | 2020-04-18T15:17:58.000Z | 2022-02-24T13:25:46.000Z | twill/utils.py | rickproza/twill | 7a98e4912a8ff929a94e35d35e7a027472ee4f46 | [
"MIT"
] | 5 | 2020-04-04T21:16:00.000Z | 2022-02-10T00:26:20.000Z | twill/utils.py | rickproza/twill | 7a98e4912a8ff929a94e35d35e7a027472ee4f46 | [
"MIT"
] | 3 | 2020-06-06T17:26:19.000Z | 2022-02-10T00:30:39.000Z | """
Various ugly utility functions for twill.
Apart from various simple utility functions, twill's robust parsing
code is implemented in the ConfigurableParsingFactory class.
"""
import os
import re
from collections import namedtuple
from lxml import html
try:
import tidylib
except (ImportError, OSError):
... | 29.997658 | 78 | 0.5728 |
import os
import re
from collections import namedtuple
from lxml import html
try:
import tidylib
except (ImportError, OSError):
tidylib = None
from . import log, twill_ext
from .errors import TwillException
Link = namedtuple('Link', 'text, url')
class Singleton:
def __new__(cls, *args, *... | true | true |
f7546c7d9cb5aff52bd6315a3620b998b43f2502 | 3,786 | py | Python | Assignments/assignment1/q3_sgd.py | xnone/CS224n-Natural-Language-Processing-with-Deep-Learning | 0ec63dcd6b8671712c0206cc64b3e4c2fc6f97a3 | [
"MIT"
] | null | null | null | Assignments/assignment1/q3_sgd.py | xnone/CS224n-Natural-Language-Processing-with-Deep-Learning | 0ec63dcd6b8671712c0206cc64b3e4c2fc6f97a3 | [
"MIT"
] | null | null | null | Assignments/assignment1/q3_sgd.py | xnone/CS224n-Natural-Language-Processing-with-Deep-Learning | 0ec63dcd6b8671712c0206cc64b3e4c2fc6f97a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Save parameters every a few SGD iterations as fail-safe
SAVE_PARAMS_EVERY = 5000
import glob
import random
import numpy as np
import os.path as op
import pickle
def load_saved_params():
"""
A helper function that loads previously saved parameters and resets
iteration start.
"... | 26.291667 | 75 | 0.598785 |
SAVE_PARAMS_EVERY = 5000
import glob
import random
import numpy as np
import os.path as op
import pickle
def load_saved_params():
st = 0
for f in glob.glob("saved_params_*.npy"):
iter = int(op.splitext(op.basename(f))[0].split("_")[2])
if (iter > st):
st = iter
if st > 0:
... | true | true |
f7546d068385c71fa98ee664221857a8839628c8 | 150 | py | Python | Aulas/Aula16C.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | Aulas/Aula16C.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | Aulas/Aula16C.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | pessoa = ('Gustavo', 39, 'M', 99.88)
print(pessoa)
del(pessoa) # del() - apaga uma variável da memória
input('\n\nPressione <enter> para continuar')
| 25 | 51 | 0.68 | pessoa = ('Gustavo', 39, 'M', 99.88)
print(pessoa)
del(pessoa)
input('\n\nPressione <enter> para continuar')
| true | true |
f7546f0ebc52390add41ee90927b1230dcab43de | 2,450 | py | Python | gamelayer/sprite/movement/vector.py | Windspar/Gamelayer | 65e1cf11548bc02bc49348eb265c209172c14844 | [
"MIT"
] | null | null | null | gamelayer/sprite/movement/vector.py | Windspar/Gamelayer | 65e1cf11548bc02bc49348eb265c209172c14844 | [
"MIT"
] | null | null | null | gamelayer/sprite/movement/vector.py | Windspar/Gamelayer | 65e1cf11548bc02bc49348eb265c209172c14844 | [
"MIT"
] | null | null | null | from pygame import Vector2
from .movement import Movement
from ...util import MaxValue
class VectorMovement(Movement):
def __init__(self, sprite, thrust=10, friction=1, rotation=60, brake=6, max_velocity=150, angle=0):
Movement.__init__(self, sprite, thrust)
self.friction = friction * Movement.per_... | 31.410256 | 103 | 0.641633 | from pygame import Vector2
from .movement import Movement
from ...util import MaxValue
class VectorMovement(Movement):
def __init__(self, sprite, thrust=10, friction=1, rotation=60, brake=6, max_velocity=150, angle=0):
Movement.__init__(self, sprite, thrust)
self.friction = friction * Movement.per_... | true | true |
f7546f18652eca4afd30dd6b882e197cee04851e | 3,919 | py | Python | exercises/circular-buffer/circular_buffer_test.py | akashsara/python | 6778e437487ad0e813959fe8a5e8fd37302704f5 | [
"MIT"
] | null | null | null | exercises/circular-buffer/circular_buffer_test.py | akashsara/python | 6778e437487ad0e813959fe8a5e8fd37302704f5 | [
"MIT"
] | null | null | null | exercises/circular-buffer/circular_buffer_test.py | akashsara/python | 6778e437487ad0e813959fe8a5e8fd37302704f5 | [
"MIT"
] | null | null | null | import unittest
from circular_buffer import CircularBuffer
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
class CircularBufferTest(unittest.TestCase):
def test_reading_empty_buffer_should_fail(self):
buf = CircularBuffer(1)
with self.assertRaisesWithMessage(BaseExcep... | 30.379845 | 85 | 0.618525 | import unittest
from circular_buffer import CircularBuffer
class CircularBufferTest(unittest.TestCase):
def test_reading_empty_buffer_should_fail(self):
buf = CircularBuffer(1)
with self.assertRaisesWithMessage(BaseException):
buf.read()
def test_can_read_an_item_just_written(s... | true | true |
f7546fbbf299d0441584fb1dfc1bb398dea73733 | 414 | py | Python | public_interface/migrations/0006_vouchers_flickr_photo_url.py | danmcelroy/VoSeq | e22bd5d971154170bf3f4f24b684b95a12418637 | [
"BSD-3-Clause"
] | 2 | 2019-08-20T04:16:12.000Z | 2020-08-25T02:05:12.000Z | public_interface/migrations/0006_vouchers_flickr_photo_url.py | danmcelroy/VoSeq | e22bd5d971154170bf3f4f24b684b95a12418637 | [
"BSD-3-Clause"
] | 65 | 2016-09-27T23:14:51.000Z | 2022-03-19T14:17:58.000Z | public_interface/migrations/0006_vouchers_flickr_photo_url.py | danmcelroy/VoSeq | e22bd5d971154170bf3f4f24b684b95a12418637 | [
"BSD-3-Clause"
] | 4 | 2018-07-02T16:57:44.000Z | 2021-03-23T02:12:15.000Z | # Generated by Django 2.2.13 on 2021-03-14 21:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('public_interface', '0005_auto_20210313_1919'),
]
operations = [
migrations.AddField(
model_name='vouchers',
name='f... | 21.789474 | 58 | 0.618357 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('public_interface', '0005_auto_20210313_1919'),
]
operations = [
migrations.AddField(
model_name='vouchers',
name='flickr_photo_url',
field=models.TextF... | true | true |
f7546fe0be529ddd3dcd603eb95f8c0399fbefe1 | 1,188 | py | Python | pcat2py/class/23145ca0-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/23145ca0-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/23145ca0-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
# 23145ca0-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... | 32.108108 | 80 | 0.512626 | true | true | |
f75470306c4f47a4c9f93d16757d465a2fa4d4bb | 24,470 | py | Python | depend/zcash/qa/rpc-tests/fundrawtransaction.py | ZcashFoundation/zcashconsensus | c9fbc441efd78593ba6a9828be45baf2d6469757 | [
"Apache-2.0"
] | null | null | null | depend/zcash/qa/rpc-tests/fundrawtransaction.py | ZcashFoundation/zcashconsensus | c9fbc441efd78593ba6a9828be45baf2d6469757 | [
"Apache-2.0"
] | 1 | 2020-07-17T14:09:32.000Z | 2020-07-17T14:09:32.000Z | depend/zcash/qa/rpc-tests/fundrawtransaction.py | ZcashFoundation/zcashconsensus | c9fbc441efd78593ba6a9828be45baf2d6469757 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSO... | 40.313015 | 223 | 0.555497 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
start_nodes, connect_nodes_bi, stop_nodes, \
wait_bitcoinds
from decimal import Decimal
class RawTransactionsTest(Bitc... | true | true |
f7547044e039c0af49b4a3a1b8697382236c1e77 | 5,160 | py | Python | statement_parser/expenses/expense.py | jamiehannaford/statement-parser | 93925b5903a4570f66f3e7b7d5d839412bde1da0 | [
"MIT"
] | 5 | 2021-09-01T03:27:02.000Z | 2022-03-31T16:31:23.000Z | statement_parser/expenses/expense.py | jamiehannaford/statement-parser | 93925b5903a4570f66f3e7b7d5d839412bde1da0 | [
"MIT"
] | null | null | null | statement_parser/expenses/expense.py | jamiehannaford/statement-parser | 93925b5903a4570f66f3e7b7d5d839412bde1da0 | [
"MIT"
] | null | null | null | from statement_parser.text_analyser import TextAnalyser
from xbrl.instance import TextFact
BALANCE_TAGS_REVERSAL = [
"us-gaap_CashDividendsPaidToParentCompanyByConsolidatedSubsidiaries",
]
class Expense:
def __init__(self, fact, label, text_blocks=None):
self.fact = fact
self.cost = float(fac... | 34.4 | 112 | 0.617636 | from statement_parser.text_analyser import TextAnalyser
from xbrl.instance import TextFact
BALANCE_TAGS_REVERSAL = [
"us-gaap_CashDividendsPaidToParentCompanyByConsolidatedSubsidiaries",
]
class Expense:
def __init__(self, fact, label, text_blocks=None):
self.fact = fact
self.cost = float(fac... | true | true |
f7547065bbd8d70c371fbca871f7ebc70d1ac711 | 150 | py | Python | main.py | adeen-s/DumbAssistant | eb86a69340c86e2cb0dcc77693eef125223d1b1f | [
"MIT"
] | null | null | null | main.py | adeen-s/DumbAssistant | eb86a69340c86e2cb0dcc77693eef125223d1b1f | [
"MIT"
] | null | null | null | main.py | adeen-s/DumbAssistant | eb86a69340c86e2cb0dcc77693eef125223d1b1f | [
"MIT"
] | null | null | null | from speechinput import speech_input
from speechoutput import speech_output
in_speech = speech_input()
if (in_speech):
speech_output(in_speech)
| 18.75 | 38 | 0.813333 | from speechinput import speech_input
from speechoutput import speech_output
in_speech = speech_input()
if (in_speech):
speech_output(in_speech)
| true | true |
f754708b2250b03d251cc3778718e2d65bd43090 | 661 | py | Python | design_patterns/oop/alien_game/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | design_patterns/oop/alien_game/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | design_patterns/oop/alien_game/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | from abc import ABCMeta, abstractmethod
class Scene(object):
__metaclass__ = ABCMeta
@abstractmethod
def enter(self):
"""
Enter method to every scene
:return:
"""
pass
class Engine(object):
__metaclass__ = ABCMeta
def __init__(self, scene_map):
s... | 16.525 | 39 | 0.620272 | from abc import ABCMeta, abstractmethod
class Scene(object):
__metaclass__ = ABCMeta
@abstractmethod
def enter(self):
pass
class Engine(object):
__metaclass__ = ABCMeta
def __init__(self, scene_map):
self.scene_map = scene_map
@abstractmethod
def play(self):
pa... | true | true |
f75470b70908360353e7d5c0f3eafd95bea0a26e | 7,378 | py | Python | not_active_on_streamlit/prepare_casuslandelijk.py | rcsmit/COVIDcases | 8952931ee8316644dee55aad3f94c98f510e2f14 | [
"MIT"
] | 1 | 2021-02-04T19:04:29.000Z | 2021-02-04T19:04:29.000Z | not_active_on_streamlit/prepare_casuslandelijk.py | rcsmit/COVIDcases | 8952931ee8316644dee55aad3f94c98f510e2f14 | [
"MIT"
] | 2 | 2021-04-28T17:38:26.000Z | 2021-06-22T23:00:22.000Z | not_active_on_streamlit/prepare_casuslandelijk.py | rcsmit/COVIDcases | 8952931ee8316644dee55aad3f94c98f510e2f14 | [
"MIT"
] | 3 | 2021-02-04T19:03:24.000Z | 2022-01-09T17:45:20.000Z | # PREPARE A CSV-FILE TO ENABLE AN STACKED PLOT FOR POSITIVE TESTS, HOSPITALIZATIONS AND DECEASED
# Hospitalizations and deceased are not lagged in time, the date of the result of the "desease onset", positieve test or notification is leading
# https://data.rivm.nl/geonetwork/srv/dut/catalog.search#/metadata/2c4357c8-76... | 37.642857 | 144 | 0.676742 |
mpy as np
import datetime as dt
from datetime import datetime
def save_df(df, name):
OUTPUT_DIR = (
"C:\\Users\\rcxsm\\Documents\\phyton_scripts\\covid19_seir_models\\output\\"
)
OUTPUT_DIR = (
"C:\\Users\\rcxsm\\Documents\\phyton_scripts\\covid19_seir_models\\COVIDcases\\input\\")
name... | true | true |
f75472c297e49ff9dcc0b28164d44103234c0696 | 49,515 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_link_monitor.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_link_monitor.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_link_monitor.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 32.468852 | 151 | 0.369989 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_system_link_monitor
short_descripti... | true | true |
f754737d5f5d86ae0308f1f3969cb25724d44577 | 1,472 | py | Python | test/test_unit_conjurrc_data.py | mbjahnoon/conjur-api-python3 | ec1f62bb1baf2bdcd34d2fb92c97db724f761020 | [
"Apache-2.0"
] | 16 | 2019-05-17T15:34:59.000Z | 2021-11-08T10:30:21.000Z | test/test_unit_conjurrc_data.py | mbjahnoon/conjur-api-python3 | ec1f62bb1baf2bdcd34d2fb92c97db724f761020 | [
"Apache-2.0"
] | 301 | 2019-05-07T18:27:10.000Z | 2022-01-26T13:03:49.000Z | test/test_unit_conjurrc_data.py | cyberark/cyberark-conjur-cli | 2507e8769808643d89efa7e2496cfc14f505bd7e | [
"Apache-2.0"
] | 10 | 2019-07-30T17:00:13.000Z | 2022-01-20T17:00:34.000Z | import unittest
from unittest.mock import mock_open, patch
from conjur.data_object.conjurrc_data import ConjurrcData
from conjur.errors import InvalidConfigurationException
EXPECTED_REP_OBJECT={'conjur_url': 'https://someurl', 'conjur_account': 'someaccount', 'cert_file': "/some/cert/path"}
EXPECTED_CONJURRC = \
"""
... | 42.057143 | 118 | 0.747283 | import unittest
from unittest.mock import mock_open, patch
from conjur.data_object.conjurrc_data import ConjurrcData
from conjur.errors import InvalidConfigurationException
EXPECTED_REP_OBJECT={'conjur_url': 'https://someurl', 'conjur_account': 'someaccount', 'cert_file': "/some/cert/path"}
EXPECTED_CONJURRC = \
"""
... | true | true |
f754744a7b1ae9d678cfada187591d347ec117ae | 75,817 | py | Python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2020-03-05T18:10:35.000Z | 2020-03-05T18:10:35.000Z | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.61215 | 254 | 0.66894 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f75474b02a04e223a3cf9ed069107736f071860c | 5,309 | py | Python | foo/api_symbol.py | CyberlifeCN/cyber-website | edb3e896053fd7610c5c552acc664a7b762d5610 | [
"Apache-2.0"
] | null | null | null | foo/api_symbol.py | CyberlifeCN/cyber-website | edb3e896053fd7610c5c552acc664a7b762d5610 | [
"Apache-2.0"
] | null | null | null | foo/api_symbol.py | CyberlifeCN/cyber-website | edb3e896053fd7610c5c552acc664a7b762d5610 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding: utf-8_*_
#
# Copyright 2016 7x24hs.com
# thomas@7x24hs.com
#
# 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... | 29.825843 | 83 | 0.594651 |
import tornado.web
import logging
import time
import sys
import os
import json as JSON
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../"))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../dao"))
from comm import *
from global_const import *
from base_handler import *
f... | true | true |
f75474d86c6dfdb7fe629d31f0511c4a1f9fc8dd | 9,898 | py | Python | api/cloud_provider/clients/openstack.py | liqiang-fit2cloud/KubeOperator | cb9346b95d29919570cefa6bea1ce4e5c3f0ee6d | [
"Apache-2.0"
] | 3 | 2019-11-29T03:49:08.000Z | 2020-07-29T02:52:51.000Z | api/cloud_provider/clients/openstack.py | liqiang-fit2cloud/KubeOperator | cb9346b95d29919570cefa6bea1ce4e5c3f0ee6d | [
"Apache-2.0"
] | null | null | null | api/cloud_provider/clients/openstack.py | liqiang-fit2cloud/KubeOperator | cb9346b95d29919570cefa6bea1ce4e5c3f0ee6d | [
"Apache-2.0"
] | 1 | 2020-03-04T00:29:29.000Z | 2020-03-04T00:29:29.000Z | import os
from threading import Thread
from time import sleep
from cloud_provider.cloud_client import CloudClient
from pyVmomi import vim
from keystoneclient.v3 import client as KeystoneClient
from openstack import connection
from urllib import request
import json
from cloud_provider.utils import download_plugins
from... | 38.216216 | 139 | 0.527985 | import os
from threading import Thread
from time import sleep
from cloud_provider.cloud_client import CloudClient
from pyVmomi import vim
from keystoneclient.v3 import client as KeystoneClient
from openstack import connection
from urllib import request
import json
from cloud_provider.utils import download_plugins
from... | true | true |
f75474f66ca8afbdf04fbd770a7304ac7179ade6 | 4,342 | py | Python | grid_royale/gamey/base.py | delanobgt/grid_royale | a7571a3f8262896d8423c0c8b90bc84864fdea2f | [
"MIT"
] | 2 | 2020-11-02T07:15:25.000Z | 2020-11-02T07:19:04.000Z | grid_royale/gamey/base.py | EliorBenYosef/grid_royale | 00720b20e52932b11ac472c4428d6a14e58b29cd | [
"MIT"
] | null | null | null | grid_royale/gamey/base.py | EliorBenYosef/grid_royale | 00720b20e52932b11ac472c4428d6a14e58b29cd | [
"MIT"
] | null | null | null | # Copyright 2020 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
from __future__ import annotations
import math
import inspect
import re
import abc
import random
import itertools
import collections.abc
import statistics
import concurrent.futures
import enum
import functools
import n... | 28.754967 | 100 | 0.674804 |
from __future__ import annotations
import math
import inspect
import re
import abc
import random
import itertools
import collections.abc
import statistics
import concurrent.futures
import enum
import functools
import numbers
from typing import (Iterable, Union, Optional, Tuple, Any, Iterator, Type,
... | true | true |
f7547535a030be6c68ef9c70bee336484a1b60ba | 11,453 | py | Python | tests/models/test_renderedtifields.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-07-30T16:46:46.000Z | 2021-10-19T07:18:47.000Z | tests/models/test_renderedtifields.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 6 | 2019-03-16T02:09:30.000Z | 2019-06-27T03:27:34.000Z | tests/models/test_renderedtifields.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-05T07:36:36.000Z | 2021-11-10T17:32:39.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.428105 | 110 | 0.583341 |
import os
import unittest
from datetime import date, timedelta
from unittest import mock
from parameterized import parameterized
from airflow import settings
from airflow.models import Variable
from airflow.models.dag import DAG
from airflow.models.renderedtifields import RenderedTaskInstanceFields... | true | true |
f7547649c998c8bd1123bae29cdef69ab9a0cdae | 4,553 | py | Python | dev/Tools/lmbr_aws/cleanup_utils/cleanup_lambda_utils.py | brianherrera/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Tools/lmbr_aws/cleanup_utils/cleanup_lambda_utils.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Tools/lmbr_aws/cleanup_utils/cleanup_lambda_utils.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | 45.53 | 120 | 0.648803 |
import time
from botocore.exceptions import ClientError
from . import exception_utils
from . import cleanup_utils
def __lambda_exists(cleaner, lambda_function_arn):
try:
cleaner.lambda_client.get_function(FunctionName=lambda_function_arn)
except cleaner.lambda_client.exceptions.ResourceNo... | true | true |
f754775cdf5481fc6900fbc56a12e937823f5801 | 3,646 | py | Python | bindings/python/ensmallen/datasets/string/candidatuskerfeldbacteriabacteriumrifoxya2full3824.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/candidatuskerfeldbacteriabacteriumrifoxya2full3824.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/candidatuskerfeldbacteriabacteriumrifoxya2full3824.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 Kerfeldbacteria bacterium RIFOXYA2_FULL_38_24.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
t... | 34.72381 | 223 | 0.691443 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def CandidatusKerfeldbacteriaBacteriumRifoxya2Full3824(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
... | true | true |
f75477c6dc808addf45ea2980fdda7bad547ed30 | 1,382 | py | Python | toy_experiments/solvers/moo_mtl.py | kelvin95/EPOSearch | 020f0a8890437449dd7bb37534697aa9f71e8305 | [
"MIT"
] | 32 | 2020-07-16T00:52:54.000Z | 2022-03-23T07:24:33.000Z | toy_experiments/solvers/moo_mtl.py | kelvin95/EPOSearch | 020f0a8890437449dd7bb37534697aa9f71e8305 | [
"MIT"
] | 2 | 2020-08-24T07:35:57.000Z | 2021-01-26T07:31:03.000Z | toy_experiments/solvers/moo_mtl.py | kelvin95/EPOSearch | 020f0a8890437449dd7bb37534697aa9f71e8305 | [
"MIT"
] | 11 | 2020-07-27T14:12:57.000Z | 2022-02-09T13:48:26.000Z | # This code is from
# Multi-Task Learning as Multi-Objective Optimization
# Ozan Sener, Vladlen Koltun
# Neural Information Processing Systems (NeurIPS) 2018
# https://github.com/intel-isl/MultiObjectiveOptimization
import numpy as np
from .min_norm_solvers_numpy import MinNormSolver
def moo_mtl_search(multi_obj_f... | 23.033333 | 61 | 0.615051 |
import numpy as np
from .min_norm_solvers_numpy import MinNormSolver
def moo_mtl_search(multi_obj_fg, x=None,
max_iters=200, n_dim=20, step_size=1):
x = np.random.randn(n_dim) if x is None else x
fs = []
for t in range(max_iters):
f, f_dx = multi_obj_fg(x)
w... | true | true |
f75477d21c4222f28eb44b2d8dc32e1301e2d8f7 | 3,112 | py | Python | DynamicKey/AgoraDynamicKey/python/src/RtcTokenBuilder.py | shyam-chipsoft/Tools | bfc5a15f585da429f7e87968e3401a9934eda13b | [
"MIT"
] | 5 | 2021-03-25T09:16:28.000Z | 2021-06-12T06:48:43.000Z | DynamicKey/AgoraDynamicKey/python/src/RtcTokenBuilder.py | coderkhalide/Tools | 29e04b7547d3000395d7981a4528394431e5f0be | [
"MIT"
] | null | null | null | DynamicKey/AgoraDynamicKey/python/src/RtcTokenBuilder.py | coderkhalide/Tools | 29e04b7547d3000395d7981a4528394431e5f0be | [
"MIT"
] | 1 | 2021-07-20T05:37:16.000Z | 2021-07-20T05:37:16.000Z | import os
import sys
from collections import OrderedDict
sys.path.append(os.path.join(os.path.dirname(__file__), '../src'))
from AccessToken import *
Role_Attendee = 0 # depreated, same as publisher
Role_Publisher = 1 # for live broadcaster
Role_Subscriber = 2 # default, for live audience
Role_Admin = 101 # deprecate... | 57.62963 | 119 | 0.68509 | import os
import sys
from collections import OrderedDict
sys.path.append(os.path.join(os.path.dirname(__file__), '../src'))
from AccessToken import *
Role_Attendee = 0
Role_Publisher = 1
Role_Subscriber = 2
Role_Admin = 101
class RtcTokenBuilder:
... | true | true |
f75477e26dca3553336b5dbbcfb32448253530e4 | 27,935 | py | Python | test/unit/data/test_galaxy_mapping.py | ResearchObject/galaxy | 39c7c3dfd417eb01d276e86046825bfea2208291 | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | test/unit/data/test_galaxy_mapping.py | ResearchObject/galaxy | 39c7c3dfd417eb01d276e86046825bfea2208291 | [
"CC-BY-3.0"
] | 52 | 2015-03-16T14:02:14.000Z | 2021-12-24T09:50:23.000Z | test/unit/data/test_galaxy_mapping.py | ResearchObject/galaxy | 39c7c3dfd417eb01d276e86046825bfea2208291 | [
"CC-BY-3.0"
] | 1 | 2016-03-21T12:54:06.000Z | 2016-03-21T12:54:06.000Z | import collections
import unittest
import uuid
from sqlalchemy import inspect
import galaxy.datatypes.registry
import galaxy.model
import galaxy.model.mapping as mapping
datatypes_registry = galaxy.datatypes.registry.Registry()
datatypes_registry.load_datatypes()
galaxy.model.set_datatypes_registry(datatypes_registr... | 43.243034 | 191 | 0.687847 | import collections
import unittest
import uuid
from sqlalchemy import inspect
import galaxy.datatypes.registry
import galaxy.model
import galaxy.model.mapping as mapping
datatypes_registry = galaxy.datatypes.registry.Registry()
datatypes_registry.load_datatypes()
galaxy.model.set_datatypes_registry(datatypes_registr... | true | true |
f7547806bb3e6b169fb395696271cf43d2cae44e | 162 | py | Python | aula1/projeto10.py | otaviobizulli/python-exercices | 2c61f014bf481fa463721b174ddd4238bf8d0cb3 | [
"MIT"
] | null | null | null | aula1/projeto10.py | otaviobizulli/python-exercices | 2c61f014bf481fa463721b174ddd4238bf8d0cb3 | [
"MIT"
] | null | null | null | aula1/projeto10.py | otaviobizulli/python-exercices | 2c61f014bf481fa463721b174ddd4238bf8d0cb3 | [
"MIT"
] | null | null | null | fahr = float(input('insira a temperatura em Fahrenheit: '))
celsius = ((fahr - 32) / 9) * 5
print(f'a temperatura convertida em Celsius será de {celsius:.2f}ºC.') | 54 | 70 | 0.697531 | fahr = float(input('insira a temperatura em Fahrenheit: '))
celsius = ((fahr - 32) / 9) * 5
print(f'a temperatura convertida em Celsius será de {celsius:.2f}ºC.') | true | true |
f7547ad695eb46d77b96edb9a9c35fe5d2dfe77c | 3,503 | py | Python | hail/python/hailtop/aiotools/utils.py | vrautela/hail | 7db6189b5b1feafa88452b8470e497d9505d9a46 | [
"MIT"
] | null | null | null | hail/python/hailtop/aiotools/utils.py | vrautela/hail | 7db6189b5b1feafa88452b8470e497d9505d9a46 | [
"MIT"
] | 19 | 2022-03-03T20:11:41.000Z | 2022-03-30T20:31:57.000Z | hail/python/hailtop/aiotools/utils.py | pwc2/hail | edeb70bc789c881dffa0724ddd11fcb25e689b67 | [
"MIT"
] | null | null | null | from typing import Callable, TypeVar, AsyncIterator, Iterator
import collections
import asyncio
_T = TypeVar('_T')
class _StopFeedableAsyncIterator:
pass
class FeedableAsyncIterable(AsyncIterator[_T]):
def __init__(self, maxsize: int = 1):
self._queue: asyncio.Queue = asyncio.Queue(maxsize=maxsize... | 31 | 83 | 0.584642 | from typing import Callable, TypeVar, AsyncIterator, Iterator
import collections
import asyncio
_T = TypeVar('_T')
class _StopFeedableAsyncIterator:
pass
class FeedableAsyncIterable(AsyncIterator[_T]):
def __init__(self, maxsize: int = 1):
self._queue: asyncio.Queue = asyncio.Queue(maxsize=maxsize... | true | true |
f7547afe6ab5db97418d150dd968ca7034e088b9 | 838 | py | Python | Plugins/starter.py | Naim120/Heroku-Manga-DL-Bot | 9f7ecbe2a287dec9c4e0bb265ea3e39636d475d3 | [
"MIT"
] | 7 | 2021-06-22T04:32:00.000Z | 2022-01-17T08:26:03.000Z | Plugins/starter.py | zYxDevs/Heroku-Manga-DL-Bot | 5fea4dba41f0a4a2fdbc76bd0ccf8d744d37958f | [
"MIT"
] | null | null | null | Plugins/starter.py | zYxDevs/Heroku-Manga-DL-Bot | 5fea4dba41f0a4a2fdbc76bd0ccf8d744d37958f | [
"MIT"
] | 21 | 2021-06-04T15:04:41.000Z | 2022-03-03T09:04:16.000Z | from Helper.helper import start_text, help_text
from config import bot
from telethon import events
class start():
@bot.on(events.NewMessage(pattern="/start"))
async def event_handler_start(event):
await bot.send_message(
event.chat_id,
start_text,
file='h... | 28.896552 | 88 | 0.606205 | from Helper.helper import start_text, help_text
from config import bot
from telethon import events
class start():
@bot.on(events.NewMessage(pattern="/start"))
async def event_handler_start(event):
await bot.send_message(
event.chat_id,
start_text,
file='h... | true | true |
f7547b576ce3e46941073affb5e535ecb09d688b | 3,111 | py | Python | data/p2DJ/New/R2/benchmark/startQiskit_Class143.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/R2/benchmark/startQiskit_Class143.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/R2/benchmark/startQiskit_Class143.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=10
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... | 28.281818 | 80 | 0.620058 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def b... | true | true |
f7547b907b79f1c275a2f1f5df9a1c620dd3e416 | 1,756 | py | Python | pymnn/pip_package/MNN/tools/mnn_fb/Plugin.py | xhuan28/MNN | 81df3a48d79cbc0b75251d12934345948866f7be | [
"Apache-2.0"
] | 2 | 2020-12-15T13:56:31.000Z | 2022-01-26T03:20:28.000Z | pymnn/pip_package/MNN/tools/mnn_fb/Plugin.py | xhuan28/MNN | 81df3a48d79cbc0b75251d12934345948866f7be | [
"Apache-2.0"
] | null | null | null | pymnn/pip_package/MNN/tools/mnn_fb/Plugin.py | xhuan28/MNN | 81df3a48d79cbc0b75251d12934345948866f7be | [
"Apache-2.0"
] | 1 | 2021-11-24T06:26:27.000Z | 2021-11-24T06:26:27.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: MNN
import flatbuffers
class Plugin(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsPlugin(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Plugin()
... | 33.132075 | 129 | 0.656036 |
import flatbuffers
class Plugin(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsPlugin(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Plugin()
x.Init(buf, n + offset)
return x
def Init(self, buf, pos):
... | true | true |
f7547ce019a616d9dd726ff3aaeed83b1b1a2e01 | 719 | py | Python | mmdet/models/detectors/logo_faster_rcnn.py | JulioZhao97/mmdetection-LOGODet | 4e06357c1e88c74e0f3aafc30f9a503e2833f1a8 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/logo_faster_rcnn.py | JulioZhao97/mmdetection-LOGODet | 4e06357c1e88c74e0f3aafc30f9a503e2833f1a8 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/logo_faster_rcnn.py | JulioZhao97/mmdetection-LOGODet | 4e06357c1e88c74e0f3aafc30f9a503e2833f1a8 | [
"Apache-2.0"
] | null | null | null | from ..builder import DETECTORS
from .logo_two_stage import LogoTwoStageDetector
@DETECTORS.register_module()
class LogoFasterRCNN(LogoTwoStageDetector):
"""Implementation of `Faster R-CNN <https://arxiv.org/abs/1506.01497>`_"""
def __init__(self,
backbone,
rpn_head,
... | 28.76 | 78 | 0.561892 | from ..builder import DETECTORS
from .logo_two_stage import LogoTwoStageDetector
@DETECTORS.register_module()
class LogoFasterRCNN(LogoTwoStageDetector):
def __init__(self,
backbone,
rpn_head,
roi_head,
train_cfg,
test_cfg,
... | true | true |
f7547d21d492787737aad68ff346d6c72af28a95 | 2,524 | py | Python | vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 52.583333 | 195 | 0.630349 |
from .work_item_type_field_instance_base import WorkItemTypeFieldInstanceBase
class WorkItemTypeFieldInstance(WorkItemTypeFieldInstanceBase):
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'reference_name': {'key': 'referenceName', 'type': 'str'},
'url': {'key': 'url',... | true | true |
f7547ddad5c41f2f3b8046f073fa67145906dd6c | 9,733 | py | Python | indico/modules/groups/core.py | Leats/indico | 050cc8e3ba9591f0c2ac135d35d3b14f2624638d | [
"MIT"
] | null | null | null | indico/modules/groups/core.py | Leats/indico | 050cc8e3ba9591f0c2ac135d35d3b14f2624638d | [
"MIT"
] | null | null | null | indico/modules/groups/core.py | Leats/indico | 050cc8e3ba9591f0c2ac135d35d3b14f2624638d | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from warnings import warn
from flask_multipass import MultipassE... | 32.771044 | 120 | 0.634542 |
from __future__ import unicode_literals
from warnings import warn
from flask_multipass import MultipassException
from werkzeug.utils import cached_property
from indico.core.auth import multipass
from indico.core.config import config
from indico.core.db import db
from indico.core.db.sqlalchemy.principals impor... | true | true |
f7547e3a257c340ea479ad819bbee0642b504b4f | 253 | py | Python | src/bin/Devices/Propulsion/__init__.py | rCorvidae/OrionPI | 1ef5d786d7ae55bf92a8da62d8da28af706f4713 | [
"MIT"
] | null | null | null | src/bin/Devices/Propulsion/__init__.py | rCorvidae/OrionPI | 1ef5d786d7ae55bf92a8da62d8da28af706f4713 | [
"MIT"
] | null | null | null | src/bin/Devices/Propulsion/__init__.py | rCorvidae/OrionPI | 1ef5d786d7ae55bf92a8da62d8da28af706f4713 | [
"MIT"
] | null | null | null | from .PropulsionDevice import Propulsion
from .PropulsionManager import PropulsionManager, EventlessPropulsionManager, NullPropulsionManager
from .PropulsionManagerFactory import PropulsionManagerFactory
from .PropulsionFactory import PropulsionFactory
| 50.6 | 99 | 0.905138 | from .PropulsionDevice import Propulsion
from .PropulsionManager import PropulsionManager, EventlessPropulsionManager, NullPropulsionManager
from .PropulsionManagerFactory import PropulsionManagerFactory
from .PropulsionFactory import PropulsionFactory
| true | true |
f7547ea80bb2de55ad47fa7ca92198ad1630f16d | 845 | py | Python | models/languageManager.py | falconsmilie/Raspberry-Pi-3-Weather | 132ed29d7d717e1597d1c5e8dcb5fcf716c81d17 | [
"MIT"
] | null | null | null | models/languageManager.py | falconsmilie/Raspberry-Pi-3-Weather | 132ed29d7d717e1597d1c5e8dcb5fcf716c81d17 | [
"MIT"
] | null | null | null | models/languageManager.py | falconsmilie/Raspberry-Pi-3-Weather | 132ed29d7d717e1597d1c5e8dcb5fcf716c81d17 | [
"MIT"
] | null | null | null | from os import path
from pathlib import Path as path_lib
import json
class LanguageManager(object):
def __init__(self):
self._path_to_language_file = 'config/languageConfig.json'
def get_languages(self):
languages = []
language_file_path = path.join(
path.dirname(path.... | 24.142857 | 69 | 0.617751 | from os import path
from pathlib import Path as path_lib
import json
class LanguageManager(object):
def __init__(self):
self._path_to_language_file = 'config/languageConfig.json'
def get_languages(self):
languages = []
language_file_path = path.join(
path.dirname(path.... | true | true |
f75480750aeb3196f74f340b528a74f7de3f815f | 4,297 | py | Python | catalog/models.py | hasanbeigi/locallibrary | e77ecebbb9114bd6236bc9ec08667bc8dcae8931 | [
"Apache-2.0"
] | null | null | null | catalog/models.py | hasanbeigi/locallibrary | e77ecebbb9114bd6236bc9ec08667bc8dcae8931 | [
"Apache-2.0"
] | null | null | null | catalog/models.py | hasanbeigi/locallibrary | e77ecebbb9114bd6236bc9ec08667bc8dcae8931 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.urls import reverse # Used to generate URLs by reversing the URL patterns
import uuid # Required for unique book instances
from django.contrib.auth.models import User
from datetime import date
class Genre(models.Model):
"""Model representing a book genre."""
name = mode... | 36.109244 | 155 | 0.663021 | from django.db import models
from django.urls import reverse
import uuid
from django.contrib.auth.models import User
from datetime import date
class Genre(models.Model):
name = models.CharField(max_length=200, help_text='Enter a book genre (e.g. Science Fiction)')
def __str__(self):
return self.... | true | true |
f75481d5da93f2eae351034bab0d004cf6abd38a | 5,174 | py | Python | src/ansiblelint/rules/partial_become.py | willthames/ansible-lint | 4c4eb53a7854c2a143ccfaf159d034f744528641 | [
"MIT"
] | 1,192 | 2015-01-03T20:50:49.000Z | 2018-10-29T19:13:06.000Z | src/ansiblelint/rules/partial_become.py | willthames/ansible-lint | 4c4eb53a7854c2a143ccfaf159d034f744528641 | [
"MIT"
] | 326 | 2015-01-02T00:48:35.000Z | 2018-10-29T11:07:46.000Z | src/ansiblelint/rules/partial_become.py | willthames/ansible-lint | 4c4eb53a7854c2a143ccfaf159d034f744528641 | [
"MIT"
] | 209 | 2015-01-12T14:26:09.000Z | 2018-10-18T12:10:49.000Z | """Implementation of partial-become rule."""
# Copyright (c) 2016 Will Thames <will@thames.id.au>
#
# 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 limi... | 37.766423 | 91 | 0.658871 |
import sys
from functools import reduce
from typing import TYPE_CHECKING, Any, List
from ansiblelint.rules import AnsibleLintRule
from ansiblelint.utils import LINE_NUMBER_KEY
if TYPE_CHECKING:
from ansiblelint.constants import odict
from ansiblelint.errors import MatchError
from ansib... | true | true |
f75482c96cac4da18d1b84b3fb5309b993345727 | 483 | py | Python | var/spack/repos/builtin/packages/r-matlab/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-matlab/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-matlab/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RMatlab(RPackage):
"""MATLAB emulation package.
Emulate MATLAB code using R."""
... | 25.421053 | 95 | 0.724638 |
from spack import *
class RMatlab(RPackage):
cran = "matlab"
version('1.0.2', sha256='a23dec736c51ae1864c1a53caac556a2f98e8020138a3b121badb0f5b7984154')
depends_on('r@2.15:', type=('build', 'run'))
| true | true |
f75482e67275b2a685f7a79f6fd9f54799e684b8 | 6,880 | py | Python | bigmler/tests/basic_linear_r_steps.py | shantanusharma/bigmler | 3f9d76e8567de1aa7976a84b3e6130a2c83d4515 | [
"Apache-2.0"
] | null | null | null | bigmler/tests/basic_linear_r_steps.py | shantanusharma/bigmler | 3f9d76e8567de1aa7976a84b3e6130a2c83d4515 | [
"Apache-2.0"
] | null | null | null | bigmler/tests/basic_linear_r_steps.py | shantanusharma/bigmler | 3f9d76e8567de1aa7976a84b3e6130a2c83d4515 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2016-2020 BigML
#
# 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 ... | 45.562914 | 146 | 0.650727 |
import os
import time
import json
from bigmler.tests.world import world, res_filename
from subprocess import check_call, CalledProcessError
from bigml.api import check_resource
from bigml.io import UnicodeReader
from bigmler.processing.models import MONTECARLO_FACTOR
from bigmler.checkpoint import file... | true | true |
f75482f96ad67eea7ffc8b57ef84c25c2d94d457 | 189 | py | Python | bot/states/main.py | famaxth/Rock-Paper-Scissors-Bot | 399df005e94c618e8ce95b53f6a87467d5e941ad | [
"MIT"
] | null | null | null | bot/states/main.py | famaxth/Rock-Paper-Scissors-Bot | 399df005e94c618e8ce95b53f6a87467d5e941ad | [
"MIT"
] | null | null | null | bot/states/main.py | famaxth/Rock-Paper-Scissors-Bot | 399df005e94c618e8ce95b53f6a87467d5e941ad | [
"MIT"
] | null | null | null | from aiogram.dispatcher.filters.state import StatesGroup, State
class Mailing(StatesGroup):
Q1 = State()
class Special(StatesGroup):
Q1 = State()
Q2 = State()
| 14.538462 | 64 | 0.645503 | from aiogram.dispatcher.filters.state import StatesGroup, State
class Mailing(StatesGroup):
Q1 = State()
class Special(StatesGroup):
Q1 = State()
Q2 = State()
| true | true |
f7548359c9a6c09cef935142f8f44e7c5924bc8f | 1,935 | py | Python | raven/utils/core.py | dantin/raven | 4cf741174532aacbcd71696eafcf1bd302651b2e | [
"BSD-3-Clause"
] | 1 | 2021-09-03T01:50:57.000Z | 2021-09-03T01:50:57.000Z | klinic/utils/core.py | dantin/klinic | 9f3d5f41dc5fc6f70449213630c1d42a8aa3622e | [
"BSD-3-Clause"
] | null | null | null | klinic/utils/core.py | dantin/klinic | 9f3d5f41dc5fc6f70449213630c1d42a8aa3622e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from sqlalchemy import event, exc, select
from sqlalchemy.engine import Connection, Engine
def pessimistic_connection_handling(some_engine: Engine) -> None:
@event.listens_for(some_engine, 'engine_connect')
def ping_connection(
connection: Connection, branch: bool
) -> Non... | 43.977273 | 82 | 0.636176 |
from sqlalchemy import event, exc, select
from sqlalchemy.engine import Connection, Engine
def pessimistic_connection_handling(some_engine: Engine) -> None:
@event.listens_for(some_engine, 'engine_connect')
def ping_connection(
connection: Connection, branch: bool
) -> None:
if branch:
... | true | true |
f75483777f54e95a3471be171784c444663a790d | 582 | py | Python | test/ResultsAndPrizes/bingo-75/test_bingo75_winning_numbers_of_the_last_4_draws.py | FearFactor1/SPA | a05aaa924c5bebb52cd508ebdf7fd3b81c49fac7 | [
"Apache-2.0"
] | 1 | 2019-12-05T06:50:54.000Z | 2019-12-05T06:50:54.000Z | test/ResultsAndPrizes/bingo-75/test_bingo75_winning_numbers_of_the_last_4_draws.py | FearFactor1/SPA | a05aaa924c5bebb52cd508ebdf7fd3b81c49fac7 | [
"Apache-2.0"
] | null | null | null | test/ResultsAndPrizes/bingo-75/test_bingo75_winning_numbers_of_the_last_4_draws.py | FearFactor1/SPA | a05aaa924c5bebb52cd508ebdf7fd3b81c49fac7 | [
"Apache-2.0"
] | null | null | null | # Бинго 75 + Выигрышные номера последних 4 тиражей
def test_bingo75_winning_numbers_last_4_draws(app):
app.ResultAndPrizes.open_page_results_and_prizes()
app.ResultAndPrizes.click_game_bingo75()
app.ResultAndPrizes.click_winning_numbers_of_the_last_4_draws()
app.ResultAndPrizes.button_get_report_winn... | 44.769231 | 82 | 0.835052 |
def test_bingo75_winning_numbers_last_4_draws(app):
app.ResultAndPrizes.open_page_results_and_prizes()
app.ResultAndPrizes.click_game_bingo75()
app.ResultAndPrizes.click_winning_numbers_of_the_last_4_draws()
app.ResultAndPrizes.button_get_report_winners()
app.ResultAndPrizes.parser_report_text_w... | true | true |
f75484d7f4e5c99a6da01cefa63dde44afac3ce1 | 343 | py | Python | pykfs/git/hook/__init__.py | drekels/pykfs | 3b645502119ecff8d62a90aa31958a35ff34d7a0 | [
"MIT"
] | null | null | null | pykfs/git/hook/__init__.py | drekels/pykfs | 3b645502119ecff8d62a90aa31958a35ff34d7a0 | [
"MIT"
] | null | null | null | pykfs/git/hook/__init__.py | drekels/pykfs | 3b645502119ecff8d62a90aa31958a35ff34d7a0 | [
"MIT"
] | null | null | null | from pykfs.git.hook.hookobj import PostReceive, CommitMsg, PreReceive
def pre_receive(settings={}):
hook = PreReceive(settings=settings)
return hook()
def post_receive(settings={}):
hook = PostReceive(settings=settings)
return hook()
def commit_msg(settings={}):
hook = CommitMsg(settings=setti... | 20.176471 | 69 | 0.714286 | from pykfs.git.hook.hookobj import PostReceive, CommitMsg, PreReceive
def pre_receive(settings={}):
hook = PreReceive(settings=settings)
return hook()
def post_receive(settings={}):
hook = PostReceive(settings=settings)
return hook()
def commit_msg(settings={}):
hook = CommitMsg(settings=setti... | true | true |
f75485ec74e7bed60d9134cc6ecee09a975ed077 | 3,519 | py | Python | filosocast/settings.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | filosocast/settings.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | filosocast/settings.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | 1 | 2020-07-03T21:04:34.000Z | 2020-07-03T21:04:34.000Z | """
Django settings for filosocast project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os... | 25.316547 | 91 | 0.684854 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'zf08#tjx)22q)+t%w@#&#b_x*)duitt0lmqg$!lt3@j^c7e+-y'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'podcasts',
'autores',
'django.contrib.admin',
'django.contrib.aut... | true | true |
f754861bfa7c51c43b5223444d6f2e03d58f9d4f | 869 | py | Python | doc/examples/peaks/plot.py | cyankaet/bumps | 427d077fd95f2d9a09eeb8677d045547061cff42 | [
"MIT"
] | 44 | 2015-03-28T06:48:43.000Z | 2022-01-09T11:29:00.000Z | doc/examples/peaks/plot.py | cyankaet/bumps | 427d077fd95f2d9a09eeb8677d045547061cff42 | [
"MIT"
] | 68 | 2015-08-21T11:28:54.000Z | 2022-03-30T22:14:13.000Z | doc/examples/peaks/plot.py | cyankaet/bumps | 427d077fd95f2d9a09eeb8677d045547061cff42 | [
"MIT"
] | 27 | 2015-06-22T19:25:27.000Z | 2021-06-15T18:20:06.000Z | import sys
import json
import numpy as np
import pylab
def plot(X,Y,theory,data,err):
#print "theory",theory[1:6,1:6]
#print "data",data[1:6,1:6]
#print "delta",(data-theory)[1:6,1:6]
pylab.subplot(3,1,1)
pylab.pcolormesh(X,Y, data)
pylab.subplot(3,1,2)
pylab.pcolormesh(X,Y, theory)
py... | 25.558824 | 69 | 0.612198 | import sys
import json
import numpy as np
import pylab
def plot(X,Y,theory,data,err):
pylab.subplot(3,1,1)
pylab.pcolormesh(X,Y, data)
pylab.subplot(3,1,2)
pylab.pcolormesh(X,Y, theory)
pylab.subplot(3,1,3)
pylab.pcolormesh(X,Y, (data-theory)/(err+1))
def load_results(filename)... | true | true |
f7548655c9ee27f440ba5507892a5268d48a6b1d | 2,455 | py | Python | examples/map_reduce_url.py | tomwhite/pywren-ibm-cloud | dbc87a6102d74284d03300e72e24a430c7deadd4 | [
"Apache-2.0"
] | 1 | 2020-06-21T20:10:32.000Z | 2020-06-21T20:10:32.000Z | examples/map_reduce_url.py | tomwhite/pywren-ibm-cloud | dbc87a6102d74284d03300e72e24a430c7deadd4 | [
"Apache-2.0"
] | null | null | null | examples/map_reduce_url.py | tomwhite/pywren-ibm-cloud | dbc87a6102d74284d03300e72e24a430c7deadd4 | [
"Apache-2.0"
] | null | null | null | """
Simple PyWren example using the map_reduce method which
counts the number of words inside each object specified
in 'iterdata' variable.
This example processes some objects which are in COS.
Be sure you have a bucket named 'sample_data' and the
objects object1, object2 and object3 inside it.
Otherwise, you can cha... | 35.57971 | 103 | 0.704684 |
import pywren_ibm_cloud as pywren
iterdata = ['https://archive.ics.uci.edu/ml/machine-learning-databases/bag-of-words/vocab.enron.txt',
'https://archive.ics.uci.edu/ml/machine-learning-databases/bag-of-words/vocab.kos.txt',
'https://archive.ics.uci.edu/ml/machine-learning-databases/bag-of-wor... | true | true |
f75486dbdec1e263d9a69908380417f1ef7e7ab8 | 14,616 | py | Python | muddery/launcher/utils.py | muddery/muddery | 8f9e16ea46d1f95f6497c6fa9bcfb64deb0285af | [
"BSD-3-Clause"
] | 127 | 2015-04-16T15:27:59.000Z | 2022-03-10T08:35:37.000Z | muddery/launcher/utils.py | muddery/muddery | 8f9e16ea46d1f95f6497c6fa9bcfb64deb0285af | [
"BSD-3-Clause"
] | 14 | 2015-12-17T08:02:18.000Z | 2022-01-30T15:15:38.000Z | muddery/launcher/utils.py | muddery/muddery | 8f9e16ea46d1f95f6497c6fa9bcfb64deb0285af | [
"BSD-3-Clause"
] | 54 | 2015-06-23T07:27:45.000Z | 2022-02-22T01:46:05.000Z | #!/usr/bin/env python
"""
"""
import os
import sys
import shutil
import configparser
import traceback
from pathlib import Path
from subprocess import check_output, CalledProcessError, STDOUT
import django.core.management
from evennia.server import evennia_launcher
from muddery.launcher import configs
# -------------... | 31.773913 | 120 | 0.639368 |
import os
import sys
import shutil
import configparser
import traceback
from pathlib import Path
from subprocess import check_output, CalledProcessError, STDOUT
import django.core.management
from evennia.server import evennia_launcher
from muddery.launcher import configs
def muddery_version():
version = "... | true | true |
f7548750f7276f8a624b35d28662b818d3634140 | 3,200 | py | Python | cloudify_azure/resources/network/networksecurityrule.py | diaperrash/cloudify-azure-plugin | dc495c294931168b012b60427e36e5a0738f2292 | [
"Apache-2.0"
] | null | null | null | cloudify_azure/resources/network/networksecurityrule.py | diaperrash/cloudify-azure-plugin | dc495c294931168b012b60427e36e5a0738f2292 | [
"Apache-2.0"
] | null | null | null | cloudify_azure/resources/network/networksecurityrule.py | diaperrash/cloudify-azure-plugin | dc495c294931168b012b60427e36e5a0738f2292 | [
"Apache-2.0"
] | null | null | null | # #######
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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
#
# Unles... | 35.555556 | 79 | 0.656563 | y import ctx
from cloudify_azure.resources.base import Resource
from cloudify.decorators import operation
from cloudify_azure import (constants, utils)
class NetworkSecurityRule(Resource):
def __init__(self,
resource_group=None,
network_security_group=None,
ap... | true | true |
f75488532f7074e5befe76a2bbfc945acd2372d9 | 5,147 | py | Python | cloudmersive_convert_api_client/models/get_xlsx_worksheets_request.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2018-07-25T23:04:34.000Z | 2021-08-10T16:43:10.000Z | cloudmersive_convert_api_client/models/get_xlsx_worksheets_request.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2020-11-23T10:46:48.000Z | 2021-12-30T14:09:34.000Z | cloudmersive_convert_api_client/models/get_xlsx_worksheets_request.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 2 | 2020-01-07T09:48:01.000Z | 2020-11-23T10:47:00.000Z | # coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class GetXlsxWorksheetsRequest(object... | 34.777027 | 255 | 0.612201 |
import pprint
import re
import six
class GetXlsxWorksheetsRequest(object):
swagger_types = {
'input_file_bytes': 'str',
'input_file_url': 'str'
}
attribute_map = {
'input_file_bytes': 'InputFileBytes',
'input_file_url': 'InputFileUrl'
}
def __init__(self, ... | true | true |
f7548856929225dd524e01a52726f8b7921d8ad9 | 712 | py | Python | platforms/csharp.py | jt28828/-fontawesome-enum-generator | 30b27885f3c3dadb5b17af5033b4c57169dda8f4 | [
"Unlicense"
] | null | null | null | platforms/csharp.py | jt28828/-fontawesome-enum-generator | 30b27885f3c3dadb5b17af5033b4c57169dda8f4 | [
"Unlicense"
] | null | null | null | platforms/csharp.py | jt28828/-fontawesome-enum-generator | 30b27885f3c3dadb5b17af5033b4c57169dda8f4 | [
"Unlicense"
] | null | null | null | from typing import Dict, TextIO
from utils.file import write_enum
from utils.string import to_pascal_case
def read_template() -> str:
template_file: TextIO = open("./file_templates/csharp-enum.cs", "r")
return template_file.read()
def as_enum_row(key: object, json: object) -> str:
enum_name = to_pascal... | 27.384615 | 72 | 0.695225 | from typing import Dict, TextIO
from utils.file import write_enum
from utils.string import to_pascal_case
def read_template() -> str:
template_file: TextIO = open("./file_templates/csharp-enum.cs", "r")
return template_file.read()
def as_enum_row(key: object, json: object) -> str:
enum_name = to_pascal... | true | true |
f75488685c24b69bdd07884c993e93fe57ea60bb | 2,324 | py | Python | pyscf/nao/test/test_0003_na2.py | fdmalone/pyscf | 021b17ac721e292b277d2b740e2ff8ab38bb6a4a | [
"Apache-2.0"
] | 1 | 2019-07-01T12:39:45.000Z | 2019-07-01T12:39:45.000Z | pyscf/nao/test/test_0003_na2.py | fdmalone/pyscf | 021b17ac721e292b277d2b740e2ff8ab38bb6a4a | [
"Apache-2.0"
] | null | null | null | pyscf/nao/test/test_0003_na2.py | fdmalone/pyscf | 021b17ac721e292b277d2b740e2ff8ab38bb6a4a | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2018 The PySCF Developers. 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 appl... | 31.835616 | 87 | 0.665663 |
from __future__ import print_function
import unittest
class KnowValues(unittest.TestCase):
def test_siesta2sv_df(self):
from pyscf import scf
from pyscf.nao.m_siesta_utils import get_siesta_command, get_pseudo
import subprocess
import os
siesta_fdf = """
xml.write ... | true | true |
f7548911d1af4d08641e4e305c3333857becc683 | 16,724 | py | Python | api/migrations/0043_auto__chg_field_page_url.py | haystack/eyebrowse-server | 582570a9af031efba77f4c50286fdc24dcec1e55 | [
"MIT"
] | 22 | 2015-03-10T12:53:36.000Z | 2022-03-01T15:15:39.000Z | api/migrations/0043_auto__chg_field_page_url.py | haystack/eyebrowse-server | 582570a9af031efba77f4c50286fdc24dcec1e55 | [
"MIT"
] | 135 | 2015-01-13T03:36:43.000Z | 2018-10-06T20:09:45.000Z | api/migrations/0043_auto__chg_field_page_url.py | haystack/eyebrowse-server | 582570a9af031efba77f4c50286fdc24dcec1e55 | [
"MIT"
] | 11 | 2015-03-12T21:07:32.000Z | 2018-07-26T16:58:53.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Page.url'
db.alter_column('api_page', 'url', self.gf('... | 78.149533 | 182 | 0.547835 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.alter_column('api_page', 'url', self.gf('django.db.models.fields.URLField')(max_length=2000... | true | true |
f7548bba5a65758f11bbf407dc79469a103c78b8 | 311 | py | Python | home/migrations/0003_rename_items_item.py | sakethrajesh/ToDoList | 9256fb5be99f69e7de1f5b58e48198838fc51c9c | [
"MIT"
] | null | null | null | home/migrations/0003_rename_items_item.py | sakethrajesh/ToDoList | 9256fb5be99f69e7de1f5b58e48198838fc51c9c | [
"MIT"
] | null | null | null | home/migrations/0003_rename_items_item.py | sakethrajesh/ToDoList | 9256fb5be99f69e7de1f5b58e48198838fc51c9c | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-11 14:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0002_items'),
]
operations = [
migrations.RenameModel(
old_name='Items',
new_name='Item',
),
]
| 17.277778 | 47 | 0.569132 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0002_items'),
]
operations = [
migrations.RenameModel(
old_name='Items',
new_name='Item',
),
]
| true | true |
f7548bd24ed85bcc7f6e3eed4f3324c8b868c25d | 2,226 | py | Python | src/python/WMCore/ACDC/CouchService.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | 1 | 2015-02-05T13:43:46.000Z | 2015-02-05T13:43:46.000Z | src/python/WMCore/ACDC/CouchService.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | 1 | 2016-10-13T14:57:35.000Z | 2016-10-13T14:57:35.000Z | src/python/WMCore/ACDC/CouchService.py | juztas/WMCore | f7e830a573d50fb1d7240797f18d809f994b934d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
CouchService.py
Created by Dave Evans on 2010-04-20.
Copyright (c) 2010 Fermilab. All rights reserved.
"""
from time import time
import WMCore.Database.CouchUtils as CouchUtils
class CouchService(object):
def __init__(self, **options):
super(CouchService, self... | 30.493151 | 116 | 0.632075 |
from time import time
import WMCore.Database.CouchUtils as CouchUtils
class CouchService(object):
def __init__(self, **options):
super(CouchService, self).__init__()
self.options = {}
self.options.update(options)
self.url = options.get('url', None)
self.database = option... | true | true |
f7548bd9f5836f7b600d2f43841d1ae43aa25aa1 | 1,459 | py | Python | zhmcclient/_version.py | zhmcclient/python-zhmcclient | 7d200afb0343a02535c52dc8b6ba0d224010075c | [
"Apache-2.0"
] | 30 | 2016-08-24T10:02:19.000Z | 2021-11-25T10:44:26.000Z | zhmcclient/_version.py | zhmcclient/python-zhmcclient | 7d200afb0343a02535c52dc8b6ba0d224010075c | [
"Apache-2.0"
] | 883 | 2016-08-23T12:32:12.000Z | 2022-03-28T13:18:24.000Z | zhmcclient/_version.py | zhmcclient/python-zhmcclient | 7d200afb0343a02535c52dc8b6ba0d224010075c | [
"Apache-2.0"
] | 25 | 2017-06-23T18:10:51.000Z | 2022-03-28T02:53:29.000Z | # Copyright 2016-2021 IBM Corp. 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 law or... | 34.738095 | 79 | 0.739548 |
import sys
__all__ = ['__version__']
__version__ = '1.2.0.dev1'
_PYTHON_M = sys.version_info[0]
_PYTHON_N = sys.version_info[1]
if _PYTHON_M == 2 and _PYTHON_N < 7:
raise RuntimeError('On Python 2, zhcmclient requires Python 2.7')
if _PYTHON_M == 3 and _PYTHON_N < 5:
raise RuntimeEr... | true | true |
f7548c0e65ce8a2ba467fdf3e9913d85e959d08b | 316 | py | Python | raw/root.py | mentix02/TheSmallProgrammingBook | 8f4574b074fb5f4f1c4e8d6cffe2f45929c76aa9 | [
"MIT"
] | 1 | 2020-02-29T22:07:02.000Z | 2020-02-29T22:07:02.000Z | raw/root.py | mentix02/TheSmallProgrammingBook | 8f4574b074fb5f4f1c4e8d6cffe2f45929c76aa9 | [
"MIT"
] | null | null | null | raw/root.py | mentix02/TheSmallProgrammingBook | 8f4574b074fb5f4f1c4e8d6cffe2f45929c76aa9 | [
"MIT"
] | null | null | null | def sqrt(n):
x0 = 1
while (x0 * x0) - 1 <= n:
x0 += 1
for _ in range(10):
x0 -= ( (x0**2 - n) / (x0 * 2) )
return x0
def root(n, p=2):
x0 = 1
while (x0 * x0) - 1 <= n:
x0 += 1
for _ in range(10):
x0 -= ( (x0**p - n) / (p * (x0 ** (p-1))) )
return x0
| 18.588235 | 51 | 0.360759 | def sqrt(n):
x0 = 1
while (x0 * x0) - 1 <= n:
x0 += 1
for _ in range(10):
x0 -= ( (x0**2 - n) / (x0 * 2) )
return x0
def root(n, p=2):
x0 = 1
while (x0 * x0) - 1 <= n:
x0 += 1
for _ in range(10):
x0 -= ( (x0**p - n) / (p * (x0 ** (p-1))) )
return x0
| true | true |
f7548c139f237a1a834f49146bfb1c22a0358b83 | 5,820 | py | Python | Scripts/Python/get_alerts_by_group.py | tsquillario/OpenManage-Enterprise | 7fbb46b10e9f7e0e22b8c0e828f671a02517c32c | [
"Apache-2.0"
] | null | null | null | Scripts/Python/get_alerts_by_group.py | tsquillario/OpenManage-Enterprise | 7fbb46b10e9f7e0e22b8c0e828f671a02517c32c | [
"Apache-2.0"
] | null | null | null | Scripts/Python/get_alerts_by_group.py | tsquillario/OpenManage-Enterprise | 7fbb46b10e9f7e0e22b8c0e828f671a02517c32c | [
"Apache-2.0"
] | null | null | null | #
# Python script using OME API to get alerts for a group.
#
# _author_ = Raajeev Kalyanaraman <Raajeev.Kalyanaraman@Dell.com>
# _version_ = 0.1
#
# Copyright (c) 2018 Dell EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 47.704918 | 111 | 0.565292 |
import sys
import argparse
from argparse import RawTextHelpFormatter
import json
import requests
import urllib3
def get_alerts_by_group(ip_address, user_name, password, filter_by, field):
try:
base_uri = 'https://%s' %(ip_address)
session_url = base_uri + "/api/SessionService/S... | true | true |
f7548c1765d256a3d9471d8f4e2f22fb1c09682b | 202 | py | Python | titan/api_pkg/extendspectypes/__init__.py | mnieber/moonleap | 2c951565c32f2e733a063b4a4f7b3d917ef1ec07 | [
"MIT"
] | null | null | null | titan/api_pkg/extendspectypes/__init__.py | mnieber/moonleap | 2c951565c32f2e733a063b4a4f7b3d917ef1ec07 | [
"MIT"
] | null | null | null | titan/api_pkg/extendspectypes/__init__.py | mnieber/moonleap | 2c951565c32f2e733a063b4a4f7b3d917ef1ec07 | [
"MIT"
] | null | null | null | from moonleap import Prop, extend
from moonleap.typespec.field_spec import FieldSpec
from . import props
@extend(FieldSpec)
class ExtendFieldSpec:
target_type_spec = Prop(props.target_type_spec)
| 20.2 | 51 | 0.811881 | from moonleap import Prop, extend
from moonleap.typespec.field_spec import FieldSpec
from . import props
@extend(FieldSpec)
class ExtendFieldSpec:
target_type_spec = Prop(props.target_type_spec)
| true | true |
f7548c3790252e7de1aeca8a10e1488fc4e3071d | 1,082 | py | Python | SerumWriter/Lib/__init__.py | serumstudio/SerumWriter | 5e212b49e8d3da3890cd685a985438d298db5e26 | [
"MIT"
] | 2 | 2022-03-24T05:29:02.000Z | 2022-03-24T11:01:44.000Z | SerumWriter/Lib/__init__.py | serumstudio/SerumWriter | 5e212b49e8d3da3890cd685a985438d298db5e26 | [
"MIT"
] | null | null | null | SerumWriter/Lib/__init__.py | serumstudio/SerumWriter | 5e212b49e8d3da3890cd685a985438d298db5e26 | [
"MIT"
] | null | null | null | # Copyright (c) 2022 Serum
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, su... | 51.52381 | 80 | 0.780961 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.