hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1c945b747d795be0c6f5c34e1d5bbb56c2a6a3 | 1,306 | py | Python | venv/Lib/site-packages/transliterate/discover.py | jedeland/jedel_name_generator | 8d220c7e6a13e013d9664402cb0262f323a4056d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/transliterate/discover.py | jedeland/jedel_name_generator | 8d220c7e6a13e013d9664402cb0262f323a4056d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/transliterate/discover.py | jedeland/jedel_name_generator | 8d220c7e6a13e013d9664402cb0262f323a4056d | [
"MIT"
] | null | null | null | import os
from six import print_
try:
from importlib import import_module
except ImportError:
import_module = __import__
from .conf import get_setting
from .helpers import PROJECT_DIR
__title__ = 'transliterate.discover'
__author__ = 'Artur Barseghyan'
__copyright__ = '2013-2018 Artur Barseghyan'
__license_... | 28.391304 | 72 | 0.591118 | import os
from six import print_
try:
from importlib import import_module
except ImportError:
import_module = __import__
from .conf import get_setting
from .helpers import PROJECT_DIR
__title__ = 'transliterate.discover'
__author__ = 'Artur Barseghyan'
__copyright__ = '2013-2018 Artur Barseghyan'
__license_... | true | true |
1c1c94775e2960190f04f65d60ef0b01a0974029 | 1,248 | py | Python | python/stock/chap02/ImageProcessing.py | gangserver/py_test | 869bdfa5c94c3b6a15b87e0c3de6b2cdaca821f4 | [
"Apache-2.0"
] | null | null | null | python/stock/chap02/ImageProcessing.py | gangserver/py_test | 869bdfa5c94c3b6a15b87e0c3de6b2cdaca821f4 | [
"Apache-2.0"
] | null | null | null | python/stock/chap02/ImageProcessing.py | gangserver/py_test | 869bdfa5c94c3b6a15b87e0c3de6b2cdaca821f4 | [
"Apache-2.0"
] | null | null | null | import requests
# url = 'http://bit.ly/2JnsHnT'
url = 'https://raw.githubusercontent.com/gangserver/pydev/main/net/dasom/python/stock/chap02/imgs/src.png'
r = requests.get(url, stream=True).raw
from PIL import Image
img = Image.open(r)
print("img : {}".format(img.get_format_mimetype))
img.show()
img.save('src.png')
... | 21.894737 | 106 | 0.673077 | import requests
url = 'https://raw.githubusercontent.com/gangserver/pydev/main/net/dasom/python/stock/chap02/imgs/src.png'
r = requests.get(url, stream=True).raw
from PIL import Image
img = Image.open(r)
print("img : {}".format(img.get_format_mimetype))
img.show()
img.save('src.png')
import shutil
shutil.copy('... | true | true |
1c1c9535192a7b60f0cd558ed534e8a53031e608 | 1,279 | py | Python | wheezy_extractor/__init__.py | Polsaker/wheezy_extractor | 586e19ec4c4be93548f3bc572c62569397b8f02f | [
"MIT"
] | null | null | null | wheezy_extractor/__init__.py | Polsaker/wheezy_extractor | 586e19ec4c4be93548f3bc572c62569397b8f02f | [
"MIT"
] | null | null | null | wheezy_extractor/__init__.py | Polsaker/wheezy_extractor | 586e19ec4c4be93548f3bc572c62569397b8f02f | [
"MIT"
] | null | null | null | import re
def extract_wheezy(fileobj, keywords, comment_tags, options):
"""Extract messages from Wheezy files.
:param fileobj: the file-like object the messages should be extracted
from
:param keywords: a list of keywords (i.e. function names) that should
be recog... | 37.617647 | 95 | 0.526192 | import re
def extract_wheezy(fileobj, keywords, comment_tags, options):
funcs = "|".join(keywords)
regex = re.compile(r"(?P<function>" + funcs + r")\('([^\'\\]*(?:\\.[^\'\\]*)*)',?.*?\)")
regex2 = re.compile(r"(?P<function>" + funcs + r")\(\"([^\"\\]*(?:\\.[^\"\\]*)*)\",?.*?\)")
data = fileobj.read().... | true | true |
1c1c96f2fc91bbae1b2694b3ba075f2e5b018d2d | 11,055 | py | Python | kaffe/tensorflow/network.py | Shanlans/tensorflow-deeplab-resnet | 6d1035221b67fed81058bf84c96e56d8f4e62a89 | [
"MIT"
] | null | null | null | kaffe/tensorflow/network.py | Shanlans/tensorflow-deeplab-resnet | 6d1035221b67fed81058bf84c96e56d8f4e62a89 | [
"MIT"
] | null | null | null | kaffe/tensorflow/network.py | Shanlans/tensorflow-deeplab-resnet | 6d1035221b67fed81058bf84c96e56d8f4e62a89 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import pdb
slim = tf.contrib.slim
DEFAULT_PADDING = 'SAME'
def layer(op):
'''Decorator for composable network layers.'''
def layer_decorated(self, *args, **kwargs):
# Automatically set a name if not provided.
name = kwargs.setdefault('name', self.g... | 39.623656 | 96 | 0.540932 | import numpy as np
import tensorflow as tf
import pdb
slim = tf.contrib.slim
DEFAULT_PADDING = 'SAME'
def layer(op):
def layer_decorated(self, *args, **kwargs):
name = kwargs.setdefault('name', self.get_unique_name(op.__name__))
if len(self.terminals) == 0:
raise R... | true | true |
1c1c98277ca355c3096ff68556b8953be007a17f | 3,070 | py | Python | amy/api/renderers.py | gaybro8777/amy | 3cf99aed58a0f0acf83d2645a30d8408208ccea9 | [
"MIT"
] | null | null | null | amy/api/renderers.py | gaybro8777/amy | 3cf99aed58a0f0acf83d2645a30d8408208ccea9 | [
"MIT"
] | null | null | null | amy/api/renderers.py | gaybro8777/amy | 3cf99aed58a0f0acf83d2645a30d8408208ccea9 | [
"MIT"
] | null | null | null | from rest_framework_csv.renderers import CSVRenderer
from api.serializers import (
TrainingRequestWithPersonSerializer,
TrainingRequestForManualScoringSerializer,
)
class TrainingRequestCSVColumns:
translation_labels = {
'created_at': 'Created at',
'last_updated_at': 'Last updated at',
... | 42.054795 | 89 | 0.676873 | from rest_framework_csv.renderers import CSVRenderer
from api.serializers import (
TrainingRequestWithPersonSerializer,
TrainingRequestForManualScoringSerializer,
)
class TrainingRequestCSVColumns:
translation_labels = {
'created_at': 'Created at',
'last_updated_at': 'Last updated at',
... | true | true |
1c1c984007c401da3964bf24391f0a14cb3f2744 | 1,203 | py | Python | setup.py | carbonariy/dvhb-hybrid | adbb250767ea255addc607fb6f6755c9add447db | [
"MIT"
] | 27 | 2018-05-08T16:03:24.000Z | 2020-02-20T06:39:19.000Z | setup.py | carbonariy/dvhb-hybrid | adbb250767ea255addc607fb6f6755c9add447db | [
"MIT"
] | 7 | 2018-10-20T16:03:36.000Z | 2021-11-03T11:09:22.000Z | setup.py | carbonariy/dvhb-hybrid | adbb250767ea255addc607fb6f6755c9add447db | [
"MIT"
] | 16 | 2018-12-11T15:34:22.000Z | 2022-01-25T00:20:55.000Z | import re
from pathlib import Path
from setuptools import setup, find_packages
with Path(__file__).with_name('dvhb_hybrid').joinpath('__init__.py').open() as f:
VERSION = re.compile(r'.*__version__ = \'(.*?)\'', re.S).match(f.read()).group(1)
setup(
name='dvhb-hybrid',
version=VERSION,
description='... | 26.152174 | 85 | 0.57606 | import re
from pathlib import Path
from setuptools import setup, find_packages
with Path(__file__).with_name('dvhb_hybrid').joinpath('__init__.py').open() as f:
VERSION = re.compile(r'.*__version__ = \'(.*?)\'', re.S).match(f.read()).group(1)
setup(
name='dvhb-hybrid',
version=VERSION,
description='... | true | true |
1c1c99db87c85f360d1b599ba3d394d99353d53b | 17,978 | py | Python | graalpython/com.oracle.graal.python.test/src/tests/cpyext/__init__.py | cmueh/graalpython | 4267e1be9d36377d6ccb5911d5404e9d77011211 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | graalpython/com.oracle.graal.python.test/src/tests/cpyext/__init__.py | cmueh/graalpython | 4267e1be9d36377d6ccb5911d5404e9d77011211 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | graalpython/com.oracle.graal.python.test/src/tests/cpyext/__init__.py | cmueh/graalpython | 4267e1be9d36377d6ccb5911d5404e9d77011211 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
#
# Subject to the condition set forth below, permission is hereby granted to any
# person obtaining a copy of this software, a... | 30.996552 | 138 | 0.582156 |
import sys
from importlib import invalidate_caches
from string import Formatter
os = sys.modules.get("posix", sys.modules.get("nt", None))
if os is None:
raise ImportError("posix or nt module is required in builtin modules")
__dir__ = __file__.rpartition("/")[0]
GRAALPYTHON =... | true | true |
1c1c9c28e0acd0b0c6688a622d51f434b998781c | 9,251 | py | Python | libbrook/apis/tokens_api.py | doalitic/libbrook | 9f34bfbfa1f7513ca6681a0a5566f2434edb77eb | [
"Apache-2.0"
] | null | null | null | libbrook/apis/tokens_api.py | doalitic/libbrook | 9f34bfbfa1f7513ca6681a0a5566f2434edb77eb | [
"Apache-2.0"
] | null | null | null | libbrook/apis/tokens_api.py | doalitic/libbrook | 9f34bfbfa1f7513ca6681a0a5566f2434edb77eb | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
TokensApi.py
Copyright 2016 SmartBear Software
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... | 34.778195 | 118 | 0.538969 |
from __future__ import absolute_import
import sys
import os
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class TokensApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
self.api_clie... | true | true |
1c1c9c9e9b93d7d49cb4d65c13cb6054a8cb8e3c | 3,606 | py | Python | components/gcp/container/component_sdk/python/kfp_component/core/_display.py | 15379180/pipelines | 589c905b426062d4b8ee9bf47855c1d5e87bb749 | [
"Apache-2.0"
] | 102 | 2019-10-23T20:35:41.000Z | 2022-03-27T10:28:56.000Z | components/gcp/container/component_sdk/python/kfp_component/core/_display.py | 15379180/pipelines | 589c905b426062d4b8ee9bf47855c1d5e87bb749 | [
"Apache-2.0"
] | 1,932 | 2021-01-25T11:23:37.000Z | 2022-03-31T17:10:18.000Z | components/gcp/container/component_sdk/python/kfp_component/core/_display.py | 15379180/pipelines | 589c905b426062d4b8ee9bf47855c1d5e87bb749 | [
"Apache-2.0"
] | 85 | 2019-10-24T04:04:36.000Z | 2022-03-01T10:52:57.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.820513 | 94 | 0.645313 |
import os
import json
import threading
import logging
_OUTPUT_PATH = os.environ.get('KFP_UI_METADATA_PATH', '/mlpipeline-ui-metadata.json')
_OUTPUT_FILE_LOCK = threading.Lock()
def display(obj):
obj_dir = dir(obj)
if '_repr_markdown_' in obj_dir:
display_markdown(obj)
if '_repr_kfpm... | true | true |
1c1c9cd82d52c5bddefc3173c1287416d11e454c | 16,026 | py | Python | 99Z-ARCHIVE/app-2020-0803-0610-AA-TYJ.py | eande-jasonc1025/RoboQuest-RnD-FlaskVideoStream_MiguelGrinberg_GpioZero-RPi | 042520274617b66ce96d2ead313bab65f31f9781 | [
"MIT"
] | null | null | null | 99Z-ARCHIVE/app-2020-0803-0610-AA-TYJ.py | eande-jasonc1025/RoboQuest-RnD-FlaskVideoStream_MiguelGrinberg_GpioZero-RPi | 042520274617b66ce96d2ead313bab65f31f9781 | [
"MIT"
] | null | null | null | 99Z-ARCHIVE/app-2020-0803-0610-AA-TYJ.py | eande-jasonc1025/RoboQuest-RnD-FlaskVideoStream_MiguelGrinberg_GpioZero-RPi | 042520274617b66ce96d2ead313bab65f31f9781 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
##jwc o #!/usr/bin/env python
# Key Notes
#
# jwc 2020-0519 Convert from Crickit_Adafruit to RoboHat_4tronix
# jwc 2020-0519 Use 'gpiozero' for noise-free servo-control
# jwc Add 'robohat.init()'
# jwc Make sure 'servod' copied in from 'RoboHat' dir
# jwc Using 'ro... | 34.688312 | 138 | 0.634531 |
ort os
import sys
import signal
import threading
import time
import json
from flask import Flask, render_template, request, Response
# jwc n from gevent.wsgi import WSGIServer
# jwc from gevent.pywsgi import WSGIServer
import config as cfg
##jwc o import io_wrapper as hw
import io_wrapper_dummy as hw
## jwc o impor... | true | true |
1c1c9cdbf40eb3a68e1c5c75f5f0c3268f5ab882 | 838 | py | Python | django_messages/urls.py | michaelmior/django-messages | fd48dbfd203459b270007953e6e8f010f985abf1 | [
"BSD-3-Clause"
] | null | null | null | django_messages/urls.py | michaelmior/django-messages | fd48dbfd203459b270007953e6e8f010f985abf1 | [
"BSD-3-Clause"
] | null | null | null | django_messages/urls.py | michaelmior/django-messages | fd48dbfd203459b270007953e6e8f010f985abf1 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls.defaults import *
from django.views.generic import RedirectView
from django_messages.views import *
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='inbox/'), name='messages_redirect'),
url(r'^inbox/$', inbox, name='messages_inbox'),
url(r'^outbox/$', outbox, name='mes... | 46.555556 | 82 | 0.655131 | from django.conf.urls.defaults import *
from django.views.generic import RedirectView
from django_messages.views import *
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='inbox/'), name='messages_redirect'),
url(r'^inbox/$', inbox, name='messages_inbox'),
url(r'^outbox/$', outbox, name='mes... | true | true |
1c1c9de892cbc86bf4d73d982d49b1bbcfeede48 | 2,298 | py | Python | aliyun-python-sdk-airec/aliyunsdkairec/request/v20181012/DescribeSyncReportOutliersRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-airec/aliyunsdkairec/request/v20181012/DescribeSyncReportOutliersRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-airec/aliyunsdkairec/request/v20181012/DescribeSyncReportOutliersRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"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... | 33.304348 | 89 | 0.755875 |
from aliyunsdkcore.request import RoaRequest
from aliyunsdkairec.endpoint import endpoint_data
class DescribeSyncReportOutliersRequest(RoaRequest):
def __init__(self):
RoaRequest.__init__(self, 'Airec', '2018-10-12', 'DescribeSyncReportOutliers','airec')
self.set_uri_pattern('/openapi/instanc... | true | true |
1c1c9e05e14a1923d3c4c3ff0c53ddf26bca7da5 | 871 | py | Python | ml_source/tests/diabetes/scoring/test_scoring_batch.py | GolamRashed/azure-databricks-mlops-mlflow | d1e4a21cb5047213ac0d4c620aac8938048d8168 | [
"MIT"
] | 33 | 2021-06-02T12:57:33.000Z | 2022-03-02T19:21:03.000Z | ml_source/tests/diabetes/scoring/test_scoring_batch.py | GolamRashed/azure-databricks-mlops-mlflow | d1e4a21cb5047213ac0d4c620aac8938048d8168 | [
"MIT"
] | 5 | 2021-09-16T12:35:19.000Z | 2021-12-12T19:20:15.000Z | ml_source/tests/diabetes/scoring/test_scoring_batch.py | GolamRashed/azure-databricks-mlops-mlflow | d1e4a21cb5047213ac0d4c620aac8938048d8168 | [
"MIT"
] | 17 | 2021-06-02T13:11:39.000Z | 2022-03-28T10:08:20.000Z | import os
import unittest
import pandas as pd
from diabetes.scoring.batch.run import batch_scoring
from diabetes.training.evaluate import split_data
from diabetes.training.train import train_model
class TestScoringBatchMethods(unittest.TestCase):
def test_batch_scoring(self):
ridge_args = {"alpha": 0.5}
... | 37.869565 | 84 | 0.718714 | import os
import unittest
import pandas as pd
from diabetes.scoring.batch.run import batch_scoring
from diabetes.training.evaluate import split_data
from diabetes.training.train import train_model
class TestScoringBatchMethods(unittest.TestCase):
def test_batch_scoring(self):
ridge_args = {"alpha": 0.5}
... | true | true |
1c1c9e768b699ee086dfce25a5c59847e143afde | 1,395 | py | Python | config/middleware.py | mitchellp0709/masonite-todo-backend | 06b8187e054e485cf585a5ef127e741b3ba61ac0 | [
"MIT"
] | null | null | null | config/middleware.py | mitchellp0709/masonite-todo-backend | 06b8187e054e485cf585a5ef127e741b3ba61ac0 | [
"MIT"
] | null | null | null | config/middleware.py | mitchellp0709/masonite-todo-backend | 06b8187e054e485cf585a5ef127e741b3ba61ac0 | [
"MIT"
] | null | null | null | """Middleware Configuration Settings."""
from masonite.middleware import (
ResponseMiddleware,
MaintenanceModeMiddleware,
GuardMiddleware,
)
from app.http.middleware.AuthenticationMiddleware import AuthenticationMiddleware
from app.http.middleware.CsrfMiddleware import CsrfMiddleware
from app.http.middlew... | 30.326087 | 85 | 0.765591 |
from masonite.middleware import (
ResponseMiddleware,
MaintenanceModeMiddleware,
GuardMiddleware,
)
from app.http.middleware.AuthenticationMiddleware import AuthenticationMiddleware
from app.http.middleware.CsrfMiddleware import CsrfMiddleware
from app.http.middleware.LoadUserMiddleware import LoadUserMid... | true | true |
1c1c9f4969bed9daa1b925937470296c292c6190 | 2,586 | py | Python | fie/container.py | tz70s/docker-mn | 0ec19dac673beb6cb23c2adfdeb7fd59318f1896 | [
"MIT"
] | 1 | 2018-08-28T06:47:21.000Z | 2018-08-28T06:47:21.000Z | fie/container.py | tz70s/docker-mn | 0ec19dac673beb6cb23c2adfdeb7fd59318f1896 | [
"MIT"
] | 12 | 2017-08-10T08:28:53.000Z | 2021-09-23T23:21:50.000Z | fie/container.py | tz70s/fie | 0ec19dac673beb6cb23c2adfdeb7fd59318f1896 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
This work targets for emulating fog computing infrastructure and fog service and network evaluation.
Original author Tzu-Chiao Yeh (@tz70s), 2017@National Taiwan University, Dependable Distributed System and Network Lab.
Checkout the License for using, modifying and publishing.
"""
from subproce... | 33.153846 | 149 | 0.634571 |
from subprocess import call
from subprocess import STDOUT, Popen, PIPE
import os
import docker
import json
class Container(object):
def __init__(self, docker_client, image, cg_parent, network, name_parent, count, name, **params):
self.docker_client = docker_client
self.image = image
s... | true | true |
1c1c9f82cb97b8a2f4d52b6845cc920834627824 | 15,401 | py | Python | python/tvm/expr.py | stilistik/tvm | 01ec533e7cfb603f6114a763f03dad4c564f589d | [
"Apache-2.0"
] | 6 | 2019-08-29T19:00:57.000Z | 2020-06-15T14:55:16.000Z | python/tvm/expr.py | clhne/tvm | d59320c764bd09474775e1b292f3c05c27743d24 | [
"Apache-2.0"
] | 1 | 2020-10-23T18:56:21.000Z | 2020-10-23T18:56:33.000Z | python/tvm/expr.py | clhne/tvm | d59320c764bd09474775e1b292f3c05c27743d24 | [
"Apache-2.0"
] | 3 | 2018-06-29T17:19:21.000Z | 2020-12-11T07:50:33.000Z | """Expression AST Node in TVM.
User do not need to deal with expression AST node directly.
But they can be helpful for developer to do quick proptyping.
While not displayed in the document and python file.
Each expression node have subfields that can be visited from python side.
For example, you can use addexp.a to g... | 20.001299 | 97 | 0.58691 |
from __future__ import absolute_import as _abs
from ._ffi.node import NodeBase, NodeGeneric, register_node
from . import make as _make
from . import generic as _generic
from . import _api_internal
class ExprOp(object):
def __add__(self, other):
return _generic.add(self, other)
def __radd__(self, oth... | true | true |
1c1c9f904c6eb5fe1c6acd8627662b5806123760 | 4,177 | py | Python | segmentation_models/__init__.py | gurkan8941/segmentation_models | da1c002f7a9afd25f3d103269bd306338b623777 | [
"MIT"
] | null | null | null | segmentation_models/__init__.py | gurkan8941/segmentation_models | da1c002f7a9afd25f3d103269bd306338b623777 | [
"MIT"
] | null | null | null | segmentation_models/__init__.py | gurkan8941/segmentation_models | da1c002f7a9afd25f3d103269bd306338b623777 | [
"MIT"
] | null | null | null | import os
import functools
from .__version__ import __version__
from . import base
_KERAS_FRAMEWORK_NAME = 'keras'
_TF_KERAS_FRAMEWORK_NAME = 'tf.keras'
_DEFAULT_KERAS_FRAMEWORK = _KERAS_FRAMEWORK_NAME
_KERAS_FRAMEWORK = None
_KERAS_BACKEND = None
_KERAS_LAYERS = None
_KERAS_MODELS = None
_KERAS_UTILS = None
_KERAS_L... | 29.006944 | 103 | 0.718937 | import os
import functools
from .__version__ import __version__
from . import base
_KERAS_FRAMEWORK_NAME = 'keras'
_TF_KERAS_FRAMEWORK_NAME = 'tf.keras'
_DEFAULT_KERAS_FRAMEWORK = _KERAS_FRAMEWORK_NAME
_KERAS_FRAMEWORK = None
_KERAS_BACKEND = None
_KERAS_LAYERS = None
_KERAS_MODELS = None
_KERAS_UTILS = None
_KERAS_L... | true | true |
1c1c9fe3bf8ae0a2ee023fd86f59ea851f7167e3 | 5,000 | py | Python | buildpack/compile.py | tordenist/cf-mendix-buildpack | 5258e53244a9b4d9f81832588124700ca4cf7d6e | [
"Apache-2.0"
] | null | null | null | buildpack/compile.py | tordenist/cf-mendix-buildpack | 5258e53244a9b4d9f81832588124700ca4cf7d6e | [
"Apache-2.0"
] | null | null | null | buildpack/compile.py | tordenist/cf-mendix-buildpack | 5258e53244a9b4d9f81832588124700ca4cf7d6e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import logging
import os
import shutil
import subprocess
import sys
from buildpack import (
appdynamics,
datadog,
java,
mxbuild,
newrelic,
nginx,
runtime,
telegraf,
util,
)
from buildpack.runtime_components import database
from lib.m2ee.version import MXVersio... | 29.069767 | 77 | 0.6542 |
import logging
import os
import shutil
import subprocess
import sys
from buildpack import (
appdynamics,
datadog,
java,
mxbuild,
newrelic,
nginx,
runtime,
telegraf,
util,
)
from buildpack.runtime_components import database
from lib.m2ee.version import MXVersion
BUILDPACK_DIR = os.... | true | true |
1c1ca00edeee4142615ac0390520c74bb301aba3 | 2,408 | py | Python | dask/dataframe/io/tests/test_orc.py | jnolis/dask | ac0f45e9f4ba8ec91a176a0a9c934825a1422b01 | [
"BSD-3-Clause"
] | 1 | 2021-06-20T22:54:53.000Z | 2021-06-20T22:54:53.000Z | dask/dataframe/io/tests/test_orc.py | jnolis/dask | ac0f45e9f4ba8ec91a176a0a9c934825a1422b01 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/tests/test_orc.py | jnolis/dask | ac0f45e9f4ba8ec91a176a0a9c934825a1422b01 | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
import tempfile
from distutils.version import LooseVersion
import pytest
import dask.dataframe as dd
from dask.dataframe import read_orc
from dask.dataframe.optimize import optimize_dataframe_getitem
from dask.dataframe.utils import assert_eq
pytest.importorskip("pyarrow.orc")
# Skip for bro... | 29.012048 | 77 | 0.675664 | import os
import shutil
import tempfile
from distutils.version import LooseVersion
import pytest
import dask.dataframe as dd
from dask.dataframe import read_orc
from dask.dataframe.optimize import optimize_dataframe_getitem
from dask.dataframe.utils import assert_eq
pytest.importorskip("pyarrow.orc")
import pyarro... | true | true |
1c1ca167caa322006714e123f87eadf110a588ea | 1,982 | py | Python | src/collectors/sockstat/test/testsockstat.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 2 | 2015-03-13T05:46:54.000Z | 2015-11-05T15:54:28.000Z | src/collectors/sockstat/test/testsockstat.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 1 | 2019-01-31T01:00:14.000Z | 2019-01-31T01:00:14.000Z | src/collectors/sockstat/test/testsockstat.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 2 | 2019-01-30T23:51:03.000Z | 2020-02-04T19:27:26.000Z | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
except ImportError:
... | 30.492308 | 80 | 0.571645 | true | true | |
1c1ca17f1d337ba69262c8bd3c2431640ff37832 | 2,238 | py | Python | tests/rules/test_apt_get.py | aoeu/DWIM | a3d59e5824cfd7a5195916c1af28fe54dcbbb2c1 | [
"MIT"
] | null | null | null | tests/rules/test_apt_get.py | aoeu/DWIM | a3d59e5824cfd7a5195916c1af28fe54dcbbb2c1 | [
"MIT"
] | null | null | null | tests/rules/test_apt_get.py | aoeu/DWIM | a3d59e5824cfd7a5195916c1af28fe54dcbbb2c1 | [
"MIT"
] | null | null | null | import pytest
from dwim.rules.apt_get import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command, packages', [
(Command(script='vim', stderr='vim: command not found'),
[('vim', 'main'), ('vim-tiny', 'main')]),
(Command(script='sudo vim', stderr='vim: command not found... | 41.444444 | 81 | 0.643432 | import pytest
from dwim.rules.apt_get import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command, packages', [
(Command(script='vim', stderr='vim: command not found'),
[('vim', 'main'), ('vim-tiny', 'main')]),
(Command(script='sudo vim', stderr='vim: command not found... | true | true |
1c1ca2a67e401a902753f4513ac5c528b0192b50 | 157 | py | Python | src/__tests__/generated/test.py | gao03/Paw-cURLImporter | 0393a01dfba2cff8a08373d28312d783b895805c | [
"MIT"
] | 24 | 2015-11-26T17:39:36.000Z | 2021-12-09T16:40:51.000Z | src/__tests__/generated/test.py | gao03/Paw-cURLImporter | 0393a01dfba2cff8a08373d28312d783b895805c | [
"MIT"
] | 17 | 2015-11-26T17:31:25.000Z | 2020-02-17T10:27:40.000Z | src/__tests__/generated/test.py | gao03/Paw-cURLImporter | 0393a01dfba2cff8a08373d28312d783b895805c | [
"MIT"
] | 6 | 2017-04-01T04:08:21.000Z | 2022-01-25T05:05:25.000Z | #! /Library/Frameworks/Python.framework/Versions/2.7/bin/python
import sys
import json
sys.stdout.write(json.dumps({
'args':sys.argv
}).encode('utf-8'))
| 17.444444 | 63 | 0.726115 |
import sys
import json
sys.stdout.write(json.dumps({
'args':sys.argv
}).encode('utf-8'))
| true | true |
1c1ca3415afec4324d1abd117e40ab506bc43b31 | 547 | py | Python | api/migrations/0018_myuser_country.py | nosarthur/ckc00-world | 99f3ff9c98d9b37f53399f874b92629b3795d877 | [
"MIT"
] | 1 | 2020-07-24T20:18:27.000Z | 2020-07-24T20:18:27.000Z | api/migrations/0018_myuser_country.py | nosarthur/ckc00-world | 99f3ff9c98d9b37f53399f874b92629b3795d877 | [
"MIT"
] | 79 | 2018-07-15T20:38:36.000Z | 2021-06-25T15:22:04.000Z | api/migrations/0018_myuser_country.py | nosarthur/ckc00alumni | 99f3ff9c98d9b37f53399f874b92629b3795d877 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-05 22:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cities_light', '0008_city_timezone'),
('api', '0017_remove_myuser_country'),
]
operations = [
migra... | 26.047619 | 132 | 0.645338 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cities_light', '0008_city_timezone'),
('api', '0017_remove_myuser_country'),
]
operations = [
migrations.AddField(
model_name='myuser'... | true | true |
1c1ca3f11095e54ad780f3b5b2f0501054124d96 | 19,879 | py | Python | mogp_emulator/GaussianProcessGPU.py | EXAUQ/mogp-emulator | 9d5772135498bdf5b95b44b4afb065c2c266f899 | [
"MIT"
] | null | null | null | mogp_emulator/GaussianProcessGPU.py | EXAUQ/mogp-emulator | 9d5772135498bdf5b95b44b4afb065c2c266f899 | [
"MIT"
] | null | null | null | mogp_emulator/GaussianProcessGPU.py | EXAUQ/mogp-emulator | 9d5772135498bdf5b95b44b4afb065c2c266f899 | [
"MIT"
] | null | null | null | """
extends GaussianProcess with an (optional) GPU implementation
"""
import os
import re
import numpy as np
from mogp_emulator.Kernel import SquaredExponential, Matern52
from mogp_emulator.MeanFunction import MeanFunction, MeanBase
import mogp_emulator.LibGPGPU as LibGPGPU
from mogp_emulator.GaussianProcess import... | 35.625448 | 103 | 0.616178 |
import os
import re
import numpy as np
from mogp_emulator.Kernel import SquaredExponential, Matern52
from mogp_emulator.MeanFunction import MeanFunction, MeanBase
import mogp_emulator.LibGPGPU as LibGPGPU
from mogp_emulator.GaussianProcess import GaussianProcessBase, PredictResult
class GPUUnavailableError(Runtim... | true | true |
1c1ca4419d737c14f832448e1d2462173b8e5207 | 7,247 | py | Python | pytext/data/bptt_lm_data_handler.py | liaimi/pytext-1 | ac40f3956bb2ef0d05f07e2d6bf18bc808df82e4 | [
"BSD-3-Clause"
] | 2 | 2019-01-24T00:40:45.000Z | 2019-02-09T00:56:43.000Z | pytext/data/bptt_lm_data_handler.py | silky/pytext | 40113ed01fb07714776fdc9e1f187f88c1f9f443 | [
"BSD-3-Clause"
] | 1 | 2019-06-04T08:19:27.000Z | 2019-06-04T08:19:27.000Z | pytext/data/bptt_lm_data_handler.py | silky/pytext | 40113ed01fb07714776fdc9e1f187f88c1f9f443 | [
"BSD-3-Clause"
] | 1 | 2019-10-28T08:25:43.000Z | 2019-10-28T08:25:43.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
import math
from typing import Any, Dict, List
import torch
from pytext.common.constants import DatasetFieldName, DFColumn, VocabMeta
from pytext.config.field_config import FeatureConfig, WordLabelConfig
fro... | 33.706977 | 88 | 0.609356 |
import itertools
import math
from typing import Any, Dict, List
import torch
from pytext.common.constants import DatasetFieldName, DFColumn, VocabMeta
from pytext.config.field_config import FeatureConfig, WordLabelConfig
from pytext.data.featurizer import InputRecord
from pytext.fields import TextFeatureField
from ... | true | true |
1c1ca4aa84ef21cd499ec4832e3522b428c171cb | 739 | py | Python | gdsfactory/tests/test_route_south.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | gdsfactory/tests/test_route_south.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | gdsfactory/tests/test_route_south.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | from pytest_regressions.data_regression import DataRegressionFixture
import gdsfactory as gf
from gdsfactory.component import Component
def test_route_south(
data_regression: DataRegressionFixture, check: bool = True
) -> Component:
c = gf.Component("test_route_south")
cr = c << gf.components.mmi2x2()
... | 26.392857 | 68 | 0.703654 | from pytest_regressions.data_regression import DataRegressionFixture
import gdsfactory as gf
from gdsfactory.component import Component
def test_route_south(
data_regression: DataRegressionFixture, check: bool = True
) -> Component:
c = gf.Component("test_route_south")
cr = c << gf.components.mmi2x2()
... | true | true |
1c1ca84929edef845a90daf7f370bf98f037de4e | 421 | py | Python | QRSMS/initial/migrations/0012_coursesection_section_name.py | Srishti-Ahuja/QRSMS-V1 | 1f2fa82e8ddaeb62e633fcd6a136696355317bba | [
"Apache-2.0"
] | 4 | 2020-06-16T09:42:20.000Z | 2021-11-24T08:18:16.000Z | QRSMS/initial/migrations/0012_coursesection_section_name.py | Srishti-Ahuja/QRSMS-V1 | 1f2fa82e8ddaeb62e633fcd6a136696355317bba | [
"Apache-2.0"
] | 7 | 2021-04-08T21:57:34.000Z | 2022-02-27T06:41:15.000Z | QRSMS/initial/migrations/0012_coursesection_section_name.py | Srishti-Ahuja/QRSMS-V1 | 1f2fa82e8ddaeb62e633fcd6a136696355317bba | [
"Apache-2.0"
] | 7 | 2020-11-29T09:45:44.000Z | 2022-03-30T15:27:33.000Z | # Generated by Django 2.2.7 on 2019-11-22 12:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('initial', '0011_auto_20191122_1748'),
]
operations = [
migrations.AddField(
model_name='coursesection',
name='sectio... | 22.157895 | 74 | 0.617577 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('initial', '0011_auto_20191122_1748'),
]
operations = [
migrations.AddField(
model_name='coursesection',
name='section_name',
field=models.CharField(bla... | true | true |
1c1ca86e91e6a53b3f612f56c9ddd6661f01abab | 379 | py | Python | reports/graphs/__init__.py | cephos/babybuddy | c45e8ef53bbf5d2553989f68f62219b1055142ca | [
"BSD-2-Clause"
] | null | null | null | reports/graphs/__init__.py | cephos/babybuddy | c45e8ef53bbf5d2553989f68f62219b1055142ca | [
"BSD-2-Clause"
] | null | null | null | reports/graphs/__init__.py | cephos/babybuddy | c45e8ef53bbf5d2553989f68f62219b1055142ca | [
"BSD-2-Clause"
] | null | null | null | from .diaperchange_lifetimes import diaperchange_lifetimes # NOQA
from .diaperchange_types import diaperchange_types # NOQA
from .feeding_amounts import feeding_amounts # NOQA
from .feeding_duration import feeding_duration # NOQA
from .sleep_pattern import sleep_pattern # NOQA
from .sleep_totals import sleep_total... | 47.375 | 66 | 0.833773 | from .diaperchange_lifetimes import diaperchange_lifetimes
from .diaperchange_types import diaperchange_types
from .feeding_amounts import feeding_amounts
from .feeding_duration import feeding_duration
from .sleep_pattern import sleep_pattern
from .sleep_totals import sleep_totals
from .weight_weight import... | true | true |
1c1ca8b88fbfe603c2f23e5c87de61569a99d237 | 668 | py | Python | main.py | Friedenspanzer/spacegame | 639ef6903153d0be4e1c0ef75b84bc41b1fa9cd9 | [
"MIT"
] | null | null | null | main.py | Friedenspanzer/spacegame | 639ef6903153d0be4e1c0ef75b84bc41b1fa9cd9 | [
"MIT"
] | null | null | null | main.py | Friedenspanzer/spacegame | 639ef6903153d0be4e1c0ef75b84bc41b1fa9cd9 | [
"MIT"
] | null | null | null | import tcod
from engine.engine import Engine
from constants import SCREEN_HEIGHT, SCREEN_WIDTH
def main() -> None:
tileset = tcod.tileset.load_tilesheet(
"default_font.png", 32, 8, tcod.tileset.CHARMAP_CP437
)
engine = Engine()
with tcod.context.new_terminal(
SCREEN_WIDTH,
SC... | 24.740741 | 75 | 0.634731 | import tcod
from engine.engine import Engine
from constants import SCREEN_HEIGHT, SCREEN_WIDTH
def main() -> None:
tileset = tcod.tileset.load_tilesheet(
"default_font.png", 32, 8, tcod.tileset.CHARMAP_CP437
)
engine = Engine()
with tcod.context.new_terminal(
SCREEN_WIDTH,
SC... | true | true |
1c1ca8f56af54007fd7bd58ee9d96c594514b600 | 2,031 | py | Python | write_to_file.py | altova/RaptorXML-Examples | 01ca41f671edf80a0b0034906436f63c15493423 | [
"Apache-2.0"
] | 9 | 2015-05-19T23:07:56.000Z | 2020-10-17T02:42:36.000Z | write_to_file.py | altova/RaptorXML-Examples | 01ca41f671edf80a0b0034906436f63c15493423 | [
"Apache-2.0"
] | null | null | null | write_to_file.py | altova/RaptorXML-Examples | 01ca41f671edf80a0b0034906436f63c15493423 | [
"Apache-2.0"
] | 5 | 2016-07-25T12:26:43.000Z | 2020-08-24T23:00:13.000Z | # Copyright 2015, 2016 Altova GmbH
#
# 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 wri... | 35.017241 | 91 | 0.730675 |
__copyright__ = "Copyright 2015, 2016 Altova GmbH"
__license__ = 'http://www.apache.org/licenses/LICENSE-2.0'
import builtins
import os
from altova import *
def write_to_file(job, instance):
filepath = os.path.join(job.output_dir, 'my_script_output.txt')
with builtins.open(filepath, m... | true | true |
1c1ca93daec493ce2b86c4c73561dfe86b0634fe | 4,604 | py | Python | api/resources_portal/models/material.py | AlexsLemonade/resources-portal | d91c6c8d6135461faccbc78ef2b0be3f9b358f21 | [
"BSD-3-Clause"
] | null | null | null | api/resources_portal/models/material.py | AlexsLemonade/resources-portal | d91c6c8d6135461faccbc78ef2b0be3f9b358f21 | [
"BSD-3-Clause"
] | 536 | 2019-11-13T15:49:03.000Z | 2022-03-28T20:17:24.000Z | api/resources_portal/models/material.py | AlexsLemonade/resources-portal | d91c6c8d6135461faccbc78ef2b0be3f9b358f21 | [
"BSD-3-Clause"
] | 1 | 2020-04-03T02:07:29.000Z | 2020-04-03T02:07:29.000Z | from django.conf import settings
from django.contrib.postgres.fields import ArrayField, JSONField
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from safedelete.managers import SafeDeleteDeletedManager, SafeDeleteManager
from safedelete.models import SO... | 35.415385 | 99 | 0.703953 | from django.conf import settings
from django.contrib.postgres.fields import ArrayField, JSONField
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from safedelete.managers import SafeDeleteDeletedManager, SafeDeleteManager
from safedelete.models import SO... | true | true |
1c1cac9043220a8a3216189fca918bb6d35bb92f | 8,302 | py | Python | pysnmp/SYMMNTPCLIENT.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/SYMMNTPCLIENT.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/SYMMNTPCLIENT.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 SYMMNTPCLIENT (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMMNTPCLIENT
# Produced by pysmi-0.3.4 at Tue Jul 30 11:34:26 2019
# On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt
# Using Python version 3.7.4 (default, J... | 102.493827 | 1,104 | 0.754999 |
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuild... | true | true |
1c1cac9ed184a27e40487a8d3937bcc8ef90625d | 4,203 | py | Python | feedreader/models.py | SHohentanner/django-feedreader | 7a2e5bbfaaaa3f05b5687c609b0211555cfd4b78 | [
"BSD-3-Clause"
] | null | null | null | feedreader/models.py | SHohentanner/django-feedreader | 7a2e5bbfaaaa3f05b5687c609b0211555cfd4b78 | [
"BSD-3-Clause"
] | null | null | null | feedreader/models.py | SHohentanner/django-feedreader | 7a2e5bbfaaaa3f05b5687c609b0211555cfd4b78 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
class OptionsManager(models.Manager):
def get_options(self):
options = Options.objects.all()
if options:
options = options[0]
else: # Create options row with default values
options = Options.objects.create()
return options
cla... | 27.651316 | 86 | 0.635498 | from django.db import models
class OptionsManager(models.Manager):
def get_options(self):
options = Options.objects.all()
if options:
options = options[0]
else:
options = Options.objects.create()
return options
class Options(models.Model):
number_ini... | true | true |
1c1cafadd8d03f6321ab46f80953f70aac6a17b6 | 478 | py | Python | xtable/__init__.py | tuyenta/xTable | f299e42eb3bbbfe242572375af04e18e699dd681 | [
"MIT"
] | null | null | null | xtable/__init__.py | tuyenta/xTable | f299e42eb3bbbfe242572375af04e18e699dd681 | [
"MIT"
] | null | null | null | xtable/__init__.py | tuyenta/xTable | f299e42eb3bbbfe242572375af04e18e699dd681 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from .__version__ import __version__
from .io import read_pdf
from .helpers.plotting import PlotMethods
# set up logging
logger = logging.getLogger("xtable")
format_string = "%(asctime)s - %(levelname)s - %(message)s"
formatter = logging.Formatter(format_string, datefmt="%Y-%... | 21.727273 | 73 | 0.74477 |
import logging
from .__version__ import __version__
from .io import read_pdf
from .helpers.plotting import PlotMethods
logger = logging.getLogger("xtable")
format_string = "%(asctime)s - %(levelname)s - %(message)s"
formatter = logging.Formatter(format_string, datefmt="%Y-%m-%dT%H:%M:%S")
handler = logging.Strea... | true | true |
1c1cafd2e310c98667ce1e93ca37e6efe7d4e38a | 3,960 | py | Python | retro_data_structures/formats/pak.py | duncathan/Retro-data-structures | 88c0a685e45c9c6935c1bd9d95ba549849947beb | [
"MIT"
] | 2 | 2021-06-18T16:47:00.000Z | 2021-07-06T22:36:32.000Z | retro_data_structures/formats/pak.py | duncathan/Retro-data-structures | 88c0a685e45c9c6935c1bd9d95ba549849947beb | [
"MIT"
] | 1 | 2021-10-01T20:26:01.000Z | 2021-10-01T20:26:01.000Z | retro_data_structures/formats/pak.py | duncathan/Retro-data-structures | 88c0a685e45c9c6935c1bd9d95ba549849947beb | [
"MIT"
] | 5 | 2021-08-23T17:01:01.000Z | 2021-11-20T03:57:14.000Z | import construct
from construct import (
Struct,
Const,
Int16ub,
PrefixedArray,
Int32ub,
PascalString,
IfThenElse,
FocusedSeq,
Pointer,
Aligned,
Tell,
Rebuild,
GreedyBytes,
Array,
Seek,
Computed,
RawCopy,
)
from retro_data_structures import game_check... | 27.5 | 102 | 0.555051 | import construct
from construct import (
Struct,
Const,
Int16ub,
PrefixedArray,
Int32ub,
PascalString,
IfThenElse,
FocusedSeq,
Pointer,
Aligned,
Tell,
Rebuild,
GreedyBytes,
Array,
Seek,
Computed,
RawCopy,
)
from retro_data_structures import game_check... | true | true |
1c1cafe6f13bfd26b5c95bad86ab93abde073389 | 177 | py | Python | main.py | carlo007/AI-Pygame | 549a1d7d3ee4d08f57ccdd44ce6c4e97471586d0 | [
"CC0-1.0"
] | null | null | null | main.py | carlo007/AI-Pygame | 549a1d7d3ee4d08f57ccdd44ce6c4e97471586d0 | [
"CC0-1.0"
] | null | null | null | main.py | carlo007/AI-Pygame | 549a1d7d3ee4d08f57ccdd44ce6c4e97471586d0 | [
"CC0-1.0"
] | null | null | null | __author__ = 'Andres'
import pygame
import keyboard
import environment
import physics
pygame.init()
#physics.get_random_coordinates(640, 480)
#physics.check_collision(5, 7)
| 13.615385 | 41 | 0.79661 | __author__ = 'Andres'
import pygame
import keyboard
import environment
import physics
pygame.init()
| true | true |
1c1cb0799ed8d647f0cd87afc0929227008a0982 | 5,837 | py | Python | spacy/lang/fa/stop_words.py | keshan/spaCy | 45c165af448783359f99673ab6b91492033bc66b | [
"MIT"
] | 88 | 2018-05-06T17:28:23.000Z | 2022-03-06T20:19:16.000Z | spacy/lang/fa/stop_words.py | keshan/spaCy | 45c165af448783359f99673ab6b91492033bc66b | [
"MIT"
] | 12 | 2018-07-19T15:11:57.000Z | 2021-08-05T11:58:29.000Z | spacy/lang/fa/stop_words.py | keshan/spaCy | 45c165af448783359f99673ab6b91492033bc66b | [
"MIT"
] | 10 | 2018-07-28T22:43:04.000Z | 2020-11-22T22:58:21.000Z | # coding: utf8
from __future__ import unicode_literals
STOP_WORDS = set("""
آباد آره آری آسانی آمد آمده آن آنان آنجا آنها آنها آنچه آنکه آورد آورده آیا آید
ات اثر از است استفاده اش اطلاعند الاسف البته الظاهر ام اما امروز امسال اند انکه او اول اکنون
اگر الواقع ای ایشان ایم این اینک اینکه
ب با بااین بار بارة باره بار... | 55.066038 | 119 | 0.810005 |
from __future__ import unicode_literals
STOP_WORDS = set("""
آباد آره آری آسانی آمد آمده آن آنان آنجا آنها آنها آنچه آنکه آورد آورده آیا آید
ات اثر از است استفاده اش اطلاعند الاسف البته الظاهر ام اما امروز امسال اند انکه او اول اکنون
اگر الواقع ای ایشان ایم این اینک اینکه
ب با بااین بار بارة باره بارها باز بازهم ب... | true | true |
1c1cb2733cbe847cb16890029bb665ba728f7606 | 5,071 | py | Python | tests/integration/widgets/tables/test_copy_paste.py | Connossor/bokeh | 092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e | [
"BSD-3-Clause"
] | 1 | 2019-10-08T10:21:04.000Z | 2019-10-08T10:21:04.000Z | tests/integration/widgets/tables/test_copy_paste.py | Connossor/bokeh | 092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e | [
"BSD-3-Clause"
] | null | null | null | tests/integration/widgets/tables/test_copy_paste.py | Connossor/bokeh | 092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e | [
"BSD-3-Clause"
] | 1 | 2020-03-22T12:49:32.000Z | 2020-03-22T12:49:32.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 36.746377 | 101 | 0.566358 |
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest ; pytest
from time import sleep
from selenium.webdriver.common.keys import Keys
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, DataTable, TableColumn, TextAreaInp... | true | true |
1c1cb31f5561763793ff5b3fa91c804793dea091 | 7,411 | py | Python | swtloc/bubble_bbox.py | ag-ds-bubble/swtloc | ca4a3bf323a0d7a2928634df99d193ca5c2a16d2 | [
"BSD-3-Clause"
] | 30 | 2020-12-09T12:24:40.000Z | 2022-03-16T22:29:34.000Z | swtloc/bubble_bbox.py | carpediemzt/swtloc | af11cfa4369116ed708b9db930b294ed9a430f59 | [
"BSD-3-Clause"
] | 10 | 2020-12-09T13:00:47.000Z | 2022-03-16T11:19:36.000Z | swtloc/bubble_bbox.py | carpediemzt/swtloc | af11cfa4369116ed708b9db930b294ed9a430f59 | [
"BSD-3-Clause"
] | 4 | 2021-01-26T09:37:16.000Z | 2022-01-11T16:49:37.000Z | # Author : Achintya Gupta
import numpy as np
from cv2 import cv2
class BubbleBBOX:
def __init__(self, labelmask, comp_props, lookup_radii_multiplier=0.8,
sw_ratio = 2, cl_deviat = [13,13,13], ht_ratio = 2, ar_ratio = 3, ang_deviat = 30,
bubble_width = 1):
self.l... | 41.634831 | 137 | 0.616921 |
import numpy as np
from cv2 import cv2
class BubbleBBOX:
def __init__(self, labelmask, comp_props, lookup_radii_multiplier=0.8,
sw_ratio = 2, cl_deviat = [13,13,13], ht_ratio = 2, ar_ratio = 3, ang_deviat = 30,
bubble_width = 1):
self.labelmask = labelmask.copy... | true | true |
1c1cb31fd2df3c19b93744cd7be901e4b0485a0d | 4,520 | py | Python | samspy/cmds/lvbasic.py | kwan0xfff/SamsPy | 71fbfed307b3b22d13b9cbba3967fdb95a146c0b | [
"Apache-2.0"
] | 2 | 2017-06-12T01:21:19.000Z | 2017-12-16T15:19:13.000Z | samspy/cmds/lvbasic.py | kwan0xfff/SamsPy | 71fbfed307b3b22d13b9cbba3967fdb95a146c0b | [
"Apache-2.0"
] | 5 | 2017-06-26T02:39:39.000Z | 2017-11-11T04:00:08.000Z | samspy/cmds/lvbasic.py | kwan0xfff/SamsPy | 71fbfed307b3b22d13b9cbba3967fdb95a146c0b | [
"Apache-2.0"
] | 1 | 2018-01-22T01:30:36.000Z | 2018-01-22T01:30:36.000Z | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
Launch vehicle -- basic analysis.
"""
import argparse
import sys
import yaml
from samspy.vehicle import multistage, propel
from samspy import lb2kg, m2ft, gEarth, N2lb
from samspy.writers.Text import Text
def parseargs(argv):
"Parse command line arguments."
... | 37.04918 | 79 | 0.579867 |
import argparse
import sys
import yaml
from samspy.vehicle import multistage, propel
from samspy import lb2kg, m2ft, gEarth, N2lb
from samspy.writers.Text import Text
def parseargs(argv):
parser = argparse.ArgumentParser()
parser.add_argument("vehicle", help="vehicle spec file")
parser.add_argument("... | true | true |
1c1cb331723a4ff41d7f80ceaa0517f36d0681eb | 576 | py | Python | config/celery_app.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | null | null | null | config/celery_app.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | 11 | 2021-05-10T15:40:38.000Z | 2022-02-28T21:09:37.000Z | config/celery_app.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | 2 | 2021-09-18T18:49:58.000Z | 2021-11-17T12:29:13.000Z | import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
app = Celery("my_receipts")
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
... | 32 | 72 | 0.782986 | import os
from celery import Celery
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
app = Celery("my_receipts")
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
app.config_from_object("dja... | true | true |
1c1cb3de4b11bc13e42f611b3e43330caac791be | 668 | py | Python | eLegislative/manage.py | lloydgarcia77/eLMS_San_Pedro_Laguna | dd6b59ba971301a8af40f262db1f651b7a7a6e0f | [
"MIT"
] | null | null | null | eLegislative/manage.py | lloydgarcia77/eLMS_San_Pedro_Laguna | dd6b59ba971301a8af40f262db1f651b7a7a6e0f | [
"MIT"
] | null | null | null | eLegislative/manage.py | lloydgarcia77/eLMS_San_Pedro_Laguna | dd6b59ba971301a8af40f262db1f651b7a7a6e0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eLegislative.settings')
try:
from django.core.management import execute_from_command_line
except... | 29.043478 | 76 | 0.681138 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eLegislative.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c1cb40759681937f2695fafa1287c5ab19a0d21 | 703 | py | Python | examples/different_api_versions.py | nerdguyahmad/randomstuff.py | c1e8893d7fb009109812b0e21ed09abe027573d1 | [
"MIT"
] | 12 | 2021-05-22T11:09:34.000Z | 2021-12-08T19:50:21.000Z | examples/different_api_versions.py | MarzaElise/randomstuff.py | c1e8893d7fb009109812b0e21ed09abe027573d1 | [
"MIT"
] | 21 | 2021-05-22T11:14:26.000Z | 2022-02-19T13:08:59.000Z | examples/different_api_versions.py | MarzaElise/randomstuff.py | c1e8893d7fb009109812b0e21ed09abe027573d1 | [
"MIT"
] | 9 | 2021-05-25T02:59:14.000Z | 2022-03-02T22:14:45.000Z | """This example shows how to switch to a different versions of API"""
"""Randomstuff.py supports both v3 and v4 so you can use any version without any issues.
Warning! We don't recommend the use of V3 anymore! v4 is the latest and supported version! Please use v4 for general usage!
If you have a program running the ... | 41.352941 | 124 | 0.736842 |
import randomstuff
with randomstuff.Client(
key="api-key-here", version="4"
) as client:
...
| true | true |
1c1cb559ef3b81143713f1e73452480c61fb7476 | 6,506 | py | Python | tests/scripts/thread-cert/Cert_9_2_09_PendingPartition.py | ddreyer/openthread | 23f465c681babb64ad813fe27d44ed5e958f878d | [
"BSD-3-Clause"
] | 1 | 2018-12-31T08:12:49.000Z | 2018-12-31T08:12:49.000Z | tests/scripts/thread-cert/Cert_9_2_09_PendingPartition.py | ddreyer/openthread | 23f465c681babb64ad813fe27d44ed5e958f878d | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_9_2_09_PendingPartition.py | ddreyer/openthread | 23f465c681babb64ad813fe27d44ed5e958f878d | [
"BSD-3-Clause"
] | 1 | 2021-11-14T14:15:16.000Z | 2021-11-14T14:15:16.000Z | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 43.086093 | 95 | 0.664617 |
import time
import unittest
import node
CHANNEL_INIT = 19
PANID_INIT = 0xface
CHANNEL_FINAL = 19
PANID_FINAL = 0xabcd
COMMISSIONER = 1
LEADER = 2
ROUTER1 = 3
ROUTER2 = 4
class Cert_9_2_09_PendingPartition(unittest.TestCase):
def setUp(self):
self.nodes = {}
for i in... | true | true |
1c1cb5a9bc5ba1e45e95e4f6568f201be916269b | 2,811 | py | Python | seahub/group/utils.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 2 | 2017-06-21T09:46:55.000Z | 2018-05-30T10:07:32.000Z | seahub/group/utils.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | null | null | null | seahub/group/utils.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 1 | 2020-10-01T04:11:41.000Z | 2020-10-01T04:11:41.000Z | # -*- coding: utf-8 -*-
import re
import logging
import seaserv
from seahub.utils import is_org_context
from seahub.profile.models import Profile
from seahub.base.templatetags.seahub_tags import email2nickname
from seahub.avatar.settings import AVATAR_DEFAULT_SIZE
from seahub.avatar.templatetags.avatar_tags import ap... | 28.683673 | 85 | 0.701174 |
import re
import logging
import seaserv
from seahub.utils import is_org_context
from seahub.profile.models import Profile
from seahub.base.templatetags.seahub_tags import email2nickname
from seahub.avatar.settings import AVATAR_DEFAULT_SIZE
from seahub.avatar.templatetags.avatar_tags import api_avatar_url, \
get... | true | true |
1c1cb6b377e9af24ebd2003a9ce2805489cca9cb | 7,401 | py | Python | armi/nuclearDataIO/ripl.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 162 | 2019-11-01T17:35:58.000Z | 2022-03-18T04:22:39.000Z | armi/nuclearDataIO/ripl.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 315 | 2019-11-01T17:32:05.000Z | 2022-03-30T03:51:42.000Z | armi/nuclearDataIO/ripl.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 55 | 2019-11-01T16:59:59.000Z | 2022-03-25T18:19:06.000Z | # Copyright 2019 TerraPower, 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 writi... | 33.488688 | 103 | 0.585056 |
import math
import os
import glob
import six
from armi.utils.textProcessors import SequentialStringIOReader, SequentialReader
from armi.nucDirectory import elements
from armi import runLog
from armi.utils import units
from armi.settings.caseSettings import Settings
DECAY_CONSTANTS = {}
MINIMUM_HALFLIFE... | true | true |
1c1cb6c2e62e2fec7b59732a23f17b0440c32b1a | 71,962 | py | Python | fhirclient/models/claim.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | fhirclient/models/claim.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | fhirclient/models/claim.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Claim) on 2019-01-22.
# 2019, SMART Health IT.
from . import domainresource
class Claim(domainresource.DomainResource):
"""
C
l
a
i
m
,
P
r
e
... | 13.328765 | 128 | 0.319766 |
from . import domainresource
class Claim(domainresource.DomainResource):
resource_type = "Claim"
def __init__(self, jsondict=None, strict=True):
self.accident = None
self.billablePeriod = None
self.careTeam = None
self.created... | true | true |
1c1cb6e3f4865a0376bd172d338cd94d8e519130 | 5,888 | py | Python | src/utils/lazytalonsrx.py | FRCTeam2984/infiniterecharge2020 | 8f3e8515c69cd9c378f19a0d0e24a5de2b5011e2 | [
"MIT"
] | null | null | null | src/utils/lazytalonsrx.py | FRCTeam2984/infiniterecharge2020 | 8f3e8515c69cd9c378f19a0d0e24a5de2b5011e2 | [
"MIT"
] | 2 | 2020-01-04T21:00:21.000Z | 2020-01-05T03:07:54.000Z | src/utils/lazytalonsrx.py | FRCTeam2984/infiniterecharge2020 | 8f3e8515c69cd9c378f19a0d0e24a5de2b5011e2 | [
"MIT"
] | 1 | 2019-12-07T19:48:46.000Z | 2019-12-07T19:48:46.000Z | import logging
import ctre
import numpy as np
class EncoderType:
Quad = ctre.FeedbackDevice.QuadEncoder
Integrated = ctre.FeedbackDevice.IntegratedSensor
CTREMag = ctre.FeedbackDevice.CTRE_MagEncoder_Relative
class EncoderConfig:
def __init__(self, _type: EncoderType, cpr: int):
self.type =... | 33.454545 | 97 | 0.629416 | import logging
import ctre
import numpy as np
class EncoderType:
Quad = ctre.FeedbackDevice.QuadEncoder
Integrated = ctre.FeedbackDevice.IntegratedSensor
CTREMag = ctre.FeedbackDevice.CTRE_MagEncoder_Relative
class EncoderConfig:
def __init__(self, _type: EncoderType, cpr: int):
self.type =... | true | true |
1c1cb7ce11d28d4bf148577c021256dcaadf20f7 | 3,305 | py | Python | docs/conf.py | mhalshehri/hijri-converter | e693b9573e80160d814e90b311f42cfcada7d59f | [
"MIT"
] | 2 | 2022-02-24T16:12:37.000Z | 2022-03-06T22:40:07.000Z | docs/conf.py | mhalshehri/hijri-converter | e693b9573e80160d814e90b311f42cfcada7d59f | [
"MIT"
] | 1 | 2022-02-12T14:34:04.000Z | 2022-02-20T18:46:36.000Z | docs/conf.py | mhalshehri/hijri-converter | e693b9573e80160d814e90b311f42cfcada7d59f | [
"MIT"
] | 1 | 2022-03-15T14:59:13.000Z | 2022-03-15T14:59:13.000Z | # Configuration file for the Sphinx documentation builder.
#
# Full list of options can be found in the Sphinx documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
import sys
from pathlib import Path
# Set package variables and add to path
package_name = "hijri_converter"
package_p... | 25.820313 | 88 | 0.574584 |
import re
import sys
from pathlib import Path
package_name = "hijri_converter"
package_path = Path("../src").joinpath(package_name).resolve()
sys.path.append(str(package_path.parent))
def read_version():
content = package_path.joinpath("__init__.py").read_text()
pattern = re.compile(r"(?<=__version__\s... | true | true |
1c1cb800131436dcb1df2364a6c17e34048f85dc | 706 | py | Python | setup.py | madedotcom/atomicpuppy | fe11969e75361b7b15eea412b55761b053300493 | [
"MIT"
] | 44 | 2015-07-08T14:19:39.000Z | 2022-03-11T10:22:51.000Z | setup.py | madedotcom/atomicpuppy | fe11969e75361b7b15eea412b55761b053300493 | [
"MIT"
] | 50 | 2015-08-12T15:49:43.000Z | 2021-10-07T09:29:20.000Z | setup.py | madedotcom/atomicpuppy | fe11969e75361b7b15eea412b55761b053300493 | [
"MIT"
] | 7 | 2015-07-09T14:14:22.000Z | 2020-03-03T14:18:12.000Z | from setuptools import setup, find_packages
install_requires = [
"aiohttp",
"chardet",
"gevent",
"pybreaker",
"PyYAML",
"redis",
"retrying",
"requests",
]
tests_require = [
"Contexts",
"fakeredis",
"freezegun",
"HTTPretty==0.8.10",
]
extras = {
'test': tests_requir... | 18.578947 | 63 | 0.634561 | from setuptools import setup, find_packages
install_requires = [
"aiohttp",
"chardet",
"gevent",
"pybreaker",
"PyYAML",
"redis",
"retrying",
"requests",
]
tests_require = [
"Contexts",
"fakeredis",
"freezegun",
"HTTPretty==0.8.10",
]
extras = {
'test': tests_requir... | true | true |
1c1cb8015de6490df413610129e9a2c01f4b337f | 1,730 | py | Python | h2o-py/h2o/model/extensions/__init__.py | JannisBush/h2o-3 | 30aa2a86e6bfa1febb5f95f3cb43811337895f7f | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/model/extensions/__init__.py | JannisBush/h2o-3 | 30aa2a86e6bfa1febb5f95f3cb43811337895f7f | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/model/extensions/__init__.py | JannisBush/h2o-3 | 30aa2a86e6bfa1febb5f95f3cb43811337895f7f | [
"Apache-2.0"
] | 1 | 2021-09-09T03:47:11.000Z | 2021-09-09T03:47:11.000Z | """
A collection of mixins optionally added to the model if the feature is supported for the given model.
"""
import sys
from .feature_interaction import FeatureInteraction
from .h_statistic import HStatistic
from .scoring_history import ScoringHistory, ScoringHistoryDL, ScoringHistoryGLM, ScoringHistoryTrees
from .st... | 34.6 | 134 | 0.716763 | import sys
from .feature_interaction import FeatureInteraction
from .h_statistic import HStatistic
from .scoring_history import ScoringHistory, ScoringHistoryDL, ScoringHistoryGLM, ScoringHistoryTrees
from .std_coef import StandardCoef
from .trees import Trees
from .varimp import VariableImportance
module = sys.modul... | true | true |
1c1cb816da5ab85ec0c2161003d75aee5244b90f | 5,134 | py | Python | generate-gpt2.py | OlegJakushkin/KaggleGPT2-ArxivTitleGeneration | 270a492b426cc3f0969b6b2af677ab1a86c4439a | [
"MIT"
] | null | null | null | generate-gpt2.py | OlegJakushkin/KaggleGPT2-ArxivTitleGeneration | 270a492b426cc3f0969b6b2af677ab1a86c4439a | [
"MIT"
] | 1 | 2020-12-24T06:43:50.000Z | 2020-12-24T06:43:50.000Z | generate-gpt2.py | OlegJakushkin/KaggleGPT2-ArxivTitleGeneration | 270a492b426cc3f0969b6b2af677ab1a86c4439a | [
"MIT"
] | null | null | null | import os
import pandas as pd
import requests
from tqdm import tqdm
tqdm.pandas()
from pandarallel import pandarallel
from gensim.summarization import keywords
from gpt2_client import *
import gpt_2_simple as gpt2
import tensorflow as tf
from itertools import groupby
from termcolor import colored, cprint
import sy... | 27.602151 | 125 | 0.617647 | import os
import pandas as pd
import requests
from tqdm import tqdm
tqdm.pandas()
from pandarallel import pandarallel
from gensim.summarization import keywords
from gpt2_client import *
import gpt_2_simple as gpt2
import tensorflow as tf
from itertools import groupby
from termcolor import colored, cprint
import sy... | true | true |
1c1cb9112a1d6fd534700d34c38833f64c4576c5 | 7,162 | py | Python | LsBook/mistletoe_renderers/span_token.py | liushilive/LsBook | 41f72427e9694a8a2cdc2bb2eab0992fdec63c46 | [
"MIT"
] | 8 | 2019-04-14T07:23:03.000Z | 2022-03-24T15:15:05.000Z | LsBook/mistletoe_renderers/span_token.py | liushilive/LsBook | 41f72427e9694a8a2cdc2bb2eab0992fdec63c46 | [
"MIT"
] | 1 | 2020-03-07T07:12:38.000Z | 2020-12-29T02:09:57.000Z | LsBook/mistletoe_renderers/span_token.py | liushilive/LsBook | 41f72427e9694a8a2cdc2bb2eab0992fdec63c46 | [
"MIT"
] | null | null | null | """
内联一级令牌
"""
import re
from . import span_tokenizer, core_tokens
"""
在解析过程中包含的令牌,在指定的顺序中。
"""
__all__ = ['Math', 'Spoiler', 'HTMLSpan', 'EscapeSequence', 'Strikethrough', 'AutoLink', 'CoreTokens',
'InlineCode', 'LineBreak', 'RawText']
_root_node = None
def tokenize_inner(content):
"""
A wrappe... | 26.428044 | 200 | 0.581402 |
import re
from . import span_tokenizer, core_tokens
__all__ = ['Math', 'Spoiler', 'HTMLSpan', 'EscapeSequence', 'Strikethrough', 'AutoLink', 'CoreTokens',
'InlineCode', 'LineBreak', 'RawText']
_root_node = None
def tokenize_inner(content):
return span_tokenizer.tokenize(content, _token_types)
def ... | true | true |
1c1cb96b9fe675303b22f317ec095cd12660e03c | 11,228 | py | Python | sfepy/solvers/semismooth_newton.py | carlosal1015/sfepy | 2a42376e43c6fb7c17f7a1a2403f8b8f090f4082 | [
"BSD-3-Clause"
] | 510 | 2015-01-19T16:22:25.000Z | 2022-03-30T19:02:51.000Z | sfepy/solvers/semismooth_newton.py | vlukes/sfepy | f02f88c5df9814ad710c658429e23c90744b0d9d | [
"BSD-3-Clause"
] | 402 | 2015-01-22T10:57:50.000Z | 2022-03-30T15:19:23.000Z | sfepy/solvers/semismooth_newton.py | vlukes/sfepy | f02f88c5df9814ad710c658429e23c90744b0d9d | [
"BSD-3-Clause"
] | 156 | 2015-01-05T14:23:38.000Z | 2022-03-22T13:08:30.000Z | from __future__ import absolute_import
import numpy as nm
import numpy.linalg as nla
import scipy.sparse as sp
from sfepy.base.base import output, get_default, debug
from sfepy.base.timing import Timer
from sfepy.solvers.nls import Newton, conv_test
from sfepy.linalg import compose_sparse
import six
from six.moves im... | 34.336391 | 80 | 0.481564 | from __future__ import absolute_import
import numpy as nm
import numpy.linalg as nla
import scipy.sparse as sp
from sfepy.base.base import output, get_default, debug
from sfepy.base.timing import Timer
from sfepy.solvers.nls import Newton, conv_test
from sfepy.linalg import compose_sparse
import six
from six.moves im... | true | true |
1c1cbbe83bf389f583839a5debf2211bf6243a44 | 43,598 | py | Python | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | gisproject2015/Bridge3DModeling | d1edde119b33f1cfb1a9440bed78f2936dd21276 | [
"Apache-2.0"
] | null | null | null | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | gisproject2015/Bridge3DModeling | d1edde119b33f1cfb1a9440bed78f2936dd21276 | [
"Apache-2.0"
] | null | null | null | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | gisproject2015/Bridge3DModeling | d1edde119b33f1cfb1a9440bed78f2936dd21276 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
im... | 45.414583 | 81 | 0.658769 |
import os
import re
import subprocess
import sys
import gyp.MSVSVersion
windows_quoter_regex = re.compile(r'(\\*)"')
def QuoteForRspFile(arg):
# See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment
# threads. This is actually the quoting rules for CommandLineToArgvW, not
# f... | true | true |
1c1cbc7dfdc4e4266d3a59fb76f7a469e9e8067e | 310 | py | Python | Elementary/3- string - list - dictionary - tuple/Ex_5_Lowercase_uppercase_letters.py | AlirezaMojtabavi/Python_Practice | c0128d6ce4cf172d93cc4e48861e7980e8e016a2 | [
"MIT"
] | null | null | null | Elementary/3- string - list - dictionary - tuple/Ex_5_Lowercase_uppercase_letters.py | AlirezaMojtabavi/Python_Practice | c0128d6ce4cf172d93cc4e48861e7980e8e016a2 | [
"MIT"
] | null | null | null | Elementary/3- string - list - dictionary - tuple/Ex_5_Lowercase_uppercase_letters.py | AlirezaMojtabavi/Python_Practice | c0128d6ce4cf172d93cc4e48861e7980e8e016a2 | [
"MIT"
] | 1 | 2020-11-14T07:19:26.000Z | 2020-11-14T07:19:26.000Z | word = str(input())
length = len(word)
countUppercase = 0
countLowercase = 0
for letter in word:
if str(letter) == str(letter).upper():
countUppercase += 1
else:
countLowercase += 1
if countUppercase > countLowercase:
word = word.upper()
else:
word = word.lower()
print(word) | 18.235294 | 42 | 0.63871 | word = str(input())
length = len(word)
countUppercase = 0
countLowercase = 0
for letter in word:
if str(letter) == str(letter).upper():
countUppercase += 1
else:
countLowercase += 1
if countUppercase > countLowercase:
word = word.upper()
else:
word = word.lower()
print(word) | true | true |
1c1cbd1dc177e3c227c6068d3523eb4d5d100194 | 2,319 | py | Python | python-swiftclient-3.1.0/swiftclient/functions.py | ghadatlili/python-swiftclient-3.1.0 | f68c1f230ddf2c3d5acc24e9402e7482d842084b | [
"MIT"
] | null | null | null | python-swiftclient-3.1.0/swiftclient/functions.py | ghadatlili/python-swiftclient-3.1.0 | f68c1f230ddf2c3d5acc24e9402e7482d842084b | [
"MIT"
] | null | null | null | python-swiftclient-3.1.0/swiftclient/functions.py | ghadatlili/python-swiftclient-3.1.0 | f68c1f230ddf2c3d5acc24e9402e7482d842084b | [
"MIT"
] | null | null | null | def tscalcul():
ts = 1
return ts
def bandwidth_monitoring():
bw = 3
return bw # Mbits/s
'''def assignReqToTs(tsNum, i,transTime,nbMaxThr):
assigned = False; exit = False; global startt;
print " ********* tsNum = ", tsNum # print "usedThr_dict[tsNum]", usedThr_dict[tsNum],"deadlines[i]",dead... | 49.340426 | 193 | 0.633031 | def tscalcul():
ts = 1
return ts
def bandwidth_monitoring():
bw = 3
return bw
| true | true |
1c1cbd50515bae0eebe9255f135cfbbf708a15ba | 8,091 | py | Python | tests/common/reboot.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | null | null | null | tests/common/reboot.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | null | null | null | tests/common/reboot.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | null | null | null | import threading
import time
import logging
from multiprocessing.pool import ThreadPool, TimeoutError
from errors import RunAnsibleModuleFail
logger = logging.getLogger(__name__)
# SSH defines
SONIC_SSH_PORT = 22
SONIC_SSH_REGEX = 'OpenSSH_[\\w\\.]+ Debian'
REBOOT_TYPE_WARM = "warm"
REBOOT_TYPE_COLD = "cold"
REBOOT... | 37.114679 | 129 | 0.63997 | import threading
import time
import logging
from multiprocessing.pool import ThreadPool, TimeoutError
from errors import RunAnsibleModuleFail
logger = logging.getLogger(__name__)
SONIC_SSH_PORT = 22
SONIC_SSH_REGEX = 'OpenSSH_[\\w\\.]+ Debian'
REBOOT_TYPE_WARM = "warm"
REBOOT_TYPE_COLD = "cold"
REBOOT_TYPE_FAST = ... | true | true |
1c1cbd54e1edb83dc4728121f0a81c6da5d12001 | 2,799 | py | Python | docker/src/clawpack-5.3.1/riemann/src/write_constants.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 11 | 2017-01-04T18:19:48.000Z | 2021-02-21T01:46:33.000Z | docker/src/clawpack-5.3.1/riemann/src/write_constants.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 8 | 2016-09-22T20:49:51.000Z | 2019-09-06T23:28:13.000Z | docker/src/clawpack-5.3.1/riemann/src/write_constants.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 13 | 2016-09-22T20:20:06.000Z | 2020-07-13T14:48:32.000Z | """
This script reads constants from comments in the Fortran Riemann solvers and
writes the values to miniature modules so they can be imported and used in
Python scripts. The constants that are read and written include:
- num_eqn
- num_waves
- names/indices of q fields
- names/indices of aux fields
"""
import os
fo... | 37.824324 | 76 | 0.548767 | """
This script reads constants from comments in the Fortran Riemann solvers and
writes the values to miniature modules so they can be imported and used in
Python scripts. The constants that are read and written include:
- num_eqn
- num_waves
- names/indices of q fields
- names/indices of aux fields
"""
import os
fo... | false | true |
1c1cc00391554ef644cae754c42162a2464b954a | 12,351 | py | Python | rllib/agents/es/es.py | zommiommy/ray | aa1cbe8abc845e1a6acf2f237b4b00aa7c3f295d | [
"Apache-2.0"
] | 1 | 2020-11-14T19:25:41.000Z | 2020-11-14T19:25:41.000Z | rllib/agents/es/es.py | GoingMyWay/ray | 4fb195a22e972a0b54359ffa58afedb35e827540 | [
"Apache-2.0"
] | null | null | null | rllib/agents/es/es.py | GoingMyWay/ray | 4fb195a22e972a0b54359ffa58afedb35e827540 | [
"Apache-2.0"
] | null | null | null | # Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
from collections import namedtuple
import logging
import numpy as np
import time
import ray
from ray.rllib.agents import Trainer, with_common_config
from ray.rllib.agents.es import optimizers, utils
from ray.rllib... | 35.90407 | 79 | 0.626346 |
from collections import namedtuple
import logging
import numpy as np
import time
import ray
from ray.rllib.agents import Trainer, with_common_config
from ray.rllib.agents.es import optimizers, utils
from ray.rllib.agents.es.es_tf_policy import ESTFPolicy, rollout
from ray.rllib.env.env_context import EnvContext
fro... | true | true |
1c1cc037cd18d5c781342aa3c589ba21d5e8fa54 | 8,133 | py | Python | source/sagemaker/src/package/data_privatization/container/train.py | awslabs/sagemaker-privacy-for-nlp | 899f178748401eaf2713cec83d37306f8a1327a8 | [
"Apache-2.0",
"CC0-1.0"
] | 10 | 2020-07-08T18:59:05.000Z | 2022-02-03T21:49:33.000Z | source/sagemaker/src/package/model/train.py | awslabs/sagemaker-privacy-for-nlp | 899f178748401eaf2713cec83d37306f8a1327a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | source/sagemaker/src/package/model/train.py | awslabs/sagemaker-privacy-for-nlp | 899f178748401eaf2713cec83d37306f8a1327a8 | [
"Apache-2.0",
"CC0-1.0"
] | 5 | 2021-01-06T07:12:20.000Z | 2022-01-27T17:24:36.000Z | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: LicenseRef-.amazon.com.-AmznSL-1.0
# Licensed under the Amazon Software License http://aws.amazon.com/asl/
import argparse
import os
from os.path import join
import json
import random
import time
import logging
import... | 30.122222 | 96 | 0.682159 |
import argparse
import os
from os.path import join
import json
import random
import time
import logging
import subprocess
from pathlib import Path
from glob import glob
import torch
from torch import nn
from torch import optim
from torchtext import data
from torchtext.data import Field, TabularDataset
from torch... | true | true |
1c1cc03f9d4689ceaf9d79d297c3bbd63840e002 | 3,137 | py | Python | model_archs/models.py | ahmednasserswe/COSMOS | 9d2483816bcd77c58888ec829e273cbb5dd80a16 | [
"MIT"
] | 21 | 2021-04-27T09:56:50.000Z | 2022-02-22T08:52:32.000Z | model_archs/models.py | PhucThanh/COSMOS | 587ec9d1b6dd563eda8e407c09f84b83c0c04d64 | [
"MIT"
] | 6 | 2021-05-07T02:36:30.000Z | 2022-03-24T11:20:36.000Z | model_archs/models.py | PhucThanh/COSMOS | 587ec9d1b6dd563eda8e407c09f84b83c0c04d64 | [
"MIT"
] | 8 | 2021-05-20T16:21:08.000Z | 2022-02-10T14:12:06.000Z | """ This file list architecture to combine image-objects and text-embeddings"""
import torch
from torch import nn
from model_archs.image.image_models import MaskRCNNExtractor, ProcessMaskRCNNFeats
from model_archs.text.text_models import ToyRNNLSTM, ToyText
from utils.config import device, num_boxes
class CombinedMo... | 52.283333 | 151 | 0.662735 |
import torch
from torch import nn
from model_archs.image.image_models import MaskRCNNExtractor, ProcessMaskRCNNFeats
from model_archs.text.text_models import ToyRNNLSTM, ToyText
from utils.config import device, num_boxes
class CombinedModelMaskRCNN(nn.Module):
def __init__(self, hidden_size, use=True, embedding_... | true | true |
1c1cc042785e44419a111a3b3e4c34e9cc81625b | 1,280 | py | Python | config/vim/bundle/deoplete.nvim/rplugin/python3/deoplete/__init__.py | StephGit/dotfiles | f8db81df6656598ae85cbdb1cec76844f4f86597 | [
"MIT"
] | null | null | null | config/vim/bundle/deoplete.nvim/rplugin/python3/deoplete/__init__.py | StephGit/dotfiles | f8db81df6656598ae85cbdb1cec76844f4f86597 | [
"MIT"
] | null | null | null | config/vim/bundle/deoplete.nvim/rplugin/python3/deoplete/__init__.py | StephGit/dotfiles | f8db81df6656598ae85cbdb1cec76844f4f86597 | [
"MIT"
] | null | null | null | # ============================================================================
# FILE: __init__.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
import neovim
from deoplete import logger
from deoplete.deopl... | 33.684211 | 78 | 0.6375 |
import neovim
from deoplete import logger
from deoplete.deoplete import Deoplete
@neovim.plugin
class DeopleteHandlers(object):
def __init__(self, vim):
self.__vim = vim
@neovim.function('_deoplete', sync=True)
def init_python(self, args):
self.__deoplete = Deoplete(self.__vim)
... | true | true |
1c1cc1608a336e977481e944fddd8b7075a2654c | 61,720 | py | Python | tests20/python_client/testcases/test_collection.py | DragonDriver/milvus | b72e4c63726e28cd54f90c642faf5394d4a24c12 | [
"Apache-2.0"
] | null | null | null | tests20/python_client/testcases/test_collection.py | DragonDriver/milvus | b72e4c63726e28cd54f90c642faf5394d4a24c12 | [
"Apache-2.0"
] | null | null | null | tests20/python_client/testcases/test_collection.py | DragonDriver/milvus | b72e4c63726e28cd54f90c642faf5394d4a24c12 | [
"Apache-2.0"
] | null | null | null | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
prefix = "collection"
exp_nam... | 48.984127 | 120 | 0.645188 | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
prefix = "collection"
exp_nam... | true | true |
1c1cc1c87abfd32b00c90250af08c133dfb0548a | 2,666 | py | Python | src/transformers/dependency_versions_table.py | uunal/adapter-transformers | 73a95a75f803e8fd243fc3d55ff3a9d557891377 | [
"Apache-2.0"
] | null | null | null | src/transformers/dependency_versions_table.py | uunal/adapter-transformers | 73a95a75f803e8fd243fc3d55ff3a9d557891377 | [
"Apache-2.0"
] | null | null | null | src/transformers/dependency_versions_table.py | uunal/adapter-transformers | 73a95a75f803e8fd243fc3d55ff3a9d557891377 | [
"Apache-2.0"
] | null | null | null | # THIS FILE HAS BEEN AUTOGENERATED. To update:
# 1. modify the `_deps` dict in setup.py
# 2. run `make deps_table_update``
deps = {
"Pillow": "Pillow",
"black": "black==21.4b0",
"codecarbon": "codecarbon==1.2.0",
"cookiecutter": "cookiecutter==1.7.2",
"dataclasses": "dataclasses",
"datasets": "d... | 33.746835 | 56 | 0.585146 |
deps = {
"Pillow": "Pillow",
"black": "black==21.4b0",
"codecarbon": "codecarbon==1.2.0",
"cookiecutter": "cookiecutter==1.7.2",
"dataclasses": "dataclasses",
"datasets": "datasets",
"deepspeed": "deepspeed>=0.5.3",
"docutils": "docutils==0.16.0",
"fairscale": "fairscale>0.3",
... | true | true |
1c1cc3a436d398d83ad68e59f1e7a4c3a0542a77 | 37,653 | py | Python | python/test/test_action_script.py | kp-adapt/publish-unit-test-result-action | 7bcc628a22d949239560538b6b7a9d4f5485a51a | [
"Apache-2.0"
] | null | null | null | python/test/test_action_script.py | kp-adapt/publish-unit-test-result-action | 7bcc628a22d949239560538b6b7a9d4f5485a51a | [
"Apache-2.0"
] | 10 | 2021-09-28T11:18:39.000Z | 2022-03-22T11:18:36.000Z | python/test/test_action_script.py | sede-open/publish-unit-test-result-action | 8e9fa66dc1b51aefe54db3d0fa9b133925e39695 | [
"Apache-2.0"
] | 1 | 2022-01-03T14:06:17.000Z | 2022-01-03T14:06:17.000Z | import json
import logging
import os
import tempfile
import unittest
from typing import Optional
import mock
from publish import pull_request_build_mode_merge, fail_on_mode_failures, fail_on_mode_errors, \
fail_on_mode_nothing, comment_mode_off, comment_mode_create, comment_mode_update
from publish.github_action ... | 54.490593 | 257 | 0.624147 | import json
import logging
import os
import tempfile
import unittest
from typing import Optional
import mock
from publish import pull_request_build_mode_merge, fail_on_mode_failures, fail_on_mode_errors, \
fail_on_mode_nothing, comment_mode_off, comment_mode_create, comment_mode_update
from publish.github_action ... | true | true |
1c1cc461abc1a1ee3496008b0ac856b9218e53f1 | 2,018 | py | Python | src/analysis/feat_extraction/asm_expert_comments.py | afruizc/microsoft_malware_challenge | b69b8d5e540b0a1c8d61456ec3e61dc9ff2af951 | [
"Apache-2.0"
] | 1 | 2017-06-07T23:26:25.000Z | 2017-06-07T23:26:25.000Z | src/analysis/feat_extraction/asm_expert_comments.py | xysmas/microsoft_malware_challenge | a4923f7218e396d68f773309f734b18658f31828 | [
"Apache-2.0"
] | null | null | null | src/analysis/feat_extraction/asm_expert_comments.py | xysmas/microsoft_malware_challenge | a4923f7218e396d68f773309f734b18658f31828 | [
"Apache-2.0"
] | null | null | null | """Program to pull the better comments out of
the already-extracted comments"""
__author__ = "Aaron Gonzales"
__license__ = "Apache"
__email__ = "agonzales@cs.unm.edu"
import asm_utils
import multiprocessing
from joblib import delayed, Parallel
def get_calls(comments):
call_dict = {}
calls = {'__stdcall', ... | 36.035714 | 85 | 0.704163 |
__author__ = "Aaron Gonzales"
__license__ = "Apache"
__email__ = "agonzales@cs.unm.edu"
import asm_utils
import multiprocessing
from joblib import delayed, Parallel
def get_calls(comments):
call_dict = {}
calls = {'__stdcall', '__cdecl', '__fastcall', '__thiscall'}
fcalls = [line for line in comments fo... | true | true |
1c1cc48299a2359ea9bf19ad89a8fdadd87d1fe4 | 18,013 | py | Python | poropiezo_micro_dfc.py | sfepy/example_poropiezo | c21916c8e4f2d277aefe0462898c68cea4ca052a | [
"MIT"
] | 2 | 2020-09-01T11:25:59.000Z | 2020-09-01T11:26:02.000Z | poropiezo_micro_dfc.py | sfepy/example_poropiezo | c21916c8e4f2d277aefe0462898c68cea4ca052a | [
"MIT"
] | null | null | null | poropiezo_micro_dfc.py | sfepy/example_poropiezo | c21916c8e4f2d277aefe0462898c68cea4ca052a | [
"MIT"
] | null | null | null | # This example implements homogenization of piezoeletric porous media.
# The mathematical model and numerical results are described in:
#
# ROHAN E., LUKEŠ V.
# Homogenization of the fluid-saturated piezoelectric porous media.
# International Journal of Solids and Structures
# Volume 147, 15 August 2018, Pages 110-125... | 35.811133 | 78 | 0.443624 |
import sys
import numpy as nm
import os.path as osp
from sfepy.mechanics.matcoefs import stiffness_from_youngpoisson
from sfepy.homogenization.utils import coor_to_sym, define_box_regions
import sfepy.discrete.fem.periodic as per
from sfepy.discrete.fem.mesh import Mesh
import sfepy.homogenization.coefs... | true | true |
1c1cc48eee25480fe0058c0676ea6af6d19561ec | 4,887 | py | Python | tests/test_encodingdb.py | shengxc/pdfminer.six | ab61596849203efa0ea3cca1d1cfc98735b112c5 | [
"MIT"
] | null | null | null | tests/test_encodingdb.py | shengxc/pdfminer.six | ab61596849203efa0ea3cca1d1cfc98735b112c5 | [
"MIT"
] | null | null | null | tests/test_encodingdb.py | shengxc/pdfminer.six | ab61596849203efa0ea3cca1d1cfc98735b112c5 | [
"MIT"
] | null | null | null | """Tests based on the Adobe Glyph List Specification
See: https://github.com/adobe-type-tools/agl-specification#2-the-mapping
While not in the specification, lowercase unicode often occurs in pdf's. Therefore lowercase unittest variants are
added.
"""
from nose.tools import assert_raises
from pdfminer.encodingdb impo... | 40.057377 | 120 | 0.740536 | from nose.tools import assert_raises
from pdfminer.encodingdb import name2unicode
def test_name2unicode_name_in_agl():
assert u'\u013B' == name2unicode('Lcommaaccent')
def test_name2unicode_uni():
assert u'\u013B' == name2unicode('uni013B')
def test_name2unicode_uni_lowercase():
assert u'\u013B' == n... | true | true |
1c1cc5b7432c776a3fba90059454bf141f473e3e | 701 | py | Python | django/venv/bin/django-admin.py | sjvasconcello/dev_python | 3ee1af3469e897969a2974aa6f057959e1ecaa54 | [
"MIT"
] | null | null | null | django/venv/bin/django-admin.py | sjvasconcello/dev_python | 3ee1af3469e897969a2974aa6f057959e1ecaa54 | [
"MIT"
] | null | null | null | django/venv/bin/django-admin.py | sjvasconcello/dev_python | 3ee1af3469e897969a2974aa6f057959e1ecaa54 | [
"MIT"
] | null | null | null | #!/home/sjvasconcello/Documents/dev_python/django/venv/bin/python3
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin... | 31.863636 | 80 | 0.731812 |
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was deprecated in Django 3.1 and removed in Django '
'4.0. Please manually remove this script from your virtual enviro... | true | true |
1c1cc6d5feb0196a81c64daf4fcd2d8fd6fa5bf0 | 5,119 | py | Python | test.py | jkleve/map_input | 80428b8e32e14766186fd9305a235a2e491dae79 | [
"MIT"
] | null | null | null | test.py | jkleve/map_input | 80428b8e32e14766186fd9305a235a2e491dae79 | [
"MIT"
] | 1 | 2018-02-13T02:50:50.000Z | 2018-02-13T04:11:04.000Z | test.py | jkleve/map_input | 80428b8e32e14766186fd9305a235a2e491dae79 | [
"MIT"
] | null | null | null | from map_input.input import InputThread
# from collections import namedtuple
# Pitch = namedtuple('Pitch', 'value')
# ======================================
# controls.py
from enum import Enum
class Controls(Enum):
YAW = 0
PITCH = 1
ROLL = 2
THROTTLE = 3
TEST = 10
class CommandEvent(Enum):
... | 21.782979 | 88 | 0.457902 | from map_input.input import InputThread
from enum import Enum
class Controls(Enum):
YAW = 0
PITCH = 1
ROLL = 2
THROTTLE = 3
TEST = 10
class CommandEvent(Enum):
ENTER_FLIGHT_MODE = 0
EXIT_FLIGHT_MODE = 1
YAW = 0
PITCH = 1
ROLL = 2
THROTTLE = 3
TEST = 10
def convert_to_flight_uni... | true | true |
1c1cc6efb43348c6969bb58d81a43a3bf892174a | 1,370 | py | Python | src/controllers/model_controller.py | Kotwic4/EduConv-Backend | 7571817f4a139871fdf3027dfb16b13e85b9d03e | [
"MIT"
] | null | null | null | src/controllers/model_controller.py | Kotwic4/EduConv-Backend | 7571817f4a139871fdf3027dfb16b13e85b9d03e | [
"MIT"
] | null | null | null | src/controllers/model_controller.py | Kotwic4/EduConv-Backend | 7571817f4a139871fdf3027dfb16b13e85b9d03e | [
"MIT"
] | null | null | null | import json
import shutil
import threading
import time
from os import path
from flask import jsonify
from src.datasets.scheme_validator import ModelValidator
from src.exceptions.invalid_usage import InvalidUsage
from src.models.db_models import NNModel
class ModelController:
@staticmethod
def _get_model(mo... | 29.148936 | 87 | 0.675912 | import json
import shutil
import threading
import time
from os import path
from flask import jsonify
from src.datasets.scheme_validator import ModelValidator
from src.exceptions.invalid_usage import InvalidUsage
from src.models.db_models import NNModel
class ModelController:
@staticmethod
def _get_model(mo... | true | true |
1c1cc771bacead9d1a9b4fdf449636283be32089 | 294 | py | Python | beyondtheadmin/conftest.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | 1 | 2021-11-27T06:40:34.000Z | 2021-11-27T06:40:34.000Z | beyondtheadmin/conftest.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | 2 | 2021-05-13T04:50:50.000Z | 2022-02-28T21:06:24.000Z | beyondtheadmin/conftest.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | null | null | null | import pytest
from beyondtheadmin.users.models import User
from beyondtheadmin.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
| 19.6 | 60 | 0.785714 | import pytest
from beyondtheadmin.users.models import User
from beyondtheadmin.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
| true | true |
1c1cc7bce61f9e767d639ce126a56606206657ed | 1,351 | py | Python | sublime-packages/Anaconda/anaconda_lib/kite.py | champs/devhost | 84c091a76e90e3448fb55368c38883f7de1fc993 | [
"Unlicense"
] | null | null | null | sublime-packages/Anaconda/anaconda_lib/kite.py | champs/devhost | 84c091a76e90e3448fb55368c38883f7de1fc993 | [
"Unlicense"
] | null | null | null | sublime-packages/Anaconda/anaconda_lib/kite.py | champs/devhost | 84c091a76e90e3448fb55368c38883f7de1fc993 | [
"Unlicense"
] | null | null | null | import sublime
class Integration:
"""Checks if Kite integration is turned on
"""
@classmethod
def enabled(cls):
"""Returns True if Kite integration is enabled
"""
settings = sublime.load_settings('AnacondaKite.sublime-settings')
enabled = settings.get('integrate_with_... | 28.145833 | 73 | 0.606218 | import sublime
class Integration:
@classmethod
def enabled(cls):
settings = sublime.load_settings('AnacondaKite.sublime-settings')
enabled = settings.get('integrate_with_kite', False)
if enabled:
try:
from Kite.lib.installer import check
fr... | true | true |
1c1cc7e351716d862e0cd0b8a79e57fb8c7b168d | 466 | py | Python | src/test/test_gvision.py | joyliao07/401_midterm_wizard_game | 4683c04a5c54f8fa499110cd84b9e5e254139b3c | [
"MIT"
] | 1 | 2019-02-27T01:51:33.000Z | 2019-02-27T01:51:33.000Z | src/test/test_gvision.py | joyliao07/wizards_apprentice | 4683c04a5c54f8fa499110cd84b9e5e254139b3c | [
"MIT"
] | 30 | 2018-12-27T18:33:16.000Z | 2021-09-08T00:48:37.000Z | src/test/test_gvision.py | joyliao07/401_midterm_wizard_game | 4683c04a5c54f8fa499110cd84b9e5e254139b3c | [
"MIT"
] | null | null | null | from ..gvision import ProcessedImage
import os
# TODO:
# test for files other than images
# test for image files with no features
def test_import(app):
assert ProcessedImage
def test_instance(app):
img_source = 'src/test/test_images/test_full_match.png'
assert ProcessedImage(img_source)
def test_lab... | 20.26087 | 59 | 0.753219 | from ..gvision import ProcessedImage
import os
def test_import(app):
assert ProcessedImage
def test_instance(app):
img_source = 'src/test/test_images/test_full_match.png'
assert ProcessedImage(img_source)
def test_labels(app):
img_source = 'src/test/test_images/test_full_match.png'
image ... | true | true |
1c1cc8dfac2d9ec7b7b5ddc64a4746996e69118d | 4,879 | py | Python | aequilibrae/project/network/link_types.py | Art-Ev/aequilibrae | 9f438278e09c875717779bfcc99bf7ba75ed1372 | [
"MIT"
] | 82 | 2018-07-18T09:58:21.000Z | 2022-03-30T15:36:25.000Z | aequilibrae/project/network/link_types.py | Art-Ev/aequilibrae | 9f438278e09c875717779bfcc99bf7ba75ed1372 | [
"MIT"
] | 197 | 2018-06-30T07:01:46.000Z | 2022-03-30T06:30:43.000Z | aequilibrae/project/network/link_types.py | Art-Ev/aequilibrae | 9f438278e09c875717779bfcc99bf7ba75ed1372 | [
"MIT"
] | 29 | 2018-07-16T18:10:39.000Z | 2022-03-30T15:36:26.000Z | from sqlite3 import IntegrityError, Connection
from aequilibrae.project.network.link_type import LinkType
from aequilibrae import logger
from aequilibrae.project.field_editor import FieldEditor
from aequilibrae.project.table_loader import TableLoader
class LinkTypes:
"""
Access to the API resources to manipul... | 36.140741 | 110 | 0.643984 | from sqlite3 import IntegrityError, Connection
from aequilibrae.project.network.link_type import LinkType
from aequilibrae import logger
from aequilibrae.project.field_editor import FieldEditor
from aequilibrae.project.table_loader import TableLoader
class LinkTypes:
__items = {}
def __init__(self, net):
... | true | true |
1c1cc8e566a183b758e386eb7c3f7487aa8a6fd3 | 1,955 | py | Python | python3/koans/about_exceptions.py | bjmccotter7192/PythonKoan | 92759c90824583e7bdd3355c9b5615a67dd69abf | [
"MIT"
] | null | null | null | python3/koans/about_exceptions.py | bjmccotter7192/PythonKoan | 92759c90824583e7bdd3355c9b5615a67dd69abf | [
"MIT"
] | null | null | null | python3/koans/about_exceptions.py | bjmccotter7192/PythonKoan | 92759c90824583e7bdd3355c9b5615a67dd69abf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutExceptions(Koan):
class MySpecialError(RuntimeError):
pass
def test_exceptions_inherit_from_exception(self):
mro = self.MySpecialError.mro()
self.assertEqual('RuntimeError', mro[1].__name__... | 27.152778 | 63 | 0.563171 |
from runner.koan import *
class AboutExceptions(Koan):
class MySpecialError(RuntimeError):
pass
def test_exceptions_inherit_from_exception(self):
mro = self.MySpecialError.mro()
self.assertEqual('RuntimeError', mro[1].__name__)
self.assertEqual('Exception', mro[2... | true | true |
1c1cc9070ea866aba19f25ef30b21762355693ff | 3,120 | py | Python | src/utils.py | karavik18/Orthogonal-Transforms | 7210dbd33cd8dddb5baaa6b018f0ecf5cab30e07 | [
"MIT"
] | null | null | null | src/utils.py | karavik18/Orthogonal-Transforms | 7210dbd33cd8dddb5baaa6b018f0ecf5cab30e07 | [
"MIT"
] | null | null | null | src/utils.py | karavik18/Orthogonal-Transforms | 7210dbd33cd8dddb5baaa6b018f0ecf5cab30e07 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import numpy as np
import math
def getSequence():
inSequence = np.array([])
inSeqString = input("\nPlease enter the array (elements separated by space): ")
seqSplited = inSeqString.split()
for i in range(len(seqSplited)):
inSe... | 26.440678 | 91 | 0.530128 |
import numpy as np
import math
def getSequence():
inSequence = np.array([])
inSeqString = input("\nPlease enter the array (elements separated by space): ")
seqSplited = inSeqString.split()
for i in range(len(seqSplited)):
inSequence = np.append(inSequence, float(seqSplited[i]))
return i... | true | true |
1c1cca450c413e00f403c7a691ca24e29107bd14 | 9,573 | py | Python | examples/pytorch/ogb/ogbn-products/graphsage/main.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | examples/pytorch/ogb/ogbn-products/graphsage/main.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | examples/pytorch/ogb/ogbn-products/graphsage/main.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import dgl.nn.pytorch as dglnn
import time
import argparse
import tqdm
from ogb.nodeproppred import DglNodePropPredDataset
class SAGE(nn.Module):
def __init__(self,
in... | 40.222689 | 136 | 0.61569 | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import dgl.nn.pytorch as dglnn
import time
import argparse
import tqdm
from ogb.nodeproppred import DglNodePropPredDataset
class SAGE(nn.Module):
def __init__(self,
in... | true | true |
1c1ccb0ab461b6bab8a724406d4fe9fff1133885 | 24,007 | py | Python | src/sensai/evaluation/eval_util.py | schroedk/sensAI | a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7 | [
"MIT"
] | null | null | null | src/sensai/evaluation/eval_util.py | schroedk/sensAI | a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7 | [
"MIT"
] | null | null | null | src/sensai/evaluation/eval_util.py | schroedk/sensAI | a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7 | [
"MIT"
] | null | null | null | """
This module contains methods and classes that facilitate evaluation of different types of models. The suggested
workflow for evaluation is to use these higher-level functionalities instead of instantiating
the evaluation classes directly.
"""
# TODO: provide a notebook (and possibly an rst file) that illustrates st... | 57.987923 | 267 | 0.725538 |
import logging
from abc import ABC, abstractmethod
from typing import Tuple, Dict, Any, Union, Generic, TypeVar, Optional, Sequence, Callable
import matplotlib.figure
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from .crossval import VectorModelCrossValidationData, VectorRegressionMode... | true | true |
1c1ccb68b2da1e0f86a214ab32d76aac8a65e1d6 | 1,747 | py | Python | tests/integration/cli/batch.py | necrose99/salt | 19dcace67925fb589b926dee28c68b9ad91c008c | [
"Apache-2.0"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | tests/integration/cli/batch.py | necrose99/salt | 19dcace67925fb589b926dee28c68b9ad91c008c | [
"Apache-2.0"
] | null | null | null | tests/integration/cli/batch.py | necrose99/salt | 19dcace67925fb589b926dee28c68b9ad91c008c | [
"Apache-2.0"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
import integration
class BatchTest(i... | 28.639344 | 84 | 0.618203 |
from __future__ import absolute_import
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
import integration
class BatchTest(integration.ShellCase):
def test_batch_run(self):
ret = 'Executing run on [\'sub_minion\']'
cmd = self.run_salt('\'*\' test.echo \'batch t... | true | true |
1c1ccc2a26e0c0549c25f943b2623179d2348a05 | 900 | py | Python | File/views.py | alstn2468/Likelion_DRF_Project | 35a359a05185f551ed2e999ab17e0108a69d6b57 | [
"MIT"
] | 28 | 2019-10-15T13:15:26.000Z | 2021-11-08T08:23:45.000Z | 15_LikeLionDRFProject/File/views.py | jhleed/LikeLion_Django_Study_Summary | c788182af5bcfd16bdd4b57235a48659758e494b | [
"MIT"
] | null | null | null | 15_LikeLionDRFProject/File/views.py | jhleed/LikeLion_Django_Study_Summary | c788182af5bcfd16bdd4b57235a48659758e494b | [
"MIT"
] | 17 | 2019-09-09T00:15:36.000Z | 2021-01-28T13:08:51.000Z | from rest_framework import viewsets
from .models import File
from .serializer import FileSerializer
from rest_framework.parsers import MultiPartParser, FormParser
from rest_framework.response import Response
from rest_framework import status
class FileViewSet(viewsets.ModelViewSet):
queryset = File.objects.all()
... | 31.034483 | 63 | 0.696667 | from rest_framework import viewsets
from .models import File
from .serializer import FileSerializer
from rest_framework.parsers import MultiPartParser, FormParser
from rest_framework.response import Response
from rest_framework import status
class FileViewSet(viewsets.ModelViewSet):
queryset = File.objects.all()
... | true | true |
1c1ccd260e9272de975fff6846c26f981cac738f | 1,053 | py | Python | Chapter_11/try_11.2/test_cities3.py | charliealpha094/Python_Crash_Course_2nd_edition | 9d1548b775c861fd63890ccee19a9101eb0c5c6b | [
"MIT"
] | null | null | null | Chapter_11/try_11.2/test_cities3.py | charliealpha094/Python_Crash_Course_2nd_edition | 9d1548b775c861fd63890ccee19a9101eb0c5c6b | [
"MIT"
] | null | null | null | Chapter_11/try_11.2/test_cities3.py | charliealpha094/Python_Crash_Course_2nd_edition | 9d1548b775c861fd63890ccee19a9101eb0c5c6b | [
"MIT"
] | null | null | null | #Done by Carlos Amaral in 17/07/2020
# Population
"""
Modify your function so it requires a third parameter,
population . It should now return a single string of the form City, Country –
population xxx , such as Santiago, Chile – population 5000000 . Run test
_cities.py again. Make sure test_city_country() fails thi... | 33.967742 | 77 | 0.760684 |
import unittest
from city_functions2 import get_formatted_place
class CitiesTestCase (unittest.TestCase):
def test_city_country(self):
formatted_place = get_formatted_place('Porto', 'Portugal')
self.assertEqual(formatted_place, 'Porto Portugal')
if __name__ == '__main__':
unittest.main... | true | true |
1c1ccdf87fce069d2f9e9911d7264f8abe0d55d0 | 705 | py | Python | Curso_Gustavo_Guanabara/Exercicio028_melhorado.py | Nathan120/Arq_Python_CursoEmVideo | d6269eeaa8db57d1ffa8ed66e1936a061803f37e | [
"MIT"
] | null | null | null | Curso_Gustavo_Guanabara/Exercicio028_melhorado.py | Nathan120/Arq_Python_CursoEmVideo | d6269eeaa8db57d1ffa8ed66e1936a061803f37e | [
"MIT"
] | null | null | null | Curso_Gustavo_Guanabara/Exercicio028_melhorado.py | Nathan120/Arq_Python_CursoEmVideo | d6269eeaa8db57d1ffa8ed66e1936a061803f37e | [
"MIT"
] | null | null | null | import random
n = random.randrange(0,5)
n2 = int(input('Digite um número = '))
c = 1
if n2 == n:
print('Você acertou o número que o pc escolheu ')
print('Seu numero foi {} o que do pc {} '.format(n2, n))
print('Foi necessario apenas {} tentativa para acertar'.format(c))
while n != n2:
print('Você errou... | 35.25 | 70 | 0.604255 | import random
n = random.randrange(0,5)
n2 = int(input('Digite um número = '))
c = 1
if n2 == n:
print('Você acertou o número que o pc escolheu ')
print('Seu numero foi {} o que do pc {} '.format(n2, n))
print('Foi necessario apenas {} tentativa para acertar'.format(c))
while n != n2:
print('Você errou... | true | true |
1c1cce6b0ae4324268ad5408ca80e759afda86bf | 2,814 | py | Python | tests/core/testtree.py | scaine1/holoviews | 2b08fa169a058f0aa77b94bec69ee23414cf52d1 | [
"BSD-3-Clause"
] | null | null | null | tests/core/testtree.py | scaine1/holoviews | 2b08fa169a058f0aa77b94bec69ee23414cf52d1 | [
"BSD-3-Clause"
] | null | null | null | tests/core/testtree.py | scaine1/holoviews | 2b08fa169a058f0aa77b94bec69ee23414cf52d1 | [
"BSD-3-Clause"
] | 1 | 2019-10-29T12:23:38.000Z | 2019-10-29T12:23:38.000Z | from holoviews.core.element import AttrTree
from holoviews.element.comparison import ComparisonTestCase
class AttrTreeTest(ComparisonTestCase):
"For testing of AttrTree"
def setUp(self):
self.tree = AttrTree([(('A', 'I'), 1), (('B', 'II'), 2)])
def test_access_nodes(self):
self.assertEqu... | 30.923077 | 65 | 0.61123 | from holoviews.core.element import AttrTree
from holoviews.element.comparison import ComparisonTestCase
class AttrTreeTest(ComparisonTestCase):
def setUp(self):
self.tree = AttrTree([(('A', 'I'), 1), (('B', 'II'), 2)])
def test_access_nodes(self):
self.assertEqual(self.tree.A.I, 1)
s... | true | true |
1c1cce7ee94a498ef91f867834860584e511d316 | 324,111 | py | Python | catboost/pytest/test.py | vazgenk/catboost | dc7a55065ce2ef0dc140a35b06e6cf4dcd851ac5 | [
"Apache-2.0"
] | null | null | null | catboost/pytest/test.py | vazgenk/catboost | dc7a55065ce2ef0dc140a35b06e6cf4dcd851ac5 | [
"Apache-2.0"
] | null | null | null | catboost/pytest/test.py | vazgenk/catboost | dc7a55065ce2ef0dc140a35b06e6cf4dcd851ac5 | [
"Apache-2.0"
] | null | null | null | from itertools import permutations
import yatest.common
from yatest.common import ExecutionTimeoutError, ExecutionError
import pytest
import os
import filecmp
import numpy as np
import timeit
import json
import catboost
from catboost_pytest_lib import (
apply_catboost,
compare_evals_with_precision,
compar... | 37.383045 | 189 | 0.636217 | from itertools import permutations
import yatest.common
from yatest.common import ExecutionTimeoutError, ExecutionError
import pytest
import os
import filecmp
import numpy as np
import timeit
import json
import catboost
from catboost_pytest_lib import (
apply_catboost,
compare_evals_with_precision,
compar... | true | true |
1c1cd01b76334435e790599f02f059bb1670c52a | 3,930 | py | Python | Bioinformatics VI/Week IV/ViterbiAlgorithm.py | egeulgen/Bioinformatics_Specialization | 38581b471a54c41d780d9eeb26a7033eb57f3a01 | [
"MIT"
] | 3 | 2021-04-03T23:46:42.000Z | 2021-08-08T01:19:32.000Z | Bioinformatics VI/Week IV/ViterbiAlgorithm.py | egeulgen/Bioinformatics_Specialization | 38581b471a54c41d780d9eeb26a7033eb57f3a01 | [
"MIT"
] | null | null | null | Bioinformatics VI/Week IV/ViterbiAlgorithm.py | egeulgen/Bioinformatics_Specialization | 38581b471a54c41d780d9eeb26a7033eb57f3a01 | [
"MIT"
] | null | null | null | import sys
def Viterbi(x, all_states, transition_matrix, emission_matrix):
''' Implementation of the Viterbi algorithm for solving the Decoding Problem
Input: A string x, followed by the alphabet from which x was constructed,
followed by the states States, transition matrix Transition, and emission matrix... | 43.666667 | 178 | 0.614249 | import sys
def Viterbi(x, all_states, transition_matrix, emission_matrix):
init_transition_prob = 1 / len(all_states)
Score_dict = {}
for i in range(len(x)):
backtrace[i] = {}
for current_state in all_states:
if current_state not in Score_dict.keys():
Score_dic... | true | true |
1c1cd0aab13a31f312e2caa65b9fd04f3f11856d | 21,234 | py | Python | nova/virt/firewall.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-02-21T19:19:11.000Z | 2020-02-21T19:19:11.000Z | nova/virt/firewall.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | null | null | null | nova/virt/firewall.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:52:14.000Z | 2020-07-24T08:52:14.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2011 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | 38.467391 | 79 | 0.59254 |
from oslo.config import cfg
from nova.compute import utils as compute_utils
from nova import context
from nova.network import linux_net
from nova.openstack.common.gettextutils import _
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
from nova import uti... | true | true |
1c1cd0c77ac5040ea9dc1f682e075489b1b773d9 | 2,615 | py | Python | ec2_spot/ec2_spot_stack.py | sebranchett/ec2-spot | 6785f29b14cbbcf620e4693650b15878627fc250 | [
"Apache-2.0"
] | null | null | null | ec2_spot/ec2_spot_stack.py | sebranchett/ec2-spot | 6785f29b14cbbcf620e4693650b15878627fc250 | [
"Apache-2.0"
] | null | null | null | ec2_spot/ec2_spot_stack.py | sebranchett/ec2-spot | 6785f29b14cbbcf620e4693650b15878627fc250 | [
"Apache-2.0"
] | null | null | null | from base64 import b64encode
# from base64 import b64encode, decode
from aws_cdk import (
# Duration,
Stack,
CfnTag,
aws_ec2 as ec2,
)
from constructs import Construct
# Set Up
# amazon/Deep Learning Base AMI (Amazon Linux) Version 31.1
# in Frankfurt, found using:
# https://docs.aws.amazon.com/AWSEC2/... | 34.866667 | 96 | 0.549522 | from base64 import b64encode
from aws_cdk import (
Stack,
CfnTag,
aws_ec2 as ec2,
)
from constructs import Construct
ed4e51280"
my_instance_types = ["t2.small", "t2.medium", "m3.medium"]
my_max_spot_price = "0.08"
my_tags = [ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
resource_type="in... | true | true |
1c1cd0e44417cd753d2dd2376c6b05a4b1e765f1 | 9,465 | py | Python | src/act/common/aCTReport.py | ATLASControlTower/aCT | fb841bddbe086db9f0d620167c4a11ae4634ef4f | [
"Apache-2.0"
] | null | null | null | src/act/common/aCTReport.py | ATLASControlTower/aCT | fb841bddbe086db9f0d620167c4a11ae4634ef4f | [
"Apache-2.0"
] | 8 | 2019-12-12T14:41:50.000Z | 2020-12-04T21:06:44.000Z | src/act/common/aCTReport.py | ATLASControlTower/aCT | fb841bddbe086db9f0d620167c4a11ae4634ef4f | [
"Apache-2.0"
] | 4 | 2018-02-05T11:25:20.000Z | 2018-07-19T09:53:13.000Z | import argparse
import importlib
import os
import re
import signal
import subprocess
import sys
import time
import logging
from act.common import aCTLogger
from act.common.aCTConfig import aCTConfigAPP
from act.arc import aCTDBArc
class aCTReport:
'''Print summary info on jobs in DB. Use --web to print html that ... | 32.979094 | 123 | 0.481247 | import argparse
import importlib
import os
import re
import signal
import subprocess
import sys
import time
import logging
from act.common import aCTLogger
from act.common.aCTConfig import aCTConfigAPP
from act.arc import aCTDBArc
class aCTReport:
def __init__(self, args):
self.output = ""
self.o... | true | true |
1c1cd1449d3a1a95c499c9ef5a3154c2b163df67 | 463 | py | Python | src/utils.py | queensferryme/smms.py | 25acec06d2dfab087dfbe40fa6ceef20412fdb2f | [
"MIT"
] | 5 | 2018-09-25T09:55:43.000Z | 2019-11-06T14:55:41.000Z | src/utils.py | queensferryme/smms.py | 25acec06d2dfab087dfbe40fa6ceef20412fdb2f | [
"MIT"
] | null | null | null | src/utils.py | queensferryme/smms.py | 25acec06d2dfab087dfbe40fa6ceef20412fdb2f | [
"MIT"
] | null | null | null | '''Utils for convenience'''
from click import style
# Console ascii-color helpers
def error(string, bg=False):
return style(string, bg='red', bold=True) if bg else style(string, fg='red', bold=True)
def success(string, bg=False):
return style(string, bg='green', bold=True) if bg else style(string, fg='green'... | 33.071429 | 97 | 0.704104 |
from click import style
def error(string, bg=False):
return style(string, bg='red', bold=True) if bg else style(string, fg='red', bold=True)
def success(string, bg=False):
return style(string, bg='green', bold=True) if bg else style(string, fg='green', bold=True)
def warning(string, bg=False):
return s... | true | true |
1c1cd267d1d89cd234b6582506e1df6996ae386a | 19,119 | py | Python | tests/logs/test_step.py | irskep/mrjob | e21e4f55e38007c00213a478e1465f04833cce75 | [
"Apache-2.0"
] | null | null | null | tests/logs/test_step.py | irskep/mrjob | e21e4f55e38007c00213a478e1465f04833cce75 | [
"Apache-2.0"
] | null | null | null | tests/logs/test_step.py | irskep/mrjob | e21e4f55e38007c00213a478e1465f04833cce75 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2016 Yelp
#
# 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, softwa... | 34.324955 | 87 | 0.560176 |
import errno
from mrjob.logs.step import _interpret_emr_step_logs
from mrjob.logs.step import _interpret_hadoop_jar_command_stderr
from mrjob.logs.step import _ls_emr_step_logs
from mrjob.logs.step import _match_emr_step_log_path
from mrjob.logs.step import _parse_indented_counters
from mrjob.logs.step im... | true | true |
1c1cd30bf836aa5bf30dc5f0b6fef0bbe8e365a1 | 142 | py | Python | Front/apps.py | Rat-Shop/RatShop | e3878584fe8cd865bd00a36b0b039e543aaf85aa | [
"MIT"
] | null | null | null | Front/apps.py | Rat-Shop/RatShop | e3878584fe8cd865bd00a36b0b039e543aaf85aa | [
"MIT"
] | null | null | null | Front/apps.py | Rat-Shop/RatShop | e3878584fe8cd865bd00a36b0b039e543aaf85aa | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FrontConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Front'
| 20.285714 | 56 | 0.753521 | from django.apps import AppConfig
class FrontConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Front'
| true | true |
1c1cd34b13e4e7dfe405896e226d88fba4246dd5 | 5,486 | py | Python | examples/DecryptLoginExamples/crawlers/weibolottery/weibolottery.py | hedou/DecryptLogin | ff86a5d378c8a42d1caebbb7482658a95053f716 | [
"Apache-2.0"
] | null | null | null | examples/DecryptLoginExamples/crawlers/weibolottery/weibolottery.py | hedou/DecryptLogin | ff86a5d378c8a42d1caebbb7482658a95053f716 | [
"Apache-2.0"
] | null | null | null | examples/DecryptLoginExamples/crawlers/weibolottery/weibolottery.py | hedou/DecryptLogin | ff86a5d378c8a42d1caebbb7482658a95053f716 | [
"Apache-2.0"
] | null | null | null | '''
Function:
微博自动转发抽奖
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import re
import time
import random
from DecryptLogin import login
'''微博自动转发抽奖'''
class WeiboLottery():
def __init__(self, username='charlespikachu', password='微信公众号: Charles的皮卡丘', time_interval=1800):
self.username = username
... | 43.539683 | 156 | 0.546482 | import re
import time
import random
from DecryptLogin import login
class WeiboLottery():
def __init__(self, username='charlespikachu', password='微信公众号: Charles的皮卡丘', time_interval=1800):
self.username = username
self.password = password
self.time_interval = time_interval
self.comme... | true | true |
1c1cd3f97d2ed7a3a5d1f92d752c9181e94ff016 | 69,528 | py | Python | tests/utils/test_exporter.py | ITProKyle/poetry | f462b7f8c3885585a20cf631d6542049518195c3 | [
"MIT"
] | null | null | null | tests/utils/test_exporter.py | ITProKyle/poetry | f462b7f8c3885585a20cf631d6542049518195c3 | [
"MIT"
] | null | null | null | tests/utils/test_exporter.py | ITProKyle/poetry | f462b7f8c3885585a20cf631d6542049518195c3 | [
"MIT"
] | null | null | null | from __future__ import annotations
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Iterator
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.core.toml.file import TOMLFile
from poetry.factory import Factory
from poetry.p... | 32.055325 | 113 | 0.445001 | from __future__ import annotations
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Iterator
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.core.toml.file import TOMLFile
from poetry.factory import Factory
from poetry.p... | true | true |
1c1cd5b964a8f6cbc0e2567aedf2a1ba5ac6decd | 812 | py | Python | src/rozbieznosci_if/models.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T19:50:02.000Z | 2017-04-27T19:50:02.000Z | src/rozbieznosci_if/models.py | mpasternak/django-bpp | 434338821d5ad1aaee598f6327151aba0af66f5e | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/rozbieznosci_if/models.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
class IgnorujRozbieznoscIf(models.Model):
object = GenericForeignKey()
content_type = models.ForeignKey(
"contenttypes.ContentType", on_delete=models.CASCADE
)
object_id = models.PositiveIntegerFiel... | 33.833333 | 100 | 0.724138 | from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
class IgnorujRozbieznoscIf(models.Model):
object = GenericForeignKey()
content_type = models.ForeignKey(
"contenttypes.ContentType", on_delete=models.CASCADE
)
object_id = models.PositiveIntegerFiel... | true | true |
1c1cd654892348d5fdfca6f41cd715c243b167cd | 2,711 | py | Python | sdks/python/apache_beam/examples/complete/game/leader_board_test.py | hengfengli/beam | 83a8855e5997e0311e6274c03bcb38f94efbf8ef | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/examples/complete/game/leader_board_test.py | hengfengli/beam | 83a8855e5997e0311e6274c03bcb38f94efbf8ef | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/examples/complete/game/leader_board_test.py | hengfengli/beam | 83a8855e5997e0311e6274c03bcb38f94efbf8ef | [
"PSF-2.0",
"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... | 36.635135 | 78 | 0.709701 |
import logging
import unittest
import apache_beam as beam
from apache_beam.examples.complete.game import leader_board
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import assert_that
from apa... | true | true |
1c1cd8723ce98c0e583bee9baa0a4182ada99c0f | 6,455 | py | Python | LUCI/LuciFitParameters.py | lyalcorn/LUCI | ed9dde4286ca80694f53a3a50e1da2073a92ff76 | [
"MIT"
] | null | null | null | LUCI/LuciFitParameters.py | lyalcorn/LUCI | ed9dde4286ca80694f53a3a50e1da2073a92ff76 | [
"MIT"
] | null | null | null | LUCI/LuciFitParameters.py | lyalcorn/LUCI | ed9dde4286ca80694f53a3a50e1da2073a92ff76 | [
"MIT"
] | null | null | null | """
In this file we have the functions used to calculate the velocity, the velocity dispersion (broadening),
and the flux as well as their uncertainties.
"""
import math
import numpy as np
from scipy import special as sps
# Define Constants #
SPEED_OF_LIGHT = 299792 # km/s
FWHM_COEFF = 2.*math.sqrt(2. * math.log(2.))... | 35.662983 | 142 | 0.650194 | import math
import numpy as np
from scipy import special as sps
SPEED_OF_LIGHT = 299792
FWHM_COEFF = 2.*math.sqrt(2. * math.log(2.))
def calculate_vel(ind, lines, fit_sol, line_dict):
line_name = lines[ind]
l_calc = 1e7 / fit_sol[3*ind+1]
l_shift = (l_calc - line_dict[line_name]) / line_dict[line_name... | true | true |
1c1cd8bde93d12038527d9a3857ca674a7844e5e | 7,336 | py | Python | qutebrowser/themes/base16-qutebrowser/themes/base16-material.config.py | ebzzry/dotfiles | 0c775392a031c0e24ee7b165f2533a4254eedc78 | [
"CC0-1.0"
] | 30 | 2016-06-17T01:52:37.000Z | 2021-08-20T11:39:30.000Z | qutebrowser/themes/base16-qutebrowser/themes/base16-material.config.py | ebzzry/dotfiles | 0c775392a031c0e24ee7b165f2533a4254eedc78 | [
"CC0-1.0"
] | null | null | null | qutebrowser/themes/base16-qutebrowser/themes/base16-material.config.py | ebzzry/dotfiles | 0c775392a031c0e24ee7b165f2533a4254eedc78 | [
"CC0-1.0"
] | 3 | 2019-04-08T13:09:10.000Z | 2019-11-04T12:20:43.000Z | # base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova
# Material scheme by Nate Peterson
base00 = "#263238"
base01 = "#2E3C43"
base02 = "#314549"
base03 = "#546E7A"
base04 = "#B2CCD6"
base05 = "#EEFFFF"
base06 = "#EEFFFF"
base07 = "#FFFFFF"
base08 = "#F07178"
base0... | 28.996047 | 71 | 0.770447 |
base00 = "#263238"
base01 = "#2E3C43"
base02 = "#314549"
base03 = "#546E7A"
base04 = "#B2CCD6"
base05 = "#EEFFFF"
base06 = "#EEFFFF"
base07 = "#FFFFFF"
base08 = "#F07178"
base09 = "#F78C6C"
base0A = "#FFCB6B"
base0B = "#C3E88D"
base0C = "#89DDFF"
base0D = "#82AAFF"
base0E = "#C792EA"
base0F = "#FF5370"
c.color... | true | true |
1c1cd94c17676ae7c32436d95cef4cc623b5e00c | 623 | py | Python | tests/test_rnd.py | QuantLet/spd_trading | 1f4d7a732a96fde88d91b1ae94344bc342a8eed9 | [
"MIT"
] | 2 | 2021-04-28T09:39:51.000Z | 2021-10-22T03:11:15.000Z | tests/test_rnd.py | QuantLet/spd_trading | 1f4d7a732a96fde88d91b1ae94344bc342a8eed9 | [
"MIT"
] | null | null | null | tests/test_rnd.py | QuantLet/spd_trading | 1f4d7a732a96fde88d91b1ae94344bc342a8eed9 | [
"MIT"
] | 2 | 2021-05-12T08:21:15.000Z | 2021-12-07T17:05:58.000Z | from spd_trading import risk_neutral_density as rnd
def test_get_rnd(rnd_input_data, evaluation_day, evaluation_tau):
RND = rnd.Calculator(
data=rnd_input_data,
tau_day=evaluation_tau,
date=evaluation_day,
sampling="slicing",
n_sections=15,
loss="MSE",
kerne... | 29.666667 | 65 | 0.638844 | from spd_trading import risk_neutral_density as rnd
def test_get_rnd(rnd_input_data, evaluation_day, evaluation_tau):
RND = rnd.Calculator(
data=rnd_input_data,
tau_day=evaluation_tau,
date=evaluation_day,
sampling="slicing",
n_sections=15,
loss="MSE",
kerne... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.