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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f714bf511a5db4837fb464801747ab0f635499bc | 3,832 | py | Python | networkx/drawing/tests/test_pydot.py | rakschahsa/networkx | 6cac55b1064c3c346665f9281680fa3b66442ad0 | [
"BSD-3-Clause"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | Library/lib/python3.7/site-packages/networkx/drawing/tests/test_pydot.py | gengyong/Carnets | 8930a14f69360d4db115a85ff9e0f6efa80fa2e7 | [
"BSD-3-Clause"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | site-packages/networkx/drawing/tests/test_pydot.py | Wristlebane/Pyto | 901ac307b68486d8289105c159ca702318bea5b0 | [
"MIT"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | """Unit tests for pydot drawing functions."""
try:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
except ImportError:
from io import StringIO
import sys
import tempfile
from nose.tools import assert_equal, assert_is_instance, assert_true
import networkx... | 35.155963 | 80 | 0.632307 | try:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
except ImportError:
from io import StringIO
import sys
import tempfile
from nose.tools import assert_equal, assert_is_instance, assert_true
import networkx as nx
from networkx.testing import assert_gra... | true | true |
f714c0121365938eec8fc72d484d1b10524db95f | 358 | py | Python | Gallery/migrations/0002_auto_20210115_1331.py | CiganOliviu/InfiniteShoot | 14f7fb21e360e3c58876d82ebbe206054c72958e | [
"MIT"
] | 1 | 2021-04-02T16:45:37.000Z | 2021-04-02T16:45:37.000Z | Gallery/migrations/0002_auto_20210115_1331.py | CiganOliviu/InfiniteShoot-1 | 6322ae34f88caaffc1de29dfa4f6d86d175810a7 | [
"Apache-2.0"
] | null | null | null | Gallery/migrations/0002_auto_20210115_1331.py | CiganOliviu/InfiniteShoot-1 | 6322ae34f88caaffc1de29dfa4f6d86d175810a7 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.8 on 2021-01-15 13:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Gallery', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='imageclient',
old_name='product',
... | 18.842105 | 47 | 0.578212 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Gallery', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='imageclient',
old_name='product',
new_name='client',
),
]
| true | true |
f714c0f34fff9800c3a67b955f8cc23e9eeb99c8 | 9,027 | py | Python | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | null | null | null | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | 1 | 2021-06-15T11:59:58.000Z | 2021-06-16T12:08:38.000Z | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | 1 | 2021-05-12T14:08:12.000Z | 2021-05-12T14:08:12.000Z | # Copyright 2019 The Android Open Source Project
#
# 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... | 34.586207 | 107 | 0.583029 |
import logging
import os
import re
import sys
import shutil
import abc
import docker
from tqdm import tqdm
from emu.utils import mkdir_p
class ProgressTracker(object):
def __init__(self):
self.progress = {}
self.idx = -1
def __del__(self):
for k in self.progres... | true | true |
f714c0fe8b4759fb11a941007a0f6f1a8f1d8178 | 5,927 | py | Python | statsmodels/multivariate/cancorr.py | aliavni/statsmodels | ef5d57a8d45de76a895e9401705280d558d688ad | [
"BSD-3-Clause"
] | 1 | 2022-01-24T15:17:37.000Z | 2022-01-24T15:17:37.000Z | statsmodels/multivariate/cancorr.py | aliavni/statsmodels | ef5d57a8d45de76a895e9401705280d558d688ad | [
"BSD-3-Clause"
] | null | null | null | statsmodels/multivariate/cancorr.py | aliavni/statsmodels | ef5d57a8d45de76a895e9401705280d558d688ad | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Canonical correlation analysis
author: Yichuan Liu
"""
import numpy as np
from numpy.linalg import svd
import scipy
import pandas as pd
from statsmodels.base.model import Model
from statsmodels.iolib import summary2
from .multivariate_ols import multivariate_stats
class CanCorr(Model):
... | 33.111732 | 93 | 0.549182 |
import numpy as np
from numpy.linalg import svd
import scipy
import pandas as pd
from statsmodels.base.model import Model
from statsmodels.iolib import summary2
from .multivariate_ols import multivariate_stats
class CanCorr(Model):
def __init__(self, endog, exog, tolerance=1e-8, missing='none', hasconst=None, ... | true | true |
f714c1e8dffd5c7377f91e0b8a143f15545e6c6f | 4,479 | py | Python | subcmds/branches.py | opensourcechipspark/repo | 5db69f3f6616ea199a7840f0602b988f8d5504b9 | [
"Apache-2.0"
] | null | null | null | subcmds/branches.py | opensourcechipspark/repo | 5db69f3f6616ea199a7840f0602b988f8d5504b9 | [
"Apache-2.0"
] | null | null | null | subcmds/branches.py | opensourcechipspark/repo | 5db69f3f6616ea199a7840f0602b988f8d5504b9 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 la... | 26.820359 | 74 | 0.625363 |
from __future__ import print_function
import sys
from color import Coloring
from command import Command
class BranchColoring(Coloring):
def __init__(self, config):
Coloring.__init__(self, config, 'branch')
self.current = self.printer('current', fg='green')
self.local = self.printer('loca... | true | true |
f714c30f238ba9efcd7dd75cb3798c567f7905d2 | 35,412 | py | Python | demosaic_pack/amaze_demosaic.py | rongtianjie/dcraw_py | fd45d819a67d2f52d7ca61abbe145ab1b172bee9 | [
"Unlicense"
] | 1 | 2022-03-22T02:45:10.000Z | 2022-03-22T02:45:10.000Z | demosaic_pack/amaze_demosaic.py | rongtianjie/dcraw_py | fd45d819a67d2f52d7ca61abbe145ab1b172bee9 | [
"Unlicense"
] | null | null | null | demosaic_pack/amaze_demosaic.py | rongtianjie/dcraw_py | fd45d819a67d2f52d7ca61abbe145ab1b172bee9 | [
"Unlicense"
] | null | null | null | import numpy as np
def amaze_demosaic(src, raw):
cfarray = raw.raw_colors
cfarray[cfarray == 3] = 1
rgb = amaze_demosaic_libraw(src, cfarray, raw.daylight_whitebalance)
return rgb
def amaze_demosaic_libraw(src, cfarray, daylight_wb):
TS = 512
winx = winy = 0
width = src.shape[1]
... | 53.492447 | 978 | 0.471789 | import numpy as np
def amaze_demosaic(src, raw):
cfarray = raw.raw_colors
cfarray[cfarray == 3] = 1
rgb = amaze_demosaic_libraw(src, cfarray, raw.daylight_whitebalance)
return rgb
def amaze_demosaic_libraw(src, cfarray, daylight_wb):
TS = 512
winx = winy = 0
width = src.shape[1]
... | true | true |
f714c47ee80904ec569254931c1f1328492e4608 | 6,440 | py | Python | utils.py | EdLeafe/elastic_irc | 38959e25c0b9b309b89a46c3f7ab0a3576429621 | [
"MIT"
] | null | null | null | utils.py | EdLeafe/elastic_irc | 38959e25c0b9b309b89a46c3f7ab0a3576429621 | [
"MIT"
] | 1 | 2020-07-03T14:36:10.000Z | 2020-07-03T14:36:10.000Z | utils.py | EdLeafe/elastic_irc | 38959e25c0b9b309b89a46c3f7ab0a3576429621 | [
"MIT"
] | null | null | null | import copy
from datetime import datetime
from functools import wraps, update_wrapper
from hashlib import blake2b
import logging
from math import log
import os
from subprocess import Popen, PIPE
import uuid
from dateutil import parser
import elasticsearch
import pymysql
from rich import box
from rich.console import Co... | 26.072874 | 90 | 0.612422 | import copy
from datetime import datetime
from functools import wraps, update_wrapper
from hashlib import blake2b
import logging
from math import log
import os
from subprocess import Popen, PIPE
import uuid
from dateutil import parser
import elasticsearch
import pymysql
from rich import box
from rich.console import Co... | true | true |
f714c4b095d821e174e7a6aa0d767d8a4b0c41f5 | 11,122 | py | Python | glance_docker/glance/registry/client/v1/client.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/registry/client/v1/client.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/registry/client/v1/client.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 41.969811 | 79 | 0.591261 |
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
from glance.common.client import BaseClient
from glance.common import crypt
from glance import i18n
from glance.registry.api.v1 import images
LOG = logging.getLogger(__name__)
_LE = i18n._LE
... | true | true |
f714c4cb6fce4108162f924f6f32dbbefd36b682 | 4,339 | py | Python | backend/tests/test_mollufy.py | somnisomni/mollufier | 7bc42ac51615f164bd3a479ed5e05cdea5b186d5 | [
"MIT"
] | 14 | 2021-11-13T14:59:34.000Z | 2022-02-14T06:21:49.000Z | backend/tests/test_mollufy.py | somnisomni/mollufier | 7bc42ac51615f164bd3a479ed5e05cdea5b186d5 | [
"MIT"
] | 2 | 2021-11-23T13:54:47.000Z | 2021-11-26T15:35:40.000Z | backend/tests/test_mollufy.py | somnisomni/mollufier | 7bc42ac51615f164bd3a479ed5e05cdea5b186d5 | [
"MIT"
] | 3 | 2021-11-20T16:55:41.000Z | 2021-11-26T15:27:10.000Z | import unittest
from mollufy import mollufy
class MollufyTestSimple(unittest.TestCase):
def test_mollufy_word_2chars(self):
# TEST 1: Mollufy simple 2-characters noun word
self.assertEqual(mollufy.mollufy("블루"), "블?루")
self.assertEqual(mollufy.mollufy("하루"), "하?루")
self.assertEqual(mollufy.mollufy("감... | 52.914634 | 176 | 0.704771 | import unittest
from mollufy import mollufy
class MollufyTestSimple(unittest.TestCase):
def test_mollufy_word_2chars(self):
self.assertEqual(mollufy.mollufy("블루"), "블?루")
self.assertEqual(mollufy.mollufy("하루"), "하?루")
self.assertEqual(mollufy.mollufy("감정"), "감?정")
def test_mollufy_word_manychars_... | true | true |
f714c57c24f77188279a44953fa4e55425f6c2d6 | 7,804 | py | Python | stai/util/ssl_check.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 10 | 2021-10-02T18:33:56.000Z | 2021-11-14T17:10:48.000Z | stai/util/ssl_check.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 14 | 2021-10-07T22:10:15.000Z | 2021-12-21T09:13:49.000Z | stai/util/ssl_check.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 6 | 2021-10-29T19:36:59.000Z | 2021-12-19T19:52:57.000Z | import os
import stat
import sys
from stai.util.config import load_config, traverse_dict
from stai.util.permissions import octal_mode_string, verify_file_permissions
from logging import Logger
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
DEFAULT_PERMISSIONS_CERT_FILE: int = 0o644
DEFAUL... | 38.44335 | 116 | 0.657868 | import os
import stat
import sys
from stai.util.config import load_config, traverse_dict
from stai.util.permissions import octal_mode_string, verify_file_permissions
from logging import Logger
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
DEFAULT_PERMISSIONS_CERT_FILE: int = 0o644
DEFAUL... | true | true |
f714c6177d1854e7a182e8a0ce20becbd5ea9017 | 1,320 | py | Python | webdev/urls.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | webdev/urls.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | 103 | 2021-04-25T21:28:11.000Z | 2022-03-15T01:36:31.000Z | webdev/urls.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | """webdev URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 41.25 | 78 | 0.720455 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('webdev.produtos.urls')),
path('users/', include('webdev.users.urls')),
path('fornecedores... | true | true |
f714c61bd4e0f62ce5ce0a72df8b8cb21cc1d5f1 | 6,726 | py | Python | tests/test_other.py | dtzWill/httplib2 | 7ee25dbcc24fbe42d2f7b2839327d58ecf3c8e71 | [
"MIT"
] | null | null | null | tests/test_other.py | dtzWill/httplib2 | 7ee25dbcc24fbe42d2f7b2839327d58ecf3c8e71 | [
"MIT"
] | null | null | null | tests/test_other.py | dtzWill/httplib2 | 7ee25dbcc24fbe42d2f7b2839327d58ecf3c8e71 | [
"MIT"
] | null | null | null | import httplib2
import mock
import os
import pickle
import pytest
import socket
import sys
import tests
import time
from six.moves import urllib
@pytest.mark.skipif(
sys.version_info <= (3,),
reason=(
"TODO: httplib2._convert_byte_str was defined only in python3 code " "version"
),
)
def test_conv... | 32.181818 | 118 | 0.678115 | import httplib2
import mock
import os
import pickle
import pytest
import socket
import sys
import tests
import time
from six.moves import urllib
@pytest.mark.skipif(
sys.version_info <= (3,),
reason=(
"TODO: httplib2._convert_byte_str was defined only in python3 code " "version"
),
)
def test_conv... | true | true |
f714c6db7d33f46788a289e98db5502368671a9e | 1,863 | py | Python | data/transforms/transforms.py | nodiz/reid-strong-baseline | d3c1bc948843d0ad6e52dafa79a74ab94d5d484d | [
"MIT"
] | 1 | 2020-05-30T13:44:16.000Z | 2020-05-30T13:44:16.000Z | data/transforms/transforms.py | nodiz/reid-strong-baseline | d3c1bc948843d0ad6e52dafa79a74ab94d5d484d | [
"MIT"
] | null | null | null | data/transforms/transforms.py | nodiz/reid-strong-baseline | d3c1bc948843d0ad6e52dafa79a74ab94d5d484d | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
@author: liaoxingyu
@contact: liaoxingyu2@jd.com
"""
import math
import random
class RandomErasing(object):
""" Randomly selects a rectangle region in an image and erases its pixels.
'Random Erasing Data Augmentation' by Zhong et al.
See https://arxiv.org/pdf/1708.04896.pdf... | 33.872727 | 96 | 0.547504 |
import math
import random
class RandomErasing(object):
def __init__(self, probability=0.5, sl=0.02, sh=0.4, r1=0.3, mean=(0.4914, 0.4822, 0.4465)):
self.probability = probability
self.mean = mean
self.sl = sl
self.sh = sh
self.r1 = r1
def __call__(self, img):
... | true | true |
f714c8da841a220b302fd12f3f8bb3b9dedd0598 | 5,003 | py | Python | test/test_ssl.py | nobodyinperson/urllib3 | 79e81f918efe5ae85a276bd3ad8a1939dfa206dd | [
"MIT"
] | null | null | null | test/test_ssl.py | nobodyinperson/urllib3 | 79e81f918efe5ae85a276bd3ad8a1939dfa206dd | [
"MIT"
] | null | null | null | test/test_ssl.py | nobodyinperson/urllib3 | 79e81f918efe5ae85a276bd3ad8a1939dfa206dd | [
"MIT"
] | null | null | null | import platform
import sys
import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize(
"addr",
[
# IPv6
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
# IPv4
"127.0.0.1",
"8.8.8.8",
... | 28.919075 | 88 | 0.677593 | import platform
import sys
import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize(
"addr",
[
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
"127.0.0.1",
"8.8.8.8",
b"127... | true | true |
f714c9384e398c4912bca404e456801ec236b034 | 3,792 | py | Python | setup.py | vincent101/setup.py | 147b387e82b5702dea35868b708142f150f00a1f | [
"MIT"
] | null | null | null | setup.py | vincent101/setup.py | 147b387e82b5702dea35868b708142f150f00a1f | [
"MIT"
] | null | null | null | setup.py | vincent101/setup.py | 147b387e82b5702dea35868b708142f150f00a1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'mypackage'
DESCRIPTION = 'My sho... | 28.727273 | 86 | 0.640032 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'mypackage'
DESCRIPTION = 'My short description for my project.'
URL = 'https://github.com/vincent101/myproject'
EMAIL = 'vincent.wangworks@gmail.com'
AUTHOR = 'Vicnet Wang'
REQUIRES_PYTHON = '>... | true | true |
f714c9ace3c7e9c796c9b28a1e4cced97ecb105d | 872 | py | Python | setup.py | yuwenhou/ProxyPool-master1 | 21b6c0b7788bb24e728ec75c0b44b6e4b6583595 | [
"Apache-2.0"
] | 803 | 2017-02-23T15:43:28.000Z | 2022-03-25T15:28:19.000Z | setup.py | yuwenhou/ProxyPool-master1 | 21b6c0b7788bb24e728ec75c0b44b6e4b6583595 | [
"Apache-2.0"
] | 31 | 2017-07-30T08:47:10.000Z | 2021-04-24T20:30:54.000Z | ThirdParty/ProxyPool/setup.py | XiMuYouZi/PythonDemo | 476d4d814338f37148bbf1504c0dd94a68f55a05 | [
"MIT"
] | 483 | 2017-04-01T04:08:50.000Z | 2022-03-30T11:40:24.000Z | from setuptools import setup
setup(
name='proxy-pool',
version='1.0.0',
description='High performance proxy pool',
long_description='A proxy pool project modified from WiseDoge/ProxyPool',
author=['Germey', 'WiseDoge'],
author_email='cqc@cuiqingcai.com',
url='https://github.com/Germey/Proxy... | 24.914286 | 77 | 0.597477 | from setuptools import setup
setup(
name='proxy-pool',
version='1.0.0',
description='High performance proxy pool',
long_description='A proxy pool project modified from WiseDoge/ProxyPool',
author=['Germey', 'WiseDoge'],
author_email='cqc@cuiqingcai.com',
url='https://github.com/Germey/Proxy... | true | true |
f714ca99c5ac8b2d50a2135185af88bb05dfb468 | 1,304 | py | Python | src/nasa_sbm/configuration.py | ReeceHumphreys/NASA-breakup-model-python | 3cca5d603c846b62b31b5ac7652e040b2a31193c | [
"MIT"
] | 3 | 2022-03-07T14:42:14.000Z | 2022-03-08T19:41:04.000Z | src/nasa_sbm/configuration.py | ReeceHumphreys/NASA-breakup-model-python | 3cca5d603c846b62b31b5ac7652e040b2a31193c | [
"MIT"
] | 1 | 2022-03-30T00:44:10.000Z | 2022-03-30T00:44:10.000Z | src/nasa_sbm/configuration.py | ReeceHumphreys/python-sbm | 3cca5d603c846b62b31b5ac7652e040b2a31193c | [
"MIT"
] | null | null | null | import yaml
from enum import Enum
class SimulationType(Enum):
explosion = "EXPLOSION"
collision = "COLLISION"
class SatType(Enum):
rb = "RB"
sat = "SC"
soc = "SOC"
deb = "DEB"
class SimulationConfiguration:
# Takes a .yaml file with simulation configurations
def __init__(self, file... | 27.744681 | 92 | 0.631135 | import yaml
from enum import Enum
class SimulationType(Enum):
explosion = "EXPLOSION"
collision = "COLLISION"
class SatType(Enum):
rb = "RB"
sat = "SC"
soc = "SOC"
deb = "DEB"
class SimulationConfiguration:
def __init__(self, filePath: str):
try:
with open(file... | true | true |
f714caabd13b3013f599b17b11b7fce0affc6412 | 1,675 | py | Python | hellodjango/urls.py | Alonski/HelloDjango | d6de2ec2532799e54c893fbc615433681d49bbd9 | [
"MIT"
] | null | null | null | hellodjango/urls.py | Alonski/HelloDjango | d6de2ec2532799e54c893fbc615433681d49bbd9 | [
"MIT"
] | null | null | null | hellodjango/urls.py | Alonski/HelloDjango | d6de2ec2532799e54c893fbc615433681d49bbd9 | [
"MIT"
] | null | null | null | """hellodjango URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | 31.018519 | 89 | 0.64597 | from django.conf.urls import url
from django.contrib import admin
from django.http import HttpResponse, JsonResponse
def home_page(request):
return HttpResponse("Hello <b>World!</b>")
def age(request, name, value):
return HttpResponse("{}, you are {} years old".format(name.tit... | true | true |
f714cb4507e46b6adfd3ffaaf754a90b0df72870 | 10,504 | py | Python | tests/test_plot.py | daxpryce/graspologic | b076f58ca03a41eb2e1462d20a61ff09abfd6045 | [
"MIT"
] | 148 | 2020-09-15T21:45:51.000Z | 2022-03-24T17:33:01.000Z | tests/test_plot.py | daxpryce/graspologic | b076f58ca03a41eb2e1462d20a61ff09abfd6045 | [
"MIT"
] | 533 | 2020-09-15T18:49:00.000Z | 2022-03-25T12:16:58.000Z | tests/test_plot.py | daxpryce/graspologic | b076f58ca03a41eb2e1462d20a61ff09abfd6045 | [
"MIT"
] | 74 | 2020-09-16T02:24:23.000Z | 2022-03-20T20:09:38.000Z | # Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import unittest
import numpy as np
from sklearn.mixture import GaussianMixture
from graspologic.plot.plot import (
_sort_inds,
gridplot,
heatmap,
pairplot,
pairplot_with_gmm,
)
from graspologic.simulations.s... | 33.883871 | 85 | 0.590251 |
import unittest
import numpy as np
from sklearn.mixture import GaussianMixture
from graspologic.plot.plot import (
_sort_inds,
gridplot,
heatmap,
pairplot,
pairplot_with_gmm,
)
from graspologic.simulations.simulations import er_np, sbm
def _test_pairplot_with_gmm_inputs(caller: unittest.TestC... | true | true |
f714cb67aece3a563782c8da368a0232d2341c5a | 760 | py | Python | samples/py/obj_traversal.py | alexbudmsft/dbgscript | 76dc77109bbeb8f09a893e9dd56012ff8a4b601f | [
"PSF-2.0"
] | 27 | 2015-11-05T22:19:34.000Z | 2021-08-21T02:03:52.000Z | samples/py/obj_traversal.py | alexbudmsft/dbgscript | 76dc77109bbeb8f09a893e9dd56012ff8a4b601f | [
"PSF-2.0"
] | null | null | null | samples/py/obj_traversal.py | alexbudmsft/dbgscript | 76dc77109bbeb8f09a893e9dd56012ff8a4b601f | [
"PSF-2.0"
] | 2 | 2015-11-06T04:32:31.000Z | 2016-08-22T18:24:20.000Z | from dbgscript import *
thd = Process.current_thread
print(thd)
frame = thd.current_frame
locals = frame.get_locals()
print(locals)
for l in locals: print(l.name)
for l in locals: print(l.name, l.type)
car1 = locals[0]
print(car1.name)
car1_f = car1['f']
print(car1_f)
print(car1_f.name, car1_f.type)
print(... | 29.230769 | 75 | 0.717105 | from dbgscript import *
thd = Process.current_thread
print(thd)
frame = thd.current_frame
locals = frame.get_locals()
print(locals)
for l in locals: print(l.name)
for l in locals: print(l.name, l.type)
car1 = locals[0]
print(car1.name)
car1_f = car1['f']
print(car1_f)
print(car1_f.name, car1_f.type)
print(... | true | true |
f714cc193af3bb00e3db9b505c65fc30ea731e09 | 4,804 | py | Python | tests/ouimeaux_device/api/unit/test_service.py | KnicKnic/pywemo | 5e094b47057549a9d7c539a7e2592dcbecd50deb | [
"MIT"
] | null | null | null | tests/ouimeaux_device/api/unit/test_service.py | KnicKnic/pywemo | 5e094b47057549a9d7c539a7e2592dcbecd50deb | [
"MIT"
] | 60 | 2021-01-19T07:13:42.000Z | 2022-03-25T12:06:46.000Z | tests/ouimeaux_device/api/unit/test_service.py | KnicKnic/pywemo | 5e094b47057549a9d7c539a7e2592dcbecd50deb | [
"MIT"
] | null | null | null | """Tests for pywemo.ouimeaux_device.api.service."""
import unittest.mock as mock
from xml.etree import ElementTree
from xml.etree import cElementTree as cet
import pytest
import requests
import pywemo.ouimeaux_device.api.service as svc
HEADERS_KWARG_KEY = "headers"
CONTENT_TYPE_KEY = "Content-Type"
SOAPACTION_KEY =... | 30.598726 | 97 | 0.669858 |
import unittest.mock as mock
from xml.etree import ElementTree
from xml.etree import cElementTree as cet
import pytest
import requests
import pywemo.ouimeaux_device.api.service as svc
HEADERS_KWARG_KEY = "headers"
CONTENT_TYPE_KEY = "Content-Type"
SOAPACTION_KEY = "SOAPACTION"
MOCK_ARGS_ORDERED = 0
MOCK_ARGS_KWARG... | true | true |
f714cc8f8cc3d2beac32698e45c11ada4b6f4fde | 590 | py | Python | core/config.py | imhsz/fastapi-vue-admin | 6af8876b3d62df1de776fcf23ffcfb2bbf6082d6 | [
"MIT"
] | 1 | 2022-03-20T02:03:07.000Z | 2022-03-20T02:03:07.000Z | core/config.py | imhsz/fastapi-vue-admin | 6af8876b3d62df1de776fcf23ffcfb2bbf6082d6 | [
"MIT"
] | null | null | null | core/config.py | imhsz/fastapi-vue-admin | 6af8876b3d62df1de776fcf23ffcfb2bbf6082d6 | [
"MIT"
] | null | null | null | from pydantic import AnyHttpUrl
from typing import List
import os
ENV = os.environ.get("fast_env", "DEV") # 本次启动环境
class Settings:
APP_NAME = "fastapi-vue-admin"
# api前缀
API_PREFIX = "/api"
# jwt密钥,建议随机生成一个
SECRET_KEY = "ShsUP9qIP2Xui2GpXRY6y74v2JSVS0Q2YOXJ22VjwkI"
# token过期时间
ACCESS_TOK... | 21.851852 | 70 | 0.672881 | from pydantic import AnyHttpUrl
from typing import List
import os
ENV = os.environ.get("fast_env", "DEV")
class Settings:
APP_NAME = "fastapi-vue-admin"
API_PREFIX = "/api"
SECRET_KEY = "ShsUP9qIP2Xui2GpXRY6y74v2JSVS0Q2YOXJ22VjwkI"
ACCESS_TOKEN_EXPIRE_MINUTES = 24 * 60
BACKE... | true | true |
f714cf1852de7db2ee015f8b20b6a0e72c652f7f | 9,850 | py | Python | nova/tests/unit/db/api/test_migrations.py | crowdy/nova | 7b063e4d0518af3e57872bc0288a94edcd33c19d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/db/api/test_migrations.py | crowdy/nova | 7b063e4d0518af3e57872bc0288a94edcd33c19d | [
"Apache-2.0"
] | 3 | 2019-05-17T15:49:12.000Z | 2019-11-21T10:49:54.000Z | nova/tests/unit/db/api/test_migrations.py | crowdy/nova | 7b063e4d0518af3e57872bc0288a94edcd33c19d | [
"Apache-2.0"
] | null | null | null | # 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
# d... | 34.805654 | 79 | 0.67198 |
from alembic import command as alembic_api
from alembic import script as alembic_script
from migrate.versioning import api as migrate_api
import mock
from oslo_db.sqlalchemy import enginefacade
from oslo_db.sqlalchemy import test_fixtures
from oslo_db.sqlalchemy import test_migrations
from oslo_log import ... | true | true |
f714cf7e6e60b68cd1d521d3864fc8dbec020e17 | 583 | py | Python | pipecheck/checks/icmp.py | mriedmann/pipecheck | 9919c13c96d1c9ec28e90ca9c4da5f5b33eb41e9 | [
"MIT"
] | null | null | null | pipecheck/checks/icmp.py | mriedmann/pipecheck | 9919c13c96d1c9ec28e90ca9c4da5f5b33eb41e9 | [
"MIT"
] | 5 | 2021-06-05T22:09:17.000Z | 2021-11-24T22:17:08.000Z | pipecheck/checks/icmp.py | mriedmann/pipecheck | 9919c13c96d1c9ec28e90ca9c4da5f5b33eb41e9 | [
"MIT"
] | null | null | null | import icmplib
from pipecheck.api import CheckResult, Err, Ok, Probe, Warn
class PingProbe(Probe):
"""ICMP ping check"""
host: str = ""
ping_count: int = 1
def __call__(self) -> CheckResult:
h = icmplib.ping(self.host, privileged=False, count=self.ping_count)
if h.is_alive:
... | 30.684211 | 109 | 0.61578 | import icmplib
from pipecheck.api import CheckResult, Err, Ok, Probe, Warn
class PingProbe(Probe):
host: str = ""
ping_count: int = 1
def __call__(self) -> CheckResult:
h = icmplib.ping(self.host, privileged=False, count=self.ping_count)
if h.is_alive:
if h.packet_loss > 0.0... | true | true |
f714d02380cfe366151bdfc4c476215576e9b055 | 2,195 | py | Python | sorts/recursive_mergesort_array.py | salvinanto7/Python | 78ce34637f4b22f7f530580cc2f0b687add1b94b | [
"MIT"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | sorts/recursive_mergesort_array.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 279 | 2020-02-12T20:51:09.000Z | 2021-07-20T11:25:19.000Z | sorts/recursive_mergesort_array.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | """A merge sort which accepts an array as input and recursively
splits an array in half and sorts and combines them.
"""
"""https://en.wikipedia.org/wiki/Merge_sort """
def merge(arr: list[int]) -> list[int]:
"""Return a sorted array.
>>> merge([10,9,8,7,6,5,4,3,2,1])
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
... | 33.769231 | 74 | 0.555353 |
def merge(arr: list[int]) -> list[int]:
if len(arr) > 1:
middle_length = len(arr) // 2
left_array = arr[
:middle_length
]
right_array = arr[
middle_length:
]
left_size = len(left_array)
right_size = len(right_array)
mer... | true | true |
f714d1d0ae914916a9010122b6cddb2897fbe2ce | 722 | py | Python | common/helpers/utils.py | AlcindoSchleder/flaskWeb | 1f9ba3a3ac8546c24126124d4c34335825b94df9 | [
"MIT"
] | null | null | null | common/helpers/utils.py | AlcindoSchleder/flaskWeb | 1f9ba3a3ac8546c24126124d4c34335825b94df9 | [
"MIT"
] | 1 | 2019-07-31T20:50:41.000Z | 2019-08-01T03:02:10.000Z | common/helpers/utils.py | AlcindoSchleder/flask_API | 00f91ec29ba93c9ec3f45e6cfd78625f0abadc96 | [
"MIT"
] | 1 | 2019-08-02T22:38:23.000Z | 2019-08-02T22:38:23.000Z | # -*- coding: utf-8 -*-
import hmac
import hashlib
import base64
"""
unit : utils
descritption: Collection of functions used in all projetcts
author : Alcindo Schleder
version : 1.0.0
package : i-City Identification Plataform
"""
def isnumber(value):
try:
float(valu... | 24.066667 | 81 | 0.627424 |
import hmac
import hashlib
import base64
def isnumber(value):
try:
float(value)
except ValueError:
return False
return True
def calcFileSignature(data: str, password: str = None):
if (password):
digest = hmac.new(password, msg=data, digestmod=hashlib.sha256).digest()
... | true | true |
f714d29455aa555e390ca247a0f73233eed544e4 | 1,956 | py | Python | app/app.py | Farmer-chong/todo-list | fd44fae6375cf7b1485582faf71efedaebbb57fc | [
"MIT"
] | null | null | null | app/app.py | Farmer-chong/todo-list | fd44fae6375cf7b1485582faf71efedaebbb57fc | [
"MIT"
] | null | null | null | app/app.py | Farmer-chong/todo-list | fd44fae6375cf7b1485582faf71efedaebbb57fc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:file: app.py
:author: -Farmer
:url: https://blog.farmer233.top
:date: 2021/09/21 12:44:37
'''
import os
import click
from apiflask import APIFlask, abort
from app.config import config
from app.models import TodoList
from app.extensions import db, cors
from app.api.todo impor... | 22.744186 | 84 | 0.619632 |
import os
import click
from apiflask import APIFlask, abort
from app.config import config
from app.models import TodoList
from app.extensions import db, cors
from app.api.todo import todo_bp
def create_app(config_name: str = None) -> APIFlask:
if config_name is None:
config_name = os.getenv('FLASK_CONFIG... | true | true |
f714d330ffa499a156b0b00841a0f51b4e605071 | 22,516 | py | Python | research/slim/nets/mobilenet_v1.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | research/slim/nets/mobilenet_v1.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | research/slim/nets/mobilenet_v1.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 46.908333 | 80 | 0.641322 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import namedtuple
import functools
import tensorflow.compat.v1 as tf
import tf_slim as slim
Conv = namedtuple('Conv', ['kernel', 'stride', 'depth'])
DepthSepConv = namedt... | true | true |
f714d444f86b7ebdebc4cfbcca8048b03e1c4ab5 | 494 | py | Python | src/model/shared/data/ooo_data.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/model/shared/data/ooo_data.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/model/shared/data/ooo_data.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from typing import List, Dict
from .items.data_items import DataItems
from .shared_data import BaseData
from .full_imports import FullImports
from .from_import import FromImport
class Data(BaseData):
from_imports: List[FromImport]
from_imports_typing: List[FromImport]
extends_map: Dict[str... | 24.7 | 41 | 0.744939 |
from typing import List, Dict
from .items.data_items import DataItems
from .shared_data import BaseData
from .full_imports import FullImports
from .from_import import FromImport
class Data(BaseData):
from_imports: List[FromImport]
from_imports_typing: List[FromImport]
extends_map: Dict[str, str]
quot... | true | true |
f714d5865cfb4cce0b782ba39d92e5596aa4c59d | 4,297 | py | Python | python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional
from dagster_fivetran.resources import DEFAULT_POLL_INTERVAL
from dagster_fivetran.utils import generate_materializations
from dagster import AssetKey, AssetsDefinition, Out, Output
from dagster import _check as check
from dagster import multi_asset
from dagster.utils.backcompat impo... | 39.063636 | 100 | 0.667442 | from typing import List, Optional
from dagster_fivetran.resources import DEFAULT_POLL_INTERVAL
from dagster_fivetran.utils import generate_materializations
from dagster import AssetKey, AssetsDefinition, Out, Output
from dagster import _check as check
from dagster import multi_asset
from dagster.utils.backcompat impo... | true | true |
f714d5a168b4a464f6eba8acff23787cdd077327 | 4,848 | py | Python | datasets/W300.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | null | null | null | datasets/W300.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | null | null | null | datasets/W300.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import os
import numpy as np
import random
import math
from skimage import io
import torch
import torch.utils.data as data
import torchfile
# from utils.utils import *
from utils.imutils import *
from utils.transforms import *
class W300(data.Dataset):
def __init__(self, ... | 35.130435 | 111 | 0.514233 | from __future__ import print_function
import os
import numpy as np
import random
import math
from skimage import io
import torch
import torch.utils.data as data
import torchfile
from utils.imutils import *
from utils.transforms import *
class W300(data.Dataset):
def __init__(self, args, split):
self.... | true | true |
f714d6667d827ed794b7897b3c342b7996ae0f37 | 12,279 | py | Python | tests/test_datetime_parse.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 6 | 2021-08-11T11:37:59.000Z | 2021-11-12T01:33:11.000Z | tests/test_datetime_parse.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 189 | 2020-07-12T08:13:29.000Z | 2022-03-28T01:16:29.000Z | tests/test_datetime_parse.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 2 | 2021-11-23T16:28:21.000Z | 2021-11-23T16:28:33.000Z | """
Stolen from https://github.com/django/django/blob/master/tests/utils_tests/test_dateparse.py at
9718fa2e8abe430c3526a9278dd976443d4ae3c6
Changed to:
* use standard pytest layout
* parametrize tests
"""
from datetime import date, datetime, time, timedelta, timezone
import pytest
from pydantic import BaseModel, Va... | 42.05137 | 116 | 0.58425 | from datetime import date, datetime, time, timedelta, timezone
import pytest
from pydantic import BaseModel, ValidationError, errors
from pydantic.datetime_parse import parse_date, parse_datetime, parse_duration, parse_time
def create_tz(minutes):
return timezone(timedelta(minutes=minutes))
@pytest.mark.param... | true | true |
f714d75855fb1f1011c915bfe8ff92d1d28c700e | 1,471 | py | Python | examples/hello-world.py | Shoe-Pi/gfx-hat | ac7cd4ac8873fdff692823b4bf4a804eaa2d98f8 | [
"MIT"
] | 24 | 2018-09-04T20:56:23.000Z | 2021-11-07T06:22:23.000Z | examples/hello-world.py | Shoe-Pi/gfx-hat | ac7cd4ac8873fdff692823b4bf4a804eaa2d98f8 | [
"MIT"
] | 10 | 2018-09-01T16:32:44.000Z | 2022-03-29T13:28:19.000Z | examples/hello-world.py | Shoe-Pi/gfx-hat | ac7cd4ac8873fdff692823b4bf4a804eaa2d98f8 | [
"MIT"
] | 12 | 2018-08-27T21:32:36.000Z | 2022-01-06T10:09:31.000Z | #!/usr/bin/env python
import time
import signal
from gfxhat import touch, lcd, backlight, fonts
from PIL import Image, ImageFont, ImageDraw
print("""hello-world.py
This basic example prints the text "Hello World" in the middle of the LCD
Press any button to see its corresponding LED toggle on/off.
Press Ctrl+C to... | 19.103896 | 73 | 0.626785 |
import time
import signal
from gfxhat import touch, lcd, backlight, fonts
from PIL import Image, ImageFont, ImageDraw
print("""hello-world.py
This basic example prints the text "Hello World" in the middle of the LCD
Press any button to see its corresponding LED toggle on/off.
Press Ctrl+C to exit.
""")
led_sta... | true | true |
f714d8d2b3754c5bbdedf8c1d58e3f9d656a5795 | 2,619 | py | Python | vmware_nsx/shell/admin/plugins/nsxp/resources/certificates.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/shell/admin/plugins/nsxp/resources/certificates.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/shell/admin/plugins/nsxp/resources/certificates.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 35.391892 | 78 | 0.722413 |
from vmware_nsx.shell.admin.plugins.common import constants
from vmware_nsx.shell.admin.plugins.common import utils as admin_utils
from vmware_nsx.shell.admin.plugins.common import v3_common_cert
from vmware_nsx.shell import resources as shell
from neutron_lib.callbacks import registry
from oslo_config i... | true | true |
f714d8d4dbefa94c8fbca307ba8490cc93a1e285 | 457 | py | Python | Module1/Getting_Started_with_Data_Analysis_Code/4/annotate.py | vijaysharmapc/Python-End-to-end-Data-Analysis | a00f2d5d1547993e000b2551ec6a1360240885ba | [
"MIT"
] | 38 | 2017-04-10T19:18:43.000Z | 2021-12-25T08:23:27.000Z | Module1/Getting_Started_with_Data_Analysis_Code/4/annotate.py | vijaysharmapc/Python-End-to-end-Data-Analysis | a00f2d5d1547993e000b2551ec6a1360240885ba | [
"MIT"
] | 1 | 2018-07-10T09:41:43.000Z | 2018-07-10T09:41:43.000Z | Module1/Getting_Started_with_Data_Analysis_Code/4/annotate.py | vijaysharmapc/Python-End-to-end-Data-Analysis | a00f2d5d1547993e000b2551ec6a1360240885ba | [
"MIT"
] | 37 | 2017-04-25T01:49:35.000Z | 2021-05-04T01:46:43.000Z | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-2.4, 0.4, 20)
y = x * x + 2 * x + 1
plt.plot(x, y, 'c', linewidth=2.0)
plt.text(-1.5, 1.8, 'y=x^2 + 2*x + 1',
fontsize=14, style='italic')
plt.annotate('minima point', xy=(-1, 0),
xytext=(-1, 0.3), horizontalalignment='ce... | 28.5625 | 51 | 0.619256 |
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-2.4, 0.4, 20)
y = x * x + 2 * x + 1
plt.plot(x, y, 'c', linewidth=2.0)
plt.text(-1.5, 1.8, 'y=x^2 + 2*x + 1',
fontsize=14, style='italic')
plt.annotate('minima point', xy=(-1, 0),
xytext=(-1, 0.3), horizontalalignment='center',
verticalal... | true | true |
f714d97e1633490532b220709b522cf4d4c1414c | 1,361 | py | Python | maior_menor_lista.py | eduardobaltazarmarfim/PythonC | 8e44b4f191582c73cca6df98120ab142145c4ba1 | [
"MIT"
] | null | null | null | maior_menor_lista.py | eduardobaltazarmarfim/PythonC | 8e44b4f191582c73cca6df98120ab142145c4ba1 | [
"MIT"
] | null | null | null | maior_menor_lista.py | eduardobaltazarmarfim/PythonC | 8e44b4f191582c73cca6df98120ab142145c4ba1 | [
"MIT"
] | null | null | null | def retorno():
resp=input('Deseja executar o programa novamente?[s/n] ')
if(resp=='S' or resp=='s'):
verificar()
else:
print('Processo finalizado com sucesso!')
pass
def cabecalho(titulo):
print('-'*30)
print(f'{titulo:^30}')
print('-'*30)
pass
def mensagem_er... | 15.465909 | 82 | 0.488611 | def retorno():
resp=input('Deseja executar o programa novamente?[s/n] ')
if(resp=='S' or resp=='s'):
verificar()
else:
print('Processo finalizado com sucesso!')
pass
def cabecalho(titulo):
print('-'*30)
print(f'{titulo:^30}')
print('-'*30)
pass
def mensagem_er... | true | true |
f714d9bc36813cd34431c4442b42ce62a95887ea | 3,783 | py | Python | Section 4/04.02_omniscient_agent_webapp.py | AYCHAIN/PracticalAI | 1657e31dfc60645f4f999475803f57c0ab9f1a2d | [
"MIT"
] | 7 | 2019-03-06T17:29:52.000Z | 2021-11-08T13:10:24.000Z | Section 4/04.02_omniscient_agent_webapp.py | AYCHAIN/PracticalAI | 1657e31dfc60645f4f999475803f57c0ab9f1a2d | [
"MIT"
] | null | null | null | Section 4/04.02_omniscient_agent_webapp.py | AYCHAIN/PracticalAI | 1657e31dfc60645f4f999475803f57c0ab9f1a2d | [
"MIT"
] | 5 | 2019-03-01T22:21:48.000Z | 2020-05-17T02:05:58.000Z | from flask import Flask, redirect, render_template, url_for
import numpy as np
app = Flask( __name__ )
@app.route( '/home' )
def index():
# retrieve the agent
agent = app.config['AGENT']
print( 'Episode: {}/{}'.format( agent.get_episode(), agent.get_episodes() ) )
print( 'Trial: {}/{}'.format( agent.... | 29.554688 | 94 | 0.648427 | from flask import Flask, redirect, render_template, url_for
import numpy as np
app = Flask( __name__ )
@app.route( '/home' )
def index():
agent = app.config['AGENT']
print( 'Episode: {}/{}'.format( agent.get_episode(), agent.get_episodes() ) )
print( 'Trial: {}/{}'.format( agent.get_trial(), agent.g... | true | true |
f714d9ff51f72caaaa2af83ccd179ae251b0bb23 | 1,929 | py | Python | examples/conjunctive_graphs.py | tonyfast/rdflib | e4fe0fdbd4de7e1183418f302315b51a14602e03 | [
"BSD-3-Clause"
] | 2 | 2021-02-06T17:36:05.000Z | 2021-04-21T07:33:39.000Z | examples/conjunctive_graphs.py | pragya16067/rdflib | 6b5bd37ccc67bdec62d2e36d174eb7933b5020b2 | [
"BSD-3-Clause"
] | 2 | 2020-05-09T15:03:57.000Z | 2020-05-30T10:51:40.000Z | examples/conjunctive_graphs.py | pragya16067/rdflib | 6b5bd37ccc67bdec62d2e36d174eb7933b5020b2 | [
"BSD-3-Clause"
] | 4 | 2020-05-08T08:36:19.000Z | 2020-05-28T07:23:23.000Z | """
An RDFLib ConjunctiveGraph is an (unnamed) aggregation of all the named graphs
within a Store. The :meth:`~rdflib.graph.ConjunctiveGraph.get_context`
method can be used to get a particular named graph for use such as to add
triples to, or the default graph can be used
This example shows how to create named graphs ... | 32.15 | 82 | 0.65578 |
from rdflib import Namespace, Literal, URIRef
from rdflib.graph import Graph, ConjunctiveGraph
from rdflib.plugins.memory import IOMemory
if __name__ == "__main__":
ns = Namespace("http://love.com#")
mary = URIRef("http://love.com/lovers/mary")
john = URIRef("http://love.com/lovers/john")
cmary = U... | true | true |
f714da0d0e3039473d2c96ef73abc9cc0aa2fb6a | 13,287 | py | Python | pandas/core/indexes/extension.py | andrei-assa/pandas | ded76dbbfdff3211cfff0ec7039611b50d531efb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/extension.py | andrei-assa/pandas | ded76dbbfdff3211cfff0ec7039611b50d531efb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/extension.py | andrei-assa/pandas | ded76dbbfdff3211cfff0ec7039611b50d531efb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """
Shared methods for Index subclasses backed by ExtensionArray.
"""
from typing import (
Hashable,
List,
Type,
TypeVar,
Union,
)
import numpy as np
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import (
cache_readonl... | 29.79148 | 87 | 0.611274 | from typing import (
Hashable,
List,
Type,
TypeVar,
Union,
)
import numpy as np
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import (
cache_readonly,
doc,
)
from pandas.core.dtypes.cast import (
find_common_t... | true | true |
f714da179a33d1d5ea2c52e3e23e127d722d3088 | 110 | py | Python | Data Structures/Array/FindSingleNumber.py | prabhupant/daily-coding-problem | b3775dd0ad823823e60100624ccf14235c446098 | [
"MIT"
] | null | null | null | Data Structures/Array/FindSingleNumber.py | prabhupant/daily-coding-problem | b3775dd0ad823823e60100624ccf14235c446098 | [
"MIT"
] | null | null | null | Data Structures/Array/FindSingleNumber.py | prabhupant/daily-coding-problem | b3775dd0ad823823e60100624ccf14235c446098 | [
"MIT"
] | null | null | null | def find_single(arr, n):
res = arr[0]
for i in range(1,n):
res = res ^ arr[i]
return res
| 15.714286 | 26 | 0.518182 | def find_single(arr, n):
res = arr[0]
for i in range(1,n):
res = res ^ arr[i]
return res
| true | true |
f714dae6a19b474807991a76b68862fa4ed2b7a5 | 42,485 | py | Python | controllers/results.py | admed/molgears | 385c5bf1a00d54961042e75f345626f890f43bde | [
"BSD-3-Clause"
] | 5 | 2017-01-18T07:29:02.000Z | 2018-09-26T08:44:10.000Z | controllers/results.py | admed/molgears | 385c5bf1a00d54961042e75f345626f890f43bde | [
"BSD-3-Clause"
] | null | null | null | controllers/results.py | admed/molgears | 385c5bf1a00d54961042e75f345626f890f43bde | [
"BSD-3-Clause"
] | 4 | 2016-02-07T02:14:48.000Z | 2021-04-03T17:49:15.000Z | # -*- coding: utf-8 -*-
"""Sample controller with all its actions protected."""
from tg import expose, flash, redirect, request
from tg.i18n import lazy_ugettext as l_
from molgears.model import DBSession, Tags, LCompound, LPurity, Names
from molgears.model import Compound, User, Projects
from molgears.model.auth impor... | 53.507557 | 240 | 0.427775 |
from tg import expose, flash, redirect, request
from tg.i18n import lazy_ugettext as l_
from molgears.model import DBSession, Tags, LCompound, LPurity, Names
from molgears.model import Compound, User, Projects
from molgears.model.auth import UserLists
from molgears.lib.base import BaseController
import os
from sqlalch... | true | true |
f714dbac06e6467ae8dac56a6f4797e46e75a4c1 | 30,324 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 49.711475 | 207 | 0.667491 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
f714dbc004258f17a45bcd057be6ef72a01f16ec | 414 | py | Python | setup.py | SabevAtGitHub/qspreadsheet | 29127dd6f38573c7ede7680cf8f4852368fb2c38 | [
"MIT"
] | null | null | null | setup.py | SabevAtGitHub/qspreadsheet | 29127dd6f38573c7ede7680cf8f4852368fb2c38 | [
"MIT"
] | null | null | null | setup.py | SabevAtGitHub/qspreadsheet | 29127dd6f38573c7ede7680cf8f4852368fb2c38 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='qspreadsheet',
version='0.1.0',
author='TT-at-GitHub',
author_email='tt3d@start.bg',
license='MIT',
packages=setuptools.find_packages(),
install_requires=[
'numpy>=1.19.0',
'pandas>=1.0.5',
'PySide2>=5.13.0'
],
descri... | 24.352941 | 72 | 0.615942 | import setuptools
setuptools.setup(
name='qspreadsheet',
version='0.1.0',
author='TT-at-GitHub',
author_email='tt3d@start.bg',
license='MIT',
packages=setuptools.find_packages(),
install_requires=[
'numpy>=1.19.0',
'pandas>=1.0.5',
'PySide2>=5.13.0'
],
descri... | true | true |
f714dbe7af81229b495cab12b96c587e22021104 | 913 | py | Python | var/spack/repos/builtin/packages/libgcrypt/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-08-20T06:55:11.000Z | 2018-08-20T06:55:11.000Z | var/spack/repos/builtin/packages/libgcrypt/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-04-29T22:36:27.000Z | 2019-04-30T12:51:38.000Z | var/spack/repos/builtin/packages/libgcrypt/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-12T19:27:17.000Z | 2020-03-12T19:27:17.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libgcrypt(AutotoolsPackage):
"""Libgcrypt is a general purpose cryptographic library based... | 39.695652 | 74 | 0.736035 |
from spack import *
class Libgcrypt(AutotoolsPackage):
homepage = "http://www.gnu.org/software/libgcrypt/"
url = "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.1.tar.bz2"
version('1.8.1', 'b21817f9d850064d2177285f1073ec55')
version('1.7.6', '54e180679a7ae4d090f8689ca32b654c')
version(... | true | true |
f714dc8856bcaebac5a0892eb1e21befd216579a | 10,791 | py | Python | examples/Ball_Drop/GenDataBallDrop1.py | lanl/SEPIA | 0a1e606e1d1072f49e4f3f358962bd8918a5d3a3 | [
"BSD-3-Clause"
] | 19 | 2020-06-22T16:37:07.000Z | 2022-02-18T22:50:59.000Z | examples/Ball_Drop/GenDataBallDrop1.py | lanl/SEPIA | 0a1e606e1d1072f49e4f3f358962bd8918a5d3a3 | [
"BSD-3-Clause"
] | 41 | 2020-07-07T22:52:33.000Z | 2021-11-04T14:05:03.000Z | examples/Ball_Drop/GenDataBallDrop1.py | lanl/SEPIA | 0a1e606e1d1072f49e4f3f358962bd8918a5d3a3 | [
"BSD-3-Clause"
] | 6 | 2020-08-14T18:58:45.000Z | 2022-03-01T21:00:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 24 07:52:25 2020
Generate, Plot, and write all data needed for ball drop example 1
@author: granthutchings
"""
#%% Imports
import numpy as np
#import pyDOE # Latin Hypercube
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
fro... | 38.130742 | 124 | 0.587712 |
import numpy as np
b.pyplot as plt
from matplotlib.gridspec import GridSpec
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from invertH import invertHsim, invertHtrue
# 1. generate the h-t pairs and write them into files. (this file and invertH.py)
# 2. a "runmcmc"-type file that first cal... | true | true |
f714dd2831864994b43276d37c673f59de37c3f8 | 13,979 | py | Python | monai/transforms/io/dictionary.py | tatuanb/monai_V1 | 41e492b61c78bb3c303f38b03fe9fdc74a3c2e96 | [
"Apache-2.0"
] | 2,971 | 2019-10-16T23:53:16.000Z | 2022-03-31T20:58:24.000Z | monai/transforms/io/dictionary.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 2,851 | 2020-01-10T16:23:44.000Z | 2022-03-31T22:14:53.000Z | monai/transforms/io/dictionary.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 614 | 2020-01-14T19:18:01.000Z | 2022-03-31T14:06:14.000Z | # Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 52.552632 | 115 | 0.654625 |
from pathlib import Path
from typing import Optional, Union
import numpy as np
from monai.config import DtypeLike, KeysCollection
from monai.data.image_reader import ImageReader
from monai.transforms.io.array import LoadImage, SaveImage
from monai.transforms.transform import MapTransform
from monai.utils i... | true | true |
f714dd425e33726e34a19c85ff11b50408c2213b | 3,088 | py | Python | overhave/cli/s3.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 33 | 2021-02-01T15:49:37.000Z | 2021-12-20T00:44:43.000Z | overhave/cli/s3.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 46 | 2021-02-03T12:56:52.000Z | 2021-12-19T18:50:27.000Z | overhave/cli/s3.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 1 | 2021-12-07T09:02:44.000Z | 2021-12-07T09:02:44.000Z | from datetime import timedelta
from pathlib import Path
import click
from overhave.base_settings import LoggingSettings
from overhave.cli.group import overhave
from overhave.transport import OverhaveS3Bucket, OverhaveS3ManagerSettings, S3Manager
from overhave.utils import get_current_time
@overhave.group(short_help... | 32.166667 | 112 | 0.70693 | from datetime import timedelta
from pathlib import Path
import click
from overhave.base_settings import LoggingSettings
from overhave.cli.group import overhave
from overhave.transport import OverhaveS3Bucket, OverhaveS3ManagerSettings, S3Manager
from overhave.utils import get_current_time
@overhave.group(short_help... | true | true |
f714ddbe1fa4334438b63d1817170ad4c1db0595 | 2,250 | py | Python | coffea/lookup_tools/dense_lookup.py | kmohrman/coffea | 1963fc9371552b348a15084f5bde9390be1e6e1c | [
"BSD-3-Clause"
] | 1 | 2020-11-19T21:50:34.000Z | 2020-11-19T21:50:34.000Z | coffea/lookup_tools/dense_lookup.py | kondratyevd/coffea | 2baae94028c38b59f0eb52127d8fb92840dbf23d | [
"BSD-3-Clause"
] | null | null | null | coffea/lookup_tools/dense_lookup.py | kondratyevd/coffea | 2baae94028c38b59f0eb52127d8fb92840dbf23d | [
"BSD-3-Clause"
] | null | null | null | from coffea.lookup_tools.lookup_base import lookup_base
import numpy
from copy import deepcopy
class dense_lookup(lookup_base):
def __init__(self, values, dims, feval_dim=None):
super(dense_lookup, self).__init__()
self._dimension = 0
whattype = type(dims)
if whattype == numpy.nda... | 34.615385 | 84 | 0.517333 | from coffea.lookup_tools.lookup_base import lookup_base
import numpy
from copy import deepcopy
class dense_lookup(lookup_base):
def __init__(self, values, dims, feval_dim=None):
super(dense_lookup, self).__init__()
self._dimension = 0
whattype = type(dims)
if whattype == numpy.nda... | true | true |
f714ddd185814029f4f28b3c294fecf5acc1b57a | 834 | py | Python | components/py_engine/adapter/esp32/m5stackcore2/boot.py | yong171966/AliOS-Things | df29e6886cec68885db9975d5b9f51f057c2ba04 | [
"Apache-2.0"
] | null | null | null | components/py_engine/adapter/esp32/m5stackcore2/boot.py | yong171966/AliOS-Things | df29e6886cec68885db9975d5b9f51f057c2ba04 | [
"Apache-2.0"
] | null | null | null | components/py_engine/adapter/esp32/m5stackcore2/boot.py | yong171966/AliOS-Things | df29e6886cec68885db9975d5b9f51f057c2ba04 | [
"Apache-2.0"
] | null | null | null | import axp192
import kv
try:
# for m5stack-core2 only
axp = axp192.Axp192()
axp.powerAll()
axp.setLCDBrightness(80) # 设置背光亮度 0~100
except OSError:
print("make sure axp192.py is in libs folder")
def _on_get_url(url):
kv.set('_amp_pyapp_url', url)
execfile('/lib/appOta.py')
def _connect_... | 22.540541 | 57 | 0.672662 | import axp192
import kv
try:
axp = axp192.Axp192()
axp.powerAll()
axp.setLCDBrightness(80)
except OSError:
print("make sure axp192.py is in libs folder")
def _on_get_url(url):
kv.set('_amp_pyapp_url', url)
execfile('/lib/appOta.py')
def _connect_wifi(ssid, passwd):
import network... | true | true |
f714dedfb2fc55a060893bd7f928aefbca6e4e47 | 3,001 | py | Python | sphinx/ext/duration.py | samdoran/sphinx | 4c91c038b220d07bbdfe0c1680af42fe897f342c | [
"BSD-2-Clause"
] | 4,973 | 2015-01-03T15:44:00.000Z | 2022-03-31T03:11:51.000Z | sphinx/ext/duration.py | samdoran/sphinx | 4c91c038b220d07bbdfe0c1680af42fe897f342c | [
"BSD-2-Clause"
] | 7,850 | 2015-01-02T08:09:25.000Z | 2022-03-31T18:57:40.000Z | sphinx/ext/duration.py | samdoran/sphinx | 4c91c038b220d07bbdfe0c1680af42fe897f342c | [
"BSD-2-Clause"
] | 2,179 | 2015-01-03T15:26:53.000Z | 2022-03-31T12:22:44.000Z | """
sphinx.ext.duration
~~~~~~~~~~~~~~~~~~~
Measure durations of Sphinx processing.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from datetime import datetime, timedelta
from itertools import islice
from operator import itemgetter
fr... | 31.260417 | 95 | 0.680107 |
from datetime import datetime, timedelta
from itertools import islice
from operator import itemgetter
from typing import Any, Dict, List, cast
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.domains import Domain
from sphinx.locale import __
from sphinx.util import logging
logger = logg... | true | true |
f714df06f4b8553ddceb7ea6424b300d9bce8373 | 1,678 | py | Python | saleor/store/migrations/0002_auto_20210513_1002.py | autobotasia/saleor | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | [
"CC-BY-4.0"
] | 1 | 2022-02-19T13:27:40.000Z | 2022-02-19T13:27:40.000Z | saleor/store/migrations/0002_auto_20210513_1002.py | autobotasia/saleor | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | [
"CC-BY-4.0"
] | null | null | null | saleor/store/migrations/0002_auto_20210513_1002.py | autobotasia/saleor | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | [
"CC-BY-4.0"
] | 2 | 2021-12-03T16:59:37.000Z | 2022-02-19T13:05:42.000Z | # Generated by Django 3.1.7 on 2021-05-13 03:02
from django.db import migrations, models
import django.utils.timezone
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('store', '0001_initial'),
]
operations = [
migrations.AddField(
model... | 29.438596 | 83 | 0.565554 |
from django.db import migrations, models
import django.utils.timezone
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('store', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='store',
name='city',
... | true | true |
f714df9ac1fd6d0bf4721aeb747d23287a74cfba | 15,684 | py | Python | tests/python/unit/dku_timeseries/resampling/test_resampler_helpers.py | dataiku/dss-plugin-timeseries-preparation | bdb662c909a0ad6d7845325a70e3dac2bdcc6b28 | [
"Apache-2.0"
] | 2 | 2021-03-12T10:48:20.000Z | 2021-04-23T09:37:18.000Z | tests/python/unit/dku_timeseries/resampling/test_resampler_helpers.py | dataiku/dss-plugin-timeseries-preparation | bdb662c909a0ad6d7845325a70e3dac2bdcc6b28 | [
"Apache-2.0"
] | 27 | 2020-07-22T15:49:25.000Z | 2021-06-18T09:40:48.000Z | tests/python/unit/dku_timeseries/resampling/test_resampler_helpers.py | dataiku/dss-plugin-timeseries-preparation | bdb662c909a0ad6d7845325a70e3dac2bdcc6b28 | [
"Apache-2.0"
] | 1 | 2021-06-01T12:49:53.000Z | 2021-06-01T12:49:53.000Z | import numpy as np
import pandas as pd
import pytest
from dku_timeseries.timeseries_helpers import generate_date_range, get_date_offset
from recipe_config_loading import get_resampling_params
@pytest.fixture
def config():
config = {u'clip_end': 0, u'constant_value': 0, u'extrapolation_method': u'none', u'shift':... | 49.166144 | 153 | 0.615851 | import numpy as np
import pandas as pd
import pytest
from dku_timeseries.timeseries_helpers import generate_date_range, get_date_offset
from recipe_config_loading import get_resampling_params
@pytest.fixture
def config():
config = {u'clip_end': 0, u'constant_value': 0, u'extrapolation_method': u'none', u'shift':... | true | true |
f714e02bb7e930b170e446ab67321d019d589be2 | 1,958 | py | Python | fltk/nets/fashion_mnist_ls_gan.py | nata1y/fltk-testbed-group-3 | e23b59fa2a5e638d3804a39fe5012983e2988ca6 | [
"BSD-2-Clause"
] | null | null | null | fltk/nets/fashion_mnist_ls_gan.py | nata1y/fltk-testbed-group-3 | e23b59fa2a5e638d3804a39fe5012983e2988ca6 | [
"BSD-2-Clause"
] | null | null | null | fltk/nets/fashion_mnist_ls_gan.py | nata1y/fltk-testbed-group-3 | e23b59fa2a5e638d3804a39fe5012983e2988ca6 | [
"BSD-2-Clause"
] | 2 | 2021-05-03T17:40:18.000Z | 2021-05-11T09:34:30.000Z | import torch.nn as nn
class Generator(nn.Module):
def __init__(self, img_size=32):
super(Generator, self).__init__()
# TODO: update to proper image size
self.init_size = img_size // 4
self.l1 = nn.Sequential(nn.Linear(10, 128 * self.init_size ** 2))
self.conv_blocks = nn.... | 32.633333 | 118 | 0.569969 | import torch.nn as nn
class Generator(nn.Module):
def __init__(self, img_size=32):
super(Generator, self).__init__()
self.init_size = img_size // 4
self.l1 = nn.Sequential(nn.Linear(10, 128 * self.init_size ** 2))
self.conv_blocks = nn.Sequential(
nn.Upsample... | true | true |
f714e05a9950ae7e34d7aeff00d5514217f9ba13 | 1,811 | py | Python | vimsetting/bundle/VOom/autoload/voom/voom_mode_org.py | thuleqaid/boost_study | 59469af4e7b569c87c0a1de53644a39e7f9ae766 | [
"MIT"
] | 1 | 2016-03-02T16:44:59.000Z | 2016-03-02T16:44:59.000Z | vimsetting/bundle/VOom/autoload/voom/voom_mode_org.py | thuleqaid/boost_study | 59469af4e7b569c87c0a1de53644a39e7f9ae766 | [
"MIT"
] | null | null | null | vimsetting/bundle/VOom/autoload/voom/voom_mode_org.py | thuleqaid/boost_study | 59469af4e7b569c87c0a1de53644a39e7f9ae766 | [
"MIT"
] | null | null | null | # voom_mode_org.py
# Last Modified: 2013-10-31
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/
"""
VOoM markup ... | 31.224138 | 84 | 0.629486 |
import re
headline_match = re.compile(r'^(\*+)\s').match
def hook_makeOutline(VO, blines):
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
if not blines[i].startswith('*'):
... | true | true |
f714e1119b8f7e34f516de3746a674c249a5f780 | 969 | py | Python | experiments/2014-01-28-extrap-SE.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 151 | 2015-01-09T19:25:05.000Z | 2022-01-05T02:05:52.000Z | experiments/2014-01-28-extrap-SE.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 1 | 2016-08-04T13:12:51.000Z | 2016-08-04T13:12:51.000Z | experiments/2014-01-28-extrap-SE.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 59 | 2015-02-04T19:13:58.000Z | 2021-07-28T23:36:09.000Z | Experiment(description='SE extrapolation experiment',
data_dir='../data/tsdlr_9010/',
max_depth=1,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
max_jobs=1000... | 33.413793 | 83 | 0.495356 | Experiment(description='SE extrapolation experiment',
data_dir='../data/tsdlr_9010/',
max_depth=1,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
max_jobs=1000... | true | true |
f714e120e53da70f11f7c6bb03b17c5cd3ea28fe | 1,756 | py | Python | python/draw_height_time.py | ntu-as-cooklab/Weather-Balloon-Radiosonde-Tracker | 85e85a869439798475ad6711c280dae630c03c46 | [
"MIT"
] | 5 | 2018-04-24T19:43:20.000Z | 2022-01-24T19:31:48.000Z | python/draw_height_time.py | ntu-as-cooklab/Weather-Balloon-Radiosonde-Tracker | 85e85a869439798475ad6711c280dae630c03c46 | [
"MIT"
] | 3 | 2017-12-28T15:30:49.000Z | 2018-03-07T15:01:25.000Z | python/draw_height_time.py | ntu-as-cooklab/Weather-Balloon-Radiosonde-Tracker | 85e85a869439798475ad6711c280dae630c03c46 | [
"MIT"
] | 1 | 2018-03-07T12:59:27.000Z | 2018-03-07T12:59:27.000Z | from os import listdir, getcwd
from os.path import isfile, join
from math import sin, cos
from setting_utils import timeLimit, heightLimit, input_stream
files = [f for f in listdir(join(getcwd(), 'uploads')) if isfile(join(getcwd(), 'uploads', f))]
files = [f for f in files if f.endswith(".txt")]
czml =(
'var heigh... | 22.512821 | 95 | 0.514237 | from os import listdir, getcwd
from os.path import isfile, join
from math import sin, cos
from setting_utils import timeLimit, heightLimit, input_stream
files = [f for f in listdir(join(getcwd(), 'uploads')) if isfile(join(getcwd(), 'uploads', f))]
files = [f for f in files if f.endswith(".txt")]
czml =(
'var heigh... | true | true |
f714e1362842774b2075236c5764ecaf5ce5ef8c | 24,230 | py | Python | bagit_profile.py | tdilauro/bagit-profiles-validator | e73b66223fc05bc2498cb7f6dd5814940e8852e7 | [
"Unlicense"
] | 3 | 2018-05-18T16:07:57.000Z | 2020-05-01T16:08:26.000Z | bagit_profile.py | tdilauro/bagit-profiles-validator | e73b66223fc05bc2498cb7f6dd5814940e8852e7 | [
"Unlicense"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/bagit_profile.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 3 | 2018-11-06T17:04:45.000Z | 2021-07-21T08:08:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple Python module for validating BagIt profiles. See
https://github.com/bagit-profiles/bagit-profiles
for more information.
This module is intended for use with https://github.com/edsu/bagit but does not extend it.
Usage:
import bagit
import bagit_profile
# I... | 39.786535 | 139 | 0.586587 |
import json
import logging
import mimetypes
import sys
from fnmatch import fnmatch
from os import listdir, walk
from os.path import basename, exists, isdir, isfile, join, relpath, split
if sys.version_info > (3,):
basestring = str
from urllib.request import urlopen
else:
basestring = basestring
... | true | true |
f714e2196b368d98e5bacb6be6c5d3f861d519e1 | 1,340 | py | Python | tests/unit/Sentry.py | jayvdb/platform-engine | 31fb8f329dc12d75e35d85c138718f68568b893a | [
"Apache-2.0"
] | null | null | null | tests/unit/Sentry.py | jayvdb/platform-engine | 31fb8f329dc12d75e35d85c138718f68568b893a | [
"Apache-2.0"
] | null | null | null | tests/unit/Sentry.py | jayvdb/platform-engine | 31fb8f329dc12d75e35d85c138718f68568b893a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from asyncy.Exceptions import StoryscriptError
from asyncy.Sentry import Sentry
from raven import Client
def test_init(patch):
# noinspection PyTypeChecker
Sentry.init(None, None) # No-op.
patch.init(Client)
Sentry.init('sentry_dsn', 'release_ver')
Client.__init__.assert_... | 27.916667 | 69 | 0.653731 |
from asyncy.Exceptions import StoryscriptError
from asyncy.Sentry import Sentry
from raven import Client
def test_init(patch):
Sentry.init(None, None)
patch.init(Client)
Sentry.init('sentry_dsn', 'release_ver')
Client.__init__.assert_called_with(
dsn='sentry_dsn',
enable_bread... | true | true |
f714e2c0711678f8f014bdff84f94e2145a726a0 | 1,389 | py | Python | bot.py | phy1um/tmtc-discord-bot | 7d01cd4c1a78dc0b8aa2bb703c8970ff7bb27f92 | [
"MIT"
] | null | null | null | bot.py | phy1um/tmtc-discord-bot | 7d01cd4c1a78dc0b8aa2bb703c8970ff7bb27f92 | [
"MIT"
] | null | null | null | bot.py | phy1um/tmtc-discord-bot | 7d01cd4c1a78dc0b8aa2bb703c8970ff7bb27f92 | [
"MIT"
] | null | null | null | from constants import *
from gateway_protocol import Gateway
from api import DiscordAPI
import bot_config as config
import logging as log
log.basicConfig(encoding='utf-8', level=log.DEBUG)
class Bot(object):
def __init__(self, token):
self.g = Gateway(token)
self.api = DiscordAPI(token)
de... | 23.948276 | 97 | 0.614111 | from constants import *
from gateway_protocol import Gateway
from api import DiscordAPI
import bot_config as config
import logging as log
log.basicConfig(encoding='utf-8', level=log.DEBUG)
class Bot(object):
def __init__(self, token):
self.g = Gateway(token)
self.api = DiscordAPI(token)
de... | true | true |
f714e36b0fce1ae5deb107d8990396cd61bd0910 | 3,150 | py | Python | database/zenodo.py | MRCIEU/ewascatalog | a37dfeb207537831b4c5e313e0edecbad8a7c1a2 | [
"MIT"
] | 1 | 2021-08-05T09:39:48.000Z | 2021-08-05T09:39:48.000Z | database/zenodo.py | MRCIEU/ewascatalog | a37dfeb207537831b4c5e313e0edecbad8a7c1a2 | [
"MIT"
] | null | null | null | database/zenodo.py | MRCIEU/ewascatalog | a37dfeb207537831b4c5e313e0edecbad8a7c1a2 | [
"MIT"
] | null | null | null | # script to upload a file to zenodo sandbox via api
# seperate sandbox- and real-zenodo accounts and ACCESS_TOKENs each need to be created
# to adapt this script to real-zenodo (from sandbox implementation):
# update urls to zenodo.org from sandbox.zenodo.org
# update SANDBOX_TOKEN to a ACCESS_TOKEN from real-... | 40.384615 | 273 | 0.729524 |
import sys, json, requests
import pandas as pd
studyid = sys.argv[1]
file_dir = sys.argv[2]
access_token = sys.argv[3]
data_dir = file_dir+'/ewas-sum-stats/to-add/'+studyid
zfile=data_dir+'/zenodo.csv'
try:
zdata = pd.read_csv(zfile)
except FileNotFoundError:
print("Can't find the file "+zfile)... | true | true |
f714e3a075ce1c505d60b891128c7925fcf59c0c | 4,476 | py | Python | mars/worker/tests/test_dispatcher.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | mars/worker/tests/test_dispatcher.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | mars/worker/tests/test_dispatcher.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 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... | 43.038462 | 108 | 0.638517 |
import time
from functools import partial
import gevent
from mars.tests.core import patch_method
from mars.utils import get_next_port
from mars.actors import create_actor_pool
from mars.promise import PromiseActor
from mars.worker import *
from mars.worker.tests.base import WorkerCase
class TaskActor(... | true | true |
f714e47b106eac676e74b6b6d55a7dccf1215a4c | 8,482 | py | Python | datasets/wikitext/wikitext.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 10,608 | 2020-09-10T15:47:50.000Z | 2022-03-31T22:51:47.000Z | datasets/wikitext/wikitext.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 2,396 | 2020-09-10T14:55:31.000Z | 2022-03-31T19:41:04.000Z | datasets/wikitext/wikitext.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 1,530 | 2020-09-10T21:43:10.000Z | 2022-03-31T01:59:12.000Z | """TODO(wikitext): Add a description here."""
import os
import datasets
_CITATION = """\
@misc{merity2016pointer,
title={Pointer Sentinel Mixture Models},
author={Stephen Merity and Caiming Xiong and James Bradbury and Richard Socher},
year={2016},
eprint={1609.07843},
archivePrefix={... | 43.948187 | 119 | 0.524051 |
import os
import datasets
_CITATION = """\
@misc{merity2016pointer,
title={Pointer Sentinel Mixture Models},
author={Stephen Merity and Caiming Xiong and James Bradbury and Richard Socher},
year={2016},
eprint={1609.07843},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
"""
_DES... | true | true |
f714e52d70d6ddff64b9a0a585c2e4068c9397b7 | 48,390 | py | Python | wagtail/api/v2/tests/test_pages.py | sir-sigurd/wagtail | 18dd01a4cc7f7c51680400d7f39f80d661c4b1d5 | [
"BSD-3-Clause"
] | 1 | 2021-08-14T13:47:33.000Z | 2021-08-14T13:47:33.000Z | wagtail/api/v2/tests/test_pages.py | denza/wagtail | 3939397850f2c73d3f960cea5cc9c2cfae2d005d | [
"BSD-3-Clause"
] | 2 | 2021-03-10T14:04:08.000Z | 2021-05-08T21:24:46.000Z | wagtail/api/v2/tests/test_pages.py | denza/wagtail | 3939397850f2c73d3f960cea5cc9c2cfae2d005d | [
"BSD-3-Clause"
] | null | null | null | import collections
import json
import mock
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from wagtail.api.v2 import signal_handlers
from wagtail.core.models import Page, Site
from wagtail.tests.demosite import models
from wagtail.tests.testapp.models ... | 42.410167 | 172 | 0.666171 | import collections
import json
import mock
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from wagtail.api.v2 import signal_handlers
from wagtail.core.models import Page, Site
from wagtail.tests.demosite import models
from wagtail.tests.testapp.models ... | true | true |
f714e5ccca4b369e0fbd09fb0a4e6218788b9ed7 | 3,513 | py | Python | google_or_tools/coloring_ip_sat.py | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | google_or_tools/coloring_ip_sat.py | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | google_or_tools/coloring_ip_sat.py | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | # Copyright 2021 Hakan Kjellerstrand hakank@gmail.com
#
# 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 ... | 27.232558 | 78 | 0.63507 |
from __future__ import print_function
from ortools.sat.python import cp_model as cp
import math, sys
def main():
model = cp.CpModel()
nc = 5
n = 11
V = list(range(n))
num_edges = 20
E = [[1, 2], [1, 4], [1, 7], [1, 9], [2, 3], [2, 6], [2, 8], [3, 5], [3,... | true | true |
f714e6ac55f4e95ed142d9f2bf5143a5d4edabf6 | 1,179 | py | Python | utils/summaries.py | lzhmarkk/pytorch-deeplab-xception | 63f699214e4095a4edda21173012cc29e53125b3 | [
"MIT"
] | 2,766 | 2018-06-15T11:30:06.000Z | 2022-03-30T08:22:29.000Z | utils/summaries.py | lzhmarkk/pytorch-deeplab-xception | 63f699214e4095a4edda21173012cc29e53125b3 | [
"MIT"
] | 211 | 2018-06-29T07:02:02.000Z | 2022-03-25T03:38:19.000Z | utils/summaries.py | lzhmarkk/pytorch-deeplab-xception | 63f699214e4095a4edda21173012cc29e53125b3 | [
"MIT"
] | 867 | 2018-07-03T10:09:34.000Z | 2022-03-31T09:52:40.000Z | import os
import torch
from torchvision.utils import make_grid
from tensorboardX import SummaryWriter
from dataloaders.utils import decode_seg_map_sequence
class TensorboardSummary(object):
def __init__(self, directory):
self.directory = directory
def create_summary(self):
writer = SummaryWrit... | 51.26087 | 108 | 0.659033 | import os
import torch
from torchvision.utils import make_grid
from tensorboardX import SummaryWriter
from dataloaders.utils import decode_seg_map_sequence
class TensorboardSummary(object):
def __init__(self, directory):
self.directory = directory
def create_summary(self):
writer = SummaryWrit... | true | true |
f714e7fafd9de41aaacfbf8d84f6f21e60c66856 | 3,410 | py | Python | app/__init__.py | brandiqa/microblog-pytest | 652429fb440dc9e9f912b8376d3587641ab14348 | [
"MIT"
] | null | null | null | app/__init__.py | brandiqa/microblog-pytest | 652429fb440dc9e9f912b8376d3587641ab14348 | [
"MIT"
] | 1 | 2021-06-02T00:35:14.000Z | 2021-06-02T00:35:14.000Z | app/__init__.py | brandiqa/microblog-pytest | 652429fb440dc9e9f912b8376d3587641ab14348 | [
"MIT"
] | null | null | null | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, request, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from flask... | 32.788462 | 79 | 0.660411 | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, request, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from flask... | true | true |
f714e80b7cf0f0a4bbd27f451d6c99bb727e414c | 863 | py | Python | Ninja/Leetcode/88_Merge_Sorted_Array.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/Leetcode/88_Merge_Sorted_Array.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/Leetcode/88_Merge_Sorted_Array.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | """
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m and n respectively.
"""
class Solution:
# @param A a list ... | 27.83871 | 187 | 0.479722 |
class Solution:
def merge(self, A, m, B, n):
i = m - 1
j = n - 1
x = m + n - 1
while i>=0 and j>=0:
if A[i] > B[j]:
A[x] = A[i]
i -= 1
else:
A[x] = B[j]
j -= 1
... | true | true |
f714e82ca1013c68e6fdf12798491074bf08099a | 13,720 | py | Python | jirafs/migrations.py | mcepl/jirafs | abe18222b8bbfb23877d176bab966809556a9637 | [
"MIT"
] | null | null | null | jirafs/migrations.py | mcepl/jirafs | abe18222b8bbfb23877d176bab966809556a9637 | [
"MIT"
] | null | null | null | jirafs/migrations.py | mcepl/jirafs | abe18222b8bbfb23877d176bab966809556a9637 | [
"MIT"
] | null | null | null | import json
import os
import shutil
import subprocess
from six.moves.urllib import parse
from . import utils
from .exceptions import GitCommandError
def set_repo_version(repo, version):
with open(repo.get_metadata_path('version'), 'w') as out:
out.write(str(version))
repo.run_git_command(
'a... | 26.537718 | 79 | 0.571574 | import json
import os
import shutil
import subprocess
from six.moves.urllib import parse
from . import utils
from .exceptions import GitCommandError
def set_repo_version(repo, version):
with open(repo.get_metadata_path('version'), 'w') as out:
out.write(str(version))
repo.run_git_command(
'a... | true | true |
f714e83d2f50d6b29bdbd9adf5eabbbb4ba0812e | 6,187 | py | Python | Compiler/ppc.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | Compiler/ppc.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | Compiler/ppc.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | import util
import math
from Compiler.types import Array, sint, sfloat, sfix, MemValue, cint, Matrix, _int
# import operator
# import math
# from Compiler.instructions import *
from Compiler.library import for_range, print_str, for_range, print_float_prec
import ml
pint = sint
pfloat = sfloat
pfix = sfix
pnum = pflo... | 27.255507 | 84 | 0.659286 | import util
import math
from Compiler.types import Array, sint, sfloat, sfix, MemValue, cint, Matrix, _int
from Compiler.library import for_range, print_str, for_range, print_float_prec
import ml
pint = sint
pfloat = sfloat
pfix = sfix
pnum = pfloat
print_float_prec(4)
MAX_DATA_LENGTH = 500
MAX_ML_SIZE = 500
... | true | true |
f714e8841d230fa94120f748f64ae122d1b782d6 | 17,326 | py | Python | dscript/commands/train.py | samsledje/D-SCRIPT | 3fa7ea685f7fcdc63468380267d1672f63bb8772 | [
"MIT"
] | 12 | 2020-11-15T11:36:27.000Z | 2022-03-14T13:30:35.000Z | dscript/commands/train.py | samsledje/D-SCRIPT | 3fa7ea685f7fcdc63468380267d1672f63bb8772 | [
"MIT"
] | 27 | 2020-12-01T02:38:55.000Z | 2022-02-25T19:08:18.000Z | dscript/commands/train.py | samsledje/D-SCRIPT | 3fa7ea685f7fcdc63468380267d1672f63bb8772 | [
"MIT"
] | 6 | 2021-07-05T23:16:56.000Z | 2022-03-30T03:29:12.000Z | """
Train a new model.
"""
import sys
import argparse
import h5py
import datetime
import subprocess as sp
import numpy as np
import pandas as pd
import gzip as gz
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
fr... | 31.387681 | 140 | 0.609546 |
import sys
import argparse
import h5py
import datetime
import subprocess as sp
import numpy as np
import pandas as pd
import gzip as gz
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import ... | true | true |
f714e944300f9dc8d4448ae55e5b7c4d463b66f6 | 667 | py | Python | setup.py | ameya98/roc2pr | ab19d7552e2e9ae32ca00a1be4a17b29a3f915fa | [
"MIT"
] | 1 | 2020-09-08T14:51:48.000Z | 2020-09-08T14:51:48.000Z | setup.py | ameya98/pr2roc | ab19d7552e2e9ae32ca00a1be4a17b29a3f915fa | [
"MIT"
] | null | null | null | setup.py | ameya98/pr2roc | ab19d7552e2e9ae32ca00a1be4a17b29a3f915fa | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pr2roc",
version="0.0.1",
author="Ameya Daigavane",
author_email="ameya.d.98@gmail.com",
description="A package to resample precision-recall curves correctly.",
long_description=long_d... | 30.318182 | 75 | 0.667166 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pr2roc",
version="0.0.1",
author="Ameya Daigavane",
author_email="ameya.d.98@gmail.com",
description="A package to resample precision-recall curves correctly.",
long_description=long_d... | true | true |
f714eaabcfc91716d629e476a3730ed8f6d6ff30 | 2,766 | py | Python | core/converter/coordinate_converter.py | tringuyenminh23/chronos | cf20e65ca81b7cd2f3000383e870902b421fe3b0 | [
"MIT"
] | null | null | null | core/converter/coordinate_converter.py | tringuyenminh23/chronos | cf20e65ca81b7cd2f3000383e870902b421fe3b0 | [
"MIT"
] | null | null | null | core/converter/coordinate_converter.py | tringuyenminh23/chronos | cf20e65ca81b7cd2f3000383e870902b421fe3b0 | [
"MIT"
] | null | null | null | import requests
from abc import ABC, abstractmethod
from typing import Tuple, List
import json
class CoordinateConverter(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def convert_coordinate(self, coordinate: Tuple, base_system_code, target_system_code):
pass
@abstractm... | 39.514286 | 108 | 0.630875 | import requests
from abc import ABC, abstractmethod
from typing import Tuple, List
import json
class CoordinateConverter(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def convert_coordinate(self, coordinate: Tuple, base_system_code, target_system_code):
pass
@abstractm... | true | true |
f714ec32dd2c3ee61a6b4c3f6009a99ad349e191 | 314 | py | Python | day4/1.py | bujiie/adventofcode2015 | 40d04b078bf9ebd90a544e4259c65cb77de36928 | [
"MIT"
] | null | null | null | day4/1.py | bujiie/adventofcode2015 | 40d04b078bf9ebd90a544e4259c65cb77de36928 | [
"MIT"
] | null | null | null | day4/1.py | bujiie/adventofcode2015 | 40d04b078bf9ebd90a544e4259c65cb77de36928 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fileinput
import hashlib
hash = None
with fileinput.input() as fp:
hash = fp.readline().strip()
res = None
i = 0
zeros = 5
while True:
s = f'{hash}{str(i)}'
h = hashlib.md5(s.encode())
res = h.hexdigest()
if res.startswith('0'*zeros):
break;
i += 1
print(i)
print(res)
| 12.56 | 30 | 0.636943 |
import fileinput
import hashlib
hash = None
with fileinput.input() as fp:
hash = fp.readline().strip()
res = None
i = 0
zeros = 5
while True:
s = f'{hash}{str(i)}'
h = hashlib.md5(s.encode())
res = h.hexdigest()
if res.startswith('0'*zeros):
break;
i += 1
print(i)
print(res)
| true | true |
f714edb5b8db1159d14893789256eff798138f9d | 17,348 | py | Python | thespian/test/test_deadLettering.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 210 | 2015-08-31T19:39:34.000Z | 2020-01-10T08:07:48.000Z | thespian/test/test_deadLettering.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 85 | 2017-04-08T19:28:42.000Z | 2022-03-23T15:25:49.000Z | thespian/test/test_deadLettering.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 47 | 2015-09-01T19:24:20.000Z | 2020-01-02T20:03:05.000Z | """Verify DeadLetter handling behavior.
Current behavior is that an Actor may register for DeadLetter
handling. If it is registered, any message sent to an Actor that is
no longer present will be redirected to the register DeadLetter actor
(in its original form).
On exit of the DeadLetter handling Actor, the system ... | 37.227468 | 94 | 0.640016 |
import time
from thespian.actors import *
from thespian.test import *
from datetime import timedelta
ASK_WAIT = timedelta(seconds=15)
dead_routing_wait = lambda: inTestDelay(timedelta(milliseconds=125))
actor_exit_wait = lambda: inTestDelay(timedelta(milliseconds=50))
actor_create_wait = lambda: inTestDelay(timedel... | true | true |
f714edba273ac98faf971ba9c109eee8aee8bd86 | 2,833 | py | Python | z2/part2/batch/jm/parser_errors_2/366414300.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 1 | 2020-04-16T12:13:47.000Z | 2020-04-16T12:13:47.000Z | z2/part2/batch/jm/parser_errors_2/366414300.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:50:15.000Z | 2020-05-19T14:58:30.000Z | z2/part2/batch/jm/parser_errors_2/366414300.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:45:13.000Z | 2020-06-09T19:18:31.000Z | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 366414300
"""
"""
random actions, total chaos
"""
board = gamma_new(5, 4, 4, 1)
assert board is... | 30.462366 | 44 | 0.650547 | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
board = gamma_new(5, 4, 4, 1)
assert board is not None
assert gamma_move(board, 1, 2, 0) == 1
assert gamma_free_fields(board, 1) == ... | true | true |
f714edba6f5e54b2903a01e66bac1da132698edc | 1,773 | py | Python | examples/part_c.py | Viasat/salabim_plus | f68b207a469648f75cafdb9a3a0e3f772ad9b08a | [
"MIT"
] | 3 | 2020-07-12T16:18:08.000Z | 2022-03-31T20:29:51.000Z | examples/part_c.py | JackNelson/salabim_plus | f68b207a469648f75cafdb9a3a0e3f772ad9b08a | [
"MIT"
] | null | null | null | examples/part_c.py | JackNelson/salabim_plus | f68b207a469648f75cafdb9a3a0e3f772ad9b08a | [
"MIT"
] | 1 | 2020-06-12T20:19:45.000Z | 2020-06-12T20:19:45.000Z | import misc_tools
import random
def create_routing(env, first_step='op1'):
tasks = {
'op1': misc_tools.make_assembly_step(
env=env,
run_time=random.gauss(mu=12, sigma=0.5),
route_to='op2'),
'op2': {
'location': env['machine_3'],
'worker... | 29.55 | 68 | 0.478849 | import misc_tools
import random
def create_routing(env, first_step='op1'):
tasks = {
'op1': misc_tools.make_assembly_step(
env=env,
run_time=random.gauss(mu=12, sigma=0.5),
route_to='op2'),
'op2': {
'location': env['machine_3'],
'worker... | true | true |
f714edde1080126efd87ebb2e29ea0002cb76a78 | 122 | py | Python | irnl_rdt_correction/__main__.py | pylhc/irnl_rdt_correction | 7360728ffaa66b0c9f7b4825c241a3949df18962 | [
"MIT"
] | null | null | null | irnl_rdt_correction/__main__.py | pylhc/irnl_rdt_correction | 7360728ffaa66b0c9f7b4825c241a3949df18962 | [
"MIT"
] | null | null | null | irnl_rdt_correction/__main__.py | pylhc/irnl_rdt_correction | 7360728ffaa66b0c9f7b4825c241a3949df18962 | [
"MIT"
] | null | null | null | from irnl_rdt_correction.irnl_rdt_correction import main, log_setup
if __name__ == '__main__':
log_setup()
main() | 24.4 | 67 | 0.754098 | from irnl_rdt_correction.irnl_rdt_correction import main, log_setup
if __name__ == '__main__':
log_setup()
main() | true | true |
f714eea8b200ced2a6fd1482b2234ba9eb5303f0 | 27 | py | Python | reolink_baichuan/camera_api.py | xannor/reolink_baichuan | 390f469d19eb4308cd390ed2357705aa4fe7fb38 | [
"MIT"
] | 1 | 2021-08-13T16:14:32.000Z | 2021-08-13T16:14:32.000Z | reolink_baichuan/camera_api.py | xannor/reolink_baichuan | 390f469d19eb4308cd390ed2357705aa4fe7fb38 | [
"MIT"
] | null | null | null | reolink_baichuan/camera_api.py | xannor/reolink_baichuan | 390f469d19eb4308cd390ed2357705aa4fe7fb38 | [
"MIT"
] | 1 | 2021-05-15T12:51:34.000Z | 2021-05-15T12:51:34.000Z | """
Reolink Camera API
"""
| 6.75 | 18 | 0.592593 | true | true | |
f714ef557ca4ceb8492ccb8cd834a8c222a15a93 | 6,909 | py | Python | test.py | spk921/RTFNet | 4dad2a63e13e9c302da45ad5a3af4d85cf474694 | [
"MIT"
] | 1 | 2020-11-04T10:38:33.000Z | 2020-11-04T10:38:33.000Z | test.py | spk921/RTFNet | 4dad2a63e13e9c302da45ad5a3af4d85cf474694 | [
"MIT"
] | null | null | null | test.py | spk921/RTFNet | 4dad2a63e13e9c302da45ad5a3af4d85cf474694 | [
"MIT"
] | 1 | 2021-02-25T03:27:16.000Z | 2021-02-25T03:27:16.000Z | # coding:utf-8
# modified from: https://github.com/haqishen/MFNet-pytorch
# By Yuxiang Sun, Aug. 2, 2019
# Email: sun.yuxiang@outlook.com
import os
import argparse
import time
import datetime
import numpy as np
import sys
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
from ut... | 49.35 | 253 | 0.627587 |
import os
import argparse
import time
import datetime
import numpy as np
import sys
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
from util.MF_dataset import MF_dataset
from model import RTFNet
from sklearn.metrics import confusion_matrix
n_class = 9
data_dir = '... | true | true |
f714f0b9624cf9de0c997ff4a2f5217b29268d2c | 5,779 | py | Python | tests/unit/test_validator_cli.py | ajenie/sawtooth-validator | c21436b3abbac4d2ce7cf6a65d9c71ea79d78e98 | [
"Apache-2.0"
] | 4 | 2017-05-22T15:53:29.000Z | 2021-12-03T02:11:30.000Z | tests/unit/test_validator_cli.py | ajenie/sawtooth-validator | c21436b3abbac4d2ce7cf6a65d9c71ea79d78e98 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_validator_cli.py | ajenie/sawtooth-validator | c21436b3abbac4d2ce7cf6a65d9c71ea79d78e98 | [
"Apache-2.0"
] | 2 | 2017-10-16T02:36:34.000Z | 2021-12-03T02:11:19.000Z | # Copyright 2016 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 agreed to in wri... | 35.89441 | 80 | 0.59249 |
import os
import unittest
from txnmain.validator_cli import get_configuration
class TestValidatorCLI(unittest.TestCase):
def test_currency_home(self):
os.environ.clear()
os.environ["CURRENCYHOME"] = "/test_path"
cfg = get_configuration(args=[], config_files_required=False)... | true | true |
f714f3d1f909cc42bd23a2c7442b97bb0ce95b3a | 13,654 | py | Python | samples/client/petstore/python/petstore_api/model/child_lizard.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-01-03T04:40:07.000Z | 2022-01-03T04:40:07.000Z | samples/client/petstore/python/petstore_api/model/child_lizard.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 28 | 2021-04-07T07:38:36.000Z | 2022-03-31T03:10:56.000Z | samples/client/petstore/python/petstore_api/model/child_lizard.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 2 | 2021-11-03T10:07:15.000Z | 2021-12-17T13:00:53.000Z | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... | 42.403727 | 174 | 0.581075 |
import re
import sys
from petstore_api.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
Ope... | true | true |
f714f53f337435de514cd32802ebf103c855cc8e | 319 | py | Python | backend/server/go-spider.py | thomas5566/new-django-react-app | 25a1f499de60a35d4cc40a7dca3696e04d92d5dc | [
"MIT"
] | null | null | null | backend/server/go-spider.py | thomas5566/new-django-react-app | 25a1f499de60a35d4cc40a7dca3696e04d92d5dc | [
"MIT"
] | null | null | null | backend/server/go-spider.py | thomas5566/new-django-react-app | 25a1f499de60a35d4cc40a7dca3696e04d92d5dc | [
"MIT"
] | null | null | null | from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from botmovies.spiders.ptt import PttMoviesSpider
from botmovies.spiders.yahoo import YahooSpider
process = CrawlerProcess(get_project_settings())
process.crawl(PttMoviesSpider)
process.crawl(YahooSpider)
process.start()
| 29 | 53 | 0.858934 | from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from botmovies.spiders.ptt import PttMoviesSpider
from botmovies.spiders.yahoo import YahooSpider
process = CrawlerProcess(get_project_settings())
process.crawl(PttMoviesSpider)
process.crawl(YahooSpider)
process.start()
| true | true |
f714f642a68008e196da074e26144251d4a5f260 | 611 | py | Python | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter18/rpyc_server.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter18/rpyc_server.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter18/rpyc_server.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Foundations of Python Network Programming, Third Edition
# https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter18/rpyc_server.py
# RPyC server
import rpyc
def main():
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(MyService, port = 18861)
t.start()
class My... | 27.772727 | 77 | 0.702128 |
import rpyc
def main():
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(MyService, port = 18861)
t.start()
class MyService(rpyc.Service):
def exposed_line_counter(self, fileobj, function):
print('Client has invoked exposed_line_counter()')
for linenum, line in enum... | true | true |
f714f69a08b35e1b9d65ff1ce11b3bc8d056174d | 531 | py | Python | Task2B.py | henryseal/PartIA-Flood-Warning-System-main | 4110a22b4b4a1b6ac8778aa176ddb1a577d245b1 | [
"MIT"
] | null | null | null | Task2B.py | henryseal/PartIA-Flood-Warning-System-main | 4110a22b4b4a1b6ac8778aa176ddb1a577d245b1 | [
"MIT"
] | null | null | null | Task2B.py | henryseal/PartIA-Flood-Warning-System-main | 4110a22b4b4a1b6ac8778aa176ddb1a577d245b1 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_level_over_threshold
def run():
stations = build_station_list()
update_water_levels(stations)
for station_tuple in stati... | 26.55 | 75 | 0.73258 |
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_level_over_threshold
def run():
stations = build_station_list()
update_water_levels(stations)
for station_tuple in stations_level_over_threshold(stations, 0.8):
print(station_tup... | true | true |
f714f6e6db1898081eaba5c2d3937b62899fb8ac | 476 | py | Python | Desafios/Desafio101.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | Desafios/Desafio101.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | Desafios/Desafio101.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | from auxiliar import receberInt
def voto(nasc):
from datetime import date
idade = int(date.today().year) - nasc
if idade < 16:
return f'Com {idade} anos, voto: NEGADO'
elif idade < 18 or idade >= 60:
return f'Com {idade} anos, voto: OPCIONAL'
else:
return f'Com {idade} anos,... | 25.052632 | 55 | 0.655462 | from auxiliar import receberInt
def voto(nasc):
from datetime import date
idade = int(date.today().year) - nasc
if idade < 16:
return f'Com {idade} anos, voto: NEGADO'
elif idade < 18 or idade >= 60:
return f'Com {idade} anos, voto: OPCIONAL'
else:
return f'Com {idade} anos,... | true | true |
f714f71252970ab103635098b3af05715486c851 | 675 | py | Python | examples/argument_group.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | 1 | 2021-04-26T19:46:33.000Z | 2021-04-26T19:46:33.000Z | examples/argument_group.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | null | null | null | examples/argument_group.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | null | null | null | import argtyper
@argtyper.ArgumentGroup(
["firstname", "lastname"],
title="Name details",
description="Give your full name here",
)
@argtyper.ArgumentGroup(
["nickname", "firstname"],
title="Nickname details",
description="Give your Nickname here",
)
@argtyper.Argument(
"amount", "repetiti... | 25.961538 | 85 | 0.662222 | import argtyper
@argtyper.ArgumentGroup(
["firstname", "lastname"],
title="Name details",
description="Give your full name here",
)
@argtyper.ArgumentGroup(
["nickname", "firstname"],
title="Nickname details",
description="Give your Nickname here",
)
@argtyper.Argument(
"amount", "repetiti... | true | true |
f714f92a92fb4764cbd9b8709835322bbc54cf6b | 1,474 | py | Python | tensorflow_datasets/text/__init__.py | MyWhiteCastle/datasets | e75a54948bb8aaf9cf45933a538502d2f66c41a6 | [
"Apache-2.0"
] | 2 | 2019-11-23T18:41:58.000Z | 2020-08-12T21:00:39.000Z | tensorflow_datasets/text/__init__.py | MyWhiteCastle/datasets | e75a54948bb8aaf9cf45933a538502d2f66c41a6 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/text/__init__.py | MyWhiteCastle/datasets | e75a54948bb8aaf9cf45933a538502d2f66c41a6 | [
"Apache-2.0"
] | 1 | 2019-12-14T00:32:08.000Z | 2019-12-14T00:32:08.000Z | # coding=utf-8
# Copyright 2019 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... | 44.666667 | 90 | 0.833786 |
from tensorflow_datasets.text.definite_pronoun_resolution import DefinitePronounResolution
from tensorflow_datasets.text.gap import Gap
from tensorflow_datasets.text.glue import Glue
from tensorflow_datasets.text.imdb import IMDBReviews
from tensorflow_datasets.text.imdb import IMDBReviewsConfig
from te... | true | true |
f714f98147bf1c6b56576249d2a0857054514332 | 5,166 | py | Python | tests/test_development_scripts.py | dmwcode/ntc-templates | 684f45b34e453c5d2a20df2a8769c66555017e22 | [
"Apache-2.0"
] | 817 | 2016-04-27T22:47:59.000Z | 2022-03-29T21:47:37.000Z | tests/test_development_scripts.py | dmwcode/ntc-templates | 684f45b34e453c5d2a20df2a8769c66555017e22 | [
"Apache-2.0"
] | 577 | 2016-05-13T12:41:12.000Z | 2022-03-31T02:42:14.000Z | tests/test_development_scripts.py | dmwcode/ntc-templates | 684f45b34e453c5d2a20df2a8769c66555017e22 | [
"Apache-2.0"
] | 677 | 2016-04-27T22:48:03.000Z | 2022-03-28T16:20:36.000Z | import os
import glob
from copy import deepcopy
import pytest
from ruamel.yaml.compat import StringIO
import development_scripts
@pytest.fixture(scope="module")
def yaml_comments_file():
with open("tests/mocks/load/yaml_comments.yml", encoding="utf-8") as fh:
return development_scripts.YAML_OBJECT.load(... | 33.115385 | 88 | 0.734611 | import os
import glob
from copy import deepcopy
import pytest
from ruamel.yaml.compat import StringIO
import development_scripts
@pytest.fixture(scope="module")
def yaml_comments_file():
with open("tests/mocks/load/yaml_comments.yml", encoding="utf-8") as fh:
return development_scripts.YAML_OBJECT.load(... | true | true |
f714f9af20d505dd8a6b78bf8ee9169697d1f5cd | 8,853 | py | Python | custom_components/xiaomi_miot/light.py | ss109/hass-xiaomi-miot | a69c8e0e44400b9aa0f94f1003d3c6f3de4996fd | [
"Apache-2.0"
] | 1 | 2021-12-10T12:30:34.000Z | 2021-12-10T12:30:34.000Z | custom_components/xiaomi_miot/light.py | ss109/hass-xiaomi-miot | a69c8e0e44400b9aa0f94f1003d3c6f3de4996fd | [
"Apache-2.0"
] | null | null | null | custom_components/xiaomi_miot/light.py | ss109/hass-xiaomi-miot | a69c8e0e44400b9aa0f94f1003d3c6f3de4996fd | [
"Apache-2.0"
] | null | null | null | """Support for Xiaomi lights."""
import logging
from functools import partial
from homeassistant.const import * # noqa: F401
from homeassistant.components.light import (
DOMAIN as ENTITY_DOMAIN,
LightEntity,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR_TEMP,
SUPPORT_COLOR,
SUPPORT_EFFECT,
ATTR_BRIGHT... | 33.790076 | 112 | 0.656952 | import logging
from functools import partial
from homeassistant.const import *
from homeassistant.components.light import (
DOMAIN as ENTITY_DOMAIN,
LightEntity,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR_TEMP,
SUPPORT_COLOR,
SUPPORT_EFFECT,
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,... | true | true |
f714f9e04cfc2c6e3e123f7aa5966dc910128689 | 10,457 | py | Python | tests/test_app/test_result.py | u6052029/cogent3 | ca0efcb7f60b715bcbfbecd924cdb98a53cefe20 | [
"BSD-3-Clause"
] | null | null | null | tests/test_app/test_result.py | u6052029/cogent3 | ca0efcb7f60b715bcbfbecd924cdb98a53cefe20 | [
"BSD-3-Clause"
] | null | null | null | tests/test_app/test_result.py | u6052029/cogent3 | ca0efcb7f60b715bcbfbecd924cdb98a53cefe20 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase, main
from cogent3 import make_aligned_seqs
from cogent3.app import evo as evo_app
from cogent3.app.result import (
generic_result,
model_collection_result,
model_result,
)
from cogent3.util.deserialise import deserialise_object
__author__ = "Gavin Huttley"
__copyright__ = "... | 35.568027 | 83 | 0.609353 | from unittest import TestCase, main
from cogent3 import make_aligned_seqs
from cogent3.app import evo as evo_app
from cogent3.app.result import (
generic_result,
model_collection_result,
model_result,
)
from cogent3.util.deserialise import deserialise_object
__author__ = "Gavin Huttley"
__copyright__ = "... | true | true |
f714fbc79b42edf40142a4ad4bbb7a90e3778f3f | 789 | py | Python | account/views.py | AhteshamSid/College_school_management_system | a8504708ea2f347d18d4ac59198f29d05c0374d2 | [
"MIT"
] | null | null | null | account/views.py | AhteshamSid/College_school_management_system | a8504708ea2f347d18d4ac59198f29d05c0374d2 | [
"MIT"
] | null | null | null | account/views.py | AhteshamSid/College_school_management_system | a8504708ea2f347d18d4ac59198f29d05c0374d2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from .models import UserProfile
from .forms import ProfileForm
def profile(request, pk):
profile = UserProfile.objects.get(id=pk)
context = {
'profile': profile
}
return render(request, 'accoun... | 29.222222 | 75 | 0.653992 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from .models import UserProfile
from .forms import ProfileForm
def profile(request, pk):
profile = UserProfile.objects.get(id=pk)
context = {
'profile': profile
}
return render(request, 'accoun... | true | true |
f714fbdb129a1c7ec713e34c3c33a04f1236e5c5 | 9,949 | py | Python | pyanalyze/test_annotations.py | sobolevn/pyanalyze | f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc | [
"Apache-2.0"
] | null | null | null | pyanalyze/test_annotations.py | sobolevn/pyanalyze | f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc | [
"Apache-2.0"
] | null | null | null | pyanalyze/test_annotations.py | sobolevn/pyanalyze | f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc | [
"Apache-2.0"
] | null | null | null | # static analysis: ignore
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .test_name_check_visitor import TestNameCheckVisitorBase
from .test_node_visitor import skip_before
from .error_code import ErrorCode
class TestAnnotations(TestNameCheckVisitorB... | 22.976905 | 113 | 0.592924 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .test_name_check_visitor import TestNameCheckVisitorBase
from .test_node_visitor import skip_before
from .error_code import ErrorCode
class TestAnnotations(TestNameCheckVisitorBase):
@skip_before((3... | true | true |
f714fc4571882f467493e6f5ded8f4fd81a3114e | 9,403 | py | Python | src/ebay_rest/api/buy_browse/models/payment_method.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | src/ebay_rest/api/buy_browse/models/payment_method.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | src/ebay_rest/api/buy_browse/models/payment_method.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Browse API
<p>The Browse API has the following resources:</p> <ul> <li><b> item_summary: </b> Lets shoppers search for specific items by keyword, GTIN, category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility, and fields values.<... | 47.730964 | 2,314 | 0.668829 |
import pprint
import re
import six
class PaymentMethod(object):
swagger_types = {
'payment_instructions': 'list[str]',
'payment_method_brands': 'list[PaymentMethodBrand]',
'payment_method_type': 'str',
'seller_instructions': 'list[str]'
}
attribute_map = {
'pa... | true | true |
f714fc808fcfb6c6731b0e09e82f0d3179f49b65 | 2,971 | py | Python | v1/awsbuild/bao_signal_handler.py | badassops/ops-aws | 2e6b76e62e7b9edaa3ba43ff57df90b75c75aba7 | [
"BSD-3-Clause"
] | 2 | 2019-02-28T06:49:19.000Z | 2019-12-30T09:41:17.000Z | v1/awsbuild/bao_signal_handler.py | badassops/ops-aws | 2e6b76e62e7b9edaa3ba43ff57df90b75c75aba7 | [
"BSD-3-Clause"
] | null | null | null | v1/awsbuild/bao_signal_handler.py | badassops/ops-aws | 2e6b76e62e7b9edaa3ba43ff57df90b75c75aba7 | [
"BSD-3-Clause"
] | null | null | null | # vim:fileencoding=utf-8:noet
""" python method """
# Copyright (c) 2010 - 2019, © Badassops LLC / Luc Suryo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code... | 43.691176 | 85 | 0.703467 |
import signal
import sys
def signal_handler(signum, frame):
if signum is int(signal.SIGHUP):
print('Received -HUP, app does not support reload. {}'.format(frame))
elif signum is int(signal.SIGINT):
print('Received ctrl-c, aborted on your request. {}'.fo... | true | true |
f714fd687acb9dcd38aefae007bf9b8459b33ed2 | 2,485 | py | Python | svc/lycanthropy/auth/client.py | kryptops/lycanthropy | 8b18a78e1586b9e5d4d433f307a3dd72d961f4fe | [
"BSD-3-Clause"
] | 11 | 2020-08-14T18:55:17.000Z | 2022-02-18T07:35:12.000Z | svc/lycanthropy/auth/client.py | kryptops/lycanthropy | 8b18a78e1586b9e5d4d433f307a3dd72d961f4fe | [
"BSD-3-Clause"
] | 9 | 2020-08-17T02:26:11.000Z | 2022-02-19T22:59:53.000Z | svc/lycanthropy/auth/client.py | kryptops/lycanthropy | 8b18a78e1586b9e5d4d433f307a3dd72d961f4fe | [
"BSD-3-Clause"
] | 2 | 2020-09-14T15:23:47.000Z | 2022-02-20T03:04:54.000Z | import hashlib
import random
import lycanthropy.sql.interface
import lycanthropy.crypto
import jwt
def decodeToken(token,config):
rawData = jwt.decode(
token,
config['secret'],
algorithms=['HS256']
)
return rawData
def monitoringToken(user,config,remote,identity):
userData = ly... | 26.157895 | 97 | 0.615292 | import hashlib
import random
import lycanthropy.sql.interface
import lycanthropy.crypto
import jwt
def decodeToken(token,config):
rawData = jwt.decode(
token,
config['secret'],
algorithms=['HS256']
)
return rawData
def monitoringToken(user,config,remote,identity):
userData = ly... | true | true |
f714fec78acf88635ae3a5489d89aaa3ac2fe45a | 1,162 | py | Python | app/view/index.py | InnopolisAero/uavcan.org | cef212cdb4fb2c3f672b04780445229607c93eaa | [
"MIT"
] | null | null | null | app/view/index.py | InnopolisAero/uavcan.org | cef212cdb4fb2c3f672b04780445229607c93eaa | [
"MIT"
] | null | null | null | app/view/index.py | InnopolisAero/uavcan.org | cef212cdb4fb2c3f672b04780445229607c93eaa | [
"MIT"
] | null | null | null | #
# Copyright (C) 2019 UAVCAN Development Team <info@zubax.com>.
# Author: Pavel Kirienko <pavel.kirienko@zubax.com>
#
from .. import app
from ..model import devel_feed, forum_feed, adopters
from flask import render_template
FEED_LENGTH = 15
TITLE = 'UAVCAN - a lightweight protocol designed for reliable communicat... | 29.05 | 80 | 0.674699 |
from .. import app
from ..model import devel_feed, forum_feed, adopters
from flask import render_template
FEED_LENGTH = 15
TITLE = 'UAVCAN - a lightweight protocol designed for reliable communication ' \
'in aerospace and robotic applications over robust vehicular networks'
@app.route('/')
def _inde... | true | true |
f714ffc25bab8da9a862bf45880ff26921b227b0 | 5,358 | py | Python | pynextcaller/tests/test_by_address.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | pynextcaller/tests/test_by_address.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | pynextcaller/tests/test_by_address.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import unittest
try:
from unittest import mock
except ImportError:
import mock
try:
from .base import BaseTestCase, BasePlatformTestCase
except (ValueError, ImportError):
from pynextcaller.tests.base import BaseTestCase, BasePlatformTestCase
ADDRESS_JSON_RESULT_... | 31.333333 | 83 | 0.573162 | from __future__ import unicode_literals
import unittest
try:
from unittest import mock
except ImportError:
import mock
try:
from .base import BaseTestCase, BasePlatformTestCase
except (ValueError, ImportError):
from pynextcaller.tests.base import BaseTestCase, BasePlatformTestCase
ADDRESS_JSON_RESULT_... | true | true |
f71501f1216ea4346d3b0a6f63bb45fb0f07341f | 52,205 | py | Python | sympy/matrices/tests/test_commonmatrix.py | AugustinJose1221/sympy | 94731be8cc4ee7d2a63065732dd086fb272029ad | [
"BSD-3-Clause"
] | 2 | 2019-10-18T12:45:34.000Z | 2020-08-10T08:27:59.000Z | sympy/matrices/tests/test_commonmatrix.py | AugustinJose1221/sympy | 94731be8cc4ee7d2a63065732dd086fb272029ad | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/tests/test_commonmatrix.py | AugustinJose1221/sympy | 94731be8cc4ee7d2a63065732dd086fb272029ad | [
"BSD-3-Clause"
] | 1 | 2019-10-18T12:39:41.000Z | 2019-10-18T12:39:41.000Z | import collections
import random
from sympy.assumptions import Q
from sympy.core.add import Add
from sympy.core.compatibility import range
from sympy.core.function import (Function, diff)
from sympy.core.numbers import (E, Float, I, Integer, oo, pi)
from sympy.core.relational import (Eq, Lt)
from sympy.core.singleton ... | 33.400512 | 123 | 0.5279 | import collections
import random
from sympy.assumptions import Q
from sympy.core.add import Add
from sympy.core.compatibility import range
from sympy.core.function import (Function, diff)
from sympy.core.numbers import (E, Float, I, Integer, oo, pi)
from sympy.core.relational import (Eq, Lt)
from sympy.core.singleton ... | true | true |
f71502012c2112fc320b40aba0ee9fe0ae69053c | 4,289 | py | Python | azure-batch/azure/batch/models/subtask_information.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/subtask_information.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/subtask_information.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... | 47.655556 | 217 | 0.683143 |
from msrest.serialization import Model
class SubtaskInformation(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'int'},
'node_info': {'key': 'nodeInfo', 'type': 'ComputeNodeInformation'},
'start_time': {'key': 'startTime', 'type': 'iso-8601'},
'end_time... | true | true |
f71502d262586243fcb871571f56d5965f4c4430 | 1,805 | py | Python | misc/logger.py | abraker95/ultimate_osu_analyzer | bea58c997d13c3f461ccbe682f52799f0f88fdea | [
"MIT"
] | 23 | 2019-02-27T06:20:15.000Z | 2022-03-31T22:54:11.000Z | misc/logger.py | abraker95/ultimate_osu_analyzer | bea58c997d13c3f461ccbe682f52799f0f88fdea | [
"MIT"
] | 38 | 2019-03-03T17:35:39.000Z | 2021-08-23T20:43:34.000Z | misc/logger.py | abraker95/ultimate_osu_analyzer | bea58c997d13c3f461ccbe682f52799f0f88fdea | [
"MIT"
] | 4 | 2020-03-30T20:43:14.000Z | 2022-03-06T19:40:15.000Z | import logging
import traceback
import config
import pathlib
class Logger(logging.getLoggerClass()):
def __init__(self, name, level=logging.NOTSET):
super().__init__(name, level=logging.DEBUG)
formatter = logging.Formatter('%(levelname)s %(asctime)s [ %(name)s ] %(message)s')
... | 29.112903 | 104 | 0.574515 | import logging
import traceback
import config
import pathlib
class Logger(logging.getLoggerClass()):
def __init__(self, name, level=logging.NOTSET):
super().__init__(name, level=logging.DEBUG)
formatter = logging.Formatter('%(levelname)s %(asctime)s [ %(name)s ] %(message)s')
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.