hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b549ebf1f575ae1b2ca0a4f54c933a69dae4422d | 9,154 | py | Python | tests/test_models.py | jscook2345/squad-client | 3b40e3f2a2846c6567a03676a18e3d99eed3d75d | [
"MIT"
] | 3 | 2020-03-30T18:34:57.000Z | 2020-04-12T07:51:25.000Z | tests/test_models.py | jscook2345/squad-client | 3b40e3f2a2846c6567a03676a18e3d99eed3d75d | [
"MIT"
] | 127 | 2020-03-05T23:20:37.000Z | 2022-03-23T18:44:19.000Z | tests/test_models.py | jscook2345/squad-client | 3b40e3f2a2846c6567a03676a18e3d99eed3d75d | [
"MIT"
] | 17 | 2020-02-14T14:37:38.000Z | 2022-03-17T15:59:56.000Z | import unittest
from . import settings
from squad_client.core.api import SquadApi
from squad_client.core.models import Squad, ALL, Project
from squad_client.utils import first
SquadApi.configure(url='http://localhost:%s' % settings.DEFAULT_SQUAD_PORT)
class SquadTest(unittest.TestCase):
def setUp(self):
... | 33.654412 | 133 | 0.680686 |
6c703fa3f75fa753ff170907be8ba14750272fda | 62,752 | py | Python | Lib/importlib/_bootstrap_external.py | gaurav1086/cpython | 10355ed7f132ed10f1e0d8bd64ccb744b86b1cce | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2021-05-06T19:55:27.000Z | 2021-05-06T19:55:27.000Z | Lib/importlib/_bootstrap_external.py | doc22940/cpython | 65ecc390c1fa5acdd6348ae3f9843bbdcd8870d1 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/importlib/_bootstrap_external.py | doc22940/cpython | 65ecc390c1fa5acdd6348ae3f9843bbdcd8870d1 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """Core implementation of path-based import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public... | 38.147112 | 105 | 0.624618 |
c371d88057187c656d9f769587a5e69d0b81b2f1 | 915 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/region_GL.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_GL.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_GL.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. GL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GL = PhoneMetadata(id='GL', country_code=299, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-689]\\d{5}', possible_length=(6,)... | 83.181818 | 149 | 0.71694 |
8657d90fe7092bbdb91cfe26101bae5ad4366000 | 808 | py | Python | migrations/versions/816ea3631582_add_topics.py | OpenASL/HowSignBot | bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2 | [
"MIT"
] | 9 | 2021-01-12T07:28:30.000Z | 2021-12-30T09:27:04.000Z | migrations/versions/816ea3631582_add_topics.py | OpenASL/HowSignBot | bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2 | [
"MIT"
] | 16 | 2021-03-28T16:31:42.000Z | 2022-03-21T00:18:30.000Z | migrations/versions/816ea3631582_add_topics.py | OpenASL/HowSignBot | bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2 | [
"MIT"
] | 1 | 2021-07-18T20:49:19.000Z | 2021-07-18T20:49:19.000Z | """add topics
Revision ID: 816ea3631582
Revises: 37a124b0099b
Create Date: 2021-03-13 14:20:10.044131
"""
from alembic import op
import sqlalchemy as sa
import bot
# revision identifiers, used by Alembic.
revision = "816ea3631582"
down_revision = "37a124b0099b"
branch_labels = None
depends_on = None
def upgrade()... | 23.085714 | 90 | 0.674505 |
7d54fbcd31a227c9893bdf6b082f900c065d73a9 | 220 | py | Python | 210915/Q10951.py | JongGuk/BOJ | dd447d9f65481de19a3c0b4f8bb8b5f3d6277c15 | [
"MIT"
] | null | null | null | 210915/Q10951.py | JongGuk/BOJ | dd447d9f65481de19a3c0b4f8bb8b5f3d6277c15 | [
"MIT"
] | null | null | null | 210915/Q10951.py | JongGuk/BOJ | dd447d9f65481de19a3c0b4f8bb8b5f3d6277c15 | [
"MIT"
] | null | null | null | '''
Two integers A and B will given, please print result of A+B.
Input cases consists with several lines.
'''
import sys
lines = sys.stdin.readlines()
for line in lines:
A, B = map(int, line.split())
print(A+B) | 20 | 60 | 0.677273 |
377e7350c6abf673eb2b63e3adb971b5490c0fe3 | 1,880 | py | Python | connectomics/data/augmentation/__init__.py | mouradbelo/pytorch_connectomics | bbed3a879ba2b4bcfa215eb2aba04b59533e180a | [
"MIT"
] | 1 | 2020-07-22T12:56:09.000Z | 2020-07-22T12:56:09.000Z | connectomics/data/augmentation/__init__.py | mouradbelo/pytorch_connectomics | bbed3a879ba2b4bcfa215eb2aba04b59533e180a | [
"MIT"
] | null | null | null | connectomics/data/augmentation/__init__.py | mouradbelo/pytorch_connectomics | bbed3a879ba2b4bcfa215eb2aba04b59533e180a | [
"MIT"
] | null | null | null | from .composition import Compose
from .augmentor import DataAugment
from .test_augmentor import TestAugmentor
# augmentation methods
from .warp import Elastic
from .grayscale import Grayscale
from .flip import Flip
from .rotation import Rotate
from .rescale import Rescale
from .misalign import MisAlignment
from .missi... | 32.413793 | 131 | 0.704255 |
ab758a9ff77cc679fdb6f1d327c1e927e36f7ddb | 423 | py | Python | spikey/snn/__init__.py | SpikeyCNS/spikey | 03a49073491974eff01bc017fd8eadb822e13f0d | [
"MIT"
] | 4 | 2021-02-25T20:53:41.000Z | 2022-01-18T15:27:07.000Z | spikey/snn/__init__.py | SpikeyCNS/spikey | 03a49073491974eff01bc017fd8eadb822e13f0d | [
"MIT"
] | 5 | 2021-03-06T05:35:10.000Z | 2021-03-31T09:27:57.000Z | spikey/snn/__init__.py | SpikeyCNS/spikey | 03a49073491974eff01bc017fd8eadb822e13f0d | [
"MIT"
] | null | null | null | """
SNN __init__.py
"""
try:
import spikey.snn.input
import spikey.snn.neuron
import spikey.snn.readout
import spikey.snn.reward
import spikey.snn.synapse
import spikey.snn.weight
from spikey.snn.network import Network, RLNetwork, ActiveRLNetwork
from spikey.snn.modifier import Modifier... | 24.882353 | 70 | 0.732861 |
7334e809c1322db094a33f4a6c913d1cd0b7a466 | 292 | py | Python | misc/tempConversion.py | cmulliss/turtles-doing-things | 70c8241bcf6d3b37104a59e92b5cf5a002fcb0bf | [
"CC0-1.0"
] | null | null | null | misc/tempConversion.py | cmulliss/turtles-doing-things | 70c8241bcf6d3b37104a59e92b5cf5a002fcb0bf | [
"CC0-1.0"
] | null | null | null | misc/tempConversion.py | cmulliss/turtles-doing-things | 70c8241bcf6d3b37104a59e92b5cf5a002fcb0bf | [
"CC0-1.0"
] | null | null | null | # program to convert degrees f to degrees c
# need to use (degF - 32) * 5/9
user = input('Hello, what is your name? ')
print('Hello', user)
degF = int(input('Enter a temperature in degrees F: '))
degC = (degF -32) * 5/9
print('{} ,degrees F converts to , {} ,degrees C'.format(degF, (degC)))
| 36.5 | 71 | 0.64726 |
efb2c233341fbbe4d8823cf277952d746dcc00dc | 1,087 | py | Python | pytuber/utils.py | Starz0r/pytuber | 5bb53edde6a39cedec48c4a8f41ba22db21d4727 | [
"MIT"
] | 8 | 2019-01-27T00:52:20.000Z | 2021-07-15T15:57:19.000Z | pytuber/utils.py | Starz0r/pytuber | 5bb53edde6a39cedec48c4a8f41ba22db21d4727 | [
"MIT"
] | 22 | 2019-01-25T14:57:08.000Z | 2021-12-13T19:55:04.000Z | pytuber/utils.py | Starz0r/pytuber | 5bb53edde6a39cedec48c4a8f41ba22db21d4727 | [
"MIT"
] | 4 | 2019-02-17T09:56:30.000Z | 2021-04-17T17:53:13.000Z | import contextlib
from datetime import datetime
from typing import Optional
import click
from yaspin import yaspin
from pytuber.storage import Registry
def magenta(text):
return click.style(str(text), fg="magenta")
@contextlib.contextmanager
def spinner(text):
sp = yaspin(text=text)
sp.start()
try... | 21.74 | 74 | 0.633855 |
9ad0cec0c9a2cac5ee0655195c24575470255216 | 3,900 | py | Python | Algorithm.Python/Alphas/TripleLeverageETFPairVolatilityDecayAlpha.py | szymanskilukasz/Lean | fe2ac131af2d0614494e5c970a57d4b7c89d5f88 | [
"Apache-2.0"
] | 4 | 2020-03-30T06:00:05.000Z | 2020-06-29T02:51:25.000Z | Algorithm.Python/Alphas/TripleLeverageETFPairVolatilityDecayAlpha.py | szymanskilukasz/Lean | fe2ac131af2d0614494e5c970a57d4b7c89d5f88 | [
"Apache-2.0"
] | 30 | 2020-03-16T07:27:37.000Z | 2021-05-17T05:51:04.000Z | Algorithm.Python/Alphas/TripleLeverageETFPairVolatilityDecayAlpha.py | szymanskilukasz/Lean | fe2ac131af2d0614494e5c970a57d4b7c89d5f88 | [
"Apache-2.0"
] | 1 | 2020-03-10T03:12:12.000Z | 2020-03-10T03:12:12.000Z | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... | 41.489362 | 163 | 0.753846 |
933c1474daa9456141cf505919944abbc827af85 | 3,301 | py | Python | backend/main.py | willshiao/dub-hacks-2020 | 081aa32b50d61ad171388951354678505e20fa1e | [
"MIT"
] | 1 | 2020-10-18T19:05:33.000Z | 2020-10-18T19:05:33.000Z | backend/main.py | willshiao/dub-hacks-2020 | 081aa32b50d61ad171388951354678505e20fa1e | [
"MIT"
] | null | null | null | backend/main.py | willshiao/dub-hacks-2020 | 081aa32b50d61ad171388951354678505e20fa1e | [
"MIT"
] | 1 | 2021-06-09T03:54:37.000Z | 2021-06-09T03:54:37.000Z | from os import path
from flask import Flask, request
from flask_cors import CORS
import youtube_dl
import ujson
from pose_extractor import PoseExtractor
import mysql.connector
from preprocessing import normalize
import re
VID_DIR='./videos'
YT_REGEX = re.compile(r'^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed... | 30.850467 | 123 | 0.605877 |
69161d8ffb3e9acb284c0610f6f55f215abbec0a | 1,051 | py | Python | Error.tweets-try-except.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | 4 | 2019-05-04T00:33:25.000Z | 2021-05-29T20:37:59.000Z | Error.tweets-try-except.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | null | null | null | Error.tweets-try-except.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | 3 | 2020-05-05T13:14:28.000Z | 2022-02-03T16:18:37.000Z | #import pandas
import pandas as pd
#import twitter data to dataframe
tweets_df = pd.read_csv("tweets.csv")
# Define count_entries()
def count_entries(df, col_name='lang'):
"""Return a dictionary with counts of
occurrences as value for each key."""
# Raise a ValueError if col_name is NOT in DataFrame
... | 26.275 | 82 | 0.666984 |
1c507404f6ee68c5084d8477d1dcb7b9a764ed52 | 1,548 | py | Python | integrationtest/vm/windows/suite_setup.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/windows/suite_setup.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/windows/suite_setup.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | '''
@author: SyZhao
'''
import os.path
import zstacklib.utils.linux as linux
import zstacklib.utils.http as http
import zstacktestagent.plugins.host as host_plugin
import zstacktestagent.testagent as testagent
import zstackwoodpecker.operations.deploy_operations as deploy_operations
import zstackwoodpecker.... | 46.909091 | 221 | 0.802326 |
997dd3eaf452bc400eb1a45fb80c935e99bb1acb | 7,244 | py | Python | src/datadog_api_client/v1/model/monitor_overall_states.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v1/model/monitor_overall_states.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v1/model/monitor_overall_states.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
import nulltype # ... | 38.737968 | 172 | 0.569023 |
14528a7881d641b41a1e2d920c226594b0e5e6be | 794 | py | Python | tests/test_excel.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 15 | 2019-11-07T09:57:56.000Z | 2022-01-03T22:45:28.000Z | tests/test_excel.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 6 | 2021-03-19T23:15:14.000Z | 2021-09-23T16:46:19.000Z | tests/test_excel.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 1 | 2021-12-17T05:50:47.000Z | 2021-12-17T05:50:47.000Z | import pytest
import os
import filecmp
from excel import convert_xls_to_xlsx, convert_spreadsheet_to_csv
def test_convert_xls_to_xlsx():
x = convert_xls_to_xlsx('tests/test_files/counter/counter4_jr1_2018_01.xls')
assert isinstance(x, str)
assert '.xlsx' in x
assert os.path.isfile(x)
def test_convert_... | 37.809524 | 102 | 0.756927 |
884deee4ef5c4e088a59b8432155f75855f155e9 | 7,775 | py | Python | ingestion/tests/integration/ometa/test_ometa_dashboard_api.py | Shreshtha13/OpenMetadata | cd65037ac76a2d44ece2e3cf456789864ee363da | [
"Apache-2.0"
] | 864 | 2021-08-13T23:48:45.000Z | 2022-03-31T18:36:30.000Z | ingestion/tests/integration/ometa/test_ometa_dashboard_api.py | Shreshtha13/OpenMetadata | cd65037ac76a2d44ece2e3cf456789864ee363da | [
"Apache-2.0"
] | 2,701 | 2021-08-14T06:05:12.000Z | 2022-03-31T23:48:32.000Z | ingestion/tests/integration/ometa/test_ometa_dashboard_api.py | Shreshtha13/OpenMetadata | cd65037ac76a2d44ece2e3cf456789864ee363da | [
"Apache-2.0"
] | 144 | 2021-08-16T20:44:08.000Z | 2022-03-29T14:12:30.000Z | # Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... | 31.734694 | 85 | 0.653248 |
64b049c970a8018d6e899811ed6595dba2f1db5a | 792 | py | Python | folks/models/post.py | marinintim/folks | 2dce457c9d57da34626717667b942fa91f62385f | [
"MIT"
] | 4 | 2019-12-02T20:04:55.000Z | 2020-04-30T22:14:30.000Z | folks/models/post.py | marinintim/folks | 2dce457c9d57da34626717667b942fa91f62385f | [
"MIT"
] | null | null | null | folks/models/post.py | marinintim/folks | 2dce457c9d57da34626717667b942fa91f62385f | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, DateTime, String, ForeignKey
from sqlalchemy.orm import relationship
from datetime import datetime
from database import Base
class Post(Base):
__tablename__ = 'posts'
id = Column(Integer, primary_key=True)
body = Column(String())
posted_at = Column(DateTime, ind... | 36 | 70 | 0.713384 |
c3d7f78164c0aa9b802ee22368c2a254e8c91d6c | 8,298 | py | Python | dnnlib/tflib/autosummary.py | Di-Is/stylegan2-ada | c1228c08a27fda80e512cfecf3b10c3c93c8b6d3 | [
"BSD-Source-Code"
] | null | null | null | dnnlib/tflib/autosummary.py | Di-Is/stylegan2-ada | c1228c08a27fda80e512cfecf3b10c3c93c8b6d3 | [
"BSD-Source-Code"
] | null | null | null | dnnlib/tflib/autosummary.py | Di-Is/stylegan2-ada | c1228c08a27fda80e512cfecf3b10c3c93c8b6d3 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and re... | 42.336735 | 135 | 0.660521 |
c760e3fd90e023379edae411160d261785661078 | 5,192 | py | Python | n5k/calculator_base.py | c-d-leonard/N5K | 99d844621f2436aaf56fc98484e309043d4b7bd1 | [
"BSD-3-Clause"
] | null | null | null | n5k/calculator_base.py | c-d-leonard/N5K | 99d844621f2436aaf56fc98484e309043d4b7bd1 | [
"BSD-3-Clause"
] | null | null | null | n5k/calculator_base.py | c-d-leonard/N5K | 99d844621f2436aaf56fc98484e309043d4b7bd1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
class N5KCalculatorBase(object):
name = 'Base'
needed_fields = ['output_prefix']
def __init__(self, fname_config):
if isinstance(fname_config, dict):
self.config = fname_config
else:
import yaml
with open(fname_config) as f:
... | 34.157895 | 87 | 0.540254 |
7756514fa4197b5a6c91505483790ac1c8a85d01 | 4,514 | py | Python | src/sagemaker/deprecations.py | eitansela/sagemaker-python-sdk | aa54102b5113b1d39bbbd4d9d341775f84641681 | [
"Apache-2.0"
] | 1 | 2021-07-22T00:23:51.000Z | 2021-07-22T00:23:51.000Z | src/sagemaker/deprecations.py | eitansela/sagemaker-python-sdk | aa54102b5113b1d39bbbd4d9d341775f84641681 | [
"Apache-2.0"
] | 24 | 2021-05-18T07:10:27.000Z | 2021-05-28T13:36:51.000Z | src/sagemaker/deprecations.py | eitansela/sagemaker-python-sdk | aa54102b5113b1d39bbbd4d9d341775f84641681 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 25.794286 | 74 | 0.671688 |
6e9b2333ed8b6a85508655d296209459ea63e8ed | 1,001 | py | Python | travel/docs/Amadeus-master/pactravel-master/python-client/test/test_train_search_itinerary.py | shopglobal/api | 176e1858d3f93e8e7854ba194698b6b9825841da | [
"CC-BY-4.0"
] | null | null | null | travel/docs/Amadeus-master/pactravel-master/python-client/test/test_train_search_itinerary.py | shopglobal/api | 176e1858d3f93e8e7854ba194698b6b9825841da | [
"CC-BY-4.0"
] | 1 | 2021-06-01T22:04:28.000Z | 2021-06-01T22:04:28.000Z | travel/docs/Amadeus-master/pactravel-master/python-client/test/test_train_search_itinerary.py | shopglobal/api | 176e1858d3f93e8e7854ba194698b6b9825841da | [
"CC-BY-4.0"
] | null | null | null | # coding: utf-8
"""
Amadeus Travel Innovation Sandbox
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
imp... | 22.244444 | 105 | 0.722278 |
ed2d295b2003c7fbb69716c1e27cfde6f36318ad | 690 | py | Python | src/nexpy/api/frills/functions/polynomial.py | tschoonj/nexpy | c95b0602f09eac55bd1d7eda8ddd729f42a2d5c5 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/nexpy/api/frills/functions/polynomial.py | tschoonj/nexpy | c95b0602f09eac55bd1d7eda8ddd729f42a2d5c5 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/nexpy/api/frills/functions/polynomial.py | tschoonj/nexpy | c95b0602f09eac55bd1d7eda8ddd729f42a2d5c5 | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2013, NeXpy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING, distributed with this software.
#--------... | 31.363636 | 78 | 0.456522 |
b7b9faf7efa667269a2cf1c4aaaac0723056131f | 2,954 | py | Python | geopandas/tools/tests/test_tools.py | raphacosta27/geopandas | 2c22a26bd40ec48536026b160c54c6fe523d22d7 | [
"BSD-3-Clause"
] | 2,914 | 2015-01-01T14:27:43.000Z | 2022-03-31T22:26:39.000Z | geopandas/tools/tests/test_tools.py | raphacosta27/geopandas | 2c22a26bd40ec48536026b160c54c6fe523d22d7 | [
"BSD-3-Clause"
] | 2,040 | 2015-01-16T11:34:26.000Z | 2022-03-31T12:13:39.000Z | geopandas/tools/tests/test_tools.py | raphacosta27/geopandas | 2c22a26bd40ec48536026b160c54c6fe523d22d7 | [
"BSD-3-Clause"
] | 758 | 2015-01-21T20:23:32.000Z | 2022-03-31T17:22:53.000Z | from distutils.version import LooseVersion
from shapely.geometry import LineString, MultiPoint, Point
import pyproj
from pyproj import CRS
from geopandas import GeoSeries
from geopandas.tools import collect
from geopandas.tools.crs import epsg_from_crs, explicit_crs_from_epsg
import pytest
# pyproj 2.3.1 fixed a s... | 34.348837 | 86 | 0.659783 |
7e36ad78a0505b2b2f4fc2f3b69e3cd8b1fd9d0e | 5,526 | py | Python | progressive_billing/progressive_billing/progressive_billing.py | hafeeserp/Progressive-Billing | 8e6f38b5a76bf432629a331ee3df174fe5366b85 | [
"MIT"
] | null | null | null | progressive_billing/progressive_billing/progressive_billing.py | hafeeserp/Progressive-Billing | 8e6f38b5a76bf432629a331ee3df174fe5366b85 | [
"MIT"
] | null | null | null | progressive_billing/progressive_billing/progressive_billing.py | hafeeserp/Progressive-Billing | 8e6f38b5a76bf432629a331ee3df174fe5366b85 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe.utils import cint, flt
from frappe import _, msgprint, throw
from erpnext.accounts.party import get_party_account, get_due_date
from erpnext.controllers.stock_controller import update_gl_entries_after
from frappe.model.map... | 42.183206 | 239 | 0.696526 |
36b6f40e317d94e4c15356713f64478915c17112 | 10,910 | py | Python | test/azure/low-level/Expected/AcceptanceTests/AzureSpecialsLowLevel/azurespecialpropertieslowlevel/rest/skip_url_encoding/_request_builders.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/azure/low-level/Expected/AcceptanceTests/AzureSpecialsLowLevel/azurespecialpropertieslowlevel/rest/skip_url_encoding/_request_builders.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/azure/low-level/Expected/AcceptanceTests/AzureSpecialsLowLevel/azurespecialpropertieslowlevel/rest/skip_url_encoding/_request_builders.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.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 may ... | 35.888158 | 116 | 0.681027 |
352fbd3ba304831c09b1a6f8d6d73b5e52771b6f | 58 | py | Python | HackerRank Python Solutions/001. Say Hello World with Python.py | aravind-alpha/Hackerrank-Solutions | 489ea4760d0f67bf257d2f20320e24f1cba5ec11 | [
"MIT"
] | 1 | 2021-05-02T06:05:35.000Z | 2021-05-02T06:05:35.000Z | HackerRank Python Solutions/001. Say Hello World with Python.py | aravind-alpha/Hackerrank-Solutions | 489ea4760d0f67bf257d2f20320e24f1cba5ec11 | [
"MIT"
] | null | null | null | HackerRank Python Solutions/001. Say Hello World with Python.py | aravind-alpha/Hackerrank-Solutions | 489ea4760d0f67bf257d2f20320e24f1cba5ec11 | [
"MIT"
] | 2 | 2021-12-01T06:42:21.000Z | 2021-12-29T17:12:53.000Z | # Say "Hello,World!" with Python:
print("Hello, World!")
| 14.5 | 33 | 0.655172 |
ae2029dbb5d1cd2c9778b4125ff645bb4ad95980 | 7,944 | py | Python | http_server/manage_data_handler.py | JX-Wang/obtaining_domain_valid_dns | fac037fd0be6dd4f1a6ca1a9f1d5cd71aa25cd72 | [
"MIT"
] | 1 | 2019-07-02T02:44:55.000Z | 2019-07-02T02:44:55.000Z | http_server/manage_data_handler.py | JX-Wang/obtaining_domain_valid_dns | fac037fd0be6dd4f1a6ca1a9f1d5cd71aa25cd72 | [
"MIT"
] | null | null | null | http_server/manage_data_handler.py | JX-Wang/obtaining_domain_valid_dns | fac037fd0be6dd4f1a6ca1a9f1d5cd71aa25cd72 | [
"MIT"
] | null | null | null | # encoding:utf-8
"""
主节点控制功能
"""
import tornado.web
import hashlib
import time
import json
from system_parameter import *
from Logger import Logger
from async_fetch import async_fetch,async_post
from tornado import gen
logger = Logger(file_path='./query_log/',show_terminal=True) # 日志配置
class RespDomainResultHandle... | 34.094421 | 148 | 0.55929 |
b93d11843e4ad40beda64350aed7be28a2fd85ab | 953 | py | Python | setup.py | maroba/physix | be8b6aabb8b784511906e4a0e531db10072137a5 | [
"MIT"
] | null | null | null | setup.py | maroba/physix | be8b6aabb8b784511906e4a0e531db10072137a5 | [
"MIT"
] | null | null | null | setup.py | maroba/physix | be8b6aabb8b784511906e4a0e531db10072137a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import exists
from setuptools import setup, find_packages
author = 'Matthias Baer'
email = 'matthias.r.baer@googlemail.com'
description = 'A Physics toolbox in Python'
name = 'physix'
year = '2022'
url = 'https://github.com/maroba/physix'
version = '0.0.2'
se... | 27.228571 | 77 | 0.636936 |
0f7eaf2c49e0736fd3b67d09243e8fba6d038f8c | 6,296 | py | Python | docs/source/conf.py | RCTimms/rockets | 61099b44b306ab8dabf746c4aa6e1ad6d118823d | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | RCTimms/rockets | 61099b44b306ab8dabf746c4aa6e1ad6d118823d | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | RCTimms/rockets | 61099b44b306ab8dabf746c4aa6e1ad6d118823d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# rockets documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 28 12:35:56 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | 31.014778 | 135 | 0.695362 |
86c9121072ecb48bdf98f6b415c37e862c6f6c5e | 2,761 | py | Python | custom_components/pvoutput_exporter/config_flow.py | jmbrunskill/ha-energy-pvoutput | b5a054121f80113f358eb7b24424e1d66e0de9e8 | [
"MIT"
] | null | null | null | custom_components/pvoutput_exporter/config_flow.py | jmbrunskill/ha-energy-pvoutput | b5a054121f80113f358eb7b24424e1d66e0de9e8 | [
"MIT"
] | null | null | null | custom_components/pvoutput_exporter/config_flow.py | jmbrunskill/ha-energy-pvoutput | b5a054121f80113f358eb7b24424e1d66e0de9e8 | [
"MIT"
] | null | null | null | """Config flow for PV Output Exporter."""
from __future__ import annotations
from typing import Any
from homeassistant.helpers.config_validation import boolean
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry, ConfigFlow, OptionsFlow
from homeassistant.const import CONF_NAME, CONF_API_KE... | 31.375 | 78 | 0.5795 |
fce0796ef4d9cf4b9c3c117385f798580905513d | 17,669 | py | Python | cliquetree.py | georgeAO/IterativeCoarsening | 0bf22fd74b93218fac6116c0a52332f36d29d26e | [
"MIT"
] | null | null | null | cliquetree.py | georgeAO/IterativeCoarsening | 0bf22fd74b93218fac6116c0a52332f36d29d26e | [
"MIT"
] | null | null | null | cliquetree.py | georgeAO/IterativeCoarsening | 0bf22fd74b93218fac6116c0a52332f36d29d26e | [
"MIT"
] | null | null | null | from copy import deepcopy
import networkx as nx
from networkx import NetworkXNoPath
'''
Copyright (c) 2016, cliquetree contributors,
Charalampos Mavroforakis <cmav@bu.edu>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
co... | 39.975113 | 101 | 0.513442 |
26ba81263fac141d57986de6591fb54730875f7f | 204 | py | Python | python/flareapps/django/homepage/urls.py | flarebyte/wonderful-bazar | 810514cd7d73505b11d738f8b84d91842d18d074 | [
"MIT"
] | null | null | null | python/flareapps/django/homepage/urls.py | flarebyte/wonderful-bazar | 810514cd7d73505b11d738f8b84d91842d18d074 | [
"MIT"
] | null | null | null | python/flareapps/django/homepage/urls.py | flarebyte/wonderful-bazar | 810514cd7d73505b11d738f8b84d91842d18d074 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^(en|fr)/$', 'flareteam.homepage.views.index'),
(r'^(en|fr)/([A-Za-z0-9-_]+).html$', 'flareteam.homepage.views.section'),
)
| 25.5 | 77 | 0.627451 |
3fb4f541451cf2432a0223b611c777a803943b55 | 2,306 | py | Python | examples/spend_p2sh_transaction.py | doersf/python-bitcoin-utils | ab558513aba706d0215463fffc615772a955a142 | [
"MIT"
] | null | null | null | examples/spend_p2sh_transaction.py | doersf/python-bitcoin-utils | ab558513aba706d0215463fffc615772a955a142 | [
"MIT"
] | null | null | null | examples/spend_p2sh_transaction.py | doersf/python-bitcoin-utils | ab558513aba706d0215463fffc615772a955a142 | [
"MIT"
] | 2 | 2021-09-20T23:55:53.000Z | 2021-12-14T16:06:25.000Z | # Copyright (C) 2018-2020 The python-bitcoin-utils developers
#
# This file is part of python-bitcoin-utils
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoin-utils, including this file, may be copied,
# modified, propagated,... | 35.476923 | 89 | 0.736774 |
d6a2294729639aa006555cc91e50ad834050bff4 | 1,035 | py | Python | scripts/checktest.py | iondbproject/utility-scripts | 36f10931ec831a6805feff1766000709060b9c3b | [
"Apache-2.0"
] | null | null | null | scripts/checktest.py | iondbproject/utility-scripts | 36f10931ec831a6805feff1766000709060b9c3b | [
"Apache-2.0"
] | null | null | null | scripts/checktest.py | iondbproject/utility-scripts | 36f10931ec831a6805feff1766000709060b9c3b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import argparse
import re
import os
test_files = []
for root, dirnames, filenames in os.walk("src"):
for filename in filenames:
if re.search(r"test_.*\.c(?:pp)?", filename):
test_files.append(os.path.join(root, filename))
for filename in test_files:
with open(filename, "r... | 30.441176 | 91 | 0.592271 |
1cdee373f46fe7596e75b60fcce7cd397b5c5f46 | 2,647 | py | Python | external/vcm/vcm/calc/histogram.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | 1 | 2021-12-14T23:43:35.000Z | 2021-12-14T23:43:35.000Z | external/vcm/vcm/calc/histogram.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | 195 | 2021-09-16T05:47:18.000Z | 2022-03-31T22:03:15.000Z | external/vcm/vcm/calc/histogram.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | null | null | null | from typing import Any, Hashable, Mapping, Tuple
import numpy as np
import xarray as xr
def histogram(da: xr.DataArray, **kwargs) -> Tuple[xr.DataArray, xr.DataArray]:
"""Compute histogram and return tuple of counts and bin widths.
Args:
da: input data
kwargs: optional parameters to pass on ... | 38.362319 | 88 | 0.656215 |
9d7253b2b76140f5ec0c964c08163e12d001eaef | 898 | py | Python | PyInstaller/hooks/hook-PIL.py | IASEngineers/pyinstaller | 5a3c8585b1f4147da7ef4d823b8194baddedbb1f | [
"Apache-2.0"
] | 1 | 2020-07-21T15:25:22.000Z | 2020-07-21T15:25:22.000Z | PyInstaller/hooks/hook-PIL.py | IASEngineers/pyinstaller | 5a3c8585b1f4147da7ef4d823b8194baddedbb1f | [
"Apache-2.0"
] | null | null | null | PyInstaller/hooks/hook-PIL.py | IASEngineers/pyinstaller | 5a3c8585b1f4147da7ef4d823b8194baddedbb1f | [
"Apache-2.0"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | 40.818182 | 78 | 0.631403 |
fd18e2ca6ce0992ce83d2ea4f861c40596d885bb | 1,633 | py | Python | tests/_site/myauth/models.py | hlongmore/django-oscar | 21da1301d41597d470d4292678718e37556ee186 | [
"BSD-3-Clause"
] | null | null | null | tests/_site/myauth/models.py | hlongmore/django-oscar | 21da1301d41597d470d4292678718e37556ee186 | [
"BSD-3-Clause"
] | null | null | null | tests/_site/myauth/models.py | hlongmore/django-oscar | 21da1301d41597d470d4292678718e37556ee186 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import re
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.core import validators
from django.contrib.auth.models import BaseUserManager
from oscar.apps.customer.abstract_models import AbstractUser
class CustomUserManager(BaseUserManager):
... | 28.155172 | 106 | 0.630741 |
74b02368d2191173f12880c22637d1e1343f5c07 | 654 | py | Python | backend/edw/management/commands/rebuild_datamart.py | MMotionMan/django-edw | 0f686429d29e0f40409a3b2318664973b2844c08 | [
"BSD-3-Clause"
] | 4 | 2019-09-18T05:51:12.000Z | 2020-10-23T08:50:00.000Z | backend/edw/management/commands/rebuild_datamart.py | Vvvnukova/django-edw | 18397c2e6e2d7ddebad4d83ffee16425e7ac4e9f | [
"BSD-3-Clause"
] | 10 | 2020-04-29T11:46:44.000Z | 2022-03-11T23:38:27.000Z | backend/edw/management/commands/rebuild_datamart.py | Vvvnukova/django-edw | 18397c2e6e2d7ddebad4d83ffee16425e7ac4e9f | [
"BSD-3-Clause"
] | 13 | 2020-04-09T07:49:48.000Z | 2022-03-02T07:06:28.000Z | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
"""
``rebuild_datamart2``
---------------------
``rebuild_datamart2`` rebuilds your mptt pointers. Only use in emergencies.
"""
from django.core.manageme... | 29.727273 | 86 | 0.547401 |
d6ede213b46e64cc5702bc3f1ce660b5f07fefe4 | 116 | py | Python | data_analysis/Matplotlib/11Graficos_a_partir_do_numpy.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | data_analysis/Matplotlib/11Graficos_a_partir_do_numpy.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | data_analysis/Matplotlib/11Graficos_a_partir_do_numpy.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
plt.scatter(np.arange(50), np.random.randn(50))
plt.show()
| 19.333333 | 48 | 0.724138 |
7b0653be2e337d78718d855ba9446c7b9670282b | 833 | py | Python | robot_ws/src/nssc_web_interface/setup.py | NS-Robotics/NSRA2 | 86dbd504ed268fa951c61b010924bea6faff5a43 | [
"BSD-3-Clause"
] | null | null | null | robot_ws/src/nssc_web_interface/setup.py | NS-Robotics/NSRA2 | 86dbd504ed268fa951c61b010924bea6faff5a43 | [
"BSD-3-Clause"
] | null | null | null | robot_ws/src/nssc_web_interface/setup.py | NS-Robotics/NSRA2 | 86dbd504ed268fa951c61b010924bea6faff5a43 | [
"BSD-3-Clause"
] | null | null | null | import os
from glob import glob
from setuptools import setup
package_name = 'nssc_web_interface'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package... | 27.766667 | 85 | 0.642257 |
2737609ffae0ceb0c12acbd5ac914869ae6aff18 | 379 | py | Python | ELAB02/02-11.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB02/02-11.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB02/02-11.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | import math
l = [0,0,0,0,0]
l[0] = int(input("Input a: "))
l[1] = int(input("Input b: "))
l[2] = int(input("Input c: "))
l[3] = int(input("Input d: "))
l[4] = int(input("Input e: "))
mean = float((l[0]+l[1]+l[2]+l[3]+l[4])/5)
print(f"mean: {mean:.3f}")
sum = 0
for i in range(5):
sum +=(l[i]-mean)*(l[i]-mean... | 27.071429 | 43 | 0.522427 |
0d51b01fc3373f35d4d6aec22d640550b50ac42a | 5,095 | py | Python | aucc/main.py | FlameOfIgnis/avell-unofficial-control-center | e87652b8b6def1aa2544149735761aab7fa1cc53 | [
"MIT"
] | 1 | 2021-07-07T10:20:10.000Z | 2021-07-07T10:20:10.000Z | aucc/main.py | ignis-sec/avell-unofficial-control-center | e87652b8b6def1aa2544149735761aab7fa1cc53 | [
"MIT"
] | null | null | null | aucc/main.py | ignis-sec/avell-unofficial-control-center | e87652b8b6def1aa2544149735761aab7fa1cc53 | [
"MIT"
] | null | null | null | """
Copyright (c) 2019, Rodrigo Gomes.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on May 22, 2019
@author: @rodgomesc
"""
import argparse
import sys, os
from aucc.core.handler import DeviceHandler
import time
from aucc.core.colors imp... | 34.659864 | 96 | 0.627478 |
ca945a1a6c7a4509dcbc0efa32fe9421f372f222 | 429 | py | Python | gammapy/extern/__init__.py | aaguasca/gammapy | b1a4e9dbaeec23b3eaca1c874752e92432920a42 | [
"BSD-3-Clause"
] | null | null | null | gammapy/extern/__init__.py | aaguasca/gammapy | b1a4e9dbaeec23b3eaca1c874752e92432920a42 | [
"BSD-3-Clause"
] | null | null | null | gammapy/extern/__init__.py | aaguasca/gammapy | b1a4e9dbaeec23b3eaca1c874752e92432920a42 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains `extern` code, i.e. code that we just copied
here into the `gammapy.extern` package, because we wanted to use it,
but not have an extra dependency (these are single-file external packages).
* ``xmltodict.py`` for easily convertin... | 42.9 | 75 | 0.757576 |
de03538555f79009d83e86957b8c66d02c1db359 | 865 | py | Python | Models/PowerPlantsLoad/dummy_data/SPG StandortDaten/model.py | schmocker/Pyjamas | 52a72d6e8b915f77a2194d4e7d53c46d0ec28c17 | [
"MIT"
] | 2 | 2018-05-31T15:02:08.000Z | 2018-07-11T11:02:44.000Z | Models/PowerPlantsLoad/dummy_data/SPG StandortDaten/model.py | schmocker/Pyjamas | 52a72d6e8b915f77a2194d4e7d53c46d0ec28c17 | [
"MIT"
] | null | null | null | Models/PowerPlantsLoad/dummy_data/SPG StandortDaten/model.py | schmocker/Pyjamas | 52a72d6e8b915f77a2194d4e7d53c46d0ec28c17 | [
"MIT"
] | null | null | null | from pyjamas_core import Supermodel
from pyjamas_core.util import Input, Output, Property
import numpy as np
# define the model class and inherit from class "Supermodel"
class Model(Supermodel):
# model constructor
def __init__(self, id, name: str):
# instantiate supermodel
super(Model, self).... | 26.212121 | 69 | 0.611561 |
0a7165880908fc970966d400ece92e844791b149 | 1,135 | py | Python | asyncapi_schema_pydantic/v2_3_0/stomp_bindings.py | albertnadal/asyncapi-schema-pydantic | 83966bdc11f2d465a10b52cec5ff79d18fa6f5fe | [
"MIT"
] | null | null | null | asyncapi_schema_pydantic/v2_3_0/stomp_bindings.py | albertnadal/asyncapi-schema-pydantic | 83966bdc11f2d465a10b52cec5ff79d18fa6f5fe | [
"MIT"
] | null | null | null | asyncapi_schema_pydantic/v2_3_0/stomp_bindings.py | albertnadal/asyncapi-schema-pydantic | 83966bdc11f2d465a10b52cec5ff79d18fa6f5fe | [
"MIT"
] | null | null | null | from pydantic import BaseModel, Extra
class StompChannelBinding(BaseModel):
"""
This document defines how to describe STOMP-specific information on AsyncAPI.
This object MUST NOT contain any properties. Its name is reserved for future use.
"""
class Config:
extra = Extra.forbid
class ... | 22.7 | 85 | 0.705727 |
deee073b8462bea284029639d15b97d251300e93 | 2,037 | py | Python | data/munge.py | datamade/ihs-price-index | 2ccab93b10277ce75e26196c541f0ee4855ae4cb | [
"MIT"
] | 2 | 2015-12-06T22:52:23.000Z | 2016-09-12T12:43:33.000Z | data/munge.py | datamade/ihs-price-index | 2ccab93b10277ce75e26196c541f0ee4855ae4cb | [
"MIT"
] | 1 | 2015-05-05T14:45:51.000Z | 2015-05-05T21:44:08.000Z | data/munge.py | datamade/ihs-price-index | 2ccab93b10277ce75e26196c541f0ee4855ae4cb | [
"MIT"
] | null | null | null | import csv
file_prefix = "2021_q2_"
with open(file_prefix + 'price_index_by_quarter.csv', 'r') as f:
reader = csv.reader(f)
puma_ids = next(reader)[1:]
puma_ids = [i[1:].zfill(5) for i in puma_ids]
puma_names = next(reader)[1:]
rotated_rows = [[] for i in range(len(puma_ids) + 1)]
for row i... | 26.454545 | 66 | 0.619539 |
2bef3498033e9c3237664648f2b178c301c6914f | 31 | py | Python | starfish/image/__init__.py | joshmoore/starfish | db38168da35f01ad1541f67aebe49a083d12e224 | [
"MIT"
] | 1 | 2018-10-07T03:53:43.000Z | 2018-10-07T03:53:43.000Z | starfish/image/__init__.py | Xiaojieqiu/starfish | 426480fcfeda4b8b1eb9371a818ff20275ac898d | [
"MIT"
] | null | null | null | starfish/image/__init__.py | Xiaojieqiu/starfish | 426480fcfeda4b8b1eb9371a818ff20275ac898d | [
"MIT"
] | 1 | 2019-03-12T23:39:55.000Z | 2019-03-12T23:39:55.000Z | from ._stack import ImageStack
| 15.5 | 30 | 0.83871 |
243054f132f7c76494576331f85042a76565a3bf | 3,079 | py | Python | Video_Summarization/helpers/init_helper.py | AlexanderSlav/Automatic-Soccer-Highlights-Generation | 073e95776052034a327a102e5291234983965ad2 | [
"MIT"
] | null | null | null | Video_Summarization/helpers/init_helper.py | AlexanderSlav/Automatic-Soccer-Highlights-Generation | 073e95776052034a327a102e5291234983965ad2 | [
"MIT"
] | 1 | 2021-05-30T06:43:53.000Z | 2021-06-02T16:49:07.000Z | Video_Summarization/helpers/init_helper.py | AlexanderSlav/Automatic-Soccer-Highlights-Generation | 073e95776052034a327a102e5291234983965ad2 | [
"MIT"
] | null | null | null | import argparse
import logging
import random
from pathlib import Path
import numpy as np
import torch
def set_random_seed(seed: int) -> None:
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
def init_logger(log_dir: str, log_file: str) -> None:
logger = logging.getLogger()
format_... | 36.223529 | 77 | 0.639818 |
308e65dea7d89a57767e6362c59586e0bf108e5b | 11,193 | py | Python | splash/download.py | disruptiveplanets/splash | 8ac3ccdb8afde87de2c5b83de5c6768d4353b7e7 | [
"MIT"
] | 2 | 2021-02-05T04:47:33.000Z | 2021-04-25T02:19:18.000Z | splash/download.py | disruptiveplanets/splash | 8ac3ccdb8afde87de2c5b83de5c6768d4353b7e7 | [
"MIT"
] | 9 | 2020-07-22T00:29:44.000Z | 2020-10-12T14:12:01.000Z | splash/download.py | disruptiveplanets/splash | 8ac3ccdb8afde87de2c5b83de5c6768d4353b7e7 | [
"MIT"
] | 1 | 2020-08-01T11:58:41.000Z | 2020-08-01T11:58:41.000Z | import os
import requests
import glob
import numpy as np
from os import path
from tqdm import tqdm
from astropy.io import fits
from astropy.io import fits
from io import BytesIO
from .Functions import GetID
def get_file_from_url(url, user, password):
resp = requests.get(url, auth=(user, password))
return Bytes... | 34.869159 | 165 | 0.605736 |
0c8e0123894cf9a73fd6b0855d5fb2dc054f9682 | 7,738 | py | Python | shareseq.py | YichaoOU/SHARE_seq_pipeline | d7e142d35aa90c33d3c53f2919f4f04862392935 | [
"MIT"
] | null | null | null | shareseq.py | YichaoOU/SHARE_seq_pipeline | d7e142d35aa90c33d3c53f2919f4f04862392935 | [
"MIT"
] | null | null | null | shareseq.py | YichaoOU/SHARE_seq_pipeline | d7e142d35aa90c33d3c53f2919f4f04862392935 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import argparse
import logging
import Colorer
import pandas as pd
import subprocess
import yaml
import datetime
import getpass
from utils import collision_boxplot
"""
main script to stitch together share-seq analysis pipeline
"""
username = getpass.getuser(... | 46.059524 | 339 | 0.71543 |
6d401b9a0ff7c132c503be5a8596db98977a6649 | 1,500 | py | Python | PaddleNLP/examples/language_model/rnnlm/args.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | 1 | 2021-02-24T14:03:55.000Z | 2021-02-24T14:03:55.000Z | PaddleNLP/examples/language_model/rnnlm/args.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | null | null | null | PaddleNLP/examples/language_model/rnnlm/args.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | 1 | 2021-06-09T01:50:13.000Z | 2021-06-09T01:50:13.000Z | import argparse
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--data_path",
type=str,
default=None,
help="all the data for train,valid,test")
parser.add_argument('--batch_size', type=int, default=20, help='batch size')
par... | 39.473684 | 80 | 0.649333 |
05f1968bbdb6de0ef4483e930a395162959b2f45 | 1,074 | py | Python | checking/unittest_coverage.py | jwhonce/container-check | 8c0751359994d93025cd996cec0633ec7a330bd7 | [
"Apache-2.0"
] | null | null | null | checking/unittest_coverage.py | jwhonce/container-check | 8c0751359994d93025cd996cec0633ec7a330bd7 | [
"Apache-2.0"
] | null | null | null | checking/unittest_coverage.py | jwhonce/container-check | 8c0751359994d93025cd996cec0633ec7a330bd7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import unittest
import coverage
import coverage.version
OPTIONS = {
'data_file': '.coverage',
'branch': True,
'include': [
'checking/*',
'container_check',
],
'omit': [
'*.sh',
'*/test_*.py',
]
}
if __name__ == '__main__':
... | 22.851064 | 71 | 0.537244 |
5498611438e237d62ee0df192447c6b38ddaee21 | 5,762 | py | Python | seleniumwire/thirdparty/mitmproxy/contrib/kaitaistruct/tls_client_hello.py | KozminMoci/selenium-wire | 063c44ab42ac5e53e28c8a8c49c9ae7036bd878b | [
"MIT"
] | 975 | 2018-06-23T10:50:42.000Z | 2022-03-31T00:56:03.000Z | seleniumwire/thirdparty/mitmproxy/contrib/kaitaistruct/tls_client_hello.py | KozminMoci/selenium-wire | 063c44ab42ac5e53e28c8a8c49c9ae7036bd878b | [
"MIT"
] | 492 | 2018-07-30T12:49:51.000Z | 2022-03-31T12:46:56.000Z | seleniumwire/thirdparty/mitmproxy/contrib/kaitaistruct/tls_client_hello.py | KozminMoci/selenium-wire | 063c44ab42ac5e53e28c8a8c49c9ae7036bd878b | [
"MIT"
] | 149 | 2018-08-29T06:53:12.000Z | 2022-03-31T09:23:56.000Z | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
import array
import struct
import zlib
from enum import Enum
from kaitaistruct import BytesIO, KaitaiStream, KaitaiStruct
from kaitaistruct import __version__ as ks_version
from pkg_resources import parse_version
if pa... | 40.865248 | 118 | 0.598924 |
10bcbfb2897d145ce356bfb4bf240893b92d69a5 | 3,417 | py | Python | history_of_changes/callback2-for-MTA-ent_extMidtown-Map-works.py | kakun45/MTADashVisualization | 7edac4de650c54671356a11ac91d1c1f477d33bc | [
"MIT"
] | null | null | null | history_of_changes/callback2-for-MTA-ent_extMidtown-Map-works.py | kakun45/MTADashVisualization | 7edac4de650c54671356a11ac91d1c1f477d33bc | [
"MIT"
] | null | null | null | history_of_changes/callback2-for-MTA-ent_extMidtown-Map-works.py | kakun45/MTADashVisualization | 7edac4de650c54671356a11ac91d1c1f477d33bc | [
"MIT"
] | null | null | null | import dash
import numpy as np
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.graph_objs as go
import pandas as pd
import folium
# get help from installed module:
# in terminal
# import dash_html_components as html
# print(help(html.Div)... | 29.205128 | 84 | 0.558092 |
1bb889e69c910f14533c7281feee69da1b72328f | 2,100 | py | Python | glue_vispy_viewers/extern/vispy/visuals/spectrogram.py | jzuhone/glue-vispy-viewers | d940705f4ba95f8d7a9a74d37fb68c71080b490a | [
"BSD-2-Clause"
] | 3 | 2018-05-09T17:55:53.000Z | 2019-07-22T09:14:41.000Z | glue_vispy_viewers/extern/vispy/visuals/spectrogram.py | jzuhone/glue-vispy-viewers | d940705f4ba95f8d7a9a74d37fb68c71080b490a | [
"BSD-2-Clause"
] | 19 | 2015-06-16T14:33:22.000Z | 2015-07-27T21:18:15.000Z | graphViz/vispy/visuals/spectrogram.py | onecklam/ethereum-graphviz | 6993accf0cb85e23013bf7ae6b04145724a6dbd2 | [
"Apache-2.0"
] | 1 | 2017-09-29T01:24:47.000Z | 2017-09-29T01:24:47.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | 36.842105 | 79 | 0.561905 |
56a17950e89d3f9f213ebc9414d520df9373dff2 | 6,431 | py | Python | boilerplate/mail.py | ikcam/django-boilerplate | d8253665d74f0f18cf9a5fd46772598a60f20c5c | [
"Apache-2.0"
] | 5 | 2016-10-02T04:57:10.000Z | 2019-08-12T22:22:39.000Z | boilerplate/mail.py | ikcam/django-boilerplate | d8253665d74f0f18cf9a5fd46772598a60f20c5c | [
"Apache-2.0"
] | null | null | null | boilerplate/mail.py | ikcam/django-boilerplate | d8253665d74f0f18cf9a5fd46772598a60f20c5c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.utils.text import slugify
from django.utils import translation
class SendEmail(object):
"""
Send an ... | 27.600858 | 79 | 0.582336 |
52f4cdf6eac797b36019bf2e64955a6f08acf931 | 441 | py | Python | setup.py | grundprinzip/pyxplorer | 34c1d166cfef4a94aeb6d5fcb3cbb726d48146e2 | [
"BSD-2-Clause"
] | 10 | 2015-01-10T00:54:56.000Z | 2021-08-14T17:01:37.000Z | setup.py | grundprinzip/pyxplorer | 34c1d166cfef4a94aeb6d5fcb3cbb726d48146e2 | [
"BSD-2-Clause"
] | 1 | 2016-09-08T15:09:52.000Z | 2016-09-08T15:09:52.000Z | setup.py | grundprinzip/pyxplorer | 34c1d166cfef4a94aeb6d5fcb3cbb726d48146e2 | [
"BSD-2-Clause"
] | 1 | 2015-04-24T19:21:03.000Z | 2015-04-24T19:21:03.000Z | from distutils.core import setup
setup(
name='pyxplorer',
version='0.1.0',
author='Martin Grund',
author_email='grundprinzip+pip@gmail.com',
packages=['pyxplorer'],
url='http://github.com/grundprinzip/pyxplorer',
license='LICENSE',
description='Simple Big Data Profiling',
long_descr... | 23.210526 | 51 | 0.630385 |
3054667af2bdade775bc12dbbadc8b999f2adab4 | 1,662 | py | Python | atom/FileZillaPortable_feed.py | click3/SubProjects | bda2a7124c4d5d34576610154793504a61790ca0 | [
"BSL-1.0"
] | null | null | null | atom/FileZillaPortable_feed.py | click3/SubProjects | bda2a7124c4d5d34576610154793504a61790ca0 | [
"BSL-1.0"
] | null | null | null | atom/FileZillaPortable_feed.py | click3/SubProjects | bda2a7124c4d5d34576610154793504a61790ca0 | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/python3.2
# -*- coding: utf-8 -*-
from FeedUpdate import FeedUpdate, FeedUpdateData
import re
import datetime
class FileZillaPortableData(FeedUpdateData):
def getCheckUrl():
return 'http://portableapps.com/apps/internet/filezilla_portable'
def __init__(self):
super().__... | 25.96875 | 98 | 0.582431 |
a434b25eea998b9c5edecc3c77be6f17f57b7f71 | 1,537 | py | Python | tgtypes/models/chat_permissions.py | autogram/tgtypes | 90f8d0d35d3c372767508e56c20777635e128e38 | [
"MIT"
] | null | null | null | tgtypes/models/chat_permissions.py | autogram/tgtypes | 90f8d0d35d3c372767508e56c20777635e128e38 | [
"MIT"
] | null | null | null | tgtypes/models/chat_permissions.py | autogram/tgtypes | 90f8d0d35d3c372767508e56c20777635e128e38 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Optional
from ._base import MutableTelegramObject
class ChatPermissions(MutableTelegramObject):
"""
Describes actions that a non-administrator user is allowed to take in a chat.
Source: https://core.telegram.org/bots/api#chatpermissions
"""
... | 43.914286 | 98 | 0.732596 |
e46b23aa7e7f7893bfc633cb2b315f2978165abc | 915 | py | Python | test.py | ning1875/falcon-dashboard | c04e625c49358a278d5f1663a8055627eeb56334 | [
"Apache-2.0"
] | 1 | 2020-07-09T00:40:42.000Z | 2020-07-09T00:40:42.000Z | test.py | ning1875/falcon-dashboard | c04e625c49358a278d5f1663a8055627eeb56334 | [
"Apache-2.0"
] | null | null | null | test.py | ning1875/falcon-dashboard | c04e625c49358a278d5f1663a8055627eeb56334 | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8 -*-
# Copyright 2017 Xiaomi, 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... | 32.678571 | 74 | 0.746448 |
2c5c503d35db26c03d9e2b33d42d97ef9240c8f7 | 15,806 | py | Python | ds4ml/utils.py | Mykrass/data-synthesis-for-machine-learning | df56959424f73d7797b70dcbf9cc5105a2a2365f | [
"Apache-2.0"
] | 1 | 2020-12-17T09:21:07.000Z | 2020-12-17T09:21:07.000Z | ds4ml/utils.py | Mykrass/data-synthesis-for-machine-learning | df56959424f73d7797b70dcbf9cc5105a2a2365f | [
"Apache-2.0"
] | null | null | null | ds4ml/utils.py | Mykrass/data-synthesis-for-machine-learning | df56959424f73d7797b70dcbf9cc5105a2a2365f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Utility functions for data synthesis. Including:
input/output,
machine learning,
...
"""
import argparse
import csv
import logging
import numpy as np
import os
import hashlib
from string import ascii_lowercase
from pandas import Series, DataFrame
logger = logging.getLogger(__n... | 33.275789 | 85 | 0.571239 |
cc8a1197119fa3de0ab9b943795fe310280b6e1d | 1,839 | py | Python | app/main/views.py | Krasivaya/News-Highlight | 4cd53ad52603170f8b62b70a73d0916c5db0dc03 | [
"MIT"
] | null | null | null | app/main/views.py | Krasivaya/News-Highlight | 4cd53ad52603170f8b62b70a73d0916c5db0dc03 | [
"MIT"
] | null | null | null | app/main/views.py | Krasivaya/News-Highlight | 4cd53ad52603170f8b62b70a73d0916c5db0dc03 | [
"MIT"
] | null | null | null | from flask import render_template, request, redirect, url_for
from . import main
from ..request import get_sources, view_source, get_by_category, get_by_language, search_article, get_top_headlines
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
ti... | 34.055556 | 183 | 0.672648 |
4e2782db41a6c3e7319966f3aacaa5a92631cf5c | 2,344 | py | Python | RenderVideo.py | apichlkostner/CarND-Vehicle-Detection | a3937b19b5e8e36da01cb5c15437e952c70a766a | [
"MIT"
] | null | null | null | RenderVideo.py | apichlkostner/CarND-Vehicle-Detection | a3937b19b5e8e36da01cb5c15437e952c70a766a | [
"MIT"
] | null | null | null | RenderVideo.py | apichlkostner/CarND-Vehicle-Detection | a3937b19b5e8e36da01cb5c15437e952c70a766a | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import numpy as np
import cv2
from CameraCalibration import CalibrateCamera
from ProcessImage import ProcessImage
from ProcessImageLane import ProcessImageLane
from moviepy.editor import VideoFileClip
import glob
import matplotlib.image as mpimg
def main():
if (len(sys.argv) > 1) and i... | 30.441558 | 99 | 0.637372 |
3eb3924f5d14b00a279d7802406fbab7f95e5864 | 5,767 | py | Python | egg/core/callbacks.py | chan0park/EGG | d7d7238da35eac0306b6bf13c47017a6c0c0b67e | [
"MIT"
] | null | null | null | egg/core/callbacks.py | chan0park/EGG | d7d7238da35eac0306b6bf13c47017a6c0c0b67e | [
"MIT"
] | null | null | null | egg/core/callbacks.py | chan0park/EGG | d7d7238da35eac0306b6bf13c47017a6c0c0b67e | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
from typing import Dict, Any, Union, NamedTuple
import pathlib
import torch
from egg.core.util import get_summary_writer
class... | 35.598765 | 114 | 0.636726 |
0f09fceea11d4f9551d3e15b28783e7a412790d8 | 259 | py | Python | turtlebot_controller/src/turtlebot_controller_node.py | IhabMohamed/deep_motion_planning | 6512f651bafbb56710ddbae501a5b4c22d56ac66 | [
"BSD-3-Clause"
] | 17 | 2020-01-29T16:25:31.000Z | 2022-03-06T13:04:13.000Z | turtlebot_controller/src/turtlebot_controller_node.py | IhabMohamed/deep_motion_planning | 6512f651bafbb56710ddbae501a5b4c22d56ac66 | [
"BSD-3-Clause"
] | 1 | 2020-07-05T21:21:55.000Z | 2020-08-13T08:36:09.000Z | turtlebot_controller/src/turtlebot_controller_node.py | ethz-asl/deep_motion_planning | 6512f651bafbb56710ddbae501a5b4c22d56ac66 | [
"BSD-3-Clause"
] | 10 | 2020-01-30T05:45:12.000Z | 2021-11-20T11:38:14.000Z | #!/usr/bin/env python2
import rospy
from turtlebot_controller import TurtlebotController
def main():
rospy.init_node('turtlebot_controller')
with TurtlebotController() as controller:
rospy.spin()
if __name__ == "__main__":
main()
| 17.266667 | 52 | 0.706564 |
c2536e24fee0000997995324e066323d561809cc | 589 | py | Python | client.py | eshnil2000/crypto_trading | 491f5f99907f9e5082fdfb3d5a6c07cbd137966c | [
"MIT"
] | null | null | null | client.py | eshnil2000/crypto_trading | 491f5f99907f9e5082fdfb3d5a6c07cbd137966c | [
"MIT"
] | null | null | null | client.py | eshnil2000/crypto_trading | 491f5f99907f9e5082fdfb3d5a6c07cbd137966c | [
"MIT"
] | null | null | null | import socket
import json
# Create a socket (SOCK_STREAM means a TCP socket)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
# Connect to server and send data
sock.connect(("localhost", 8080))
order = {'id': 0, 'type': 'limit', 'side': 'sell', 'price': 99, 'quantity': 12}
serialized_orde... | 29.45 | 83 | 0.66893 |
5693eb28373257e98ee4a44beda83c4a6baeb227 | 3,823 | py | Python | src/saltext/vmware/modules/tag.py | dmurphy18/salt-ext-modules-vmware | 93342bfed2261c2f41232ff14d6cc0fb731b4d49 | [
"Apache-2.0"
] | null | null | null | src/saltext/vmware/modules/tag.py | dmurphy18/salt-ext-modules-vmware | 93342bfed2261c2f41232ff14d6cc0fb731b4d49 | [
"Apache-2.0"
] | null | null | null | src/saltext/vmware/modules/tag.py | dmurphy18/salt-ext-modules-vmware | 93342bfed2261c2f41232ff14d6cc0fb731b4d49 | [
"Apache-2.0"
] | 1 | 2021-12-15T02:46:59.000Z | 2021-12-15T02:46:59.000Z | # Copyright 2021 VMware, Inc.
# SPDX-License: Apache-2.0
import logging
import salt.exceptions
import saltext.vmware.utils.common as utils_common
import saltext.vmware.utils.connect as connect
log = logging.getLogger(__name__)
try:
from pyVmomi import vim
HAS_PYVMOMI = True
except ImportError:
HAS_PYVMO... | 26.365517 | 97 | 0.640073 |
ad1fa7a11796a464041015d8d2521e5ee94f7c81 | 25,578 | py | Python | apps/jobbrowser/src/jobbrowser/views.py | bopopescu/Hue-4 | 127a23f563611b0e8dc0dd35ad393cbaff8a64c6 | [
"Apache-2.0"
] | 1 | 2018-08-01T05:10:26.000Z | 2018-08-01T05:10:26.000Z | apps/jobbrowser/src/jobbrowser/views.py | bopopescu/Hue-4 | 127a23f563611b0e8dc0dd35ad393cbaff8a64c6 | [
"Apache-2.0"
] | null | null | null | apps/jobbrowser/src/jobbrowser/views.py | bopopescu/Hue-4 | 127a23f563611b0e8dc0dd35ad393cbaff8a64c6 | [
"Apache-2.0"
] | 1 | 2020-07-25T19:27:13.000Z | 2020-07-25T19:27:13.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 34.013298 | 184 | 0.688756 |
4c28baed59ac5a77b405f356eff00bcab5e6c48c | 2,438 | py | Python | src/foreign_if/python/UT/src/dt/test_006.py | XpressAI/frovedis | bda0f2c688fb832671c5b542dd8df1c9657642ff | [
"BSD-2-Clause"
] | 63 | 2018-06-21T14:11:59.000Z | 2022-03-30T11:24:36.000Z | src/foreign_if/python/UT/src/dt/test_006.py | XpressAI/frovedis | bda0f2c688fb832671c5b542dd8df1c9657642ff | [
"BSD-2-Clause"
] | 5 | 2018-09-22T14:01:53.000Z | 2021-12-27T16:11:05.000Z | src/foreign_if/python/UT/src/dt/test_006.py | XpressAI/frovedis | bda0f2c688fb832671c5b542dd8df1c9657642ff | [
"BSD-2-Clause"
] | 12 | 2018-08-23T15:59:44.000Z | 2022-02-20T06:47:22.000Z | #!/usr/bin/env python
from frovedis.exrpc.server import FrovedisServer
from frovedis.mllib.tree import DecisionTreeClassifier
from frovedis.mllib.tree import DecisionTreeRegressor
import sys
import numpy as np
import pandas as pd
# Objective : When only single element predict
# initializing the Frovedis server
argv... | 34.338028 | 142 | 0.685808 |
5beeacd74eb3e3c0a362d8c3eed734d2c62b9c04 | 13,381 | py | Python | flink-python/pyflink/datastream/__init__.py | huyuanfeng2018/flink | b3a9dcbd65719c742fe4907ec17de396b188d378 | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/datastream/__init__.py | huyuanfeng2018/flink | b3a9dcbd65719c742fe4907ec17de396b188d378 | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/datastream/__init__.py | huyuanfeng2018/flink | b3a9dcbd65719c742fe4907ec17de396b188d378 | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 49.194853 | 100 | 0.709439 |
cc306bf4ec8a08308ac109b488c9a68e4896b143 | 1,575 | py | Python | codechain/rpc/devel.py | foriequal0/codechain-primitives-python | 8e020196be7beeb327b4e540aa2dfc193f34e40e | [
"ISC"
] | 11 | 2018-08-22T09:42:54.000Z | 2019-11-30T07:19:42.000Z | codechain/rpc/devel.py | foriequal0/codechain-primitives-python | 8e020196be7beeb327b4e540aa2dfc193f34e40e | [
"ISC"
] | 38 | 2019-07-22T06:13:39.000Z | 2021-06-02T00:43:21.000Z | codechain/rpc/devel.py | foriequal0/codechain-primitives-python | 8e020196be7beeb327b4e540aa2dfc193f34e40e | [
"ISC"
] | 5 | 2019-07-24T19:13:00.000Z | 2020-03-18T12:13:27.000Z | from typing import Union
from jsonrpcclient.requests import Request
class Devel:
def __init__(self, client):
self.client = client
def get_state_trie_keys(self, offset: int, limit: int):
payload = Request("devel_getStateTrieKeys", offset, limit)
response = self.client.send(payload)
... | 28.636364 | 102 | 0.63746 |
eea95aa529ae7c989528fb319c2cf791290a1de0 | 986 | py | Python | gethands.py | iamSwaps/Hand-Track-Sketcher | 24de737b7d07715573db04eb277e5c24273f8a1b | [
"MIT"
] | null | null | null | gethands.py | iamSwaps/Hand-Track-Sketcher | 24de737b7d07715573db04eb277e5c24273f8a1b | [
"MIT"
] | null | null | null | gethands.py | iamSwaps/Hand-Track-Sketcher | 24de737b7d07715573db04eb277e5c24273f8a1b | [
"MIT"
] | null | null | null | import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
hands = mp_hands.Hands(min_detection_confidence=0.7, min_tracking_confidence=0.7)
def gethan(camwidth, camheight, camera):
success,frame = camera.read()
if not success:
print("Alert !... | 32.866667 | 100 | 0.624746 |
f1184f26693b117149b892e0a1283dfc43ff6c0d | 1,712 | py | Python | misc/perturb_ic.py | wy2136/wython | 0eaa9db335d57052806ae956afe6a34705407628 | [
"MIT"
] | 1 | 2022-03-21T21:24:40.000Z | 2022-03-21T21:24:40.000Z | misc/perturb_ic.py | wy2136/wython | 0eaa9db335d57052806ae956afe6a34705407628 | [
"MIT"
] | null | null | null | misc/perturb_ic.py | wy2136/wython | 0eaa9db335d57052806ae956afe6a34705407628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Wenchang Yang (wenchang@princeton.edu)
# Mon Feb 21 13:19:58 EST 2022
# perturb IC by adding small "random" numbers to the temperature field of tile1
if __name__ == '__main__':
import sys
from misc.timer import Timer
tt = Timer('start ' + ' '.join(sys.argv))
import sys, os.path, os, ... | 33.568627 | 135 | 0.668224 |
8e33f038084388860b412cd07aa0af34506fa566 | 6,096 | py | Python | src/streetscope/streetscope_visualization.py | ddeangelis/predictive-modeling-tech | 986163ac0d94cc2bdd8b66ab4da631cea76b51f5 | [
"MIT"
] | 1 | 2020-07-19T08:58:30.000Z | 2020-07-19T08:58:30.000Z | src/streetscope/streetscope_visualization.py | ddeangelis/predictive-modeling-tech | 986163ac0d94cc2bdd8b66ab4da631cea76b51f5 | [
"MIT"
] | null | null | null | src/streetscope/streetscope_visualization.py | ddeangelis/predictive-modeling-tech | 986163ac0d94cc2bdd8b66ab4da631cea76b51f5 | [
"MIT"
] | null | null | null | '''
File name: streetscope_visualization.py
Author: Tyche Analytics Co.
'''
from streetscope import StreetScope
import pandas as pd
from collections import Counter, defaultdict
from matplotlib import pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from sklearn.neighbors import KNeighborsR... | 38.582278 | 94 | 0.640748 |
fea4b48816337819425e0e84e6e5d6f28dcc283f | 1,815 | py | Python | ask-smapi-model/ask_smapi_model/v1/skill/alexa_hosted/hosted_skill_runtime.py | rivamarco/alexa-apis-for-python | 62e3a9057a26003e836fa09aa12a2e1c8b62d6e0 | [
"Apache-2.0"
] | 2 | 2021-10-30T06:52:48.000Z | 2021-11-16T12:34:16.000Z | ask-smapi-model/ask_smapi_model/v1/skill/alexa_hosted/hosted_skill_runtime.py | Shreyas-vgr/alexa-apis-for-python | 74ea73b3b6a03fd9cb735fb8c1fb2bd961faab54 | [
"Apache-2.0"
] | null | null | null | ask-smapi-model/ask_smapi_model/v1/skill/alexa_hosted/hosted_skill_runtime.py | Shreyas-vgr/alexa-apis-for-python | 74ea73b3b6a03fd9cb735fb8c1fb2bd961faab54 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 27.089552 | 96 | 0.649587 |
7e27f971fcf060902e1f5ae70668020210d77c18 | 35 | py | Python | lms/Domain/Teachers/__init__.py | bobrovskayaa/LMS | adac324977f5255d15c0ebfeef69995bd9dc8f26 | [
"MIT"
] | null | null | null | lms/Domain/Teachers/__init__.py | bobrovskayaa/LMS | adac324977f5255d15c0ebfeef69995bd9dc8f26 | [
"MIT"
] | 1 | 2018-12-21T21:09:30.000Z | 2018-12-21T21:09:30.000Z | lms/Domain/Teachers/__init__.py | bobrovskayaa/LMS | adac324977f5255d15c0ebfeef69995bd9dc8f26 | [
"MIT"
] | 3 | 2018-12-18T13:37:24.000Z | 2019-02-12T17:33:39.000Z | from .teacher_model import Teacher
| 17.5 | 34 | 0.857143 |
38e363bd0dd712e4bf391ca804575302246610ce | 278 | py | Python | ABC/abc001-abc050/abc024/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc001-abc050/abc024/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc001-abc050/abc024/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
if __name__ == '__main__':
a, b, c, k = list(map(int, input().split()))
s, t = list(map(int, input().split()))
total = a * s + b * t
if s + t >= k:
total -= c * (s + t)
print(total)
| 19.857143 | 49 | 0.460432 |
84f49540f2ba78a8326878d29c2bfe45d8b99ca5 | 2,066 | py | Python | devicely/muse.py | DigitalBiomarkerDiscoveryPipeline/devicely | 9773fead4d3969a32ca2760b8db4ae728c4d5d50 | [
"MIT"
] | 13 | 2020-07-13T22:26:25.000Z | 2022-03-18T17:40:56.000Z | devicely/muse.py | DigitalBiomarkerDiscoveryPipeline/devicely | 9773fead4d3969a32ca2760b8db4ae728c4d5d50 | [
"MIT"
] | 26 | 2020-11-29T11:11:09.000Z | 2022-01-12T11:34:19.000Z | devicely/muse.py | DigitalBiomarkerDiscoveryPipeline/devicely | 9773fead4d3969a32ca2760b8db4ae728c4d5d50 | [
"MIT"
] | 5 | 2021-07-26T11:01:38.000Z | 2022-02-22T18:23:57.000Z | """
Module to process Muse data from the mind monitor application
"""
import os
import random
import numpy as np
import pandas as pd
class MuseReader:
"""
Parses, timeshifts and writes data generated by the Muse S headband using the Mind Monitor application.
Attributes
----------
data : DataFra... | 27.918919 | 107 | 0.590029 |
924583d8796ebee51a455942c936b981040f84cd | 31,604 | py | Python | burger/toppings/blockstates.py | extremeheat/Burger | fdff962aeb1aa0351fc222e005af3fa9248345fb | [
"MIT"
] | null | null | null | burger/toppings/blockstates.py | extremeheat/Burger | fdff962aeb1aa0351fc222e005af3fa9248345fb | [
"MIT"
] | null | null | null | burger/toppings/blockstates.py | extremeheat/Burger | fdff962aeb1aa0351fc222e005af3fa9248345fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
from .topping import Topping
from jawa.constants import *
from jawa.util.descriptor import method_descriptor, field_descriptor
import traceback
import six
import six.moves
# EnumFacing.Plane. Needed because this is also a predicate, which is used
# to get certain facing... | 44.764873 | 159 | 0.475604 |
0819c37c9c6687975bd4fd571864eaeb12f86c7b | 1,234 | py | Python | cajas/chains/migrations/0002_auto_20190408_1614.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/chains/migrations/0002_auto_20190408_1614.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/chains/migrations/0002_auto_20190408_1614.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | # Generated by Django 2.0.9 on 2019-04-08 16:14
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('offi... | 35.257143 | 189 | 0.657212 |
04569807ff23385a13213c4d302d578019a8ae2b | 1,953 | py | Python | ch05/two_layer_net.py | care0717/deep-learning-from-scratch | 0d8eaae1636a47b6da27930ba857bfa3fa7d355c | [
"MIT"
] | null | null | null | ch05/two_layer_net.py | care0717/deep-learning-from-scratch | 0d8eaae1636a47b6da27930ba857bfa3fa7d355c | [
"MIT"
] | null | null | null | ch05/two_layer_net.py | care0717/deep-learning-from-scratch | 0d8eaae1636a47b6da27930ba857bfa3fa7d355c | [
"MIT"
] | null | null | null | import numpy as np
from common.differential_function import numerical_gradient
from common.layer import Affine, Relu, SoftmaxWithLoss
from collections import OrderedDict
class TwoLayerNet:
def __init__(self, input_size, hidden_size, output_size, weight_init_std=0.01):
self.params = {'W1': weight_init_std ... | 35.509091 | 121 | 0.605735 |
57b274e89c1319a1c7080e0d4133c9592ddd7686 | 18,405 | py | Python | Contents/Libraries/Shared/rebulk/pattern.py | jippo015/Sub-Zero.bundle | 734e0f7128c05c0f639e11e7dfc77daa1014064b | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/rebulk/pattern.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/rebulk/pattern.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Abstract pattern class definition along with various implementations (regexp, string, functional)
"""
# pylint: disable=super-init-not-called,wrong-import-position
from abc import ABCMeta, abstractmethod, abstractproperty
import six
from . import debug
from .loose im... | 37.561224 | 118 | 0.59348 |
0d5a7d77aa03075cb7bc56ede1a8a2bfa30b7c64 | 1,259 | py | Python | python/test/mocks.py | omardelarosa/godot-python-demo-game | c9c91b2a8e838c315dae6d6d597ce75a20318747 | [
"CC-BY-3.0"
] | null | null | null | python/test/mocks.py | omardelarosa/godot-python-demo-game | c9c91b2a8e838c315dae6d6d597ce75a20318747 | [
"CC-BY-3.0"
] | null | null | null | python/test/mocks.py | omardelarosa/godot-python-demo-game | c9c91b2a8e838c315dae6d6d597ce75a20318747 | [
"CC-BY-3.0"
] | null | null | null | # Fake Vector 3
from typing import Iterator, Any
class Comparable:
def __eq__(self, other):
if self.d == other.d:
return True
else:
return False
def __str__(self):
if isinstance(self.d, tuple):
return str(self.d)
elif isinstance(self.d, li... | 20.639344 | 62 | 0.570294 |
c93ee75f3e07ed6bc2aa8d8e2e9d8c15c9c1a478 | 58,776 | py | Python | test/data.py | kaushikacharya/PyStanfordDependencies | 43d8f38a19e40087f273330087918c87df6d4d8f | [
"Apache-2.0"
] | 69 | 2015-01-04T02:15:10.000Z | 2021-09-04T04:16:55.000Z | test/data.py | kaushikacharya/PyStanfordDependencies | 43d8f38a19e40087f273330087918c87df6d4d8f | [
"Apache-2.0"
] | 27 | 2015-01-08T03:38:18.000Z | 2020-12-21T13:57:24.000Z | test/data.py | kaushikacharya/PyStanfordDependencies | 43d8f38a19e40087f273330087918c87df6d4d8f | [
"Apache-2.0"
] | 19 | 2015-07-05T11:12:20.000Z | 2020-07-11T16:54:20.000Z | # this file contains all the string data (inputs and outputs) for tests
# the SD trees were originally produced on SD 3.4.1 but they work up
# to (at least) SD 3.5.2. the UD trees were produced using UD 3.5.2.
# tests now require SD/UD 3.5.2 (and thus Java 1.8). downside of this
# is that we can't test JPype on older ... | 65.96633 | 538 | 0.618535 |
e900d9eab39c289c4938a44d6d29db9918a2e2dc | 932 | py | Python | harmoni_actuators/harmoni_tts/test/test_tts_client.py | interaction-lab/HARMONI | 9c88019601a983a1739744919a95247a997d3bb1 | [
"MIT"
] | 7 | 2020-09-02T06:31:21.000Z | 2022-02-18T21:16:44.000Z | harmoni_actuators/harmoni_tts/test/test_tts_client.py | micolspitale93/HARMONI | cf6a13fb85e3efb4e421dbfd4555359c0a04acaa | [
"MIT"
] | 61 | 2020-05-15T16:46:32.000Z | 2021-07-28T17:44:49.000Z | harmoni_actuators/harmoni_tts/test/test_tts_client.py | micolspitale93/HARMONI | cf6a13fb85e3efb4e421dbfd4555359c0a04acaa | [
"MIT"
] | 3 | 2020-10-05T23:01:29.000Z | 2022-03-02T11:53:34.000Z | import os
import unittest
from harmoni_tts.local_tts_client import TtsClient
tts_dir = os.path.abspath(os.path.join(os.getcwd(), ".."))
content_dir = os.path.abspath(os.path.join(tts_dir, "../../../../model/tts"))
tts_config = os.path.join(content_dir, "config.json")
tts_model = os.path.join(content_dir, "tts_model.p... | 28.242424 | 77 | 0.670601 |
016baf0c1f68a2dd93e3a844956608c34a57b0a0 | 996 | py | Python | problems/test_0883.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0883.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0883.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
import utils
# O(n^2) time. O(n) space. Iteration.
class Solution:
def projectionArea(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
result = 0
max_by_row = [0] * len(grid)
max_by_col = [0] * len(grid)
for row, heights ... | 26.210526 | 68 | 0.560241 |
e7e1536d78eeb94df95e5d18c0aa833362bcd371 | 2,755 | py | Python | nation_flags/scrape.py | masayang/nation_flags | 0abe72212d613071ebee4816a46913c0ac812b18 | [
"MIT"
] | null | null | null | nation_flags/scrape.py | masayang/nation_flags | 0abe72212d613071ebee4816a46913c0ac812b18 | [
"MIT"
] | 1 | 2021-03-31T18:36:08.000Z | 2021-03-31T18:36:08.000Z | nation_flags/scrape.py | masayang/nation_flags | 0abe72212d613071ebee4816a46913c0ac812b18 | [
"MIT"
] | null | null | null | import requests
from lxml import html
import json
import re
from settings import config
import urllib2
import time
def get_english_content():
return requests.get(config['ENGLISH_URL'])
def get_japanese_content():
return requests.get(config['JAPANESE_URL'])
def get_dom_tree(content):
return html.fromstrin... | 30.955056 | 86 | 0.654809 |
0a7d8689b3fe3052b87a00196daa457721118020 | 284 | py | Python | app/common/management/commands/app_list.py | MrPeker/acikkaynak-service | 21c3f2faaa84342d2fa95709293bc84d1e2a23ae | [
"Apache-2.0"
] | 5 | 2021-02-28T22:29:13.000Z | 2021-11-29T00:24:28.000Z | app/common/management/commands/app_list.py | MrPeker/acikkaynak-service | 21c3f2faaa84342d2fa95709293bc84d1e2a23ae | [
"Apache-2.0"
] | null | null | null | app/common/management/commands/app_list.py | MrPeker/acikkaynak-service | 21c3f2faaa84342d2fa95709293bc84d1e2a23ae | [
"Apache-2.0"
] | 3 | 2021-03-03T19:56:30.000Z | 2021-03-06T22:10:35.000Z | from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
for app_name in settings.INSTALLED_APPS:
if app_name.startswith("app."):
print(app_name[4:])
| 28.4 | 51 | 0.676056 |
53c39871b8218de218a2c259c538e9bafefd39c6 | 1,810 | py | Python | tests/common/test_run/sqrt_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/common/test_run/sqrt_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/common/test_run/sqrt_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., 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 agreed to... | 36.2 | 110 | 0.697238 |
915c272fc68d10efe800032fef07bdb32cc38cb9 | 2,753 | py | Python | tests/fixtures/message.py | BenTopping/lighthouse | 649b442ca89f7deb7c01411faa883c1894b72986 | [
"MIT"
] | null | null | null | tests/fixtures/message.py | BenTopping/lighthouse | 649b442ca89f7deb7c01411faa883c1894b72986 | [
"MIT"
] | null | null | null | tests/fixtures/message.py | BenTopping/lighthouse | 649b442ca89f7deb7c01411faa883c1894b72986 | [
"MIT"
] | null | null | null | import pytest
from lighthouse.constants.events import PLATE_EVENT_SOURCE_ALL_NEGATIVES, PLATE_EVENT_SOURCE_COMPLETED
from lighthouse.messages.message import Message
@pytest.fixture
def message_unknown():
message_content = {
"event": {
"uuid": "1770dbcd-0abf-4293-ac62-dd26964f80b0",
... | 32.388235 | 102 | 0.486378 |
b355429cfa6fdafd211c700ffc2d19197d8e71c2 | 1,982 | py | Python | tests/test_distance.py | pedrocamargo/fast-trips | a2549936b2707b00d6c21b4e6ae4be8fefd0aa46 | [
"Apache-2.0"
] | 3 | 2017-11-03T00:18:23.000Z | 2020-11-30T18:54:46.000Z | tests/test_distance.py | pedrocamargo/fast-trips | a2549936b2707b00d6c21b4e6ae4be8fefd0aa46 | [
"Apache-2.0"
] | null | null | null | tests/test_distance.py | pedrocamargo/fast-trips | a2549936b2707b00d6c21b4e6ae4be8fefd0aa46 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import numpy as np
import pandas as pd
import partridge as ptg
import pytest
from fasttrips import Trip
from fasttrips import Util
TEST_NETWORKS = {"Seattle_Region": "psrc_1_1",
"Springfield": "vermont"}
EXAMPLES_DIR = os.path.join(os.getcwd(), "fastt... | 35.392857 | 85 | 0.562059 |
20beb301db17dec0771b5f4fb0ff1fccbeb622be | 1,487 | py | Python | slashtags/__init__.py | P4RZ1V4L-93/Cogs | 8b2b2bf3bcb2c961efd2f70a2cae0ff1f622c019 | [
"MIT"
] | null | null | null | slashtags/__init__.py | P4RZ1V4L-93/Cogs | 8b2b2bf3bcb2c961efd2f70a2cae0ff1f622c019 | [
"MIT"
] | null | null | null | slashtags/__init__.py | P4RZ1V4L-93/Cogs | 8b2b2bf3bcb2c961efd2f70a2cae0ff1f622c019 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-2021 phenom4n4n
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 35.404762 | 78 | 0.785474 |
0c2a9e2f70e7ad6cc9356845f2c3ac85eb2fc35b | 2,117 | py | Python | ex41.py | thinzaroo15/coding-sprint | 3c146fafb09a5e9bf9ef1d257b9a8f3052e8ab96 | [
"MIT"
] | null | null | null | ex41.py | thinzaroo15/coding-sprint | 3c146fafb09a5e9bf9ef1d257b9a8f3052e8ab96 | [
"MIT"
] | null | null | null | ex41.py | thinzaroo15/coding-sprint | 3c146fafb09a5e9bf9ef1d257b9a8f3052e8ab96 | [
"MIT"
] | null | null | null | import random
from urllib.request import urlopen
import sys
WORDS_URL ="https://learncodethehardway.org/words.txt"
WORDS =[]
PHRASES =[
"class %%%(%%%):"
"Make a class named %%% that is _ a %%%"
"class %%%(object):\n\tdef __init__(self,***)"
"class %%% has-a __init_ tha... | 34.145161 | 85 | 0.549835 |
992ac9aa11be639f406390041e0d18d34d30684d | 254 | py | Python | Python/age1.py | NewGuonx/DST_algorithm | 8c4b2f0fe1f43044a5c37a7f993d339862d9182c | [
"Unlicense"
] | 1 | 2022-01-23T05:29:17.000Z | 2022-01-23T05:29:17.000Z | Python/age1.py | sonaspy/dst_algorithms | 8c4b2f0fe1f43044a5c37a7f993d339862d9182c | [
"Unlicense"
] | null | null | null | Python/age1.py | sonaspy/dst_algorithms | 8c4b2f0fe1f43044a5c37a7f993d339862d9182c | [
"Unlicense"
] | null | null | null |
age = -1 # an initially invalid choice
while age <= 0:
try:
age = int(input('Enter your age in years: '))
if age <= 0:
print('Your age must be positive')
except (ValueError, EOFError):
print('Invalid response')
| 23.090909 | 57 | 0.574803 |
ad1aa3066f37a04c5aefe63c7e575f2b4f4116a9 | 925 | py | Python | backend/ipproject/core/users/models.py | FedotenkoM/ipsproject | f02ce8acd560b3e10e5357f0605e923396aaafa0 | [
"MIT"
] | null | null | null | backend/ipproject/core/users/models.py | FedotenkoM/ipsproject | f02ce8acd560b3e10e5357f0605e923396aaafa0 | [
"MIT"
] | 11 | 2021-05-14T12:34:18.000Z | 2021-08-22T14:52:01.000Z | backend/ipproject/core/users/models.py | FedotenkoM/ipsproject | f02ce8acd560b3e10e5357f0605e923396aaafa0 | [
"MIT"
] | null | null | null | from ipproject.core.database import db
class UserModel(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(50), unique=True, nullable=False)
password = db.Column(db.String(120), nullable=False)
email = db.Column(db.String(50), unique=True... | 29.83871 | 77 | 0.621622 |
604423621edf03bfa9d63339e71e16c85f4b2dec | 328 | py | Python | util/vaihingen/vaihingen_extra_data.py | marcelampc/aerial_mtl | c6a2033ec89a89ff06836014c619d66bc907d958 | [
"BSD-3-Clause"
] | 58 | 2019-07-23T09:01:58.000Z | 2022-03-31T23:12:37.000Z | util/vaihingen/vaihingen_extra_data.py | marcelampc/mtl_aerial_images | c6a2033ec89a89ff06836014c619d66bc907d958 | [
"BSD-3-Clause"
] | 5 | 2019-12-09T12:20:35.000Z | 2021-06-23T12:41:48.000Z | util/vaihingen/vaihingen_extra_data.py | marcelampc/aerial_mtl | c6a2033ec89a89ff06836014c619d66bc907d958 | [
"BSD-3-Clause"
] | 8 | 2019-08-05T11:13:23.000Z | 2021-04-26T00:57:40.000Z | # Extra information about nyuv2
import numpy as np
# Number of classes:
n_classes = 7
# set 0 to first label
# weights=np.ones(1, n_classes)
weights = [
0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0]
colors = [
[0, 0, 0], [255, 255, 255], [0, 0, 255], [0, 255, 255], [0, 255, 0], [255, 255, 0], [255, 0, 0]
... | 25.230769 | 103 | 0.527439 |
0b8974ba3768fbcab445f34119c1a90dd89fd88f | 1,096 | py | Python | Python3/0936-Stamping-The-Sequence/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0936-Stamping-The-Sequence/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0936-Stamping-The-Sequence/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def movesToStamp(self, stamp, target):
"""
:type stamp: str
:type target: str
:rtype: List[int]
"""
ns, nt = len(stamp), len(target)
if nt < ns or stamp[0] != target[0] or stamp[-1] != target[-1]:
return []
target = list(tar... | 32.235294 | 71 | 0.367701 |
553d2c8c1391fa21f625507b0573640f2569a28f | 8,126 | py | Python | src/oemof/tabular/tools/postprocessing.py | jnnr/oemof-tabular | ab58d8c3035b6e97d9d45169832745de11e5bb36 | [
"BSD-3-Clause"
] | 2 | 2019-12-09T17:34:31.000Z | 2022-02-04T12:55:15.000Z | src/oemof/tabular/tools/postprocessing.py | jnnr/oemof-tabular | ab58d8c3035b6e97d9d45169832745de11e5bb36 | [
"BSD-3-Clause"
] | 28 | 2018-11-24T16:56:55.000Z | 2022-03-25T12:19:41.000Z | src/oemof/tabular/tools/postprocessing.py | jnnr/oemof-tabular | ab58d8c3035b6e97d9d45169832745de11e5bb36 | [
"BSD-3-Clause"
] | 7 | 2018-12-19T13:42:52.000Z | 2021-11-21T18:43:45.000Z | # -*- coding: utf-8 -*-
"""
"""
import os
import numpy as np
import pandas as pd
from oemof.network import Bus, Sink
from oemof.outputlib import views
from oemof.solph.components import GenericStorage
from oemof.tabular import facades
def component_results(es, results, select="sequences"):
""" Aggregated by co... | 30.780303 | 79 | 0.528304 |
a22c8400b87bcbf8d3c7b05ffa5b709ba5ff14ae | 801 | py | Python | manti_by/apps/profiles/models.py | manti-by/manti.by | 233882fc5e5758ff92f0b7940316f15e4d30af07 | [
"BSD-3-Clause"
] | 1 | 2021-12-11T11:34:04.000Z | 2021-12-11T11:34:04.000Z | manti_by/apps/profiles/models.py | manti-by/manti.by | 233882fc5e5758ff92f0b7940316f15e4d30af07 | [
"BSD-3-Clause"
] | 11 | 2021-03-23T13:59:39.000Z | 2022-02-02T10:16:58.000Z | manti_by/apps/profiles/models.py | manti-by/manti.by | 233882fc5e5758ff92f0b7940316f15e4d30af07 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.templatetags.static import static
from django.utils.translation import gettext_lazy as _
from manti_by.apps.core.models import BaseModel
from manti_by.apps.core.utils import profile_image_name
class Profile(BaseModel):
original... | 25.83871 | 80 | 0.706617 |
77d82411a4756b5788ec964fe9a5432604dfd495 | 7,122 | py | Python | scripts/pre_ORgenerator_py/odds_c_a_anydiag_v4-17-13.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | 3 | 2018-03-29T23:02:43.000Z | 2020-08-10T12:01:50.000Z | scripts/pre_ORgenerator_py/odds_c_a_anydiag_v4-17-13.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | null | null | null | scripts/pre_ORgenerator_py/odds_c_a_anydiag_v4-17-13.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | null | null | null | #!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 4/6/2013
###Function: Draw charts for each season for week number (x) by odds of children ILI to adult ILI normalized by US child and adult visits of any diagnosis for each flu season
###Import data: ... | 40.465909 | 288 | 0.701067 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.