hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71c74c4947034e3fa1939f004fe6def695c2676 | 2,684 | py | Python | unjupyter.py | milo-trujillo/unjupyter | 2ea86f67e39060ddffb109a2ab94bd074c169fed | [
"MIT"
] | null | null | null | unjupyter.py | milo-trujillo/unjupyter | 2ea86f67e39060ddffb109a2ab94bd074c169fed | [
"MIT"
] | null | null | null | unjupyter.py | milo-trujillo/unjupyter | 2ea86f67e39060ddffb109a2ab94bd074c169fed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json, sys, os, base64, hashlib, glob
def writeSource(f, src):
for line in src:
f.write(line)
def processOutputs(f, outputs):
for output in outputs:
if( "text" in output.keys() ):
f.write("```\n")
for line in output["text"]:
f.write(line)
f.write("\n```\n")
if( "d... | 33.55 | 94 | 0.604322 |
import json, sys, os, base64, hashlib, glob
def writeSource(f, src):
for line in src:
f.write(line)
def processOutputs(f, outputs):
for output in outputs:
if( "text" in output.keys() ):
f.write("```\n")
for line in output["text"]:
f.write(line)
f.write("\n```\n")
if( "data" in output.keys() ... | true | true |
f71c7536f0d8bae32792340fd5193c009dbbeef0 | 403 | py | Python | AIC21_Backend/asgi.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | 3 | 2021-03-12T18:32:39.000Z | 2021-11-08T10:21:04.000Z | AIC21_Backend/asgi.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | null | null | null | AIC21_Backend/asgi.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | 2 | 2021-01-29T14:52:53.000Z | 2022-03-05T10:24:24.000Z | """
ASGI config for AIC21_Backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AIC21_Backend.settings')
application = get_asgi_application()
| true | true |
f71c767d697d8a28a293c70fc345f6c9aac815fd | 296 | py | Python | TweetsToDB/main.py | lru-avershave/CapstoneProject | f74b4c73ffb0214a498b19f5f51481c529fa85a8 | [
"MIT"
] | 2 | 2020-01-15T06:38:34.000Z | 2020-01-22T20:42:19.000Z | TweetsToDB/main.py | lru-avershave/CapstoneProject | f74b4c73ffb0214a498b19f5f51481c529fa85a8 | [
"MIT"
] | null | null | null | TweetsToDB/main.py | lru-avershave/CapstoneProject | f74b4c73ffb0214a498b19f5f51481c529fa85a8 | [
"MIT"
] | 1 | 2020-01-15T20:11:48.000Z | 2020-01-15T20:11:48.000Z | import mongodb_setup as dbConnection
import TweetModel as TweetModel
# from watchdir import watch
from ImportText import collectTxt
class main():
try:
dbConnection
collectTxt()
# watch()
except KeyboardInterrupt:
print("Interrupted Main")
exit(0) | 21.142857 | 36 | 0.679054 | import mongodb_setup as dbConnection
import TweetModel as TweetModel
from ImportText import collectTxt
class main():
try:
dbConnection
collectTxt()
except KeyboardInterrupt:
print("Interrupted Main")
exit(0) | true | true |
f71c76b8aae27f9f54f39dc22abd7134629a2418 | 6,042 | py | Python | yateto/arch.py | ZaubererHaft/yateto | 88a02d160da9bfa7f74a4280deaf465f15cae0fb | [
"BSD-3-Clause"
] | 2 | 2021-07-01T14:23:01.000Z | 2022-01-12T01:06:24.000Z | yateto/arch.py | ZaubererHaft/yateto | 88a02d160da9bfa7f74a4280deaf465f15cae0fb | [
"BSD-3-Clause"
] | 14 | 2019-06-25T18:12:29.000Z | 2022-02-08T15:17:27.000Z | yateto/arch.py | ZaubererHaft/yateto | 88a02d160da9bfa7f74a4280deaf465f15cae0fb | [
"BSD-3-Clause"
] | 3 | 2021-05-14T13:04:28.000Z | 2021-12-24T03:15:35.000Z | ##
# @file
# This file is part of SeisSol.
#
# @author Carsten Uphoff (c.uphoff AT tum.de, http://www5.in.tum.de/wiki/index.php/Carsten_Uphoff,_M.Sc.)
#
# @section LICENSE
# Copyright (c) 2015-2018, SeisSol Group
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificatio... | 38.484076 | 110 | 0.71665 |
from .memory import DenseMemoryLayout
class Architecture(object):
def __init__(self,
name,
precision,
alignment,
enablePrefetch=False,
sub_name=None,
host_name=None):
self.name = name
... | true | true |
f71c77a35b95b5244ed1a2f4cb8314b74edffc12 | 19,222 | py | Python | lib/spack/spack/test/install.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-03-05T10:54:32.000Z | 2021-03-05T14:14:52.000Z | lib/spack/spack/test/install.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | lib/spack/spack/test/install.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # 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 os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.error
import spack.patch
import sp... | 33.371528 | 83 | 0.70232 |
import os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.error
import spack.patch
import spack.repo
import spack.store
import spack.util.spack_json as sjson
from spack.package import (
InstallError,
PackageBase,
PackageStillNeededError,
_spack_build_envfile,
_spac... | true | true |
f71c77d1c0f627d4c0d8120689ae89c7e1a43d86 | 2,577 | py | Python | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 13 | 2018-12-07T21:02:20.000Z | 2019-02-22T14:36:31.000Z | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 43 | 2018-11-30T11:31:43.000Z | 2019-04-03T16:09:06.000Z | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 13 | 2018-11-29T00:31:29.000Z | 2019-02-22T18:50:28.000Z | import json
import os
import sys
import time
from agogosml.common.abstract_streaming_client import find_streaming_clients
from agogosml.tools.sender import send
from agogosml.tools.receiver import receive
eh_base_config = {
"EVENT_HUB_NAMESPACE": os.getenv("EVENT_HUB_NAMESPACE"),
"EVENT_HUB_NAME": os.getenv("... | 28.955056 | 109 | 0.73962 | import json
import os
import sys
import time
from agogosml.common.abstract_streaming_client import find_streaming_clients
from agogosml.tools.sender import send
from agogosml.tools.receiver import receive
eh_base_config = {
"EVENT_HUB_NAMESPACE": os.getenv("EVENT_HUB_NAMESPACE"),
"EVENT_HUB_NAME": os.getenv("... | true | true |
f71c78a611dd59c34a836099368a08f02076670b | 9,173 | py | Python | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 45.636816 | 97 | 0.692903 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.timeseries.python.timeseries import math_utils
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import state_space_model
from tensorflow.py... | true | true |
f71c792738a6eb005cce3420d1463f363558dd6e | 898 | py | Python | Lms/migrations/versions/4b83761bf52a_users_table.py | stsl256/LMS_for_tinkoff | 5ace2a9d8f8e6c80660171502de6689f746535ed | [
"MIT"
] | null | null | null | Lms/migrations/versions/4b83761bf52a_users_table.py | stsl256/LMS_for_tinkoff | 5ace2a9d8f8e6c80660171502de6689f746535ed | [
"MIT"
] | null | null | null | Lms/migrations/versions/4b83761bf52a_users_table.py | stsl256/LMS_for_tinkoff | 5ace2a9d8f8e6c80660171502de6689f746535ed | [
"MIT"
] | 1 | 2020-12-09T00:41:26.000Z | 2020-12-09T00:41:26.000Z | """users table
Revision ID: 4b83761bf52a
Revises: 0d3bdf63aacc
Create Date: 2029-12-29 17:17:20.500426
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4b83761bf52a'
down_revision = '0d3bdf63aacc'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | 29.933333 | 89 | 0.688196 | from alembic import op
import sqlalchemy as sa
revision = '4b83761bf52a'
down_revision = '0d3bdf63aacc'
branch_labels = None
depends_on = None
def upgrade():
add_column('user', sa.Column('phone', sa.String(length=64), nullable=True))
| true | true |
f71c7941417b4404871df8bb404ec9f2347ad2f0 | 1,254 | py | Python | var/spack/repos/builtin/packages/dpdk/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/dpdk/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/dpdk/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Dpdk(MakefilePackage):
"""DPDK is a set of libraries and drivers for fast packet p... | 39.1875 | 95 | 0.748804 |
from spack.package import *
class Dpdk(MakefilePackage):
homepage = "https://github.com/DPDK/dpdk"
url = "https://github.com/DPDK/dpdk/archive/v19.11.tar.gz"
version('20.02', sha256='29e56ea8e47e30110ecb881fa5a37125a865dd2d45b61f68e93e334caaab16b7')
version('19.11', sha256='ce1befb20a5e5c5... | true | true |
f71c7bece95f106b2a9bb71db5ac6017fee41c58 | 1,757 | py | Python | spdx_lint/lint.py | sthagen/verbose-pancake | f12b38c8aea8aee8f7a593a4669dfe5e0a447ba5 | [
"MIT"
] | 1 | 2021-02-28T11:39:00.000Z | 2021-02-28T11:39:00.000Z | spdx_lint/lint.py | sthagen/verbose-pancake | f12b38c8aea8aee8f7a593a4669dfe5e0a447ba5 | [
"MIT"
] | 26 | 2021-02-28T12:07:04.000Z | 2021-02-28T13:04:27.000Z | spdx_lint/lint.py | sthagen/verbose-pancake | f12b38c8aea8aee8f7a593a4669dfe5e0a447ba5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=expression-not-assigned,line-too-long
SPDX_2_2_DCI_TV = {
"SPDXVersion": "SPDX-2.2",
"DataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"DocumentName": "$_SINGLE_LINE",
"DocumentNamespace": "$_URI_MINUS_PART",
"[ExternalDocumentRef]": [
"Do... | 31.375 | 109 | 0.592487 |
SPDX_2_2_DCI_TV = {
"SPDXVersion": "SPDX-2.2",
"DataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"DocumentName": "$_SINGLE_LINE",
"DocumentNamespace": "$_URI_MINUS_PART",
"[ExternalDocumentRef]": [
"DocumentRef-$_IDSTRING $_SPDX_DOCUMENT_URI $_PREFIX_COLON_CHECKSUM",
],
... | true | true |
f71c7c09de030a029f096f3ac1471f0f9a979e3b | 6,549 | py | Python | packages/pytea/pytest/benchmarks/transformers/examples/question-answering/run_squad_trainer.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 1 | 2020-11-30T09:01:57.000Z | 2020-11-30T09:01:57.000Z | packages/pytea/pytest/benchmarks/transformers/examples/question-answering/run_squad_trainer.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | packages/pytea/pytest/benchmarks/transformers/examples/question-answering/run_squad_trainer.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA 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 cop... | 37.637931 | 133 | 0.703008 |
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Optional
import transformers
from transformers import AutoConfig, AutoModelForQuestionAnswering, AutoTokenizer, HfArgumentParser, SquadDataset
from transformers import SquadDataTrainingArguments as DataTrai... | true | true |
f71c7c547c5784ada99fdc35a9188f398ce31ecd | 123 | py | Python | adlmagics/adlmagics/__init__.py | Azure/Azure-Data-Service-Notebook | 6bd28587c9fa0a7c1f9113f638b790b1773c5585 | [
"MIT"
] | 6 | 2018-06-06T08:37:53.000Z | 2020-06-01T13:13:13.000Z | adlmagics/adlmagics/__init__.py | Azure/Azure-Data-Service-Notebook | 6bd28587c9fa0a7c1f9113f638b790b1773c5585 | [
"MIT"
] | 30 | 2018-06-08T02:47:18.000Z | 2018-07-25T07:07:07.000Z | adlmagics/adlmagics/__init__.py | Azure/Azure-Data-Service-Notebook | 6bd28587c9fa0a7c1f9113f638b790b1773c5585 | [
"MIT"
] | 5 | 2018-06-06T08:37:55.000Z | 2021-01-07T09:15:15.000Z | from adlmagics.adlmagics_main import AdlMagics
def load_ipython_extension(ipython):
ipython.register_magics(AdlMagics) | 30.75 | 46 | 0.853659 | from adlmagics.adlmagics_main import AdlMagics
def load_ipython_extension(ipython):
ipython.register_magics(AdlMagics) | true | true |
f71c7e0a03d097595b703379f84e0942a21fd206 | 4,909 | py | Python | kubernetes/client/models/v1beta1_self_subject_access_review_spec.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2019-07-12T05:38:06.000Z | 2019-07-12T05:38:06.000Z | kubernetes/client/models/v1beta1_self_subject_access_review_spec.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_self_subject_access_review_spec.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2021-05-18T12:25:56.000Z | 2021-05-18T12:25:56.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.670968 | 111 | 0.644938 |
from pprint import pformat
from six import iteritems
import re
class V1beta1SelfSubjectAccessReviewSpec(object):
swagger_types = {
'non_resource_attributes': 'V1beta1NonResourceAttributes',
'resource_attributes': 'V1beta1ResourceAttributes'
}
attribute_map = {
'non_resource_... | true | true |
f71c7edc2ae9ca95fcb919548ce178feef3c1b16 | 2,805 | py | Python | st2common/tests/unit/test_triggers_registrar.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 2 | 2021-08-04T01:04:06.000Z | 2021-08-04T01:04:08.000Z | st2common/tests/unit/test_triggers_registrar.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:53:22.000Z | 2022-03-31T03:53:22.000Z | st2common/tests/unit/test_triggers_registrar.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2019-10-11T14:42:28.000Z | 2019-10-11T14:42:28.000Z | # Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.652174 | 88 | 0.745455 |
from __future__ import absolute_import
import os
import st2common.bootstrap.triggersregistrar as triggers_registrar
from st2common.persistence.trigger import Trigger
from st2common.persistence.trigger import TriggerType
from st2tests.base import CleanDbTestCase
from st2tests.fixturesloader import get_fix... | true | true |
f71c8126e5ce154c4f9e4de6a8537b75a21c3612 | 1,486 | py | Python | examples/node_labels.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | 4,417 | 2018-01-13T04:30:48.000Z | 2022-03-31T15:33:59.000Z | examples/node_labels.py | belajarqywok/python | b15bea16a87ad03136a4627941ac437582ea4657 | [
"Apache-2.0"
] | 1,414 | 2018-01-12T19:31:56.000Z | 2022-03-31T22:01:02.000Z | examples/node_labels.py | palnabarun/python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | 2,854 | 2018-01-14T08:57:33.000Z | 2022-03-31T01:41:56.000Z | # Copyright 2016 The Kubernetes 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 or agreed to ... | 28.576923 | 74 | 0.662853 |
from kubernetes import client, config
def main():
config.load_kube_config()
api_instance = client.CoreV1Api()
body = {
"metadata": {
"labels": {
"foo": "bar",
"baz": None}
}
}
node_list = api_instance.list_node()
... | true | true |
f71c817e947e6fd2bca33380c21307542dc6f585 | 110,038 | py | Python | hermes/hermes_parser.py | scottfrazer/hermes | d82d916dd20da58c056b18dbb9b6c01a3700f3e1 | [
"MIT"
] | 14 | 2015-07-29T06:20:00.000Z | 2021-03-21T10:23:38.000Z | hermes/hermes_parser.py | scottfrazer/hermes | d82d916dd20da58c056b18dbb9b6c01a3700f3e1 | [
"MIT"
] | 32 | 2015-02-13T18:34:44.000Z | 2020-03-17T15:08:51.000Z | hermes/hermes_parser.py | scottfrazer/hermes | d82d916dd20da58c056b18dbb9b6c01a3700f3e1 | [
"MIT"
] | 8 | 2015-04-22T11:46:59.000Z | 2019-03-29T22:58:38.000Z |
import sys
import os
import re
import base64
import argparse
from collections import OrderedDict
# Common Code #
def parse_tree_string(parsetree, indent=None, b64_source=True, indent_level=0, debug=False):
indent_str = (' ' * indent * indent_level) if indent else ''
if isinstance(parsetree, ParseTree):
... | 38.088612 | 189 | 0.520529 |
import sys
import os
import re
import base64
import argparse
from collections import OrderedDict
def parse_tree_string(parsetree, indent=None, b64_source=True, indent_level=0, debug=False):
indent_str = (' ' * indent * indent_level) if indent else ''
if isinstance(parsetree, ParseTree):
children = [par... | true | true |
f71c81a8b1726d61edd4af204b0813341e2fdc17 | 20,285 | py | Python | pkg/suggestion/v1beta1/nas/enas/service.py | Adarsh2910/katib | cd095d6a33401cfddee8188943b60cd12c950c33 | [
"Apache-2.0"
] | null | null | null | pkg/suggestion/v1beta1/nas/enas/service.py | Adarsh2910/katib | cd095d6a33401cfddee8188943b60cd12c950c33 | [
"Apache-2.0"
] | 669 | 2021-01-25T10:26:46.000Z | 2022-03-31T22:01:58.000Z | pkg/suggestion/v1beta1/nas/enas/service.py | Adarsh2910/katib | cd095d6a33401cfddee8188943b60cd12c950c33 | [
"Apache-2.0"
] | 1 | 2021-09-10T06:56:10.000Z | 2021-09-10T06:56:10.000Z | import logging
from logging import getLogger, StreamHandler, INFO
import json
import os
import tensorflow as tf
import grpc
from pkg.apis.manager.v1beta1.python import api_pb2
from pkg.apis.manager.v1beta1.python import api_pb2_grpc
from pkg.suggestion.v1beta1.nas.enas.Controller import Controller
from pkg.suggestion.... | 46.956019 | 156 | 0.603944 | import logging
from logging import getLogger, StreamHandler, INFO
import json
import os
import tensorflow as tf
import grpc
from pkg.apis.manager.v1beta1.python import api_pb2
from pkg.apis.manager.v1beta1.python import api_pb2_grpc
from pkg.suggestion.v1beta1.nas.enas.Controller import Controller
from pkg.suggestion.... | true | true |
f71c84d85474a8f5aa729fc1e185f9a029c9a09c | 6,121 | py | Python | Monte-Carlo-Attacks/Monte-Carlo-CIFAR_VAE/cifar10_train.py | SAP-samples/security-research-mi-gen-nn | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | 5 | 2020-02-21T15:13:57.000Z | 2021-08-05T15:18:40.000Z | Monte-Carlo-Attacks/Monte-Carlo-CIFAR_VAE/cifar10_train.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | Monte-Carlo-Attacks/Monte-Carlo-CIFAR_VAE/cifar10_train.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import pickle
from keras.layers import Input, Dense, Lambda, Flatten, Reshape, Layer
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Model
from keras import backend as K
from keras import metrics
# import paramet... | 37.09697 | 123 | 0.663944 | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import pickle
from keras.layers import Input, Dense, Lambda, Flatten, Reshape, Layer
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Model
from keras import backend as K
from keras import metrics
from cifar10_pa... | true | true |
f71c8578ec45fa13ff3af1382cbd44bcc86f9bbe | 93 | py | Python | CVgallery/apps.py | siavashMehran/Portfolio | a592ec51122d96e8e336365fd3cd039a7f223221 | [
"MIT"
] | null | null | null | CVgallery/apps.py | siavashMehran/Portfolio | a592ec51122d96e8e336365fd3cd039a7f223221 | [
"MIT"
] | null | null | null | CVgallery/apps.py | siavashMehran/Portfolio | a592ec51122d96e8e336365fd3cd039a7f223221 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CvgalleryConfig(AppConfig):
name = 'CVgallery'
| 15.5 | 33 | 0.763441 | from django.apps import AppConfig
class CvgalleryConfig(AppConfig):
name = 'CVgallery'
| true | true |
f71c861ea7dd94eca7c2a5bcbc500411f6590433 | 2,705 | py | Python | castle/kivy_wrapper.py | chappers/castle | 0abdb4eed91c45b443c0de8f029dff983f921363 | [
"MIT"
] | null | null | null | castle/kivy_wrapper.py | chappers/castle | 0abdb4eed91c45b443c0de8f029dff983f921363 | [
"MIT"
] | 1 | 2020-11-22T22:00:13.000Z | 2020-11-22T22:00:13.000Z | castle/kivy_wrapper.py | chappers/castle | 0abdb4eed91c45b443c0de8f029dff983f921363 | [
"MIT"
] | null | null | null | """
A simple kivy wrapper
"""
import kivy
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.clock import Clock
"""
A really simple discrete env... | 29.725275 | 85 | 0.629945 |
import kivy
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.clock import Clock
import numpy as np
import random
from gym.spaces import Box, ... | true | true |
f71c862ef26b8cf209313fbb5ff5c086291c53ca | 1,093 | py | Python | python/analysis/TargetScanDB.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | python/analysis/TargetScanDB.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | python/analysis/TargetScanDB.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | import re
from collections import defaultdict
from openpyxl import load_workbook
class TargetScanDB :
def __init__(self):
self.elems = []
self.gene2mirnas = defaultdict(list)
def make_dictionary(self):
for elem in self.elems:
self.gene2mirnas[elem[0]].append(elem)
... | 19.517857 | 102 | 0.548948 | import re
from collections import defaultdict
from openpyxl import load_workbook
class TargetScanDB :
def __init__(self):
self.elems = []
self.gene2mirnas = defaultdict(list)
def make_dictionary(self):
for elem in self.elems:
self.gene2mirnas[elem[0]].append(elem)
... | true | true |
f71c86d03bc2eedb4697b0730ac3f051ebb54808 | 15,522 | py | Python | rasa_nlu/project.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | null | null | null | rasa_nlu/project.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | 6 | 2020-09-26T00:52:34.000Z | 2022-02-10T01:37:38.000Z | rasa_nlu/project.py | esrel/rasa_nlu | 53840788e41b2daf957ec5d488281f70e238730f | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import os
import tempfile
import zipfile
from threading import Lock, Thread
from typing import Text, List
import six
import time
from buil... | 36.097674 | 86 | 0.616029 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import os
import tempfile
import zipfile
from threading import Lock, Thread
from typing import Text, List
import six
import time
from buil... | true | true |
f71c881a51efe3fd38a5ddad27bb876a0a24ab7d | 8,497 | py | Python | pytype/tests/test_namedtuple.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_namedtuple.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_namedtuple.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | """Tests for the namedtuple implementation in collections_overlay.py."""
import textwrap
from pytype import file_utils
from pytype.overlays import collections_overlay
from pytype.pytd import escape
from pytype.pytd import pytd_utils
from pytype.tests import test_base
class NamedtupleTests(test_base.TargetIndependen... | 31.354244 | 88 | 0.564905 |
import textwrap
from pytype import file_utils
from pytype.overlays import collections_overlay
from pytype.pytd import escape
from pytype.pytd import pytd_utils
from pytype.tests import test_base
class NamedtupleTests(test_base.TargetIndependentTest):
def _namedtuple_ast(self, name, fields):
return collection... | true | true |
f71c885784aeccc154dd5cca2413ad6060ae4e6b | 3,087 | py | Python | tests/tests_hrv.py | raimonpv/NeuroKit | cb37d83ee20d6a13a91c4848aa435f41e979e203 | [
"MIT"
] | 1 | 2021-11-14T21:18:43.000Z | 2021-11-14T21:18:43.000Z | tests/tests_hrv.py | raimonpv/NeuroKit | cb37d83ee20d6a13a91c4848aa435f41e979e203 | [
"MIT"
] | null | null | null | tests/tests_hrv.py | raimonpv/NeuroKit | cb37d83ee20d6a13a91c4848aa435f41e979e203 | [
"MIT"
] | 1 | 2021-11-14T21:18:48.000Z | 2021-11-14T21:18:48.000Z | import numpy as np
import neurokit2 as nk
def test_hrv_time():
ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=70, random_state=42)
ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=110, random_state=42)
_, peaks_slow = nk.ecg_process(ecg_slow, sampling_rate=1... | 44.73913 | 96 | 0.661808 | import numpy as np
import neurokit2 as nk
def test_hrv_time():
ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=70, random_state=42)
ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=110, random_state=42)
_, peaks_slow = nk.ecg_process(ecg_slow, sampling_rate=1... | true | true |
f71c887dca4cf691587ab051359773359de7010e | 3,226 | bzl | Python | build_tools/bazel/iree_lit_test.bzl | smit-hinsu/iree | a385d311b701cdc06cb825000ddb34c8a11c6eef | [
"Apache-2.0"
] | 1 | 2022-02-13T15:27:08.000Z | 2022-02-13T15:27:08.000Z | build_tools/bazel/iree_lit_test.bzl | iree-github-actions-bot/iree | 9982f10090527a1a86cd280b4beff9a579b96b38 | [
"Apache-2.0"
] | 1 | 2022-01-27T18:10:51.000Z | 2022-01-27T18:10:51.000Z | build_tools/bazel/iree_lit_test.bzl | iree-github-actions-bot/iree | 9982f10090527a1a86cd280b4beff9a579b96b38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Bazel macros for running lit tests."""
load(":lit_test.bzl", "lit_test", "lit_test_suite")
def ir... | 32.918367 | 79 | 0.6584 |
load(":lit_test.bzl", "lit_test", "lit_test_suite")
def iree_lit_test(
name,
cfg = "//iree:lit.cfg.py",
tools = None,
env = None,
**kwargs):
tools = tools or []
env = env or {}
# when it does, I think better to hardcode it here.
llvm_symbo... | true | true |
f71c8959b58f25069e1143ec6f69c7935fd4843b | 8,176 | py | Python | safe/view.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 1 | 2019-05-06T19:40:43.000Z | 2019-05-06T19:40:43.000Z | safe/view.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 9 | 2019-12-04T22:57:46.000Z | 2022-02-10T07:15:11.000Z | safe/view.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 3 | 2019-05-01T20:41:33.000Z | 2019-10-03T20:57:00.000Z | from people.models import Village, Mother, Driver, HealthCenter, MotherDriverConnection
from django.http import JsonResponse, Http404
from django.core import serializers
from decouple import config
from .geokdbush.geokdbush import around, distance
import requests
import json
import time
FRONTLINE_KEY = config('FRONTLI... | 40.676617 | 183 | 0.57999 | from people.models import Village, Mother, Driver, HealthCenter, MotherDriverConnection
from django.http import JsonResponse, Http404
from django.core import serializers
from decouple import config
from .geokdbush.geokdbush import around, distance
import requests
import json
import time
FRONTLINE_KEY = config('FRONTLI... | true | true |
f71c8a133ef8994968d105d86d6a4f81b0c891b8 | 3,888 | py | Python | examples/python_service/pyservice.py | laungcisin/skein | 7f023239dcdee1482774466032bd63468cc7e42f | [
"BSD-3-Clause"
] | 124 | 2018-04-21T23:26:57.000Z | 2022-01-24T14:34:26.000Z | examples/python_service/pyservice.py | laungcisin/skein | 7f023239dcdee1482774466032bd63468cc7e42f | [
"BSD-3-Clause"
] | 144 | 2018-05-21T13:57:01.000Z | 2022-03-31T13:07:42.000Z | examples/python_service/pyservice.py | laungcisin/skein | 7f023239dcdee1482774466032bd63468cc7e42f | [
"BSD-3-Clause"
] | 36 | 2018-07-01T19:09:42.000Z | 2022-03-31T16:04:47.000Z | import argparse
import os
import tempfile
from getpass import getuser
import skein
from skein.tornado import SimpleAuthMixin, KerberosAuthMixin, init_kerberos
from tornado import web, ioloop
# An argument parser for configuring the application
parser = argparse.ArgumentParser(
description="A web service for subm... | 31.868852 | 80 | 0.626286 | import argparse
import os
import tempfile
from getpass import getuser
import skein
from skein.tornado import SimpleAuthMixin, KerberosAuthMixin, init_kerberos
from tornado import web, ioloop
parser = argparse.ArgumentParser(
description="A web service for submitting python scripts to YARN."
)
parser.add_argumen... | true | true |
f71c8b37ee651e199c6b02d5bd122d3d43661a14 | 2,874 | py | Python | scripts/product.py | etherisc/gif-contracts | 9bc09787a19bd79a0576e46856405cff7fdee15c | [
"Apache-2.0"
] | null | null | null | scripts/product.py | etherisc/gif-contracts | 9bc09787a19bd79a0576e46856405cff7fdee15c | [
"Apache-2.0"
] | null | null | null | scripts/product.py | etherisc/gif-contracts | 9bc09787a19bd79a0576e46856405cff7fdee15c | [
"Apache-2.0"
] | null | null | null | from web3 import Web3
from brownie import Contract
from brownie.convert import to_bytes
from brownie.network import accounts
from brownie.network.account import Account
from brownie import (
Wei,
Contract,
# Registry,
# RegistryController,
License,
LicenseController,
Policy,... | 27.113208 | 93 | 0.641267 | from web3 import Web3
from brownie import Contract
from brownie.convert import to_bytes
from brownie.network import accounts
from brownie.network.account import Account
from brownie import (
Wei,
Contract,
License,
LicenseController,
Policy,
PolicyController,
Query... | true | true |
f71c8bb35951957eb8062c9ab9ba757124ceaade | 1,056 | py | Python | database/creds.py | LaudateCorpus1/n-view | 8f474e40344c9a48e1d6ad43a4cfcb7de641219c | [
"Apache-2.0"
] | null | null | null | database/creds.py | LaudateCorpus1/n-view | 8f474e40344c9a48e1d6ad43a4cfcb7de641219c | [
"Apache-2.0"
] | null | null | null | database/creds.py | LaudateCorpus1/n-view | 8f474e40344c9a48e1d6ad43a4cfcb7de641219c | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2019 Hewlett Packard Enterprise Development LP.
# 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 ... | 35.2 | 74 | 0.749053 |
from mongoengine import signals
from application import db
class Creds(db.Document):
hostip = db.StringField(db_field="h", required=True)
username= db.StringField(db_field="u", required=True)
password = db.StringField(db_field="p", required=True)
| true | true |
f71c8c2ec884cd59a6a4294250c173594ed45b44 | 2,351 | py | Python | bin/ssa-end-to-end-testing/modules/github_service.py | adriaandens/security_content | f1f2f8370ce0f0986804ea9f89555de307a49d66 | [
"Apache-2.0"
] | 1 | 2021-06-17T05:23:19.000Z | 2021-06-17T05:23:19.000Z | bin/ssa-end-to-end-testing/modules/github_service.py | adriaandens/security_content | f1f2f8370ce0f0986804ea9f89555de307a49d66 | [
"Apache-2.0"
] | null | null | null | bin/ssa-end-to-end-testing/modules/github_service.py | adriaandens/security_content | f1f2f8370ce0f0986804ea9f89555de307a49d66 | [
"Apache-2.0"
] | null | null | null |
import git
import os
import logging
import glob
# Logger
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
LOGGER = logging.getLogger(__name__)
SECURITY_CONTENT_URL = "https://github.com/splunk/security_content"
class GithubService:
def __init__(self, security_content_branch):
self.securi... | 36.169231 | 114 | 0.632071 |
import git
import os
import logging
import glob
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
LOGGER = logging.getLogger(__name__)
SECURITY_CONTENT_URL = "https://github.com/splunk/security_content"
class GithubService:
def __init__(self, security_content_branch):
self.security_conte... | true | true |
f71c8ce9b3d8ee3617835b4bd38ad01e0b6f17d2 | 2,725 | py | Python | gumpy/split.py | gumpy-bci/gumpy | abd8230dc50bd8b0a2348c6e08a1bba1c0ed3146 | [
"MIT"
] | 55 | 2018-02-20T14:17:06.000Z | 2022-03-22T06:33:31.000Z | gumpy/gumpy/split.py | Tizzio/gumpy-project | c51ee75ddf1eaa58813b493282014da6f31f5591 | [
"MIT"
] | 5 | 2018-02-17T06:54:55.000Z | 2019-07-16T15:18:25.000Z | gumpy/gumpy/split.py | Tizzio/gumpy-project | c51ee75ddf1eaa58813b493282014da6f31f5591 | [
"MIT"
] | 23 | 2018-02-17T06:45:56.000Z | 2022-03-04T06:01:07.000Z | import sklearn.model_selection
import numpy as np
from sklearn.model_selection import ShuffleSplit, StratifiedShuffleSplit, cross_val_score, StratifiedKFold
def normal(X, labels, test_size):
"""Split a dataset into training and test parts.
Args:
X (numpy.ndarray): 2D features matrix
labels: ... | 36.333333 | 119 | 0.693945 | import sklearn.model_selection
import numpy as np
from sklearn.model_selection import ShuffleSplit, StratifiedShuffleSplit, cross_val_score, StratifiedKFold
def normal(X, labels, test_size):
Y = labels
X_train, X_test, Y_train, Y_test = \
sklearn.model_selection.train_test_split(X, Y,
... | true | true |
f71c8d37ae326e29cdf957282fbbe1c51cf54ac4 | 1,004 | py | Python | src/slack.py | villoro/airflow_tasks | 81bd892744a9bbbf6e01903649b6c3786a955a5a | [
"MIT"
] | null | null | null | src/slack.py | villoro/airflow_tasks | 81bd892744a9bbbf6e01903649b6c3786a955a5a | [
"MIT"
] | 4 | 2020-10-09T15:59:09.000Z | 2020-11-18T08:34:44.000Z | src/slack.py | villoro/airflow_tasks | 81bd892744a9bbbf6e01903649b6c3786a955a5a | [
"MIT"
] | null | null | null | import json
import requests
from utils import get_secret
from utils import is_pro
def send_slack(text="", channel="test", blocks=None):
assert channel in ["test", "events", "general"]
webhook = get_secret(f"SLACK_WEBHOOK_{channel.upper()}")
data = {"text": text}
if blocks:
data["blocks"] ... | 21.361702 | 84 | 0.644422 | import json
import requests
from utils import get_secret
from utils import is_pro
def send_slack(text="", channel="test", blocks=None):
assert channel in ["test", "events", "general"]
webhook = get_secret(f"SLACK_WEBHOOK_{channel.upper()}")
data = {"text": text}
if blocks:
data["blocks"] ... | true | true |
f71c8d87b4e0910142ebc974a5c242cbc32868ab | 798 | py | Python | tree/b_my_solution.py | master-cim/algorithm | a57f473ceb32b96240989e31ac33154e55c00724 | [
"MIT"
] | 1 | 2022-03-31T07:30:53.000Z | 2022-03-31T07:30:53.000Z | tree/b_my_solution.py | master-cim/algorithm | a57f473ceb32b96240989e31ac33154e55c00724 | [
"MIT"
] | null | null | null | tree/b_my_solution.py | master-cim/algorithm | a57f473ceb32b96240989e31ac33154e55c00724 | [
"MIT"
] | 2 | 2022-03-04T09:42:03.000Z | 2022-03-30T14:51:32.000Z | # B. Сбалансированное дерево
# ID успешной посылки 66593272
class Node:
def __init__(self, value, left=None, right=None):
self.value = value
self.right = right
self.left = left
def height(root):
if root is None:
return 0
return max(height(root.left), height(root.right)) ... | 21.567568 | 57 | 0.616541 |
class Node:
def __init__(self, value, left=None, right=None):
self.value = value
self.right = right
self.left = left
def height(root):
if root is None:
return 0
return max(height(root.left), height(root.right)) + 1
def solution(root):
if root is None:
retu... | true | true |
f71c8d946e5ae29a441cb944deb2a30473a80d7d | 21,205 | py | Python | py/desispec/scripts/stdstars.py | segasai/desispec | 4786347a8ad44effa4985671423f7ba0129ba6c3 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/scripts/stdstars.py | segasai/desispec | 4786347a8ad44effa4985671423f7ba0129ba6c3 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/scripts/stdstars.py | segasai/desispec | 4786347a8ad44effa4985671423f7ba0129ba6c3 | [
"BSD-3-Clause"
] | null | null | null |
"""
Get the normalized best template to do flux calibration.
"""
#- TODO: refactor algorithmic code into a separate module/function
import argparse
import sys
import numpy as np
from astropy.io import fits
from astropy import units
from astropy.table import Table
from desispec import io
from desispec.fluxcalibrat... | 43.01217 | 175 | 0.614902 |
import argparse
import sys
import numpy as np
from astropy.io import fits
from astropy import units
from astropy.table import Table
from desispec import io
from desispec.fluxcalibration import match_templates,normalize_templates,isStdStar
from desispec.interpolation import resample_flux
from desiutil.log import ... | true | true |
f71c8ece5ac79d8215cf3897a8f8aec003849358 | 33,179 | py | Python | ros/src/tl_detector/light_classification/protos/box_predictor_pb2.py | allaydesai/SDCND_system_integration | 078c1f77ea0c5f09af42f7974d9b49a4000f10d7 | [
"MIT"
] | 13 | 2020-03-04T10:16:28.000Z | 2022-01-06T11:14:29.000Z | ros/src/tl_detector/light_classification/protos/box_predictor_pb2.py | allaydesai/SDCND_system_integration | 078c1f77ea0c5f09af42f7974d9b49a4000f10d7 | [
"MIT"
] | 5 | 2020-01-28T23:04:54.000Z | 2022-02-10T00:23:36.000Z | ros/src/tl_detector/light_classification/protos/box_predictor_pb2.py | allaydesai/SDCND_system_integration | 078c1f77ea0c5f09af42f7974d9b49a4000f10d7 | [
"MIT"
] | 6 | 2019-10-22T12:43:40.000Z | 2021-09-18T08:10:31.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/box_predictor.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... | 53.0864 | 3,991 | 0.777811 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f71c8eebfa69486d737645f22b74bf824a91eeee | 1,479 | py | Python | beerxml/picobrew_parser.py | rryanburton/PicobrewServerDjango | 24e616677a8543638204889bfe19062b9d16c7ae | [
"MIT"
] | 5 | 2017-07-25T04:32:47.000Z | 2020-10-10T14:27:16.000Z | beerxml/picobrew_parser.py | rryanburton/PicobrewServerDjango | 24e616677a8543638204889bfe19062b9d16c7ae | [
"MIT"
] | 3 | 2020-02-11T23:53:22.000Z | 2021-06-10T19:29:52.000Z | beerxml/picobrew_parser.py | rryanburton/PicobrewServerDjango | 24e616677a8543638204889bfe19062b9d16c7ae | [
"MIT"
] | 1 | 2018-12-23T08:57:34.000Z | 2018-12-23T08:57:34.000Z | from pybeerxml.parser import Parser
from .picobrew_recipe import PicoBrewRecipe
from .picobrew_program_step import PicoBrewProgramStep
from xml.etree import ElementTree
class PicoBrewParser(Parser):
def parse(self, xml_file):
# Parse the BeerXML file
recipes = super(PicoBrewParser, self).parse(xm... | 29.58 | 75 | 0.610548 | from pybeerxml.parser import Parser
from .picobrew_recipe import PicoBrewRecipe
from .picobrew_program_step import PicoBrewProgramStep
from xml.etree import ElementTree
class PicoBrewParser(Parser):
def parse(self, xml_file):
recipes = super(PicoBrewParser, self).parse(xml_file)
... | true | true |
f71c8f6aa2a62ab271f35e5e3080e58ef457c6cb | 782 | py | Python | examples/kmeansHeightWeight.py | Duane321/pyprobml | 6d0ba29f22dc7fec9dfc73788bc5520e97663bdb | [
"MIT"
] | null | null | null | examples/kmeansHeightWeight.py | Duane321/pyprobml | 6d0ba29f22dc7fec9dfc73788bc5520e97663bdb | [
"MIT"
] | null | null | null | examples/kmeansHeightWeight.py | Duane321/pyprobml | 6d0ba29f22dc7fec9dfc73788bc5520e97663bdb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import matplotlib.pyplot as pl
import numpy as np
from utils import util
from sklearn.cluster import KMeans
from utils.util import save_fig
data = util.load_mat('heightWeight/heightWeight')
data = data['heightWeightData']
markers = 'Dox'
colors = 'rgb'
for i in range(3):
KM_model = KMeans(i... | 28.962963 | 56 | 0.644501 |
import matplotlib.pyplot as pl
import numpy as np
from utils import util
from sklearn.cluster import KMeans
from utils.util import save_fig
data = util.load_mat('heightWeight/heightWeight')
data = data['heightWeightData']
markers = 'Dox'
colors = 'rgb'
for i in range(3):
KM_model = KMeans(init='k-means++', n_cl... | true | true |
f71c8fc259c0697f53a0ebace9290263e205e66d | 2,867 | py | Python | testsuite/N806.py | ramnes/pep8-naming | 9d2004fcd28d2434bcceeed843cd353a2e8808e2 | [
"MIT"
] | null | null | null | testsuite/N806.py | ramnes/pep8-naming | 9d2004fcd28d2434bcceeed843cd353a2e8808e2 | [
"MIT"
] | null | null | null | testsuite/N806.py | ramnes/pep8-naming | 9d2004fcd28d2434bcceeed843cd353a2e8808e2 | [
"MIT"
] | null | null | null | #: Okay
def test():
good = 1
#: Okay
def test():
def test2():
good = 1
#: Okay
GOOD = 1
#: Okay
class Test(object):
GOOD = 1
#: N806
def test():
Bad = 1
#: N806
def test():
VERY = 2
#: N806
def test():
def test2():
class Foo(object):
def test3(self):
B... | 16.668605 | 79 | 0.536798 |
def test():
good = 1
def test():
def test2():
good = 1
GOOD = 1
class Test(object):
GOOD = 1
def test():
Bad = 1
def test():
VERY = 2
def test():
def test2():
class Foo(object):
def test3(self):
Bad = 3
def test():
Bad = 1
def good():
... | true | true |
f71c91a3f54d9b713dc013f6441b683eae4ab3e6 | 6,683 | py | Python | graphnas_variants/micro_graphnas/micro_search_space.py | mhnnunes/nas_gnn | 91092acfee9fdbbef3e22252040b80aa96143311 | [
"Apache-2.0"
] | 13 | 2020-07-29T12:45:22.000Z | 2022-03-07T06:26:02.000Z | graphnas_variants/micro_graphnas/micro_search_space.py | mhnnunes/nas_gnn | 91092acfee9fdbbef3e22252040b80aa96143311 | [
"Apache-2.0"
] | null | null | null | graphnas_variants/micro_graphnas/micro_search_space.py | mhnnunes/nas_gnn | 91092acfee9fdbbef3e22252040b80aa96143311 | [
"Apache-2.0"
] | 3 | 2020-09-27T06:43:17.000Z | 2020-11-26T08:43:35.000Z | import torch
import torch.nn.functional as F
from torch.nn import Module
from torch_geometric.nn.conv import *
gnn_list = [
"gat_8", # GAT with 8 heads
"gat_6", # GAT with 6 heads
"gat_4", # GAT with 4 heads
"gat_2", # GAT with 2 heads
"gat_1", # GAT with 1 heads
"gcn", # GCN
"cheb", ... | 34.448454 | 79 | 0.5511 | import torch
import torch.nn.functional as F
from torch.nn import Module
from torch_geometric.nn.conv import *
gnn_list = [
"gat_8",
"gat_6",
"gat_4",
"gat_2",
"gat_1",
"gcn",
"cheb",
"sage",
"arma",
"sg",
"linear",
"zero",
]
act_list = [
... | true | true |
f71c945e6058577857c0b8a5868cd8a7b234044b | 2,412 | py | Python | jupyter_server_mathjax/app.py | minrk/jupyter_server_mathjax | 4dfbcf70ee00de3776cd2acf1debdc790e56f64e | [
"BSD-3-Clause"
] | null | null | null | jupyter_server_mathjax/app.py | minrk/jupyter_server_mathjax | 4dfbcf70ee00de3776cd2acf1debdc790e56f64e | [
"BSD-3-Clause"
] | null | null | null | jupyter_server_mathjax/app.py | minrk/jupyter_server_mathjax | 4dfbcf70ee00de3776cd2acf1debdc790e56f64e | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from pathlib import Path
from traitlets import default, observe, Unicode
from tornado.web import RedirectHandler
from jupyter_server.extension.application import ExtensionApp
from jupyter_server.utils import url_path... | 31.736842 | 105 | 0.625622 |
from pathlib import Path
from traitlets import default, observe, Unicode
from tornado.web import RedirectHandler
from jupyter_server.extension.application import ExtensionApp
from jupyter_server.utils import url_path_join
from jupyter_server.transutils import _
STATIC_ASSETS_PATH = Path(__file__).parent / "stati... | true | true |
f71c94ef510848605c979ad6aae3be1a96a86bcd | 5,538 | py | Python | src/movies/management/commands/add_kp_movie.py | Little-Pogchamp-Team/kinopoisk_on_django | 06e1b5ee14c7e77dd5b69140732461a02bf44566 | [
"MIT"
] | 10 | 2021-01-10T09:39:16.000Z | 2022-02-05T06:40:47.000Z | src/movies/management/commands/add_kp_movie.py | Little-Pogchamp-Team/kinopoisk_on_django | 06e1b5ee14c7e77dd5b69140732461a02bf44566 | [
"MIT"
] | null | null | null | src/movies/management/commands/add_kp_movie.py | Little-Pogchamp-Team/kinopoisk_on_django | 06e1b5ee14c7e77dd5b69140732461a02bf44566 | [
"MIT"
] | 1 | 2021-01-11T17:04:06.000Z | 2021-01-11T17:04:06.000Z | import asyncio
import os
from datetime import date
from os import getenv
from django.core.files.images import ImageFile
from django.core.management.base import BaseCommand
from movies.models import Poster, Movie, Genre
from person.models import Person, Photo, PersonRole
from parser.formatter import get_formatted_movie... | 43.606299 | 120 | 0.639581 | import asyncio
import os
from datetime import date
from os import getenv
from django.core.files.images import ImageFile
from django.core.management.base import BaseCommand
from movies.models import Poster, Movie, Genre
from person.models import Person, Photo, PersonRole
from parser.formatter import get_formatted_movie... | true | true |
f71c9666f42e0445cb30a86089bfe762d8443e53 | 1,292 | py | Python | archspee/presenters/log.py | wangpy/archspee | 97855f903106fba567ffda8cdc25b061cd8bdf5e | [
"MIT"
] | 8 | 2019-01-22T13:03:40.000Z | 2021-12-30T22:11:12.000Z | archspee/presenters/log.py | wangpy/archspee | 97855f903106fba567ffda8cdc25b061cd8bdf5e | [
"MIT"
] | null | null | null | archspee/presenters/log.py | wangpy/archspee | 97855f903106fba567ffda8cdc25b061cd8bdf5e | [
"MIT"
] | null | null | null | from archspee.presenters import PresenterBase
from archspee.listeners import ListenerStatus
_LOG_LEVEL = None
class LogPresenter(PresenterBase):
def __init__(self, action_callback, **kwargs):
self.__log_level = _LOG_LEVEL
super(LogPresenter, self).__init__(action_callback)
self.status = Li... | 39.151515 | 100 | 0.687307 | from archspee.presenters import PresenterBase
from archspee.listeners import ListenerStatus
_LOG_LEVEL = None
class LogPresenter(PresenterBase):
def __init__(self, action_callback, **kwargs):
self.__log_level = _LOG_LEVEL
super(LogPresenter, self).__init__(action_callback)
self.status = Li... | true | true |
f71c96af05ee8e95f66b314c7abe60dd75cb2846 | 14,146 | py | Python | python/oneflow/nn/optimizer/optimizer.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/optimizer.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/optimizer.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 38.336043 | 148 | 0.600028 | import collections
import warnings
from copy import deepcopy
from itertools import chain
from typing import Any, Callable, Dict, Union
from oneflow.framework.tensor import Tensor
from oneflow.nn.graph.block import TensorBlock
from oneflow.nn.parameter import Parameter
from oneflow.nn.utils.clip_grad import clip_grad_n... | true | true |
f71c971bf4dd805103974078d53aae515b91c0a1 | 1,361 | py | Python | petastorm/cache.py | cclauss/petastorm | 12fc6542005c6dc7c99997604b939536cca79fa9 | [
"Apache-2.0"
] | 1 | 2018-09-25T10:59:29.000Z | 2018-09-25T10:59:29.000Z | petastorm/cache.py | cclauss/petastorm | 12fc6542005c6dc7c99997604b939536cca79fa9 | [
"Apache-2.0"
] | null | null | null | petastorm/cache.py | cclauss/petastorm | 12fc6542005c6dc7c99997604b939536cca79fa9 | [
"Apache-2.0"
] | 1 | 2018-09-25T10:59:32.000Z | 2018-09-25T10:59:32.000Z | # Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33.195122 | 112 | 0.709772 |
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class CacheBase(object):
@abc.abstractmethod
def get(self, key, fill_cache_func):
pass
class NullCache(CacheBase):
def get(self, key, fill_cache_func):
return fill_cache_func()
| true | true |
f71c98221a39db59c80de17a016146f0be85cd00 | 6,266 | py | Python | nicos_mlz/mira/devices/stargate.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/mira/devices/stargate.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/mira/devices/stargate.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 34.811111 | 79 | 0.608682 |
from time import monotonic
from nicos.core import SIMULATION, Attach, InvalidValueError, Param, listof, \
status
from nicos.devices import entangle
from nicos_mlz.mira.devices.axis import HoveringAxis
class Stargate(entangle.DigitalOutput):
valuetype = listof(int)
parameters =... | true | true |
f71c98c738d67bea14753699412d0bb3f45ce1c4 | 237 | py | Python | jina/types/arrays/__init__.py | slettner/jina | 4140961c62359e3acd540a6d88931665c6313824 | [
"Apache-2.0"
] | null | null | null | jina/types/arrays/__init__.py | slettner/jina | 4140961c62359e3acd540a6d88931665c6313824 | [
"Apache-2.0"
] | null | null | null | jina/types/arrays/__init__.py | slettner/jina | 4140961c62359e3acd540a6d88931665c6313824 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from .document import DocumentArray
from .querylang import QueryLangArray
from .chunk import ChunkArray
from .match import MatchArray
| 29.625 | 74 | 0.801688 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from .document import DocumentArray
from .querylang import QueryLangArray
from .chunk import ChunkArray
from .match import MatchArray
| true | true |
f71c9a76519602baf175d90363655dc76c65ea28 | 512 | py | Python | MobileRevelator/python/postbank_finanzassistent_decrypt.py | ohunecker/MR | b0c93436c7964d87a0b8154f8b7662b1731124b9 | [
"MIT"
] | 98 | 2019-02-03T22:50:24.000Z | 2022-03-17T12:50:56.000Z | MobileRevelator/python/postbank_finanzassistent_decrypt.py | cewatkins/MR | 5ba553fd0eb4c1d80842074a553119486f005822 | [
"MIT"
] | 10 | 2019-03-14T20:12:10.000Z | 2020-05-23T10:37:54.000Z | MobileRevelator/python/postbank_finanzassistent_decrypt.py | cewatkins/MR | 5ba553fd0eb4c1d80842074a553119486f005822 | [
"MIT"
] | 30 | 2019-02-03T22:50:27.000Z | 2022-03-30T12:37:30.000Z | #Filename="finanzassistent"
#Type=Prerun
import os
def main():
ctx.gui_setMainLabel("Postbank Finanzassistent: Extracting key");
error=""
dbkey="73839EC3A528910B235859947CC8424543D7B686"
ctx.gui_setMainLabel("Postbank: Key extracted: " + dbkey)
if not (ctx.fs_sqlcipher_decrypt(filename, ... | 34.133333 | 78 | 0.6875 |
import os
def main():
ctx.gui_setMainLabel("Postbank Finanzassistent: Extracting key");
error=""
dbkey="73839EC3A528910B235859947CC8424543D7B686"
ctx.gui_setMainLabel("Postbank: Key extracted: " + dbkey)
if not (ctx.fs_sqlcipher_decrypt(filename, filename + ".dec", dbkey)):
erro... | true | true |
f71c9ac104ae461bd523cc38b814d19111b44e47 | 1,166 | py | Python | google/ads/googleads/v10/enums/types/feed_item_target_device.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/enums/types/feed_item_target_device.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/enums/types/feed_item_target_device.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 29.15 | 74 | 0.716123 |
import proto
__protobuf__ = proto.module(
package="google.ads.googleads.v10.enums",
marshal="google.ads.googleads.v10",
manifest={"FeedItemTargetDeviceEnum",},
)
class FeedItemTargetDeviceEnum(proto.Message):
class FeedItemTargetDevice(proto.Enum):
UNSPECIFIED = 0
U... | true | true |
f71c9b79db447996719fed63c8fac35684923c7b | 3,915 | py | Python | nova/scheduler/ironic_host_manager.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/ironic_host_manager.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/ironic_host_manager.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011-2014 OpenStack Foundation
# 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.apa... | 38.382353 | 78 | 0.676373 |
from oslo.config import cfg
from oslo.serialization import jsonutils
from oslo.utils import timeutils
from nova.openstack.common import log as logging
import nova.scheduler.base_baremetal_host_manager as bbhm
from nova.scheduler import host_manager
host_manager_opts = [
cfg.ListOpt('baremetal_sche... | true | true |
f71c9cd673a863c06787408e99e849774b777b45 | 931 | py | Python | main.py | flatman123/device_auto_config_v0.0.1 | b6335e07735f937089c528130c4b50a6bd32641d | [
"MIT"
] | null | null | null | main.py | flatman123/device_auto_config_v0.0.1 | b6335e07735f937089c528130c4b50a6bd32641d | [
"MIT"
] | null | null | null | main.py | flatman123/device_auto_config_v0.0.1 | b6335e07735f937089c528130c4b50a6bd32641d | [
"MIT"
] | 1 | 2020-10-09T14:43:21.000Z | 2020-10-09T14:43:21.000Z | from decrypt_file import decrypt
from get_commands import fetch_commands
import netmiko
import os
import concurrent.futures
hosts = decrypt(f'{os.getcwd()}/device_json.gpg')
def send_commands(connection, host, commands):
connection.send_config_set(commands)
return
def run(ip_address):
for device in hosts... | 26.6 | 61 | 0.654135 | from decrypt_file import decrypt
from get_commands import fetch_commands
import netmiko
import os
import concurrent.futures
hosts = decrypt(f'{os.getcwd()}/device_json.gpg')
def send_commands(connection, host, commands):
connection.send_config_set(commands)
return
def run(ip_address):
for device in hosts... | true | true |
f71c9dde7d847171940268a4386ef04e1c81c1ea | 20,567 | py | Python | tmmPCECalc.py | NREL/PVwindow | df7091c9d1ebd280aca53c50015e3b1ee7a3183e | [
"BSD-2-Clause"
] | null | null | null | tmmPCECalc.py | NREL/PVwindow | df7091c9d1ebd280aca53c50015e3b1ee7a3183e | [
"BSD-2-Clause"
] | null | null | null | tmmPCECalc.py | NREL/PVwindow | df7091c9d1ebd280aca53c50015e3b1ee7a3183e | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 4 12:29:21 2021
@author: aduell
"""
#import numpy as np
from numpy import pi, linspace, array, exp
#import tmm
from tmm import inc_tmm, inc_absorp_in_each_layer, inf
#import pandas as pd
#import tmm_vw as tmm
#import matplotlib.pyplot as plt
from matplotlib.pyplot impo... | 37.876611 | 196 | 0.685516 |
from numpy import pi, linspace, array, exp
from tmm import inc_tmm, inc_absorp_in_each_layer, inf
from matplotlib.pyplot import plot,figure,xlabel,ylabel,show,ylim,legend
from wpv import Layer, Stack
from scipy.interpolate import interp1d
from scipy.integrate import quad, trapz
from scipy.optimize import fsolv... | true | true |
f71c9f9d367cb8155ed384c51b60c4ecac3f16c3 | 447 | py | Python | plan_marker/migrations/0003_auto_20150829_1529.py | oskgeek/tdl_fitness | e61da8b4b216147ba1e5d9b64db75f2cf8568759 | [
"Apache-2.0"
] | null | null | null | plan_marker/migrations/0003_auto_20150829_1529.py | oskgeek/tdl_fitness | e61da8b4b216147ba1e5d9b64db75f2cf8568759 | [
"Apache-2.0"
] | null | null | null | plan_marker/migrations/0003_auto_20150829_1529.py | oskgeek/tdl_fitness | e61da8b4b216147ba1e5d9b64db75f2cf8568759 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('plan_marker', '0002_userprofile_plan_created'),
]
operations = [
migrations.AlterField(
model_name='userprofile'... | 22.35 | 74 | 0.630872 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('plan_marker', '0002_userprofile_plan_created'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='pla... | true | true |
f71ca0e23cd8fb822e78350418aeea8241322271 | 1,142 | py | Python | sequenceplot/__init__.py | kickingvegas/SequencePlot | 82514e0dc1a3e670ea727041219dc7a69fd9e96b | [
"Apache-2.0"
] | 3 | 2017-07-23T22:32:22.000Z | 2020-05-03T20:16:36.000Z | sequenceplot/__init__.py | kickingvegas/SequencePlot | 82514e0dc1a3e670ea727041219dc7a69fd9e96b | [
"Apache-2.0"
] | null | null | null | sequenceplot/__init__.py | kickingvegas/SequencePlot | 82514e0dc1a3e670ea727041219dc7a69fd9e96b | [
"Apache-2.0"
] | 1 | 2021-09-10T08:45:39.000Z | 2021-09-10T08:45:39.000Z | #!/usr/bin/env python
# Copyright 2012 Yummy Melon Software LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 26.55814 | 89 | 0.738179 |
__version__ = '0.4'
class SyntaxError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def picEscapeString(buf):
result = buf.replace('"', '\\"')
return result
from SequenceObject import SequenceObject
from P... | true | true |
f71ca16a0d7d9c01229a650639558eb2857cf6b5 | 681 | py | Python | python/discord.py/example-bot.py | martian17/Community-Bin | e7a1471571227fdda3929a9cdd9a3cce743156df | [
"MIT"
] | null | null | null | python/discord.py/example-bot.py | martian17/Community-Bin | e7a1471571227fdda3929a9cdd9a3cce743156df | [
"MIT"
] | null | null | null | python/discord.py/example-bot.py | martian17/Community-Bin | e7a1471571227fdda3929a9cdd9a3cce743156df | [
"MIT"
] | null | null | null | # This is an example of a very basic discord bot in python
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=".", description="A basic discord bot")
@bot.event
async def on_ready():
print("I'm online!")
@commands.command(name="ping")
async def _ping(ctx):
latency = bot.late... | 23.482759 | 73 | 0.678414 |
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=".", description="A basic discord bot")
@bot.event
async def on_ready():
print("I'm online!")
@commands.command(name="ping")
async def _ping(ctx):
latency = bot.latency * 1000 # convert to ms
embed = discord.Embed(
... | true | true |
f71ca30466bc275ef559c5fc42e0c93a4703385c | 1,407 | py | Python | csvkit/convert/__init__.py | tthibo/csvkit | fb12c7df32504b51b9def6e3cff41c36147616cf | [
"MIT"
] | 2 | 2015-03-06T15:22:02.000Z | 2016-03-11T13:35:48.000Z | csvkit/convert/__init__.py | tthibo/csvkit | fb12c7df32504b51b9def6e3cff41c36147616cf | [
"MIT"
] | null | null | null | csvkit/convert/__init__.py | tthibo/csvkit | fb12c7df32504b51b9def6e3cff41c36147616cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from csvitself import csv2csv
from fixed import fixed2csv
from js import json2csv
from xls import xls2csv
SUPPORTED_FORMATS = ['fixed', 'xls', 'csv']
def convert(f, format, schema=None, key=None, **kwargs):
"""
Convert a file of a specified format to CSV.
"""
if not f:
r... | 25.125 | 78 | 0.606254 |
from csvitself import csv2csv
from fixed import fixed2csv
from js import json2csv
from xls import xls2csv
SUPPORTED_FORMATS = ['fixed', 'xls', 'csv']
def convert(f, format, schema=None, key=None, **kwargs):
if not f:
raise ValueError('f must not be None')
if not format:
raise ValueError('fo... | true | true |
f71ca381286ae5e3aa87acbe71537fe119e50954 | 4,491 | py | Python | demoNN.py | zelhar/mg21 | f8392aba7deb63aa85f3d137ef81dea1bb742b41 | [
"MIT"
] | null | null | null | demoNN.py | zelhar/mg21 | f8392aba7deb63aa85f3d137ef81dea1bb742b41 | [
"MIT"
] | null | null | null | demoNN.py | zelhar/mg21 | f8392aba7deb63aa85f3d137ef81dea1bb742b41 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset, TensorDataset
from torchvision import datasets
from torchvision.transforms import ToTensor, Lambda, Compose
import matplotlib.pyplot as plt
import torch.distributions as D
import torch.nn.functional as F
# Download training data from... | 25.959538 | 91 | 0.649521 | import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset, TensorDataset
from torchvision import datasets
from torchvision.transforms import ToTensor, Lambda, Compose
import matplotlib.pyplot as plt
import torch.distributions as D
import torch.nn.functional as F
training_data = datasets.Fas... | true | true |
f71ca389de2acdd4122644dc61a4fb411c6d4bf0 | 4,451 | py | Python | geoist/snoopy/algorithms/correlator_algorithms/cross_correlator.py | CHEN-Zhaohui/geoist | 06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b | [
"MIT"
] | 53 | 2018-11-17T03:29:55.000Z | 2022-03-18T02:36:25.000Z | geoist/snoopy/algorithms/correlator_algorithms/cross_correlator.py | CHEN-Zhaohui/geoist | 06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b | [
"MIT"
] | 3 | 2018-11-28T11:37:51.000Z | 2019-01-30T01:52:45.000Z | geoist/snoopy/algorithms/correlator_algorithms/cross_correlator.py | CHEN-Zhaohui/geoist | 06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b | [
"MIT"
] | 35 | 2018-11-17T03:29:57.000Z | 2022-03-23T17:57:06.000Z | # coding=utf-8
from geoist.snoopy.algorithms.correlator_algorithms import CorrelatorAlgorithm
from geoist.snoopy.modules.correlation_result import CorrelationResult
from geoist.snoopy.constants import (DEFAULT_SHIFT_IMPACT,
DEFAULT_ALLOWED_SHIFT_SECONDS)
class CrossCorrelator(Correlato... | 43.637255 | 128 | 0.642103 |
from geoist.snoopy.algorithms.correlator_algorithms import CorrelatorAlgorithm
from geoist.snoopy.modules.correlation_result import CorrelationResult
from geoist.snoopy.constants import (DEFAULT_SHIFT_IMPACT,
DEFAULT_ALLOWED_SHIFT_SECONDS)
class CrossCorrelator(CorrelatorAlgorithm):
... | true | true |
f71ca44defb36643ad8a93f4726f956b8b913e57 | 346 | py | Python | Algorithms/746/min-cost-climbing-stairs.py | M-Quadra/LeetCode-problems | 0cc100aa1e50b02df289f04fe2e0b97239eb9895 | [
"MIT"
] | null | null | null | Algorithms/746/min-cost-climbing-stairs.py | M-Quadra/LeetCode-problems | 0cc100aa1e50b02df289f04fe2e0b97239eb9895 | [
"MIT"
] | null | null | null | Algorithms/746/min-cost-climbing-stairs.py | M-Quadra/LeetCode-problems | 0cc100aa1e50b02df289f04fe2e0b97239eb9895 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
dp = [0x7FFFFFFF for _ in range(len(cost)+2)]
dp[0] = dp[1] = 0
for i, v in enumerate(cost):
v += dp[i]
dp[i+1] = min(dp[i+1], v)
dp[i+2] = min(dp[i+2], v)
... | 31.454545 | 60 | 0.508671 | from typing import List
class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
dp = [0x7FFFFFFF for _ in range(len(cost)+2)]
dp[0] = dp[1] = 0
for i, v in enumerate(cost):
v += dp[i]
dp[i+1] = min(dp[i+1], v)
dp[i+2] = min(dp[i+2], v)
... | true | true |
f71ca45c2a4d1c7deaea184b4a83e5e006c32425 | 90 | py | Python | regtests/str/mul.py | bpmbank/PythonJS | 591a80afd8233fb715493591db2b68f1748558d9 | [
"BSD-3-Clause"
] | 319 | 2015-01-02T11:34:16.000Z | 2022-03-25T00:43:33.000Z | regtests/str/mul.py | bpmbank/PythonJS | 591a80afd8233fb715493591db2b68f1748558d9 | [
"BSD-3-Clause"
] | 10 | 2015-02-03T02:33:09.000Z | 2021-11-09T21:41:00.000Z | regtests/str/mul.py | bpmbank/PythonJS | 591a80afd8233fb715493591db2b68f1748558d9 | [
"BSD-3-Clause"
] | 61 | 2015-01-02T12:01:56.000Z | 2021-12-08T07:16:16.000Z | """string multiplication"""
def main():
a = 'hi'
b = a * 2
TestError( b == 'hihi' )
| 10 | 27 | 0.522222 |
def main():
a = 'hi'
b = a * 2
TestError( b == 'hihi' )
| true | true |
f71ca4a04ecbc21aada0d63286c6160730dff7df | 1,204 | py | Python | pyro/distributions/reflected.py | ajrcampbell/pyro | 37680e6d08f20cda95729427143f17875484b21d | [
"MIT"
] | null | null | null | pyro/distributions/reflected.py | ajrcampbell/pyro | 37680e6d08f20cda95729427143f17875484b21d | [
"MIT"
] | null | null | null | pyro/distributions/reflected.py | ajrcampbell/pyro | 37680e6d08f20cda95729427143f17875484b21d | [
"MIT"
] | null | null | null | from torch.distributions import constraints
from torch.distributions.transforms import AbsTransform
from pyro.distributions.torch import TransformedDistribution
class ReflectedDistribution(TransformedDistribution):
"""
Equivalent to ``TransformedDistribution(base_dist, AbsTransform())``,
but additionally... | 37.625 | 79 | 0.709302 | from torch.distributions import constraints
from torch.distributions.transforms import AbsTransform
from pyro.distributions.torch import TransformedDistribution
class ReflectedDistribution(TransformedDistribution):
support = constraints.positive
def __init__(self, base_dist, validate_args=None):
if ... | true | true |
f71ca57230e7a9c4e629ca823816dd4a71bdd7a4 | 572 | py | Python | localflavor/in_/models.py | stephendwolff/django-localflavor | 082d8539d2797c431bec38fe85e7894ea74b07ac | [
"BSD-3-Clause"
] | null | null | null | localflavor/in_/models.py | stephendwolff/django-localflavor | 082d8539d2797c431bec38fe85e7894ea74b07ac | [
"BSD-3-Clause"
] | null | null | null | localflavor/in_/models.py | stephendwolff/django-localflavor | 082d8539d2797c431bec38fe85e7894ea74b07ac | [
"BSD-3-Clause"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import CharField
from .in_states import STATE_CHOICES
class INStateField(CharField):
"""
A model field that forms represent as a ``forms.INStateField`` field and
stores the two-letter Indian state abbreviation in the dat... | 31.777778 | 76 | 0.708042 | from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import CharField
from .in_states import STATE_CHOICES
class INStateField(CharField):
description = _("Indian state (two uppercase letters)")
def __init__(self, *args, **kwargs):
kwargs['choices'] = STATE_CHOICES
... | true | true |
f71ca6f85ce1ce3a97c314e0b3fd3109c786d615 | 31,747 | py | Python | bot/orders/models.py | psemdel/py-trading-bot | 69da4164b3f6a3ed3e6dc81d5aefc0273b4cb019 | [
"MIT"
] | null | null | null | bot/orders/models.py | psemdel/py-trading-bot | 69da4164b3f6a3ed3e6dc81d5aefc0273b4cb019 | [
"MIT"
] | 1 | 2022-02-07T21:13:55.000Z | 2022-02-07T21:13:55.000Z | bot/orders/models.py | psemdel/py-trading-bot | 69da4164b3f6a3ed3e6dc81d5aefc0273b4cb019 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.db.models import Q
import asyncio
from ib_insync import IB, Stock, MarketOrder, util
from core.common import empty_append
from core.indicators import rel_dif
import vectorbtpro as vbt
import sys
import math
import pandas as pd
import numpy a... | 35.953567 | 270 | 0.576936 | from django.db import models
from django.utils import timezone
from django.db.models import Q
import asyncio
from ib_insync import IB, Stock, MarketOrder, util
from core.common import empty_append
from core.indicators import rel_dif
import vectorbtpro as vbt
import sys
import math
import pandas as pd
import numpy a... | true | true |
f71ca7306894b8080e9f8813e913c2b35a942d36 | 851 | py | Python | src/lib/enums.py | BlackParure/AI-StarCraft-II | 7feee4addff9881b3c735791f4a43421f813fcfc | [
"Apache-2.0"
] | 7 | 2019-01-17T16:46:24.000Z | 2020-09-09T06:35:26.000Z | src/lib/enums.py | BlackParure/AI-StarCraft-II | 7feee4addff9881b3c735791f4a43421f813fcfc | [
"Apache-2.0"
] | null | null | null | src/lib/enums.py | BlackParure/AI-StarCraft-II | 7feee4addff9881b3c735791f4a43421f813fcfc | [
"Apache-2.0"
] | null | null | null | from easydict import EasyDict as edict
# the corresponding semantics to the index of
# obs.observation.feature_minimap and obs.observation.feature_screen
feature_mini_id = edict()
feature_mini_id.HEIGHT_MAP = 0
feature_mini_id.VISIBILITY = 1
feature_mini_id.CREEP = 2
feature_mini_id.CAMERA = 3
feature_mini_id.PLAYER_... | 29.344828 | 68 | 0.836663 | from easydict import EasyDict as edict
feature_mini_id = edict()
feature_mini_id.HEIGHT_MAP = 0
feature_mini_id.VISIBILITY = 1
feature_mini_id.CREEP = 2
feature_mini_id.CAMERA = 3
feature_mini_id.PLAYER_ID = 4
feature_mini_id.PLAYER_RELATIVE = 5
feature_mini_id.PLAYER_SELECTED = 6
feature_screen_id = edict()
featu... | true | true |
f71ca8df5ac6d2ef263acfbbb27f84f925bf74a8 | 455 | py | Python | projects_api/migrations/0032_user.py | sorianos/profile-rest-api | 453b326cf067a07455772c32050a17c31b5dc71a | [
"MIT"
] | null | null | null | projects_api/migrations/0032_user.py | sorianos/profile-rest-api | 453b326cf067a07455772c32050a17c31b5dc71a | [
"MIT"
] | 5 | 2021-03-19T11:56:51.000Z | 2022-02-10T14:08:09.000Z | projects_api/migrations/0032_user.py | sorianos/profile-rest-api | 453b326cf067a07455772c32050a17c31b5dc71a | [
"MIT"
] | 1 | 2020-10-29T17:41:34.000Z | 2020-10-29T17:41:34.000Z | # Generated by Django 2.2 on 2021-01-12 07:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects_api', '0031_auto_20201217_2330'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
... | 22.75 | 114 | 0.589011 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects_api', '0031_auto_20201217_2330'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True... | true | true |
f71ca96e2c4377bd676e8a3d35dfed029ac7363e | 16,669 | py | Python | web2py/applications/ControleEstoque/languages/fr.py | GuizaoBR/Controle-Estoque | b4d7e3c665a14ea77224fa448aaf7e3d4d6fe4ed | [
"Apache-2.0"
] | null | null | null | web2py/applications/ControleEstoque/languages/fr.py | GuizaoBR/Controle-Estoque | b4d7e3c665a14ea77224fa448aaf7e3d4d6fe4ed | [
"Apache-2.0"
] | null | null | null | web2py/applications/ControleEstoque/languages/fr.py | GuizaoBR/Controle-Estoque | b4d7e3c665a14ea77224fa448aaf7e3d4d6fe4ed | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{
'!langcode!': 'fr',
'!langname!': 'Français',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats ... | 52.91746 | 293 | 0.669866 |
{
'!langcode!': 'fr',
'!langname!': 'Français',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOIN',
'%d/%m/%Y'... | true | true |
f71ca9b490a0a319f83ff81055834fce51a392e2 | 701 | py | Python | tests/ext/test_envconfig.py | Zipmatch/zipmatch-content | ead1caca63aaa4acdb092747ed03203670b50e63 | [
"BSD-3-Clause"
] | null | null | null | tests/ext/test_envconfig.py | Zipmatch/zipmatch-content | ead1caca63aaa4acdb092747ed03203670b50e63 | [
"BSD-3-Clause"
] | null | null | null | tests/ext/test_envconfig.py | Zipmatch/zipmatch-content | ead1caca63aaa4acdb092747ed03203670b50e63 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from content.ext.envconfig import EnvConfig
@pytest.mark.parametrize('use_init_app', [True, False])
def test_ext_init(app, mocker, use_init_app):
mock_init_app = mocker.patch.object(EnvConfig, 'init_app')
if use_init_app:
ext = EnvConfig()
ext.init_app(app)
else:
Env... | 25.035714 | 62 | 0.653352 | import pytest
from content.ext.envconfig import EnvConfig
@pytest.mark.parametrize('use_init_app', [True, False])
def test_ext_init(app, mocker, use_init_app):
mock_init_app = mocker.patch.object(EnvConfig, 'init_app')
if use_init_app:
ext = EnvConfig()
ext.init_app(app)
else:
Env... | true | true |
f71ca9df83a8f9e1e8cf5e848d1ced2172679a2a | 8,631 | py | Python | 2019/07_AmplificationCircuit/amp.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | 1 | 2021-01-03T23:09:28.000Z | 2021-01-03T23:09:28.000Z | 2019/07_AmplificationCircuit/amp.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | 6 | 2020-12-26T21:02:42.000Z | 2020-12-26T21:02:52.000Z | 2019/07_AmplificationCircuit/amp.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | null | null | null | # ======================================================================
# Amplification Circuit
# Advent of Code 2019 Day 07 -- Eric Wastl -- https://adventofcode.com
#
# Computer simulation by Dr. Dean Earl Wright III
# ======================================================================
# ===============... | 36.884615 | 94 | 0.446993 |
from __future__ import print_function
from itertools import permutations
import intcode
PHASES = '01234'
FEEDBACK = '56789'
LETTERS = 'ABCDE'
class Amps(object):
def __init__(self, num=5, inp=0, text=None, feedback=False):
self.amps = []
self.n... | true | true |
f71caa1994d573bc106273e8c7f0d7dd6210d086 | 61,405 | py | Python | configure.py | luyangny/Cat-detection | 6bdf989520ca6aba4cde30e48a6ea869db6eeee6 | [
"Apache-2.0"
] | null | null | null | configure.py | luyangny/Cat-detection | 6bdf989520ca6aba4cde30e48a6ea869db6eeee6 | [
"Apache-2.0"
] | null | null | null | configure.py | luyangny/Cat-detection | 6bdf989520ca6aba4cde30e48a6ea869db6eeee6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.442073 | 80 | 0.689651 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import errno
import os
import platform
import re
import subprocess
import sys
try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable a... | true | true |
f71caae6f9c23667ccfce560a4892f8c3a10bf60 | 7,955 | py | Python | utils/dataset_preprocess.py | eliasyin/LCF-ATEPC | 83ae8a729b617ae34f562e5f52b62cb366dcc103 | [
"MIT"
] | 137 | 2019-12-18T15:38:18.000Z | 2022-03-26T15:26:19.000Z | utils/dataset_preprocess.py | eliasyin/LCF-ATEPC | 83ae8a729b617ae34f562e5f52b62cb366dcc103 | [
"MIT"
] | 45 | 2019-12-20T08:24:12.000Z | 2022-03-31T12:43:19.000Z | utils/dataset_preprocess.py | eliasyin/LCF-ATEPC | 83ae8a729b617ae34f562e5f52b62cb366dcc103 | [
"MIT"
] | 34 | 2020-01-03T02:59:18.000Z | 2022-03-30T01:44:09.000Z | import os
import copy
def is_similar(s1, s2):
count = 0.0
for token in s1.split(' '):
if token in s2:
count += 1
# if count / len(s1.split(' ')) >= 0.7 and abs(len(s1.split(' '))-len(s2.split(' '))<5):
if count / len(s1.split(' ')) >= 0.7 and count / len(s2.split(' ')) >= 0.7:
... | 36.828704 | 136 | 0.595726 | import os
import copy
def is_similar(s1, s2):
count = 0.0
for token in s1.split(' '):
if token in s2:
count += 1
if count / len(s1.split(' ')) >= 0.7 and count / len(s2.split(' ')) >= 0.7:
return True
else:
return False
def assemble_aspects(fname):
fin = o... | true | true |
f71cab1867cc22a6cea57f7a9832a1702c206111 | 2,746 | py | Python | makbe/expanders/tca9555.py | kazhida/makbe-py | b2840251118959a826fe8d3e2e84c2000dba3081 | [
"MIT"
] | null | null | null | makbe/expanders/tca9555.py | kazhida/makbe-py | b2840251118959a826fe8d3e2e84c2000dba3081 | [
"MIT"
] | 1 | 2021-11-29T08:23:50.000Z | 2021-11-29T08:23:50.000Z | makbe/expanders/tca9555.py | kazhida/makbe-py | b2840251118959a826fe8d3e2e84c2000dba3081 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2021 Kazuyuki HIDA
#
# 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... | 34.759494 | 80 | 0.643117 |
from .. key_switch import nop_switch
from .. import IoExpander, KeySwitch
class TCA9555(IoExpander):
def __init__(self, dev_address: int):
self.dev_address = dev_address + 0x20
self.switches = []
for i in range(16):
self.switches.append(nop_switch())
... | true | true |
f71cab3e710d8cc552a1054d037bb361fdbacb7d | 2,386 | py | Python | old/test_reverse_linked_list.py | kurtrm/data_structures_rev | 58f425a877898a45595de9c57c7eb8e087a0c3a2 | [
"MIT"
] | null | null | null | old/test_reverse_linked_list.py | kurtrm/data_structures_rev | 58f425a877898a45595de9c57c7eb8e087a0c3a2 | [
"MIT"
] | null | null | null | old/test_reverse_linked_list.py | kurtrm/data_structures_rev | 58f425a877898a45595de9c57c7eb8e087a0c3a2 | [
"MIT"
] | null | null | null | """Test of the reversed linked list."""
import pytest
@pytest.fixture
def linked_list():
"""Make linked_list for testing."""
from linked_list import LinkedList
linked_list = LinkedList([1, 2, 3])
return linked_list
def test_empty_linked_list(linked_list):
"""Test exception from empty linked_lis... | 34.57971 | 85 | 0.754401 |
import pytest
@pytest.fixture
def linked_list():
from linked_list import LinkedList
linked_list = LinkedList([1, 2, 3])
return linked_list
def test_empty_linked_list(linked_list):
from reverse_linked_list import reverse_linked_list
linked_list.pop()
linked_list.pop()
linked_list.pop()
... | true | true |
f71cabbacd1f7c032bc3b010d748f5f29a9c6426 | 442 | py | Python | form.py | GreciaFlores1996/CursoPython | b81edad009ea36786d28ca5781c63df0f5376ac5 | [
"MIT"
] | null | null | null | form.py | GreciaFlores1996/CursoPython | b81edad009ea36786d28ca5781c63df0f5376ac5 | [
"MIT"
] | 1 | 2019-08-20T22:20:45.000Z | 2019-08-20T22:21:38.000Z | form.py | GreciaFlores1996/CursoPython | b81edad009ea36786d28ca5781c63df0f5376ac5 | [
"MIT"
] | null | null | null | from wtforms import Form
from wtforms import StringField
from wtforms import IntegerField
from wtforms.validators import DataRequired
class EmailForm(Form):
name = StringField('name', validators=[DataRequired()])
email = StringField('email', validators=[DataRequired()])
class LoginForm(Form):
username =... | 29.466667 | 67 | 0.757919 | from wtforms import Form
from wtforms import StringField
from wtforms import IntegerField
from wtforms.validators import DataRequired
class EmailForm(Form):
name = StringField('name', validators=[DataRequired()])
email = StringField('email', validators=[DataRequired()])
class LoginForm(Form):
username =... | true | true |
f71cabef85002e6d78fa7bf1e3356fe2e5b10593 | 2,601 | py | Python | src/DSGRN/Query/Database.py | yingxinac/DSGRN | b5bc64e5a99e6d266f6ac5ba7ac9d04954f12d32 | [
"MIT"
] | 9 | 2017-10-15T20:49:36.000Z | 2022-02-24T19:26:39.000Z | src/DSGRN/Query/Database.py | yingxinac/DSGRN | b5bc64e5a99e6d266f6ac5ba7ac9d04954f12d32 | [
"MIT"
] | 19 | 2015-07-02T15:59:06.000Z | 2020-06-09T18:13:05.000Z | src/DSGRN/Query/Database.py | yingxinac/DSGRN | b5bc64e5a99e6d266f6ac5ba7ac9d04954f12d32 | [
"MIT"
] | 21 | 2015-11-06T16:28:34.000Z | 2019-09-20T09:26:54.000Z | import sqlite3
import graphviz
from DSGRN._dsgrn import *
from functools import reduce
from DSGRN.Query.Logging import LogToSTDOUT
class Database:
def __init__(self, database_name):
"""
Initialize a DSGRN database object
"""
self.dbname = database_name
self.conn = sqlite3.connect(database_name)
... | 38.820896 | 153 | 0.708958 | import sqlite3
import graphviz
from DSGRN._dsgrn import *
from functools import reduce
from DSGRN.Query.Logging import LogToSTDOUT
class Database:
def __init__(self, database_name):
self.dbname = database_name
self.conn = sqlite3.connect(database_name)
self.cursor = self.conn.cursor()
sqlexpres... | true | true |
f71cacb71c497b993580e8b6ab79d5b35f0c8185 | 7,853 | py | Python | lit_nlp/examples/sst_pytorch_demo.py | johnson7788/lit | 3eb824b01e0f72a5486124b16056bf912465debc | [
"Apache-2.0"
] | 1 | 2021-04-12T22:57:04.000Z | 2021-04-12T22:57:04.000Z | lit_nlp/examples/sst_pytorch_demo.py | johnson7788/lit | 3eb824b01e0f72a5486124b16056bf912465debc | [
"Apache-2.0"
] | 4 | 2022-02-14T19:37:07.000Z | 2022-02-27T20:24:08.000Z | lit_nlp/examples/sst_pytorch_demo.py | haaami01/lit | 3eb824b01e0f72a5486124b16056bf912465debc | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
r"""Code example for a custom model, using PyTorch.
This demo shows how to use a custom model with LIT, in just a few lines of code.
We'll use a transformers model, with a minimal amount of code to implement the
LIT API. Compared to models/glue_models.py, this has fewer features, but the
code is mor... | 37.395238 | 86 | 0.706736 |
import re
from absl import app
from absl import flags
from absl import logging
from lit_nlp import dev_server
from lit_nlp import server_flags
from lit_nlp.api import model as lit_model
from lit_nlp.api import types as lit_types
from lit_nlp.examples.datasets import glue
from lit_nlp.lib import utils
import torch
imp... | true | true |
f71cae616991607462e2bfde3a5cc705076fafbc | 6,982 | py | Python | geektime_ebook_maker/spider/mini_spider.py | fakeYanss/geektime_ebook_maker | b536f3bdaf84f8180aac1d2601be8058e0e91115 | [
"MIT"
] | 33 | 2018-08-13T02:52:15.000Z | 2018-10-16T03:38:11.000Z | geektime_ebook_maker/spider/mini_spider.py | fakeYanss/geektime_ebook_maker | b536f3bdaf84f8180aac1d2601be8058e0e91115 | [
"MIT"
] | null | null | null | geektime_ebook_maker/spider/mini_spider.py | fakeYanss/geektime_ebook_maker | b536f3bdaf84f8180aac1d2601be8058e0e91115 | [
"MIT"
] | 4 | 2018-08-13T05:26:11.000Z | 2018-09-06T09:59:52.000Z | # coding=utf8
import os
from threading import Thread
try:
from queue import Queue, Empty as QueueEmpty
except ImportError:
from Queue import Queue, Empty as QueueEmpty
import requests
import logging
import traceback
error_logger = logging.getLogger('error')
error_logger.setLevel(logging.ERROR)
ERROR_STATU... | 32.474419 | 136 | 0.596534 |
import os
from threading import Thread
try:
from queue import Queue, Empty as QueueEmpty
except ImportError:
from Queue import Queue, Empty as QueueEmpty
import requests
import logging
import traceback
error_logger = logging.getLogger('error')
error_logger.setLevel(logging.ERROR)
ERROR_STATUS = -1
def ... | true | true |
f71caea71cfc518c2ef4111293c2ff14384cf596 | 1,255 | py | Python | src/sentry/api/endpoints/project_environments.py | apragacz/sf-sentry | 2fdd6c1195c29a1d401d1cd538c22ea68556699a | [
"BSD-3-Clause"
] | 1 | 2018-03-05T15:40:12.000Z | 2018-03-05T15:40:12.000Z | src/sentry/api/endpoints/project_environments.py | pitchin/sentry | ff6f260e9edb726374d2e4f455ff8b3d0ecd551e | [
"BSD-3-Clause"
] | 1 | 2018-08-22T16:49:48.000Z | 2018-08-22T16:49:48.000Z | src/sentry/api/endpoints/project_environments.py | pitchin/sentry | ff6f260e9edb726374d2e4f455ff8b3d0ecd551e | [
"BSD-3-Clause"
] | 1 | 2018-07-02T09:46:44.000Z | 2018-07-02T09:46:44.000Z | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.serializers import serialize
from sentry.models import EnvironmentProject
environment_visibility_filter_options = {
'all': lambda queryset: queryset,
'hidd... | 35.857143 | 92 | 0.713147 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.serializers import serialize
from sentry.models import EnvironmentProject
environment_visibility_filter_options = {
'all': lambda queryset: queryset,
'hidd... | true | true |
f71caf4a0f239065a54f05daee5fc3a53ea19433 | 696 | py | Python | tarefas-poo/lista-03/tribo/view/paineis/painel_cria_tribo.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/tribo/view/paineis/painel_cria_tribo.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/tribo/view/paineis/painel_cria_tribo.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5663
# Exercício da Tribo
# --------------------------
# Classe responsável por criar uma tribo
#
from model.tribo import Tribo
from view.paineis.painel_abstrato import PainelAbstrato
class PainelCriaTribo(PainelAbstrato):
def __init__(self, iu):
super... | 30.26087 | 80 | 0.627874 |
from model.tribo import Tribo
from view.paineis.painel_abstrato import PainelAbstrato
class PainelCriaTribo(PainelAbstrato):
def __init__(self, iu):
super().__init__('Criar Tribo', iu)
def _interaja(self):
nome = input('Nome da tribo: ')
qtd_guerreiros = int(input('Quantidade m... | true | true |
f71cb0c1773a3937199f2475478d123c6d026639 | 3,726 | py | Python | src/lupuxt2py/constants.py | ChrisKeck/lupuxt2py | 73dc0c636c81fc7007044d9e6c2d34a1794ebae3 | [
"MIT"
] | null | null | null | src/lupuxt2py/constants.py | ChrisKeck/lupuxt2py | 73dc0c636c81fc7007044d9e6c2d34a1794ebae3 | [
"MIT"
] | null | null | null | src/lupuxt2py/constants.py | ChrisKeck/lupuxt2py | 73dc0c636c81fc7007044d9e6c2d34a1794ebae3 | [
"MIT"
] | null | null | null | # Used in setup.py
# -*- coding: utf-8 -*-
VERSION = "0.1.1"
PROJECT_PACKAGE_NAME = "lupupy"
PROJECT_LICENSE = "MIT"
PROJECT_URL = "http://www.github.com/majuss/lupupy"
PROJECT_DESCRIPTION = "A python cli for Lupusec alarm panels."
PROJECT_LONG_DESCRIPTION = (
"lupupy is a python3 interface for"
" the Lupus Ele... | 32.4 | 83 | 0.766774 |
VERSION = "0.1.1"
PROJECT_PACKAGE_NAME = "lupupy"
PROJECT_LICENSE = "MIT"
PROJECT_URL = "http://www.github.com/majuss/lupupy"
PROJECT_DESCRIPTION = "A python cli for Lupusec alarm panels."
PROJECT_LONG_DESCRIPTION = (
"lupupy is a python3 interface for"
" the Lupus Electronics alarm panel."
" Its intented... | true | true |
f71cb55ac21dc79bb494db37b62d30dc5c9b3af6 | 597 | py | Python | multilstm_tensorpack/tensorpack/utils/globvars.py | neale/A4C | acbbb3cf14e31a19c12f27306971b4db4feafe09 | [
"MIT"
] | 1 | 2017-03-11T23:10:00.000Z | 2017-03-11T23:10:00.000Z | multilstm_tensorpack/tensorpack/utils/globvars.py | neale/A4C | acbbb3cf14e31a19c12f27306971b4db4feafe09 | [
"MIT"
] | null | null | null | multilstm_tensorpack/tensorpack/utils/globvars.py | neale/A4C | acbbb3cf14e31a19c12f27306971b4db4feafe09 | [
"MIT"
] | 1 | 2021-04-30T15:34:24.000Z | 2021-04-30T15:34:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: globvars.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import six
import argparse
__all__ = ['globalns', 'use_global_argument']
if six.PY2:
class NS:
pass
else:
import types
NS = types.SimpleNamespace
globalns = NS()
def use_global_argument(a... | 19.258065 | 63 | 0.649916 |
import six
import argparse
__all__ = ['globalns', 'use_global_argument']
if six.PY2:
class NS:
pass
else:
import types
NS = types.SimpleNamespace
globalns = NS()
def use_global_argument(args):
assert isinstance(args, argparse.Namespace), type(args)
for k, v in six.iteritems(vars(ar... | true | true |
f71cb812c630d4ea90200d9a5c076f1b4590a71e | 1,220 | py | Python | iotbx/command_line/sort_atoms.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-18T12:31:57.000Z | 2022-03-14T06:27:06.000Z | iotbx/command_line/sort_atoms.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | null | null | null | iotbx/command_line/sort_atoms.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | # LIBTBX_SET_DISPATCHER_NAME iotbx.pdb.sort_atoms
from __future__ import absolute_import, division, print_function
from libtbx.utils import Usage
import sys
import iotbx.pdb
import mmtbx.model
master_phil_str = """
file_name = None
.type = path
.multiple = False
.optional = False
.style = hidden
"""
def show... | 22.181818 | 73 | 0.685246 |
from __future__ import absolute_import, division, print_function
from libtbx.utils import Usage
import sys
import iotbx.pdb
import mmtbx.model
master_phil_str = """
file_name = None
.type = path
.multiple = False
.optional = False
.style = hidden
"""
def show_usage():
help_msg = """\
iotbx.pdb.sort_atoms ... | true | true |
f71cb926199d235645c93f0a046fc2b7260452e8 | 1,138 | py | Python | machine-learning-pipeline/airflow/dags/train_simple_model.py | dataength/automating-your-data-pipeline-with-apache-airflow | 19b7fe4a41874708c5927b7c32f9840f4285090c | [
"MIT"
] | 30 | 2020-07-09T17:37:47.000Z | 2022-01-19T04:17:02.000Z | machine-learning-pipeline/airflow/dags/train_simple_model.py | mizzony/automating-your-data-pipeline-with-apache-airflow | 90a1351de6de78c0f0a6fb2e778e2ba3b7c78f5e | [
"MIT"
] | 38 | 2021-08-12T08:01:47.000Z | 2022-03-29T22:29:27.000Z | machine-learning-pipeline/airflow/dags/train_simple_model.py | mizzony/automating-your-data-pipeline-with-apache-airflow | 90a1351de6de78c0f0a6fb2e778e2ba3b7c78f5e | [
"MIT"
] | 22 | 2020-07-10T02:41:39.000Z | 2022-03-23T22:08:52.000Z | import pickle
from airflow import DAG
from airflow.hooks.postgres_hook import PostgresHook
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.utils import timezone
from sklearn.ensemble import RandomForestClassifier
default_args = {
... | 22.76 | 65 | 0.692443 | import pickle
from airflow import DAG
from airflow.hooks.postgres_hook import PostgresHook
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.utils import timezone
from sklearn.ensemble import RandomForestClassifier
default_args = {
... | true | true |
f71cba9b88574b1dfb171079ea67df5863e28a5e | 1,843 | py | Python | nighteen_cpc.py | toddlerya/AnalyzeNPC | 5d16f994ec34300a3050463aad08ad3a1ec1eaba | [
"MIT"
] | 4 | 2018-09-15T02:43:04.000Z | 2022-02-11T01:56:49.000Z | nighteen_cpc.py | toddlerya/AnalyzeNPC | 5d16f994ec34300a3050463aad08ad3a1ec1eaba | [
"MIT"
] | null | null | null | nighteen_cpc.py | toddlerya/AnalyzeNPC | 5d16f994ec34300a3050463aad08ad3a1ec1eaba | [
"MIT"
] | 5 | 2018-03-12T10:01:48.000Z | 2021-11-05T05:34:48.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: toddler
import jieba
import re
import os
from collections import Counter
from wordcloud import WordCloud
import matplotlib.pyplot as plt
def cut_analyze(input_file):
"""
:param input_file: 输入带切词分析的文本路径
:return: (list1, list2) list1切词处理后的列表结果, list2输出... | 29.725806 | 96 | 0.688009 |
import jieba
import re
import os
from collections import Counter
from wordcloud import WordCloud
import matplotlib.pyplot as plt
def cut_analyze(input_file):
cpc_dict_path = u'user_dict/cpc_dictionary.txt'
stop_words_path = u'user_dict/stopword.txt'
with open(input_file) as f:
content = f.rea... | true | true |
f71cbafafa7b775082fc935301d70d2a60767f9b | 6,977 | py | Python | models/render.py | RichTeaMan/duck-game | b47db72e30767411251a43000a9afad7ee11f822 | [
"MIT"
] | null | null | null | models/render.py | RichTeaMan/duck-game | b47db72e30767411251a43000a9afad7ee11f822 | [
"MIT"
] | null | null | null | models/render.py | RichTeaMan/duck-game | b47db72e30767411251a43000a9afad7ee11f822 | [
"MIT"
] | null | null | null | import sys
import math
import pathlib
import bpy
import mathutils
from PIL import Image
modelDir = pathlib.Path(__file__).parent.absolute()
scn = bpy.context.scene
images_created = 0
def update_camera(camera, focus_point=mathutils.Vector((0.0, 0.0, 0.0)), distance=10.0):
"""
Focus the camera to a focus point... | 39.642045 | 118 | 0.694138 | import sys
import math
import pathlib
import bpy
import mathutils
from PIL import Image
modelDir = pathlib.Path(__file__).parent.absolute()
scn = bpy.context.scene
images_created = 0
def update_camera(camera, focus_point=mathutils.Vector((0.0, 0.0, 0.0)), distance=10.0):
looking_direction = camera.location - foc... | true | true |
f71cbc5a7db50b299b464568fe69775d801e45e9 | 1,650 | py | Python | concept_formation/tests/benchmark_cobweb.py | ThomasHoppe/concept_formation | 2468fea78ba46804bf44228519eb33ebc5780d31 | [
"MIT"
] | 47 | 2015-06-08T20:34:18.000Z | 2021-09-26T17:59:06.000Z | concept_formation/tests/benchmark_cobweb.py | ThomasHoppe/concept_formation | 2468fea78ba46804bf44228519eb33ebc5780d31 | [
"MIT"
] | 65 | 2015-07-27T18:16:31.000Z | 2021-10-04T14:02:51.000Z | concept_formation/tests/benchmark_cobweb.py | ThomasHoppe/concept_formation | 2468fea78ba46804bf44228519eb33ebc5780d31 | [
"MIT"
] | 13 | 2015-07-27T13:27:03.000Z | 2022-03-15T02:18:10.000Z | from random import randint
from timeit import timeit
from matplotlib import pyplot as plt
import matplotlib.patches as mpatches
def generate_dataset(n_inst, n_attr, n_val):
instances = []
for i in range(n_inst):
i = {}
for j in range(n_attr):
i[str(j)] = randint(1, n_val)
... | 31.132075 | 78 | 0.569697 | from random import randint
from timeit import timeit
from matplotlib import pyplot as plt
import matplotlib.patches as mpatches
def generate_dataset(n_inst, n_attr, n_val):
instances = []
for i in range(n_inst):
i = {}
for j in range(n_attr):
i[str(j)] = randint(1, n_val)
... | true | true |
f71cbc803e6c23ac267127d39b3cacff5df2afb2 | 1,759 | py | Python | ddtrace/contrib/starlette/patch.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | ddtrace/contrib/starlette/patch.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | ddtrace/contrib/starlette/patch.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | import starlette
from starlette.middleware import Middleware
from starlette.routing import Match
from ddtrace import config
from ddtrace.contrib.asgi.middleware import TraceMiddleware
from ddtrace.internal.logger import get_logger
from ddtrace.internal.utils.wrappers import unwrap as _u
from ddtrace.vendor.wrapt impor... | 25.867647 | 111 | 0.69585 | import starlette
from starlette.middleware import Middleware
from starlette.routing import Match
from ddtrace import config
from ddtrace.contrib.asgi.middleware import TraceMiddleware
from ddtrace.internal.logger import get_logger
from ddtrace.internal.utils.wrappers import unwrap as _u
from ddtrace.vendor.wrapt impor... | true | true |
f71cbe052a1401c87b58ad7ee12061265e925398 | 3,707 | py | Python | locations/spiders/mcdonalds_hu.py | thismakessand/alltheplaces | b6116199844c9e88bff3a691290f07a7457470ba | [
"MIT"
] | 1 | 2019-08-19T10:00:55.000Z | 2019-08-19T10:00:55.000Z | locations/spiders/mcdonalds_hu.py | thismakessand/alltheplaces | b6116199844c9e88bff3a691290f07a7457470ba | [
"MIT"
] | null | null | null | locations/spiders/mcdonalds_hu.py | thismakessand/alltheplaces | b6116199844c9e88bff3a691290f07a7457470ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import json
import re
from locations.items import GeojsonPointItem
class McDonaldsHUSpider(scrapy.Spider):
name = "mcdonalds_hu"
allowed_domains = ["www.mcdonalds.hu"]
start_urls = (
'https://www.mcdonalds.hu/ettermeink',
)
def store_hours(self, data... | 34.324074 | 147 | 0.514702 |
import scrapy
import json
import re
from locations.items import GeojsonPointItem
class McDonaldsHUSpider(scrapy.Spider):
name = "mcdonalds_hu"
allowed_domains = ["www.mcdonalds.hu"]
start_urls = (
'https://www.mcdonalds.hu/ettermeink',
)
def store_hours(self, data):
day_groups =... | true | true |
f71cbe39c1107e8c3db2f02071238dd85d13bb46 | 8,346 | py | Python | src/ml_rasa/scripts/preprocessors/check_english.py | GrigalashviliT/spoilerBlocker | 18a5e9689099d3b631a15ed20cc84a043f324055 | [
"MIT"
] | 5 | 2020-05-20T16:59:04.000Z | 2021-08-22T18:30:47.000Z | src/ml_rasa/scripts/preprocessors/check_english.py | GrigalashviliT/spoilerBlocker | 18a5e9689099d3b631a15ed20cc84a043f324055 | [
"MIT"
] | 10 | 2020-05-20T16:07:04.000Z | 2020-07-22T19:21:16.000Z | src/ml_rasa/scripts/preprocessors/check_english.py | GrigalashviliT/spoilerBlocker | 18a5e9689099d3b631a15ed20cc84a043f324055 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
from re import sub
from typing import Any, List, Text
from functools import reduce
from rasa.nlu.components import Component
from rasa.nlu.config impo... | 107 | 6,589 | 0.619458 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
from re import sub
from typing import Any, List, Text
from functools import reduce
from rasa.nlu.components import Component
from rasa.nlu.config impo... | true | true |
f71cbe9a6893b097ff92eef32e8a4f740fdc19a0 | 13,481 | py | Python | wheat/util/streamable.py | grayfallstown/wheat-blockchain | f391cdd30a0cbcdb2adf4439a25581fd28b42c1f | [
"Apache-2.0"
] | null | null | null | wheat/util/streamable.py | grayfallstown/wheat-blockchain | f391cdd30a0cbcdb2adf4439a25581fd28b42c1f | [
"Apache-2.0"
] | null | null | null | wheat/util/streamable.py | grayfallstown/wheat-blockchain | f391cdd30a0cbcdb2adf4439a25581fd28b42c1f | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# pylint: disable
from __future__ import annotations
import dataclasses
import io
import pprint
import sys
from enum import Enum
from typing import Any, BinaryIO, Dict, List, Tuple, Type, Callable, Optional, Iterator
from blspy import G1Element, G2Element, PrivateKey
from wheat.types.blockchain_format... | 37.551532 | 111 | 0.649952 |
from __future__ import annotations
import dataclasses
import io
import pprint
import sys
from enum import Enum
from typing import Any, BinaryIO, Dict, List, Tuple, Type, Callable, Optional, Iterator
from blspy import G1Element, G2Element, PrivateKey
from wheat.types.blockchain_format.program import Program, Serial... | true | true |
f71cbf4460d98bc10c011e9a945b70eb738776be | 853 | py | Python | setup.py | rwindsor1/DICOMcat | 1f6549882cce93f270ad24d4c4c4140d51536789 | [
"MIT"
] | 1 | 2021-08-09T15:50:53.000Z | 2021-08-09T15:50:53.000Z | setup.py | rwindsor1/DICOMcat | 1f6549882cce93f270ad24d4c4c4140d51536789 | [
"MIT"
] | null | null | null | setup.py | rwindsor1/DICOMcat | 1f6549882cce93f270ad24d4c4c4140d51536789 | [
"MIT"
] | null | null | null | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name= 'dicomcat',
version= '0.1',
description='A simple python-based tool based on imgcat f... | 34.12 | 101 | 0.681125 | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name= 'dicomcat',
version= '0.1',
description='A simple python-based tool based on imgcat f... | true | true |
f71cbfad5d23526173717cefa4699e471cc4b889 | 522 | py | Python | 16 Exception Handling/finallydemo.py | Himanshu44626748/Learn-Python | f3a4d997f2d29b146e5f7434f4801ae94bc3483f | [
"MIT"
] | 2 | 2020-03-16T14:57:44.000Z | 2020-11-29T07:45:54.000Z | 16 Exception Handling/finallydemo.py | Himanshu44626748/Learn-Python | f3a4d997f2d29b146e5f7434f4801ae94bc3483f | [
"MIT"
] | null | null | null | 16 Exception Handling/finallydemo.py | Himanshu44626748/Learn-Python | f3a4d997f2d29b146e5f7434f4801ae94bc3483f | [
"MIT"
] | 1 | 2020-08-13T07:59:02.000Z | 2020-08-13T07:59:02.000Z | try:
f = open("myfile","w")
a,b = [int(x) for x in input("Enter two numbers:").split()]
c = a/b
f.write("Writing %d into file" %c)
except ZeroDivisionError:
print("Division by zero is not allowed")
print("Please enter a non zero number")
finally:
f.close() # Writi... | 37.285714 | 189 | 0.632184 | try:
f = open("myfile","w")
a,b = [int(x) for x in input("Enter two numbers:").split()]
c = a/b
f.write("Writing %d into file" %c)
except ZeroDivisionError:
print("Division by zero is not allowed")
print("Please enter a non zero number")
finally:
f.close()
pr... | true | true |
f71cbfefe5963b92d2e1699d24dfdedb87ab4f03 | 1,191 | py | Python | benchmarks/python/microbench.py | cyntsh/dex-lang | 88a647c4b7347cc4124d9b03b90b4348c8125698 | [
"BSD-Source-Code"
] | 1,223 | 2019-10-25T12:35:46.000Z | 2022-03-30T02:08:54.000Z | benchmarks/python/microbench.py | cyntsh/dex-lang | 88a647c4b7347cc4124d9b03b90b4348c8125698 | [
"BSD-Source-Code"
] | 425 | 2019-10-27T21:12:15.000Z | 2022-03-31T17:47:57.000Z | benchmarks/python/microbench.py | cyntsh/dex-lang | 88a647c4b7347cc4124d9b03b90b4348c8125698 | [
"BSD-Source-Code"
] | 87 | 2019-10-26T17:41:23.000Z | 2022-02-05T23:32:04.000Z | # Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
import json
from functools import partial
import time
import jax.numpy as np
import jax.random as random
from jax import jit... | 24.8125 | 63 | 0.699412 |
import json
from functools import partial
import time
import jax.numpy as np
import jax.random as random
from jax import jit
from jax.config import config
config.enable_omnistaging()
np.dot(1.0, 1.0)
def benchit(bench_name, x, f):
f_jitted = jit(f)
t0 = time.time()
f_jitted(x).block_until_ready()
t1 ... | true | true |
f71cc027fdd19119fb0399b5df5021a92a9837ac | 2,248 | py | Python | e3d/plugin_management/PluginHandlers.py | jr-garcia/Engendro3D | 93a6a6c26be2b9a8c1520e9d83516c39532ab1ed | [
"MIT"
] | 8 | 2017-04-19T03:59:43.000Z | 2020-04-29T00:29:12.000Z | e3d/plugin_management/PluginHandlers.py | jr-garcia/Engendro3D | 93a6a6c26be2b9a8c1520e9d83516c39532ab1ed | [
"MIT"
] | null | null | null | e3d/plugin_management/PluginHandlers.py | jr-garcia/Engendro3D | 93a6a6c26be2b9a8c1520e9d83516c39532ab1ed | [
"MIT"
] | 3 | 2018-04-26T16:57:46.000Z | 2021-03-01T05:48:06.000Z | from os import path
from shutil import make_archive
import os
from json import load, dump
PLUGINEXTENSION = '.epf'
DESCRIPTIONNAME = 'description'
def packPluginFromFolder(folderPath):
folderPath = path.abspath(folderPath)
if not path.exists(folderPath):
raise FileNotFoundError('the folder does not ... | 32.57971 | 105 | 0.666815 | from os import path
from shutil import make_archive
import os
from json import load, dump
PLUGINEXTENSION = '.epf'
DESCRIPTIONNAME = 'description'
def packPluginFromFolder(folderPath):
folderPath = path.abspath(folderPath)
if not path.exists(folderPath):
raise FileNotFoundError('the folder does not ... | true | true |
f71cc05cd87321ac0280e9c1dac9a793ff504e60 | 6,120 | py | Python | tests/test_enums.py | eerimoq/sython | 90937bf44b798b9c1ae0d18e31e11e95967b46c6 | [
"MIT"
] | null | null | null | tests/test_enums.py | eerimoq/sython | 90937bf44b798b9c1ae0d18e31e11e95967b46c6 | [
"MIT"
] | null | null | null | tests/test_enums.py | eerimoq/sython | 90937bf44b798b9c1ae0d18e31e11e95967b46c6 | [
"MIT"
] | null | null | null | from .utils import TestCase
from .utils import build_and_test_module
class Test(TestCase):
def test_enums(self):
build_and_test_module('enums')
def test_invalid_string_enum_member_value(self):
self.assert_transpile_raises(
'@enum\n'
'class Foo:\n'
' A =... | 31.546392 | 79 | 0.427288 | from .utils import TestCase
from .utils import build_and_test_module
class Test(TestCase):
def test_enums(self):
build_and_test_module('enums')
def test_invalid_string_enum_member_value(self):
self.assert_transpile_raises(
'@enum\n'
'class Foo:\n'
' A =... | true | true |
f71cc0cae73f084599395e8d8ba1c44ef7ba93fe | 1,764 | py | Python | LogFileSetup.py | skw32/DefectCorrectionsNotebook | 7342bc6cafa4c19c774d48c4f68b02db7d2e2eb1 | [
"BSD-3-Clause"
] | 4 | 2019-03-05T01:04:30.000Z | 2020-05-19T13:07:20.000Z | LogFileSetup.py | lxf-gzu/DefectCorrectionsNotebook | fef2ede0afb27e35d8e69c1d8aa759df284dc149 | [
"BSD-3-Clause"
] | 1 | 2019-06-01T18:07:53.000Z | 2019-06-01T18:07:53.000Z | LogFileSetup.py | lxf-gzu/DefectCorrectionsNotebook | fef2ede0afb27e35d8e69c1d8aa759df284dc149 | [
"BSD-3-Clause"
] | 6 | 2019-03-26T18:38:23.000Z | 2020-05-21T07:07:33.000Z | import logging
def configure_logging(logfile_path):
''' Initialize logging defaults for in-notebook messages and
'log.info' file written to store intermediate results during analysis of each defect
To use, the following lines must be added to the code:
import LogFileSetup as lfs
logg... | 46.421053 | 132 | 0.740363 | import logging
def configure_logging(logfile_path):
notebook_formatter = logging.Formatter("[%(levelname)s] [Cell line num: %(lineno)s] %(message)s")
defect_logger = logging.getLogger()
info_file_handler = logging.FileHandler(logfile_path + ".info", mode='w')
info_file_handler.s... | true | true |
f71cc1efb366d21efb50b72a9d38ce6d8c3b520d | 1,439 | py | Python | workers/clustering_worker/setup.py | hsh3n3/augur | bb65774a0884fd82ec7799f33ac87997268d5a5f | [
"MIT"
] | 1 | 2020-12-21T23:39:27.000Z | 2020-12-21T23:39:27.000Z | workers/clustering_worker/setup.py | hsh3n3/augur | bb65774a0884fd82ec7799f33ac87997268d5a5f | [
"MIT"
] | 2 | 2021-12-10T01:45:26.000Z | 2021-12-10T01:58:04.000Z | workers/clustering_worker/setup.py | hsh3n3/augur | bb65774a0884fd82ec7799f33ac87997268d5a5f | [
"MIT"
] | 1 | 2019-05-20T15:30:40.000Z | 2019-05-20T15:30:40.000Z | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(text_type(r':[a-z]+:`~?(.*?... | 28.78 | 94 | 0.579569 | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(text_type(r':[a-z]+:`~?(.*?... | true | true |
f71cc343a74ac1d719f7021173dac1e468df922f | 2,529 | py | Python | src/main/python/baselines/dsl/search/indexer.py | sgottsch/Tab2KG | 5c749ae6056a8c9b6a23674a7bf9d8a3cc7b8530 | [
"MIT"
] | null | null | null | src/main/python/baselines/dsl/search/indexer.py | sgottsch/Tab2KG | 5c749ae6056a8c9b6a23674a7bf9d8a3cc7b8530 | [
"MIT"
] | null | null | null | src/main/python/baselines/dsl/search/indexer.py | sgottsch/Tab2KG | 5c749ae6056a8c9b6a23674a7bf9d8a3cc7b8530 | [
"MIT"
] | null | null | null | # This is an edited version of https://github.com/minhptx/iswc-2016-semantic-labeling, which was edited to use it as a baseline for Tab2KG (https://github.com/sgottsch/Tab2KG).
import logging
from elasticsearch.exceptions import RequestError
from elasticsearch.helpers import scan, bulk
from lib.utils import get_index... | 35.125 | 176 | 0.572558 |
import logging
from elasticsearch.exceptions import RequestError
from elasticsearch.helpers import scan, bulk
from lib.utils import get_index_name
__author__ = "minh"
class Indexer:
def __init__(self, es):
self.es = es
def init_analyzers(self, index_config):
print("init_analyzers")
... | true | true |
f71cc45987d40f97d2107f51052d959e0ffc1f6c | 10,055 | py | Python | crawler/crawler.py | thelumberjhack/corpusgen | 8ff1045e5b884991903697e2567a2ba67f37060f | [
"MIT"
] | 2 | 2021-01-01T12:20:39.000Z | 2021-05-10T23:33:27.000Z | crawler/crawler.py | thelumberjhack/corpusgen | 8ff1045e5b884991903697e2567a2ba67f37060f | [
"MIT"
] | null | null | null | crawler/crawler.py | thelumberjhack/corpusgen | 8ff1045e5b884991903697e2567a2ba67f37060f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This code greatly inspires itself from http://aosabook.org/en/500L/a-web-crawler-with-asyncio-coroutines.html
import cgi
from collections import namedtuple
import os
import re
import logging
import urllib
import asyncio
import aiohttp
from asyncio import Queue
import time
LOGGER = logging.get... | 30.014925 | 114 | 0.529687 |
import cgi
from collections import namedtuple
import os
import re
import logging
import urllib
import asyncio
import aiohttp
from asyncio import Queue
import time
LOGGER = logging.getLogger(__name__)
FetchStatistic = namedtuple(
'FetchStatistic', [
'url',
'next_url',
'status',
'... | true | true |
f71cc717d2a50c2a2eac3e063f01eef3d43d7dc5 | 1,914 | py | Python | code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/hourly_usage_attribution_response.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/hourly_usage_attribution_response.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/hourly_usage_attribution_response.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import (
ModelNormal,
cached_property,
... | 29.90625 | 108 | 0.698537 |
from datadog_api_client.v1.model_utils import (
ModelNormal,
cached_property,
)
def lazy_import():
from datadog_api_client.v1.model.hourly_usage_attribution_body import HourlyUsageAttributionBody
from datadog_api_client.v1.model.hourly_usage_attribution_metadata import HourlyUsageAttributionMetad... | true | true |
f71cc725c05458f3a9369d780bd91d3992785579 | 5,283 | py | Python | ecommerce/admin.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 32 | 2016-03-25T01:03:13.000Z | 2022-01-15T19:35:42.000Z | ecommerce/admin.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 4,858 | 2016-03-03T13:48:30.000Z | 2022-03-29T22:09:51.000Z | ecommerce/admin.py | umarmughal824/micromasters | ea92d3bcea9be4601150fc497302ddacc1161622 | [
"BSD-3-Clause"
] | 20 | 2016-08-18T22:07:44.000Z | 2021-11-15T13:35:35.000Z | """
Admin views for ecommerce models
"""
from django.contrib import admin
from ecommerce.models import (
Coupon,
CouponAudit,
CouponInvoice,
CouponInvoiceAudit,
Line,
Order,
OrderAudit,
Receipt,
RedeemedCoupon,
RedeemedCouponAudit,
UserCoupon,
UserCouponAudit,
)
from mi... | 25.157143 | 83 | 0.68692 |
from django.contrib import admin
from ecommerce.models import (
Coupon,
CouponAudit,
CouponInvoice,
CouponInvoiceAudit,
Line,
Order,
OrderAudit,
Receipt,
RedeemedCoupon,
RedeemedCouponAudit,
UserCoupon,
UserCouponAudit,
)
from micromasters.utils import get_field_names
... | true | true |
f71cc7626802c7caa73aac783baedbb65798da02 | 3,272 | py | Python | pylint_plugins/api_models.py | FairwindsOps/st2 | 2b76ca740c4af0d6b2c1d1ba5534ce4133fd16fa | [
"Apache-2.0"
] | 1 | 2021-04-08T03:21:49.000Z | 2021-04-08T03:21:49.000Z | pylint_plugins/api_models.py | FairwindsOps/st2 | 2b76ca740c4af0d6b2c1d1ba5534ce4133fd16fa | [
"Apache-2.0"
] | null | null | null | pylint_plugins/api_models.py | FairwindsOps/st2 | 2b76ca740c4af0d6b2c1d1ba5534ce4133fd16fa | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 36.764045 | 98 | 0.663814 |
import six
from astroid import MANAGER
from astroid import nodes
from astroid import scoped_nodes
CLASS_NAME_BLACKLIST = [
'ExecutionSpecificationAPI'
]
def register(linter):
pass
def transform(cls):
if cls.name in CLASS_NAME_BLACKLIST:
return
if cls.name.endswith('API') ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.