hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f770a140a8910b86647f9d1c6a589b8f02efc9c2 | 1,752 | py | Python | step_project/common/graph/project_graph.py | CroP-BioDiv/zcitools | 52332b4013486e983f962c085236189292228a02 | [
"MIT"
] | null | null | null | step_project/common/graph/project_graph.py | CroP-BioDiv/zcitools | 52332b4013486e983f962c085236189292228a02 | [
"MIT"
] | null | null | null | step_project/common/graph/project_graph.py | CroP-BioDiv/zcitools | 52332b4013486e983f962c085236189292228a02 | [
"MIT"
] | null | null | null | import os
from step_project.utils.import_methods import import_pygraphviz
from common_utils.file_utils import get_settings
def create_project_graph(project, output_filename='project_graph'):
# Nodes
nodes = []
edges = []
for d in sorted(os.listdir('.')):
if os.path.isdir(d) and os.path.isfile(... | 33.692308 | 83 | 0.637557 | import os
from step_project.utils.import_methods import import_pygraphviz
from common_utils.file_utils import get_settings
def create_project_graph(project, output_filename='project_graph'):
nodes = []
edges = []
for d in sorted(os.listdir('.')):
if os.path.isdir(d) and os.path.isfile(os.path.... | true | true |
f770a1d5438b34a308735d35264e612f64d4381a | 557 | py | Python | modules/response.py | NightKey/Server-monitoring-discord-bot | 69444953e2c7abd957cbfe7f0e3943f6fbf4b6b4 | [
"Unlicense"
] | 2 | 2020-02-24T02:15:30.000Z | 2022-03-30T05:26:18.000Z | modules/response.py | NightKey/Server-monitoring-discord-bot | 69444953e2c7abd957cbfe7f0e3943f6fbf4b6b4 | [
"Unlicense"
] | null | null | null | modules/response.py | NightKey/Server-monitoring-discord-bot | 69444953e2c7abd957cbfe7f0e3943f6fbf4b6b4 | [
"Unlicense"
] | null | null | null | class response:
codes = {"Bad request": 1, "Success": 2, "Internal error":3, "Denied":4, "Accepted":5}
def __init__(self, Response, Data=None, _bool=None):
"""Possible Responses: Bad request, Success, Internal error
"""
self.Response = Response
self.Data = Data
self.Code ... | 37.133333 | 90 | 0.624776 | class response:
codes = {"Bad request": 1, "Success": 2, "Internal error":3, "Denied":4, "Accepted":5}
def __init__(self, Response, Data=None, _bool=None):
self.Response = Response
self.Data = Data
self.Code = response.codes[Response]
self.bool = _bool
def create_altered(sel... | true | true |
f770a273bdf00f8aeec2c2b57f951cedafd1ac2e | 16,503 | py | Python | regexps.py | WDBell/Plex2 | 893bdfae4542227a68095b195b76c8a13e7023dd | [
"MIT"
] | 1 | 2019-07-31T03:40:13.000Z | 2019-07-31T03:40:13.000Z | regexps.py | WDBell/Plex2 | 893bdfae4542227a68095b195b76c8a13e7023dd | [
"MIT"
] | null | null | null | regexps.py | WDBell/Plex2 | 893bdfae4542227a68095b195b76c8a13e7023dd | [
"MIT"
] | null | null | null | """
Python Lexical Analyser
Regular Expressions
"""
import array
import string
import types
from sys import maxsize
from plex import errors
#
# Constants
#
BOL = 'bol'
EOL = 'eol'
EOF = 'eof'
nl_code = ord('\n')
#
# Helper functions
#
def chars_to_ranges(s):
"""
Return a... | 27.82968 | 80 | 0.556747 |
import array
import string
import types
from sys import maxsize
from plex import errors
BOL = 'bol'
EOL = 'eol'
EOF = 'eof'
nl_code = ord('\n')
def chars_to_ranges(s):
char_list = list(s)
char_list.sort()
i = 0
n = len(char_list)
result = []
while i < n:
c... | true | true |
f770a2ecdfbba4a7b9fca7cee95499e34d31107a | 88 | py | Python | apps/shuttle/devices/Shuttle/tests/test_shuttle.py | equinor/EIT-hub | 68b998c59d4deb3c6052ca7370dd107ae4df0703 | [
"MIT"
] | null | null | null | apps/shuttle/devices/Shuttle/tests/test_shuttle.py | equinor/EIT-hub | 68b998c59d4deb3c6052ca7370dd107ae4df0703 | [
"MIT"
] | 81 | 2020-06-02T10:09:53.000Z | 2020-09-24T10:05:42.000Z | apps/shuttle/devices/Shuttle/tests/test_shuttle.py | equinor/EIT-hub | 68b998c59d4deb3c6052ca7370dd107ae4df0703 | [
"MIT"
] | 2 | 2020-07-31T08:11:38.000Z | 2020-09-10T09:37:09.000Z | from shuttle import __version__
def test_version():
assert __version__ == '0.1.0'
| 14.666667 | 33 | 0.715909 | from shuttle import __version__
def test_version():
assert __version__ == '0.1.0'
| true | true |
f770a2f627cf2f0d5622ed65c01321b81f35d9c6 | 3,211 | py | Python | utils.py | HamzaG737/Kmml-challenge-code | c7ae3e26a7e02e4951758c683f29c23c2ab9b3e4 | [
"MIT"
] | null | null | null | utils.py | HamzaG737/Kmml-challenge-code | c7ae3e26a7e02e4951758c683f29c23c2ab9b3e4 | [
"MIT"
] | null | null | null | utils.py | HamzaG737/Kmml-challenge-code | c7ae3e26a7e02e4951758c683f29c23c2ab9b3e4 | [
"MIT"
] | null | null | null | from collections import defaultdict
from tqdm import tqdm
import csv
def get_sequence(data, k):
n = len(data)
dict_sequences = defaultdict(int)
id_ = 0
for x in tqdm(data):
for j in range(n - k + 1):
sequence = tuple(x[j : j + k])
if sequence not in dict_sequences:
... | 32.11 | 81 | 0.547182 | from collections import defaultdict
from tqdm import tqdm
import csv
def get_sequence(data, k):
n = len(data)
dict_sequences = defaultdict(int)
id_ = 0
for x in tqdm(data):
for j in range(n - k + 1):
sequence = tuple(x[j : j + k])
if sequence not in dict_sequences:
... | true | true |
f770a3c69814f58dbee80e9620e64c7847f27867 | 5,254 | py | Python | moi/sectors/migrations/0004_auto_20160302_0442.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | null | null | null | moi/sectors/migrations/0004_auto_20160302_0442.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | 33 | 2015-05-06T00:47:20.000Z | 2016-11-08T21:13:44.000Z | moi/sectors/migrations/0004_auto_20160302_0442.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-02 04:42
from __future__ import unicode_literals
import core.models
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
depen... | 210.16 | 4,733 | 0.763418 | from __future__ import unicode_literals
import core.models
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
dependencies = [
('sectors', '0003_auto_20160130_2141'),
]
o... | true | true |
f770a51ae17e11d4c6d504c1e323da5cc5108a0b | 276 | py | Python | terrascript/transloadit/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/transloadit/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/transloadit/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/transloadit/r.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class transloadit_template(terrascript.Resource):
pass
| 19.714286 | 79 | 0.782609 |
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class transloadit_template(terrascript.Resource):
pass
| true | true |
f770a558054c3a850ee524eab0debbeabe9fa183 | 3,054 | py | Python | CIM14/IEC61968/Assets/AssetFunction.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 58 | 2015-04-22T10:41:03.000Z | 2022-03-29T16:04:34.000Z | CIM14/IEC61968/Assets/AssetFunction.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 12 | 2015-08-26T03:57:23.000Z | 2020-12-11T20:14:42.000Z | CIM14/IEC61968/Assets/AssetFunction.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 35 | 2015-01-10T12:21:03.000Z | 2020-09-09T08:18:16.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | 38.175 | 123 | 0.677145 |
from CIM14.IEC61970.Core.IdentifiedObject import IdentifiedObject
class AssetFunction(IdentifiedObject):
def __init__(self, configID='', programID='', firmwareID='', password='', hardwareID='', Asset=None, *args, **kw_args):
self.configID = configID
self.programID = programID
... | true | true |
f770a5792ec43cef6c6c8ee66724569c3495e04c | 26,033 | py | Python | utils/exporters/blender/addons/io_three/exporter/api/mesh.py | alexan0308/three.js | 07343214c13697589632bbdc2793a22d120773df | [
"MIT"
] | null | null | null | utils/exporters/blender/addons/io_three/exporter/api/mesh.py | alexan0308/three.js | 07343214c13697589632bbdc2793a22d120773df | [
"MIT"
] | null | null | null | utils/exporters/blender/addons/io_three/exporter/api/mesh.py | alexan0308/three.js | 07343214c13697589632bbdc2793a22d120773df | [
"MIT"
] | null | null | null | import operator
from bpy import data, types, context
from . import material, texture, animation
from . import object as object_
from .. import constants, utilities, logger, exceptions
def _mesh(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:... | 26.429442 | 73 | 0.58906 | import operator
from bpy import data, types, context
from . import material, texture, animation
from . import object as object_
from .. import constants, utilities, logger, exceptions
def _mesh(func):
def inner(name, *args, **kwargs):
if isinstance(name, types.Mesh):
mesh = name
else... | true | true |
f770a6744b4a4c0a7e47f0dd4585fcc6eb976001 | 36,544 | py | Python | mmtbx/validation/sequence.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-18T12:31:57.000Z | 2022-03-14T06:27:06.000Z | mmtbx/validation/sequence.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/validation/sequence.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
from libtbx import easy_mp
from libtbx import str_utils
import libtbx.phil
from libtbx.utils import Sorry
from libtbx.test_utils import approx_equal_core
from libtbx import adopt_init_args, Auto
import sys
import iotbx.cif.model
from iotbx.pdb import mod... | 35.897839 | 151 | 0.640762 | from __future__ import absolute_import, division, print_function
from libtbx import easy_mp
from libtbx import str_utils
import libtbx.phil
from libtbx.utils import Sorry
from libtbx.test_utils import approx_equal_core
from libtbx import adopt_init_args, Auto
import sys
import iotbx.cif.model
from iotbx.pdb import mod... | true | true |
f770a6d4f1a5560724d82dabc5d72c7451a209cd | 6,366 | py | Python | test/functional/feature_nulldummy.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | null | null | null | test/functional/feature_nulldummy.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | 1 | 2021-07-12T07:38:58.000Z | 2021-07-12T07:38:58.000Z | test/functional/feature_nulldummy.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test NULLDUMMY softfork.
Connect to a single node.
Generate 2 blocks (save the coinbases for later).
G... | 52.180328 | 146 | 0.709237 |
from test_framework.blocktools import create_coinbase, create_block, create_transaction, add_witness_commitment
from test_framework.messages import CTransaction
from test_framework.script import CScript
from test_framework.test_framework import ChuckrumTestFramework
from test_framework.util import assert_equal, assert... | true | true |
f770a767387dd7cb9a0d01909be0ff4ddd8626a1 | 1,086 | py | Python | exec.40.py | Domingosws/Aprendendo.PYTHON.3 | f525e4324ab3fe33107b9c8cbea2deb61736d151 | [
"MIT"
] | 1 | 2022-02-01T04:22:56.000Z | 2022-02-01T04:22:56.000Z | exec.40.py | Domingosws/Aprendendo.PYTHON.3 | f525e4324ab3fe33107b9c8cbea2deb61736d151 | [
"MIT"
] | null | null | null | exec.40.py | Domingosws/Aprendendo.PYTHON.3 | f525e4324ab3fe33107b9c8cbea2deb61736d151 | [
"MIT"
] | null | null | null | #Faça um programa que leia o ano de nascimento de um jovem e informe, de acordo com a sua idade,
# se ele ainda vai se alistar ao serviço militar, se é a hora exata de se alistar ou se já passou do tempo do alistamento.
# Seu programa também deverá mostrar o tempo que falta ou que passou do prazo
from datetime import d... | 51.714286 | 122 | 0.685083 | from datetime import date
atual = date.today().year
nasc = int(input('\033[1;32mAno de nacimento: \033[m'))
idade = atual - nasc
print('\033[1;33mQuem naceu em {} tem {} anos em {}. \033[m'.format(nasc, idade, atual))
if idade == 18:
print('\033[1;35mVocê tem que se alistar\033[m \033[1;4;31mIMEDIATAMENTE!\033[m')... | true | true |
f770a7d55efa5e1b683814e7eed506ab6b4f4ab4 | 14,715 | py | Python | tensorflow_probability/python/internal/backend/numpy/numpy_array.py | rupei/probability | 4aa1ee652853a19c4e80d39216c3fa535ed3e589 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/numpy_array.py | rupei/probability | 4aa1ee652853a19c4e80d39216c3fa535ed3e589 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/numpy_array.py | rupei/probability | 4aa1ee652853a19c4e80d39216c3fa535ed3e589 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability 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 o... | 30.402893 | 111 | 0.680802 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
import numpy as onp
from tensorflow_probability.python.internal.backend.numpy import _utils as utils
from tensorflow_probability.python.internal.backend.numpy import ops
f... | true | true |
f770a86f0ec385f58a99e38905a28d6559b1f48e | 310 | py | Python | acceptance_tests/tests/tests/test_composition.py | arnaud-morvan/c2cwsgiutils | aa06b77b247bd8969b88225ee3ea109886aefeac | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | acceptance_tests/tests/tests/test_composition.py | arnaud-morvan/c2cwsgiutils | aa06b77b247bd8969b88225ee3ea109886aefeac | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | acceptance_tests/tests/tests/test_composition.py | arnaud-morvan/c2cwsgiutils | aa06b77b247bd8969b88225ee3ea109886aefeac | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import subprocess
def test_run(app_connection, composition):
composition.run('run_test', 'true')
def test_run_timeout(app_connection, composition):
try:
composition.run('run_test', 'sleep', '5', timeout=1)
assert False
except subprocess.TimeoutExpired:
pass # Expected
| 22.142857 | 60 | 0.690323 | import subprocess
def test_run(app_connection, composition):
composition.run('run_test', 'true')
def test_run_timeout(app_connection, composition):
try:
composition.run('run_test', 'sleep', '5', timeout=1)
assert False
except subprocess.TimeoutExpired:
pass | true | true |
f770a8dd22d0f0c5219ce6402882c05bee64cb2d | 3,201 | py | Python | os_scrapy_record/utils.py | zanachka/os-scrapy-record | 03d0cafbea74c981a72d5d7c8a3e28f05e487689 | [
"MIT"
] | 2 | 2020-05-13T12:55:01.000Z | 2020-07-24T06:52:49.000Z | os_scrapy_record/utils.py | zanachka/os-scrapy-record | 03d0cafbea74c981a72d5d7c8a3e28f05e487689 | [
"MIT"
] | 1 | 2020-05-22T09:03:04.000Z | 2020-05-22T09:31:45.000Z | os_scrapy_record/utils.py | zanachka/os-scrapy-record | 03d0cafbea74c981a72d5d7c8a3e28f05e487689 | [
"MIT"
] | 2 | 2020-07-21T00:54:09.000Z | 2020-10-29T18:10:03.000Z | from typing import Type, Union
from idna.core import IDNAError
from scrapy.core.downloader.handlers.http11 import TunnelError
from scrapy.exceptions import IgnoreRequest
from scrapy.http.response import Request, Response
from scrapy.spidermiddlewares.httperror import HttpError
from twisted.internet.defer import Cancel... | 27.358974 | 86 | 0.720712 | from typing import Type, Union
from idna.core import IDNAError
from scrapy.core.downloader.handlers.http11 import TunnelError
from scrapy.exceptions import IgnoreRequest
from scrapy.http.response import Request, Response
from scrapy.spidermiddlewares.httperror import HttpError
from twisted.internet.defer import Cancel... | true | true |
f770aaf6b346115b206787e2732889c5bcf5e66e | 9,872 | py | Python | suzieq/poller/services/evpnVni.py | foobug/suzieq | c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5 | [
"Apache-2.0"
] | null | null | null | suzieq/poller/services/evpnVni.py | foobug/suzieq | c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5 | [
"Apache-2.0"
] | null | null | null | suzieq/poller/services/evpnVni.py | foobug/suzieq | c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5 | [
"Apache-2.0"
] | null | null | null | import re
import numpy as np
from suzieq.poller.services.service import Service
from suzieq.utils import (convert_rangestring_to_list,
convert_macaddr_format_to_colon)
class EvpnVniService(Service):
"""evpnVni service. Different class because output needs to be munged"""
def clean_... | 39.967611 | 81 | 0.443375 | import re
import numpy as np
from suzieq.poller.services.service import Service
from suzieq.utils import (convert_rangestring_to_list,
convert_macaddr_format_to_colon)
class EvpnVniService(Service):
def clean_json_input(self, data):
devtype = data.get("devtype", None)
... | true | true |
f770ab344b820e7b8c1a5c7f684d5e279e67828f | 33 | py | Python | src/validator/__init__.py | boconlonton/data-validation-sb | 9522562e9373225119c7f14eb3f57f9127912df5 | [
"MIT"
] | 27 | 2022-03-10T04:15:48.000Z | 2022-03-31T03:20:21.000Z | src/validator/__init__.py | boconlonton/data-validation-sb | 9522562e9373225119c7f14eb3f57f9127912df5 | [
"MIT"
] | 4 | 2019-08-16T14:23:19.000Z | 2022-03-02T14:57:34.000Z | src/validator/__init__.py | boconlonton/data-validation-sb | 9522562e9373225119c7f14eb3f57f9127912df5 | [
"MIT"
] | 2 | 2022-03-19T08:41:03.000Z | 2022-03-28T14:11:41.000Z | from .validator import Validator
| 16.5 | 32 | 0.848485 | from .validator import Validator
| true | true |
f770accdf53b75caf2235ff618a5c7e00306e2f1 | 466 | py | Python | env/Lib/site-packages/plotly/validators/bar/hoverlabel/font/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/bar/hoverlabel/font/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/bar/hoverlabel/font/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="bar.hoverlabel.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | 31.066667 | 78 | 0.641631 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="bar.hoverlabel.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | true | true |
f770ae87817cdd3dbb599733a2bbb331db89de9c | 2,871 | py | Python | fn-prevalence-predictor/preprocess_helpers.py | disarm-platform/fn-prevalence-predictor | 759267a7f675c4da826e86456d9b62595de01ffd | [
"MIT"
] | null | null | null | fn-prevalence-predictor/preprocess_helpers.py | disarm-platform/fn-prevalence-predictor | 759267a7f675c4da826e86456d9b62595de01ffd | [
"MIT"
] | 19 | 2019-03-07T09:00:51.000Z | 2020-03-09T16:20:24.000Z | fn-prevalence-predictor/preprocess_helpers.py | disarm-platform/fn-prevalence-predictor | 759267a7f675c4da826e86456d9b62595de01ffd | [
"MIT"
] | 1 | 2019-08-01T12:33:00.000Z | 2019-08-01T12:33:00.000Z | import base64
import hashlib
import json
import os
import uuid
from urllib.parse import urlparse
from urllib.request import urlretrieve
# Mutates the params, replacing with local temporary file if required
import tempdir
# Param must exist
def required_exists(key, params):
if key not in params:
raise Valu... | 26.33945 | 86 | 0.703936 | import base64
import hashlib
import json
import os
import uuid
from urllib.parse import urlparse
from urllib.request import urlretrieve
import tempdir
def required_exists(key, params):
if key not in params:
raise ValueError(f'Required param \'{key}\' not received.')
def is_type(key, params: dict, param_t... | true | true |
f770af76ca2063836703260a8c00fb6785baed0f | 3,279 | py | Python | configs/SETR/SETR_PUP_768x768_40k_cityscapes_bs_8_MS.py | zbwxp/SETR | b921cb115610e5651c63e8993965fd3bb009159d | [
"MIT"
] | 789 | 2020-12-30T10:20:37.000Z | 2022-03-30T15:09:13.000Z | configs/SETR/SETR_PUP_768x768_40k_cityscapes_bs_8_MS.py | zbwxp/SETR | b921cb115610e5651c63e8993965fd3bb009159d | [
"MIT"
] | 51 | 2021-01-01T11:21:13.000Z | 2022-03-31T01:16:26.000Z | configs/SETR/SETR_PUP_768x768_40k_cityscapes_bs_8_MS.py | zbwxp/SETR | b921cb115610e5651c63e8993965fd3bb009159d | [
"MIT"
] | 119 | 2021-01-02T14:27:41.000Z | 2022-03-30T06:07:29.000Z | _base_ = [
'../_base_/models/setr_naive_pup.py',
'../_base_/datasets/cityscapes_768x768.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_40k.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
backbone=dict(img_size=768, align_corners=False,
pos_emb... | 32.465347 | 97 | 0.601098 | _base_ = [
'../_base_/models/setr_naive_pup.py',
'../_base_/datasets/cityscapes_768x768.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_40k.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
backbone=dict(img_size=768, align_corners=False,
pos_emb... | true | true |
f770b02e7b0c041da7c2d57e126b3a0778aab045 | 620 | py | Python | teamsync/management/commands/add_users.py | uw-it-aca/teamsync | d5e287146b0a1d0f614ec218b533496ff317f0da | [
"Apache-2.0"
] | 1 | 2020-01-30T18:57:00.000Z | 2020-01-30T18:57:00.000Z | teamsync/management/commands/add_users.py | uw-it-aca/teamsync | d5e287146b0a1d0f614ec218b533496ff317f0da | [
"Apache-2.0"
] | null | null | null | teamsync/management/commands/add_users.py | uw-it-aca/teamsync | d5e287146b0a1d0f614ec218b533496ff317f0da | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from teamsync.dao.github.organizations import get_members_for_org
from teamsync.models import User
class Command(BaseCommand):
help = 'Adds users from GitHub'
def handle(self, *args, **options):
org_id ... | 32.631579 | 65 | 0.685484 | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from teamsync.dao.github.organizations import get_members_for_org
from teamsync.models import User
class Command(BaseCommand):
help = 'Adds users from GitHub'
def handle(self, *args, **options):
org_id ... | true | true |
f770b0c01550b91135712757f8cf723efec12697 | 1,988 | py | Python | strings/findSubstringWithGivenHashValue.py | kushvr7/High-On-DSA | d424bd48e35ebd1a588d96c1c0dcb5a9c47a0ef1 | [
"MIT"
] | 76 | 2021-12-12T08:42:20.000Z | 2022-03-31T19:48:46.000Z | strings/findSubstringWithGivenHashValue.py | kushvr7/High-On-DSA | d424bd48e35ebd1a588d96c1c0dcb5a9c47a0ef1 | [
"MIT"
] | 4 | 2022-01-04T09:58:39.000Z | 2022-03-30T17:00:39.000Z | strings/findSubstringWithGivenHashValue.py | kushvr7/High-On-DSA | d424bd48e35ebd1a588d96c1c0dcb5a9c47a0ef1 | [
"MIT"
] | 13 | 2021-12-12T14:44:41.000Z | 2022-03-10T14:08:20.000Z | # https://leetcode.com/problems/find-substring-with-given-hash-value/
# Concept : https://www.youtube.com/watch?v=BfUejqd07yo
# Solution : https://www.youtube.com/watch?v=P7dX86HdNqc&t=895s
# Solution : https://www.youtube.com/watch?v=bmX2_mal8YQ&t=611s
class Solution(object):
# Submittted by @Jiganesh
... | 22.088889 | 145 | 0.523139 |
class Solution(object):
def subStrHash(self, s, power, modulo, k, hashValue):
s = s[::-1]
firstSubstringValue = ord(s[0])%96
for i in range(1,k):
firstSubstringValue = (firstSubstringValue*power+ ord(s[i])-96)
res = s[0:0+k][:-1]
for i ... | true | true |
f770b1623be468712d9357ef2e0a2ca1e5b7b131 | 15,639 | py | Python | jupyterlab_git/handlers.py | ben-mds/jupyterlab-git | de96a493e42aa590814b5677a8eec2b7341ed1ee | [
"BSD-3-Clause"
] | null | null | null | jupyterlab_git/handlers.py | ben-mds/jupyterlab-git | de96a493e42aa590814b5677a8eec2b7341ed1ee | [
"BSD-3-Clause"
] | null | null | null | jupyterlab_git/handlers.py | ben-mds/jupyterlab-git | de96a493e42aa590814b5677a8eec2b7341ed1ee | [
"BSD-3-Clause"
] | null | null | null | """
Module with all the individual handlers, which execute git commands and return the results to the frontend.
"""
import json
import os
from notebook.utils import url_path_join as ujoin, url2path
from notebook.base.handlers import APIHandler
class GitHandler(APIHandler):
"""
Top-level parent class.
"""... | 30.48538 | 120 | 0.601189 | import json
import os
from notebook.utils import url_path_join as ujoin, url2path
from notebook.base.handlers import APIHandler
class GitHandler(APIHandler):
@property
def git(self):
return self.settings["git"]
class GitCloneHandler(GitHandler):
def post(self):
data = json.loads(self.r... | true | true |
f770b1bd752eb2e8d7ae5cfe116524c870b75015 | 6,092 | py | Python | qa/rpc-tests/proxy_test.py | maskott/bwrgocoin | 35bdd4c4b6a7cbbf8d7da5b711b1be30c3241cf1 | [
"MIT"
] | 1 | 2019-10-08T02:56:35.000Z | 2019-10-08T02:56:35.000Z | qa/rpc-tests/proxy_test.py | maskott/bwrgocoin | 35bdd4c4b6a7cbbf8d7da5b711b1be30c3241cf1 | [
"MIT"
] | 1 | 2019-10-14T15:31:36.000Z | 2019-10-14T15:31:36.000Z | qa/rpc-tests/proxy_test.py | maskott/bwrgocoin | 35bdd4c4b6a7cbbf8d7da5b711b1be30c3241cf1 | [
"MIT"
] | 1 | 2019-10-08T02:56:39.000Z | 2019-10-08T02:56:39.000Z | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... | 41.726027 | 145 | 0.652659 | import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework import BitcoinTestFramework
from util import *
class ProxyTest(BitcoinTestFramework):
def __init__(self):
se... | true | true |
f770b21e91e58cb2dad97417662164baf5490981 | 858 | py | Python | src/hyper-model/hypermodel/cli/groups/deploy.py | GrowingData/hyper-model | 7034e8426780618ec97ba3d8a48c85be192554f4 | [
"Apache-2.0"
] | 16 | 2019-10-24T01:09:03.000Z | 2022-02-03T15:24:13.000Z | src/hyper-model/hypermodel/cli/groups/deploy.py | hypermodel/hyper-model | d1a0bd949ef6d20d2cf239ccfef1f1dc267277c0 | [
"Apache-2.0"
] | 2 | 2019-10-24T01:20:37.000Z | 2019-10-30T00:28:38.000Z | src/hyper-model/hypermodel/cli/groups/deploy.py | GrowingData/hyper-model | 7034e8426780618ec97ba3d8a48c85be192554f4 | [
"Apache-2.0"
] | 9 | 2019-10-24T01:09:08.000Z | 2021-11-11T21:47:27.000Z | import click
import os
import kfp
import sys
import yaml
import importlib
import importlib.util
import inspect
from hypermodel.kubeflow.deploy_prod import deploy_to_prod
@click.group()
@click.pass_context
def deploy(ctx):
"""Deploy to Kubeflow"""
pass
@deploy.command()
@click.option("-f", "--file", required... | 30.642857 | 129 | 0.737762 | import click
import os
import kfp
import sys
import yaml
import importlib
import importlib.util
import inspect
from hypermodel.kubeflow.deploy_prod import deploy_to_prod
@click.group()
@click.pass_context
def deploy(ctx):
pass
@deploy.command()
@click.option("-f", "--file", required=False, default="pipelines.ym... | true | true |
f770b2dd2cf4253d5f48f36718f18b0684bac008 | 19,116 | py | Python | astropy/nddata/tests/test_utils.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | 1 | 2022-03-02T17:07:20.000Z | 2022-03-02T17:07:20.000Z | astropy/nddata/tests/test_utils.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | 11 | 2017-12-18T16:27:29.000Z | 2018-08-29T14:54:22.000Z | astropy/nddata/tests/test_utils.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | 1 | 2018-08-02T09:33:21.000Z | 2018-08-02T09:33:21.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ...tests.helper import assert_quantity_allclose
from ..utils import (extract_array, add_array, subpixel_indices,
block_reduce, block_replicate,
... | 38.003976 | 105 | 0.581764 |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ...tests.helper import assert_quantity_allclose
from ..utils import (extract_array, add_array, subpixel_indices,
block_reduce, block_replicate,
overlap_slices, NoOverlapError, PartialOverlapError,... | true | true |
f770b32f2bcdb0e265959865d6abb605681ebd0b | 1,217 | py | Python | modelling/convertors.py | Matrixeigs/energy_management_system | b2af6a3cfa71173f33d798e943f605d802aed19f | [
"MIT"
] | 68 | 2017-11-21T02:49:11.000Z | 2022-03-25T07:14:42.000Z | modelling/convertors.py | yifeili/energy_management_system | b2af6a3cfa71173f33d798e943f605d802aed19f | [
"MIT"
] | null | null | null | modelling/convertors.py | yifeili/energy_management_system | b2af6a3cfa71173f33d798e943f605d802aed19f | [
"MIT"
] | 34 | 2017-11-21T02:52:15.000Z | 2022-03-27T14:35:25.000Z | # Convertor models for universal energy management system
# The models include the following types of convertors.
# 1) Bidirectional convertors
# 2) Unidirectional convertors
# 3) Introducing measurement value P_AC2DC, P_DC2AC, Q_AC
import configuration.configuration_convertors as default_parameters
#################... | 45.074074 | 78 | 0.685292 |
import configuration.configuration_convertors as default_parameters
BIC = \
{
"AREA": default_parameters.BIC["AREA"],
"STATUS": default_parameters.BIC["STATUS"],
"CAP": default_parameters.BIC["CAP"],
"EFF_AC2DC": default_parameters.BIC["EFF_AC2DC"],
"EFF_DC2AC": default_par... | true | true |
f770b40a582b3c1b48253e26737c8cd27cedd0d4 | 4,775 | py | Python | train_SE2DINNet.py | mateussangalli/SE2DINNets | c4d9b6d2577a5044c243d0eb80ebe5879a7673c9 | [
"MIT"
] | 2 | 2022-02-21T16:29:47.000Z | 2022-02-21T16:29:50.000Z | train_SE2DINNet.py | mateussangalli/SE2DINNets | c4d9b6d2577a5044c243d0eb80ebe5879a7673c9 | [
"MIT"
] | null | null | null | train_SE2DINNet.py | mateussangalli/SE2DINNets | c4d9b6d2577a5044c243d0eb80ebe5879a7673c9 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from tensorflow.keras import layers, regularizers
from tensorflow.keras.utils import to_categorical
import matplotlib.pyplot as plt
import os
import argparse
from SE2DIN import *
from load_data import load_data
mnist_rot_dir = 'mnist_rot'
mnist_12k_dir = 'mnist12k'
model_... | 39.791667 | 148 | 0.740733 | import tensorflow as tf
import numpy as np
from tensorflow.keras import layers, regularizers
from tensorflow.keras.utils import to_categorical
import matplotlib.pyplot as plt
import os
import argparse
from SE2DIN import *
from load_data import load_data
mnist_rot_dir = 'mnist_rot'
mnist_12k_dir = 'mnist12k'
model_... | true | true |
f770b5874d0d39d66b112f721baa863c3abdd317 | 1,691 | py | Python | basic/sprite_test/sprite_test.py | manzyun/pygame | e298c6a5fe9fbdf7fc2fa897605ad308c1595daa | [
"MIT"
] | 11 | 2017-04-08T15:24:15.000Z | 2021-12-12T03:16:34.000Z | basic/sprite_test/sprite_test.py | manzyun/pygame | e298c6a5fe9fbdf7fc2fa897605ad308c1595daa | [
"MIT"
] | null | null | null | basic/sprite_test/sprite_test.py | manzyun/pygame | e298c6a5fe9fbdf7fc2fa897605ad308c1595daa | [
"MIT"
] | 7 | 2017-05-14T05:37:01.000Z | 2021-12-12T03:16:42.000Z | #!/usr/bin/env python
import pygame
from pygame.locals import *
import sys
SCR_RECT = Rect(0, 0, 640, 480)
class MySprite(pygame.sprite.Sprite):
def __init__(self, filename, x, y, vx, vy):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(filename).convert_alpha()
width = ... | 25.621212 | 67 | 0.586635 | import pygame
from pygame.locals import *
import sys
SCR_RECT = Rect(0, 0, 640, 480)
class MySprite(pygame.sprite.Sprite):
def __init__(self, filename, x, y, vx, vy):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(filename).convert_alpha()
width = self.image.get_width()... | true | true |
f770b6505dd6430d96bc7d67fd5043d769433622 | 140,098 | py | Python | tests/test_constants.py | laf-rge/jupyterhub-samlauthenticator | a63e1411e328bcafd8f9113857057b842ff9f5df | [
"MIT"
] | 26 | 2019-04-25T20:07:04.000Z | 2020-09-27T21:10:00.000Z | tests/test_constants.py | laf-rge/jupyterhub-samlauthenticator | a63e1411e328bcafd8f9113857057b842ff9f5df | [
"MIT"
] | 45 | 2019-05-06T09:52:50.000Z | 2020-09-16T16:47:09.000Z | tests/test_constants.py | laf-rge/jupyterhub-samlauthenticator | a63e1411e328bcafd8f9113857057b842ff9f5df | [
"MIT"
] | 15 | 2019-04-25T18:10:40.000Z | 2020-10-29T15:24:25.000Z | '''
(C) Copyright 2019 Hewlett Packard Enterprise Development LP
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, ... | 98.660563 | 7,266 | 0.913296 | from collections import namedtuple
from datetime import datetime, timezone
sample_metadata_xml = '''<?xml version="1.0"?><EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://app.onelogin.com/saml/metadata/719630"><IDPSSODescriptor xmlns:ds="http://www.w3.org/2000/09/xmldsig#" protocolSuppor... | true | true |
f770b6667bb0fe873a2041ac3de976370b630ae7 | 5,191 | py | Python | generator/core/composer.py | manosriram/deepo | e6d733e6fcb84212a5804339f668bbe159941ff5 | [
"MIT"
] | null | null | null | generator/core/composer.py | manosriram/deepo | e6d733e6fcb84212a5804339f668bbe159941ff5 | [
"MIT"
] | null | null | null | generator/core/composer.py | manosriram/deepo | e6d733e6fcb84212a5804339f668bbe159941ff5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import textwrap
import functools
class Composer(object):
def __init__(self, modules, cuda_ver, cudnn_ver, ubuntu_ver, workspace, versions={}):
if len(modules) == 0:
raise ValueError('Modules should contain at least one module')
pending = self._traverse(modules)
... | 37.890511 | 134 | 0.470237 | import textwrap
import functools
class Composer(object):
def __init__(self, modules, cuda_ver, cudnn_ver, ubuntu_ver, workspace, versions={}):
if len(modules) == 0:
raise ValueError('Modules should contain at least one module')
pending = self._traverse(modules)
self.modules = [m... | true | true |
f770b6972463659c71619c8f8b95b0f022daf42c | 10,346 | py | Python | rssant_feedlib/async_reader.py | dumpmemory/rssant | 8bacf91bedc2d2fa35f3e8b0f6a8b8c2a712c1a6 | [
"BSD-3-Clause"
] | null | null | null | rssant_feedlib/async_reader.py | dumpmemory/rssant | 8bacf91bedc2d2fa35f3e8b0f6a8b8c2a712c1a6 | [
"BSD-3-Clause"
] | null | null | null | rssant_feedlib/async_reader.py | dumpmemory/rssant | 8bacf91bedc2d2fa35f3e8b0f6a8b8c2a712c1a6 | [
"BSD-3-Clause"
] | null | null | null | import socket
import ssl
import asyncio
import logging
import concurrent.futures
from http import HTTPStatus
import aiodns
import aiohttp
from rssant_common import _proxy_helper
from rssant_common.helper import aiohttp_client_session
from rssant_common.dns_service import (
DNSService, DNS_SERVICE,
PrivateAddr... | 39.792308 | 95 | 0.635221 | import socket
import ssl
import asyncio
import logging
import concurrent.futures
from http import HTTPStatus
import aiodns
import aiohttp
from rssant_common import _proxy_helper
from rssant_common.helper import aiohttp_client_session
from rssant_common.dns_service import (
DNSService, DNS_SERVICE,
PrivateAddr... | true | true |
f770b69d65368440f0c0ff7d106115fc8054cdf4 | 4,168 | py | Python | lst.py | Ayon134/code_for_Kids | d90698bb38efe5e26c31f02bd129bfdadea158e2 | [
"MIT"
] | null | null | null | lst.py | Ayon134/code_for_Kids | d90698bb38efe5e26c31f02bd129bfdadea158e2 | [
"MIT"
] | null | null | null | lst.py | Ayon134/code_for_Kids | d90698bb38efe5e26c31f02bd129bfdadea158e2 | [
"MIT"
] | 2 | 2021-01-08T03:52:46.000Z | 2021-04-01T19:16:12.000Z | import cv2
import io
from PIL import Image, ImageEnhance
import pytesseract
from wand.image import Image as wi
import re
import pandas as pd
from PyPDF2 import PdfFileWriter, PdfFileReader
from pdf2image import convert_from_path
claim = '15232353'
file = "a.pdf"
pages_to_keep = [0]
infile = PdfFileReader(file, 'rb')
... | 19.568075 | 114 | 0.659309 | import cv2
import io
from PIL import Image, ImageEnhance
import pytesseract
from wand.image import Image as wi
import re
import pandas as pd
from PyPDF2 import PdfFileWriter, PdfFileReader
from pdf2image import convert_from_path
claim = '15232353'
file = "a.pdf"
pages_to_keep = [0]
infile = PdfFileReader(file, 'rb')
... | true | true |
f770b6c17fd1030e98de5c2942e45ec74082fd7e | 526 | py | Python | fuzzer-code/tools/get_retc.py | LockOne/vuzzer64 | 3b443c54399b76b86bc68a74804a69e57cb9c256 | [
"Apache-2.0"
] | null | null | null | fuzzer-code/tools/get_retc.py | LockOne/vuzzer64 | 3b443c54399b76b86bc68a74804a69e57cb9c256 | [
"Apache-2.0"
] | null | null | null | fuzzer-code/tools/get_retc.py | LockOne/vuzzer64 | 3b443c54399b76b86bc68a74804a69e57cb9c256 | [
"Apache-2.0"
] | null | null | null | import sys
import os
import subprocess
import pickle
import math
if len(sys.argv) != 3:
print("python3 get_non_crash.py TC_path execute_command")
exit()
o1 = open("retc.out", "w")
o1.write("tc, ret code, stdout\n")
for fi in os.listdir(sys.argv[1]):
runcmd = sys.argv[2] % (sys.argv[1] + fi)
proc = subprocess... | 23.909091 | 93 | 0.671103 | import sys
import os
import subprocess
import pickle
import math
if len(sys.argv) != 3:
print("python3 get_non_crash.py TC_path execute_command")
exit()
o1 = open("retc.out", "w")
o1.write("tc, ret code, stdout\n")
for fi in os.listdir(sys.argv[1]):
runcmd = sys.argv[2] % (sys.argv[1] + fi)
proc = subprocess... | true | true |
f770b9d5ebf3428a484570e04d5960c778a9a558 | 2,983 | py | Python | homeassistant/components/switch/android_ip_webcam.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | homeassistant/components/switch/android_ip_webcam.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | homeassistant/components/switch/android_ip_webcam.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2018-08-29T19:26:20.000Z | 2020-01-19T11:58:22.000Z | """
Support for IP Webcam settings.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.android_ip_webcam/
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.android_ip_webcam import (
KEY_MAP, ICON_MAP, DAT... | 32.78022 | 79 | 0.657057 |
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.android_ip_webcam import (
KEY_MAP, ICON_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST,
CONF_NAME, CONF_SWITCHES)
DEPENDENCIES = ['android_ip_webcam']
async def async_setup_platform(hass, config, async_add_entities,
... | true | true |
f770ba481240f7727cefbf95bf984288680e7308 | 6,172 | py | Python | recipes/cctag/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/cctag/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/cctag/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
required_conan_version = ">=1.43.0"
class CCTagConan(ConanFile):
name = "cctag"
description = "Detection of CCTag markers made up of concentric circles."
license = "MPL-2.0"
topic... | 39.819355 | 102 | 0.617304 | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
required_conan_version = ">=1.43.0"
class CCTagConan(ConanFile):
name = "cctag"
description = "Detection of CCTag markers made up of concentric circles."
license = "MPL-2.0"
topic... | true | true |
f770ba8150f5e4c07478970c5177b057b74aef0a | 9,698 | py | Python | decision_tree/decision_tree.py | giangtranml/framgia-training | c7fb343bd43b1bceb241b447ff956febb99c94a8 | [
"MIT"
] | 1 | 2020-08-06T09:39:42.000Z | 2020-08-06T09:39:42.000Z | decision_tree/decision_tree.py | giangtranml/framgia-training | c7fb343bd43b1bceb241b447ff956febb99c94a8 | [
"MIT"
] | null | null | null | decision_tree/decision_tree.py | giangtranml/framgia-training | c7fb343bd43b1bceb241b447ff956febb99c94a8 | [
"MIT"
] | null | null | null | """
Author: Giang Tran.
"""
import numpy as np
from math import log2
class NodeDT:
"""
Class Node represents in Decision Tree
"""
def __init__(self, X, y, feature_name):
self.feature_name = feature_name
self.X = X
self.y = y
self.is_leaf = False
self.label = N... | 39.104839 | 123 | 0.600639 |
import numpy as np
from math import log2
class NodeDT:
def __init__(self, X, y, feature_name):
self.feature_name = feature_name
self.X = X
self.y = y
self.is_leaf = False
self.label = None
self.used = []
def entropy(self):
n = len(self.y)
sum_... | true | true |
f770ba96e75d9cb555299cbcefa4682f6b7b8c7a | 1,568 | py | Python | raxcli/concurrency/__init__.py | racker/python-raxcli | c59d7ef9abca0a7cea56882113bd71feb6c5c6ef | [
"Apache-2.0"
] | 1 | 2020-01-16T09:45:28.000Z | 2020-01-16T09:45:28.000Z | raxcli/concurrency/__init__.py | racker/python-raxcli | c59d7ef9abca0a7cea56882113bd71feb6c5c6ef | [
"Apache-2.0"
] | null | null | null | raxcli/concurrency/__init__.py | racker/python-raxcli | c59d7ef9abca0a7cea56882113bd71feb6c5c6ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Rackspace
#
# 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... | 29.037037 | 74 | 0.746811 |
__all__ = [
'get_pool',
'run_function',
'join_pool'
]
import os
import sys
try:
import gevent
gevent
gevent_available = True
except ImportError:
gevent_available = False
DEFAULT_BACKEND = 'noop'
BACKEND = DEFAULT_BACKEND
USE_GEVENT = os.getenv('RAXCLI_USE_GEVENT')
if USE_GEVENT and ge... | true | true |
f770bac98a8c1c63a4f1582f44b10b686cfc300e | 10,238 | py | Python | vulnerabilities/importers/github.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/github.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/github.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in compliance... | 39.376923 | 100 | 0.576382 |
import asyncio
import os
import dataclasses
import json
from typing import Set
from typing import Tuple
from typing import List
from typing import Mapping
from typing import Optional
import requests
from dephell_specifier import RangeSpecifier
from packageurl import PackageURL
from vulnerabilities.data_source import... | true | true |
f770bb2660904eae74af166bc7e721bb4698ceca | 685 | py | Python | app/core/migrations/0003_ingredient.py | elomat/recipe-app-api | 11e77a10b3d9c16270e694867fd8b36ccefcd5be | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | elomat/recipe-app-api | 11e77a10b3d9c16270e694867fd8b36ccefcd5be | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | elomat/recipe-app-api | 11e77a10b3d9c16270e694867fd8b36ccefcd5be | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2020-03-05 10:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
n... | 28.541667 | 118 | 0.617518 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingredient',
fields=[
... | true | true |
f770bb87eeb3fd3eae0b0c2e357dab3727a1511d | 5,800 | py | Python | venv/lib/python3.7/site-packages/slackclient/_client.py | gigumbrajaguru/SlackTats | 77fe93711ae3502f833bf3ba340f36d7da82f9cf | [
"Apache-2.0"
] | 2 | 2018-10-04T06:12:38.000Z | 2021-08-02T16:39:12.000Z | venv/lib/python3.7/site-packages/slackclient/_client.py | gigumbrajaguru/SlackTats | 77fe93711ae3502f833bf3ba340f36d7da82f9cf | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/slackclient/_client.py | gigumbrajaguru/SlackTats | 77fe93711ae3502f833bf3ba340f36d7da82f9cf | [
"Apache-2.0"
] | 1 | 2021-11-05T22:16:58.000Z | 2021-11-05T22:16:58.000Z | #!/usr/bin/python
# mostly a proxy object to abstract how some of this works
import json
from slackclient._server import Server
class SlackClient(object):
'''
The SlackClient makes API Calls to the `Slack Web API <https://api.slack.com/web>`_ as well as
managing connections to the `Real-time Messaging A... | 33.526012 | 100 | 0.539138 |
import json
from slackclient._server import Server
class SlackClient(object):
def __init__(self, token):
self.token = token
self.server = Server(self.token, False)
def rtm_connect(self, reconnect=False):
try:
self.server.rtm_connect(reconnect=reconnect)
ret... | true | true |
f770bbc784a3d05eebbe9bb729d5584a7b5ebeda | 22,399 | py | Python | nova/virt/libvirt/blockinfo.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/virt/libvirt/blockinfo.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/blockinfo.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright (C) 2012-2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.144817 | 79 | 0.610697 |
import itertools
import operator
from oslo_config import cfg
import six
from nova import block_device
from nova.compute import arch
from nova.compute import vm_mode
from nova import exception
from nova.i18n import _
from nova.objects import base as obj_base
from nova.virt import configdrive
from nova.virt import dr... | true | true |
f770bc069d5c8b6f8773727f0b10f5cbe53df2fd | 515 | py | Python | setup.py | ccebrecos/py-telegram-bot | b8f47da07e706fad189baaf059e9889ff932e9da | [
"Apache-2.0"
] | 2 | 2018-03-31T11:43:57.000Z | 2021-03-11T19:07:27.000Z | setup.py | ccebrecos/py-telegram-bot | b8f47da07e706fad189baaf059e9889ff932e9da | [
"Apache-2.0"
] | null | null | null | setup.py | ccebrecos/py-telegram-bot | b8f47da07e706fad189baaf059e9889ff932e9da | [
"Apache-2.0"
] | 1 | 2021-03-27T19:31:39.000Z | 2021-03-27T19:31:39.000Z | from setuptools import setup
setup(
name='py-telegram-bot',
version='0.1',
description='Telegram bot coded in Python to retrieve Bitcoin data',
license='Apache License v2.0',
author='Carlos GC',
author_email='mail@ccebrecos.com',
url='https://github.com/ccebrecos/py-telegram-bot',
keywo... | 22.391304 | 72 | 0.594175 | from setuptools import setup
setup(
name='py-telegram-bot',
version='0.1',
description='Telegram bot coded in Python to retrieve Bitcoin data',
license='Apache License v2.0',
author='Carlos GC',
author_email='mail@ccebrecos.com',
url='https://github.com/ccebrecos/py-telegram-bot',
keywo... | true | true |
f770bc1a470316b71f6dab56901033b816a96c34 | 638 | py | Python | backend/manage.py | crowdbotics-apps/plain-shadow-31593 | 5764258a884ec1849a46ad82c505b8d9c083c421 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/plain-shadow-31593 | 5764258a884ec1849a46ad82c505b8d9c083c421 | [
"FTL",
"AML",
"RSA-MD"
] | 2 | 2021-10-20T14:53:26.000Z | 2021-10-20T14:53:29.000Z | backend/manage.py | crowdbotics-apps/plain-shadow-31593 | 5764258a884ec1849a46ad82c505b8d9c083c421 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'plain_shadow_31593.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
r... | 29 | 82 | 0.688088 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'plain_shadow_31593.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed a... | true | true |
f770bc4184db81d5568955735f8913fa19857bf7 | 31,343 | py | Python | lib/spack/spack/test/cmd/install.py | wwyf/spack | a22bb8d050c1fc183e403ed8f57dba21eee50a5f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-12-28T14:38:41.000Z | 2020-12-28T14:38:41.000Z | lib/spack/spack/test/cmd/install.py | wwyf/spack | a22bb8d050c1fc183e403ed8f57dba21eee50a5f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | lib/spack/spack/test/cmd/install.py | karcaw/spack | 2b3ca6c3e39f486c9cf277f2ca8fef12d54300c2 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 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)
import argparse
import os
import filecmp
import re
from six.moves import builtins
import time
import pytest
import llnl.... | 35.296171 | 91 | 0.661424 |
import argparse
import os
import filecmp
import re
from six.moves import builtins
import time
import pytest
import llnl.util.filesystem as fs
import spack.config
import spack.compilers as compilers
import spack.hash_types as ht
import spack.package
import spack.cmd.install
from spack.error import SpackError
from sp... | true | true |
f770bc57c2b549c395b18c7bf638eabc3a56fa77 | 4,256 | py | Python | pirates/effects/VoodooAura2.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | pirates/effects/VoodooAura2.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | pirates/effects/VoodooAura2.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | # File: V (Python 2.4)
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from otp.otpbase import OTPRender
from PooledEffect import PooledEffect
from EffectController ... | 45.276596 | 168 | 0.707002 |
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from otp.otpbase import OTPRender
from PooledEffect import PooledEffect
from EffectController import EffectController... | true | true |
f770bd8ce8ba0351fab5d622c9b9002fe9536961 | 588 | py | Python | projects/example/bot_discord.py | parampaa2/bot-quick-guide-id | ad7df4aaa3044866256aebdd90c795e5b504c376 | [
"MIT"
] | 1 | 2020-10-22T01:29:57.000Z | 2020-10-22T01:29:57.000Z | projects/example/bot_discord.py | parampaa2/bot-quick-guide-id | ad7df4aaa3044866256aebdd90c795e5b504c376 | [
"MIT"
] | null | null | null | projects/example/bot_discord.py | parampaa2/bot-quick-guide-id | ad7df4aaa3044866256aebdd90c795e5b504c376 | [
"MIT"
] | 2 | 2020-03-12T07:31:56.000Z | 2020-12-26T02:19:13.000Z | import discord
from key_loader import GENERAL_ACCESS_TOKEN as TKN
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
global on_watch_users
# Prevents re... | 23.52 | 72 | 0.688776 | import discord
from key_loader import GENERAL_ACCESS_TOKEN as TKN
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
global on_watch_users
if messag... | true | true |
f770bdb4ecd5eec0aecef4cc9b830c22d4243881 | 49,090 | py | Python | sdk/python/pulumi_aws/ssm/_inputs.py | alexbowers/pulumi-aws | 7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5 | [
"ECL-2.0",
"Apache-2.0"
] | 260 | 2018-06-18T14:57:00.000Z | 2022-03-29T11:41:03.000Z | sdk/python/pulumi_aws/ssm/_inputs.py | alexbowers/pulumi-aws | 7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5 | [
"ECL-2.0",
"Apache-2.0"
] | 1,154 | 2018-06-19T20:38:20.000Z | 2022-03-31T19:48:16.000Z | sdk/python/pulumi_aws/ssm/_inputs.py | alexbowers/pulumi-aws | 7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5 | [
"ECL-2.0",
"Apache-2.0"
] | 115 | 2018-06-28T03:20:27.000Z | 2022-03-29T11:41:06.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 43.908766 | 680 | 0.68464 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from ._enums import *
__all__ = [
'AssociationOutputLocationArgs',
'AssociationTargetArgs',
'DocumentAttachmentsSourceArgs',
'DocumentParameterArgs',
'... | true | true |
f770be8636861d10224ef6811ef51dd1067c7937 | 136 | py | Python | backend/telegram/methods/users/__init__.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/telegram/methods/users/__init__.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/telegram/methods/users/__init__.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | from .get_user import GetUser
from .get_updated_user import GetUpdatedUser
class Users(
GetUser,
GetUpdatedUser,
):
pass
| 12.363636 | 44 | 0.735294 | from .get_user import GetUser
from .get_updated_user import GetUpdatedUser
class Users(
GetUser,
GetUpdatedUser,
):
pass
| true | true |
f770c00e17aaa8025774af649e93afad6df59f12 | 2,389 | py | Python | sprite.py | c4glenn/Dinostrider | e69b63f627266934f1ece7f4e029dfbbb7c301ee | [
"MIT"
] | null | null | null | sprite.py | c4glenn/Dinostrider | e69b63f627266934f1ece7f4e029dfbbb7c301ee | [
"MIT"
] | null | null | null | sprite.py | c4glenn/Dinostrider | e69b63f627266934f1ece7f4e029dfbbb7c301ee | [
"MIT"
] | null | null | null | import glob
import pygame
VEC = pygame.math.Vector2
class Sprite(pygame.sprite.Sprite):
def __init__(self, start_x, start_y, height, width, vel=VEC(0, 0)):
#pygame.sprite.Sprite.__init__(self)
super().__init__()
self.pos = VEC(start_x, start_y)
self.rect = pygame.Rect(start_x, sta... | 29.134146 | 71 | 0.556718 | import glob
import pygame
VEC = pygame.math.Vector2
class Sprite(pygame.sprite.Sprite):
def __init__(self, start_x, start_y, height, width, vel=VEC(0, 0)):
super().__init__()
self.pos = VEC(start_x, start_y)
self.rect = pygame.Rect(start_x, start_y, width, height)
self.bou... | true | true |
f770c0c910a97d72ea7809b5867137b04f8dd803 | 671 | py | Python | c3po/constants.py | cipherLord/C-3PO | c99d7f958ee437c02c6afcbabdf5a06d6b7103b4 | [
"MIT"
] | null | null | null | c3po/constants.py | cipherLord/C-3PO | c99d7f958ee437c02c6afcbabdf5a06d6b7103b4 | [
"MIT"
] | null | null | null | c3po/constants.py | cipherLord/C-3PO | c99d7f958ee437c02c6afcbabdf5a06d6b7103b4 | [
"MIT"
] | null | null | null | """Defines constants needed for fetch Data from FB."""
# API version
FACEBOOK_API_VERSION = "v6.0"
# Group information
FACEBOOK_GROUP_ID = "1488511748129645"
# Fields to fetch from API
FACEBOOK_POST_FIELDS = (
"id,created_time,from,link,message,message_tags,"
"name,object_id,permalink_url,properties,"
"sh... | 26.84 | 54 | 0.782414 | FACEBOOK_API_VERSION = "v6.0"
FACEBOOK_GROUP_ID = "1488511748129645"
FACEBOOK_POST_FIELDS = (
"id,created_time,from,link,message,message_tags,"
"name,object_id,permalink_url,properties,"
"shares,source,status_type,type,updated_time"
)
FACEBOOK_COMMENT_FIELDS = (
"id,attachment,comment_count,created_ti... | true | true |
f770c0d0c3d59b26102fdfdbe6258a56b12f5a1d | 12,858 | py | Python | userbot/plugins/kang.py | kidiloska/catuserbot | bff493ca57873f415442996107be897274e0909d | [
"MIT"
] | null | null | null | userbot/plugins/kang.py | kidiloska/catuserbot | bff493ca57873f415442996107be897274e0909d | [
"MIT"
] | null | null | null | userbot/plugins/kang.py | kidiloska/catuserbot | bff493ca57873f415442996107be897274e0909d | [
"MIT"
] | null | null | null | """Make / Download Telegram Sticker Packs without installing Third Party applications
Available Commands:
.lund [Optional Emoji]
.packinfo
.loda {for zip sticker pack}"""
from telethon import events
from io import BytesIO
from PIL import Image
import asyncio
import datetime
from collections import defaultdict
import ma... | 38.845921 | 142 | 0.637035 | from telethon import events
from io import BytesIO
from PIL import Image
import asyncio
import datetime
from collections import defaultdict
import math
import os
import requests
import zipfile
from telethon.errors.rpcerrorlist import StickersetInvalidError
from telethon.errors import MessageNotModifiedError
from teleth... | true | true |
f770c1a43716a280347531a3f3c643c8ec7f4706 | 6,973 | py | Python | telegram-statistics.py | mnemocron/TelegramChatStats | 10b9ebb97bfb28f835fd05050f03dcb10525f7a3 | [
"MIT"
] | 27 | 2019-03-03T07:18:12.000Z | 2022-03-24T08:37:35.000Z | telegram-statistics.py | mnemocron/TelegramChatStats | 10b9ebb97bfb28f835fd05050f03dcb10525f7a3 | [
"MIT"
] | 6 | 2018-10-12T07:14:23.000Z | 2022-03-20T11:38:55.000Z | telegram-statistics.py | mnemocron/TelegramChatStats | 10b9ebb97bfb28f835fd05050f03dcb10525f7a3 | [
"MIT"
] | 8 | 2019-11-13T20:16:16.000Z | 2022-03-11T07:57:44.000Z | #! /usr/bin/python3
#_*_ coding: utf-8 _*_
'''
@file telegram-statistics.py
@author Simon Burkhardt - github.com/mnemocron
@date 2018.10.01
Post about this code:
https://www.reddit.com/r/LongDistance/comments/9mgcol/oc_chat_statistics_from_telegram_using_python/
Inspiration:
https://www.reddit.com/r/LongDistan... | 34.865 | 125 | 0.685645 |
from __future__ import print_function
import sys
import os
import optparse
import re
import json
import codecs
import numpy as np import pandas as pd import bokeh from pprint import pprint
from collections import Counter
from datetime import datetime
from datetime import timedelta
from _message_numerics... | true | true |
f770c21130f1d422937f7510d25f77fb56f2c98a | 10,661 | py | Python | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/nova_server_block_device_mapping.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/nova_server_block_device_mapping.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/nova_server_block_device_mapping.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class NovaServerBlockDeviceMapping:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and... | 32.702454 | 249 | 0.647313 |
import pprint
import re
import six
class NovaServerBlockDeviceMapping:
sensitive_list = []
openapi_types = {
'source_type': 'str',
'destination_type': 'str',
'guest_format': 'str',
'device_name': 'str',
'delete_on_termination': 'bool',
'boot_index': 'st... | true | true |
f770c2212a2011346d3ea4183e730c9201ce3323 | 336 | py | Python | test/pretreatment.py | wangyingying625/cnn-fish-test | dcb43a2b278e177e835d685e47ec85901ad1c6ce | [
"Apache-2.0"
] | null | null | null | test/pretreatment.py | wangyingying625/cnn-fish-test | dcb43a2b278e177e835d685e47ec85901ad1c6ce | [
"Apache-2.0"
] | null | null | null | test/pretreatment.py | wangyingying625/cnn-fish-test | dcb43a2b278e177e835d685e47ec85901ad1c6ce | [
"Apache-2.0"
] | 1 | 2021-12-30T01:22:05.000Z | 2021-12-30T01:22:05.000Z | def loadFile(p,wFile):
f = open(p)
newFile=[]
for line in f.readlines():
newLine = line.split(',')
newFile.append(newLine[3])
fp = open(wFile, 'w+')
for lines in newFile:
fp.write(lines)
fp.close()
f.close()
if __name__ == '__main__':
loadFile('./loadFile.txt','... | 22.4 | 47 | 0.559524 | def loadFile(p,wFile):
f = open(p)
newFile=[]
for line in f.readlines():
newLine = line.split(',')
newFile.append(newLine[3])
fp = open(wFile, 'w+')
for lines in newFile:
fp.write(lines)
fp.close()
f.close()
if __name__ == '__main__':
loadFile('./loadFile.txt','... | true | true |
f770c351f5831db71228192793c0bc0fa1e08401 | 8,629 | py | Python | desktop/core/ext-py/Beaker/tests/test_cache.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/Beaker/tests/test_cache.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/Beaker/tests/test_cache.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # coding: utf-8
import os
import shutil
import tarfile
import tempfile
import time
from beaker.middleware import CacheMiddleware
from beaker.cache import Cache
from webtest import TestApp
# Tarballs of the output of:
# >>> from beaker.cache import Cache
# >>> c = Cache('test', data_dir='db', type='dbm')
# >>> c['foo']... | 34.242063 | 111 | 0.651408 | import os
import shutil
import tarfile
import tempfile
import time
from beaker.middleware import CacheMiddleware
from beaker.cache import Cache
from webtest import TestApp
dbm_cache_tar = """\
eJzt3EtOwkAAgOEBjTHEBDfu2ekKZ6bTTnsBL+ABzPRB4osSRBMXHsNruXDl3nMYLaEbpYRAaIn6
f8kwhFcn/APLSeNTUTdZsL4/m4Pg21wSqiCt9D1PC6mUZ7Xo+... | true | true |
f770c36a4a7d4e6837b69f2e180fcc9f28570150 | 1,799 | py | Python | python/src/nnabla/backward_function/sinc.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | 1 | 2020-08-03T12:49:19.000Z | 2020-08-03T12:49:19.000Z | python/src/nnabla/backward_function/sinc.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | 1 | 2020-11-09T07:33:29.000Z | 2020-11-09T07:33:29.000Z | python/src/nnabla/backward_function/sinc.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony Corporation. 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 applicabl... | 36.714286 | 76 | 0.673152 |
import nnabla as nn
from .backward_function import BackwardFunction
class SincBackward(BackwardFunction):
@property
def name(self):
return 'SincBackward'
def _create_forward_inputs_and_outputs(self, inputs, outputs):
inputs_fwd = []
for i in range(self._num_inputs_fwd):
... | true | true |
f770c3d9012aa7680f017dacbe0c6be816be50ad | 967 | py | Python | example_project/open_news/scraper/pipelines.py | jsdelivrbot/xscraper | 5f097b4e21a5cc57eea2b30ede6983caf1391742 | [
"BSD-3-Clause"
] | null | null | null | example_project/open_news/scraper/pipelines.py | jsdelivrbot/xscraper | 5f097b4e21a5cc57eea2b30ede6983caf1391742 | [
"BSD-3-Clause"
] | null | null | null | example_project/open_news/scraper/pipelines.py | jsdelivrbot/xscraper | 5f097b4e21a5cc57eea2b30ede6983caf1391742 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from builtins import str
from builtins import object
import logging
from django.db.utils import IntegrityError
from scrapy.exceptions import DropItem
from dynamic_scraper.models import SchedulerRuntime
class DjangoWriterPipeline(object):
def process_item(self, item, spi... | 34.535714 | 68 | 0.590486 | from __future__ import unicode_literals
from builtins import str
from builtins import object
import logging
from django.db.utils import IntegrityError
from scrapy.exceptions import DropItem
from dynamic_scraper.models import SchedulerRuntime
class DjangoWriterPipeline(object):
def process_item(self, item, spi... | true | true |
f770c3ecc505e6d5c0bb8ab2c610eb5dfb21c334 | 12,108 | py | Python | rllib/agents/sac/sac_ensemble_tf_model_unstack.py | bentzinir/ray | 39b84166f88e271b279bd0b3ce56f81d24a1852c | [
"Apache-2.0"
] | null | null | null | rllib/agents/sac/sac_ensemble_tf_model_unstack.py | bentzinir/ray | 39b84166f88e271b279bd0b3ce56f81d24a1852c | [
"Apache-2.0"
] | null | null | null | rllib/agents/sac/sac_ensemble_tf_model_unstack.py | bentzinir/ray | 39b84166f88e271b279bd0b3ce56f81d24a1852c | [
"Apache-2.0"
] | null | null | null | from gym.spaces import MultiDiscrete
import numpy as np
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.utils.framework import try_import_tf
tf = try_import_tf()
class SACEnsembleTFModel(TFModelV2):
"""Extension of standard TFModel for SAC.
Data flow:
obs -> forward() -> model_o... | 42.041667 | 119 | 0.579534 | from gym.spaces import MultiDiscrete
import numpy as np
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.utils.framework import try_import_tf
tf = try_import_tf()
class SACEnsembleTFModel(TFModelV2):
def __init__(self,
obs_space,
action_space,
... | true | true |
f770c42a6ba8381f0677133f7fbe0ae21331dac1 | 7,557 | py | Python | tests/test_dnsService.py | pkeroulas/nmos-common | b650bad276819d794624f4ff6ea08fbdecd915d7 | [
"Apache-2.0"
] | 7 | 2017-12-08T08:05:51.000Z | 2020-10-21T07:32:42.000Z | tests/test_dnsService.py | pkeroulas/nmos-common | b650bad276819d794624f4ff6ea08fbdecd915d7 | [
"Apache-2.0"
] | 63 | 2017-12-13T08:46:58.000Z | 2020-12-02T08:48:40.000Z | tests/test_dnsService.py | pkeroulas/nmos-common | b650bad276819d794624f4ff6ea08fbdecd915d7 | [
"Apache-2.0"
] | 7 | 2017-11-22T10:49:23.000Z | 2022-03-15T22:00:17.000Z | #!/usr/bin/env python
# Copyright 2017 British Broadcasting 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... | 34.824885 | 84 | 0.628556 |
import unittest
from nmoscommon.mdns.dnsService import DNSService
from nmoscommon.mdns.mdnsExceptions import DNSRecordNotFound
from mock import MagicMock, patch
class testDNSService(unittest.TestCase):
def setUp(self):
self.serviceName = "hostname._nmos-registration._tcp.example.com."
self.type... | true | true |
f770c4adeed99e10b89b8930ef4b1b1eda5b1438 | 924 | py | Python | nova/virt/vmwareapi/__init__.py | bopopescu/nova_vmware_compute_driver | 60d3936b68030647b9f11970c9e0d060fc286dd9 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/__init__.py | bopopescu/nova_vmware_compute_driver | 60d3936b68030647b9f11970c9e0d060fc286dd9 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/__init__.py | bopopescu/nova_vmware_compute_driver | 60d3936b68030647b9f11970c9e0d060fc286dd9 | [
"Apache-2.0"
] | 2 | 2019-07-08T22:12:35.000Z | 2020-07-24T08:27:24.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy... | 40.173913 | 79 | 0.738095 |
from nova.virt.vmwareapi.driver import VMwareESXDriver
| true | true |
f770c4b7055f77c7efc753e8bbe4b8533b02190b | 396 | py | Python | python/05p1.py | dsumike/adventofcode | cd5e484fa162bada67625c3779580d77e87d1daa | [
"MIT"
] | null | null | null | python/05p1.py | dsumike/adventofcode | cd5e484fa162bada67625c3779580d77e87d1daa | [
"MIT"
] | null | null | null | python/05p1.py | dsumike/adventofcode | cd5e484fa162bada67625c3779580d77e87d1daa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import md5
nice = 0
with open("../input/05.txt") as fileobj:
for line in fileobj:
if 'ab' in line or 'cd' in line or 'pq' in line or 'xy' in line:
continue
if (line.count('a') + line.count('e') + line.count('i') + line.count('o') + line.count('u')) < 3:
continue
for x in range(0, l... | 22 | 99 | 0.588384 |
import md5
nice = 0
with open("../input/05.txt") as fileobj:
for line in fileobj:
if 'ab' in line or 'cd' in line or 'pq' in line or 'xy' in line:
continue
if (line.count('a') + line.count('e') + line.count('i') + line.count('o') + line.count('u')) < 3:
continue
for x in range(0, len(line)-1):
if lin... | false | true |
f770c56bd3f3db9fb07eda04403c0d883d5ddc7d | 7,053 | py | Python | src/compas_rhino/install.py | archimarkGit/compas | a953df2fca778e27bdf02437fcf8ff2b7d924c73 | [
"MIT"
] | 2 | 2021-03-17T18:14:22.000Z | 2021-09-19T13:50:02.000Z | src/compas_rhino/install.py | archimarkGit/compas | a953df2fca778e27bdf02437fcf8ff2b7d924c73 | [
"MIT"
] | null | null | null | src/compas_rhino/install.py | archimarkGit/compas | a953df2fca778e27bdf02437fcf8ff2b7d924c73 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
import itertools
import os
import sys
import compas_rhino
import compas._os
import compas.plugins
__all__ = ['install']
def install(version=None, packages=None):
"""Install COMPAS for ... | 35.442211 | 145 | 0.68127 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
import itertools
import os
import sys
import compas_rhino
import compas._os
import compas.plugins
__all__ = ['install']
def install(version=None, packages=None):
if version not in ('5... | true | true |
f770c5d26b0b73655f4c5137b6ca4784e1c7ce85 | 4,532 | py | Python | scripts/python/backend_server/wsgi/road_wx_locator.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2020-06-03T15:59:50.000Z | 2020-12-21T11:11:57.000Z | scripts/python/backend_server/wsgi/road_wx_locator.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | null | null | null | scripts/python/backend_server/wsgi/road_wx_locator.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2019-10-02T06:47:23.000Z | 2020-02-02T18:32:23.000Z | #!/usr/bin/env python
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2015
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** Research Applications Laboratory(RAL)
# ** P.O.Box 3000, Boulder... | 42.35514 | 194 | 0.667696 |
import numpy
from netCDF4 import Dataset
import pyflann
def build_save_flann_index(road_segment_file, latitude_field_name, longitude_field_name, seg_id_field_name, precision, output_flann_file, output_numpy_seg_pts_file, output_numpy_seg_id_file):
cdf = Dataset(road_segment_file, "r")
latitude = cdf... | false | true |
f770c6ae9806f68f46a4a6d1df434306afad3b4b | 9,208 | py | Python | pythonFiles/vscode_datascience_helpers/kernel_launcher_daemon.py | amichuda/vscode-jupyter | b30cfeeb3c1dde64977232523c1bc83df4e59cec | [
"MIT"
] | 2 | 2021-03-17T15:28:52.000Z | 2021-10-04T16:01:48.000Z | pythonFiles/vscode_datascience_helpers/kernel_launcher_daemon.py | amichuda/vscode-jupyter | b30cfeeb3c1dde64977232523c1bc83df4e59cec | [
"MIT"
] | 38 | 2021-03-19T16:21:22.000Z | 2022-03-31T03:12:59.000Z | pythonFiles/vscode_datascience_helpers/kernel_launcher_daemon.py | amichuda/vscode-jupyter | b30cfeeb3c1dde64977232523c1bc83df4e59cec | [
"MIT"
] | 1 | 2022-02-10T13:49:05.000Z | 2022-02-10T13:49:05.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import logging
import os
import os.path
import signal
import sys
# Only subprocess.PIPE is used in this file so we can ignore the subprocess warning for this file
# The actual POpen is in kernel_launcher.py
impor... | 37.583673 | 109 | 0.604257 |
import json
import logging
import os
import os.path
import signal
import sys
import subprocess import threading
import time
from vscode_datascience_helpers.daemon.daemon_python import (
error_decorator,
PythonDaemon as BasePythonDaemon,
change_exec_context,
)
from vscode_datascience_helpers.jupyter_daemo... | true | true |
f770c772734bd274f72b07384345f7ad326f41ff | 9,310 | py | Python | setup.py | TamasFlorin/YOLO3-4-Py | d7cc4d67c7eb9168a30ce9716ed64024fc1e1f8f | [
"Apache-2.0"
] | null | null | null | setup.py | TamasFlorin/YOLO3-4-Py | d7cc4d67c7eb9168a30ce9716ed64024fc1e1f8f | [
"Apache-2.0"
] | null | null | null | setup.py | TamasFlorin/YOLO3-4-Py | d7cc4d67c7eb9168a30ce9716ed64024fc1e1f8f | [
"Apache-2.0"
] | null | null | null | import tempfile
from distutils.command.build import build
from distutils.command.clean import clean
import sys
import numpy as np # TODO: Need a mechanism to ensure numpy is already installed
import shutil
# Compile using .cpp files if cython is not present
try:
from Cython.Distutils import build_ext
except Import... | 36.509804 | 157 | 0.686144 | import tempfile
from distutils.command.build import build
from distutils.command.clean import clean
import sys
import numpy as np import shutil
try:
from Cython.Distutils import build_ext
except ImportError:
from distutils.command.build_ext import build_ext
use_cython = False
else:
use_cython = True
f... | true | true |
f770c7b05cbaa0228999bb20034089ee316755f0 | 3,209 | py | Python | tests/unit/modules/test_kapacitor.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_kapacitor.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2017-07-10T21:44:39.000Z | 2017-07-10T21:44:39.000Z | tests/unit/modules/test_kapacitor.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | import salt.modules.kapacitor as kapacitor
import salt.utils.json
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import Mock, patch
from tests.support.unit import TestCase
class KapacitorTestCase(TestCase, LoaderModuleMockMixin):
env = {"KAPACITOR_UNSAFE_SSL": "false", "KAPACITOR_U... | 38.662651 | 85 | 0.602992 | import salt.modules.kapacitor as kapacitor
import salt.utils.json
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import Mock, patch
from tests.support.unit import TestCase
class KapacitorTestCase(TestCase, LoaderModuleMockMixin):
env = {"KAPACITOR_UNSAFE_SSL": "false", "KAPACITOR_U... | true | true |
f770c7b5ed3d119a6f1fef1f289fd44c7bb7e11f | 2,027 | py | Python | vma_app/__init__.py | shanavas-techversant/vma | 8f3168d2a2dd64447d71d989bb54e280067515d7 | [
"MIT"
] | null | null | null | vma_app/__init__.py | shanavas-techversant/vma | 8f3168d2a2dd64447d71d989bb54e280067515d7 | [
"MIT"
] | null | null | null | vma_app/__init__.py | shanavas-techversant/vma | 8f3168d2a2dd64447d71d989bb54e280067515d7 | [
"MIT"
] | 1 | 2020-03-16T08:05:25.000Z | 2020-03-16T08:05:25.000Z | import os
import urllib3
import click
from constants import (
CHILD_SERVICE,
DEFAULT_CONFIG_FILE,
PARENT_SERVICE,
SERVICE_NAME,
VMACONFIG,
)
from flask import Flask # Import the Flask class
from .db import DB, MIGRATE, init_db, migrate_database
from .extensions import login_manager, oauth, jwt_au... | 22.775281 | 65 | 0.676862 | import os
import urllib3
import click
from constants import (
CHILD_SERVICE,
DEFAULT_CONFIG_FILE,
PARENT_SERVICE,
SERVICE_NAME,
VMACONFIG,
)
from flask import Flask
from .db import DB, MIGRATE, init_db, migrate_database
from .extensions import login_manager, oauth, jwt_auth
from .views import reg... | true | true |
f770c93914a0db8815652cc95067f2d31790817a | 1,549 | py | Python | src/programy/nlp/wordnet/extension.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | src/programy/nlp/wordnet/extension.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | src/programy/nlp/wordnet/extension.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | """
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... | 48.40625 | 120 | 0.767592 | from programy.extensions.base import Extension
from programy.nlp.wordnet.wordnet import WordNet
class WordNetExtension(Extension):
def execute(self, client_context, data):
del client_context
definitions = WordNet.get_definitions(data)
if len(definitions) > 0:
return defin... | true | true |
f770c9ceab6ea3b3555a01042e2913de6a225830 | 795 | py | Python | dbt_cloud/command/job/list.py | jeremyyeo/dbt-cloud-cli | f1253bcc343c08232e18ea01ef4a74c2e62a9999 | [
"Apache-2.0"
] | 33 | 2021-12-09T11:17:58.000Z | 2022-03-23T21:51:43.000Z | dbt_cloud/command/job/list.py | jeremyyeo/dbt-cloud-cli | f1253bcc343c08232e18ea01ef4a74c2e62a9999 | [
"Apache-2.0"
] | 20 | 2021-11-26T15:46:43.000Z | 2022-03-25T15:49:20.000Z | dbt_cloud/command/job/list.py | jeremyyeo/dbt-cloud-cli | f1253bcc343c08232e18ea01ef4a74c2e62a9999 | [
"Apache-2.0"
] | 4 | 2022-01-17T19:18:34.000Z | 2022-03-12T09:55:31.000Z | import requests
from typing import Optional
from pydantic import Field
from dbt_cloud.command.command import DbtCloudAccountCommand
class DbtCloudJobListCommand(DbtCloudAccountCommand):
"""Returns a list of jobs in the account."""
order_by: Optional[str] = Field(
description="Field to order the resul... | 30.576923 | 84 | 0.675472 | import requests
from typing import Optional
from pydantic import Field
from dbt_cloud.command.command import DbtCloudAccountCommand
class DbtCloudJobListCommand(DbtCloudAccountCommand):
order_by: Optional[str] = Field(
description="Field to order the result by. Use - to indicate reverse order."
)
... | true | true |
f770cb5d3059a5f3b79f8585090375452f022049 | 929 | py | Python | internetnl/celery.py | sinteur/Internet.nl | 88d2145f89868b353303b211d3e4ec9c52bcc8d6 | [
"Apache-2.0",
"CC-BY-4.0"
] | 9 | 2021-07-19T09:34:35.000Z | 2022-01-06T15:38:06.000Z | internetnl/celery.py | sinteur/Internet.nl | 88d2145f89868b353303b211d3e4ec9c52bcc8d6 | [
"Apache-2.0",
"CC-BY-4.0"
] | 86 | 2021-07-16T12:56:15.000Z | 2022-03-28T13:09:48.000Z | internetnl/celery.py | sinteur/Internet.nl | 88d2145f89868b353303b211d3e4ec9c52bcc8d6 | [
"Apache-2.0",
"CC-BY-4.0"
] | 4 | 2021-08-20T13:47:03.000Z | 2021-12-01T21:31:43.000Z | # Copyright: 2019, NLnet Labs and the Internet.nl contributors
# SPDX-License-Identifier: Apache-2.0
import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'internetnl.settings')
app = Celery('internetnl')
app.config_from_object('django.conf:settings... | 26.542857 | 70 | 0.663079 | import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'internetnl.settings')
app = Celery('internetnl')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)
def debug_task(self):
prin... | true | true |
f770cc036f7b5554abc6fb46765858bf3b38b09a | 159 | py | Python | contrib/wallettools/walletunlock.py | mario1987/Advertcoin-p | 1d8299dd98cf73df453d9b51b344cd769093dc8c | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | mario1987/Advertcoin-p | 1d8299dd98cf73df453d9b51b344cd769093dc8c | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | mario1987/Advertcoin-p | 1d8299dd98cf73df453d9b51b344cd769093dc8c | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:37594")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| 31.8 | 47 | 0.767296 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:37594")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| true | true |
f770cc275c4e3dd064fe104cf8da013ff3bcf575 | 414 | py | Python | experiments/fdtd-2d/tmp_files/2733.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/2733.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/2733.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/2733.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
ti... | 23 | 116 | 0.722222 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/2733.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
ti... | true | true |
f770ccf094765c2f82bc31e8cea52a332f553806 | 1,810 | py | Python | bluelog/settings.py | tyutltf/bluelog | 6b7833dcc793b5316612ff2a6d76915b5b3c0651 | [
"MIT"
] | null | null | null | bluelog/settings.py | tyutltf/bluelog | 6b7833dcc793b5316612ff2a6d76915b5b3c0651 | [
"MIT"
] | null | null | null | bluelog/settings.py | tyutltf/bluelog | 6b7833dcc793b5316612ff2a6d76915b5b3c0651 | [
"MIT"
] | null | null | null | import os
import sys
basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
# SQLite URI compatible
WIN = sys.platform.startswith('win')
if WIN:
prefix = 'sqlite:///'
else:
prefix = 'sqlite:////'
class BaseConfig(object):
SECRET_KEY = os.getenv('SECRET_KEY', 'dev key')
DEBUG_TB_INTER... | 27.014925 | 98 | 0.708287 | import os
import sys
basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
WIN = sys.platform.startswith('win')
if WIN:
prefix = 'sqlite:///'
else:
prefix = 'sqlite:////'
class BaseConfig(object):
SECRET_KEY = os.getenv('SECRET_KEY', 'dev key')
DEBUG_TB_INTERCEPT_REDIRECTS = False
... | true | true |
f770cda932366ea0b8b4ea97166f80fd3bbcbfb5 | 2,482 | py | Python | deepmoji/attlayer.py | ceshine/DeepMoji | cb20d5b0394a0f8fb33ad2cd64fbb2fea8732c42 | [
"MIT"
] | null | null | null | deepmoji/attlayer.py | ceshine/DeepMoji | cb20d5b0394a0f8fb33ad2cd64fbb2fea8732c42 | [
"MIT"
] | null | null | null | deepmoji/attlayer.py | ceshine/DeepMoji | cb20d5b0394a0f8fb33ad2cd64fbb2fea8732c42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
from os.path import dirname
sys.path.append(dirname(dirname(__file__)))
from keras import initializers
from keras.engine import InputSpec, Layer
from keras import backend as K
class AttentionWeightedAverage(Layer):
"""
Computes a weighted average of the different channels ... | 35.971014 | 86 | 0.635375 |
import sys
from os.path import dirname
sys.path.append(dirname(dirname(__file__)))
from keras import initializers
from keras.engine import InputSpec, Layer
from keras import backend as K
class AttentionWeightedAverage(Layer):
def __init__(self, return_attention=False, **kwargs):
self.init = initializer... | true | true |
f770ce8e46b16021e054cca4da8829a8ce27f4a9 | 439 | py | Python | my-rating-counter.py | patirahardik/SparkCourse-1 | d4bcbccb4fa27f832eb56d745ee648e6bf946440 | [
"Apache-2.0"
] | null | null | null | my-rating-counter.py | patirahardik/SparkCourse-1 | d4bcbccb4fa27f832eb56d745ee648e6bf946440 | [
"Apache-2.0"
] | null | null | null | my-rating-counter.py | patirahardik/SparkCourse-1 | d4bcbccb4fa27f832eb56d745ee648e6bf946440 | [
"Apache-2.0"
] | null | null | null | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf=conf)
lines = sc.textFile("file:///E:/Study/SparkCourse/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResul... | 29.266667 | 68 | 0.749431 | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf=conf)
lines = sc.textFile("file:///E:/Study/SparkCourse/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResul... | false | true |
f770cec6b51807f35d96cbac7e9bcc2a23d5a1cd | 16,572 | py | Python | Algorithms/graphs/test.py | matija94/show-me-the-code | 7e98b15da03712e28417f2c808c4324989ce9bd7 | [
"MIT"
] | 1 | 2017-07-10T21:05:46.000Z | 2017-07-10T21:05:46.000Z | Algorithms/graphs/test.py | matija94/show-me-the-code | 7e98b15da03712e28417f2c808c4324989ce9bd7 | [
"MIT"
] | null | null | null | Algorithms/graphs/test.py | matija94/show-me-the-code | 7e98b15da03712e28417f2c808c4324989ce9bd7 | [
"MIT"
] | null | null | null |
class PriorityQueueBase:
''' abstract base class for a priority queue '''
class _Item:
__slots_ = '_key', '_value'
def __init__(self, k, v):
self._key = k
self._value = v
def __lt__(self, other):
return self._key < other._key
def is_empty(self... | 28.523236 | 122 | 0.534697 |
class PriorityQueueBase:
class _Item:
__slots_ = '_key', '_value'
def __init__(self, k, v):
self._key = k
self._value = v
def __lt__(self, other):
return self._key < other._key
def is_empty(self):
return len(self) == 0
class UnsortedPrio... | true | true |
f770cfb0fdc138795c9b18509ed0ee1c055fdedd | 1,671 | py | Python | voluseg/_tools/ants_registration.py | jingxlim/voluseg | 41429a73a481fbffc3a15457be262ec021304b51 | [
"MIT"
] | 10 | 2019-11-05T18:49:50.000Z | 2022-03-07T04:15:53.000Z | voluseg/_tools/ants_registration.py | jingxlim/voluseg | 41429a73a481fbffc3a15457be262ec021304b51 | [
"MIT"
] | 5 | 2021-02-09T20:32:38.000Z | 2021-03-22T16:53:40.000Z | voluseg/_tools/ants_registration.py | jingxlim/voluseg | 41429a73a481fbffc3a15457be262ec021304b51 | [
"MIT"
] | 3 | 2019-12-09T08:30:18.000Z | 2021-03-22T01:58:44.000Z | def ants_registration(dir_ants, in_nii, ref_nii, out_nii, prefix_out_tform, typ, in_tform=None, restrict=None):
'''ants registration'''
import os
lin_tform_params = ' '.join([
'--metric MI[%s,%s,1,32,Regular,0.25]'%(ref_nii, in_nii),
'--convergence [1000x500x250x125]',
'--shrink-fa... | 45.162162 | 111 | 0.576302 | def ants_registration(dir_ants, in_nii, ref_nii, out_nii, prefix_out_tform, typ, in_tform=None, restrict=None):
import os
lin_tform_params = ' '.join([
'--metric MI[%s,%s,1,32,Regular,0.25]'%(ref_nii, in_nii),
'--convergence [1000x500x250x125]',
'--shrink-factors 12x8x4x2',
'--... | true | true |
f770d00080d8d5b8ca80f027285c2b5443172731 | 253 | py | Python | addons/source-python/plugins/warcraft/commands/bash.py | ThomasVieth/WCS-Remastered | 28aceac73abef8b8839a17680cc046bf4c078169 | [
"MIT"
] | null | null | null | addons/source-python/plugins/warcraft/commands/bash.py | ThomasVieth/WCS-Remastered | 28aceac73abef8b8839a17680cc046bf4c078169 | [
"MIT"
] | null | null | null | addons/source-python/plugins/warcraft/commands/bash.py | ThomasVieth/WCS-Remastered | 28aceac73abef8b8839a17680cc046bf4c078169 | [
"MIT"
] | null | null | null | """
"""
## source.python imports
from messages import Shake
## __all__ declaration
__all__ = ("bash", )
## bash declaration
def bash(player, magnitude, duration):
shake_message = Shake(magnitude, duration)
shake_message.send(player.index) | 14.882353 | 46 | 0.70751 |
from messages import Shake
__all__ = ("bash", )
def bash(player, magnitude, duration):
shake_message = Shake(magnitude, duration)
shake_message.send(player.index) | true | true |
f770d120325ce60d5734cad63d9c35308c92d649 | 10,499 | py | Python | efficacy_2by2_analysis.py | DavidPageGroup/psychic-telegram | 9e69c5e4a4af74ca58a9c35ea04a5d2b878cadc4 | [
"MIT"
] | null | null | null | efficacy_2by2_analysis.py | DavidPageGroup/psychic-telegram | 9e69c5e4a4af74ca58a9c35ea04a5d2b878cadc4 | [
"MIT"
] | null | null | null | efficacy_2by2_analysis.py | DavidPageGroup/psychic-telegram | 9e69c5e4a4af74ca58a9c35ea04a5d2b878cadc4 | [
"MIT"
] | null | null | null | # Compares the efficacy of two medications through analysis of 2-by-2
# tables
# Copyright (c) 2018 Aubrey Barnard. This is free software released
# under the MIT License. See `LICENSE` or
# https://choosealicense.com/licenses/mit/ for details.
__version__ = '0.0.2'
import itertools as itools
import math
import r... | 36.70979 | 75 | 0.665301 |
__version__ = '0.0.2'
import itertools as itools
import math
import random
import sqlite3
import sys
from barnapy import contingency_table as contab
from barnapy import general
from barnapy import parse
default_env = dict(
drug_table_name='drug_exposure',
drug_id_column_name='drug_concept_id',
... | true | true |
f770d1c64f85aec78940dd82a64620a70322eec6 | 5,828 | py | Python | chives/harvester/harvester.py | zcomputerwiz/chivesv2-blockchain | f36235e16a348f7fe3e7f9cdbc92615f391a877b | [
"Apache-2.0"
] | null | null | null | chives/harvester/harvester.py | zcomputerwiz/chivesv2-blockchain | f36235e16a348f7fe3e7f9cdbc92615f391a877b | [
"Apache-2.0"
] | null | null | null | chives/harvester/harvester.py | zcomputerwiz/chivesv2-blockchain | f36235e16a348f7fe3e7f9cdbc92615f391a877b | [
"Apache-2.0"
] | null | null | null | import asyncio
import concurrent
import logging
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
import chives.server.ws_connection as ws # lgtm [py/import-and-import-from]
from chives.consensus.constants import ConsensusConstan... | 40.193103 | 119 | 0.661633 | import asyncio
import concurrent
import logging
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
import chives.server.ws_connection as ws from chives.consensus.constants import ConsensusConstants
from chives.plotting.manager imp... | true | true |
f770d2b63f8750504aba9eda9279a4841d099239 | 7,423 | py | Python | source_py3/combi/perming/variations.py | cool-RR/combi | 9c5c143a792ffd8fb38b6470f926268c8bacbc31 | [
"MIT"
] | 23 | 2015-01-16T03:45:10.000Z | 2021-08-11T20:46:44.000Z | source_py3/combi/perming/variations.py | cool-RR/combi | 9c5c143a792ffd8fb38b6470f926268c8bacbc31 | [
"MIT"
] | 3 | 2015-01-30T15:59:45.000Z | 2021-09-18T08:52:38.000Z | source_py3/combi/perming/variations.py | cool-RR/combi | 9c5c143a792ffd8fb38b6470f926268c8bacbc31 | [
"MIT"
] | 1 | 2021-08-11T19:57:47.000Z | 2021-08-11T19:57:47.000Z | # Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
from combi._python_toolbox import exceptions
from combi._python_toolbox import cute_iter_tools
from combi._python_toolbox import nifty_collections
from combi._python_toolbox import caching
from combi._python_toolbox.third_party impo... | 38.46114 | 79 | 0.653509 |
from combi._python_toolbox import exceptions
from combi._python_toolbox import cute_iter_tools
from combi._python_toolbox import nifty_collections
from combi._python_toolbox import caching
from combi._python_toolbox.third_party import sortedcontainers
from ..selection_space import SelectionSpace
class Variation(nif... | true | true |
f770d2eda9280ee3e9e1dd689671ce03c66cfbd1 | 26,483 | py | Python | tests/test_index.py | KarimTayie/algoliasearch-django | 6e7d084f26e5cb9f8fda8b3128568a21fcd70ae3 | [
"MIT"
] | null | null | null | tests/test_index.py | KarimTayie/algoliasearch-django | 6e7d084f26e5cb9f8fda8b3128568a21fcd70ae3 | [
"MIT"
] | null | null | null | tests/test_index.py | KarimTayie/algoliasearch-django | 6e7d084f26e5cb9f8fda8b3128568a21fcd70ae3 | [
"MIT"
] | null | null | null | # coding=utf-8
import time
from django.conf import settings
from django.test import TestCase
from algoliasearch_django import AlgoliaIndex
from algoliasearch_django import algolia_engine
from algoliasearch_django.models import AlgoliaIndexError
from .models import User, Website, Example
class IndexTestCase(TestCase... | 39.64521 | 119 | 0.611562 | import time
from django.conf import settings
from django.test import TestCase
from algoliasearch_django import AlgoliaIndex
from algoliasearch_django import algolia_engine
from algoliasearch_django.models import AlgoliaIndexError
from .models import User, Website, Example
class IndexTestCase(TestCase):
def setU... | true | true |
f770d371e9d97ca3138f40fac68a3d2613d2bfde | 2,224 | py | Python | core/config.py | kartikwar/GFM | 64f1f2c9c17039117ab075a117435a34c0482a13 | [
"MIT"
] | 109 | 2021-10-30T02:57:48.000Z | 2022-03-30T12:02:50.000Z | core/config.py | 3354555/- | 05c162cdc5a963535a48036db90a5f94a7c331fc | [
"MIT"
] | 9 | 2021-11-01T23:13:21.000Z | 2022-03-09T07:44:53.000Z | core/config.py | 3354555/- | 05c162cdc5a963535a48036db90a5f94a7c331fc | [
"MIT"
] | 23 | 2021-11-03T02:00:07.000Z | 2022-03-30T12:07:09.000Z | """
Bridging Composite and Real: Towards End-to-end Deep Image Matting [IJCV-2021]
Base Configurations class.
Copyright (c) 2021, Jizhizi Li (jili8515@uni.sydney.edu.au)
Licensed under the MIT License (see LICENSE for details)
Github repo: https://github.com/JizhiziLi/GFM
Paper link (Arxiv): https://arxiv.org/abs/2010... | 30.465753 | 78 | 0.755845 |
REPOSITORY_ROOT_PATH = ''
AM2K_DATASET_ROOT_PATH = ''
BG20K_DATASET_ROOT_PATH = ''
COCO_DATASET_ROOT_PATH = ''
TRAIN_LOGS_FOLDER = REPOSITORY_ROOT_PATH+'logs/train_logs/'
TEST_LOGS_FOLDER = REPOSITORY_ROOT_PATH+'logs/test_logs/'
DATASET_PATHS_DICT={
'AM2K':{
'TRAIN':{
'ROOT_PATH':AM2K_DATASET_ROOT_PATH+'train/',
... | true | true |
f770d5146174727ffdc33291434039cc5b74d699 | 784 | py | Python | application/apps/anagramos/__init__.py | Vahen/VahenWebsite | 19a0f0f923874d66d8229e20e0df5b7916da5595 | [
"MIT"
] | null | null | null | application/apps/anagramos/__init__.py | Vahen/VahenWebsite | 19a0f0f923874d66d8229e20e0df5b7916da5595 | [
"MIT"
] | null | null | null | application/apps/anagramos/__init__.py | Vahen/VahenWebsite | 19a0f0f923874d66d8229e20e0df5b7916da5595 | [
"MIT"
] | null | null | null | import logging
from flask import Blueprint
from flask_restx import Api
from application.configuration import web_templates_dir, web_static_dir
from application.apps import apps_folder
logger = logging.getLogger("VahenWebsite.apps.anagramos")
anagramos_bp = Blueprint('anagramos_bp', __name__,
... | 35.636364 | 88 | 0.65051 | import logging
from flask import Blueprint
from flask_restx import Api
from application.configuration import web_templates_dir, web_static_dir
from application.apps import apps_folder
logger = logging.getLogger("VahenWebsite.apps.anagramos")
anagramos_bp = Blueprint('anagramos_bp', __name__,
... | true | true |
f770d5d6e87b57434a05a8be5cfcb560bbe07e02 | 903 | py | Python | components/alibi-detect-server/adserver/base/alibi_model.py | glindsell/seldon-core | a6992832b74ed71bbd3a91c48b5a79a5cee785b2 | [
"Apache-2.0"
] | 4 | 2019-08-29T19:36:55.000Z | 2021-12-20T00:37:08.000Z | components/alibi-detect-server/adserver/base/alibi_model.py | glindsell/seldon-core | a6992832b74ed71bbd3a91c48b5a79a5cee785b2 | [
"Apache-2.0"
] | 231 | 2020-08-10T08:38:42.000Z | 2021-08-02T20:56:49.000Z | components/alibi-detect-server/adserver/base/alibi_model.py | josephglanville/seldon-core | 34ab0c33c55879ebe3ea3009ca64b0b47d18896c | [
"Apache-2.0"
] | 7 | 2020-09-07T09:10:57.000Z | 2021-11-25T02:59:02.000Z | import kfserving
from typing import Optional
from adserver.base.model import CEModel
from alibi_detect.utils.saving import load_detector, Data
class AlibiDetectModel(CEModel): # pylint:disable=c-extension-no-member
def __init__(self, name: str, storage_uri: str, model: Optional[Data] = None):
"""
... | 27.363636 | 82 | 0.616833 | import kfserving
from typing import Optional
from adserver.base.model import CEModel
from alibi_detect.utils.saving import load_detector, Data
class AlibiDetectModel(CEModel): def __init__(self, name: str, storage_uri: str, model: Optional[Data] = None):
super().__init__(name)
self.name = name
... | true | true |
f770d68f6a384fe421dbd6fdde768534c6d638d7 | 2,217 | py | Python | twitoff/twitter.py | TylerRobichaux/twitoff | de7b569243b5aed7b591093d4d60cd35be6f4510 | [
"MIT"
] | null | null | null | twitoff/twitter.py | TylerRobichaux/twitoff | de7b569243b5aed7b591093d4d60cd35be6f4510 | [
"MIT"
] | 3 | 2021-06-08T22:13:42.000Z | 2022-01-13T03:08:47.000Z | twitoff/twitter.py | TylerRobichaux/twitoff | de7b569243b5aed7b591093d4d60cd35be6f4510 | [
"MIT"
] | null | null | null | """Retrieve Tweets, embeddings, and persist in the database."""
from os import getenv
import basilica
import tweepy
from .models import DB, Tweet, User
# https://greatist.com/happiness/must-follow-twitter-accounts
TWITTER_USERS = ['calebhicks', 'elonmusk', 'rrherr', 'SteveMartinToGo',
'alyankovic', 'n... | 36.344262 | 78 | 0.638701 | from os import getenv
import basilica
import tweepy
from .models import DB, Tweet, User
TWITTER_USERS = ['calebhicks', 'elonmusk', 'rrherr', 'SteveMartinToGo',
'alyankovic', 'nasa', 'sadserver', 'jkhowland', 'austen',
'common_squirrel', 'KenJennings', 'conanobrien',
'... | true | true |
f770d6b15b397b46528d7699cb7ab1397afa05a1 | 1,046 | py | Python | hokudai_furima/product/migrations/0001_initial.py | TetsuFe/hokuma | b981a52b3bf8d7268bf791c5827bbe8af90afef6 | [
"MIT"
] | 1 | 2021-02-13T03:51:42.000Z | 2021-02-13T03:51:42.000Z | hokudai_furima/product/migrations/0001_initial.py | TetsuFe/hokuma | b981a52b3bf8d7268bf791c5827bbe8af90afef6 | [
"MIT"
] | null | null | null | hokudai_furima/product/migrations/0001_initial.py | TetsuFe/hokuma | b981a52b3bf8d7268bf791c5827bbe8af90afef6 | [
"MIT"
] | 1 | 2021-09-18T09:25:48.000Z | 2021-09-18T09:25:48.000Z | # Generated by Django 2.0.3 on 2018-03-19 03:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 33.741935 | 120 | 0.630019 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
f770d7bf141e0b0f64083b1911e7d9c722058605 | 1,401 | py | Python | tests/bugs/core_0210_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_0210_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_0210_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_0210
# title: CS server crash altering SP in 2 connect
# decription:
#
# tracker_id: CORE-0210
# min_versions: ['2.5.0']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
# re... | 17.296296 | 73 | 0.606709 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# begin
# exit;
# end
# '''
# declare x int;
# begin
# exit;
# end
# '''
@pytest.mark.version('>=2.5')
@pytest.mark.xfail
def t... | true | true |
f770d925476cedc6a840943455a3582a6388f25e | 969 | py | Python | sambhava/webapp/migrations/0002_auto_20200613_1206.py | sriharsharevadi/exam_portal | 6788f55613a47988cfd43027179d33b043412168 | [
"Apache-2.0"
] | null | null | null | sambhava/webapp/migrations/0002_auto_20200613_1206.py | sriharsharevadi/exam_portal | 6788f55613a47988cfd43027179d33b043412168 | [
"Apache-2.0"
] | null | null | null | sambhava/webapp/migrations/0002_auto_20200613_1206.py | sriharsharevadi/exam_portal | 6788f55613a47988cfd43027179d33b043412168 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2020-06-13 12:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('webapp', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='student',
... | 30.28125 | 145 | 0.615067 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('webapp', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='student',
old_name='expity_date',
new_na... | true | true |
f770da2785425af81319befdc37bdeb28f3bee91 | 1,844 | py | Python | nistats/tests/test_init.py | PeerHerholz/nistats | a7f8da95efbedc3f33e7b579975096ae31fa15ab | [
"BSD-3-Clause"
] | 1 | 2019-05-28T10:21:42.000Z | 2019-05-28T10:21:42.000Z | nistats/tests/test_init.py | mwegrzyn/nistats | 7f600e766333f4e2dbbe4d456fc2fe8cc1bc0b8c | [
"BSD-3-Clause"
] | null | null | null | nistats/tests/test_init.py | mwegrzyn/nistats | 7f600e766333f4e2dbbe4d456fc2fe8cc1bc0b8c | [
"BSD-3-Clause"
] | null | null | null | import sys
import warnings
# import time warnings don't interfere with warning's tests
import pytest
with warnings.catch_warnings(record=True):
from nistats import _py34_deprecation_warning
from nistats import _py2_deprecation_warning
from nistats import _python_deprecation_warnings
def test_py2_deprec... | 36.88 | 75 | 0.693059 | import sys
import warnings
import pytest
with warnings.catch_warnings(record=True):
from nistats import _py34_deprecation_warning
from nistats import _py2_deprecation_warning
from nistats import _python_deprecation_warnings
def test_py2_deprecation_warning():
with pytest.warns(DeprecationWarning,
... | true | true |
f770dc0d75d5a291a74906906c0c275d7c2a183a | 1,736 | py | Python | skbandit/bandits/adversarial.py | dourouc05/scikit-bandit | aa0a0a58304844f593682ff1fe7f0960977bd0d2 | [
"BSD-3-Clause"
] | null | null | null | skbandit/bandits/adversarial.py | dourouc05/scikit-bandit | aa0a0a58304844f593682ff1fe7f0960977bd0d2 | [
"BSD-3-Clause"
] | null | null | null | skbandit/bandits/adversarial.py | dourouc05/scikit-bandit | aa0a0a58304844f593682ff1fe7f0960977bd0d2 | [
"BSD-3-Clause"
] | null | null | null | from typing import Union
import math
from skbandit.bandits.base import Bandit
class WeightedMajority(Bandit):
"""Optimal bandit in an adversarial setting.
As all good algorithms for adversarial bandits, it randomises its decisions. This algorithm supposes access
to full information (i.e. the reward for... | 37.73913 | 132 | 0.710253 | from typing import Union
import math
from skbandit.bandits.base import Bandit
class WeightedMajority(Bandit):
def __init__(self, n_arms: int, eta: Union[float, None], horizon: Union[int, None] = None):
super().__init__(n_arms)
if eta is not None:
self._eta = eta
elif horizo... | true | true |
f770dc35ffb03cbe7b9c021d7374c8d018bd52f5 | 262 | py | Python | src/app/coursegrab/controllers/hello_world_controller.py | cuappdev/coursegrab-backend | e69cfaf8bcabae788ebf81e18078f8eb604c79a7 | [
"MIT"
] | 1 | 2020-02-28T00:53:34.000Z | 2020-02-28T00:53:34.000Z | src/app/coursegrab/controllers/hello_world_controller.py | cuappdev/coursegrab-backend | e69cfaf8bcabae788ebf81e18078f8eb604c79a7 | [
"MIT"
] | 31 | 2019-11-06T22:14:16.000Z | 2021-11-03T21:51:40.000Z | src/app/coursegrab/controllers/hello_world_controller.py | cuappdev/coursegrab-backend | e69cfaf8bcabae788ebf81e18078f8eb604c79a7 | [
"MIT"
] | null | null | null | from . import *
class HelloWorldController(AppDevController):
def get_path(self):
return "/hello/"
def get_methods(self):
return ["GET"]
@authorize_user
def content(self, **kwargs):
return {"message": "Hello, world!"}
| 18.714286 | 45 | 0.614504 | from . import *
class HelloWorldController(AppDevController):
def get_path(self):
return "/hello/"
def get_methods(self):
return ["GET"]
@authorize_user
def content(self, **kwargs):
return {"message": "Hello, world!"}
| true | true |
f770dd64a2e84d8b48431b458cbc154d97f62960 | 1,344 | py | Python | pronotepy/__init__.py | 1yam/pronotepy | 52fad01f70d2f86ad333c6b59dd02e61682666d0 | [
"MIT"
] | null | null | null | pronotepy/__init__.py | 1yam/pronotepy | 52fad01f70d2f86ad333c6b59dd02e61682666d0 | [
"MIT"
] | null | null | null | pronotepy/__init__.py | 1yam/pronotepy | 52fad01f70d2f86ad333c6b59dd02e61682666d0 | [
"MIT"
] | null | null | null | """
An API wrapper for pronote.
This whole package is licensed under the MIT license:
Copyright (c) 2020 bain, Xiloe
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, includin... | 48 | 146 | 0.787946 |
__title__ = 'pronotepy'
__author__ = 'bain, Xiloe'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) bain, Xiloe'
__version__ = '1.1.3'
from .pronoteAPI import Client
from .dataClasses import *
| true | true |
f770ddc5e136a8f1fff9d6557c86abd97ac2bdc5 | 11,339 | py | Python | ggraph.py | sheepolata/GraphEngine | 853447e42dcd09154cdc5ac0b8e00c493445a389 | [
"MIT"
] | null | null | null | ggraph.py | sheepolata/GraphEngine | 853447e42dcd09154cdc5ac0b8e00c493445a389 | [
"MIT"
] | null | null | null | ggraph.py | sheepolata/GraphEngine | 853447e42dcd09154cdc5ac0b8e00c493445a389 | [
"MIT"
] | null | null | null | # import the pygame module, so you can use it
import pygame
from pygame.locals import *
import warnings
import random
import numpy as np
import math
from scipy.spatial import Delaunay
import delaunaytriangulation as dt
import graphmodel as gm
import drawer
import utils
class gNode(gm.Node):
def draw(self, surfac... | 44.466667 | 147 | 0.552694 | import pygame
from pygame.locals import *
import warnings
import random
import numpy as np
import math
from scipy.spatial import Delaunay
import delaunaytriangulation as dt
import graphmodel as gm
import drawer
import utils
class gNode(gm.Node):
def draw(self, surface, color):
self.drawNode(surface, colo... | true | true |
f770ddec8d8177431e777d369081819184297233 | 1,274 | py | Python | app/core/tests/test_models.py | ademrizki/recipe-app-api | d0f79c1a670677c37bcda720a529e7cb384949ee | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | ademrizki/recipe-app-api | d0f79c1a670677c37bcda720a529e7cb384949ee | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | ademrizki/recipe-app-api | d0f79c1a670677c37bcda720a529e7cb384949ee | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
"""Test creating a new user with an email is successful"""
email = 'test@mail.com'
password = '123'
user = get_user_model()... | 31.85 | 69 | 0.650706 | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
email = 'test@mail.com'
password = '123'
user = get_user_model().objects.create_user(
email=email,
password... | true | true |
f770ddf1c8e9f7800adb5f1cb0af9a5da3b3569a | 5,637 | py | Python | sinablog-backup.py | solomonxie/sinablog-backup | 938f76dceca4b83ad65fa7d6e866de202e0b249b | [
"Apache-2.0"
] | null | null | null | sinablog-backup.py | solomonxie/sinablog-backup | 938f76dceca4b83ad65fa7d6e866de202e0b249b | [
"Apache-2.0"
] | null | null | null | sinablog-backup.py | solomonxie/sinablog-backup | 938f76dceca4b83ad65fa7d6e866de202e0b249b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# ==== This project should be running in a python3 enviroment, preferred in Virtualenv. ====
#
# Author: Solomon Xie
# Email: solomonxiewise@gmail.com
# Project: Sina Blog Crawler
# Description: scrap my sina blogs and backup
#
import requests
import re
import os
import time
from random import ... | 36.134615 | 1,102 | 0.637218 |
import requests
import re
import os
import time
from random import random
from bs4 import BeautifulSoup
headers = {
'host': "blog.sina.com.cn",
'connection': "keep-alive",
'cache-control': "max-age=0",
'upgrade-insecure-requests': "1",
'user-agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6... | true | true |
f770decf2661b4fe1ea586fd51311a0db00dc590 | 1,861 | py | Python | setup.py | jeanpro/talon | 8671c6940a50d7ce54d651b1507a1ba49a15ccc9 | [
"Apache-2.0"
] | null | null | null | setup.py | jeanpro/talon | 8671c6940a50d7ce54d651b1507a1ba49a15ccc9 | [
"Apache-2.0"
] | null | null | null | setup.py | jeanpro/talon | 8671c6940a50d7ce54d651b1507a1ba49a15ccc9 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from setuptools import setup, find_packages
from setuptools.command.install import install
class InstallCommand(install):
user_options = install.user_options + [
('no-ml', None, "Don't install without Machine Learning modules."),
]
boolean_options = install.... | 29.078125 | 78 | 0.557765 | from __future__ import absolute_import
from setuptools import setup, find_packages
from setuptools.command.install import install
class InstallCommand(install):
user_options = install.user_options + [
('no-ml', None, "Don't install without Machine Learning modules."),
]
boolean_options = install.... | true | true |
f770df7a23779f919cd11cc28b2aaf7cfdf9c5a1 | 10,177 | py | Python | src/main/python/apache/aurora/client/api/scheduler_client.py | mohitsoni/incubator-aurora | fbbd0e3e165188c2a3a23b2295587c48f9264847 | [
"Apache-2.0"
] | 1 | 2016-05-01T20:17:24.000Z | 2016-05-01T20:17:24.000Z | src/main/python/apache/aurora/client/api/scheduler_client.py | mohitsoni/incubator-aurora | fbbd0e3e165188c2a3a23b2295587c48f9264847 | [
"Apache-2.0"
] | null | null | null | src/main/python/apache/aurora/client/api/scheduler_client.py | mohitsoni/incubator-aurora | fbbd0e3e165188c2a3a23b2295587c48f9264847 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Apache Software Foundation
#
# 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 agree... | 36.740072 | 100 | 0.715732 |
import functools
import threading
import time
from apache.aurora.common.auth import make_session_key, SessionKeyError
from apache.aurora.common.cluster import Cluster
from gen.apache.aurora import AuroraAdmin
from gen.apache.aurora.constants import CURRENT_API_VERSION
from pystachio import Boolean, Default, Integer... | true | true |
f770e0de2af54540951682791b814bf8189403ec | 4,180 | py | Python | run_example.py | inesnolas/Rank-based-loss_ICASSP22 | 3ebe7345dc26b8fa74543725a51b43b7170c58cc | [
"MIT"
] | null | null | null | run_example.py | inesnolas/Rank-based-loss_ICASSP22 | 3ebe7345dc26b8fa74543725a51b43b7170c58cc | [
"MIT"
] | 1 | 2022-03-10T04:08:49.000Z | 2022-03-10T04:08:49.000Z | run_example.py | inesnolas/Rank-based-loss_ICASSP22 | 3ebe7345dc26b8fa74543725a51b43b7170c58cc | [
"MIT"
] | null | null | null | import models.SingleLayer_net as single_layer
import loss_functions.rank_based_loss as rbl
# import wandb
import torch
import utils.data_functions as df
import os
import json
import pandas as pd
import csv
os.environ['CUDA_VISIBLE_DEVICES'] = '3'
# wandb.init(project='example')
exp_name = 'example'
# wandb.run.name ... | 41.386139 | 158 | 0.761962 | import models.SingleLayer_net as single_layer
import loss_functions.rank_based_loss as rbl
import torch
import utils.data_functions as df
import os
import json
import pandas as pd
import csv
os.environ['CUDA_VISIBLE_DEVICES'] = '3'
exp_name = 'example'
standardized_data = True
save_training_embeddings_to_plot = True... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.