hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4075292667381a58b69acdd7965c603d6dc88e | 6,850 | py | Python | src/python3/request/calendar_groups_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | 7 | 2019-07-17T06:59:53.000Z | 2021-05-13T15:23:37.000Z | src/python3/request/calendar_groups_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | null | null | null | src/python3/request/calendar_groups_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | 2 | 2020-06-30T13:06:59.000Z | 2021-06-03T09:47:35.000Z | # -*- coding: utf-8 -*-
"""
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
"""
from __future__ import unicode_literals
from ..collection_base impo... | 41.26506 | 151 | 0.676204 |
from __future__ import unicode_literals
from ..collection_base import CollectionRequestBase, CollectionResponseBase, CollectionPageBase
from ..request_builder_base import RequestBuilderBase
from ..request import calendar_group_request_builder
from ..model.calendar_group import CalendarGroup
import json
import asyncio... | true | true |
1c4076133d2531bdb57097d627ff8fbc5b0dfd03 | 5,555 | py | Python | anyway/widgets/suburban_widgets/motorcycle_accidents_vs_all_accidents_widget.py | shaysw/anyway | 35dec531fd4ac79c99d09e684027df017e989ddc | [
"MIT"
] | null | null | null | anyway/widgets/suburban_widgets/motorcycle_accidents_vs_all_accidents_widget.py | shaysw/anyway | 35dec531fd4ac79c99d09e684027df017e989ddc | [
"MIT"
] | null | null | null | anyway/widgets/suburban_widgets/motorcycle_accidents_vs_all_accidents_widget.py | shaysw/anyway | 35dec531fd4ac79c99d09e684027df017e989ddc | [
"MIT"
] | null | null | null | import datetime
from typing import List
import pandas as pd
from sqlalchemy import case, literal_column, func, distinct, desc
from anyway.request_params import RequestParams
from anyway.backend_constants import BE_CONST, AccidentSeverity
from anyway.widgets.widget_utils import get_query
from anyway.models im... | 39.678571 | 156 | 0.59586 | import datetime
from typing import List
import pandas as pd
from sqlalchemy import case, literal_column, func, distinct, desc
from anyway.request_params import RequestParams
from anyway.backend_constants import BE_CONST, AccidentSeverity
from anyway.widgets.widget_utils import get_query
from anyway.models im... | true | true |
1c40763425a3dd4fa423267ce2489d4f3864d171 | 10,271 | py | Python | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
"""Recipe for training a classifier using the
mobvoihotwords Dataset.
To run this recipe, use the following command:
> python train.py {hyperparameter_file}
Using your own hyperparameter file or one of the following:
hyperparams/xvect.yaml (xvector system)
"""
import os
import sys
import torch... | 33.565359 | 80 | 0.634115 | import os
import sys
import torch
import torchaudio
import speechbrain as sb
from hyperpyyaml import load_hyperpyyaml
from speechbrain.utils.distributed import run_on_main
from sklearn.metrics import confusion_matrix
import numpy as np
label_list = []
output_list = []
global output_array
global label_array
output_arr... | true | true |
1c407682bc1aa17b328c6916ee6337b8b41d7e77 | 40,315 | py | Python | tests/test_date_parser.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_date_parser.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_date_parser.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import unittest
from datetime import datetime, timedelta
from functools import wraps
from operator import attrgetter
import six
from mock import patch, Mock
from nose_parameterized import parameterized, param
import dateparser.timezone_parser
from dateparser.da... | 51.685897 | 126 | 0.627781 | from __future__ import unicode_literals
import unittest
from datetime import datetime, timedelta
from functools import wraps
from operator import attrgetter
import six
from mock import patch, Mock
from nose_parameterized import parameterized, param
import dateparser.timezone_parser
from dateparser.date import DateDa... | true | true |
1c4076c85e14c5bd3849ea13543d080b510e08e1 | 12,264 | py | Python | mars/services/task/tests/test_service.py | qinxuye/mars | 3b10fd4b40fbaf1526c179709fdbcc3a1f899ab7 | [
"Apache-2.0"
] | null | null | null | mars/services/task/tests/test_service.py | qinxuye/mars | 3b10fd4b40fbaf1526c179709fdbcc3a1f899ab7 | [
"Apache-2.0"
] | null | null | null | mars/services/task/tests/test_service.py | qinxuye/mars | 3b10fd4b40fbaf1526c179709fdbcc3a1f899ab7 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.020888 | 103 | 0.679713 |
import asyncio
import time
import numpy as np
import pytest
import mars.oscar as mo
import mars.remote as mr
from mars.core import TileableGraph, TileableGraphBuilder
from mars.core.context import get_context
from mars.services import start_services, NodeRole
from mars.services.session import SessionAPI
from mars.se... | true | true |
1c4076e540d68a9547420103d4ad6383ba1ec3cc | 2,384 | py | Python | server/workers/base/src/base.py | dasch124/Headstart | 9eb37ce458a24fd42b22f2aa15c53ac46a69f9bf | [
"MIT"
] | 111 | 2016-12-10T17:27:46.000Z | 2022-03-29T02:57:19.000Z | server/workers/base/src/base.py | dasch124/Headstart | 9eb37ce458a24fd42b22f2aa15c53ac46a69f9bf | [
"MIT"
] | 338 | 2016-12-04T17:43:28.000Z | 2022-03-04T15:50:33.000Z | server/workers/base/src/base.py | dasch124/Headstart | 9eb37ce458a24fd42b22f2aa15c53ac46a69f9bf | [
"MIT"
] | 32 | 2016-12-19T12:48:00.000Z | 2022-02-12T17:47:47.000Z | import json
import subprocess
import pandas as pd
import logging
from common.r_wrapper import RWrapper
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
class BaseClient(RWrapper):
def next_item(self):
queue, msg = se... | 36.676923 | 111 | 0.518876 | import json
import subprocess
import pandas as pd
import logging
from common.r_wrapper import RWrapper
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
class BaseClient(RWrapper):
def next_item(self):
queue, msg = se... | true | true |
1c4076e641e754b295b1a76ea44a40f0f9c23f5f | 10,843 | py | Python | google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 35.55082 | 101 | 0.647883 | import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import pkg_resources
import google.auth import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import oper... | true | true |
1c4076f88b85fdfb5685a007425e937b013824ff | 2,019 | py | Python | api/src/rapidapi/nutritionix.py | carlotacb/foodlord | 3e2379e47ea31474f4a18c2e5904980a34165ae6 | [
"MIT"
] | 8 | 2019-02-23T18:48:33.000Z | 2020-01-14T11:48:33.000Z | api/src/rapidapi/nutritionix.py | andreugallofre/foodlord | 3e2379e47ea31474f4a18c2e5904980a34165ae6 | [
"MIT"
] | null | null | null | api/src/rapidapi/nutritionix.py | andreugallofre/foodlord | 3e2379e47ea31474f4a18c2e5904980a34165ae6 | [
"MIT"
] | 3 | 2019-02-24T20:27:42.000Z | 2019-02-27T11:36:28.000Z | import requests
import os
from src import *
from src.util import log
def __api_request(ingredient):
data = {
'appId': 'cd730bdb',
'appKey': '0555561b71a1ebfa3479c8fd1d966b8c',
'prhase': ingredient,
'fields': ['item_name', 'brand_name', 'nf_calories'],
'filters': {
... | 26.565789 | 82 | 0.607727 | import requests
import os
from src import *
from src.util import log
def __api_request(ingredient):
data = {
'appId': 'cd730bdb',
'appKey': '0555561b71a1ebfa3479c8fd1d966b8c',
'prhase': ingredient,
'fields': ['item_name', 'brand_name', 'nf_calories'],
'filters': {
... | true | true |
1c40787ba009b629beac95a38d431fdc2146936a | 3,040 | py | Python | test/unit/test_azure_blob_remove_public_access.py | kshrutik/secure-state-remediation-jobs | dc0a5acc3a74dd70d0b18e448124761a8481990d | [
"Apache-2.0"
] | 13 | 2020-08-07T17:48:19.000Z | 2022-02-17T17:17:04.000Z | test/unit/test_azure_blob_remove_public_access.py | kshrutik/secure-state-remediation-jobs | dc0a5acc3a74dd70d0b18e448124761a8481990d | [
"Apache-2.0"
] | 27 | 2020-08-19T18:42:44.000Z | 2021-10-04T05:35:05.000Z | test/unit/test_azure_blob_remove_public_access.py | kshrutik/secure-state-remediation-jobs | dc0a5acc3a74dd70d0b18e448124761a8481990d | [
"Apache-2.0"
] | 23 | 2020-08-12T13:09:08.000Z | 2021-09-16T11:59:17.000Z | # Copyright (c) 2020 VMware Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 44.057971 | 654 | 0.684539 |
import pytest
from mock import Mock
from remediation_worker.jobs.azure_blob_remove_public_access.azure_blob_remove_public_access import (
StorageBlobRemovePublicAccess,
)
@pytest.fixture
def valid_payload():
return """
{
"notificationInfo": {
"RuleId": "5c6cc5e103dcc90f363146cd",
"Servic... | true | true |
1c4078f5eb934c119808576ac595981540e733de | 4,134 | py | Python | test_project/test_app/views.py | mblayman/django-test-plus | 691ce7bcb2e4c31cb0958a53548f49277d9305c2 | [
"BSD-3-Clause"
] | 530 | 2015-05-23T18:25:39.000Z | 2022-03-20T14:30:10.000Z | test_project/test_app/views.py | mblayman/django-test-plus | 691ce7bcb2e4c31cb0958a53548f49277d9305c2 | [
"BSD-3-Clause"
] | 144 | 2015-05-27T04:09:15.000Z | 2021-11-24T15:32:08.000Z | test_project/test_app/views.py | mblayman/django-test-plus | 691ce7bcb2e4c31cb0958a53548f49277d9305c2 | [
"BSD-3-Clause"
] | 62 | 2015-05-27T02:47:19.000Z | 2022-02-11T21:01:36.000Z | import json
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseGone
from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views import generic
from .forms import DataForm, NameForm
from .models import Dat... | 21.989362 | 112 | 0.688195 | import json
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseGone
from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views import generic
from .forms import DataForm, NameForm
from .models import Dat... | true | true |
1c407a36b89b5ec80b8a9ce3e8a4466d21e5f77d | 5,390 | py | Python | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_igw_info.py | ginigangadharan/ansible-real-life | 897c2fc0d05babbb540768b336b6ad399dad5bfa | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_igw_info.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | null | null | null | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_igw_info.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 32.666667 | 130 | 0.62987 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: ec2_vpc_igw_info
short_description: Gather information abo... | true | true |
1c407a6298b4da99045109389a17c51b109e624a | 38,694 | py | Python | test/functional/test_framework/messages.py | AtomicLemon/bitcoinflex | fe02bd48be01e08a047ef8d5821eb247a0681306 | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | AtomicLemon/bitcoinflex | fe02bd48be01e08a047ef8d5821eb247a0681306 | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | AtomicLemon/bitcoinflex | fe02bd48be01e08a047ef8d5821eb247a0681306 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 29.447489 | 262 | 0.596527 | from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70914 MY_SUBVERSION = b"/python... | true | true |
1c407a8836fca2986284f537934f9013606eda28 | 5,204 | py | Python | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | null | null | null | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | null | null | null | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | 1 | 2021-02-23T21:13:47.000Z | 2021-02-23T21:13:47.000Z | import os
import codecs
import re
import logging
lg = logging.getLogger('schemaparser')
LANG_NAME="Python"
MODULE_TEMPLATE = """
{license}
from pymei import MeiElement
{classes}
"""
MODULE_CLASS_TEMPLATE = """
class {className}_(MeiElement):
def __init__(self):
MeiElement.__init__(self, "{className}")
... | 32.525 | 101 | 0.637779 | import os
import codecs
import re
import logging
lg = logging.getLogger('schemaparser')
LANG_NAME="Python"
MODULE_TEMPLATE = """
{license}
from pymei import MeiElement
{classes}
"""
MODULE_CLASS_TEMPLATE = """
class {className}_(MeiElement):
def __init__(self):
MeiElement.__init__(self, "{className}")
... | true | true |
1c407a8ac254ac8c2d539df2d33986b39bdb8715 | 1,712 | py | Python | Testing_ProjectBudgetTracker/budget/tests/test_models.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | null | null | null | Testing_ProjectBudgetTracker/budget/tests/test_models.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | 40 | 2020-06-05T22:10:58.000Z | 2022-03-11T23:56:09.000Z | Testing_ProjectBudgetTracker/budget/tests/test_models.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | 1 | 2021-03-31T10:30:03.000Z | 2021-03-31T10:30:03.000Z | from django.test import TestCase
from budget.models import Project, Category, Expense
class TestModels(TestCase):
def setUp(self):
self.project1 = Project.objects.create(
name='Project 1',
budget=10000
)
def test_project... | 28.533333 | 62 | 0.525701 | from django.test import TestCase
from budget.models import Project, Category, Expense
class TestModels(TestCase):
def setUp(self):
self.project1 = Project.objects.create(
name='Project 1',
budget=10000
)
def test_project... | true | true |
1c407aeb8ee9b73aa7dbc86d2f813d0c87ff8533 | 14,005 | py | Python | deepstate.py | simonkamronn/deepstate | 74878840c609dd92fd5410e1db111c834b68f357 | [
"MIT"
] | 4 | 2019-01-24T02:54:14.000Z | 2020-08-10T07:46:38.000Z | deepstate.py | simonkamronn/deepstate | 74878840c609dd92fd5410e1db111c834b68f357 | [
"MIT"
] | null | null | null | deepstate.py | simonkamronn/deepstate | 74878840c609dd92fd5410e1db111c834b68f357 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.contrib.eager.python import tfe
import tensorflow_probability as tfp
from tensorflow.keras import layers
import numpy as np
import argparse
import sys
from collections import namedtuple
parameter_class = namedtuple('parameters', ['A', 'C', 'Q', 'R', 'mu', 'sigma'])
class Deep... | 40.830904 | 113 | 0.605212 | import tensorflow as tf
from tensorflow.contrib.eager.python import tfe
import tensorflow_probability as tfp
from tensorflow.keras import layers
import numpy as np
import argparse
import sys
from collections import namedtuple
parameter_class = namedtuple('parameters', ['A', 'C', 'Q', 'R', 'mu', 'sigma'])
class Deep... | true | true |
1c407bbd2f4997e15c6bca7ec590bb3cc0644317 | 715 | py | Python | config.py | obewas/NewsAPI | 3fe0e6fbeafaa8c0529615a522b045c9bc37eb11 | [
"MIT"
] | null | null | null | config.py | obewas/NewsAPI | 3fe0e6fbeafaa8c0529615a522b045c9bc37eb11 | [
"MIT"
] | null | null | null | config.py | obewas/NewsAPI | 3fe0e6fbeafaa8c0529615a522b045c9bc37eb11 | [
"MIT"
] | null | null | null | import os
class Config:
'''
General configuration parent class
'''
NEWS_API_BASE_URL = 'https://newsapi.org/v2/{}?country=us&apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
class ProdConfig(Config):
'''
Production configuration child... | 21.029412 | 82 | 0.671329 | import os
class Config:
NEWS_API_BASE_URL = 'https://newsapi.org/v2/{}?country=us&apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
class ProdConfig(Config):
pass
class DevConfig(Config):
DEBUG = True
config_options = {
'development': DevCon... | true | true |
1c407c0f6a7b1df4c6df422c3b722b8f4efddb0d | 4,336 | py | Python | Peasy+Box2dshapes2Phaser.py | kobitoko/peasy2phaser | 41202a0b7b7949fa1237b1a0e2ef536bff9bc576 | [
"Unlicense"
] | null | null | null | Peasy+Box2dshapes2Phaser.py | kobitoko/peasy2phaser | 41202a0b7b7949fa1237b1a0e2ef536bff9bc576 | [
"Unlicense"
] | null | null | null | Peasy+Box2dshapes2Phaser.py | kobitoko/peasy2phaser | 41202a0b7b7949fa1237b1a0e2ef536bff9bc576 | [
"Unlicense"
] | null | null | null | import sys
import json
hasPillow = False
try:
from PIL import Image
hasPillow = True
except ImportError:
print("pillow library not found. \nCan ignore this if you want to convert a Peasy file.")
class Converter():
def __init__(self, json):
self._json = json
if not "rigidBodies" in self.... | 38.371681 | 153 | 0.513838 | import sys
import json
hasPillow = False
try:
from PIL import Image
hasPillow = True
except ImportError:
print("pillow library not found. \nCan ignore this if you want to convert a Peasy file.")
class Converter():
def __init__(self, json):
self._json = json
if not "rigidBodies" in self.... | true | true |
1c407c5bbb37f740c6338168cc73d9c43c64c49f | 1,716 | py | Python | cmsplugin_blog_categories/views.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | cmsplugin_blog_categories/views.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | 3 | 2020-02-11T22:01:45.000Z | 2021-06-10T17:38:13.000Z | cmsplugin_blog_categories/views.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | """Views of the ``cmsplugin_blog_categories`` app."""
from django.db.models import Q
from django.views.generic import ListView
from cmsplugin_blog.models import Entry
from .models import Category
class CategoryListView(ListView):
template_name = 'cmsplugin_blog_categories/entry_archive_category.html'
contex... | 32.377358 | 75 | 0.649767 | from django.db.models import Q
from django.views.generic import ListView
from cmsplugin_blog.models import Entry
from .models import Category
class CategoryListView(ListView):
template_name = 'cmsplugin_blog_categories/entry_archive_category.html'
context_object_name = 'entries'
def dispatch(self, requ... | true | true |
1c407ce22b0188d626bd19f8a9dfb9016f55a632 | 652 | py | Python | samples/iris/iris/evaluation/evaluation_result.py | katyamust/ml-expr-fw | 5ede3ff1f777430cf25e8731e4798fc37387fb9d | [
"MIT"
] | 1 | 2022-03-06T21:52:01.000Z | 2022-03-06T21:52:01.000Z | samples/iris/iris/evaluation/evaluation_result.py | omri374/FabricML | a545f1ee907b1b89ca9766a873c5944ec88e54e9 | [
"MIT"
] | null | null | null | samples/iris/iris/evaluation/evaluation_result.py | omri374/FabricML | a545f1ee907b1b89ca9766a873c5944ec88e54e9 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import Dict
from iris import LoggableObject
class EvaluationResult(LoggableObject):
"""
Class which holds the evaluation output for one model run.
For example, precision or recall, MSE, accuracy etc.
"""
@abstractmethod
def get_metrics(self) -> Dict... | 27.166667 | 101 | 0.684049 | from abc import abstractmethod
from typing import Dict
from iris import LoggableObject
class EvaluationResult(LoggableObject):
@abstractmethod
def get_metrics(self) -> Dict:
pass
def get_params(self):
return None
| true | true |
1c407d59c8ef52303c20adc45386f2e632b7af91 | 10,932 | py | Python | nncf/compression_method_api.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | nncf/compression_method_api.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | nncf/compression_method_api.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | 1 | 2021-04-05T09:33:51.000Z | 2021-04-05T09:33:51.000Z | #
# Copyright (c) 2019-2020 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | 40.043956 | 117 | 0.676454 |
import functools
from copy import copy
from enum import Enum
from functools import partial
import torch
from torch import nn
from nncf.config import NNCFConfig
from nncf.dynamic_graph.graph_builder import create_mock_tensor
from nncf.initialization import DataLoaderBNAdaptationRunner
from nncf.nncf_logger import log... | true | true |
1c407ee6c340fe5d42a2e3383839c117a000ebd8 | 25,169 | py | Python | test/moduletests/check_growth/test_check_growth.py | vespian/check-growth | 83322e40f51759bb0fba5dba214357e1fc3fdaea | [
"Apache-2.0"
] | 2 | 2015-01-27T14:39:22.000Z | 2016-03-10T07:50:41.000Z | test/moduletests/check_growth/test_check_growth.py | brainly/check-growth | 83322e40f51759bb0fba5dba214357e1fc3fdaea | [
"Apache-2.0"
] | null | null | null | test/moduletests/check_growth/test_check_growth.py | brainly/check-growth | 83322e40f51759bb0fba5dba214357e1fc3fdaea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015 Pawel Rozlach
# Copyright (c) 2014 Pawel Rozlach
# Copyright (c) 2014 Brainly.com sp. z o.o.
# Copyright (c) 2013 Spotify AB
#
# 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... | 44.31162 | 103 | 0.596329 |
import ddt
import mock
import os
import subprocess
import sys
import unittest
from ddt import ddt, data
pwd = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.abspath(pwd + '/../../modules/'))
import file_paths as paths
import check_growth
DF_COMMAND = '/bin/df'
class TestsBaseClass(unittest.T... | true | true |
1c407f90884301b776b97d1fded0cfdf77b2360e | 5,153 | py | Python | edge/server.py | akirato0223/test | d530ee17ca839fcf863f9e08f9615e3856e02e3d | [
"Apache-2.0"
] | null | null | null | edge/server.py | akirato0223/test | d530ee17ca839fcf863f9e08f9615e3856e02e3d | [
"Apache-2.0"
] | null | null | null | edge/server.py | akirato0223/test | d530ee17ca839fcf863f9e08f9615e3856e02e3d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 28.787709 | 90 | 0.6732 |
import argparse
from collections import OrderedDict
from typing import Callable, Dict, Optional, Tuple
import flwr as fl
import numpy as np
import torch
import torchvision
from flwr.common.logger import log
from logging import INFO
import utils
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "c... | true | true |
1c408005c7eeb0a5dd713dacd7c45c871c4a05c6 | 4,406 | bzl | Python | tools/build_rules/module_rules.bzl | xmfan/buck | 1e755494263bfa4b68e62fd61d86a711b9febc3a | [
"Apache-2.0"
] | null | null | null | tools/build_rules/module_rules.bzl | xmfan/buck | 1e755494263bfa4b68e62fd61d86a711b9febc3a | [
"Apache-2.0"
] | null | null | null | tools/build_rules/module_rules.bzl | xmfan/buck | 1e755494263bfa4b68e62fd61d86a711b9febc3a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-present Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.471429 | 104 | 0.611666 |
load("@bazel_skylib//lib:collections.bzl", "collections")
load("//tools/build_rules:java_rules.bzl", "java_library_with_plugins")
load("//tools/build_rules:module_rules_for_tests.bzl", "convert_module_deps_to_test")
def buck_module(
name,
module_deps = [],
module_resources = [],
**kwa... | true | true |
1c40806bbf5b0f4e55a8e494da731a672586c90e | 2,478 | py | Python | jobfunnel/config/validate.py | Arax1/JobFunnel | 461aca3fd8d5c07fc4a57bf82d8bdc08a775e82b | [
"MIT"
] | 1 | 2019-07-13T14:41:26.000Z | 2019-07-13T14:41:26.000Z | jobfunnel/config/validate.py | studentbrad/JobFunnel | f7913304f7cd11799b975fc8afc1c60521184e68 | [
"MIT"
] | 1 | 2021-05-05T01:39:59.000Z | 2021-05-05T01:39:59.000Z | jobfunnel/config/validate.py | studentbrad/JobFunnel | f7913304f7cd11799b975fc8afc1c60521184e68 | [
"MIT"
] | null | null | null | import re
from .valid_options import DOMAINS, PROVIDERS, DELAY_FUN
from .parser import ConfigError
def validate_region(region):
""" Check if the region settings are valid.
"""
# only allow supported domains
if region['domain'] not in DOMAINS:
raise ConfigError('domain')
# search term st... | 33.486486 | 82 | 0.669088 | import re
from .valid_options import DOMAINS, PROVIDERS, DELAY_FUN
from .parser import ConfigError
def validate_region(region):
if region['domain'] not in DOMAINS:
raise ConfigError('domain')
if 'state' in region:
if (region['state'] is not None) and (region['province'] is None):... | true | true |
1c408180acd684d7e97183a6ca88a6e68ac5ae37 | 908 | py | Python | processor_box/start.py | monobot/micro_orchestra | 04fbcf202d9bda332890d4478569a911650d6540 | [
"MIT"
] | null | null | null | processor_box/start.py | monobot/micro_orchestra | 04fbcf202d9bda332890d4478569a911650d6540 | [
"MIT"
] | null | null | null | processor_box/start.py | monobot/micro_orchestra | 04fbcf202d9bda332890d4478569a911650d6540 | [
"MIT"
] | null | null | null | import os
import uuid
from redis_connector import RedisConnector
HOST = 'redis_cache'
PORT = 6379
QUEUENAME = 'microservices'
QUEUES = [QUEUENAME, ]
MICRO_SERVICE_NAME = 'processor'
redis_connector_processor = RedisConnector(HOST, PORT, QUEUES, MICRO_SERVICE_NAME)
multiplier = int(os.environ.get('MULTIPLIER', '1'))... | 23.894737 | 82 | 0.634361 | import os
import uuid
from redis_connector import RedisConnector
HOST = 'redis_cache'
PORT = 6379
QUEUENAME = 'microservices'
QUEUES = [QUEUENAME, ]
MICRO_SERVICE_NAME = 'processor'
redis_connector_processor = RedisConnector(HOST, PORT, QUEUES, MICRO_SERVICE_NAME)
multiplier = int(os.environ.get('MULTIPLIER', '1'))... | true | true |
1c4081cba058811be59db669e6489eeab5314d3c | 3,437 | py | Python | venv/lib/python3.8/site-packages/astroid/transforms.py | DiegoSilvaHoffmann/Small-Ecommerce | c6f9d75cc6dd558aa1ba9abe0186a27fe15b32d2 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | venv/lib/python3.8/site-packages/astroid/transforms.py | DiegoSilvaHoffmann/Small-Ecommerce | c6f9d75cc6dd558aa1ba9abe0186a27fe15b32d2 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | env/lib/python3.9/site-packages/astroid/transforms.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | # Copyright (c) 2015-2016, 2018 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2018 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl... | 37.358696 | 85 | 0.644166 |
import collections
from functools import lru_cache
class TransformVisitor:
TRANSFORM_MAX_CACHE_SIZE = 10000
def __init__(self):
self.transforms = collections.defaultdict(list)
@lru_cache(maxsize=TRANSFORM_MAX_CACHE_SIZE)
def _transform(self, node):
cls = node.__class__
if... | true | true |
1c40824a9bddbf7eaaaeea4f7ce6abb11a34fb46 | 108,170 | py | Python | curator/actions.py | andytumelty/curator | ecc57679b4098aa55d1015b8cb406b4c5875e3c0 | [
"Apache-2.0"
] | null | null | null | curator/actions.py | andytumelty/curator | ecc57679b4098aa55d1015b8cb406b4c5875e3c0 | [
"Apache-2.0"
] | null | null | null | curator/actions.py | andytumelty/curator | ecc57679b4098aa55d1015b8cb406b4c5875e3c0 | [
"Apache-2.0"
] | null | null | null | """Curator Actions"""
import logging
import re
import time
from copy import deepcopy
from datetime import datetime
from elasticsearch.exceptions import ConflictError, RequestError
from curator import exceptions, utils
class Alias(object):
"""Alias Action Class"""
def __init__(self, name=None, extra_settings={}... | 43.233413 | 138 | 0.572996 | import logging
import re
import time
from copy import deepcopy
from datetime import datetime
from elasticsearch.exceptions import ConflictError, RequestError
from curator import exceptions, utils
class Alias(object):
def __init__(self, name=None, extra_settings={}, **kwargs):
if not name:
raise... | true | true |
1c40828729b44afb6e27bd02134bed827f46fba8 | 3,317 | py | Python | tests/df/test_memory.py | sanketsaurav/dffml | acf3a20cd6a4c3c15aa872f3a1f898924af05a0e | [
"MIT"
] | null | null | null | tests/df/test_memory.py | sanketsaurav/dffml | acf3a20cd6a4c3c15aa872f3a1f898924af05a0e | [
"MIT"
] | null | null | null | tests/df/test_memory.py | sanketsaurav/dffml | acf3a20cd6a4c3c15aa872f3a1f898924af05a0e | [
"MIT"
] | null | null | null | from functools import wraps
from unittest.mock import patch
from typing import NamedTuple
from dffml.util.data import traverse_config_set
from dffml.util.cli.arg import Arg, parse_unknown
from dffml.util.entrypoint import entry_point
from dffml.df.base import BaseKeyValueStore, BaseRedundancyCheckerConfig
from dffml.d... | 34.915789 | 79 | 0.493217 | from functools import wraps
from unittest.mock import patch
from typing import NamedTuple
from dffml.util.data import traverse_config_set
from dffml.util.cli.arg import Arg, parse_unknown
from dffml.util.entrypoint import entry_point
from dffml.df.base import BaseKeyValueStore, BaseRedundancyCheckerConfig
from dffml.d... | true | true |
1c40829241242b10163a3380f70cebf2109dad8d | 108 | py | Python | month03.2/django/day05/mysitel3/music/urls.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month03.2/django/day05/mysitel3/music/urls.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month03.2/django/day05/mysitel3/music/urls.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from music import views
urlpatterns = [
path('index',views.music_view),
] | 15.428571 | 35 | 0.731481 | from django.urls import path
from music import views
urlpatterns = [
path('index',views.music_view),
] | true | true |
1c40835f9bd35870bae0825ad82318769270950d | 2,847 | py | Python | Examples/calibrate/calibrate.py | mustafacc/SiEPIC_Photonics_Package | 50dec87c9af4f3d883134ca121e1cbbf8cf73c24 | [
"MIT"
] | 16 | 2018-09-17T08:36:58.000Z | 2022-03-27T12:30:50.000Z | Examples/calibrate/calibrate.py | ltianying/SiEPIC_Photonics_Package | 8492cac275bfd2dc0f57ae9d01b3e71321a50caf | [
"MIT"
] | null | null | null | Examples/calibrate/calibrate.py | ltianying/SiEPIC_Photonics_Package | 8492cac275bfd2dc0f57ae9d01b3e71321a50caf | [
"MIT"
] | 7 | 2020-03-31T16:10:42.000Z | 2022-03-16T16:48:38.000Z | """
SiEPIC Photonics Package
Author: Mustafa Hammood
Mustafa@ece.ubc.ca
Example: Application of SiEPIC_PP calibration function
"""
#%% import package and installed dependent packages
import sys, os
# go up two directories
#dir_path = os.path.dirname(os.path.abspath(__file__))
#sys.path.append(os.... | 42.492537 | 126 | 0.773797 |
import sys, os
import SiEPIC_Photonics_Package as SiEPIC_PP
from SiEPIC_Photonics_Package.setup import *
file_name_in = 'MZI_data2'
file_extension = '.mat'
url = 'https://github.com/SiEPIC-Kits/SiEPIC_Photonics_Package/blob/master/Examples/'+file_name_in+file_extension+'?raw=true'
PORT = 1
input_response= SiEPIC_PP.... | true | true |
1c4083fd4d6b1dde4ea9b1f21d7bd6b84a73e3f6 | 2,802 | py | Python | SOP/t4/q1.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | SOP/t4/q1.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | SOP/t4/q1.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | def dist(a, b):
return abs(a - b)
def find_min(diff):
index = -1
mini = float("inf")
for i in range(len(diff)):
if not diff[i][1] and mini > diff[i][0]:
mini = diff[i][0]
index = i
return index
def ssf_sorting(requests):
head = requests[0]
l = len(request... | 26.685714 | 113 | 0.586724 | def dist(a, b):
return abs(a - b)
def find_min(diff):
index = -1
mini = float("inf")
for i in range(len(diff)):
if not diff[i][1] and mini > diff[i][0]:
mini = diff[i][0]
index = i
return index
def ssf_sorting(requests):
head = requests[0]
l = len(request... | true | true |
1c40842edff0a2d5d733140b134db08b5063c859 | 5,581 | py | Python | examples/two_sample_vs_voka.py | icecube/voka | 29a5d4439cf13d35e29b9308dcbf54c799be3b83 | [
"MIT"
] | null | null | null | examples/two_sample_vs_voka.py | icecube/voka | 29a5d4439cf13d35e29b9308dcbf54c799be3b83 | [
"MIT"
] | null | null | null | examples/two_sample_vs_voka.py | icecube/voka | 29a5d4439cf13d35e29b9308dcbf54c799be3b83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
This example exercises the two sample statistical tests
available from scipy:
* scipy.stats.ttest_ind
* scipy.stats.ks_2samp
* scipy.stats.anderson_ksamp
* scipy.stats.epps_singleton_2samp
* scipy.stats.mannwhitneyu
* scipy.stats.ranksums
* scipy.stats.wilcoxon
* scipy.stats.kruskal
* scipy.... | 30.664835 | 111 | 0.623903 |
import os
import pickle
import numpy
import pylab
import scipy.stats
import pylab
import voka.tools.samples
import voka.model
import voka.tools.render
def voka_2sample(sample1, sample2):
result = dict()
r = scipy.stats.ttest_ind(sample1, sample2)
result['TTest'] = {
... | true | true |
1c40843db190369bf1adfa7d13266259cfc09243 | 489 | py | Python | games/migrations/0031_auto_20171103_1744.py | munisisazade/diplom_isi | 767531ef3a4b090d1bc0963e687b5215d6f92f53 | [
"MIT"
] | 1 | 2019-04-07T15:58:00.000Z | 2019-04-07T15:58:00.000Z | games/migrations/0031_auto_20171103_1744.py | munisisazade/diplom_isi | 767531ef3a4b090d1bc0963e687b5215d6f92f53 | [
"MIT"
] | 12 | 2020-06-05T18:15:45.000Z | 2022-03-11T23:20:26.000Z | games/migrations/0031_auto_20171103_1744.py | munisisazade/diplom_isi | 767531ef3a4b090d1bc0963e687b5215d6f92f53 | [
"MIT"
] | 1 | 2019-04-07T15:58:08.000Z | 2019-04-07T15:58:08.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-03 13:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('games', '0030_auto_20171009_1415'),
]
operations = [
migrations.AlterModelOptions(
... | 24.45 | 116 | 0.633947 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('games', '0030_auto_20171009_1415'),
]
operations = [
migrations.AlterModelOptions(
name='monthlyresults',
options={'ordering': ('id'... | true | true |
1c4086111b3f7f8f648d6d8f43ddc9fcf8fb7656 | 3,118 | py | Python | google/ads/google_ads/v1/proto/services/campaign_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/campaign_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/campaign_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v1.proto.resources import campaign_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_campaign__pb2
from google.ads.google_ads.v1.proto.services import campaign_service_pb2 as google_dot_ads_do... | 47.969231 | 158 | 0.809173 | import grpc
from google.ads.google_ads.v1.proto.resources import campaign_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_campaign__pb2
from google.ads.google_ads.v1.proto.services import campaign_service_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_campaign__service__pb2
cl... | true | true |
1c40861846f6275944c4cd057c757a7fd928f481 | 495 | py | Python | plotly/validators/layout/scene/zaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/scene/zaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/layout/scene/zaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='color',
parent_name='layout.scene.zaxis.titlefont',
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_... | 26.052632 | 66 | 0.606061 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='color',
parent_name='layout.scene.zaxis.titlefont',
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_... | true | true |
1c40867ddad76e4deac86592b2c5229745f1c42d | 143 | py | Python | auth/twilio_auth.py | busyuqboy/gateio-crypto-trading-bot-binance-announcements-new-coins | e60e78ddf21bd0e272d9ddce6a86d250119a9425 | [
"MIT"
] | null | null | null | auth/twilio_auth.py | busyuqboy/gateio-crypto-trading-bot-binance-announcements-new-coins | e60e78ddf21bd0e272d9ddce6a86d250119a9425 | [
"MIT"
] | null | null | null | auth/twilio_auth.py | busyuqboy/gateio-crypto-trading-bot-binance-announcements-new-coins | e60e78ddf21bd0e272d9ddce6a86d250119a9425 | [
"MIT"
] | null | null | null | import yaml
def load_twilio_creds(file):
with open(file) as file:
auth = yaml.load(file, Loader=yaml.FullLoader)
return auth
| 17.875 | 54 | 0.685315 | import yaml
def load_twilio_creds(file):
with open(file) as file:
auth = yaml.load(file, Loader=yaml.FullLoader)
return auth
| true | true |
1c4086c300846640ff43fa76f34d9aae7872760c | 68 | py | Python | 7 kyu/Exes and Ohs/Exes and Ohs.py | anthonyjatoba/codewars | 76b0d66dd1ba76a4d136b658920cdf85fd5c4b06 | [
"MIT"
] | null | null | null | 7 kyu/Exes and Ohs/Exes and Ohs.py | anthonyjatoba/codewars | 76b0d66dd1ba76a4d136b658920cdf85fd5c4b06 | [
"MIT"
] | null | null | null | 7 kyu/Exes and Ohs/Exes and Ohs.py | anthonyjatoba/codewars | 76b0d66dd1ba76a4d136b658920cdf85fd5c4b06 | [
"MIT"
] | null | null | null | def xo(s):
s = s.lower()
return s.count('x') == s.count('o') | 22.666667 | 39 | 0.485294 | def xo(s):
s = s.lower()
return s.count('x') == s.count('o') | true | true |
1c4087d8a8fde9d7ae8bc928220890c1cc009ddf | 8,421 | py | Python | tools/data_converter/image_classification/image_classification_data.py | matarof/tpu | d2e3b810134b200214f42cb004f20fe6b8e2cab4 | [
"Apache-2.0"
] | 5,098 | 2018-02-09T16:56:49.000Z | 2022-03-31T13:50:40.000Z | tools/data_converter/image_classification/image_classification_data.py | matarof/tpu | d2e3b810134b200214f42cb004f20fe6b8e2cab4 | [
"Apache-2.0"
] | 550 | 2018-02-07T05:30:06.000Z | 2022-03-13T22:00:09.000Z | tools/data_converter/image_classification/image_classification_data.py | matarof/tpu | d2e3b810134b200214f42cb004f20fe6b8e2cab4 | [
"Apache-2.0"
] | 1,920 | 2018-02-07T23:44:49.000Z | 2022-03-29T03:11:08.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 30.400722 | 80 | 0.641135 | import abc
import os
import six
import tensorflow.compat.v1 as tf
import tensorflow_datasets.public_api as tfds
import image_utils as image
_REQUIRED_INPUTS = [
'image_fobj',
'label',
]
_VERSION = '0.1.0'
class ImageClassificationBuilder(tfds.core.GeneratorBasedBuilder):
VERSION = tfds.core.Version(_VERSI... | true | true |
1c4089e21b7947affd5d4e0335cbd83bde92af9f | 10,435 | py | Python | blueoil/generate_lmnet_config.py | msakai/blueoil | 0c9160b524b17482d59ae48a0c11384f1d26dccc | [
"Apache-2.0"
] | 248 | 2018-10-19T01:48:42.000Z | 2022-01-31T02:34:24.000Z | blueoil/generate_lmnet_config.py | oatawa1/blueoil | 6a5f1cc1fb78c86423338f99cb9dbf506a76f3d6 | [
"Apache-2.0"
] | 1,102 | 2018-10-19T04:50:34.000Z | 2021-08-02T04:22:10.000Z | blueoil/generate_lmnet_config.py | oatawa1/blueoil | 6a5f1cc1fb78c86423338f99cb9dbf506a76f3d6 | [
"Apache-2.0"
] | 110 | 2018-10-19T01:49:02.000Z | 2022-01-31T02:34:26.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 34.438944 | 101 | 0.653378 | import importlib
import os
from tempfile import NamedTemporaryFile
from jinja2 import Environment, FileSystemLoader
_TASK_TYPE_TEMPLATE_FILE = {
"classification": "classification.tpl.py",
"object_detection": "object_detection.tpl.py",
"semantic_segmentation": "semantic_segmentation.tpl.py",
"keypoint... | true | true |
1c408a451ce19687080e53396a1ce9bc991b7b7d | 8,822 | py | Python | batchgenerators/examples/brats2017/brats2017_dataloader_2D.py | ramesh152/batchgenerators | 709a46a96333fd1b36205feb74059781b730b18b | [
"Apache-2.0"
] | null | null | null | batchgenerators/examples/brats2017/brats2017_dataloader_2D.py | ramesh152/batchgenerators | 709a46a96333fd1b36205feb74059781b730b18b | [
"Apache-2.0"
] | null | null | null | batchgenerators/examples/brats2017/brats2017_dataloader_2D.py | ramesh152/batchgenerators | 709a46a96333fd1b36205feb74059781b730b18b | [
"Apache-2.0"
] | 1 | 2019-10-19T02:20:16.000Z | 2019-10-19T02:20:16.000Z | from time import time
from batchgenerators.augmentations.crop_and_pad_augmentations import crop
from batchgenerators.dataloading import MultiThreadedAugmenter
from batchgenerators.examples.brats2017.brats2017_dataloader_3D import get_list_of_patients, BraTS2017DataLoader3D, \
get_train_transform
from batchgenerator... | 51.590643 | 131 | 0.710383 | from time import time
from batchgenerators.augmentations.crop_and_pad_augmentations import crop
from batchgenerators.dataloading import MultiThreadedAugmenter
from batchgenerators.examples.brats2017.brats2017_dataloader_3D import get_list_of_patients, BraTS2017DataLoader3D, \
get_train_transform
from batchgenerator... | true | true |
1c408a9aee927765791ec0f8397a13865a1b4e1a | 599 | py | Python | jaxlib/version.py | tomhennigan/jax | fb6c9f64e49880e3c3d0ff9a2ef7345fc9bbe717 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jaxlib/version.py | tomhennigan/jax | fb6c9f64e49880e3c3d0ff9a2ef7345fc9bbe717 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jaxlib/version.py | tomhennigan/jax | fb6c9f64e49880e3c3d0ff9a2ef7345fc9bbe717 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.4375 | 74 | 0.75793 |
__version__ = "0.1.36"
| true | true |
1c408b947d5026f58a30e2878874e81d9390a574 | 20,386 | py | Python | waymo_open_dataset/utils/range_image_utils.py | kprohith/waymo-open-dataset | 9c519584cb95c6e2d3c909722298978668075542 | [
"Apache-2.0"
] | 3 | 2019-09-19T02:09:09.000Z | 2019-10-05T11:50:47.000Z | waymo_open_dataset/utils/range_image_utils.py | kprohith/waymo-open-dataset | 9c519584cb95c6e2d3c909722298978668075542 | [
"Apache-2.0"
] | null | null | null | waymo_open_dataset/utils/range_image_utils.py | kprohith/waymo-open-dataset | 9c519584cb95c6e2d3c909722298978668075542 | [
"Apache-2.0"
] | 1 | 2020-03-28T16:50:05.000Z | 2020-03-28T16:50:05.000Z | # Copyright 2019 The Waymo Open Dataset Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.128599 | 80 | 0.629304 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
__all__ = [
'compute_range_image_polar', 'compute_range_image_cartesian',
'build_range_image_from_point_cloud', 'build_camera_depth_image',
'extract_poi... | true | true |
1c408c36b6bdfcbced5d5fa89616a441e1a3f104 | 417 | py | Python | Semester2/ShapeTester/Box.py | ConstantineLinardakis/Programming1Portfolio | 9062590de87e495ecf19b759a5d7a132a6982e3b | [
"MIT"
] | 1 | 2020-11-23T19:02:21.000Z | 2020-11-23T19:02:21.000Z | Semester2/ShapeTester/Box.py | ConstantineLinardakis/Programming1Portfolio | 9062590de87e495ecf19b759a5d7a132a6982e3b | [
"MIT"
] | null | null | null | Semester2/ShapeTester/Box.py | ConstantineLinardakis/Programming1Portfolio | 9062590de87e495ecf19b759a5d7a132a6982e3b | [
"MIT"
] | null | null | null | class Box:
l = 0
w = 0
h = 0
def __init__(self,l,w,h):
self.l = l
self.w = w
self.h = h
def calcvolume(self):
l = self.l
w = self.w
h = self.h
print("The volume equals:", str(w*l*h))
def calcsurface(self):
l = self.l
w ... | 18.130435 | 68 | 0.441247 | class Box:
l = 0
w = 0
h = 0
def __init__(self,l,w,h):
self.l = l
self.w = w
self.h = h
def calcvolume(self):
l = self.l
w = self.w
h = self.h
print("The volume equals:", str(w*l*h))
def calcsurface(self):
l = self.l
w ... | true | true |
1c408c442e1e807f5d4ecb8193daa5b1f4184032 | 6,167 | py | Python | IO/radiation.py | storage4grid/PROFESS-PROFEV | adf4e26488225206c249938c9eecc394a06f9677 | [
"Apache-2.0"
] | null | null | null | IO/radiation.py | storage4grid/PROFESS-PROFEV | adf4e26488225206c249938c9eecc394a06f9677 | [
"Apache-2.0"
] | null | null | null | IO/radiation.py | storage4grid/PROFESS-PROFEV | adf4e26488225206c249938c9eecc394a06f9677 | [
"Apache-2.0"
] | null | null | null | import configparser
import datetime
import json
from math import floor, ceil
import requests
from IO.locationData import LocationData
from utils_intern.messageLogger import MessageLogger
logger = MessageLogger.get_logger_parent()
# Date = Date & time (UTC)
# EPV = PV power output if requested (W)
# Bi = In-pl... | 41.113333 | 118 | 0.574185 | import configparser
import datetime
import json
from math import floor, ceil
import requests
from IO.locationData import LocationData
from utils_intern.messageLogger import MessageLogger
logger = MessageLogger.get_logger_parent()
class RadiationData:
def __init__(self, date=datetime.datetime.now(), pv_output=0... | true | true |
1c408e8e8f9bc32650dab15d276e34f5c4975c7f | 5,268 | py | Python | sscutils/validation_functions.py | papsebestyen/sscutils | dff8b62ab31c9dfe1494264f9319e287945762bc | [
"MIT"
] | null | null | null | sscutils/validation_functions.py | papsebestyen/sscutils | dff8b62ab31c9dfe1494264f9319e287945762bc | [
"MIT"
] | 21 | 2021-09-15T15:31:22.000Z | 2022-03-20T17:10:50.000Z | sscutils/validation_functions.py | papsebestyen/sscutils | dff8b62ab31c9dfe1494264f9319e287945762bc | [
"MIT"
] | 2 | 2021-09-08T14:12:00.000Z | 2021-09-29T10:58:08.000Z | import re
from functools import partial
from pathlib import Path
from dvc.repo import Repo
from structlog import get_logger
from .artifact_context import ArtifactContext
from .config_loading import DataEnvSpecification, DatasetConfig, ProjectConfig
from .exceptions import DatasetSetupException
from .helpers import im... | 29.104972 | 78 | 0.699696 | import re
from functools import partial
from pathlib import Path
from dvc.repo import Repo
from structlog import get_logger
from .artifact_context import ArtifactContext
from .config_loading import DataEnvSpecification, DatasetConfig, ProjectConfig
from .exceptions import DatasetSetupException
from .helpers import im... | true | true |
1c4090dcb2015b0c5a4cc7088154f7ca9e7c6fc2 | 27,882 | py | Python | gedl/RPCGenerator.py | gaps-closure/capo | 894d2f6d291ff79e18c77e0ca7073531147cbee8 | [
"BSD-3-Clause"
] | 1 | 2021-04-20T18:43:44.000Z | 2021-04-20T18:43:44.000Z | gedl/RPCGenerator.py | gaps-closure/capo | 894d2f6d291ff79e18c77e0ca7073531147cbee8 | [
"BSD-3-Clause"
] | 1 | 2021-09-23T14:55:43.000Z | 2021-09-23T18:09:35.000Z | gedl/RPCGenerator.py | gaps-closure/capo | 894d2f6d291ff79e18c77e0ca7073531147cbee8 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T03:12:16.000Z | 2020-05-21T03:12:16.000Z | import json
import sys
import copy
import os
from argparse import ArgumentParser
def argparser(enclaveList, enclaveMap):
parser = ArgumentParser(description='CLOSURE RPC File and Wrapper Generator')
parser.add_argument('-o','--odir', required=True, type=str, help='Output Directory')
parser.add_argument('-g... | 75.560976 | 238 | 0.551718 | import json
import sys
import copy
import os
from argparse import ArgumentParser
def argparser(enclaveList, enclaveMap):
parser = ArgumentParser(description='CLOSURE RPC File and Wrapper Generator')
parser.add_argument('-o','--odir', required=True, type=str, help='Output Directory')
parser.add_argument('-g... | true | true |
1c40916eb433571c4cd4fc33eb695f5113d7ecfa | 9,370 | py | Python | snips_nlu/dataset.py | ddorian/snips-nlu | 0934d386bb138ebb34764446416856cfac664e65 | [
"Apache-2.0"
] | null | null | null | snips_nlu/dataset.py | ddorian/snips-nlu | 0934d386bb138ebb34764446416856cfac664e65 | [
"Apache-2.0"
] | null | null | null | snips_nlu/dataset.py | ddorian/snips-nlu | 0934d386bb138ebb34764446416856cfac664e65 | [
"Apache-2.0"
] | null | null | null | from __future__ import division, unicode_literals
import json
from builtins import str
from collections import Counter
from copy import deepcopy
from future.utils import iteritems, itervalues
from snips_nlu_ontology import get_all_languages
from snips_nlu.constants import (AUTOMATICALLY_EXTENSIBLE, CAPITALIZE, DATA,... | 39.369748 | 79 | 0.673212 | from __future__ import division, unicode_literals
import json
from builtins import str
from collections import Counter
from copy import deepcopy
from future.utils import iteritems, itervalues
from snips_nlu_ontology import get_all_languages
from snips_nlu.constants import (AUTOMATICALLY_EXTENSIBLE, CAPITALIZE, DATA,... | true | true |
1c409292ee3ecf1d4fccae874588048198c4f948 | 3,185 | py | Python | b_stage_deployment_test/testing_infrastructure.py | ignaloidas/B.StageDeployment | 951af38e675e7d469e70d3460836d1e70bc1f63b | [
"Apache-2.0"
] | null | null | null | b_stage_deployment_test/testing_infrastructure.py | ignaloidas/B.StageDeployment | 951af38e675e7d469e70d3460836d1e70bc1f63b | [
"Apache-2.0"
] | null | null | null | b_stage_deployment_test/testing_infrastructure.py | ignaloidas/B.StageDeployment | 951af38e675e7d469e70d3460836d1e70bc1f63b | [
"Apache-2.0"
] | 1 | 2021-02-01T10:28:32.000Z | 2021-02-01T10:28:32.000Z | from aws_cdk.aws_apigatewayv2 import CfnApi, CfnStage, CfnRoute, CfnIntegration
from aws_cdk.aws_lambda import Function, Code, Runtime
from aws_cdk.core import Construct
from b_aws_testing_framework.tools.cdk_testing.testing_manager import TestingManager
from b_aws_testing_framework.tools.cdk_testing.testing_stack impo... | 36.609195 | 108 | 0.595918 | from aws_cdk.aws_apigatewayv2 import CfnApi, CfnStage, CfnRoute, CfnIntegration
from aws_cdk.aws_lambda import Function, Code, Runtime
from aws_cdk.core import Construct
from b_aws_testing_framework.tools.cdk_testing.testing_manager import TestingManager
from b_aws_testing_framework.tools.cdk_testing.testing_stack impo... | true | true |
1c4093d7d9b58530b9b92d6b80208734e55bb251 | 2,498 | py | Python | CircleciScripts/framework_list.py | code-surf/aws-sdk-ios | 7d2d99691419e8aaaf70911cd9c34eece79c0a02 | [
"Apache-2.0"
] | null | null | null | CircleciScripts/framework_list.py | code-surf/aws-sdk-ios | 7d2d99691419e8aaaf70911cd9c34eece79c0a02 | [
"Apache-2.0"
] | null | null | null | CircleciScripts/framework_list.py | code-surf/aws-sdk-ios | 7d2d99691419e8aaaf70911cd9c34eece79c0a02 | [
"Apache-2.0"
] | null | null | null | # A list of frameworks/packages for the AWS iOS SDK. As of now, order on these
# packages is important, since we don't model dependencies in code that we
# consume for the release process. Packages toward the bottom of the list
# depend on packages toward the top of the list.
# Note that this list isn't a comprehensiv... | 26.860215 | 83 | 0.618094 | # consume for the release process. Packages toward the bottom of the list
# depend on packages toward the top of the list.
# Note that this list isn't a comprehensive list of Xcode schemas or targets
grouped_frameworks = [
[
'AWSCore',
'AWSCognitoIdentityProviderASF',
],
[
... | true | true |
1c4094387a9d3f0cd170326eb874c55e90798d9e | 9,919 | py | Python | tests/components/modbus/test_modbus_sensor.py | jlvaillant/core | ae37f9a1d9c5067957854b3c25dcc73fe9a10bee | [
"Apache-2.0"
] | 2 | 2019-11-20T20:56:59.000Z | 2021-01-03T08:52:18.000Z | tests/components/modbus/test_modbus_sensor.py | jlvaillant/core | ae37f9a1d9c5067957854b3c25dcc73fe9a10bee | [
"Apache-2.0"
] | 5 | 2020-04-26T10:50:01.000Z | 2021-03-16T21:19:46.000Z | tests/components/modbus/test_modbus_sensor.py | winterscar/core | 5a55d508791aae65f16396691d014c73fb2095f0 | [
"Apache-2.0"
] | 1 | 2021-04-18T19:36:34.000Z | 2021-04-18T19:36:34.000Z | """The tests for the Modbus sensor component."""
from datetime import timedelta
from unittest import mock
import pytest
from homeassistant.components.modbus.const import (
CALL_TYPE_REGISTER_HOLDING,
CALL_TYPE_REGISTER_INPUT,
CONF_COUNT,
CONF_DATA_TYPE,
CONF_OFFSET,
CONF_PRECISION,
CONF_RE... | 27.940845 | 92 | 0.654401 | from datetime import timedelta
from unittest import mock
import pytest
from homeassistant.components.modbus.const import (
CALL_TYPE_REGISTER_HOLDING,
CALL_TYPE_REGISTER_INPUT,
CONF_COUNT,
CONF_DATA_TYPE,
CONF_OFFSET,
CONF_PRECISION,
CONF_REGISTER,
CONF_REGISTER_TYPE,
CONF_REGISTER... | true | true |
1c40946627caba4610fd0f0f0091de2790b9ccf1 | 1,018 | py | Python | tests/rules/test_cp_create_destination.py | HiteshMah-Jan/thefuck | 132c62262246824470934c2c6f46919ef6f00203 | [
"MIT"
] | 75,504 | 2015-04-08T18:22:19.000Z | 2022-03-31T23:59:52.000Z | tests/rules/test_cp_create_destination.py | HiteshMah-Jan/thefuck | 132c62262246824470934c2c6f46919ef6f00203 | [
"MIT"
] | 1,160 | 2015-04-17T18:47:12.000Z | 2022-03-30T20:42:26.000Z | tests/rules/test_cp_create_destination.py | HiteshMah-Jan/thefuck | 132c62262246824470934c2c6f46919ef6f00203 | [
"MIT"
] | 4,399 | 2015-04-17T18:36:04.000Z | 2022-03-31T07:01:03.000Z | import pytest
from thefuck.rules.cp_create_destination import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize(
"script, output",
[("cp", "cp: directory foo does not exist\n"), ("mv", "No such file or directory")],
)
def test_match(script, output):
assert match(Command(scr... | 32.83871 | 106 | 0.654224 | import pytest
from thefuck.rules.cp_create_destination import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize(
"script, output",
[("cp", "cp: directory foo does not exist\n"), ("mv", "No such file or directory")],
)
def test_match(script, output):
assert match(Command(scr... | true | true |
1c409472d8cb1e03d6991c52aa165e63f057563c | 505 | py | Python | week2/scripts/publisher2.py | manasdesai/Robotics-Automation-QSTP-2021 | a51e01dd9fcbae106f618d82737e01e279ba0ff2 | [
"MIT"
] | 1 | 2021-09-19T03:34:35.000Z | 2021-09-19T03:34:35.000Z | week2/scripts/publisher2.py | manasdesai/Robotics-Automation-QSTP-2021 | a51e01dd9fcbae106f618d82737e01e279ba0ff2 | [
"MIT"
] | null | null | null | week2/scripts/publisher2.py | manasdesai/Robotics-Automation-QSTP-2021 | a51e01dd9fcbae106f618d82737e01e279ba0ff2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
def publisher():
pub=rospy.Publisher('World',String,queue_size=10)
rospy.init_node('publish2',anonymous=True)
rate=rospy.Rate(10)
while not rospy.is_shutdown():
pub.publish('World')
publishstring='World is being pub... | 25.25 | 53 | 0.649505 | import rospy
from std_msgs.msg import String
def publisher():
pub=rospy.Publisher('World',String,queue_size=10)
rospy.init_node('publish2',anonymous=True)
rate=rospy.Rate(10)
while not rospy.is_shutdown():
pub.publish('World')
publishstring='World is being published'
rospy.... | true | true |
1c409484510aab17d13a436173f168f6acfe19e1 | 889 | py | Python | api/responders/grafana/__init__.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/responders/grafana/__init__.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/responders/grafana/__init__.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 55.5625 | 79 | 0.460067 | from api.responders.responder_base import ResponderBase
class Health(ResponderBase):
def on_get(self, req, resp):
self.set_ok_response(resp, "We're open")
| true | true |
1c4095e149b03c67d4661ad4fca4684d6028a5e9 | 318 | py | Python | rastervision/evaluation/api.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 4 | 2019-03-11T12:38:15.000Z | 2021-04-06T14:57:52.000Z | rastervision/evaluation/api.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | null | null | null | rastervision/evaluation/api.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 1 | 2021-12-02T08:07:21.000Z | 2021-12-02T08:07:21.000Z | # flake8: noqa
# Registry keys
EVALUATOR = 'EVALUATOR'
OBJECT_DETECTION_EVALUATOR = 'OBJECT_DETECTION_EVALUATOR'
CHIP_CLASSIFICATION_EVALUATOR = 'CHIP_CLASSIFICATION_EVALUATOR'
SEMANTIC_SEGMENTATION_EVALUATOR = 'SEMANTIC_SEGMENTATION_EVALUATOR'
from rastervision.evaluation.evaluator_config import EvaluatorConfig
| 26.5 | 68 | 0.86478 |
EVALUATOR = 'EVALUATOR'
OBJECT_DETECTION_EVALUATOR = 'OBJECT_DETECTION_EVALUATOR'
CHIP_CLASSIFICATION_EVALUATOR = 'CHIP_CLASSIFICATION_EVALUATOR'
SEMANTIC_SEGMENTATION_EVALUATOR = 'SEMANTIC_SEGMENTATION_EVALUATOR'
from rastervision.evaluation.evaluator_config import EvaluatorConfig
| true | true |
1c40969107ea62c91965c9ee8aec48640843570c | 1,251 | py | Python | tests.py | MasterOdin/LogicalEquivalency | c1f4e053c4c18b8fc23a5842944bbd9ef9f37843 | [
"MIT"
] | 1 | 2018-02-02T17:11:24.000Z | 2018-02-02T17:11:24.000Z | tests.py | MasterOdin/LogicalEquivalency | c1f4e053c4c18b8fc23a5842944bbd9ef9f37843 | [
"MIT"
] | null | null | null | tests.py | MasterOdin/LogicalEquivalency | c1f4e053c4c18b8fc23a5842944bbd9ef9f37843 | [
"MIT"
] | 1 | 2019-01-16T21:11:52.000Z | 2019-01-16T21:11:52.000Z | import copy
from forseti.formula import Symbol, Or, And, Not
from nose import runmodule
from nose.tools import assert_equal, assert_true
import util
from extra_formulas import GeneralizedAnd, GeneralizedOr
def test_helper():
statement = Or(Or(Symbol("B"), Symbol("C")), Symbol("A"))
new_statement, change = uti... | 37.909091 | 98 | 0.677058 | import copy
from forseti.formula import Symbol, Or, And, Not
from nose import runmodule
from nose.tools import assert_equal, assert_true
import util
from extra_formulas import GeneralizedAnd, GeneralizedOr
def test_helper():
statement = Or(Or(Symbol("B"), Symbol("C")), Symbol("A"))
new_statement, change = uti... | true | true |
1c40979d9fa04f5d63f1a60a08cb903ed94e2d4b | 1,652 | py | Python | exe/load_spiketimes_subsampled.py | Priesemann-Group/historydependence | e1adc5eea8cb05cc686bfda0b979244b34d63bb4 | [
"BSD-3-Clause"
] | 1 | 2022-03-25T21:56:53.000Z | 2022-03-25T21:56:53.000Z | exe/load_spiketimes_subsampled.py | Priesemann-Group/historydependence | e1adc5eea8cb05cc686bfda0b979244b34d63bb4 | [
"BSD-3-Clause"
] | null | null | null | exe/load_spiketimes_subsampled.py | Priesemann-Group/historydependence | e1adc5eea8cb05cc686bfda0b979244b34d63bb4 | [
"BSD-3-Clause"
] | null | null | null | from sys import stderr, exit, argv
from os.path import isfile, isdir, realpath, dirname, exists
import numpy as np
from scipy.io import loadmat
# Loading spiketimes for entorhinal cortex recording
recorded_system = argv[1]
run_index = int(argv[2])
rec_length = argv[3]
if len(argv) > 4:
data_path = argv[4]
else:
... | 31.169811 | 108 | 0.710048 | from sys import stderr, exit, argv
from os.path import isfile, isdir, realpath, dirname, exists
import numpy as np
from scipy.io import loadmat
recorded_system = argv[1]
run_index = int(argv[2])
rec_length = argv[3]
if len(argv) > 4:
data_path = argv[4]
else:
CODE_DIR = '{}/..'.format(dirname(realpath(__file_... | true | true |
1c4097f0c6e4c010cfebeb8ec84a06cd6e86692b | 42,266 | py | Python | util/genIncJS.py | ahmedmrefaat/lang | 68e962ada2ab3d81398cb2651fead30205f01c20 | [
"Apache-2.0"
] | null | null | null | util/genIncJS.py | ahmedmrefaat/lang | 68e962ada2ab3d81398cb2651fead30205f01c20 | [
"Apache-2.0"
] | null | null | null | util/genIncJS.py | ahmedmrefaat/lang | 68e962ada2ab3d81398cb2651fead30205f01c20 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 Yoav Seginer, Theo Vosse, Gil Harari, and Uri Kolodny.
# 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... | 32.738962 | 139 | 0.654403 |
# javascript files. Changes to the run-time javascript files take affect
# with but a reload of the browser, while changes to typescript files require
# compiling typescript to javascript (but not cdl recompilation or
# re-generation of the .html file by this script).
# For batch automatic test execution... | true | true |
1c40984042dd5944e2952e5085793718543a185e | 464 | py | Python | setup.py | rohansurve212/Black_Friday_Data_Hack | 83e536db35383b7e5266cf8370405b20aa4641b0 | [
"MIT"
] | null | null | null | setup.py | rohansurve212/Black_Friday_Data_Hack | 83e536db35383b7e5266cf8370405b20aa4641b0 | [
"MIT"
] | null | null | null | setup.py | rohansurve212/Black_Friday_Data_Hack | 83e536db35383b7e5266cf8370405b20aa4641b0 | [
"MIT"
] | 1 | 2019-11-20T20:52:32.000Z | 2019-11-20T20:52:32.000Z | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='A retail company "ABC Private Limited" wants to understand the customer purchase behaviour (specifically, purchase amount) against various products of different categories. They have s... | 42.181818 | 297 | 0.760776 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='A retail company "ABC Private Limited" wants to understand the customer purchase behaviour (specifically, purchase amount) against various products of different categories. They have s... | true | true |
1c4098c795f2d81b7286028374fdf10586f51fe0 | 149 | py | Python | application/rustLab/src/saySMTH.py | pianoft/subStringSearchUsingRust | 722ec006d54614b61708a804ed0f658d1b64841d | [
"MIT"
] | null | null | null | application/rustLab/src/saySMTH.py | pianoft/subStringSearchUsingRust | 722ec006d54614b61708a804ed0f658d1b64841d | [
"MIT"
] | null | null | null | application/rustLab/src/saySMTH.py | pianoft/subStringSearchUsingRust | 722ec006d54614b61708a804ed0f658d1b64841d | [
"MIT"
] | null | null | null | import subprocess
import sys
def say(files):
subprocess.run(['spd-say -w -r 50 -i 100 "'+files+'";'], shell=True)
return
say(sys.argv[1])
| 14.9 | 72 | 0.630872 | import subprocess
import sys
def say(files):
subprocess.run(['spd-say -w -r 50 -i 100 "'+files+'";'], shell=True)
return
say(sys.argv[1])
| true | true |
1c4098d9a3e1c3fcf7b89358aabcf4cc56825e04 | 417 | py | Python | src/dataset/dataset_factory.py | lupvasile/keypoint-mot | e185f150e5ea5f234c06402b8ea5db30487d16cc | [
"Apache-2.0"
] | null | null | null | src/dataset/dataset_factory.py | lupvasile/keypoint-mot | e185f150e5ea5f234c06402b8ea5db30487d16cc | [
"Apache-2.0"
] | 1 | 2020-10-06T13:17:41.000Z | 2020-10-06T17:38:47.000Z | src/dataset/dataset_factory.py | lupvasile/keypoint-mot | e185f150e5ea5f234c06402b8ea5db30487d16cc | [
"Apache-2.0"
] | 2 | 2020-09-01T05:48:25.000Z | 2021-12-27T18:34:51.000Z | from config import config
from dataset import generic_dataset, nuscenes_dataset
DATASETS = {'nuscenes': nuscenes_dataset.NuscenesDataset}
def get_dataset(dataset_name: str, subset: str, opts: generic_dataset.DatasetOptions, mini_version: bool):
return DATASETS[dataset_name](subset=subset, dataset_root=config.get... | 41.7 | 107 | 0.757794 | from config import config
from dataset import generic_dataset, nuscenes_dataset
DATASETS = {'nuscenes': nuscenes_dataset.NuscenesDataset}
def get_dataset(dataset_name: str, subset: str, opts: generic_dataset.DatasetOptions, mini_version: bool):
return DATASETS[dataset_name](subset=subset, dataset_root=config.get... | true | true |
1c40996853a1bb6f37c0af088d55832404461e76 | 1,232 | py | Python | external/workload-automation/wa/workloads/homescreen/__init__.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | 159 | 2016-01-25T11:08:39.000Z | 2022-03-28T05:20:41.000Z | external/workload-automation/wa/workloads/homescreen/__init__.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | 656 | 2016-01-25T11:16:56.000Z | 2022-03-23T16:03:28.000Z | external/workload-automation/wa/workloads/homescreen/__init__.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | 127 | 2015-03-11T16:36:17.000Z | 2022-02-15T02:26:43.000Z | # Copyright 2013-2017 ARM Limited
#
# 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 w... | 29.333333 | 87 | 0.696429 |
from wa import Workload, Parameter
class HomeScreen(Workload):
name = 'homescreen'
description = """
A workload that goes to the home screen and idles for the the
specified duration.
"""
supported_platforms = ['android']
parameters = [
Parameter('duration', kind=int, default=2... | true | true |
1c409a06ca2bbf206d7c22c10aa1a7a8e7d67207 | 715 | py | Python | eeggan/pytorch/modules/modify/noise.py | kahartma/eeggan | 1fd5b45938ea6f1033f301430a5c7fb3b9bf4fb4 | [
"BSD-3-Clause"
] | 3 | 2020-08-04T08:54:55.000Z | 2021-02-19T14:17:46.000Z | eeggan/pytorch/modules/modify/noise.py | kahartma/eeggan | 1fd5b45938ea6f1033f301430a5c7fb3b9bf4fb4 | [
"BSD-3-Clause"
] | 2 | 2020-10-08T14:14:20.000Z | 2021-06-11T07:08:42.000Z | eeggan/pytorch/modules/modify/noise.py | kahartma/eeggan | 1fd5b45938ea6f1033f301430a5c7fb3b9bf4fb4 | [
"BSD-3-Clause"
] | 2 | 2020-07-06T11:00:36.000Z | 2020-08-10T20:48:43.000Z | # Author: Kay Hartmann <kg.hartma@gmail.com>
import torch
from torch import nn
from eeggan.pytorch.modules.module import Module
from eeggan.pytorch.utils.weights import fill_weights_normal
class WeightedNoise(Module):
def __init__(self, n_features, n_time):
super().__init__()
self.weight_conv =... | 28.6 | 68 | 0.667133 |
import torch
from torch import nn
from eeggan.pytorch.modules.module import Module
from eeggan.pytorch.utils.weights import fill_weights_normal
class WeightedNoise(Module):
def __init__(self, n_features, n_time):
super().__init__()
self.weight_conv = nn.Conv1d(1, n_features, 1, bias=False)
... | true | true |
1c409ab22a09222efa40721215f153389109b31f | 2,408 | py | Python | python/docs/file_handling.py | caleberi/LeetCode | fa170244648f73e76d316a6d7fc0e813adccaa82 | [
"MIT"
] | 1 | 2021-08-10T20:00:24.000Z | 2021-08-10T20:00:24.000Z | python/docs/file_handling.py | caleberi/LeetCode | fa170244648f73e76d316a6d7fc0e813adccaa82 | [
"MIT"
] | null | null | null | python/docs/file_handling.py | caleberi/LeetCode | fa170244648f73e76d316a6d7fc0e813adccaa82 | [
"MIT"
] | 3 | 2021-06-11T11:56:39.000Z | 2021-08-10T08:50:49.000Z | import sys
from random import randint
import pickle
_file_object = None
def count_file_lines(path):
file = open("input.txt","r")
count = 0
# while file.readline()!='':
# count+=1
#OR
for line in file:
count+=1
file.close();
return count
def set_stdout(path,mode):
... | 21.122807 | 65 | 0.656977 | import sys
from random import randint
import pickle
_file_object = None
def count_file_lines(path):
file = open("input.txt","r")
count = 0
for line in file:
count+=1
file.close();
return count
def set_stdout(path,mode):
global _file_object
_file_object = open(pat... | true | true |
1c409ad508c1eae122b7a06a9bacbc2b829b4b63 | 1,283 | py | Python | homework/hw07/editor/primitives.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | 3 | 2021-11-21T06:09:39.000Z | 2022-03-12T08:05:27.000Z | project/pro4-scheme/editor/primitives.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | project/pro4-scheme/editor/primitives.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | from typing import List
from helper import verify_exact_callable_length
from log import Holder
from datamodel import Expression
from evaluate_apply import Frame, evaluate_all, Applicable
class BuiltIn(Applicable):
def execute(self, operands: List[Expression], frame: Frame, gui_holder: Holder, eval_operands=True... | 32.075 | 118 | 0.718628 | from typing import List
from helper import verify_exact_callable_length
from log import Holder
from datamodel import Expression
from evaluate_apply import Frame, evaluate_all, Applicable
class BuiltIn(Applicable):
def execute(self, operands: List[Expression], frame: Frame, gui_holder: Holder, eval_operands=True... | true | true |
1c409b1d5977d47078785e85a8ed5dcc6bda98ef | 17,700 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 45.153061 | 157 | 0.669096 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from .. import models
class LocalNetworkGatewaysOperations(object):
models = models
... | true | true |
1c409d645821398acbf2c2725c69932ce4d91f2b | 5,431 | py | Python | data/external/repositories_2to3/137656/blundercheck-master/combine/contest_20150303a/modeling/fit_errorchunk_models.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/137656/blundercheck-master/combine/contest_20150303a/modeling/fit_errorchunk_models.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/137656/blundercheck-master/combine/contest_20150303a/modeling/fit_errorchunk_models.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | #!/usr/bin/env python
import os, code
import pickle as pickle
from djeval import *
import numpy as np
from pandas import read_pickle, cut, concat, Series, get_dummies
from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier, ExtraTreesClassifier
from sklearn.cross_validation import Strat... | 42.100775 | 226 | 0.669674 |
import os, code
import pickle as pickle
from djeval import *
import numpy as np
from pandas import read_pickle, cut, concat, Series, get_dummies
from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier, ExtraTreesClassifier
from sklearn.cross_validation import StratifiedKFold, cross_val_s... | true | true |
1c409e3d1e5473d1df3c2d6d1260a8eddbe059ab | 30,300 | py | Python | framework/JobHandler.py | bonifak/raven | 666978e8546d1f948b2ad55a4c3b0fce5cc8533c | [
"Apache-2.0"
] | null | null | null | framework/JobHandler.py | bonifak/raven | 666978e8546d1f948b2ad55a4c3b0fce5cc8533c | [
"Apache-2.0"
] | null | null | null | framework/JobHandler.py | bonifak/raven | 666978e8546d1f948b2ad55a4c3b0fce5cc8533c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, 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 t... | 41.678129 | 226 | 0.651518 | from __future__ import division, print_function, unicode_literals, absolute_import
import warnings
warnings.simplefilter('default',DeprecationWarning)
import time
import collections
import subprocess
import os
import copy
import sys
import abc
import threading
import random
import socket
from utils import utils
from... | true | true |
1c409e9156c0eb16b725cac2a4f067e9d329c65f | 2,047 | py | Python | chia/server/start_full_node.py | ForestCrazy/chia-blockchain-remote-plot | 0ba838b7a8ea2b5410d438ac70295df699a30dae | [
"Apache-2.0"
] | 11,902 | 2019-12-05T00:14:29.000Z | 2022-03-31T23:25:37.000Z | chia/server/start_full_node.py | ForestCrazy/chia-blockchain-remote-plot | 0ba838b7a8ea2b5410d438ac70295df699a30dae | [
"Apache-2.0"
] | 5,246 | 2019-12-05T04:00:03.000Z | 2022-03-31T21:33:30.000Z | chia/server/start_full_node.py | Devh4ox4d/silishitcoin | 4372d06aa4a54220f2bde29c8081410503679a82 | [
"Apache-2.0"
] | 2,149 | 2019-12-05T11:12:53.000Z | 2022-03-31T06:08:34.000Z | import logging
import pathlib
from multiprocessing import freeze_support
from typing import Dict
from chia.consensus.constants import ConsensusConstants
from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.full_node.full_node import FullNode
from chia.full_node.full_node_api import FullNodeAPI
from... | 31.015152 | 87 | 0.741085 | import logging
import pathlib
from multiprocessing import freeze_support
from typing import Dict
from chia.consensus.constants import ConsensusConstants
from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.full_node.full_node import FullNode
from chia.full_node.full_node_api import FullNodeAPI
from... | true | true |
1c409eb65c6a92e583e1f42208d95c66824f1c7f | 449 | py | Python | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/title/_text.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/title/_text.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/title/_text.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="text",
parent_name="scattergl.marker.colorbar.title",
**kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_... | 26.411765 | 66 | 0.621381 | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="text",
parent_name="scattergl.marker.colorbar.title",
**kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_... | true | true |
1c409f00899ab1c7539a27e717468362b2df8d14 | 2,500 | py | Python | demos/person_detect.py | altest-com/dnfal | d1fb15508c5583aeaa0957fcc3e37634d36bf237 | [
"MIT"
] | null | null | null | demos/person_detect.py | altest-com/dnfal | d1fb15508c5583aeaa0957fcc3e37634d36bf237 | [
"MIT"
] | 1 | 2020-03-31T17:04:09.000Z | 2020-03-31T17:04:09.000Z | demos/person_detect.py | altest-com/dnfal | d1fb15508c5583aeaa0957fcc3e37634d36bf237 | [
"MIT"
] | null | null | null | import argparse
import sys
from os import path
from time import time
import cv2 as cv
from cvtlib.drawing import Drawer
from cvtlib.image import resize
from utils import list_images, DEMOS_DIR, MODELS_DIR
from dnfal.persons import BodyDetector
from dnfal.loggers import logger, config_logger
def run(image_path: str,... | 26.041667 | 79 | 0.6248 | import argparse
import sys
from os import path
from time import time
import cv2 as cv
from cvtlib.drawing import Drawer
from cvtlib.image import resize
from utils import list_images, DEMOS_DIR, MODELS_DIR
from dnfal.persons import BodyDetector
from dnfal.loggers import logger, config_logger
def run(image_path: str,... | true | true |
1c409f237c768935f49616c6f9bf5539055aaee2 | 19,269 | py | Python | datasets/siam_rpn_dataset.py | ywang-37/EnhancedSiamShipTracking | 0b25cf02b6088268a6c374cb20a7f0355bc65b2e | [
"Apache-2.0"
] | 3 | 2022-03-03T09:14:50.000Z | 2022-03-28T13:46:29.000Z | datasets/siam_rpn_dataset.py | ywang-37/EnhancedSiamShipTracking | 0b25cf02b6088268a6c374cb20a7f0355bc65b2e | [
"Apache-2.0"
] | null | null | null | datasets/siam_rpn_dataset.py | ywang-37/EnhancedSiamShipTracking | 0b25cf02b6088268a6c374cb20a7f0355bc65b2e | [
"Apache-2.0"
] | null | null | null | from __future__ import division
from torch.utils.data import Dataset
import numpy as np
import json
import random
import logging
from os.path import join
from utils.bbox_helper import *
from utils.anchors import Anchors
import math
import sys
pyv = sys.version[0]
import cv2
if pyv[0] == '3':
cv2.ocl.setUseOpenCL(Fa... | 33.165232 | 117 | 0.539104 | from __future__ import division
from torch.utils.data import Dataset
import numpy as np
import json
import random
import logging
from os.path import join
from utils.bbox_helper import *
from utils.anchors import Anchors
import math
import sys
pyv = sys.version[0]
import cv2
if pyv[0] == '3':
cv2.ocl.setUseOpenCL(Fa... | true | true |
1c409f3486947fc3583859ea467e7541e363dce0 | 1,873 | py | Python | classifier.py | adithyasunil26/LID-Excitation-Features | ae15e3f24016723ddbb832421746d2c0ef64fd03 | [
"MIT"
] | null | null | null | classifier.py | adithyasunil26/LID-Excitation-Features | ae15e3f24016723ddbb832421746d2c0ef64fd03 | [
"MIT"
] | null | null | null | classifier.py | adithyasunil26/LID-Excitation-Features | ae15e3f24016723ddbb832421746d2c0ef64fd03 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.metrics import classification_report
print("Loading data...")
df=pd.read_csv('ge... | 40.717391 | 118 | 0.744794 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.metrics import classification_report
print("Loading data...")
df=pd.read_csv('ge... | true | true |
1c40a0eadbf9d3c24d1cbe180d9dda2ca9e5488c | 249 | py | Python | molmodmt/lib/__init__.py | LMMV/MolModMT | 5725d6d5627b07edcbbd5e55318345a136b28c35 | [
"MIT"
] | null | null | null | molmodmt/lib/__init__.py | LMMV/MolModMT | 5725d6d5627b07edcbbd5e55318345a136b28c35 | [
"MIT"
] | null | null | null | molmodmt/lib/__init__.py | LMMV/MolModMT | 5725d6d5627b07edcbbd5e55318345a136b28c35 | [
"MIT"
] | null | null | null | from .libbox import module_box as box
from .libgeometry import module_geometry as geometry
from .libmath import module_math as math
from .libcom import module_com as com
from .libpbc import module_pbc as pbc
from .librmsd import module_rmsd as rmsd
| 35.571429 | 52 | 0.831325 | from .libbox import module_box as box
from .libgeometry import module_geometry as geometry
from .libmath import module_math as math
from .libcom import module_com as com
from .libpbc import module_pbc as pbc
from .librmsd import module_rmsd as rmsd
| true | true |
1c40a12cbe2a34082679b984edcde861e85f515c | 2,167 | py | Python | clinicadl/train/tasks/reconstruction_cli.py | sophieloiz/clinicadl | d26a1c6ce4f6da9de59e3d15c27ae3be2d33bc9d | [
"MIT"
] | null | null | null | clinicadl/train/tasks/reconstruction_cli.py | sophieloiz/clinicadl | d26a1c6ce4f6da9de59e3d15c27ae3be2d33bc9d | [
"MIT"
] | null | null | null | clinicadl/train/tasks/reconstruction_cli.py | sophieloiz/clinicadl | d26a1c6ce4f6da9de59e3d15c27ae3be2d33bc9d | [
"MIT"
] | null | null | null | import click
from .. import train_option
from .task_utils import task_launcher
@click.command(name="reconstruction", no_args_is_help=True)
# Mandatory arguments
@train_option.caps_directory
@train_option.preprocessing_json
@train_option.tsv_directory
@train_option.output_maps
# Options
@train_option.config_file
# Co... | 30.521127 | 101 | 0.820951 | import click
from .. import train_option
from .task_utils import task_launcher
@click.command(name="reconstruction", no_args_is_help=True)
@train_option.caps_directory
@train_option.preprocessing_json
@train_option.tsv_directory
@train_option.output_maps
@train_option.config_file
@train_option.gpu
@train_option.n_pr... | true | true |
1c40a1338382a36ef22891301005bcea31b2b08f | 644 | py | Python | src/apis/text/text/similarities/all-MiniLM-L6-v2/all-MiniLM-L6-v2.py | theunifai/unifai-apis-core | 1f2a9051c1e3df1bd19a96f22e4a07767ef3973a | [
"MIT"
] | 2 | 2021-11-09T07:18:06.000Z | 2022-01-04T19:37:17.000Z | src/apis/text/text/similarities/all-MiniLM-L6-v2/all-MiniLM-L6-v2.py | theunifai/unifai-apis-core | 1f2a9051c1e3df1bd19a96f22e4a07767ef3973a | [
"MIT"
] | 4 | 2021-11-04T08:28:59.000Z | 2021-11-07T05:59:59.000Z | src/apis/text/text/similarities/all-MiniLM-L6-v2/all-MiniLM-L6-v2.py | theunifai/unifai-apis-core | 1f2a9051c1e3df1bd19a96f22e4a07767ef3973a | [
"MIT"
] | 1 | 2022-01-07T09:12:22.000Z | 2022-01-07T09:12:22.000Z |
def predict(sentence_1: str, sentence_2: str) -> str:
"""
For two given sentences, say whether they are similar or not.
:param sentence_1: first sentence to compare
:param sentence_2: second sentence to compare
:return: similarity score (between 0 and 1)
"""
from sentence_transformers imp... | 30.666667 | 65 | 0.728261 |
def predict(sentence_1: str, sentence_2: str) -> str:
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('all-MiniLM-L6-v2')
embedding1 = model.encode(sentence_1, convert_to_tensor=True)
embedding2 = model.encode(sentence_2, convert_to_tensor=True)
cosin... | true | true |
1c40a179b5c9b26cca7c57dde90dfa09fa7626b7 | 13,221 | py | Python | newsletter/tests/test_admin.py | vikrantsingh-vs53/Final-Senior-Year-Project- | 94f2786956ebaad08711701ef03071d1051e368c | [
"MIT"
] | 68 | 2019-05-02T06:54:59.000Z | 2022-03-08T07:54:06.000Z | newsletter/tests/test_admin.py | arjunkr123/Final-Senior-Year-Project- | 12b65915dbd9bf5a4a2ae7e3c56c7eaedcb8646b | [
"MIT"
] | 4 | 2019-12-26T16:41:30.000Z | 2022-01-18T22:02:03.000Z | newsletter/tests/test_admin.py | arjunkr123/Final-Senior-Year-Project- | 12b65915dbd9bf5a4a2ae7e3c56c7eaedcb8646b | [
"MIT"
] | 40 | 2019-03-08T20:21:05.000Z | 2022-03-15T03:48:46.000Z | import os
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import patch_logger
from newsletter import admin # Triggers model admin registration
from newsletter.admin_ut... | 35.540323 | 110 | 0.625596 | import os
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import patch_logger
from newsletter import admin from newsletter.admin_utils import make_subscription
from ne... | true | true |
1c40a1b821d8871c7412044d06a39c3001541806 | 7,979 | py | Python | azure/train_landcover.py | mjevans26/Satellite_ComputerVision | 013c69c5cf6f86126e6ad2d715f8b13b300e29a8 | [
"BSD-2-Clause"
] | 10 | 2020-04-06T04:51:27.000Z | 2022-02-23T16:00:43.000Z | azure/train_landcover.py | mjevans26/Satellite_ComputerVision | 013c69c5cf6f86126e6ad2d715f8b13b300e29a8 | [
"BSD-2-Clause"
] | 2 | 2020-04-06T06:25:35.000Z | 2021-03-22T21:55:41.000Z | azure/train_landcover.py | mjevans26/Satellite_ComputerVision | 013c69c5cf6f86126e6ad2d715f8b13b300e29a8 | [
"BSD-2-Clause"
] | 5 | 2020-04-18T16:44:44.000Z | 2021-08-31T00:10:08.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 21 12:13:11 2021
@author: MEvans
"""
from utils import model_tools, processing
from utils.prediction_tools import makePredDataset, callback_predictions, plot_to_image
from matplotlib import pyplot as plt
import argparse
import os
import glob
import json
import math
impor... | 37.995238 | 404 | 0.691816 |
from utils import model_tools, processing
from utils.prediction_tools import makePredDataset, callback_predictions, plot_to_image
from matplotlib import pyplot as plt
import argparse
import os
import glob
import json
import math
import tensorflow as tf
from datetime import datetime
from azureml.core import Run, Worksp... | true | true |
1c40a1ea96587cb8301d06fdf671f5dd84c4a694 | 2,219 | py | Python | config/_base_/models/retinanet_mydartsnet_fpn.py | automlresearch/autodetector | e959baf589fb329509cd25edcab11c7d22ea5e7e | [
"Apache-2.0"
] | null | null | null | config/_base_/models/retinanet_mydartsnet_fpn.py | automlresearch/autodetector | e959baf589fb329509cd25edcab11c7d22ea5e7e | [
"Apache-2.0"
] | null | null | null | config/_base_/models/retinanet_mydartsnet_fpn.py | automlresearch/autodetector | e959baf589fb329509cd25edcab11c7d22ea5e7e | [
"Apache-2.0"
] | 1 | 2021-12-08T08:28:16.000Z | 2021-12-08T08:28:16.000Z | # model settings
model = dict(
type='RetinaNet',
# pretrained='torchvision://resnet50',
# backbone=dict(
# type='ResNet',
# depth=50,
# num_stages=4,
# out_indices=(0, 1, 2, 3),
# frozen_stages=1,
# norm_cfg=dict(type='BN', requires_grad=True),
# norm_... | 29.986486 | 124 | 0.566021 | model = dict(
type='RetinaNet',
pretrained="/home/p/Documents/experiment/experiment/Classification/PC-DARTS/pretained/0608_selected/model_best.pth.tar",
backbone=dict(
type='MyNetworkImageNet_FPN',
C=48,
num_classes=1,
... | true | true |
1c40a20e9676da219f65a2279c95dfe0c266c1d7 | 1,009 | py | Python | FaceRecog/LiveFaceJudge.py | lnblanke/DL | 4d2631e27a1a5c6de1f7239c2979af63c4019e34 | [
"MIT"
] | null | null | null | FaceRecog/LiveFaceJudge.py | lnblanke/DL | 4d2631e27a1a5c6de1f7239c2979af63c4019e34 | [
"MIT"
] | null | null | null | FaceRecog/LiveFaceJudge.py | lnblanke/DL | 4d2631e27a1a5c6de1f7239c2979af63c4019e34 | [
"MIT"
] | null | null | null | # Judge whether the face in the camera is the person in the dataset
# @Time: 8/17/2020
# @Author: lnblanke
# @Email: fjh314.84@gmail.com
# @File: LiveFaceJudge.py
import cv2, dlib, numpy, time
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
model =... | 22.422222 | 83 | 0.704658 |
import cv2, dlib, numpy, time
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
model = dlib.face_recognition_model_v1("dlib_face_recognition_resnet_model_v1.dat")
global desp
pic = cv2.imread("Dataset/obama.jpg")
faces = detector(pic, 1)
for i, f... | true | true |
1c40a2125b76ad4cc2545126d2abffb8b1786211 | 9,525 | py | Python | Time_Series/mainTestOfTSModels.py | ZGChung/P2E_FreqPred | 79544e9547a94b0d492d14af43ccf271cb175c47 | [
"MIT"
] | 2 | 2021-06-12T10:29:44.000Z | 2022-01-01T13:01:34.000Z | Time_Series/mainTestOfTSModels.py | ZGChung/P2E_FreqPred | 79544e9547a94b0d492d14af43ccf271cb175c47 | [
"MIT"
] | null | null | null | Time_Series/mainTestOfTSModels.py | ZGChung/P2E_FreqPred | 79544e9547a94b0d492d14af43ccf271cb175c47 | [
"MIT"
] | null | null | null | from warnings import simplefilter
import warnings
from statsmodels.tools.sm_exceptions import ConvergenceWarning
import pandas as pd
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import time
import sklearn as sk
import sklearn.metrics as metrics
from s... | 35.943396 | 118 | 0.758215 | from warnings import simplefilter
import warnings
from statsmodels.tools.sm_exceptions import ConvergenceWarning
import pandas as pd
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import time
import sklearn as sk
import sklearn.metrics as metrics
from s... | true | true |
1c40a23989ae80e4473f4505e19980540d22119f | 621 | py | Python | samples/websocket/web/app.py | Algorab/examples | c89c24876ac329ebdf2caef578a283a1249546bc | [
"Apache-2.0"
] | 17 | 2018-08-16T09:55:03.000Z | 2021-03-29T00:49:39.000Z | samples/websocket/web/app.py | Algorab/examples | c89c24876ac329ebdf2caef578a283a1249546bc | [
"Apache-2.0"
] | 14 | 2018-09-18T10:52:10.000Z | 2021-12-09T22:38:09.000Z | samples/websocket/web/app.py | Algorab/examples | c89c24876ac329ebdf2caef578a283a1249546bc | [
"Apache-2.0"
] | 17 | 2020-09-21T07:40:08.000Z | 2022-03-25T16:36:59.000Z | import os.path
import logging
from flask import request
def root_dir(): # pragma: no cover
return os.path.abspath(os.path.dirname(__file__))
def get_file(filename): # pragma: no cover
try:
src = os.path.join(root_dir(), filename)
# Figure out how flask returns static files
# Tried:
... | 25.875 | 61 | 0.639291 | import os.path
import logging
from flask import request
def root_dir(): return os.path.abspath(os.path.dirname(__file__))
def get_file(filename): try:
src = os.path.join(root_dir(), filename)
return open(src).read()
except IOError as exc:
r... | true | true |
1c40a30f099c634f5772a9978641a432fdc3189e | 6,661 | py | Python | networkx_mod/generators/tests/test_threshold.py | movingpictures83/MATria | d3dbd0d15e00dbc26db39ace0663868180fdc471 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | networkx_mod/generators/tests/test_threshold.py | movingpictures83/MATria | d3dbd0d15e00dbc26db39ace0663868180fdc471 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | networkx_mod/generators/tests/test_threshold.py | movingpictures83/MATria | d3dbd0d15e00dbc26db39ace0663868180fdc471 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Threshold Graphs
================
"""
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx_mod as nx
import networkx_mod.generators.threshold as nxt
from networkx_mod.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
cnlti = n... | 36.005405 | 82 | 0.607717 |
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx_mod as nx
import networkx_mod.generators.threshold as nxt
from networkx_mod.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
cnlti = nx.convert_node_labels_to_integers
class TestGeneratorThreshol... | true | true |
1c40a31df74207678516ba146b07306ed68ed2cb | 10,511 | py | Python | tx/tx_builder/bitcoin_v3_cpfp/merch_close_with_cpfp.py | fakecoinbase/boltlabs-incslashlibzkchannels | c0b43790c637f4ffd2956193b16f9ddcea94a3a4 | [
"MIT"
] | 68 | 2020-01-18T22:07:57.000Z | 2022-02-03T02:30:55.000Z | tx/tx_builder/bitcoin_v3_cpfp/merch_close_with_cpfp.py | fakecoinbase/boltlabs-incslashlibzkchannels | c0b43790c637f4ffd2956193b16f9ddcea94a3a4 | [
"MIT"
] | 2 | 2020-04-29T02:02:49.000Z | 2021-04-08T11:23:48.000Z | tx/tx_builder/bitcoin_v3_cpfp/merch_close_with_cpfp.py | fakecoinbase/boltlabs-incslashlibzkchannels | c0b43790c637f4ffd2956193b16f9ddcea94a3a4 | [
"MIT"
] | 3 | 2021-04-04T05:04:16.000Z | 2022-01-26T10:14:46.000Z | # Based on tutorial from:
# https://github.com/zeltsi/segwit_tutorial/tree/master/transactions
import argparse
import hashlib
import ecdsa
import sys
def dSHA256(data):
hash_1 = hashlib.sha256(data).digest()
hash_2 = hashlib.sha256(hash_1).digest()
return hash_2
def hash160(s):
'''sha256 followed by ... | 33.368254 | 122 | 0.694035 |
import argparse
import hashlib
import ecdsa
import sys
def dSHA256(data):
hash_1 = hashlib.sha256(data).digest()
hash_2 = hashlib.sha256(hash_1).digest()
return hash_2
def hash160(s):
return hashlib.new('ripemd160', hashlib.sha256(s).digest()).digest()
def privkey_to_pubkey(privkey):
signing_key... | true | true |
1c40a342679a1eaa8322cfbd8ecbc8309bb09213 | 390 | py | Python | openstack_dashboard/enabled/_1720_project_databases_panel.py | xinwu/horizon | 0e984a2c75d253dd35ab92e7926021b82d730b26 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/enabled/_1720_project_databases_panel.py | xinwu/horizon | 0e984a2c75d253dd35ab92e7926021b82d730b26 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/enabled/_1720_project_databases_panel.py | xinwu/horizon | 0e984a2c75d253dd35ab92e7926021b82d730b26 | [
"Apache-2.0"
] | null | null | null | # The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'databases'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'database'
# Python panel class of the PANEL to be added.
ADD_PANEL... | 39 | 78 | 0.782051 | PANEL = 'databases'
PANEL_DASHBOARD = 'project'
PANEL_GROUP = 'database'
ADD_PANEL = 'openstack_dashboard.dashboards.project.databases.panel.Databases'
| true | true |
1c40a48e830b627ca1d05cdbf1fc61968e871c4a | 22,637 | py | Python | tensorflow/python/keras/distribute/keras_correctness_test_base.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 12 | 2020-12-28T18:42:10.000Z | 2022-03-24T17:34:21.000Z | tensorflow/python/keras/distribute/keras_correctness_test_base.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:58:11.000Z | 2022-02-10T01:47:24.000Z | tensorflow/python/keras/distribute/keras_correctness_test_base.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 3 | 2020-03-09T19:17:02.000Z | 2020-06-26T23:14:31.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.481191 | 105 | 0.688342 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
from absl.testing import parameterized
import numpy as np
import six
from tensorflow.python import keras
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.distribute im... | true | true |
1c40a6eb8a3fb152356c57421c00424f19f98a0a | 8,302 | py | Python | gym-link/gym_link/envs/link_env.py | ivukotic/rl_examples | b6ca1a01429934cc936baa94753b3e08677e0fae | [
"MIT"
] | null | null | null | gym-link/gym_link/envs/link_env.py | ivukotic/rl_examples | b6ca1a01429934cc936baa94753b3e08677e0fae | [
"MIT"
] | null | null | null | gym-link/gym_link/envs/link_env.py | ivukotic/rl_examples | b6ca1a01429934cc936baa94753b3e08677e0fae | [
"MIT"
] | null | null | null | """
One network link environment.
Link has changing base load.
Actions: start 0 to 4 more transfers
Reward: percentage of free rate used. Gets negative if link fully saturated
Files sizes are normally distributed (absolute values).
"""
import math
from collections import deque
import gym
from gym import error, spaces... | 38.258065 | 114 | 0.593471 |
import math
from collections import deque
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from gym.envs.classic_control import rendering
import numpy as np
class LinkEnv(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 50
... | true | true |
1c40a712b217d3224d9cbc01756f60232fa675ad | 691 | py | Python | web/news/migrations/0001_initial.py | NeumannSven/pyshb_web | e4df67dd2550fc8dccf84f26c28894eb86ffc31f | [
"MIT"
] | null | null | null | web/news/migrations/0001_initial.py | NeumannSven/pyshb_web | e4df67dd2550fc8dccf84f26c28894eb86ffc31f | [
"MIT"
] | null | null | null | web/news/migrations/0001_initial.py | NeumannSven/pyshb_web | e4df67dd2550fc8dccf84f26c28894eb86ffc31f | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-15 19:28
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='news',
fields=[
('newsid', models.IntegerFi... | 26.576923 | 102 | 0.54848 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='news',
fields=[
('newsid', models.IntegerField(auto_created=True, primary_key=True, seriali... | true | true |
1c40a7fc94e37aa860e57e22b861ba268c37050c | 1,392 | py | Python | Python Fundamentals/P2M5MatthewLane.py | mlane52/pythonteachingcode | 46f007a94dfc6afcc22b41952f9c486d5c4c145e | [
"MIT"
] | null | null | null | Python Fundamentals/P2M5MatthewLane.py | mlane52/pythonteachingcode | 46f007a94dfc6afcc22b41952f9c486d5c4c145e | [
"MIT"
] | null | null | null | Python Fundamentals/P2M5MatthewLane.py | mlane52/pythonteachingcode | 46f007a94dfc6afcc22b41952f9c486d5c4c145e | [
"MIT"
] | null | null | null | #MatthewLaneP2M5Final
import os
os.system ("curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/elements1_20.txt -o ""elements1_20.txt")
def get_names() :
while True :
if(len(ele_list) < 5):
ele_input = input("Enter the name of an element: ").strip().lower()
... | 29.617021 | 129 | 0.635776 |
import os
os.system ("curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/elements1_20.txt -o ""elements1_20.txt")
def get_names() :
while True :
if(len(ele_list) < 5):
ele_input = input("Enter the name of an element: ").strip().lower()
if not ele_input :
... | true | true |
1c40a8057efc4770ba41bb544ae07945fc992d08 | 203 | py | Python | penerimaan_biji/penerimaan_biji/doctype/id_alat/test_id_alat.py | bobzz-zone/Biji | 02bf9001c7bd505041de57c4b952733421b80815 | [
"MIT"
] | null | null | null | penerimaan_biji/penerimaan_biji/doctype/id_alat/test_id_alat.py | bobzz-zone/Biji | 02bf9001c7bd505041de57c4b952733421b80815 | [
"MIT"
] | null | null | null | penerimaan_biji/penerimaan_biji/doctype/id_alat/test_id_alat.py | bobzz-zone/Biji | 02bf9001c7bd505041de57c4b952733421b80815 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, PT DAS and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestIDAlat(unittest.TestCase):
pass
| 18.454545 | 45 | 0.758621 | from __future__ import unicode_literals
import frappe
import unittest
class TestIDAlat(unittest.TestCase):
pass
| true | true |
1c40a8a592ca0b34897e5b34e6106314ee52f7fb | 3,039 | py | Python | 6.006 Introduction to Algorithms MIT OCW/Lecture Notes/lec06_code/avl.py | SiyuIsaacParkerTian/self_learning | 662b27c60cbfad94d80bd40f46e9f2d0f4270826 | [
"MIT"
] | 2 | 2020-02-09T18:06:02.000Z | 2020-04-19T07:30:58.000Z | 6.006 Introduction to Algorithms MIT OCW/Lecture Notes/lec06_code/avl.py | SiyuIsaacParkerTian/self_learning | 662b27c60cbfad94d80bd40f46e9f2d0f4270826 | [
"MIT"
] | null | null | null | 6.006 Introduction to Algorithms MIT OCW/Lecture Notes/lec06_code/avl.py | SiyuIsaacParkerTian/self_learning | 662b27c60cbfad94d80bd40f46e9f2d0f4270826 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import bst
def height(node):
if node is None:
return -1
else:
return node.height
def update_height(node):
node.height = max(height(node.left), height(node.right)) + 1
class AVL(bst.BST):
"""
AVL binary search tree implementation.
Supports insert, delete, find, f... | 29.504854 | 75 | 0.529121 |
import bst
def height(node):
if node is None:
return -1
else:
return node.height
def update_height(node):
node.height = max(height(node.left), height(node.right)) + 1
class AVL(bst.BST):
def left_rotate(self, x):
y = x.right
y.parent = x.parent
if y.parent is ... | true | true |
1c40a9449567adf10ec4b9ff383c65fec24d5def | 326 | py | Python | bioluigi/tasks/samtools.py | PavlidisLab/luigi-biotasks | fec1c247752278518b2906a2ce968477349fee45 | [
"Apache-2.0"
] | 5 | 2019-11-14T18:41:46.000Z | 2020-03-21T17:56:32.000Z | bioluigi/tasks/samtools.py | PavlidisLab/luigi-biotasks | fec1c247752278518b2906a2ce968477349fee45 | [
"Apache-2.0"
] | 8 | 2019-11-13T21:40:32.000Z | 2022-03-04T20:31:37.000Z | bioluigi/tasks/samtools.py | PavlidisLab/luigi-biotasks | fec1c247752278518b2906a2ce968477349fee45 | [
"Apache-2.0"
] | null | null | null | import luigi
from luigi.contrib.external_program import ExternalProgramTask
import os
class IndexBam(ExternalProgramTask):
bam_file = luigi.Parameter()
def program_args(self):
return ['samtools', 'index', self.bam_file]
def output(self):
return luigi.LocalTarget('{}.bai'.format(self.bam_f... | 25.076923 | 64 | 0.723926 | import luigi
from luigi.contrib.external_program import ExternalProgramTask
import os
class IndexBam(ExternalProgramTask):
bam_file = luigi.Parameter()
def program_args(self):
return ['samtools', 'index', self.bam_file]
def output(self):
return luigi.LocalTarget('{}.bai'.format(self.bam_f... | true | true |
1c40a9c5cbc74726c8fb2a338490323f64adc489 | 700 | py | Python | C/Matcher.py | aleksandr-gordeiko/mathlogic-itmo | 824b8942d487c0c112304fe7fa8e43f2a8aefa13 | [
"MIT"
] | null | null | null | C/Matcher.py | aleksandr-gordeiko/mathlogic-itmo | 824b8942d487c0c112304fe7fa8e43f2a8aefa13 | [
"MIT"
] | null | null | null | C/Matcher.py | aleksandr-gordeiko/mathlogic-itmo | 824b8942d487c0c112304fe7fa8e43f2a8aefa13 | [
"MIT"
] | null | null | null | # Copyright: Aleksandr Gordeiko 2020
from A.Node import Node
class Matcher:
def __init__(self):
self.node_schema_expressions = {}
def matches(self, node: Node, schema: Node):
if schema.sign is None:
try:
ex = self.node_schema_expressions[schema.expr]
except KeyError:
self.node_schema_expression... | 21.875 | 57 | 0.682857 |
from A.Node import Node
class Matcher:
def __init__(self):
self.node_schema_expressions = {}
def matches(self, node: Node, schema: Node):
if schema.sign is None:
try:
ex = self.node_schema_expressions[schema.expr]
except KeyError:
self.node_schema_expressions[schema.expr] = node.expr
return... | true | true |
1c40aaa4ea80053d21168df03ff0c474bffc67b9 | 20,317 | py | Python | cinder/volume/drivers/hitachi/hbsd_fc.py | alexpilotti/cinder-ci-fixes | c0ed2ab8cc6b1197e426cd6c58c3b582624d1cfd | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/hitachi/hbsd_fc.py | alexpilotti/cinder-ci-fixes | c0ed2ab8cc6b1197e426cd6c58c3b582624d1cfd | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/hitachi/hbsd_fc.py | alexpilotti/cinder-ci-fixes | c0ed2ab8cc6b1197e426cd6c58c3b582624d1cfd | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014, Hitachi, Ltd.
#
# 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... | 38.18985 | 79 | 0.592361 |
import os
import threading
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import six
from cinder import exception
from cinder.i18n import _LW
from cinder import utils
import cinder.volume.driver
from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
from... | true | true |
1c40ab0516aea0f0690c56eb78806e7e66a6259f | 1,098 | py | Python | sdk/python/pulumi_azure_native/dbforpostgresql/v20200214preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/dbforpostgresql/v20200214preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/dbforpostgresql/v20200214preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'CreateMode',
'HAEnabledEnum',
'ResourceIdentityType',
'ServerVersion',
'SkuTier',
]
class Cre... | 20.333333 | 80 | 0.644809 |
from enum import Enum
__all__ = [
'CreateMode',
'HAEnabledEnum',
'ResourceIdentityType',
'ServerVersion',
'SkuTier',
]
class CreateMode(str, Enum):
DEFAULT = "Default"
POINT_IN_TIME_RESTORE = "PointInTimeRestore"
class HAEnabledEnum(str, Enum):
ENABLED = "Enabled"
DISABLED = "D... | true | true |
1c40adf6a5577fca192d80e8d7e46f9de991112e | 46,384 | py | Python | hummingbot/strategy/perpetual_market_making/perpetual_market_making.py | BGTCapital/hummingbot | 2c50f50d67cedccf0ef4d8e3f4c8cdce3dc87242 | [
"Apache-2.0"
] | 2 | 2022-03-03T10:00:27.000Z | 2022-03-08T13:57:56.000Z | hummingbot/strategy/perpetual_market_making/perpetual_market_making.py | BGTCapital/hummingbot | 2c50f50d67cedccf0ef4d8e3f4c8cdce3dc87242 | [
"Apache-2.0"
] | 6 | 2022-01-31T15:44:54.000Z | 2022-03-06T04:27:12.000Z | hummingbot/strategy/perpetual_market_making/perpetual_market_making.py | BGTCapital/hummingbot | 2c50f50d67cedccf0ef4d8e3f4c8cdce3dc87242 | [
"Apache-2.0"
] | 1 | 2022-02-03T19:51:26.000Z | 2022-02-03T19:51:26.000Z | import logging
import time
from decimal import Decimal
from itertools import chain
from math import ceil, floor
from typing import Dict, List
import numpy as np
import pandas as pd
from hummingbot.connector.derivative.position import Position
from hummingbot.connector.exchange_base import ExchangeBase
from hummingbot... | 46.570281 | 144 | 0.623491 | import logging
import time
from decimal import Decimal
from itertools import chain
from math import ceil, floor
from typing import Dict, List
import numpy as np
import pandas as pd
from hummingbot.connector.derivative.position import Position
from hummingbot.connector.exchange_base import ExchangeBase
from hummingbot... | true | true |
1c40aeff2a010938c435dea825268ce34f9171c9 | 3,317 | py | Python | tensorflow_datasets/scripts/documentation/document_datasets_test.py | harsh020/datasets | b4ad3617b279ec65356e696c4c860458621976f6 | [
"Apache-2.0"
] | 1 | 2020-12-10T06:37:27.000Z | 2020-12-10T06:37:27.000Z | tensorflow_datasets/scripts/documentation/document_datasets_test.py | Jinwook-shim/datasets | 815037e87150e3c8a557d91a68b07e8ffb6a2a86 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/scripts/documentation/document_datasets_test.py | Jinwook-shim/datasets | 815037e87150e3c8a557d91a68b07e8ffb6a2a86 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 34.915789 | 104 | 0.737112 |
import functools
import pytest
import tensorflow_datasets as tfds
from tensorflow_datasets.scripts.documentation import doc_utils
from tensorflow_datasets.scripts.documentation import document_datasets
class DummyDatasetConfigs(tfds.testing.DummyDataset):
MANUAL_DOWNLOAD_INSTRUCTIONS = """Some manual instructio... | true | true |
1c40af161c7b42ead2f0f09971dbedcc1442595c | 6,044 | py | Python | pysnmp-with-texts/Chromatis-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Chromatis-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Chromatis-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Chromatis-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Chromatis-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:34:31 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 97.483871 | 1,308 | 0.741727 | Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
1c40afb51f9b020b46acfa7b2254c38faade74bb | 660 | py | Python | app/src/short_urls/tasks.py | gustavodsf/blue-code-be-test | 26b14639ab12fdccb840b8cdaf2f4386ec965bc6 | [
"Apache-2.0"
] | 1 | 2022-02-10T01:57:31.000Z | 2022-02-10T01:57:31.000Z | app/src/short_urls/tasks.py | gustavodsf/blue-code-be-test | 26b14639ab12fdccb840b8cdaf2f4386ec965bc6 | [
"Apache-2.0"
] | null | null | null | app/src/short_urls/tasks.py | gustavodsf/blue-code-be-test | 26b14639ab12fdccb840b8cdaf2f4386ec965bc6 | [
"Apache-2.0"
] | null | null | null | import time
import sqlite3
import requests
from bs4 import BeautifulSoup
def threaded_task(shorterObj):
title = get_title_from_page(shorterObj.original_url)
add_title_to_database(shorterObj.id, title)
def add_title_to_database(id, title):
con = sqlite3.connect('app/src/core/flask_boilerplate_main.db')
cur... | 27.5 | 101 | 0.719697 | import time
import sqlite3
import requests
from bs4 import BeautifulSoup
def threaded_task(shorterObj):
title = get_title_from_page(shorterObj.original_url)
add_title_to_database(shorterObj.id, title)
def add_title_to_database(id, title):
con = sqlite3.connect('app/src/core/flask_boilerplate_main.db')
cur... | true | true |
1c40afca3bc43ba6bb32c9ef1a343d7db2bc9737 | 4,390 | py | Python | contrib/seeds/generate-seeds.py | genteshare-project/genteshare | b1407e7977c52bac52326cec9c7243877d0b273d | [
"MIT"
] | 3 | 2018-05-04T01:33:30.000Z | 2018-08-08T14:54:21.000Z | contrib/seeds/generate-seeds.py | genteshare-project/genteshare | b1407e7977c52bac52326cec9c7243877d0b273d | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | genteshare-project/genteshare | b1407e7977c52bac52326cec9c7243877d0b273d | [
"MIT"
] | 1 | 2019-08-18T00:42:19.000Z | 2019-08-18T00:42:19.000Z | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... | 31.582734 | 98 | 0.583599 | from __future__ import print_function, division
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.oni... | true | true |
1c40b03a78b4dd52d0c701603722180fc0d2466c | 568 | py | Python | esphomeflasher/const.py | mozzwald/esphome-flasher | 419b180845352cce92b94766c8af777d0ddf9d0b | [
"MIT"
] | null | null | null | esphomeflasher/const.py | mozzwald/esphome-flasher | 419b180845352cce92b94766c8af777d0ddf9d0b | [
"MIT"
] | null | null | null | esphomeflasher/const.py | mozzwald/esphome-flasher | 419b180845352cce92b94766c8af777d0ddf9d0b | [
"MIT"
] | 1 | 2020-07-05T13:40:52.000Z | 2020-07-05T13:40:52.000Z | import re
__version__ = "1.2.0"
ESP32_DEFAULT_BOOTLOADER_FORMAT = 'https://fujinet.online/firmware/bootloader.bin'
ESP32_DEFAULT_OTA_DATA = 'https://fujinet.online/firmware/boot_app0.bin'
ESP32_DEFAULT_PARTITIONS = 'https://fujinet.online/firmware/partitions.bin'
ESP32_DEFAULT_FIRMWARE = 'https://fujinet.online/firmw... | 43.692308 | 114 | 0.732394 | import re
__version__ = "1.2.0"
ESP32_DEFAULT_BOOTLOADER_FORMAT = 'https://fujinet.online/firmware/bootloader.bin'
ESP32_DEFAULT_OTA_DATA = 'https://fujinet.online/firmware/boot_app0.bin'
ESP32_DEFAULT_PARTITIONS = 'https://fujinet.online/firmware/partitions.bin'
ESP32_DEFAULT_FIRMWARE = 'https://fujinet.online/firmw... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.