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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f709817624225eac19cd625a3048f72b03e64a4b | 382 | py | Python | wsgi.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | wsgi.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | wsgi.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | """
WSGI config for editor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.470588 | 78 | 0.782723 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
application = get_wsgi_application()
| true | true |
f7098178cdc1fe45aac531ccf83efb684e2e1369 | 12,691 | py | Python | src/python/pants/backend/docker/target_types.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/docker/target_types.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/docker/target_types.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
import re
from abc import ABC, abstractmethod
from textwrap import dedent
from typing import Callable, ClassVar, Iterator, Optional, cast
fro... | 38.574468 | 120 | 0.643685 |
from __future__ import annotations
import os
import re
from abc import ABC, abstractmethod
from textwrap import dedent
from typing import Callable, ClassVar, Iterator, Optional, cast
from typing_extensions import final
from pants.backend.docker.registries import ALL_DEFAULT_REGISTRIES
from pants.base.build_enviro... | true | true |
f70982161030e47bcbd5ca140e005db20ffc06d5 | 1,694 | py | Python | test/writing/test_minimize.py | backwardn/policy_sentry | 6676fba80b00bcfb3d3884ce5777168a9bbcbf71 | [
"MIT"
] | 1 | 2020-07-20T16:16:30.000Z | 2020-07-20T16:16:30.000Z | test/writing/test_minimize.py | avineshwar/policy_sentry | 1b52b50d97293109ac54350a6c09e48643c7170d | [
"MIT"
] | 14 | 2020-05-06T21:34:17.000Z | 2021-03-05T01:04:06.000Z | test/writing/test_minimize.py | Mohib-hub/policy_sentry | d04a69eb7cce2e184c986e0a364b57eea01ef4da | [
"MIT"
] | null | null | null | import unittest
from policy_sentry.writing.minimize import minimize_statement_actions
from policy_sentry.querying.all import get_all_actions
class MinimizeWildcardActionsTestCase(unittest.TestCase):
def test_minimize_statement_actions(self):
actions_to_minimize = [
"kms:CreateGrant",
... | 37.644444 | 101 | 0.656434 | import unittest
from policy_sentry.writing.minimize import minimize_statement_actions
from policy_sentry.querying.all import get_all_actions
class MinimizeWildcardActionsTestCase(unittest.TestCase):
def test_minimize_statement_actions(self):
actions_to_minimize = [
"kms:CreateGrant",
... | true | true |
f709848ee6e175d33f02d22031606644dbbc1dcf | 3,364 | py | Python | ckanext/example_theme_docs/custom_emails/test_custom_emails.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 1 | 2022-03-24T04:47:38.000Z | 2022-03-24T04:47:38.000Z | ckanext/example_theme_docs/custom_emails/test_custom_emails.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 1 | 2021-09-22T12:53:39.000Z | 2021-09-22T12:53:39.000Z | ckanext/example_theme_docs/custom_emails/test_custom_emails.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 2 | 2018-01-21T17:03:08.000Z | 2019-07-23T08:49:52.000Z | # encoding: utf-8
import os
import pytest
import ckan.model as model
import ckan.lib.mailer as mailer
from ckan.tests import factories
from ckan.lib.base import render
from ckan.common import config
from ckan.tests.lib.test_mailer import MailerBase
@pytest.mark.usefixtures("with_request_context", "clean_db", "wit... | 32.660194 | 77 | 0.636445 |
import os
import pytest
import ckan.model as model
import ckan.lib.mailer as mailer
from ckan.tests import factories
from ckan.lib.base import render
from ckan.common import config
from ckan.tests.lib.test_mailer import MailerBase
@pytest.mark.usefixtures("with_request_context", "clean_db", "with_plugins")
@pyte... | true | true |
f709850ca1f40d6a987f9f5e257bf3085fc0b583 | 2,646 | py | Python | .history/mercari/mercari_search_20201124185000.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/mercari/mercari_search_20201124185000.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/mercari/mercari_search_20201124185000.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.support.ui import Select
import pandas as pd
import re
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import PyQt5
import time
"""[Initial Settings]
初期設定
"""
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.a... | 37.267606 | 93 | 0.637188 | from selenium import webdriver
from selenium.webdriver.support.ui import Select
import pandas as pd
import re
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import PyQt5
import time
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.add_argument('--disable-gpu')
op... | true | true |
f70985406baacff2698cda8db75a4fcb1039b24d | 14,992 | py | Python | Feature_Extraction.py | peiyan1234/NTU_UpperTUC_biomed | f96766aa3f4de8cd9f37d252bd0f063d8f841069 | [
"MIT"
] | null | null | null | Feature_Extraction.py | peiyan1234/NTU_UpperTUC_biomed | f96766aa3f4de8cd9f37d252bd0f063d8f841069 | [
"MIT"
] | null | null | null | Feature_Extraction.py | peiyan1234/NTU_UpperTUC_biomed | f96766aa3f4de8cd9f37d252bd0f063d8f841069 | [
"MIT"
] | null | null | null | import argparse
import os
import glob
import copy
import csv
import json
import numpy as np
from PIL import Image
import nrrd
import radiomics
from radiomics import featureextractor
import SimpleITK as sitk
_pwd_ = os.getcwd()
data_Table = {}
Feature_Table = {}
hyperparameters = {}
hyperparameters['setting'] = ... | 28.02243 | 116 | 0.480123 | import argparse
import os
import glob
import copy
import csv
import json
import numpy as np
from PIL import Image
import nrrd
import radiomics
from radiomics import featureextractor
import SimpleITK as sitk
_pwd_ = os.getcwd()
data_Table = {}
Feature_Table = {}
hyperparameters = {}
hyperparameters['setting'] = ... | true | true |
f70985996cf54c23bb1a95550c2daac3207fa3fb | 209 | py | Python | backend/common/context_processors.py | olegpobedynskyi/Boilerplate-React-Django | 79281a6254be3402bbe1c8216c98b84750f54646 | [
"MIT"
] | 3 | 2020-02-06T01:06:29.000Z | 2020-05-20T14:25:22.000Z | backend/common/context_processors.py | olegpobedynskyi/Boilerplate-React-Django | 79281a6254be3402bbe1c8216c98b84750f54646 | [
"MIT"
] | 19 | 2020-02-11T04:54:40.000Z | 2022-02-26T23:03:01.000Z | backend/common/context_processors.py | davidpierre21/repository-monitor | 0be5fbf1d5d404aa9e4952a0f02a44f1662efa91 | [
"MIT"
] | 2 | 2021-01-28T16:00:01.000Z | 2021-06-15T03:49:20.000Z | from django.conf import settings
def sentry_dsn(request):
return {
'SENTRY_DSN': settings.SENTRY_DSN
}
def commit_sha(request):
return {
'COMMIT_SHA': settings.COMMIT_SHA
}
| 14.928571 | 41 | 0.650718 | from django.conf import settings
def sentry_dsn(request):
return {
'SENTRY_DSN': settings.SENTRY_DSN
}
def commit_sha(request):
return {
'COMMIT_SHA': settings.COMMIT_SHA
}
| true | true |
f70985e843e47bc768ffb3a11799ccf0e11fff29 | 1,454 | py | Python | mlcollect/cnn/lenet.py | sanghuynh1501/mlcollect | e85fe6a08e14fa6502166c1a7bfffdcd8c3a25b2 | [
"MIT"
] | null | null | null | mlcollect/cnn/lenet.py | sanghuynh1501/mlcollect | e85fe6a08e14fa6502166c1a7bfffdcd8c3a25b2 | [
"MIT"
] | null | null | null | mlcollect/cnn/lenet.py | sanghuynh1501/mlcollect | e85fe6a08e14fa6502166c1a7bfffdcd8c3a25b2 | [
"MIT"
] | null | null | null | from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
clas... | 35.463415 | 78 | 0.652682 | from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
clas... | true | true |
f709888e7bb1e2b7e0336cde6b0426fffa9cbec5 | 896 | py | Python | lightutils/sys/path.py | smilelight/lightUtils | e9b7ed35ed50cf6b7c6284fe60918ce4dc71beac | [
"MIT"
] | 2 | 2020-01-23T02:03:19.000Z | 2020-12-13T09:05:45.000Z | lightutils/sys/path.py | smilelight/lightUtils | e9b7ed35ed50cf6b7c6284fe60918ce4dc71beac | [
"MIT"
] | null | null | null | lightutils/sys/path.py | smilelight/lightUtils | e9b7ed35ed50cf6b7c6284fe60918ce4dc71beac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
from ..common.file import get_file_name
from ..common.log import logger
def add_sys_path(file_path: str, project_name: str):
if not os.path.exists(file_path):
raise FileNotFoundError("{} not found".format(file_path))
flag = False
parent_path = os.path.... | 28.903226 | 68 | 0.637277 |
import os
import sys
from ..common.file import get_file_name
from ..common.log import logger
def add_sys_path(file_path: str, project_name: str):
if not os.path.exists(file_path):
raise FileNotFoundError("{} not found".format(file_path))
flag = False
parent_path = os.path.abspath(file_path)
... | true | true |
f70988d5b64503f0de01827901e8b85c32db26c7 | 2,832 | py | Python | theano/gof/__init__.py | JimmyRetza/Theano | 72d83bce0d547d54ab3513bcba35c166979f7a6f | [
"BSD-3-Clause"
] | 9 | 2018-10-29T20:25:25.000Z | 2021-11-17T11:03:17.000Z | theano/gof/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | theano/gof/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2020-01-06T20:28:42.000Z | 2020-01-06T20:28:42.000Z | """
gof.py
gof stands for Graph Optimization Framework.
The gof submodule of theano implements a framework
for manipulating programs described as graphs. The
gof module defines basic theano graph concepts:
-Apply nodes, which represent the application
of an Op to Variables. Together these make up a
graph.
-Th... | 31.120879 | 77 | 0.784958 | from __future__ import absolute_import, print_function, division
from theano.gof.cc import \
CLinker, OpWiseCLinker, DualLinker, HideC
from theano.gof.fg import \
CachedConstantError, InconsistencyError, MissingInputError, FunctionGraph
from theano.gof.destroyhandler import \
DestroyHandler
from theano.... | true | true |
f7098960057372652381a92072a1f17f38411d41 | 8,769 | py | Python | models.py | mattj241/FSWD_Capstone | a677f44ec5b6fc3c360d1cb94399c8d99bb6df00 | [
"MIT"
] | null | null | null | models.py | mattj241/FSWD_Capstone | a677f44ec5b6fc3c360d1cb94399c8d99bb6df00 | [
"MIT"
] | null | null | null | models.py | mattj241/FSWD_Capstone | a677f44ec5b6fc3c360d1cb94399c8d99bb6df00 | [
"MIT"
] | null | null | null | import os
import enum
from typing import Counter
from sqlalchemy import Column, String, Integer, create_engine
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import... | 28.015974 | 83 | 0.638841 | import os
import enum
from typing import Counter
from sqlalchemy import Column, String, Integer, create_engine
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import... | true | true |
f7098a56d5bc500eb89b46ae24674e262cb9574f | 3,747 | py | Python | pdf2pdfocr_multibackground.py | browntownington/pdf2pdfocr | 21b8dc2bdaa9d059b2c858c27dd05a9a26235371 | [
"Apache-2.0"
] | 136 | 2016-01-03T10:58:24.000Z | 2022-03-20T23:01:24.000Z | pdf2pdfocr_multibackground.py | browntownington/pdf2pdfocr | 21b8dc2bdaa9d059b2c858c27dd05a9a26235371 | [
"Apache-2.0"
] | 27 | 2016-04-30T05:41:18.000Z | 2022-02-26T12:00:36.000Z | pdf2pdfocr_multibackground.py | browntownington/pdf2pdfocr | 21b8dc2bdaa9d059b2c858c27dd05a9a26235371 | [
"Apache-2.0"
] | 22 | 2016-04-30T04:34:54.000Z | 2021-08-30T21:01:13.000Z | #!/usr/bin/env python3
##############################################################################
# Copyright (c) 2016: Leonardo Cardoso
# https://github.com/LeoFCardoso/pdf2pdfocr
##############################################################################
# Emulate pdftk multibackground operator
# $1 - first fi... | 39.03125 | 103 | 0.621564 | true | true | |
f7098a7742e9c2007808daa26f100d2b2cd86f4a | 2,913 | py | Python | echoscope/__main__.py | treeyh/echoscope | ef8933ce9a5dfe2ac8fb6e82bad8d5fa0d72a6da | [
"MIT"
] | 1 | 2022-01-18T09:19:38.000Z | 2022-01-18T09:19:38.000Z | echoscope/__main__.py | treeyh/echoscope | ef8933ce9a5dfe2ac8fb6e82bad8d5fa0d72a6da | [
"MIT"
] | null | null | null | echoscope/__main__.py | treeyh/echoscope | ef8933ce9a5dfe2ac8fb6e82bad8d5fa0d72a6da | [
"MIT"
] | 1 | 2022-01-18T09:19:39.000Z | 2022-01-18T09:19:39.000Z | # -*- coding: UTF-8 -*-
import sys
import logging
import argparse
import shutil
from typing import Dict, List
from echoscope.util import file_util, log_util
from echoscope.config import config
from echoscope.model import config_model
from echoscope.source import source, mysql_source, clickhouse_source
from echoscope... | 26.724771 | 97 | 0.727085 |
import sys
import logging
import argparse
import shutil
from typing import Dict, List
from echoscope.util import file_util, log_util
from echoscope.config import config
from echoscope.model import config_model
from echoscope.source import source, mysql_source, clickhouse_source
from echoscope.generate import genera... | true | true |
f7098c2080949e808ba6e5b35267749e8ad64cbe | 3,540 | py | Python | lib/kubernetes/client/models/v1_rolling_update_stateful_set_strategy.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_rolling_update_stateful_set_strategy.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_rolling_update_stateful_set_strategy.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 27.874016 | 108 | 0.55452 |
from pprint import pformat
from six import iteritems
import re
class V1RollingUpdateStatefulSetStrategy(object):
swagger_types = {
'partition': 'int'
}
attribute_map = {
'partition': 'partition'
}
def __init__(self, partition=None):
self._parti... | true | true |
f7098c6d7d019f59843b2349c02ec2b299bce038 | 18,212 | py | Python | optuna/visualization/matplotlib/_contour.py | keisukefukuda/optuna | ac4ea8d0c74726f8a603ba2cb0bfb7f4112f736e | [
"MIT"
] | null | null | null | optuna/visualization/matplotlib/_contour.py | keisukefukuda/optuna | ac4ea8d0c74726f8a603ba2cb0bfb7f4112f736e | [
"MIT"
] | null | null | null | optuna/visualization/matplotlib/_contour.py | keisukefukuda/optuna | ac4ea8d0c74726f8a603ba2cb0bfb7f4112f736e | [
"MIT"
] | null | null | null | from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
import scipy
from optuna._experimental import experimental
from optuna.logging import get_logger
from optuna.study import Study
from optuna.study... | 34.82218 | 99 | 0.621623 | from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
import scipy
from optuna._experimental import experimental
from optuna.logging import get_logger
from optuna.study import Study
from optuna.study... | true | true |
f7098cc1020c0449102ed02912eddc4ceb9787ee | 58 | py | Python | hello world.py | RJ722/Repo-with-spaces | 7efd9dcb35a760d7fd02ef88f9bdde3b26a846bb | [
"MIT"
] | null | null | null | hello world.py | RJ722/Repo-with-spaces | 7efd9dcb35a760d7fd02ef88f9bdde3b26a846bb | [
"MIT"
] | null | null | null | hello world.py | RJ722/Repo-with-spaces | 7efd9dcb35a760d7fd02ef88f9bdde3b26a846bb | [
"MIT"
] | null | null | null | import this
def hello_world():
print("Hello World")
| 9.666667 | 24 | 0.672414 | import this
def hello_world():
print("Hello World")
| true | true |
f7098d8278771772864212ad3ce454b1a9c954ea | 710 | py | Python | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 1 | 2021-05-24T10:08:51.000Z | 2021-05-24T10:08:51.000Z | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | null | null | null | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 1 | 2021-01-28T01:57:41.000Z | 2021-01-28T01:57:41.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""System configuration library.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.framework.versions import CXX11_ABI_FLAG
from tenso... | 37.368421 | 82 | 0.856338 |
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.framework.versions import CXX11_ABI_FLAG
from tensorflow.python.framework.versions import MONOLITHIC_BUILD
from tensorflow.python.platform.sysconfig import get_build_info
from tensorflow.python.platform.sysconfig imp... | true | true |
f7098dfc12b93cf391e09b7933418a63cee34e7a | 5,447 | py | Python | pysnmp/CISCO-MGX82XX-MODULE-RSRC-PART-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-MGX82XX-MODULE-RSRC-PART-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-MGX82XX-MODULE-RSRC-PART-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-MGX82XX-MODULE-RSRC-PART-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MGX82XX-MODULE-RSRC-PART-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:50:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using... | 123.795455 | 705 | 0.77382 |
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint = mibBuild... | true | true |
f7098ebb8ff1dfc1223860cb85b7c2ab64d03675 | 5,733 | py | Python | mlpipeline_analyzer/visualizer/PipelineDiagram.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | mlpipeline_analyzer/visualizer/PipelineDiagram.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | mlpipeline_analyzer/visualizer/PipelineDiagram.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | from diagrams import Cluster, Diagram
from graphviz import Digraph
from .PipelineNode import PipelineNode
import sklearn
from sklearn import *
import regex as re
import warnings
#warnings.filterwarnings("ignore")
class PipelineDiagram:
def __init__(self, pipeline, file_name='ml_pipeline.png'):
self.pipe =... | 39.267123 | 136 | 0.570382 | from diagrams import Cluster, Diagram
from graphviz import Digraph
from .PipelineNode import PipelineNode
import sklearn
from sklearn import *
import regex as re
import warnings
class PipelineDiagram:
def __init__(self, pipeline, file_name='ml_pipeline.png'):
self.pipe = pipeline
self.title = 'Ma... | true | true |
f7098fb90676aab0b7bddddef5e52fc6f77ed958 | 1,642 | py | Python | sdks/python/apache_beam/typehints/row_type.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/typehints/row_type.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/typehints/row_type.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 32.196078 | 74 | 0.727771 |
from apache_beam.typehints import typehints
class RowTypeConstraint(typehints.TypeConstraint):
def __init__(self, fields):
self._fields = tuple(fields)
def _consistent_with_check_(self, sub):
return self == sub
def type_check(self, instance):
from apache_beam import Row
retu... | true | true |
f70990d5f14342ae48272d9f8af48d74029ae394 | 18,002 | py | Python | external-deps/python-lsp-server/test/plugins/test_completion.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 493 | 2021-04-11T19:38:09.000Z | 2022-03-31T16:24:55.000Z | external-deps/python-lsp-server/test/plugins/test_completion.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 134 | 2021-04-10T00:09:00.000Z | 2022-03-31T06:41:05.000Z | external-deps/python-lsp-server/test/plugins/test_completion.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 69 | 2021-04-14T21:09:17.000Z | 2022-03-30T05:55:38.000Z | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import math
import os
import sys
from pathlib import Path
from typing import NamedTuple, Dict
import pytest
from pylsp import uris, lsp
from pylsp.workspace import Document
from pylsp.plugins.jedi_completion imp... | 35.577075 | 116 | 0.679313 |
import math
import os
import sys
from pathlib import Path
from typing import NamedTuple, Dict
import pytest
from pylsp import uris, lsp
from pylsp.workspace import Document
from pylsp.plugins.jedi_completion import pylsp_completions as pylsp_jedi_completions
from pylsp.plugins.jedi_completion import pylsp_complet... | true | true |
f709914a96349d3d19379fbb812de6ce94a78611 | 1,591 | py | Python | youtube_mp3.py | sliatecinos/saladeaula | 35ee1a47f3a62c6e17d831b8b08bf209eab3305d | [
"Unlicense"
] | 1 | 2022-01-11T21:05:33.000Z | 2022-01-11T21:05:33.000Z | youtube_mp3.py | sliatecinos/saladeaula | 35ee1a47f3a62c6e17d831b8b08bf209eab3305d | [
"Unlicense"
] | null | null | null | youtube_mp3.py | sliatecinos/saladeaula | 35ee1a47f3a62c6e17d831b8b08bf209eab3305d | [
"Unlicense"
] | null | null | null | # ================================================================
# YouTube Downloader (.MP4 para .MP3) :: github.com/sliatecinos
# ================================================================
from pytube import YouTube
from pydub import AudioSegment
import os
import time
link = input('\nEntre com o link:')
yt... | 27.431034 | 83 | 0.615965 |
from pytube import YouTube
from pydub import AudioSegment
import os
import time
link = input('\nEntre com o link:')
yt = YouTube(link)
print('Titulo:\t',yt.title)
print('Nro. de views:\t',yt.views)
print('Tamanho:\t',yt.length)
t.rating)
print('Publicado por:\t',yt.author)
video = yt.streams.filter(onl... | true | true |
f709916599da40d4a4b314b76e753b26221d2c76 | 2,398 | py | Python | how_to_use_custom_keras_objects.py | XiaowanYi/Attention_vgg16 | 32c68ae048ea3f3de96c74a1df78d1f58894eee7 | [
"MIT"
] | 3 | 2020-12-13T12:50:14.000Z | 2021-09-19T09:28:42.000Z | how_to_use_custom_keras_objects.py | XiaowanYi/Attention_vgg16 | 32c68ae048ea3f3de96c74a1df78d1f58894eee7 | [
"MIT"
] | null | null | null | how_to_use_custom_keras_objects.py | XiaowanYi/Attention_vgg16 | 32c68ae048ea3f3de96c74a1df78d1f58894eee7 | [
"MIT"
] | 1 | 2021-05-29T08:43:28.000Z | 2021-05-29T08:43:28.000Z | """
This script has a few examples about how to use custom keras objects
which are defined in `keras_custom_objects`
"""
'''
1. Use a custom EarlyStopping criteria:
In our case, it is RelativeEarlyStopping which is to terminate training
if the monitored improvement between two epochs is le... | 47.96 | 115 | 0.610926 |
import keras_custom_objects as KO
custom_earlystopping = KO.RelativeEarlyStopping(monitor='val_loss',
min_perc_delta=0.001,
patience=patience,
verbose=2,
... | true | true |
f7099171822142f65064fc71bc2ffdaf986681bf | 689 | py | Python | nw/tests/__init__.py | valhuber/Logic-Bank | 3f31b47786ce3fae53fd96af8795cd693e20547b | [
"BSD-3-Clause"
] | 1 | 2021-06-28T20:37:09.000Z | 2021-06-28T20:37:09.000Z | nw/tests/__init__.py | valhuber/Logic-Bank | 3f31b47786ce3fae53fd96af8795cd693e20547b | [
"BSD-3-Clause"
] | 2 | 2020-09-30T14:10:54.000Z | 2020-09-30T14:11:43.000Z | nw/tests/__init__.py | valhuber/Logic-Bank | 3f31b47786ce3fae53fd96af8795cd693e20547b | [
"BSD-3-Clause"
] | null | null | null | import os
from shutil import copyfile
from logic_bank.util import prt
def setup_db():
""" copy db/database-gold.db over db/database.db"""
print("\n" + prt("restoring database-gold\n"))
basedir = os.path.abspath(os.path.dirname(__file__))
basedir = os.path.dirname(basedir)
print("\n**************... | 32.809524 | 96 | 0.555878 | import os
from shutil import copyfile
from logic_bank.util import prt
def setup_db():
print("\n" + prt("restoring database-gold\n"))
basedir = os.path.abspath(os.path.dirname(__file__))
basedir = os.path.dirname(basedir)
print("\n********************************\n"
" IMPORTANT - create da... | true | true |
f70991fbf0ccbff4d648e3f23be1363474a8332b | 6,435 | py | Python | py_work/AI/ML/FeatureSelection.py | kotori-y/kotori_work | 51ebfdf49571ae34c246dc5b37cc86e25f4ccf3d | [
"MIT"
] | 6 | 2020-05-14T09:47:04.000Z | 2021-06-05T03:03:45.000Z | py_work/AI/ML/FeatureSelection.py | kotori-y/kotori_work | 51ebfdf49571ae34c246dc5b37cc86e25f4ccf3d | [
"MIT"
] | null | null | null | py_work/AI/ML/FeatureSelection.py | kotori-y/kotori_work | 51ebfdf49571ae34c246dc5b37cc86e25f4ccf3d | [
"MIT"
] | 4 | 2020-04-20T13:17:27.000Z | 2021-08-07T19:44:50.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 21:46:41 2019
You are not expected to understand my codes!
@Author: Kotori_Y
@Blog: blog.moyule.me
@Weibo: Kotori-Y
@Mail: yzjkid9@gmail.com
I love Megumi forerver!
"""
print(__doc__)
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection ... | 30.9375 | 141 | 0.524165 |
print(__doc__)
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split,KFold
from sklearn.metrics import accuracy_score,precision_score,recall_score
import pandas as pd
import time
import os
from tqdm import tqdm
kf = KFold(n_splits=5)
start = time.clock()
... | true | true |
f70993686240ee83242c38feb61999ddede668e5 | 8,456 | py | Python | anvil/utils/generic.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 3 | 2019-11-22T04:38:06.000Z | 2022-01-19T08:27:18.000Z | anvil/utils/generic.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 28 | 2018-02-01T20:39:42.000Z | 2018-04-26T17:25:23.000Z | anvil/utils/generic.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 1 | 2018-03-11T06:47:26.000Z | 2018-03-11T06:47:26.000Z | from six import iteritems, itervalues
from collections import OrderedDict, MutableMapping, Iterable
from functools import wraps
import anvil.config as cfg
def to_list(query):
if isinstance(query, list):
return query
elif isinstance(query, str):
return [query]
elif isinstance(query, dict):
... | 31.670412 | 117 | 0.626301 | from six import iteritems, itervalues
from collections import OrderedDict, MutableMapping, Iterable
from functools import wraps
import anvil.config as cfg
def to_list(query):
if isinstance(query, list):
return query
elif isinstance(query, str):
return [query]
elif isinstance(query, dict):
... | true | true |
f709949ef53472ddbc169d6ea68a3922395cec12 | 49,392 | py | Python | core/domain/rights_manager.py | mzaman07/oppia | cac5737ba63a0a209d47d20f3b464495da12bd59 | [
"Apache-2.0"
] | 1 | 2022-02-22T09:27:22.000Z | 2022-02-22T09:27:22.000Z | core/domain/rights_manager.py | mzaman07/oppia | cac5737ba63a0a209d47d20f3b464495da12bd59 | [
"Apache-2.0"
] | null | null | null | core/domain/rights_manager.py | mzaman07/oppia | cac5737ba63a0a209d47d20f3b464495da12bd59 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 35.381089 | 80 | 0.695396 |
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import logging
from constants import constants
from core.domain import activity_services
from core.domain import change_domain
from core.domain import role_services
from core.domain import subscription_serv... | true | true |
f709949f002c77e7ca71cbfadd25bd0c223af1b8 | 18,637 | py | Python | vispy/visuals/line/line.py | jni/vispy | 8b61cd439076aa3f50ac5f6dacb4c0af8c1d0684 | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:33.000Z | 2020-05-03T21:29:03.000Z | vispy/visuals/line/line.py | jni/vispy | 8b61cd439076aa3f50ac5f6dacb4c0af8c1d0684 | [
"BSD-3-Clause"
] | null | null | null | vispy/visuals/line/line.py | jni/vispy | 8b61cd439076aa3f50ac5f6dacb4c0af8c1d0684 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Line visual implementing Agg- and GL-based drawing modes.
"""
from __future__ import division
import numpy as np
from ... import gloo, glsl
from ...color ... | 33.823956 | 78 | 0.540806 |
from __future__ import division
import numpy as np
from ... import gloo, glsl
from ...color import Color, ColorArray, get_colormap
from ...ext.six import string_types
from ..shaders import Function
from ..visual import Visual, CompoundVisual
from ...util.profiler import Profiler
from .dash_atlas import DashAtlas... | true | true |
f7099500a68960bb66d8067e80352e61f0cd79d0 | 723 | py | Python | main.py | valknight/PlexDiscordPresence | 3fcd236ab8abcef2b11e37dffe5a463b272b5881 | [
"MIT"
] | 2 | 2019-02-19T18:43:37.000Z | 2021-09-06T16:36:55.000Z | main.py | valknight/PlexDiscordPresence | 3fcd236ab8abcef2b11e37dffe5a463b272b5881 | [
"MIT"
] | 1 | 2021-09-13T18:30:22.000Z | 2021-09-13T18:30:22.000Z | main.py | valknight/PlexDiscordPresence | 3fcd236ab8abcef2b11e37dffe5a463b272b5881 | [
"MIT"
] | null | null | null | import tautulli
import config
import time
from config import client_id
from pypresence import Presence
RPC = Presence(client_id)
def main():
RPC.connect()
print("Check discord")
while True:
current_activity = tautulli.get_my_activity()
if current_activity is not None:
to_send =... | 28.92 | 74 | 0.655602 | import tautulli
import config
import time
from config import client_id
from pypresence import Presence
RPC = Presence(client_id)
def main():
RPC.connect()
print("Check discord")
while True:
current_activity = tautulli.get_my_activity()
if current_activity is not None:
to_send =... | true | true |
f70995ff867a7704a1fe14f6760f10b07cb7ae8b | 663 | py | Python | tests/trestle/core/remote/__init__.py | degenaro/compliance-trestle | 9feb6908c80c3873cf310079144fbbbe20002c54 | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/remote/__init__.py | degenaro/compliance-trestle | 9feb6908c80c3873cf310079144fbbbe20002c54 | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/remote/__init__.py | degenaro/compliance-trestle | 9feb6908c80c3873cf310079144fbbbe20002c54 | [
"Apache-2.0"
] | null | null | null | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 39 | 74 | 0.742081 | true | true | |
f7099645b764655b7a6b01b5a8b89fb66d9a99e8 | 102 | py | Python | diffpy.pdffit2/run_test.py | st3107/conda-recipes | 61a8fbefa807f43f1023397fd00310551da200a9 | [
"BSD-3-Clause"
] | null | null | null | diffpy.pdffit2/run_test.py | st3107/conda-recipes | 61a8fbefa807f43f1023397fd00310551da200a9 | [
"BSD-3-Clause"
] | null | null | null | diffpy.pdffit2/run_test.py | st3107/conda-recipes | 61a8fbefa807f43f1023397fd00310551da200a9 | [
"BSD-3-Clause"
] | 1 | 2020-12-01T18:11:29.000Z | 2020-12-01T18:11:29.000Z | #!/usr/bin/env python
import diffpy.pdffit2.tests
assert diffpy.pdffit2.tests.test().wasSuccessful()
| 20.4 | 50 | 0.784314 |
import diffpy.pdffit2.tests
assert diffpy.pdffit2.tests.test().wasSuccessful()
| true | true |
f709975689be0cff9a6ae96e30974f303f6430bd | 2,473 | py | Python | src/slim/nets/nets_factory_test.py | nghugo88/tf-pose-estimation | 0df660feeb52957f40f4a5e18920adc317af3653 | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | src/slim/nets/nets_factory_test.py | nghugo88/tf-pose-estimation | 0df660feeb52957f40f4a5e18920adc317af3653 | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | src/slim/nets/nets_factory_test.py | nghugo88/tf-pose-estimation | 0df660feeb52957f40f4a5e18920adc317af3653 | [
"Apache-2.0"
] | 2,580 | 2017-05-14T14:33:41.000Z | 2022-03-31T15:04:14.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 39.887097 | 80 | 0.698342 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from nets import nets_factory
class NetworksTest(tf.test.TestCase):
def testGetNetworkFnFirstHalf(self):
batch_size = 5
num_classes = 1000
for net in n... | true | true |
f709978d4de03e050175f1392140b62ad12c1672 | 4,168 | py | Python | gale/classification/model/meta_arch/common.py | benihime91/litcv | 1da107e1dcf1f20d6da4ac3f126e22d409a7f92e | [
"Apache-2.0"
] | null | null | null | gale/classification/model/meta_arch/common.py | benihime91/litcv | 1da107e1dcf1f20d6da4ac3f126e22d409a7f92e | [
"Apache-2.0"
] | null | null | null | gale/classification/model/meta_arch/common.py | benihime91/litcv | 1da107e1dcf1f20d6da4ac3f126e22d409a7f92e | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04b_classification.model.meta_arch.common.ipynb (unless otherwise specified).
__all__ = ['GeneralizedImageClassifier']
# Cell
import logging
from collections import namedtuple
from typing import *
import torch
from omegaconf import DictConfig, OmegaConf
from pytorch_li... | 33.344 | 125 | 0.648992 |
__all__ = ['GeneralizedImageClassifier']
import logging
from collections import namedtuple
from typing import *
import torch
from omegaconf import DictConfig, OmegaConf
from pytorch_lightning.core.memory import get_human_readable_count
from torch.nn import Module
from ..backbones import ImageClassificationBackbon... | true | true |
f709983851a949a8e91eea102571610f8c22f66c | 1,811 | py | Python | RSA/multi_power.py | dev-alberto/Computational-Number-Theory | 89644a4d69553bc726409b1f85d5bc897e8491ec | [
"MIT"
] | 1 | 2019-02-21T20:48:01.000Z | 2019-02-21T20:48:01.000Z | RSA/multi_power.py | dev-alberto/Computational-Number-Theory | 89644a4d69553bc726409b1f85d5bc897e8491ec | [
"MIT"
] | null | null | null | RSA/multi_power.py | dev-alberto/Computational-Number-Theory | 89644a4d69553bc726409b1f85d5bc897e8491ec | [
"MIT"
] | null | null | null | from util import getPrime, inv, gcd
from random import randrange
from time import time
from datetime import timedelta
def gen_keys():
p = getPrime(512)
q = getPrime(512)
p_s = p ** 2
n = p_s * q
phi = (p_s - p) * (q - 1)
e = randrange(1, phi)
g = gcd(e, phi)
while g != 1:
e = r... | 19.684783 | 57 | 0.539481 | from util import getPrime, inv, gcd
from random import randrange
from time import time
from datetime import timedelta
def gen_keys():
p = getPrime(512)
q = getPrime(512)
p_s = p ** 2
n = p_s * q
phi = (p_s - p) * (q - 1)
e = randrange(1, phi)
g = gcd(e, phi)
while g != 1:
e = r... | true | true |
f709998f3e0fc54cc0e672fbc903c33dd1f1b011 | 4,504 | py | Python | handbook_tools/commands/toc.py | uribench/software-engineering-handbook-tools | 30b48ed0b48aabbec451be0ef6e2519b3c54cefa | [
"Unlicense"
] | 2 | 2018-06-27T07:59:12.000Z | 2021-04-29T00:22:08.000Z | handbook_tools/commands/toc.py | uribench/software-engineering-handbook-tools | 30b48ed0b48aabbec451be0ef6e2519b3c54cefa | [
"Unlicense"
] | 11 | 2018-06-18T06:55:46.000Z | 2020-07-19T10:33:42.000Z | handbook_tools/commands/toc.py | uribench/software-engineering-handbook-tools | 30b48ed0b48aabbec451be0ef6e2519b3c54cefa | [
"Unlicense"
] | 1 | 2019-07-05T13:07:11.000Z | 2019-07-05T13:07:11.000Z | """
'toc' sub-command of the 'handbook' command.
This module composes a TOC for the Handbook from configuration files.
"""
import os
import sys
from urllib.request import pathname2url
from handbook_tools.lib.command_base import CommandBase
from handbook_tools.lib.navigation_tree import NavigationTree
__version__ = '... | 36.322581 | 89 | 0.60524 |
import os
import sys
from urllib.request import pathname2url
from handbook_tools.lib.command_base import CommandBase
from handbook_tools.lib.navigation_tree import NavigationTree
__version__ = '0.6.8'
class Toc(CommandBase):
def __init__(self, command_args=None, global_args=None):
super().__init__(comma... | true | true |
f7099a27cae14071fac72802c976debd492c90a6 | 4,060 | py | Python | translate/cloud-client/beta_snippets_test.py | Cuciu/python-test | baee855ce20a2a1344ffb208a40ebc20014fba5f | [
"Apache-2.0"
] | 1 | 2022-02-06T00:04:04.000Z | 2022-02-06T00:04:04.000Z | translate/cloud-client/beta_snippets_test.py | Cuciu/python-test | baee855ce20a2a1344ffb208a40ebc20014fba5f | [
"Apache-2.0"
] | 1 | 2021-03-25T22:38:27.000Z | 2021-03-25T22:38:27.000Z | translate/cloud-client/beta_snippets_test.py | Cuciu/python-test | baee855ce20a2a1344ffb208a40ebc20014fba5f | [
"Apache-2.0"
] | 1 | 2020-02-17T03:55:51.000Z | 2020-02-17T03:55:51.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 30.074074 | 79 | 0.734236 |
import os
import pytest
import uuid
import beta_snippets
from google.cloud import storage
PROJECT_ID = os.environ['GCLOUD_PROJECT']
@pytest.fixture(scope='function')
def bucket():
bucket_name = str(uuid.uuid1())
storage_client = storage.Client()
bucket = storage_client.create_bucket(bucket_... | true | true |
f7099a55a30bdd3116b8fe67a61658fa8e908227 | 6,145 | py | Python | Snake.py | JoaoSantos2007/jogoCobrinha | d4a09a339d929d7a19984a45f27127153b009bb3 | [
"MIT"
] | null | null | null | Snake.py | JoaoSantos2007/jogoCobrinha | d4a09a339d929d7a19984a45f27127153b009bb3 | [
"MIT"
] | null | null | null | Snake.py | JoaoSantos2007/jogoCobrinha | d4a09a339d929d7a19984a45f27127153b009bb3 | [
"MIT"
] | null | null | null | import pygame # importa a biblioteca Pygame
import random # importa a biblioteca Random
from audioplayer import AudioPlayer
inicio = False
source = "/home/joao/Arquivos/jogoCobrinha/"
# Começar partida
def iniciar(inicio, tela, fonte, texto):
texto = fonte.render("Pressione T para iniciar: ", True, cor_pontos)
... | 29.261905 | 80 | 0.552482 | import pygame
import random
from audioplayer import AudioPlayer
inicio = False
source = "/home/joao/Arquivos/jogoCobrinha/"
def iniciar(inicio, tela, fonte, texto):
texto = fonte.render("Pressione T para iniciar: ", True, cor_pontos)
tela.blit(imagem, [0, 263])
tela.blit(texto, [150, 150])
for ev... | true | true |
f7099a6152e7bc1aa632fc5d51076615ce91b95a | 608 | py | Python | app/model.py | SayAkhan/testkakao | f1753733ce6f9c62829ac9f33eea4fec4c8ba03a | [
"MIT"
] | null | null | null | app/model.py | SayAkhan/testkakao | f1753733ce6f9c62829ac9f33eea4fec4c8ba03a | [
"MIT"
] | null | null | null | app/model.py | SayAkhan/testkakao | f1753733ce6f9c62829ac9f33eea4fec4c8ba03a | [
"MIT"
] | null | null | null | #from app import db
from datetime import datetime, timedelta
#class User(db.Model):
# id = db.Column(db.Integer, primary_key=True)
# user_key = db.Column(db.String(32), index=True, unique=True)
# join_date = db.Column(db.String())
# last_active_date = db.Column(db.String())
# def __init__(self, user_k... | 30.4 | 65 | 0.625 |
from datetime import datetime, timedelta
| true | true |
f7099a668e8105f9d5648b4e92033cd303825672 | 26,111 | py | Python | InnerEye/ML/pipelines/inference.py | JacopoTeneggi/InnerEye-DeepLearning | 988d9fa318a19cfd435370248970d976ee2e78b0 | [
"MIT"
] | 402 | 2020-09-22T16:38:16.000Z | 2022-03-30T09:56:03.000Z | InnerEye/ML/pipelines/inference.py | JacopoTeneggi/InnerEye-DeepLearning | 988d9fa318a19cfd435370248970d976ee2e78b0 | [
"MIT"
] | 259 | 2020-09-23T09:32:33.000Z | 2022-03-30T18:15:01.000Z | InnerEye/ML/pipelines/inference.py | JacopoTeneggi/InnerEye-DeepLearning | 988d9fa318a19cfd435370248970d976ee2e78b0 | [
"MIT"
] | 112 | 2020-09-23T00:12:58.000Z | 2022-03-31T07:39:55.000Z | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 52.537223 | 119 | 0.655547 |
from __future__ import annotations
import logging
from enum import Enum
from pathlib import Path
from typing import Any, Dict, Optional
import numpy as np
import torch
from radio import CTImagesMaskedBatch
from radio.batchflow import Dataset, action, inbatch_parallel
from InnerEye.Common.type_annotations import ... | true | true |
f7099b9af35d02543cd8c55b0aed90da402ab7ff | 6,986 | py | Python | qualcoder/GUI/ui_dialog_report_compare_coder_file.py | ericbrasiln/QualCoder | 46108a0e43034bdeed77319bb09dc1a3227a8c3a | [
"MIT"
] | null | null | null | qualcoder/GUI/ui_dialog_report_compare_coder_file.py | ericbrasiln/QualCoder | 46108a0e43034bdeed77319bb09dc1a3227a8c3a | [
"MIT"
] | null | null | null | qualcoder/GUI/ui_dialog_report_compare_coder_file.py | ericbrasiln/QualCoder | 46108a0e43034bdeed77319bb09dc1a3227a8c3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_dialog_report_compare_coder_file.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog_reportCompareCoderFile(object):
... | 57.735537 | 144 | 0.73862 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog_reportCompareCoderFile(object):
def setupUi(self, Dialog_reportCompareCoderFile):
Dialog_reportCompareCoderFile.setObjectName("Dialog_reportCompareCoderFile")
Dialog_reportCompareCoderFile.setWindowModality(QtCore.Qt.NonModal)
... | true | true |
f7099beab38b1d30053511639c2dc6a1ef187290 | 1,884 | py | Python | app/misc/modular.py | Cicadadenis/999 | f1de12723c89d77fc4e020ba9343289665330776 | [
"MIT"
] | null | null | null | app/misc/modular.py | Cicadadenis/999 | f1de12723c89d77fc4e020ba9343289665330776 | [
"MIT"
] | null | null | null | app/misc/modular.py | Cicadadenis/999 | f1de12723c89d77fc4e020ba9343289665330776 | [
"MIT"
] | null | null | null | import glob
import logging
from importlib import import_module
from os.path import basename, isdir, isfile
from pathlib import Path
from aiogram import Dispatcher
class ModuleManager:
def __init__(self, dp: Dispatcher):
self.dp = dp
self.root = Path(__file__).parent.parent
def load_path(sel... | 26.914286 | 78 | 0.565817 | import glob
import logging
from importlib import import_module
from os.path import basename, isdir, isfile
from pathlib import Path
from aiogram import Dispatcher
class ModuleManager:
def __init__(self, dp: Dispatcher):
self.dp = dp
self.root = Path(__file__).parent.parent
def load_path(sel... | true | true |
f7099c4ecec5f13d588cfea1db3c144e28b6d645 | 1,887 | py | Python | entities/entity-processor.py | surma-dump/html-build | eeeeae3624cc7ee6733a0c5f9d077546a8b81e90 | [
"CC-BY-4.0"
] | 69 | 2015-09-06T14:33:32.000Z | 2022-02-16T03:17:39.000Z | entities/entity-processor.py | surma-dump/html-build | eeeeae3624cc7ee6733a0c5f9d077546a8b81e90 | [
"CC-BY-4.0"
] | 186 | 2015-08-31T08:10:56.000Z | 2022-03-16T17:11:57.000Z | entities/entity-processor.py | surma-dump/html-build | eeeeae3624cc7ee6733a0c5f9d077546a8b81e90 | [
"CC-BY-4.0"
] | 72 | 2015-08-28T03:36:52.000Z | 2022-03-13T21:27:13.000Z | import xml.dom.minidom
import sys
# this uses 658 MB
document = xml.dom.minidom.parse(sys.stdin)
sets = []
entities = {}
for group in document.getElementsByTagName('group'):
if (group.getAttribute('name') == 'html5' or group.getAttribute('name') == 'mathml'):
for set in group.getElementsByTagName('set'):
... | 46.02439 | 176 | 0.559618 | import xml.dom.minidom
import sys
document = xml.dom.minidom.parse(sys.stdin)
sets = []
entities = {}
for group in document.getElementsByTagName('group'):
if (group.getAttribute('name') == 'html5' or group.getAttribute('name') == 'mathml'):
for set in group.getElementsByTagName('set'):
sets.append(set.g... | true | true |
f7099c93ad2bd1e3a69de77ee2572adef4df10e2 | 1,154 | py | Python | util/metric.py | smartdolphin/variational-autoencoder | 999e00c1f630d1e3b6b433c965f87d236ba18668 | [
"MIT"
] | 3 | 2018-05-31T08:30:30.000Z | 2018-09-02T09:07:51.000Z | util/metric.py | smartdolphin/variational-autoencoder | 999e00c1f630d1e3b6b433c965f87d236ba18668 | [
"MIT"
] | null | null | null | util/metric.py | smartdolphin/variational-autoencoder | 999e00c1f630d1e3b6b433c965f87d236ba18668 | [
"MIT"
] | 1 | 2018-09-02T09:07:53.000Z | 2018-09-02T09:07:53.000Z | from collections import Counter
import numpy as np
from sklearn.metrics import accuracy_score, confusion_matrix
def __majority(arr):
counter = Counter(arr)
value, _ = counter.most_common(1)[0]
return value
def clustering_accuracy(y_true, y_clustering):
clustering_labels = list(set(y_clustering))
... | 33.941176 | 60 | 0.733969 | from collections import Counter
import numpy as np
from sklearn.metrics import accuracy_score, confusion_matrix
def __majority(arr):
counter = Counter(arr)
value, _ = counter.most_common(1)[0]
return value
def clustering_accuracy(y_true, y_clustering):
clustering_labels = list(set(y_clustering))
... | true | true |
f7099df0b81adf9edb8587839dbb5f4204a4277b | 430 | py | Python | app/core/migrations/0006_recipe_image.py | Plachey/recipe-app-api | 226317d0af02e3add2239ea46eeeff45ce55d151 | [
"MIT"
] | null | null | null | app/core/migrations/0006_recipe_image.py | Plachey/recipe-app-api | 226317d0af02e3add2239ea46eeeff45ce55d151 | [
"MIT"
] | null | null | null | app/core/migrations/0006_recipe_image.py | Plachey/recipe-app-api | 226317d0af02e3add2239ea46eeeff45ce55d151 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-14 14:07
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.5 | 93 | 0.62093 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(null=True, u... | true | true |
f7099e207c4fe793f5a10e86c872264015378602 | 4,347 | py | Python | xrpl/core/binarycodec/types/currency.py | antonyggvzvmnxxcx/xrpl-py | fda7ce2a28807374b40324478e42e17d97a063d7 | [
"ISC"
] | null | null | null | xrpl/core/binarycodec/types/currency.py | antonyggvzvmnxxcx/xrpl-py | fda7ce2a28807374b40324478e42e17d97a063d7 | [
"ISC"
] | 2 | 2022-02-23T22:57:46.000Z | 2022-02-24T11:41:49.000Z | xrpl/core/binarycodec/types/currency.py | antonyggvzvmnxxcx/xrpl-py | fda7ce2a28807374b40324478e42e17d97a063d7 | [
"ISC"
] | 1 | 2022-02-21T07:36:36.000Z | 2022-02-21T07:36:36.000Z | """Codec for currency property inside an XRPL issued currency amount json."""
from __future__ import annotations # Requires Python 3.7+
from typing import Optional, Type
from typing_extensions import Final
from xrpl.constants import HEX_CURRENCY_REGEX, ISO_CURRENCY_REGEX
from xrpl.core.binarycodec.exceptions import... | 33.183206 | 86 | 0.645503 | from __future__ import annotations
from typing import Optional, Type
from typing_extensions import Final
from xrpl.constants import HEX_CURRENCY_REGEX, ISO_CURRENCY_REGEX
from xrpl.core.binarycodec.exceptions import XRPLBinaryCodecException
from xrpl.core.binarycodec.types.hash160 import Hash160
_CURRENCY_CODE_LE... | true | true |
f7099e28f13d0d0ebf689edd59f647a14c4109a6 | 833 | py | Python | python/functions.py | felipesud/side-projects | 82ce8559cd64ce726eeebe5c8f7f5f07228ac44a | [
"MIT"
] | null | null | null | python/functions.py | felipesud/side-projects | 82ce8559cd64ce726eeebe5c8f7f5f07228ac44a | [
"MIT"
] | null | null | null | python/functions.py | felipesud/side-projects | 82ce8559cd64ce726eeebe5c8f7f5f07228ac44a | [
"MIT"
] | null | null | null | #We’ve already seen a few python functions such as print and input, but now we’re going to dive into writing our own functions. To get started, we’ll write a function that takes in a number and squares it:
def square(x):
return x * x
#Notice how we use the def keyword to indicate we’re defining a function, that... | 32.038462 | 205 | 0.728691 |
def square(x):
return x * x
for i in range(10):
print(f"The square of {i} is {square(i)}")
| true | true |
f7099e513b3ccd63804c178e2f0d32173e3f1c4e | 55 | py | Python | pre_commit_hooks/loaderon_hooks/tests/testing_samples/check_model_name_samples/error.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | pre_commit_hooks/loaderon_hooks/tests/testing_samples/check_model_name_samples/error.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | pre_commit_hooks/loaderon_hooks/tests/testing_samples/check_model_name_samples/error.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | class SomeClass(object):
_name = "some.model.name"
| 18.333333 | 29 | 0.690909 | class SomeClass(object):
_name = "some.model.name"
| true | true |
f709a042ad90eee2b99eba0e4d74e9980bc62785 | 8,682 | py | Python | apps/news/views.py | dawang-youy/Django-blog | 529e7ef16d65170dc56cd628c34c5c9806138eed | [
"Apache-2.0"
] | null | null | null | apps/news/views.py | dawang-youy/Django-blog | 529e7ef16d65170dc56cd628c34c5c9806138eed | [
"Apache-2.0"
] | null | null | null | apps/news/views.py | dawang-youy/Django-blog | 529e7ef16d65170dc56cd628c34c5c9806138eed | [
"Apache-2.0"
] | null | null | null | import logging
import json
from django.shortcuts import render,HttpResponse
from django.http import Http404
from django.views import View
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from . import models
from . import constants
from utils.json_fun import to_json_data
from utils.res_code import... | 35.008065 | 115 | 0.585695 | import logging
import json
from django.shortcuts import render,HttpResponse
from django.http import Http404
from django.views import View
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from . import models
from . import constants
from utils.json_fun import to_json_data
from utils.res_code import... | true | true |
f709a16aaacdecfd6b39728f922d2694addb5ca8 | 3,463 | py | Python | vsts/vsts/feature_management/v4_0/models/contributed_feature.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/feature_management/v4_0/models/contributed_feature.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/feature_management/v4_0/models/contributed_feature.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 59.706897 | 230 | 0.663298 |
from msrest.serialization import Model
class ContributedFeature(Model):
_attribute_map = {
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'default_state': {'key': 'defaultState', 'type': 'bool'},
'default_value_rules': {'key': 'defaultValueRules', 'type': '[ContributedFeat... | true | true |
f709a1ceea0ffc10aa2fbd792d7b6518d912934a | 1,709 | py | Python | numpy-arrays/code.py | patelshival/ga-dsmp | c355d28daf50c51b1610930f963dcd17b770e17a | [
"MIT"
] | null | null | null | numpy-arrays/code.py | patelshival/ga-dsmp | c355d28daf50c51b1610930f963dcd17b770e17a | [
"MIT"
] | null | null | null | numpy-arrays/code.py | patelshival/ga-dsmp | c355d28daf50c51b1610930f963dcd17b770e17a | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
data = np.genfromtxt(path, delimiter=",", skip_header=1)
print("\nData: \n\n", data)
print("\nType of data: \n\n", type(dat... | 20.590361 | 61 | 0.626682 |
import numpy as np
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
data = np.genfromtxt(path, delimiter=",", skip_header=1)
print("\nData: \n\n", data)
print("\nType of data: \n\n", type(data))
census = np.concatenate((data, new_record), axis=0)
print(census)
age=census[:,0]
print(age)
... | true | true |
f709a1ff552f62232b89d6d9363ed677443a46fd | 3,345 | py | Python | RecoTracker/TrackProducer/test/refitFromMINIAOD.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoTracker/TrackProducer/test/refitFromMINIAOD.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoTracker/TrackProducer/test/refitFromMINIAOD.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
process = cms.Process('RECO2',Run2_2016)
options = VarParsing.VarParsing('analysis')
options.register('globalTag',
"auto:run2_mc", # default value
... | 39.821429 | 115 | 0.75994 | import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
process = cms.Process('RECO2',Run2_2016)
options = VarParsing.VarParsing('analysis')
options.register('globalTag',
"auto:run2_mc",
... | true | true |
f709a34963612148e07d6218f601266cbad70915 | 1,709 | py | Python | domains/explore/problems/training/problem346_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | domains/explore/problems/training/problem346_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | domains/explore/problems/training/problem346_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | 29.465517 | 221 | 0.486834 | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | true | true |
f709a3cce919ff24eb1d2474804b1ef4b4319607 | 2,597 | py | Python | Lib/importlib/test/benchmark.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | 1 | 2020-11-26T18:53:46.000Z | 2020-11-26T18:53:46.000Z | Lib/importlib/test/benchmark.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | null | null | null | Lib/importlib/test/benchmark.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | 2 | 2018-08-06T04:37:38.000Z | 2022-02-27T18:07:12.000Z | from . import util
from .source import util as source_util
import gc
import decimal
import imp
import importlib
import sys
import timeit
def bench_cache(import_, repeat, number):
"""Measure the time it takes to pull from sys.modules."""
name = '<benchmark import>'
with util.uncache(name):
module =... | 31.289157 | 77 | 0.58298 | from . import util
from .source import util as source_util
import gc
import decimal
import imp
import importlib
import sys
import timeit
def bench_cache(import_, repeat, number):
name = '<benchmark import>'
with util.uncache(name):
module = imp.new_module(name)
sys.modules[name] = module
... | true | true |
f709a461b1f54fd83eb4c7764434dd937ee90766 | 13,269 | py | Python | Server/ChatBot/venv/Lib/site-packages/tensorflow/core/framework/tensor_pb2.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 3 | 2018-11-27T06:30:23.000Z | 2021-05-30T15:56:32.000Z | Server/ChatBot/venv/Lib/site-packages/tensorflow/core/framework/tensor_pb2.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 3 | 2020-09-26T01:09:47.000Z | 2022-02-10T02:12:08.000Z | Server/ChatBot/venv/Lib/site-packages/tensorflow/core/framework/tensor_pb2.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 6 | 2020-04-13T15:33:30.000Z | 2020-06-21T19:26:55.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/tensor.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.protobuf im... | 53.504032 | 1,407 | 0.768332 |
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 |
f709a4c39c96d3a1e8421aefec3136f85f663333 | 4,568 | py | Python | readthedocs/search/documents.py | srijan-deepsource/readthedocs.org | ec45216d9ce946a486ef472a8ae3e243742d3aed | [
"MIT"
] | null | null | null | readthedocs/search/documents.py | srijan-deepsource/readthedocs.org | ec45216d9ce946a486ef472a8ae3e243742d3aed | [
"MIT"
] | null | null | null | readthedocs/search/documents.py | srijan-deepsource/readthedocs.org | ec45216d9ce946a486ef472a8ae3e243742d3aed | [
"MIT"
] | 1 | 2020-09-17T08:38:30.000Z | 2020-09-17T08:38:30.000Z | import logging
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from elasticsearch import Elasticsearch
from readthedocs.projects.models import HTMLFile, Project
project_conf = settings.ES_INDEXES['project']
project_index = Index(project_conf['name'])
project_index.setting... | 28.911392 | 75 | 0.577496 | import logging
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from elasticsearch import Elasticsearch
from readthedocs.projects.models import HTMLFile, Project
project_conf = settings.ES_INDEXES['project']
project_index = Index(project_conf['name'])
project_index.setting... | true | true |
f709a519386f92fbdb79f8035b8677fa2a7251b5 | 2,773 | py | Python | pdm/cli/commands/show.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | 1 | 2022-03-02T19:43:46.000Z | 2022-03-02T19:43:46.000Z | pdm/cli/commands/show.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | 1 | 2022-03-20T07:36:27.000Z | 2022-03-20T07:36:27.000Z | pdm/cli/commands/show.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | null | null | null | import argparse
from packaging.version import Version
from pdm import termui
from pdm.cli.commands.base import BaseCommand
from pdm.exceptions import PdmUsageError
from pdm.models.candidates import Candidate
from pdm.models.project_info import ProjectInfo
from pdm.models.requirements import parse_requirement
from pdm... | 37.986301 | 85 | 0.639019 | import argparse
from packaging.version import Version
from pdm import termui
from pdm.cli.commands.base import BaseCommand
from pdm.exceptions import PdmUsageError
from pdm.models.candidates import Candidate
from pdm.models.project_info import ProjectInfo
from pdm.models.requirements import parse_requirement
from pdm... | true | true |
f709a58c0695a29b53bac9a2a62d67edf3e465a0 | 124 | py | Python | thirdweb/types/collection/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | 1 | 2022-02-18T16:59:12.000Z | 2022-02-18T16:59:12.000Z | thirdweb/types/collection/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | null | null | null | thirdweb/types/collection/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | null | null | null | """
Deprecated. Use types.bundle instead.
"""
from .types import CreateCollectionArg, CollectionMetadata, MintCollectionArg
| 24.8 | 77 | 0.806452 | from .types import CreateCollectionArg, CollectionMetadata, MintCollectionArg
| true | true |
f709a61da35f0ca43aa59d98bda805127bea4373 | 622 | py | Python | examples/dataversity.py | ettoreleandrotognoli/etto-robot | 602b6c00ac925ccdbf33e60f06feb5835c246d31 | [
"Apache-2.0"
] | null | null | null | examples/dataversity.py | ettoreleandrotognoli/etto-robot | 602b6c00ac925ccdbf33e60f06feb5835c246d31 | [
"Apache-2.0"
] | 6 | 2020-12-17T10:19:15.000Z | 2021-03-31T23:23:19.000Z | examples/dataversity.py | ettoreleandrotognoli/etto-robot | 602b6c00ac925ccdbf33e60f06feb5835c246d31 | [
"Apache-2.0"
] | 1 | 2021-08-30T20:38:00.000Z | 2021-08-30T20:38:00.000Z | from robot import Robot
from robot.collector.shortcut import *
collector = pipe(
const('http://www.dataversity.net/category/education/daily-data/'),
get(),
css('#primary article'),
foreach(dict(
pipe(
css('a[href]'), attr('href'), any(), url(),
get(),
dict(
... | 24.88 | 71 | 0.533762 | from robot import Robot
from robot.collector.shortcut import *
collector = pipe(
const('http://www.dataversity.net/category/education/daily-data/'),
get(),
css('#primary article'),
foreach(dict(
pipe(
css('a[href]'), attr('href'), any(), url(),
get(),
dict(
... | true | true |
f709a66c3ccd87f772fd79dba1cc07610dc2d391 | 216 | py | Python | Unidad 2/Ejercicios Plataforma/Ejercicio3.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | Unidad 2/Ejercicios Plataforma/Ejercicio3.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | Unidad 2/Ejercicios Plataforma/Ejercicio3.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | cadena = input("\33[0mIngrese la cadena a separar: \33[34m")
separador = input("\33[0mIngrese el carácter espaciador: \33[34m")[0]
print("\33[0m")
print("Resultado:\33[33m", cadena.replace(' ', separador), "\33[0m")
| 43.2 | 69 | 0.685185 | cadena = input("\33[0mIngrese la cadena a separar: \33[34m")
separador = input("\33[0mIngrese el carácter espaciador: \33[34m")[0]
print("\33[0m")
print("Resultado:\33[33m", cadena.replace(' ', separador), "\33[0m")
| true | true |
f709a7666ac46a954430541cfb50b7e737579f2e | 10,407 | py | Python | high_order_layers_torch/FunctionalConvolution.py | jloveric/high-order-layers-torch | a50ccf0cf82c21fdda4c20c671e7d233a0b6f793 | [
"MIT"
] | 4 | 2021-12-05T11:09:51.000Z | 2021-12-11T20:07:37.000Z | high_order_layers_torch/FunctionalConvolution.py | jloveric/high-order-layers-torch | a50ccf0cf82c21fdda4c20c671e7d233a0b6f793 | [
"MIT"
] | 1 | 2022-03-12T01:03:58.000Z | 2022-03-12T01:03:58.000Z | high_order_layers_torch/FunctionalConvolution.py | jloveric/high-order-layers-torch | a50ccf0cf82c21fdda4c20c671e7d233a0b6f793 | [
"MIT"
] | null | null | null | from .LagrangePolynomial import LagrangeExpand
from pytorch_lightning import LightningModule, Trainer
from high_order_layers_torch.PolynomialLayers import *
from torch.nn import Conv2d
import torch.nn as nn
import torch
from .utils import *
def conv2d_wrapper(
in_channels: int,
out_channels: int,
kernel_... | 38.977528 | 178 | 0.618142 | from .LagrangePolynomial import LagrangeExpand
from pytorch_lightning import LightningModule, Trainer
from high_order_layers_torch.PolynomialLayers import *
from torch.nn import Conv2d
import torch.nn as nn
import torch
from .utils import *
def conv2d_wrapper(
in_channels: int,
out_channels: int,
kernel_... | true | true |
f709a78792f34be38d389105354669425719c2f6 | 459 | py | Python | packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="parcats.line.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plo... | 27 | 66 | 0.623094 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="parcats.line.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plo... | true | true |
f709a7abeea7c161af86f8de2d2b4ca3e795964c | 3,261 | py | Python | python/ccxt/test/test_trade.py | DavidFelsen/ccxt | 6497b7da13d2ea3a9e56207b46b8691938b07839 | [
"MIT"
] | 500 | 2017-06-28T14:43:21.000Z | 2022-03-11T14:19:00.000Z | python/ccxt/test/test_trade.py | DavidFelsen/ccxt | 6497b7da13d2ea3a9e56207b46b8691938b07839 | [
"MIT"
] | 214 | 2017-07-03T17:39:26.000Z | 2017-09-20T02:41:20.000Z | python/ccxt/test/test_trade.py | DavidFelsen/ccxt | 6497b7da13d2ea3a9e56207b46b8691938b07839 | [
"MIT"
] | 127 | 2017-06-30T05:49:24.000Z | 2021-11-05T22:39:56.000Z | import numbers # noqa: E402
try:
basestring # basestring was removed in Python 3
except NameError:
basestring = str
def test_trade(exchange, trade, symbol, now):
assert trade
sampleTrade = {
'info': {'a': 1, 'b': 2, 'c': 3}, # the original decoded JSON as is
'id': '12345-67890:098... | 48.671642 | 172 | 0.601349 | import numbers
try:
basestring
except NameError:
basestring = str
def test_trade(exchange, trade, symbol, now):
assert trade
sampleTrade = {
'info': {'a': 1, 'b': 2, 'c': 3},
'id': '12345-67890:09876/54321',
'timestamp': 1502962946216,
'dateti... | true | true |
f709a7ecd6bb9ade98ca43b8a364ed1073609efa | 322 | py | Python | simple_app.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | 19 | 2020-12-11T15:40:55.000Z | 2022-01-17T16:55:13.000Z | simple_app.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | null | null | null | simple_app.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | null | null | null | from pathlib import Path
from pprint import pprint
from hesiod import get_cfg_copy, hmain
template_file = Path("tests/configs/templates/complex.yaml")
base_cfg_dir = Path("tests/configs/bases")
@hmain(base_cfg_dir, template_cfg_file=template_file)
def test() -> None:
cfg = get_cfg_copy()
pprint(cfg)
test(... | 18.941176 | 60 | 0.757764 | from pathlib import Path
from pprint import pprint
from hesiod import get_cfg_copy, hmain
template_file = Path("tests/configs/templates/complex.yaml")
base_cfg_dir = Path("tests/configs/bases")
@hmain(base_cfg_dir, template_cfg_file=template_file)
def test() -> None:
cfg = get_cfg_copy()
pprint(cfg)
test(... | true | true |
f709a7eefbbbaab83c4f1985daeb1cbebd252f53 | 6,119 | py | Python | gita/utils.py | CD3/gita | 9881cf81d46a41ab05ae558e7dcc7dd846a8ce2d | [
"MIT"
] | null | null | null | gita/utils.py | CD3/gita | 9881cf81d46a41ab05ae558e7dcc7dd846a8ce2d | [
"MIT"
] | null | null | null | gita/utils.py | CD3/gita | 9881cf81d46a41ab05ae558e7dcc7dd846a8ce2d | [
"MIT"
] | null | null | null | import os
import yaml
import asyncio
import platform
from functools import lru_cache
from typing import List, Dict, Coroutine, Union
from . import info
from . import common
def get_path_fname() -> str:
"""
Return the file name that stores the repo locations.
"""
root = common.get_config_dir()
ret... | 30.748744 | 90 | 0.618565 | import os
import yaml
import asyncio
import platform
from functools import lru_cache
from typing import List, Dict, Coroutine, Union
from . import info
from . import common
def get_path_fname() -> str:
root = common.get_config_dir()
return os.path.join(root, 'repo_path')
@lru_cache()
def get_repos() -> Dic... | true | true |
f709a7fc512ab2f029c40750148094564f225011 | 4,364 | py | Python | Speech Recognition/Jarvis.py | KALVS/RandomStuff | a347d73ee3621597c6efa731b36194d1743ef36c | [
"MIT"
] | null | null | null | Speech Recognition/Jarvis.py | KALVS/RandomStuff | a347d73ee3621597c6efa731b36194d1743ef36c | [
"MIT"
] | null | null | null | Speech Recognition/Jarvis.py | KALVS/RandomStuff | a347d73ee3621597c6efa731b36194d1743ef36c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Requires PyAudio and PySpeech and more.
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
import random
from pygame import mixer
from pyicloud import PyiCloudService
from datetime import date
import re
from re import findall, finditer
from urlli... | 31.623188 | 119 | 0.656279 |
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
import random
from pygame import mixer
from pyicloud import PyiCloudService
from datetime import date
import re
from re import findall, finditer
from urllib.request import urlopen
iCloudService = PyiCloudService('icl... | true | true |
f709a87041d5c05d76449fc6fb9f3500d01c2824 | 57,267 | py | Python | timm/models/byobnet.py | KnockerPulsar/pytorch-image-models | 893f5dde27ae6b17389f738bd6e37160e2868c72 | [
"Apache-2.0"
] | null | null | null | timm/models/byobnet.py | KnockerPulsar/pytorch-image-models | 893f5dde27ae6b17389f738bd6e37160e2868c72 | [
"Apache-2.0"
] | null | null | null | timm/models/byobnet.py | KnockerPulsar/pytorch-image-models | 893f5dde27ae6b17389f738bd6e37160e2868c72 | [
"Apache-2.0"
] | null | null | null | """ Bring-Your-Own-Blocks Network
A flexible network w/ dataclass based config for stacking those NN blocks.
This model is currently used to implement the following networks:
GPU Efficient (ResNets) - gernet_l/m/s (original versions called genet, but this was already used (by SENet author)).
Paper: `Neural Ar... | 42.170103 | 134 | 0.626364 | import math
from dataclasses import dataclass, field, replace
from typing import Tuple, List, Dict, Optional, Union, Any, Callable, Sequence
from functools import partial
import torch
import torch.nn as nn
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from .helpers import build_model_with... | true | true |
f709a8d7e31687d2292fa97fcf708ceecab9433b | 285 | py | Python | src/14/14682.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 11 | 2020-09-20T15:17:11.000Z | 2022-03-17T12:43:33.000Z | src/14/14682.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 3 | 2021-10-30T07:51:36.000Z | 2022-03-09T05:19:23.000Z | src/14/14682.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 13 | 2021-01-21T03:19:08.000Z | 2022-03-28T10:44:58.000Z | """
14682. Shifty Sum
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 60 ms
해결 날짜: 2020년 9월 20일
"""
def main():
N, k = [int(input()) for _ in range(2)]
res = N
for _ in range(k):
N *= 10
res += N
print(res)
if __name__ == '__main__':
main() | 12.954545 | 43 | 0.526316 |
def main():
N, k = [int(input()) for _ in range(2)]
res = N
for _ in range(k):
N *= 10
res += N
print(res)
if __name__ == '__main__':
main() | true | true |
f709a967b1234667309531a39b0693c8f8ce9bc0 | 5,348 | py | Python | sarpy/io/general/nitf_elements/graphics.py | pressler-vsc/sarpy | fa6c951c42b9a7d9df2edfa53c771494cb0246fb | [
"MIT"
] | 1 | 2021-02-04T08:44:18.000Z | 2021-02-04T08:44:18.000Z | sarpy/io/general/nitf_elements/graphics.py | pressler-vsc/sarpy | fa6c951c42b9a7d9df2edfa53c771494cb0246fb | [
"MIT"
] | null | null | null | sarpy/io/general/nitf_elements/graphics.py | pressler-vsc/sarpy | fa6c951c42b9a7d9df2edfa53c771494cb0246fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The graphics header element definition.
"""
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
... | 56.294737 | 117 | 0.631077 |
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class GraphicsSegmentHeader(NITFElement):
_ordering = (
'S... | true | true |
f709a9ab548efdde5cce699085047d8dc56830d2 | 7,366 | py | Python | pyrseas/dbobject/column.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | 1 | 2015-03-16T09:10:47.000Z | 2015-03-16T09:10:47.000Z | pyrseas/dbobject/column.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | pyrseas/dbobject/column.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pyrseas.column
~~~~~~~~~~~~~~
This module defines two classes: Column derived from
DbSchemaObject and ColumnDict derived from DbObjectDict.
"""
from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id
class Column(DbSchemaObject):
"A table column definition"... | 36.83 | 79 | 0.562449 |
from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id
class Column(DbSchemaObject):
keylist = ['schema', 'table']
def to_map(self):
if hasattr(self, 'dropped'):
return None
dct = self._base_map()
del dct['number'], dct['name'], dct['_table']
if hasa... | true | true |
f709aa2bed50b695798989b4ab08357aee9cbc57 | 47,691 | py | Python | tests/python/relay/test_op_level3.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | tests/python/relay/test_op_level3.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | tests/python/relay/test_op_level3.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.204425 | 125 | 0.576461 |
import numpy as np
import pytest
import tvm
from tvm import te
from tvm import relay
from tvm.error import TVMError
from tvm.relay import create_executor, transform
from tvm.relay.testing import check_grad, run_infer_type
import tvm.testing
def test_zeros_ones():
for op, ref in [(relay.zeros, np.z... | true | true |
f709aaa7ef848d9eea57b70c4b2699c9584e9ab3 | 2,111 | py | Python | application/pages/training_analysis/services/fit_file_services.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | 1 | 2020-05-08T21:44:37.000Z | 2020-05-08T21:44:37.000Z | application/pages/training_analysis/services/fit_file_services.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | application/pages/training_analysis/services/fit_file_services.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | """In this module we provide services for working with fit files.
Resources
- fitparse package: [GitHub](https://github.com/dtcooper/python-fitparse) and \
[Docs](http://dtcooper.github.io/python-fitparse/)
- fitdecode pacakge: [GitHub](https://github.com/polyvertex/fitdecode) and \
[Read the Docs](htt... | 35.183333 | 93 | 0.650403 |
from typing import Union
import fitparse
import pandas as pd
UNIT_CONVERSION = {
"speed": {"from": "10*6m/s", "to": "km/h", "factor": 0.0036,},
"enhanced_speed": {"from": "10*6m/s", "to": "km/h", "factor": 3.6,},
"altitude": {"from": "unknown", "to": "m", "factor": 0.03855343881175331,},
"p... | true | true |
f709abae3ce3540aa543e1f247ef2b414093609a | 679 | py | Python | hackerrank/Python/Exceptions/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Python/Exceptions/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Python/Exceptions/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'3',
'1 0',
'2 $',
'3 1',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
... | 26.115385 | 86 | 0.561119 | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'3',
'1 0',
'2 $',
'3 1',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
... | true | true |
f709ac008c4373082aa0f1b4e12d73b060e3e98e | 14,590 | py | Python | RecoEgamma/EgammaTools/python/regressionModifier_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | RecoEgamma/EgammaTools/python/regressionModifier_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | RecoEgamma/EgammaTools/python/regressionModifier_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
regressionModifier106XUL = cms.PSet(
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyF... | 58.12749 | 204 | 0.62111 | import FWCore.ParameterSet.Config as cms
regressionModifier106XUL = cms.PSet(
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyF... | true | true |
f709acd7de0d69fa46a1ab2426b894f47946597c | 15,795 | py | Python | tensorflow/python/kernel_tests/sparse_xent_op_test.py | rainwoodman/tensorflow | 9b7ff60faa841f0473facf618cb5b66b9cb99b5e | [
"Apache-2.0"
] | 3 | 2021-03-15T05:31:57.000Z | 2021-12-14T07:29:31.000Z | tensorflow/python/kernel_tests/sparse_xent_op_test.py | rainwoodman/tensorflow | 9b7ff60faa841f0473facf618cb5b66b9cb99b5e | [
"Apache-2.0"
] | 7 | 2021-11-10T20:21:23.000Z | 2022-03-22T19:18:39.000Z | tensorflow/python/kernel_tests/sparse_xent_op_test.py | rainwoodman/tensorflow | 9b7ff60faa841f0473facf618cb5b66b9cb99b5e | [
"Apache-2.0"
] | 1 | 2019-09-27T09:03:41.000Z | 2019-09-27T09:03:41.000Z | # Copyright 2015 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... | 39.68593 | 80 | 0.650839 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import time
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session
from tensorflow.python.eager import backprop as backprop_l... | true | true |
f709ad2a894c733b34890663a08ccf16a64e97a4 | 7,047 | py | Python | chirp/library/do_delete_audio_file_from_db_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 8 | 2015-03-06T17:28:36.000Z | 2020-11-27T10:06:40.000Z | chirp/library/do_delete_audio_file_from_db_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 9 | 2015-09-21T18:52:22.000Z | 2018-02-12T19:23:17.000Z | chirp/library/do_delete_audio_file_from_db_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 9 | 2016-04-08T00:21:15.000Z | 2018-01-25T19:35:58.000Z | import os
import time
import unittest
from mock import patch
from chirp.library import audio_file_test
from chirp.library import do_delete_audio_file_from_db
from chirp.library import database
TEST_DB_NAME_PATTERN = "/tmp/chirp-library-db_test.%d.sqlite"
class DeleteFingerprintTest(unittest.TestCase):
def set... | 30.506494 | 77 | 0.65276 | import os
import time
import unittest
from mock import patch
from chirp.library import audio_file_test
from chirp.library import do_delete_audio_file_from_db
from chirp.library import database
TEST_DB_NAME_PATTERN = "/tmp/chirp-library-db_test.%d.sqlite"
class DeleteFingerprintTest(unittest.TestCase):
def set... | true | true |
f709ad6bc723b406239f8b4084411aa1356e16f3 | 1,133 | py | Python | setup.py | pjdelport/pytest-testmon | dbbaf2f29cc7e9a2745f27dae91e44ce973e8d10 | [
"MIT"
] | null | null | null | setup.py | pjdelport/pytest-testmon | dbbaf2f29cc7e9a2745f27dae91e44ce973e8d10 | [
"MIT"
] | null | null | null | setup.py | pjdelport/pytest-testmon | dbbaf2f29cc7e9a2745f27dae91e44ce973e8d10 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='pytest-testmon',
description='take TDD to a new level with py.test and testmon',
long_description=''.join(open('README.rst').readlines()),
version='0.9.15',
license='MIT',
platforms=['linux', 'osx', 'win32'],
packages=['testmon'],
url='https://g... | 33.323529 | 70 | 0.58782 | from setuptools import setup
setup(
name='pytest-testmon',
description='take TDD to a new level with py.test and testmon',
long_description=''.join(open('README.rst').readlines()),
version='0.9.15',
license='MIT',
platforms=['linux', 'osx', 'win32'],
packages=['testmon'],
url='https://g... | true | true |
f709ae4ed5324f7f1cb8132611e387bb13a68a6f | 2,557 | py | Python | tests/test_imports.py | mnicolas94/pyrulo | 1a537369407b760182bd40f188fd82be637310e2 | [
"MIT"
] | null | null | null | tests/test_imports.py | mnicolas94/pyrulo | 1a537369407b760182bd40f188fd82be637310e2 | [
"MIT"
] | null | null | null | tests/test_imports.py | mnicolas94/pyrulo | 1a537369407b760182bd40f188fd82be637310e2 | [
"MIT"
] | null | null | null | import unittest
import pyrulo.class_imports
class TestImports(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_whenImportClassesByDir_resultIsTheExpected(self):
# arrange
path = "test_classes"
# act
classes = p... | 27.793478 | 91 | 0.637857 | import unittest
import pyrulo.class_imports
class TestImports(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_whenImportClassesByDir_resultIsTheExpected(self):
path = "test_classes"
classes = pyrulo.class_im... | true | true |
f709b0dedd5c969d909177a66ee08e53365ca5a2 | 1,357 | py | Python | test/test_settings.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | 3 | 2015-12-23T06:45:52.000Z | 2017-03-14T10:04:44.000Z | test/test_settings.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | null | null | null | test/test_settings.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | 3 | 2015-08-10T17:41:14.000Z | 2020-03-03T10:13:47.000Z | import collections
import pytest # noqa: F401
from pudb.py3compat import builtins
from pudb.settings import load_breakpoints, save_breakpoints
def test_load_breakpoints(mocker):
fake_data = ["b /home/user/test.py:41"], ["b /home/user/test.py:50"]
mock_open = mocker.mock_open()
mock_open.return_value.re... | 38.771429 | 72 | 0.692704 | import collections
import pytest
from pudb.py3compat import builtins
from pudb.settings import load_breakpoints, save_breakpoints
def test_load_breakpoints(mocker):
fake_data = ["b /home/user/test.py:41"], ["b /home/user/test.py:50"]
mock_open = mocker.mock_open()
mock_open.return_value.readlines.side... | true | true |
f709b235057889c4af135a5edda5c8d0cda7c681 | 10,703 | py | Python | tests/unit/Containers.py | rashmi43/platform-engine | dd9a22742bc8dc43a530ea5edef39b3c35db57c1 | [
"Apache-2.0"
] | null | null | null | tests/unit/Containers.py | rashmi43/platform-engine | dd9a22742bc8dc43a530ea5edef39b3c35db57c1 | [
"Apache-2.0"
] | null | null | null | tests/unit/Containers.py | rashmi43/platform-engine | dd9a22742bc8dc43a530ea5edef39b3c35db57c1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import hashlib
from unittest.mock import MagicMock
from asyncy.AppConfig import Expose
from asyncy.Containers import Containers
from asyncy.Exceptions import ActionNotFound, ContainerSpecNotRegisteredError,\
EnvironmentVariableNotFound, K8sError
from asyncy.Kubernetes import Kubernetes
from... | 33.136223 | 79 | 0.624872 |
import hashlib
from unittest.mock import MagicMock
from asyncy.AppConfig import Expose
from asyncy.Containers import Containers
from asyncy.Exceptions import ActionNotFound, ContainerSpecNotRegisteredError,\
EnvironmentVariableNotFound, K8sError
from asyncy.Kubernetes import Kubernetes
from asyncy.constants.LineC... | true | true |
f709b2e65336b023bfdac6a056b5c4f86ebed150 | 1,327 | py | Python | yepes/fields/postal_code.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/fields/postal_code.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/fields/postal_code.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from yepes import forms
from yepes.fields.char import CharField
from yepes.validators import PostalCodeValidator
from yepes.utils.deconstruct import clean_keywords
class PostalCodeField(CharField)... | 30.860465 | 77 | 0.660889 |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from yepes import forms
from yepes.fields.char import CharField
from yepes.validators import PostalCodeValidator
from yepes.utils.deconstruct import clean_keywords
class PostalCodeField(CharField):
default_validat... | true | true |
f709b3b126143357e20c2bcb075dff3ce91691c4 | 4,078 | py | Python | pymodel/TestSuite.py | Python3pkg/PyModel | e0d404e122202c25c85dcebedcbd567837068b65 | [
"BSD-3-Clause"
] | 3 | 2017-06-09T22:45:16.000Z | 2021-02-13T23:18:44.000Z | pymodel/TestSuite.py | Python3pkg/PyModel | e0d404e122202c25c85dcebedcbd567837068b65 | [
"BSD-3-Clause"
] | null | null | null | pymodel/TestSuite.py | Python3pkg/PyModel | e0d404e122202c25c85dcebedcbd567837068b65 | [
"BSD-3-Clause"
] | null | null | null | """
Interface to a test suite module (one or more runs) used by ProductModelProgram
"""
from operator import concat
from .model import Model
from functools import reduce
class TestSuite(Model):
def __init__(self, module, exclude, include):
Model.__init__(self, module, exclude, include)
def post_init(self):
... | 34.268908 | 79 | 0.660128 |
from operator import concat
from .model import Model
from functools import reduce
class TestSuite(Model):
def __init__(self, module, exclude, include):
Model.__init__(self, module, exclude, include)
def post_init(self):
if hasattr(self.module, 'testsuite'):
self.module.testSuite = ... | true | true |
f709b422a4a86fca2bfa9d6d75f29ff165ea07aa | 2,764 | py | Python | eth/vm/forks/byzantium/__init__.py | dylanjw/py-evm | c78020fe0cf6b4d98b93264872dfd10c59757e06 | [
"MIT"
] | 5 | 2018-09-28T20:01:42.000Z | 2022-02-22T19:54:46.000Z | env/lib/python3.7/site-packages/eth/vm/forks/byzantium/__init__.py | kpeluso/vyper-dynamic-array | fb18070650c6fafeca9d3ab99d667147a4b3acc4 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/eth/vm/forks/byzantium/__init__.py | kpeluso/vyper-dynamic-array | fb18070650c6fafeca9d3ab99d667147a4b3acc4 | [
"MIT"
] | 1 | 2019-02-27T21:29:16.000Z | 2019-02-27T21:29:16.000Z | from typing import ( # noqa: F401
Type,
)
from cytoolz import (
curry,
)
from eth_utils import (
encode_hex,
ValidationError,
)
from eth.constants import (
MAX_UNCLE_DEPTH,
)
from eth.rlp.blocks import BaseBlock # noqa: F401
from eth.rlp.receipts import Receipt
from eth.validation import (
... | 29.094737 | 90 | 0.736614 | from typing import (
Type,
)
from cytoolz import (
curry,
)
from eth_utils import (
encode_hex,
ValidationError,
)
from eth.constants import (
MAX_UNCLE_DEPTH,
)
from eth.rlp.blocks import BaseBlock
from eth.rlp.receipts import Receipt
from eth.validation import (
validate_lte,
)
from eth... | true | true |
f709b5200ed53cfbc4b378054a4d8839207369cc | 740 | py | Python | setup.py | 29next/next-theme-kit | 8abe7234c0fcf8af6004385ee28d9fb29bcaef9c | [
"MIT"
] | 7 | 2021-05-26T11:57:20.000Z | 2021-06-13T09:57:46.000Z | setup.py | 29next/next-theme-kit | 8abe7234c0fcf8af6004385ee28d9fb29bcaef9c | [
"MIT"
] | 1 | 2021-05-25T00:11:16.000Z | 2021-05-25T02:18:56.000Z | setup.py | 29next/theme-kit | 8abe7234c0fcf8af6004385ee28d9fb29bcaef9c | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
__version__ = '1.0.1'
tests_require = [
"flake8==3.9.2",
"nose==1.3.7"
]
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='next-theme-kit',
author="29next",
author_email="dev@29next.com",
url='https://github.com/29ne... | 20.555556 | 50 | 0.590541 | from setuptools import find_packages, setup
__version__ = '1.0.1'
tests_require = [
"flake8==3.9.2",
"nose==1.3.7"
]
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='next-theme-kit',
author="29next",
author_email="dev@29next.com",
url='https://github.com/29ne... | true | true |
f709b5d4d2e798dbd11856e6f3b5f1768f57e8b8 | 6,050 | py | Python | tests/test_parser.py | dbrattli/Expression | 1cf04ccd5d5e277baea7113c3b420a85f22712b5 | [
"MIT"
] | 22 | 2020-11-03T03:17:12.000Z | 2020-11-28T07:02:38.000Z | tests/test_parser.py | dbrattli/Expression | 1cf04ccd5d5e277baea7113c3b420a85f22712b5 | [
"MIT"
] | null | null | null | tests/test_parser.py | dbrattli/Expression | 1cf04ccd5d5e277baea7113c3b420a85f22712b5 | [
"MIT"
] | 1 | 2020-11-08T13:24:32.000Z | 2020-11-08T13:24:32.000Z | from __future__ import annotations
import string
from dataclasses import dataclass
from typing import Any, Tuple
from expression import Error, Nothing, Ok, Option, Some, TaggedUnion, match, pipe, tag
from expression.collections import Block
from expression.extra.parser import (
Parser,
and_then,
any_of,
... | 22.242647 | 86 | 0.561322 | from __future__ import annotations
import string
from dataclasses import dataclass
from typing import Any, Tuple
from expression import Error, Nothing, Ok, Option, Some, TaggedUnion, match, pipe, tag
from expression.collections import Block
from expression.extra.parser import (
Parser,
and_then,
any_of,
... | true | true |
f709b65418dc777da8e49db95809cebc85771242 | 400 | py | Python | 2017-08-23/exemplo_servidor_django/meuprojeto/petshop/migrations/0003_animal_dono.py | dunossauro/bora_falar_de_python | 7fe92d6257a2cad1c570255bc9be069f6c8e38d3 | [
"Apache-2.0"
] | 6 | 2017-09-07T20:24:48.000Z | 2018-09-12T16:16:32.000Z | 2017-08-23/exemplo_servidor_django/meuprojeto/petshop/migrations/0003_animal_dono.py | dunossauro/bora_falar_de_python | 7fe92d6257a2cad1c570255bc9be069f6c8e38d3 | [
"Apache-2.0"
] | 1 | 2017-12-22T01:47:12.000Z | 2017-12-24T13:59:13.000Z | 2017-08-23/exemplo_servidor_django/meuprojeto/petshop/migrations/0003_animal_dono.py | dunossauro/bora_falar_de_python | 7fe92d6257a2cad1c570255bc9be069f6c8e38d3 | [
"Apache-2.0"
] | 6 | 2017-10-20T01:25:01.000Z | 2018-09-11T22:54:01.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('petshop', '0002_dono'),
]
operations = [
migrations.AddField(
model_name='animal',
name='dono',
... | 20 | 66 | 0.5875 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('petshop', '0002_dono'),
]
operations = [
migrations.AddField(
model_name='animal',
name='dono',
field=models.Fo... | true | true |
f709b6ad81d25a0c074deaa1308cf04158654f02 | 1,373 | py | Python | tests/book/ch05/classify_name.py | TITC/pyhanlp | ad062f358805da5bf97f78d9f37f441c06ae4d19 | [
"Apache-2.0"
] | null | null | null | tests/book/ch05/classify_name.py | TITC/pyhanlp | ad062f358805da5bf97f78d9f37f441c06ae4d19 | [
"Apache-2.0"
] | null | null | null | tests/book/ch05/classify_name.py | TITC/pyhanlp | ad062f358805da5bf97f78d9f37f441c06ae4d19 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author:hankcs
# Date: 2018-06-21 19:46
# 《自然语言处理入门》5.3 基于感知机的人名性别分类
# 配套书籍:http://nlp.hankcs.com/book.php
# 讨论答疑:https://bbs.hankcs.com/
import sys,os# environment, adjust the priority
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))... | 38.138889 | 112 | 0.718864 |
import sys,os
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
from pyhanlp import *
from tests.test_utility import ensure_data
PerceptronNameGenderClassifier = JClass('com.hankcs.hanlp.model.perceptron.PerceptronNameGenderClassifier')
cnname = ens... | true | true |
f709b7b4e48264871c1d14816252623fa84ae826 | 579 | py | Python | pepdb/core/migrations/0143_auto_20180403_1255.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 7 | 2015-12-21T03:52:46.000Z | 2020-07-24T19:17:23.000Z | pepdb/core/migrations/0143_auto_20180403_1255.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 12 | 2016-03-05T18:11:05.000Z | 2021-06-17T20:20:03.000Z | pepdb/core/migrations/0143_auto_20180403_1255.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 4 | 2016-07-17T20:19:38.000Z | 2021-03-23T12:47:20.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-03 09:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0142_auto_20180301_2143'),
]
operations =... | 26.318182 | 142 | 0.661485 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0142_auto_20180301_2143'),
]
operations = [
migrations.AlterField(
model_name='declaration',
... | true | true |
f709b7e141af88e2c6bddfcf36ef2b4d97d0b978 | 4,567 | py | Python | app/hrcm/classes/candidate.py | bastienbot/hr-challenges-manager | 1fe8e4fa34f6866a724c2461bc17cc442fe50a4c | [
"MIT"
] | null | null | null | app/hrcm/classes/candidate.py | bastienbot/hr-challenges-manager | 1fe8e4fa34f6866a724c2461bc17cc442fe50a4c | [
"MIT"
] | null | null | null | app/hrcm/classes/candidate.py | bastienbot/hr-challenges-manager | 1fe8e4fa34f6866a724c2461bc17cc442fe50a4c | [
"MIT"
] | null | null | null | import os
import json
from datetime import datetime
from .challenge import Challenge
from hrcm.services.db import DBConnector
from hrcm.errors.bad_request import BadRequest
from hrcm.helpers import format_username, format_message
class Candidate:
"""
@desc We prepare all the instance parameters along side th... | 31.496552 | 101 | 0.640245 | import os
import json
from datetime import datetime
from .challenge import Challenge
from hrcm.services.db import DBConnector
from hrcm.errors.bad_request import BadRequest
from hrcm.helpers import format_username, format_message
class Candidate:
def __init__(self, informations):
self._id = informations.... | true | true |
f709b80e5f1c7707c4509530ecca4a245f8ec708 | 3,847 | py | Python | tests/PySys/environments/environment_c8y.py | PradeepKiruvale/localworkflow | b5f3c97c835cb36ae87f14b8697bedcca5d22619 | [
"Apache-2.0"
] | 6 | 2021-09-14T10:14:15.000Z | 2021-11-20T13:42:26.000Z | tests/PySys/environments/environment_c8y.py | PradeepKiruvale/localworkflow | b5f3c97c835cb36ae87f14b8697bedcca5d22619 | [
"Apache-2.0"
] | null | null | null | tests/PySys/environments/environment_c8y.py | PradeepKiruvale/localworkflow | b5f3c97c835cb36ae87f14b8697bedcca5d22619 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import re
import requests
import psutil
from pysys.basetest import BaseTest
from pysys.constants import FAILED
from cumulocity import Cumulocity
from environment_tedge import TedgeEnvironment
"""
Environment to manage automated connects and disconnects to c8y
"""
class EnvironmentC8y(Ted... | 29.592308 | 95 | 0.593709 | import base64
import json
import re
import requests
import psutil
from pysys.basetest import BaseTest
from pysys.constants import FAILED
from cumulocity import Cumulocity
from environment_tedge import TedgeEnvironment
class EnvironmentC8y(TedgeEnvironment):
cumulocity: Cumulocity
def setup(self):
... | true | true |
f709b828175fdc3722692be33dce392102dcbe34 | 416 | py | Python | examples/compile-only.p4app/main.py | serhatarslan-hub/p4app | 6ac7e769ee2e73382c32c96dfff8729e46b51431 | [
"Apache-2.0"
] | null | null | null | examples/compile-only.p4app/main.py | serhatarslan-hub/p4app | 6ac7e769ee2e73382c32c96dfff8729e46b51431 | [
"Apache-2.0"
] | null | null | null | examples/compile-only.p4app/main.py | serhatarslan-hub/p4app | 6ac7e769ee2e73382c32c96dfff8729e46b51431 | [
"Apache-2.0"
] | 2 | 2021-05-19T16:36:42.000Z | 2021-11-01T21:35:51.000Z | from p4app import P4Program
import json
# Compile a P4_16 program:
prog16 = P4Program('wire.p4')
prog16.compile()
# Inspect the compiled JSON file
with open(prog16.json(), 'r') as f:
bmv2_json = json.load(f)
#print bmv2_json['actions']
# Compile a P4_14 program:
prog14 = P4Program('wire14.p4', version=14)
p... | 18.086957 | 43 | 0.689904 | from p4app import P4Program
import json
prog16 = P4Program('wire.p4')
prog16.compile()
with open(prog16.json(), 'r') as f:
bmv2_json = json.load(f)
prog14 = P4Program('wire14.p4', version=14)
prog14.compile()
with open(prog14.json(), 'r') as f:
bmv2_json = json.load(f)
print("OK")
| true | true |
f709b82b33a33885a4357d82d763d405a1fc0a14 | 4,267 | py | Python | pyretrace/reader.py | probablyodd/pyretrace | a65f456597514e8a845ff4ad50deeca1acc13245 | [
"BSD-2-Clause-FreeBSD"
] | 20 | 2015-10-27T08:17:32.000Z | 2022-03-13T09:43:30.000Z | pyretrace/reader.py | probablyodd/pyretrace | a65f456597514e8a845ff4ad50deeca1acc13245 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | pyretrace/reader.py | probablyodd/pyretrace | a65f456597514e8a845ff4ad50deeca1acc13245 | [
"BSD-2-Clause-FreeBSD"
] | 8 | 2015-12-28T18:52:09.000Z | 2021-01-06T10:13:35.000Z | from __future__ import print_function
import sys
class MappingReader():
def __init__(self, mapping_file):
self.mapping_file = mapping_file
def pump(self, mapping_processor):
reader = open(self.mapping_file, 'r')
try:
class_name = None
# Read the subsequent ... | 37.429825 | 102 | 0.542536 | from __future__ import print_function
import sys
class MappingReader():
def __init__(self, mapping_file):
self.mapping_file = mapping_file
def pump(self, mapping_processor):
reader = open(self.mapping_file, 'r')
try:
class_name = None
while Tru... | true | true |
f709b83b7dd0d4dc8f2ed9be76428c1683165b7d | 1,895 | py | Python | luafun/game/config.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 1 | 2021-02-06T06:42:29.000Z | 2021-02-06T06:42:29.000Z | luafun/game/config.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 6 | 2021-04-08T21:46:06.000Z | 2021-05-09T01:40:04.000Z | luafun/game/config.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | null | null | null | import os
EXECUTABLE_PATH_WINDOWS = '/game/bin/win64/dota2.exe'
EXECUTABLE_PATH_LINUX = '/game/dota.sh'
EXECUTABLE_PATH_LINUX = '/game/bin/linuxsteamrt64/dota2'
BOT_PATH = '/game/dota/scripts/vscripts/bots/'
CONSOLE_LOG = '/game/dota/scripts/vscripts/bots/console.log'
SEND_MSG = '/game/dota/scripts/vscripts/bots/IPC_... | 28.712121 | 81 | 0.667018 | import os
EXECUTABLE_PATH_WINDOWS = '/game/bin/win64/dota2.exe'
EXECUTABLE_PATH_LINUX = '/game/dota.sh'
EXECUTABLE_PATH_LINUX = '/game/bin/linuxsteamrt64/dota2'
BOT_PATH = '/game/dota/scripts/vscripts/bots/'
CONSOLE_LOG = '/game/dota/scripts/vscripts/bots/console.log'
SEND_MSG = '/game/dota/scripts/vscripts/bots/IPC_... | true | true |
f709b94b5dc3cc9000a3be6044866aa2ad321e0c | 1,671 | py | Python | emet/hypothesis/generate_dictionary.py | stephanefschwarz/EMET | 92ab8b0a53bbdfe5618353f0055eba98ae93f53f | [
"MIT"
] | 3 | 2020-05-19T19:45:06.000Z | 2021-03-21T03:59:19.000Z | emet/hypothesis/generate_dictionary.py | stephanefschwarz/EMET | 92ab8b0a53bbdfe5618353f0055eba98ae93f53f | [
"MIT"
] | null | null | null | emet/hypothesis/generate_dictionary.py | stephanefschwarz/EMET | 92ab8b0a53bbdfe5618353f0055eba98ae93f53f | [
"MIT"
] | 2 | 2021-03-21T04:36:58.000Z | 2022-01-31T07:29:49.000Z | import sys
import pandas as pd
import requests
import nltk
nltk.download('stopwords')
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
# --- open dataset --- #
data = pd.read_csv('./dataset/translated_twitter_posts.csv')
documents = data['translated_posts']
#... | 28.810345 | 105 | 0.617594 | import sys
import pandas as pd
import requests
import nltk
nltk.download('stopwords')
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
data = pd.read_csv('./dataset/translated_twitter_posts.csv')
documents = data['translated_posts']
premises = []
tokenizer ... | true | true |
f709b9bf5ba6566862a18830554448f31ea2f564 | 20,398 | py | Python | hs_labels/models.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_labels/models.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_labels/models.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | """
This model supports user labeling of resources in various ways.
For a User u, this instantiates a subobject u.ulabels (like u.uaccess)
that contains all the labeling functions.
Functions include:
* u.ulabels.label_resource(r, label)
instantiates a label for a resource. Resources can have multiple labels.
... | 38.779468 | 110 | 0.595402 |
import re
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.db.models import Q
from hs_core.models import BaseResource
class FlagCodes(object):
FAVORITE = 1
MINE = 2
OPEN_WITH_APP = 3
FLAG_CHOICES = (
(FAVORITE, 'Favorite'... | true | true |
f709ba30f2ddb928e1e17aeebb2ecdb73dfac7e8 | 5,549 | py | Python | official/nlp/bert/run_squad.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 2 | 2020-12-11T04:07:55.000Z | 2020-12-11T04:08:11.000Z | official/nlp/bert/run_squad.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | null | null | null | official/nlp/bert/run_squad.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 3 | 2021-02-22T13:24:07.000Z | 2021-02-26T02:06:24.000Z | # Copyright 2019 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... | 36.267974 | 80 | 0.73707 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import time
from absl import app
from absl import flags
from absl import logging
import gin
import tensorflow as tf
from official.common import distribute_utils
from offic... | true | true |
f709ba80071c7ed33b34ab298cb31c2a7898803c | 2,292 | py | Python | mininet_topology/Topo10hosts&router/Topo10.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | 3 | 2021-01-11T11:08:09.000Z | 2021-03-28T01:02:50.000Z | mininet_topology/Topo10hosts&router/Topo10.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | 10 | 2020-12-25T10:30:25.000Z | 2021-05-17T13:09:32.000Z | mininet_topology/Topo10hosts&router/Topo10.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogL... | 27.614458 | 117 | 0.637871 |
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from m... | true | true |
f709bae64888c279d680e86fbedd96c227f6f4d8 | 9,085 | py | Python | plaidrl/torch/smac/launcher.py | charliec443/plaid-rl | 2e8fbf389af9efecd41361df80e40e0bf932056d | [
"MIT"
] | null | null | null | plaidrl/torch/smac/launcher.py | charliec443/plaid-rl | 2e8fbf389af9efecd41361df80e40e0bf932056d | [
"MIT"
] | null | null | null | plaidrl/torch/smac/launcher.py | charliec443/plaid-rl | 2e8fbf389af9efecd41361df80e40e0bf932056d | [
"MIT"
] | null | null | null | import pickle
import plaidrl.torch.pytorch_util as ptu
from plaidrl.core import logger
from plaidrl.core.meta_rl_algorithm import MetaRLAlgorithm
from plaidrl.core.simple_offline_rl_algorithm import OfflineMetaRLAlgorithm
from plaidrl.data_management.env_replay_buffer import EnvReplayBuffer
from plaidrl.demos.source.m... | 36.633065 | 86 | 0.716346 | import pickle
import plaidrl.torch.pytorch_util as ptu
from plaidrl.core import logger
from plaidrl.core.meta_rl_algorithm import MetaRLAlgorithm
from plaidrl.core.simple_offline_rl_algorithm import OfflineMetaRLAlgorithm
from plaidrl.data_management.env_replay_buffer import EnvReplayBuffer
from plaidrl.demos.source.m... | true | true |
f709bb26c60915265cade2b384fdde8847a123c3 | 1,070 | py | Python | messenger/migrations/0001_initial.py | lucida-no/hdo-quiz-service | 32e03165e8d495f1290edd2b96cc1cba415f9799 | [
"BSD-3-Clause"
] | null | null | null | messenger/migrations/0001_initial.py | lucida-no/hdo-quiz-service | 32e03165e8d495f1290edd2b96cc1cba415f9799 | [
"BSD-3-Clause"
] | 13 | 2017-01-01T23:23:29.000Z | 2017-05-27T11:15:38.000Z | messenger/migrations/0001_initial.py | lucida-no/hdo-messenger-backend | 32e03165e8d495f1290edd2b96cc1cba415f9799 | [
"BSD-3-Clause"
] | 1 | 2017-01-01T16:32:30.000Z | 2017-01-01T16:32:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-03-05 13:47
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.C... | 34.516129 | 151 | 0.614019 |
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ChatSession',
fields=[
... | true | true |
f709bc9106901d8180f4e8a8ab96e5dcd594d6f5 | 7,740 | py | Python | community/migrations/0001_squashed_0004_auto_20170831_0541.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 911 | 2015-01-03T22:16:06.000Z | 2022-03-31T23:56:22.000Z | community/migrations/0001_squashed_0004_auto_20170831_0541.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 1,342 | 2015-01-02T16:14:45.000Z | 2022-03-28T08:01:20.000Z | community/migrations/0001_squashed_0004_auto_20170831_0541.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 551 | 2015-01-04T02:17:31.000Z | 2022-03-23T11:59:25.000Z | # Generated by Django 1.9.13 on 2017-08-31 05:44
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import markupfield.fields
class Migration(migrations.Migration):
replaces = [('comm... | 59.083969 | 217 | 0.613824 |
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import markupfield.fields
class Migration(migrations.Migration):
replaces = [('community', '0001_initial'), ('community', '0002_aut... | true | true |
f709bea1e2a5cc19ce8c1b6caa6b04ad1d2ec215 | 3,976 | py | Python | test/unit/test_crypto_encryption_decryptor.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 95 | 2018-08-20T23:10:00.000Z | 2022-02-17T02:54:32.000Z | test/unit/test_crypto_encryption_decryptor.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 220 | 2018-08-01T20:56:29.000Z | 2022-03-28T18:12:35.000Z | test/unit/test_crypto_encryption_decryptor.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 63 | 2018-08-01T19:37:33.000Z | 2022-03-20T17:14:15.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 40.161616 | 118 | 0.788229 |
import pytest
from mock import MagicMock, sentinel
from pytest_mock import mocker
import aws_encryption_sdk.internal.crypto.encryption
from aws_encryption_sdk.internal.crypto.encryption import Decryptor, decrypt
pytestmark = [pytest.mark.unit, pytest.mark.local]
@pytest.fixture
def patch_default_backe... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.