hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f710b5ffbebe49e837f19c94522a3272a6027073 | 1,784 | py | Python | Python3/79.word-search.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/79.word-search.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/79.word-search.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=79 lang=python3
#
# [79] Word Search
#
# @lc code=start
class Solution:
def exist(self, board, word):
start = [None, None]
h = len(board)
l = len(board[0])
walked = [[0] * l for _ in range(h)]
for i in range(h):
for j in range(l):
... | 30.758621 | 90 | 0.421525 |
class Solution:
def exist(self, board, word):
start = [None, None]
h = len(board)
l = len(board[0])
walked = [[0] * l for _ in range(h)]
for i in range(h):
for j in range(l):
if board[i][j] == word[0]:
start = [i, j]
... | true | true |
f710b63ba31a89c01f4bf06cfb94875dfffd398e | 6,376 | py | Python | fragment.py | soumitrasamanta/FragGenie | 9ce493d88e3479a286ce88dc0c5b199ea7c7e441 | [
"MIT"
] | 1 | 2021-07-08T15:29:53.000Z | 2021-07-08T15:29:53.000Z | fragment.py | soumitrasamanta/FragGenie | 9ce493d88e3479a286ce88dc0c5b199ea7c7e441 | [
"MIT"
] | null | null | null | fragment.py | soumitrasamanta/FragGenie | 9ce493d88e3479a286ce88dc0c5b199ea7c7e441 | [
"MIT"
] | null | null | null | """
-----------------------------------------------------------------------------
AUTHOR: Soumitra Samanta (soumitramath39@gmail.com)
-----------------------------------------------------------------------------
"""
import subprocess
import os
import numpy as np
from datetime import datetime
import pandas as pd
from ... | 33.382199 | 124 | 0.528545 |
import subprocess
import os
import numpy as np
from datetime import datetime
import pandas as pd
from rdkit import Chem
from rdkit.Chem import Descriptors
__all__ = [
'FragGenie'
]
class FragGenie():
def __init__(self, dir_fraggenie=''):
self.dir_fraggenie = dir_fraggenie
... | true | true |
f710b66b0ac6b8256d7003a72fab84b564edbb14 | 6,541 | py | Python | cirq/optimizers/expand_composite_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | 1 | 2019-05-10T10:26:42.000Z | 2019-05-10T10:26:42.000Z | cirq/optimizers/expand_composite_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/expand_composite_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.792553 | 77 | 0.591041 |
import cirq
def assert_equal_mod_empty(expected, actual):
drop_empty = cirq.DropEmptyMoments()
drop_empty.optimize_circuit(actual)
if expected != actual:
print('EXPECTED')
print(expected)
print('ACTUAL')
print(actual)
assert expected == actual
def test_empty_... | true | true |
f710b6dee76ed44e8b32fb3065ab9d427703ea7d | 329 | py | Python | fs_warehouser/fs_warehouser.py | JesseAldridge/fs_warehouser | ad8c6794313729cff07b964b91fa0335154fee3c | [
"MIT"
] | null | null | null | fs_warehouser/fs_warehouser.py | JesseAldridge/fs_warehouser | ad8c6794313729cff07b964b91fa0335154fee3c | [
"MIT"
] | null | null | null | fs_warehouser/fs_warehouser.py | JesseAldridge/fs_warehouser | ad8c6794313729cff07b964b91fa0335154fee3c | [
"MIT"
] | null | null | null | import os, glob
def get_last_timestamped_dir_path(data_dir_path):
glob_path = os.path.join(os.path.expanduser(data_dir_path), '2*')
date_paths = glob.glob(glob_path)
date_paths.sort()
return date_paths[-1] if date_paths else None
if __name__ == '__main__':
print(get_last_timestamped_dir_path('~/fake_scraper... | 29.909091 | 67 | 0.768997 | import os, glob
def get_last_timestamped_dir_path(data_dir_path):
glob_path = os.path.join(os.path.expanduser(data_dir_path), '2*')
date_paths = glob.glob(glob_path)
date_paths.sort()
return date_paths[-1] if date_paths else None
if __name__ == '__main__':
print(get_last_timestamped_dir_path('~/fake_scraper... | true | true |
f710b77221f9ccb42a7760e5cf57e07915eb7a7e | 42,626 | py | Python | test/functional/test_framework/messages.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | 1 | 2022-03-05T14:50:58.000Z | 2022-03-05T14:50:58.000Z | test/functional/test_framework/messages.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | 2 | 2021-12-25T12:39:07.000Z | 2022-02-14T03:03:36.000Z | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2019 The Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 28.417333 | 262 | 0.599446 | from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, assert_equal
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70014 MY_SUBVERSION = b"/python-min... | true | true |
f710b7ec16f6c2d873e98254f0217de121369296 | 24,902 | py | Python | official/recommend/ncf/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/recommend/ncf/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/recommend/ncf/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.024712 | 120 | 0.656132 | import logging
import math
import os
import time
import timeit
import pickle
import numpy as np
import pandas as pd
from mindspore.dataset import GeneratorDataset, Sampler
import src.constants as rconst
import src.movielens as movielens
import src.stat_utils as stat_utils
DATASET_TO_NUM_USERS_AND_ITEMS = {
"ml-1... | true | true |
f710b8147a553fabf38ebede8c94806bd534a143 | 2,307 | py | Python | labml_nn/normalization/group_norm/experiment.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 3,714 | 2021-05-26T03:42:15.000Z | 2022-03-31T16:45:20.000Z | labml_nn/normalization/group_norm/experiment.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 43 | 2021-05-26T05:26:42.000Z | 2022-03-23T11:50:56.000Z | labml_nn/normalization/group_norm/experiment.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 349 | 2021-05-26T21:07:09.000Z | 2022-03-31T07:52:00.000Z | """
---
title: CIFAR10 Experiment to try Group Normalization
summary: >
This trains is a simple convolutional neural network that uses group normalization
to classify CIFAR10 images.
---
# CIFAR10 Experiment for Group Normalization
"""
import torch.nn as nn
from labml import experiment
from labml.configs import ... | 26.517241 | 95 | 0.618986 |
import torch.nn as nn
from labml import experiment
from labml.configs import option
from labml_helpers.module import Module
from labml_nn.experiments.cifar10 import CIFAR10Configs
from labml_nn.normalization.group_norm import GroupNorm
class Model(Module):
def __init__(self, groups: int = 32):
super().... | true | true |
f710b83bd8594a1934a5829a1392dae4395ef186 | 305 | py | Python | 2017/07/obamacare-popularity-20170707/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2017/07/obamacare-popularity-20170707/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2017/07/obamacare-popularity-20170707/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1QOOhihZdUwdAJcUgkeokbx7YaDSkSGWtlXHvKXhHW3E'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.819672 |
import base_filters
COPY_GOOGLE_DOC_KEY = '1QOOhihZdUwdAJcUgkeokbx7YaDSkSGWtlXHvKXhHW3E'
USE_ASSETS = False
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| true | true |
f710b90a4060a39f957fd2a19f35fac1f130b7b9 | 2,324 | py | Python | nca47/objects/dns/sp_policy_info.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/objects/dns/sp_policy_info.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/objects/dns/sp_policy_info.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | from nca47.db import api as db_api
from nca47.db.sqlalchemy.models import Proximity as ProximityModel
from nca47.objects import base
from nca47.objects import fields as object_fields
class ProximityInfo(base.Nca47Object):
VERSION = '1.0'
fields = {
'tenant_id': object_fields.StringField(),
's... | 35.212121 | 76 | 0.674269 | from nca47.db import api as db_api
from nca47.db.sqlalchemy.models import Proximity as ProximityModel
from nca47.objects import base
from nca47.objects import fields as object_fields
class ProximityInfo(base.Nca47Object):
VERSION = '1.0'
fields = {
'tenant_id': object_fields.StringField(),
's... | true | true |
f710b99e0cb3fb44f98ec0ea8aa3312cc37d3fa8 | 719 | py | Python | drkcode/python/kktmat.py | kdeweese/DualRandomizedKaczmarz | 3d339e893fe1dcb91677f3240047801ca3c43162 | [
"BSD-3-Clause"
] | 2 | 2016-03-09T08:05:42.000Z | 2020-05-30T02:33:51.000Z | drkcode/python/kktmat.py | kdeweese/DualRandomizedKaczmarz | 3d339e893fe1dcb91677f3240047801ca3c43162 | [
"BSD-3-Clause"
] | null | null | null | drkcode/python/kktmat.py | kdeweese/DualRandomizedKaczmarz | 3d339e893fe1dcb91677f3240047801ca3c43162 | [
"BSD-3-Clause"
] | 2 | 2016-03-09T08:07:03.000Z | 2020-10-01T16:37:28.000Z | #!/usr/bin/env python
# kktmat.py -- KKT matrix from Laplacian matrix
#
# Copyright (C) <2016> <Kevin Deweese>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import scipy
def kktmat(L):
mat=scipy.sparse.coo_matrix(s... | 26.62963 | 63 | 0.659249 |
import scipy
def kktmat(L):
mat=scipy.sparse.coo_matrix(scipy.sparse.tril(L,-1))
row=mat.row
m=len(row)
n=L.shape[0]
col=mat.col
val=mat.data
R=scipy.array(-1/val)
i=scipy.concatenate([scipy.arange(0,m),scipy.arange(0,m)])
j=scipy.concatenate([row,col])
data=scipy.conc... | true | true |
f710ba1f276ed700fb85e07626b81479efa95afe | 794 | py | Python | SimpleCV/examples/detection/FisherFaceRecognizer.py | M93Pragya/SimpleCV | 6c4d61b6d1d9d856b471910107cad0838954d2b2 | [
"BSD-3-Clause"
] | 1,686 | 2015-01-02T08:47:08.000Z | 2022-03-26T11:55:35.000Z | SimpleCV/examples/detection/FisherFaceRecognizer.py | Tester2009/SimpleCV | 7372a0c58eead9c3228315d65ae1903e4b8eb3f1 | [
"BSD-3-Clause"
] | 64 | 2015-01-05T11:23:11.000Z | 2021-12-17T18:29:10.000Z | SimpleCV/examples/detection/FisherFaceRecognizer.py | Tester2009/SimpleCV | 7372a0c58eead9c3228315d65ae1903e4b8eb3f1 | [
"BSD-3-Clause"
] | 599 | 2015-01-10T17:37:08.000Z | 2022-03-28T05:31:51.000Z | from SimpleCV import *
import time
"""
This is an example of HOW-TO use FaceRecognizer to recognize gender
of the person.
"""
def identifyGender():
f = FaceRecognizer()
cam = Camera()
img = cam.getImage()
cascade = LAUNCH_PATH + "/" + "Features/HaarCascades/face.xml"
feat = img.findHaarFeatures(ca... | 24.060606 | 76 | 0.639798 | from SimpleCV import *
import time
"""
This is an example of HOW-TO use FaceRecognizer to recognize gender
of the person.
"""
def identifyGender():
f = FaceRecognizer()
cam = Camera()
img = cam.getImage()
cascade = LAUNCH_PATH + "/" + "Features/HaarCascades/face.xml"
feat = img.findHaarFeatures(ca... | false | true |
f710bb121dc39fe025e869b3c95d8b40ae0689d1 | 21,508 | py | Python | readthedocs/settings/base.py | santos22/readthedocs.org | 9802ad0d8677b9c4f2eea317a9574812e4e8ff8a | [
"MIT"
] | null | null | null | readthedocs/settings/base.py | santos22/readthedocs.org | 9802ad0d8677b9c4f2eea317a9574812e4e8ff8a | [
"MIT"
] | null | null | null | readthedocs/settings/base.py | santos22/readthedocs.org | 9802ad0d8677b9c4f2eea317a9574812e4e8ff8a | [
"MIT"
] | null | null | null | # pylint: disable=missing-docstring
import getpass
import os
from celery.schedules import crontab
from readthedocs.core.settings import Settings
from readthedocs.projects.constants import CELERY_LOW, CELERY_MEDIUM, CELERY_HIGH
try:
import readthedocsext # noqa
ext = True
except ImportError:
ext = Fals... | 33.038402 | 106 | 0.589455 |
import getpass
import os
from celery.schedules import crontab
from readthedocs.core.settings import Settings
from readthedocs.projects.constants import CELERY_LOW, CELERY_MEDIUM, CELERY_HIGH
try:
import readthedocsext ext = True
except ImportError:
ext = False
_ = gettext = lambda s: s
class Commu... | true | true |
f710bc0c7a452a8d63c48e69d4a6a414fc921a2e | 2,793 | py | Python | pdc/apps/contact/filters.py | hluk/product-definition-center | af79f73c30fa5f5709ba03d584b7a49b83166b81 | [
"MIT"
] | 18 | 2015-12-15T17:56:18.000Z | 2021-04-10T13:49:48.000Z | pdc/apps/contact/filters.py | hluk/product-definition-center | af79f73c30fa5f5709ba03d584b7a49b83166b81 | [
"MIT"
] | 303 | 2015-11-18T07:37:06.000Z | 2021-05-26T12:34:01.000Z | pdc/apps/contact/filters.py | hluk/product-definition-center | af79f73c30fa5f5709ba03d584b7a49b83166b81 | [
"MIT"
] | 27 | 2015-11-19T20:33:54.000Z | 2021-03-25T08:15:28.000Z | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import django_filters
from django.db.models import Q
from django_filters import FilterSet
from pdc.apps.common.filters import MultiValueFilter, MultiValueRegexFilter, value_is_not_empty
from . import models
fr... | 32.103448 | 95 | 0.712496 | import django_filters
from django.db.models import Q
from django_filters import FilterSet
from pdc.apps.common.filters import MultiValueFilter, MultiValueRegexFilter, value_is_not_empty
from . import models
from .models import (Person,
Maillist,
GlobalComponentContact,
... | true | true |
f710bc6f51d67c9c28e1e8d61df7113edf1ef689 | 191 | py | Python | jp.atcoder/abc156/abc156_a/10265687.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc156/abc156_a/10265687.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc156/abc156_a/10265687.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
n, r = map(int, sys.stdin.readline().split())
def main():
res = r + 100 * max(10 - n, 0)
return res
if __name__ == '__main__':
ans = main()
print(ans)
| 15.916667 | 46 | 0.528796 | import sys
n, r = map(int, sys.stdin.readline().split())
def main():
res = r + 100 * max(10 - n, 0)
return res
if __name__ == '__main__':
ans = main()
print(ans)
| true | true |
f710bcbd79d2d6ab9a9da2e8a815f6df2e583197 | 21,262 | py | Python | sdk/python/pulumi_azure_nextgen/healthcareapis/v20200330/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/healthcareapis/v20200330/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/healthcareapis/v20200330/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.588022 | 208 | 0.667764 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'PrivateEndpointConnectionResponse',
'PrivateEndpointResponse',
'PrivateLinkServiceConnectionStateResponse',
'ServiceAcce... | true | true |
f710bcdd6aae55098faa5368f8cdcae5b8cac447 | 408 | py | Python | educa/courses/api/urls.py | kformanowicz/educa | 290883dc973345c6d3784c6bb0cb784cec80fa60 | [
"MIT"
] | null | null | null | educa/courses/api/urls.py | kformanowicz/educa | 290883dc973345c6d3784c6bb0cb784cec80fa60 | [
"MIT"
] | 9 | 2020-06-05T20:29:39.000Z | 2022-03-12T00:10:48.000Z | educa/courses/api/urls.py | kformanowicz/educa | 290883dc973345c6d3784c6bb0cb784cec80fa60 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register('courses', views.CourseViewSet)
urlpatterns = [
url(r'^subjects/$', views.SubjectListView.as_view(), name='subject_list'),
url(r'^subjects/(?P<pk>\d+)/$', views.Su... | 31.384615 | 94 | 0.723039 | from django.conf.urls import include, url
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register('courses', views.CourseViewSet)
urlpatterns = [
url(r'^subjects/$', views.SubjectListView.as_view(), name='subject_list'),
url(r'^subjects/(?P<pk>\d+)/$', views.Su... | true | true |
f710be72959fb0be0368f06abdc06ed4a9466c4c | 1,401 | py | Python | zygoat/components/backend/docker_compose.py | Ian-MacLeod/zygoat | 83773fdebf8cddf06903c2d32bd575e33e23e252 | [
"MIT"
] | null | null | null | zygoat/components/backend/docker_compose.py | Ian-MacLeod/zygoat | 83773fdebf8cddf06903c2d32bd575e33e23e252 | [
"MIT"
] | null | null | null | zygoat/components/backend/docker_compose.py | Ian-MacLeod/zygoat | 83773fdebf8cddf06903c2d32bd575e33e23e252 | [
"MIT"
] | null | null | null | import importlib
import logging
from zygoat.constants import Phases, Projects
from zygoat.components import Component
from zygoat.config import yaml
from . import resources
log = logging.getLogger()
file_name = 'docker-compose.yml'
class DockerCompose(Component):
def _dump_config(self, data):
with open(... | 26.942308 | 97 | 0.681656 | import importlib
import logging
from zygoat.constants import Phases, Projects
from zygoat.components import Component
from zygoat.config import yaml
from . import resources
log = logging.getLogger()
file_name = 'docker-compose.yml'
class DockerCompose(Component):
def _dump_config(self, data):
with open(... | true | true |
f710be848a7796c69f453a60a5b769bb077868cc | 11,427 | py | Python | main.py | ikuroNoriiwa/shellcode_transform | fac7d04168d9f3888a63c7ce76cc93bc8bef0058 | [
"Apache-2.0"
] | 2 | 2021-09-13T09:40:12.000Z | 2021-09-13T11:37:54.000Z | main.py | ikuroNoriiwa/shellcode_transform | fac7d04168d9f3888a63c7ce76cc93bc8bef0058 | [
"Apache-2.0"
] | null | null | null | main.py | ikuroNoriiwa/shellcode_transform | fac7d04168d9f3888a63c7ce76cc93bc8bef0058 | [
"Apache-2.0"
] | 1 | 2021-07-09T17:06:46.000Z | 2021-07-09T17:06:46.000Z | #!/usr/bin/python3
import argparse
from os.path import isfile
from pathlib import Path
from re import compile, findall, split as re_split, sub, search, match
from utils import error
def parse_buffer(encode_detail_buffer, shellcode, numberbefore=0, numberafter=0):
"""
parse le buffer et renvoie un tuple comm... | 45.891566 | 240 | 0.543362 |
import argparse
from os.path import isfile
from pathlib import Path
from re import compile, findall, split as re_split, sub, search, match
from utils import error
def parse_buffer(encode_detail_buffer, shellcode, numberbefore=0, numberafter=0):
print(encode_detail_buffer)
print(shellcode)
print(numberaf... | true | true |
f710bec06f616273ff86b3dba79e21d3bc0e6645 | 6,784 | py | Python | examples/basic_example_v1/basic_example_data.py | yandex-cloud/ydb-python-sdk | 0df2dce2d77fc41ad3020072740f51dd91630177 | [
"Apache-2.0"
] | 19 | 2019-07-01T08:25:29.000Z | 2022-01-26T14:46:51.000Z | examples/basic_example_v1/basic_example_data.py | yandex-cloud/ydb-python-sdk | 0df2dce2d77fc41ad3020072740f51dd91630177 | [
"Apache-2.0"
] | 5 | 2019-07-02T13:36:42.000Z | 2021-09-14T06:46:48.000Z | examples/basic_example_v1/basic_example_data.py | yandex-cloud/ydb-python-sdk | 0df2dce2d77fc41ad3020072740f51dd91630177 | [
"Apache-2.0"
] | 10 | 2019-06-07T10:36:19.000Z | 2021-10-15T08:58:11.000Z | # -*- coding: utf-8 -*-
import iso8601
def to_days(date):
timedelta = iso8601.parse_date(date) - iso8601.parse_date("1970-1-1")
return timedelta.days
class Series(object):
__slots__ = ('series_id', 'title', 'release_date', 'series_info')
def __init__(self, series_id, title, release_date, series_inf... | 46.786207 | 117 | 0.573261 | import iso8601
def to_days(date):
timedelta = iso8601.parse_date(date) - iso8601.parse_date("1970-1-1")
return timedelta.days
class Series(object):
__slots__ = ('series_id', 'title', 'release_date', 'series_info')
def __init__(self, series_id, title, release_date, series_info):
self.series_... | true | true |
f710bf5555ab64daaa0b8c249a8138939dfd42bd | 17,462 | py | Python | experiments/X2_thebest.py | jakobkolb/pysave | 6925982c4f526613472be0549ee93cc209af1704 | [
"MIT"
] | null | null | null | experiments/X2_thebest.py | jakobkolb/pysave | 6925982c4f526613472be0549ee93cc209af1704 | [
"MIT"
] | null | null | null | experiments/X2_thebest.py | jakobkolb/pysave | 6925982c4f526613472be0549ee93cc209af1704 | [
"MIT"
] | null | null | null | """
I want to know, whether the imitation process leads to equal return rates in both sectors.
Parameters that this could depend on are
1) the rate of exploration (random changes in opinion and rewiring),
2) also, the rate of rewiring could have an effect.
This should only work in the equilibrium condition where the ... | 52.915152 | 763 | 0.317432 | """
I want to know, whether the imitation process leads to equal return rates in both sectors.
Parameters that this could depend on are
1) the rate of exploration (random changes in opinion and rewiring),
2) also, the rate of rewiring could have an effect.
This should only work in the equilibrium condition where the ... | false | true |
f710c21983c49887ee85a144d3507038da6ab576 | 1,698 | py | Python | matrix/The_Vector_problems.py | tjctw/PythonNote | e93cebbc6bf9748966f761eff6a9ad7b12e9ece5 | [
"CC0-1.0"
] | null | null | null | matrix/The_Vector_problems.py | tjctw/PythonNote | e93cebbc6bf9748966f761eff6a9ad7b12e9ece5 | [
"CC0-1.0"
] | null | null | null | matrix/The_Vector_problems.py | tjctw/PythonNote | e93cebbc6bf9748966f761eff6a9ad7b12e9ece5 | [
"CC0-1.0"
] | null | null | null | # version code 80e56511a793+
# Please fill out this stencil and submit using the provided submission script.
# Some of the GF2 problems require use of the value GF2.one so the stencil imports it.
from GF2 import one
## 1: (Problem 2.14.1) Vector Addition Practice 1
#Please express each answer as a list of numbers
... | 22.051948 | 86 | 0.651943 |
from GF2 import one
p1_v = [-1, 3]
p1_u = [0, 4]
p1_v_plus_u = [...]
p1_v_minus_u = [...]
p1_three_v_minus_two_u = [...]
p2_u = [-1, 1, 1]
p2_v = [ 2, -1, 5]
p2_v_plus_u = [...]
p2_v_minus_u = [...]
p2_two_v_minus_u = [...]
p2_v_plus_two_u = [...]
p3_vector_sum_1 = [...]
p3_vector_sum_2 = [...]
## 4: (Pr... | true | true |
f710c21a88409fcff3b7068fee986b0767faa304 | 2,658 | py | Python | huggingface_ner/preprocess.py | dertilo/sequence-tagging | c7a264ee32fb4b9d2337c466d4c12552e7ddb799 | [
"MIT"
] | 1 | 2020-05-08T09:05:47.000Z | 2020-05-08T09:05:47.000Z | huggingface_ner/preprocess.py | TUB-NLP-OpenData/sequence-tagging | c7a264ee32fb4b9d2337c466d4c12552e7ddb799 | [
"MIT"
] | null | null | null | huggingface_ner/preprocess.py | TUB-NLP-OpenData/sequence-tagging | c7a264ee32fb4b9d2337c466d4c12552e7ddb799 | [
"MIT"
] | null | null | null | import argparse
import sys
from collections import Counter
from tqdm import tqdm
from transformers import AutoTokenizer
def read_and_preprocess(file:str):
subword_len_counter = 0
with open(file, "rt") as f_p:
for line in f_p:
line = line.rstrip()
if not line:
y... | 28.276596 | 100 | 0.598947 | import argparse
import sys
from collections import Counter
from tqdm import tqdm
from transformers import AutoTokenizer
def read_and_preprocess(file:str):
subword_len_counter = 0
with open(file, "rt") as f_p:
for line in f_p:
line = line.rstrip()
if not line:
y... | true | true |
f710c2c88539af8f36a8ca8272678561a8d6d0ba | 1,075 | py | Python | scripts/embeddings.py | serre-lab/brownUnconference | c51758f0bf695648832448c5c166e2a8dea14268 | [
"MIT"
] | null | null | null | scripts/embeddings.py | serre-lab/brownUnconference | c51758f0bf695648832448c5c166e2a8dea14268 | [
"MIT"
] | null | null | null | scripts/embeddings.py | serre-lab/brownUnconference | c51758f0bf695648832448c5c166e2a8dea14268 | [
"MIT"
] | null | null | null | import argparse
import csv
import torch
import transformers
def parse_arguments():
parser = argparse.ArgumentParser(description="MiniConf Portal Command Line")
parser.add_argument("papers", default=False, help="papers file to parse")
return parser.parse_args()
if __name__ == "__main__":
args = par... | 31.617647 | 83 | 0.661395 | import argparse
import csv
import torch
import transformers
def parse_arguments():
parser = argparse.ArgumentParser(description="MiniConf Portal Command Line")
parser.add_argument("papers", default=False, help="papers file to parse")
return parser.parse_args()
if __name__ == "__main__":
args = par... | true | true |
f710c311e6b5c5805939067fdc6c52f6401f15f1 | 1,319 | py | Python | python-module/setup.py | SSICLOPS/cppl | 265514bc461352b7b5bc58fd7482328601029e4a | [
"Apache-2.0"
] | 1 | 2018-06-02T11:50:06.000Z | 2018-06-02T11:50:06.000Z | python-module/setup.py | SSICLOPS/cppl | 265514bc461352b7b5bc58fd7482328601029e4a | [
"Apache-2.0"
] | 1 | 2018-01-17T04:16:29.000Z | 2018-01-30T09:01:44.000Z | python-module/setup.py | SSICLOPS/cppl | 265514bc461352b7b5bc58fd7482328601029e4a | [
"Apache-2.0"
] | 1 | 2018-11-18T20:31:54.000Z | 2018-11-18T20:31:54.000Z | from distutils.core import setup, Extension
import sys
major_version = '4'
minor_version = '0'
cpplmodule = Extension('cppl_cpp_python_bridge',
define_macros = [('MAJOR_VERSION', major_version),
('MINOR_VERSION', minor_version)],
include_dir... | 43.966667 | 131 | 0.551175 | from distutils.core import setup, Extension
import sys
major_version = '4'
minor_version = '0'
cpplmodule = Extension('cppl_cpp_python_bridge',
define_macros = [('MAJOR_VERSION', major_version),
('MINOR_VERSION', minor_version)],
include_dir... | true | true |
f710c366338ee89946b9f99f27d37a342ac49eca | 893 | py | Python | config.py | devseme/Blogs-App | 06e4aed7cfa7b4985e1d11e48c500305d69ef9cc | [
"MIT"
] | null | null | null | config.py | devseme/Blogs-App | 06e4aed7cfa7b4985e1d11e48c500305d69ef9cc | [
"MIT"
] | null | null | null | config.py | devseme/Blogs-App | 06e4aed7cfa7b4985e1d11e48c500305d69ef9cc | [
"MIT"
] | null | null | null | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_TRACK_MODIFICATIONS = False
UPLOADED_PHOTOS_DEST = 'app/static/photos'
# email configurations
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get("MAIL_USER... | 20.767442 | 82 | 0.702128 | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_TRACK_MODIFICATIONS = False
UPLOADED_PHOTOS_DEST = 'app/static/photos'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get("MAIL_USERNAME")
MAIL_PASSWORD... | true | true |
f710c3c42e825b9a3c844e48547f214cc48ab052 | 5,249 | py | Python | lambda/py/lambda_upload/ask_sdk_model/events/skillevents/skill_enabled_request.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | lambda/py/lambda_upload/ask_sdk_model/events/skillevents/skill_enabled_request.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | lambda/py/lambda_upload/ask_sdk_model/events/skillevents/skill_enabled_request.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 38.595588 | 182 | 0.637074 |
import pprint
import re import six
import typing
from enum import Enum
from ask_sdk_model.request import Request
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime
class SkillEnabledRequest(Request):
deserialized_types = {
'object_type': 'str',
... | true | true |
f710c4fea0ba46f981807f2668cecb5daab0e12a | 4,128 | py | Python | examples/algorithms/groupDRO.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 355 | 2020-12-12T03:29:28.000Z | 2022-03-31T22:47:29.000Z | examples/algorithms/groupDRO.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 34 | 2020-12-24T11:50:51.000Z | 2022-03-18T00:06:38.000Z | examples/algorithms/groupDRO.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 87 | 2020-12-16T08:13:21.000Z | 2022-03-24T17:00:17.000Z | import torch
from algorithms.single_model_algorithm import SingleModelAlgorithm
from models.initializer import initialize_model
class GroupDRO(SingleModelAlgorithm):
"""
Group distributionally robust optimization.
Original paper:
@inproceedings{sagawa2019distributionally,
title={Distribu... | 39.314286 | 142 | 0.610707 | import torch
from algorithms.single_model_algorithm import SingleModelAlgorithm
from models.initializer import initialize_model
class GroupDRO(SingleModelAlgorithm):
def __init__(self, config, d_out, grouper, loss, metric, n_train_steps, is_group_in_train):
assert config.uniform_over_groups
... | true | true |
f710c6110376f8c01aecd9ca8aebf4d7950f3199 | 8,006 | py | Python | DATA/Labeling.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | DATA/Labeling.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | DATA/Labeling.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | import numpy
from matplotlib import pyplot
import gdal
from skimage import io,exposure
from skimage.segmentation import slic,mark_boundaries
import os
from PIL import Image
import shelve
import sys
sys.path.append('..')
from Config import config
def seg(path,n_segments=500, compactness=20):
i=io.imread(path)[:,... | 28.695341 | 118 | 0.533475 | import numpy
from matplotlib import pyplot
import gdal
from skimage import io,exposure
from skimage.segmentation import slic,mark_boundaries
import os
from PIL import Image
import shelve
import sys
sys.path.append('..')
from Config import config
def seg(path,n_segments=500, compactness=20):
i=io.imread(path)[:,... | true | true |
f710c650d453fed703c3a62ecd5bf44194cdb61e | 25,757 | py | Python | tools/spaces.py | fsanges/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 165 | 2015-01-26T05:22:04.000Z | 2022-03-22T02:50:41.000Z | tools/spaces.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 5 | 2015-12-02T02:39:44.000Z | 2020-12-09T02:45:54.000Z | tools/spaces.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 83 | 2015-02-10T17:18:24.000Z | 2022-02-10T07:16:47.000Z | import maya.cmds as mc
class UserInputError(Exception): pass
class Spaces(object):
def __init__(self):
'''
Initializer for Spaces class object
'''
self.allChannels = ['t','tx','ty','tz','r','rx','ry','rz','s','sx','sy','sz']
self.channels = self.allChannels[0:8]
self.transform = ['transform','joint']
... | 39.809892 | 179 | 0.722561 | import maya.cmds as mc
class UserInputError(Exception): pass
class Spaces(object):
def __init__(self):
'''
Initializer for Spaces class object
'''
self.allChannels = ['t','tx','ty','tz','r','rx','ry','rz','s','sx','sy','sz']
self.channels = self.allChannels[0:8]
self.transform = ['transform','joint']
... | false | true |
f710c7c26ca691b1517407f9a1238bc3759d8852 | 312 | py | Python | tests/urls.py | zonnepanelendelen/django-fsm-log | 28e2469693425efbeaf604f40db836977fbb68ff | [
"MIT"
] | 140 | 2015-01-07T19:12:49.000Z | 2021-08-14T14:17:12.000Z | tests/urls.py | zonnepanelendelen/django-fsm-log | 28e2469693425efbeaf604f40db836977fbb68ff | [
"MIT"
] | 81 | 2015-02-27T13:07:29.000Z | 2022-01-14T11:26:58.000Z | tests/urls.py | kcrebound/django-fsm-log | b2acc23d2a3398f07deacaf0911a763fbc6f4a75 | [
"MIT"
] | 73 | 2015-01-07T17:07:21.000Z | 2021-12-10T07:34:54.000Z | try:
from django.urls import path
from django.contrib import admin
urlpatterns = [path('admin', admin.site.urls)]
except ImportError:
# django < 2.0
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
| 26 | 61 | 0.689103 | try:
from django.urls import path
from django.contrib import admin
urlpatterns = [path('admin', admin.site.urls)]
except ImportError:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
| true | true |
f710c807738df97a99495e8269c1fb300b203df9 | 2,026 | py | Python | tensorflow/python/ipu/keras/layers/recomputation.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/ipu/keras/layers/recomputation.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 9 | 2020-10-13T23:25:29.000Z | 2022-02-10T06:54:48.000Z | tensorflow/python/ipu/keras/layers/recomputation.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.000Z | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.766667 | 80 | 0.71619 |
from tensorflow.python.keras.engine.base_layer import Layer
from tensorflow.python.ipu.ops import pipelining_ops
class RecomputationCheckpoint(Layer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def call(self, inputs, **kwargs):
return pipelining_ops.recomputation_checkpoint(inputs, name=se... | true | true |
f710c8dc0ae9c607360da95e07304279627fd52e | 3,944 | py | Python | pysnmp/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:43:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 ... | 131.466667 | 665 | 0.811359 | ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.impo... | true | true |
f710cd85c0f4915e384055a6b54566ba32288ac7 | 5,447 | py | Python | library/bitcash-master/docs/source/conf.py | Devel484/CryptoPay-Crypto | 76ae0486ea86b5fa121af42c6d0b9efa279b97ee | [
"MIT"
] | 2 | 2020-09-08T22:59:33.000Z | 2020-12-30T06:28:29.000Z | docs/source/conf.py | AlphaGriffin/bitcash | 793e632733b4ea8988b23c7804c00034f9fc0427 | [
"MIT"
] | null | null | null | docs/source/conf.py | AlphaGriffin/bitcash | 793e632733b4ea8988b23c7804c00034f9fc0427 | [
"MIT"
] | 1 | 2020-12-30T06:28:41.000Z | 2020-12-30T06:28:41.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Bitcash documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 20 15:41:44 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | 29.603261 | 79 | 0.679457 |
from bitcash import __version__
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinxcontrib.fulltoc'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'Bitcash'
copyright = '2017, Ofek Lev'
author = 'Ofek Lev'
# |version| and |release|, also... | true | true |
f710cde440c8546e165803127d3fe665e30c7217 | 136 | py | Python | geo_files/geo_networkx.py | floristevito/SEN9120_Advanced_Agent_Based_Modelling | fc45d02f3add05fb5db23c920d6702f1e704ef21 | [
"MIT"
] | null | null | null | geo_files/geo_networkx.py | floristevito/SEN9120_Advanced_Agent_Based_Modelling | fc45d02f3add05fb5db23c920d6702f1e704ef21 | [
"MIT"
] | null | null | null | geo_files/geo_networkx.py | floristevito/SEN9120_Advanced_Agent_Based_Modelling | fc45d02f3add05fb5db23c920d6702f1e704ef21 | [
"MIT"
] | null | null | null | import geopandas as gpd
# Networkx werkt erg traag
gdf = gpd.read_file(r"C:\Users\bruno\Downloads\snelwegen_provincie.geojson")
gdf
| 15.111111 | 76 | 0.779412 | import geopandas as gpd
gdf = gpd.read_file(r"C:\Users\bruno\Downloads\snelwegen_provincie.geojson")
gdf
| true | true |
f710ce94cd50e7263e3201853259575b309288ba | 260 | py | Python | examples/host/status_receiver.py | ci4rail/esp_test_status_report | a54ffc81adb6cd6ffa22f7dc913010154f7ffca0 | [
"Apache-2.0"
] | null | null | null | examples/host/status_receiver.py | ci4rail/esp_test_status_report | a54ffc81adb6cd6ffa22f7dc913010154f7ffca0 | [
"Apache-2.0"
] | 1 | 2021-11-16T14:36:23.000Z | 2021-11-16T14:36:23.000Z | examples/host/status_receiver.py | ci4rail/esp_test_status_report | a54ffc81adb6cd6ffa22f7dc913010154f7ffca0 | [
"Apache-2.0"
] | null | null | null | import socket
import sys
ESP_IP = '192.168.7.1'
PORT = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('try to connect')
sock.connect((ESP_IP, PORT))
print('connected...')
data = sock.recv(255)
print('msg: ', data.decode())
sock.close()
| 18.571429 | 56 | 0.707692 | import socket
import sys
ESP_IP = '192.168.7.1'
PORT = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('try to connect')
sock.connect((ESP_IP, PORT))
print('connected...')
data = sock.recv(255)
print('msg: ', data.decode())
sock.close()
| true | true |
f710cf1996c86a9c50d9c2272c951efd092ad2b2 | 2,288 | py | Python | monasca_api/conf/types.py | MheniMerz/monasca-api | 9c0892a58622082ed8baf81ee2f621cc68f5b42c | [
"Apache-2.0"
] | 50 | 2015-10-18T02:54:52.000Z | 2021-12-05T07:54:08.000Z | monasca_api/conf/types.py | MheniMerz/monasca-api | 9c0892a58622082ed8baf81ee2f621cc68f5b42c | [
"Apache-2.0"
] | 13 | 2015-10-29T12:54:07.000Z | 2021-09-02T06:17:42.000Z | monasca_api/conf/types.py | MheniMerz/monasca-api | 9c0892a58622082ed8baf81ee2f621cc68f5b42c | [
"Apache-2.0"
] | 81 | 2015-10-21T07:43:30.000Z | 2022-01-07T03:35:05.000Z | # Copyright 2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 35.75 | 79 | 0.65035 |
from oslo_config import cfg
from oslo_config import types
from oslo_utils import netutils
class HostAddressPortOpt(cfg.Opt):
def __init__(self, name, **kwargs):
ip_port_type = HostAddressPortType()
super(HostAddressPortOpt, self).__init__(name,
typ... | true | true |
f710cf7c42a883633b27ede44b5fceb415cbf5e8 | 5,101 | py | Python | scripts/Tennis Ball Detection/ball_detection_taskphase.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | 17 | 2020-03-27T10:33:16.000Z | 2021-06-07T10:29:13.000Z | scripts/Tennis_Ball_Detection/ball_detection_taskphase.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | null | null | null | scripts/Tennis_Ball_Detection/ball_detection_taskphase.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | 7 | 2020-03-06T03:53:57.000Z | 2021-01-15T14:31:31.000Z | #!/usr/bin/env python3
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import numpy as np
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(5, 5))
kernel1= cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3, 3))
aratio = 1.0
def nothing(x):
pass
# ********************... | 34.006667 | 125 | 0.53068 | import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import numpy as np
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(5, 5))
kernel1= cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3, 3))
aratio = 1.0
def nothing(x):
pass
def adjust_gamma(image, gamma=1.0):
if ga... | true | true |
f710cf7de401283a510300d327968e38dc598cdc | 3,267 | py | Python | openstack_app/bin/api/routers_stats.py | GSLabDev/openstack-app-for-splunk | 1c479dffed81f8e0eeffe4c1123b5eb293b9bedf | [
"BSD-3-Clause"
] | 2 | 2017-04-03T09:25:56.000Z | 2017-05-19T17:36:39.000Z | openstack_app/bin/api/routers_stats.py | GSLabDev/openstack-app-for-splunk | 1c479dffed81f8e0eeffe4c1123b5eb293b9bedf | [
"BSD-3-Clause"
] | null | null | null | openstack_app/bin/api/routers_stats.py | GSLabDev/openstack-app-for-splunk | 1c479dffed81f8e0eeffe4c1123b5eb293b9bedf | [
"BSD-3-Clause"
] | null | null | null | '''
Openstack App for Splunk
Copyright (c) 2017, Great Software Laboratory Private Limited.
All rights reserved.
Contributor: Vikas Sanap [vikas.sanap@gslab.com], Basant Kumar [basant.kumar@gslab.com]
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the f... | 40.333333 | 118 | 0.734619 | '''
Openstack App for Splunk
Copyright (c) 2017, Great Software Laboratory Private Limited.
All rights reserved.
Contributor: Vikas Sanap [vikas.sanap@gslab.com], Basant Kumar [basant.kumar@gslab.com]
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the f... | false | true |
f710cff3f98e1377242473c9bcc5e0534ef79cd9 | 2,449 | py | Python | glowing/data/glowing/functions/generate_adjust_tags.py | dv-extrarius/dv-datapacks | b03b7f0a02a62ff7d66a60c3c8b7517fac4bc09b | [
"MIT"
] | 3 | 2018-08-30T16:17:09.000Z | 2020-01-13T05:13:08.000Z | glowing/data/glowing/functions/generate_adjust_tags.py | dv-extrarius/dv-datapacks | b03b7f0a02a62ff7d66a60c3c8b7517fac4bc09b | [
"MIT"
] | null | null | null | glowing/data/glowing/functions/generate_adjust_tags.py | dv-extrarius/dv-datapacks | b03b7f0a02a62ff7d66a60c3c8b7517fac4bc09b | [
"MIT"
] | null | null | null | #line = r'''execute if score waveGlowTimer glowTimer matches %s run tag @e[type=!player,type=!dolphin,distance=%s,nbt={Attributes:[{Name:"generic.attackDamage"}]},nbt=!{Glowing: 1b}] add madeGlowing'''
#type=!player,type=!dolphin,distance=16..20,nbt={Attributes:[{Name:"generic.attackDamage"}]},nbt=!{Glowing: 1b}
line =... | 61.225 | 201 | 0.681503 | line = r'''execute if score waveGlowTimer glowTimer matches %s if entity @a[distance=%s] run tag @s add madeGlowing'''
bandDistance = 4
bandDuration = 0
minDistance = 16
maxDistance = 64
timeMod = (3 * bandDistance)
distMod = maxDistance - minDistance
def dotdotspan(start, end):
if start != end:
return "%s.... | true | true |
f710d02252626211a863cd5b3d96abcfce335204 | 6,435 | py | Python | wip/pulumi/helpers.py | 4c74356b41/IaC | 3938519c33c72fc5c0552a5f4dfd894a5952c527 | [
"MIT"
] | 1 | 2020-08-18T06:05:20.000Z | 2020-08-18T06:05:20.000Z | wip/pulumi/helpers.py | 4c74356b41/IaC | 3938519c33c72fc5c0552a5f4dfd894a5952c527 | [
"MIT"
] | null | null | null | wip/pulumi/helpers.py | 4c74356b41/IaC | 3938519c33c72fc5c0552a5f4dfd894a5952c527 | [
"MIT"
] | null | null | null | import os
import re
import secrets
import string
import pulumi
from pulumi import ResourceOptions
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service
from azure.keyvault import KeyVaultClient, KeyVaultAuthentication, KeyVaultId
from azure.common.credentials import ServicePri... | 30.070093 | 424 | 0.56519 | import os
import re
import secrets
import string
import pulumi
from pulumi import ResourceOptions
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service
from azure.keyvault import KeyVaultClient, KeyVaultAuthentication, KeyVaultId
from azure.common.credentials import ServicePri... | true | true |
f710d0ba4867c668f8feb836bbb131e08fa75b00 | 938 | py | Python | sysflags/cli.py | JosiahKerley/flags | e39a46060efeab778d2e5f15550ad3801cce1a55 | [
"MIT"
] | null | null | null | sysflags/cli.py | JosiahKerley/flags | e39a46060efeab778d2e5f15550ad3801cce1a55 | [
"MIT"
] | null | null | null | sysflags/cli.py | JosiahKerley/flags | e39a46060efeab778d2e5f15550ad3801cce1a55 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
from .database import YamlDatabase as DB
from . import utils
def cli():
parser = argparse.ArgumentParser()
parser.add_argument('-S', '--scope', default='directory', help="flag scope")
parser.add_argument('-F', '--output-format', default='yaml', dest='format', help="outp... | 39.083333 | 99 | 0.697228 | import argparse
from .database import YamlDatabase as DB
from . import utils
def cli():
parser = argparse.ArgumentParser()
parser.add_argument('-S', '--scope', default='directory', help="flag scope")
parser.add_argument('-F', '--output-format', default='yaml', dest='format', help="output format")
parser.a... | true | true |
f710d21e432038416b298e6b3a84477228b6564c | 759 | py | Python | spacy_lookups_data/tests/test_da.py | CajuM/spacy-lookups-data | 52d996165f2de57731dbd088493592b1d5dfaaf9 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_da.py | CajuM/spacy-lookups-data | 52d996165f2de57731dbd088493592b1d5dfaaf9 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_da.py | CajuM/spacy-lookups-data | 52d996165f2de57731dbd088493592b1d5dfaaf9 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from spacy.lang.da import Danish
import pytest
@pytest.fixture(scope="session")
def da_nlp():
return Danish()
@pytest.mark.parametrize(
"string,lemma",
[
("affaldsgruppernes", "affaldsgruppe"),
("detailhandelsstrukturernes", "detai... | 23 | 72 | 0.673254 | from __future__ import unicode_literals
from spacy.lang.da import Danish
import pytest
@pytest.fixture(scope="session")
def da_nlp():
return Danish()
@pytest.mark.parametrize(
"string,lemma",
[
("affaldsgruppernes", "affaldsgruppe"),
("detailhandelsstrukturernes", "detailhandelsstruktur... | true | true |
f710d25f24ddec548a668960e642e38c0c271832 | 1,156 | py | Python | var/spack/repos/builtin/packages/libcircle/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-06-25T15:25:29.000Z | 2020-06-25T15:25:29.000Z | var/spack/repos/builtin/packages/libcircle/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/libcircle/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 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 Libcircle(AutotoolsPackage):
"""libcircle provides an efficient distributed queue on a clu... | 39.862069 | 186 | 0.701557 |
from spack import *
class Libcircle(AutotoolsPackage):
homepage = "https://github.com/hpc/libcircle"
git = "https://github.com/hpc/libcircle.git"
url = "https://github.com/hpc/libcircle/releases/download/0.2.1-rc.1/libcircle-0.2.1-rc.1.tar.gz"
version('master', branch='master')
versio... | true | true |
f710d28b750d8653844e380b43142853926905f5 | 6,960 | py | Python | macro_benchmark/Mask_RCNN_PyTorch/maskrcnn_benchmark/config/paths_catalog_dbcluster.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 180 | 2018-09-20T07:27:40.000Z | 2022-03-19T07:55:42.000Z | macro_benchmark/Mask_RCNN_PyTorch/maskrcnn_benchmark/config/paths_catalog_dbcluster.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 80 | 2018-09-26T18:55:56.000Z | 2022-02-10T02:03:26.000Z | macro_benchmark/Mask_RCNN_PyTorch/maskrcnn_benchmark/config/paths_catalog_dbcluster.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 72 | 2018-08-30T00:49:15.000Z | 2022-02-15T23:22:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved.
"""Centralized catalog of paths."""
import os
class DatasetCatalog(object):
DATA_DIR = os.environ['DATA_DIR']
DATASETS = {
"coco_2017_train": {
"img_d... | 39.545455 | 117 | 0.604167 |
import os
class DatasetCatalog(object):
DATA_DIR = os.environ['DATA_DIR']
DATASETS = {
"coco_2017_train": {
"img_dir": "train2017",
"ann_file": "annotations/instances_train2017.json"
},
"coco_2017_val": {
"img_dir": "val2017",
"ann_file"... | true | true |
f710d41f3956bdcf4108ffe790cab0b83a899be7 | 6,249 | py | Python | avod/core/avod_fc_layers/basic_fc_layers.py | AhmedYousriSobhi/avod | 04a8c1edd87811139cbb2318796f0eb226e7c039 | [
"MIT"
] | null | null | null | avod/core/avod_fc_layers/basic_fc_layers.py | AhmedYousriSobhi/avod | 04a8c1edd87811139cbb2318796f0eb226e7c039 | [
"MIT"
] | null | null | null | avod/core/avod_fc_layers/basic_fc_layers.py | AhmedYousriSobhi/avod | 04a8c1edd87811139cbb2318796f0eb226e7c039 | [
"MIT"
] | null | null | null | import tensorflow.compat.v1 as tf
#from tensorflow.contrib import slim
import tf_slim as slim
from avod.core.avod_fc_layers import avod_fc_layer_utils
def build(fc_layers_config,
input_rois, input_weights,
num_final_classes, box_rep,
is_training,
end_points_collection):
"... | 37.872727 | 91 | 0.517843 | import tensorflow.compat.v1 as tf
import tf_slim as slim
from avod.core.avod_fc_layers import avod_fc_layer_utils
def build(fc_layers_config,
input_rois, input_weights,
num_final_classes, box_rep,
is_training,
end_points_collection):
fusion_method = fc_layers_config.... | true | true |
f710d496dd5fcb018569353131c4258483deb47c | 5,937 | py | Python | joints_detectors/Alphapose/yolo/video_demo_half.py | rcourivaud/video-to-pose3D | b908014fe2c531c075c11cee72bb798120f970c2 | [
"MIT"
] | 574 | 2019-07-12T08:35:18.000Z | 2022-03-28T06:37:44.000Z | joints_detectors/Alphapose/yolo/video_demo_half.py | rcourivaud/video-to-pose3D | b908014fe2c531c075c11cee72bb798120f970c2 | [
"MIT"
] | 55 | 2019-07-11T11:31:16.000Z | 2022-03-11T23:54:54.000Z | joints_detectors/Alphapose/yolo/video_demo_half.py | rcourivaud/video-to-pose3D | b908014fe2c531c075c11cee72bb798120f970c2 | [
"MIT"
] | 123 | 2019-09-06T07:08:40.000Z | 2022-03-26T21:50:28.000Z | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from .util import *
from .darknet import Darknet
from .preprocess import prep_image, inp_to_image, letterbox_image
import pandas as pd
import random
import pickle as pkl
im... | 31.247368 | 130 | 0.544551 | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from .util import *
from .darknet import Darknet
from .preprocess import prep_image, inp_to_image, letterbox_image
import pandas as pd
import random
import pickle as pkl
im... | true | true |
f710d4d4c51c7045bd1d12faab81c40a48ed0b78 | 5,382 | py | Python | httpclient.py | YeeSkywalker/CMPUT404-assignment-web-client | 0d1a3d8a3aaaeb30320ed156b085ce5e6f6aaf1e | [
"Apache-2.0"
] | null | null | null | httpclient.py | YeeSkywalker/CMPUT404-assignment-web-client | 0d1a3d8a3aaaeb30320ed156b085ce5e6f6aaf1e | [
"Apache-2.0"
] | null | null | null | httpclient.py | YeeSkywalker/CMPUT404-assignment-web-client | 0d1a3d8a3aaaeb30320ed156b085ce5e6f6aaf1e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 Abram Hindle, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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
#
# ... | 28.17801 | 93 | 0.551839 |
# Write your own HTTP GET and POST
# The point is to understand what you have to send and get experience with it
import sys
import socket
import re
# you may use urllib to encode data appropriately
from urllib.parse import urlparse
def help():
print("httpclient.py [GET/POST] [URL]\n")
class HTTPResponse(object)... | true | true |
f710d56e22dcbfc23572787429824b9582db461d | 43,545 | py | Python | laygo/generators/serdes/des_layout_generator_woM5.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 26 | 2017-07-07T08:06:31.000Z | 2021-11-25T06:41:24.000Z | laygo/generators/serdes/des_layout_generator_woM5.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 9 | 2016-12-28T03:08:29.000Z | 2019-01-30T16:00:28.000Z | laygo/generators/serdes/des_layout_generator_woM5.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 10 | 2018-07-14T01:31:28.000Z | 2021-08-21T10:18:30.000Z | #!/usr/bin/python
########################################################################################################################
#
# Copyright (c) 2014, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permi... | 72.69616 | 195 | 0.578321 |
import laygo
import numpy as np
from math import log
import yaml
import os
def generate_boundary(laygen, objectname_pfix, placement_grid,
devname_bottom, devname_top, devname_left, devname_right,
shape_bottom=None, shape_top=None, shape_left=None, shape_right=None,
... | true | true |
f710d5a412901836e4796796cab79d895bf657b5 | 8,929 | py | Python | healthbuddy_backend/fake_news/tests.py | Asfak06/health-buddy | 1a40a35a95bc4179a44445ed0c0b9dc32360e0bc | [
"MIT"
] | null | null | null | healthbuddy_backend/fake_news/tests.py | Asfak06/health-buddy | 1a40a35a95bc4179a44445ed0c0b9dc32360e0bc | [
"MIT"
] | null | null | null | healthbuddy_backend/fake_news/tests.py | Asfak06/health-buddy | 1a40a35a95bc4179a44445ed0c0b9dc32360e0bc | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.urls import reverse_lazy
from .models import FakeNews
from ..utils.base_test import AuthenticationTestTemplate
class FakeNewsListTestCase(AuthenticationTestTemplate):
def _get_callable_client_method_http(self):
return self._client.get
def _get_... | 36.594262 | 100 | 0.648897 | from django.contrib.auth.models import User
from django.urls import reverse_lazy
from .models import FakeNews
from ..utils.base_test import AuthenticationTestTemplate
class FakeNewsListTestCase(AuthenticationTestTemplate):
def _get_callable_client_method_http(self):
return self._client.get
def _get_... | true | true |
f710d5e5f3aa834fea1af550af11e0df2f6a9ed5 | 1,957 | py | Python | Ronnakornschool/Ronschool.py | plug8955/Ronnakornschool | 94ea8216c83a974a1e904cad612378d970f50e7b | [
"MIT"
] | null | null | null | Ronnakornschool/Ronschool.py | plug8955/Ronnakornschool | 94ea8216c83a974a1e904cad612378d970f50e7b | [
"MIT"
] | null | null | null | Ronnakornschool/Ronschool.py | plug8955/Ronnakornschool | 94ea8216c83a974a1e904cad612378d970f50e7b | [
"MIT"
] | null | null | null | # Ronschool.py
class Student:
def __init__(self,name): # self คือคำพิเศษเพื่อใช้แทนตัวมันเอง / ต้องใส่ทุกฟังชั่นของ class
self.name = name
# student1.name
# self = student1
self.exp = 0
self.lesson = 0
def Hello(self):
print('สวัสดีจ้าาาา ผมชื่อ{}'.format(self.name))
def Coding(self):
... | 23.865854 | 93 | 0.591211 |
class Student:
def __init__(self,name): self.name = name
self.exp = 0
self.lesson = 0
def Hello(self):
print('สวัสดีจ้าาาา ผมชื่อ{}'.format(self.name))
def Coding(self):
print('{}: กำลังเขียนโปรแกรม..'.format(self.name))
self.exp += 5
self.lesson += 1
def ShowEXP(self):
prin... | true | true |
f710d60b379f14a690eba23786aa9f232b64b970 | 423 | py | Python | mspsmc/cli.py | terhorst/mspsmc | e583e196f9ca633bf783023433eed3cff58831b1 | [
"MIT"
] | null | null | null | mspsmc/cli.py | terhorst/mspsmc | e583e196f9ca633bf783023433eed3cff58831b1 | [
"MIT"
] | null | null | null | mspsmc/cli.py | terhorst/mspsmc | e583e196f9ca633bf783023433eed3cff58831b1 | [
"MIT"
] | null | null | null | """Console script for mspsmc."""
import argparse
import sys
def main():
"""Console script for mspsmc."""
parser = argparse.ArgumentParser()
parser.add_argument("_", nargs="*")
args = parser.parse_args()
print("Arguments: " + str(args._))
print("Replace this message by putting your code into "... | 22.263158 | 78 | 0.647754 | import argparse
import sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument("_", nargs="*")
args = parser.parse_args()
print("Arguments: " + str(args._))
print("Replace this message by putting your code into " "mspsmc.cli.main")
return 0
if __name__ == "__main__":
sys.... | true | true |
f710d60d223dd89617b941d4998103be022a0f2f | 2,689 | py | Python | centroids/challenge/ImageGen.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 75 | 2020-07-20T20:54:00.000Z | 2022-03-09T09:18:37.000Z | centroids/challenge/ImageGen.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 3 | 2020-09-13T00:46:49.000Z | 2021-07-06T16:18:22.000Z | centroids/challenge/ImageGen.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 14 | 2020-07-22T16:34:51.000Z | 2021-09-13T12:19:59.000Z | from scipy import signal
from scipy import misc
from scipy import stats as st
import numpy as np
W = 128
L = 128
Body_Width = 3
Border = Body_Width+1
Points = 10
Noise_Max = 10
Body_Separation = 15
Body_Scale = 30
OvScale = 3
def gkern(kernlen=21, nsig=3):
''' 2D Gaussian Kernel. '''
x = np.linspace(-nsig, n... | 30.908046 | 103 | 0.533284 | from scipy import signal
from scipy import misc
from scipy import stats as st
import numpy as np
W = 128
L = 128
Body_Width = 3
Border = Body_Width+1
Points = 10
Noise_Max = 10
Body_Separation = 15
Body_Scale = 30
OvScale = 3
def gkern(kernlen=21, nsig=3):
x = np.linspace(-nsig, nsig, kernlen+1)
kern1d = np.... | true | true |
f710d6aeca2fcb946784031b7aef37d3f0c06494 | 6,234 | py | Python | encord/configs.py | encord-team/cord-client-python | fe7833f1d51db7cc8a2a362e632fc7dcf4ba6e81 | [
"Apache-2.0"
] | null | null | null | encord/configs.py | encord-team/cord-client-python | fe7833f1d51db7cc8a2a362e632fc7dcf4ba6e81 | [
"Apache-2.0"
] | null | null | null | encord/configs.py | encord-team/cord-client-python | fe7833f1d51db7cc8a2a362e632fc7dcf4ba6e81 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 Cord Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.300518 | 114 | 0.694097 | import hashlib
import logging
import os
from abc import ABC, abstractmethod
from pickle import NONE
from typing import Dict, Optional
import cryptography
from cryptography.hazmat.primitives.asymmetric.ed25519 import (
Ed25519PrivateKey,
Ed25519PublicKey,
)
from cryptography.hazmat.primitives.serialization impo... | true | true |
f710d6ff7602b53a29430a9106346782ca0b25c2 | 6,973 | py | Python | lib/spack/spack/schema/modules.py | Nabil-AL/spack | 442d0725fe9726597c7c88274d379c0c994d926b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/schema/modules.py | Nabil-AL/spack | 442d0725fe9726597c7c88274d379c0c994d926b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2022-03-01T02:26:40.000Z | 2022-03-15T02:33:38.000Z | lib/spack/spack/schema/modules.py | Nabil-AL/spack | 442d0725fe9726597c7c88274d379c0c994d926b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 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)
"""Schema for modules.yaml configuration file.
.. literalinclude:: _spack_root/lib/spack/spack/schema/modules.py
:line... | 30.056034 | 83 | 0.514986 |
import spack.schema.environment
import spack.schema.projections
spec_regex = r'(?!hierarchy|core_specs|verbose|hash_length|whitelist|' \
r'blacklist|projections|naming_scheme|core_compilers|all|' \
r'defaults)(^\w[\w-]*)'
set_regex = r'(?!enable|lmod|tcl|dotkit|prefix_inspections)^\w[\w-]*'... | true | true |
f710d79c09a9b0679214160018290771969fcba6 | 8,930 | py | Python | src/watchdog/observers/inotify.py | lukassup/watchdog | db45bb7923e1e0226b741e521890832e216270e2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-02-20T21:22:07.000Z | 2021-02-20T21:22:07.000Z | src/watchdog/observers/inotify.py | lukassup/watchdog | db45bb7923e1e0226b741e521890832e216270e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/watchdog/observers/inotify.py | lukassup/watchdog | db45bb7923e1e0226b741e521890832e216270e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 39.166667 | 107 | 0.676708 |
from __future__ import with_statement
import os
import threading
from .inotify_buffer import InotifyBuffer
from watchdog.observers.api import (
EventEmitter,
BaseObserver,
DEFAULT_EMITTER_TIMEOUT,
DEFAULT_OBSERVER_TIMEOUT
)
from watchdog.events import (
DirDeletedEvent,
DirModifiedEvent,
... | true | true |
f710d8153f1f5aeb27c355a1c1823ae88d30208e | 497 | py | Python | packages/python/plotly/plotly/validators/isosurface/lightposition/_z.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/lightposition/_z.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/lightposition/_z.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="z", parent_name="isosurface.lightposition", **kwargs
):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | 31.0625 | 79 | 0.617706 | import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="z", parent_name="isosurface.lightposition", **kwargs
):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | true | true |
f710d8a784792856aa8454aaa89c6b339c6e43ed | 4,369 | py | Python | datadog_checks_base/tests/base/checks/openmetrics/test_interface.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T22:45:14.000Z | 2021-12-15T22:45:14.000Z | datadog_checks_base/tests/base/checks/openmetrics/test_interface.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/tests/base/checks/openmetrics/test_interface.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.base.constants import ServiceCheck
from datadog_checks.dev.testing import requires_py3
from .utils import get_chec... | 36.714286 | 114 | 0.688487 | import pytest
from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.base.constants import ServiceCheck
from datadog_checks.dev.testing import requires_py3
from .utils import get_check
pytestmark = [requires_py3, pytest.mark.openmetrics, pytest.mark.openmetrics_interface]
def test_default_confi... | true | true |
f710d923ceb89999ceccd02025d68644894d3817 | 16,027 | py | Python | models/Strategy.py | bsda/pycryptobot | 8d0738cc06bef165d335b08ad8597777a229ed81 | [
"Apache-2.0"
] | null | null | null | models/Strategy.py | bsda/pycryptobot | 8d0738cc06bef165d335b08ad8597777a229ed81 | [
"Apache-2.0"
] | null | null | null | models/Strategy.py | bsda/pycryptobot | 8d0738cc06bef165d335b08ad8597777a229ed81 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from pandas import DataFrame
from models.PyCryptoBot import PyCryptoBot
from models.AppState import AppState
from models.helper.LogHelper import Logger
import sys
class Strategy:
def __init__(
self,
app: PyCryptoBot = None,
state: AppState = AppState,
... | 39.670792 | 179 | 0.540525 | from datetime import datetime
from pandas import DataFrame
from models.PyCryptoBot import PyCryptoBot
from models.AppState import AppState
from models.helper.LogHelper import Logger
import sys
class Strategy:
def __init__(
self,
app: PyCryptoBot = None,
state: AppState = AppState,
... | true | true |
f710d9d3bac610cb12378ee562e63296d1c01fe2 | 3,167 | py | Python | byceps/services/shop/order/actions/ticket.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 23 | 2015-08-03T23:28:54.000Z | 2018-12-12T20:11:45.000Z | byceps/services/shop/order/actions/ticket.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 1 | 2018-09-30T18:18:24.000Z | 2018-09-30T18:18:24.000Z | byceps/services/shop/order/actions/ticket.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 9 | 2015-08-06T16:41:36.000Z | 2018-09-25T11:17:31.000Z | """
byceps.services.shop.order.actions.ticket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Any, Sequence
from uuid import UUID
from .....typing import UserID
from ....ticketing.dbmodels.ticket impor... | 28.276786 | 80 | 0.703189 |
from typing import Any, Sequence
from uuid import UUID
from .....typing import UserID
from ....ticketing.dbmodels.ticket import Ticket
from ....ticketing import (
category_service as ticket_category_service,
ticket_creation_service,
ticket_revocation_service,
ticket_service,
)
from ....ticketing.tran... | true | true |
f710da033824699bdb11c30cb57fc8866b1aa4a0 | 19,600 | py | Python | pde/trackers/trackers.py | xuanxu/py-pde | de33d938aea8680eff872ae1b64569895662a248 | [
"MIT"
] | null | null | null | pde/trackers/trackers.py | xuanxu/py-pde | de33d938aea8680eff872ae1b64569895662a248 | [
"MIT"
] | null | null | null | pde/trackers/trackers.py | xuanxu/py-pde | de33d938aea8680eff872ae1b64569895662a248 | [
"MIT"
] | null | null | null | """
Module defining classes for tracking results from simulations.
The trackers defined in this module are:
.. autosummary::
:nosignatures:
CallbackTracker
ProgressTracker
PrintTracker
PlotTracker
DataTracker
SteadyStateTracker
RuntimeTracker
ConsistencyTracker
MaterialConservationTrack... | 35.507246 | 80 | 0.567194 |
from datetime import timedelta
import inspect
import sys
import time
from typing import Callable, Optional, Union, IO, List, Any
import numpy as np
from .base import TrackerBase, InfoDict, FinishedSimulation, Real
from .intervals import IntervalData, RealtimeIntervals
from ..fields.base import FieldBase
from ..fiel... | true | true |
f710dadd1226258b991a79823b61c58c911a15f1 | 11,987 | py | Python | ymir/command/tests/unit/test_tools_ark_data_exporter.py | Zhang-SJ930104/ymir | dd6481be6f229ade4cf8fba64ef44a15357430c4 | [
"Apache-2.0"
] | 64 | 2021-11-15T03:48:00.000Z | 2022-03-25T07:08:46.000Z | ymir/command/tests/unit/test_tools_ark_data_exporter.py | Zhang-SJ930104/ymir | dd6481be6f229ade4cf8fba64ef44a15357430c4 | [
"Apache-2.0"
] | 35 | 2021-11-23T04:14:35.000Z | 2022-03-26T09:03:43.000Z | ymir/command/tests/unit/test_tools_ark_data_exporter.py | Aryalfrat/ymir | d4617ed00ef67a77ab4e1944763f608bface4be6 | [
"Apache-2.0"
] | 57 | 2021-11-11T10:15:40.000Z | 2022-03-29T07:27:54.000Z | import os
import shutil
from typing import List, Tuple
import unittest
from google.protobuf import json_format
from mir.protos import mir_command_pb2 as mirpb
from mir.tools import data_exporter, hash_utils, mir_storage_ops
from tests import utils as test_utils
class TestArkDataExporter(unittest.TestCase):
# li... | 43.908425 | 119 | 0.45858 | import os
import shutil
from typing import List, Tuple
import unittest
from google.protobuf import json_format
from mir.protos import mir_command_pb2 as mirpb
from mir.tools import data_exporter, hash_utils, mir_storage_ops
from tests import utils as test_utils
class TestArkDataExporter(unittest.TestCase):
... | true | true |
f710de29749798d1f874e2fbb0b328d3f88f44de | 5,035 | py | Python | apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | # apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def sitewide_daily_metrics_sync_out_doc_template_values(url_root):
"""
Show documentation about sitewideDailyMetricsSyncOut
"""
required_query_parameter_list = [
... | 48.413462 | 118 | 0.554916 |
def sitewide_daily_metrics_sync_out_doc_template_values(url_root):
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', 'description': 'The unique key provided to any organization using th... | true | true |
f710de970e7fba982966b7b605985bbabc605981 | 447 | py | Python | bibliohub/catalog/urls.py | apjanco/bibliohub | 95da034d2e136bd4ae25a9b6932fd19124dacd9b | [
"MIT"
] | null | null | null | bibliohub/catalog/urls.py | apjanco/bibliohub | 95da034d2e136bd4ae25a9b6932fd19124dacd9b | [
"MIT"
] | null | null | null | bibliohub/catalog/urls.py | apjanco/bibliohub | 95da034d2e136bd4ae25a9b6932fd19124dacd9b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
from .views import SearchResultsView, HomePageView
urlpatterns = [
path('', views.index, name='index'),
# path('books/', views.BookListView.as_view(), name='books'),
path('search/', SearchResultsView.as_view(), name='search_results'),
path('home/', HomePa... | 44.7 | 94 | 0.711409 | from django.urls import path
from . import views
from .views import SearchResultsView, HomePageView
urlpatterns = [
path('', views.index, name='index'),
path('search/', SearchResultsView.as_view(), name='search_results'),
path('home/', HomePageView.as_view(),name='home'),
] | true | true |
f710e12932440d3e0decd6e77f4a75490177b6e2 | 14,465 | py | Python | pgmpy/readwrite/XMLBIF.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:30:57.000Z | 2016-08-27T18:30:57.000Z | pgmpy/readwrite/XMLBIF.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | null | null | null | pgmpy/readwrite/XMLBIF.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:31:00.000Z | 2016-08-27T18:31:00.000Z | #!/usr/bin/env python
try:
from lxml import etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
#try:
# import xml.etree.cElementTree as etree
# commented out because xml.etree.cElementTree is giving errors with dictionary attribute... | 35.109223 | 117 | 0.55382 |
try:
from lxml import etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
print("Failed to import ElementTree from any known place")
import numpy as np
from pgmpy.models import BayesianModel
from pgmpy.factors import Tab... | true | true |
f710e191022a1dfd9848a7665725db9fc3dd3f11 | 1,818 | py | Python | dev.py | pkeilbach/pyredis | 3bc019e8e366ab1c4705dba5254a852476069e46 | [
"MIT"
] | 3 | 2021-04-15T16:48:07.000Z | 2021-08-17T10:58:37.000Z | dev.py | pkeilbach/pyredis | 3bc019e8e366ab1c4705dba5254a852476069e46 | [
"MIT"
] | null | null | null | dev.py | pkeilbach/pyredis | 3bc019e8e366ab1c4705dba5254a852476069e46 | [
"MIT"
] | null | null | null | from pyredis import RedisConnection
from pprint import pprint
# 1. Object Creation
# pass everything you would pass to redis.Redis()
redis_args = {
'host': 'localhost',
# 'password': 'redis1234',
# 'port': 1234,
}
with RedisConnection(**redis_args) as my_redis:
my_redis.set('key', 'value')
# 2. Red... | 30.3 | 85 | 0.689769 | from pyredis import RedisConnection
from pprint import pprint
redis_args = {
'host': 'localhost',
}
with RedisConnection(**redis_args) as my_redis:
my_redis.set('key', 'value')
with RedisConnection(**redis_args) as my_redis:
my_redis.set('a_sting', 'my_sting value')
my_redis.set('a_list', [... | true | true |
f710e20958dad9de518259a06788cf29354580c5 | 2,293 | py | Python | UVa 10020 - Minimal Coverage/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2020-11-24T03:17:21.000Z | 2020-11-24T03:17:21.000Z | UVa 10020 - Minimal Coverage/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | null | null | null | UVa 10020 - Minimal Coverage/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2021-04-11T16:22:31.000Z | 2021-04-11T16:22:31.000Z | '''
Created on Jul 17, 2013
@author: Yubin Bai
'''
import time
from multiprocessing.pool import Pool
parallelSolve = False
INF = 1 << 31
def solve(par):
M, pairs = par
pairs.sort()
pairs1 = []
for p in pairs:
if p[0] >= M or p[1] <= 0:
continue
pairs1.append(tuple(p))
i... | 26.356322 | 64 | 0.516354 | import time
from multiprocessing.pool import Pool
parallelSolve = False
INF = 1 << 31
def solve(par):
M, pairs = par
pairs.sort()
pairs1 = []
for p in pairs:
if p[0] >= M or p[1] <= 0:
continue
pairs1.append(tuple(p))
if not pairs1:
return 0
pairs = [pairs1[... | true | true |
f710e3fc0e09880ad2d7a75f9ac3339aa1d05698 | 3,765 | py | Python | StandardDataSets/collada/library_effects/effect/image/singleImage/singleImage.py | KhronosGroup/COLLADA-CTS | 61f2a560cbb2a06ee62da8025241f6b08d06bfd9 | [
"MIT"
] | 20 | 2015-03-19T08:02:57.000Z | 2020-10-16T15:16:11.000Z | StandardDataSets/collada/library_effects/effect/profile_COMMON/image/oneImageDiffDir/oneImageDiffDir.py | Acidburn0zzz/COLLADA-CTS | 39a36188cf8710bbc003df43ed70b965eb4386bd | [
"MIT"
] | 4 | 2017-04-19T18:42:05.000Z | 2017-06-17T03:03:28.000Z | StandardDataSets/collada/library_effects/effect/profile_COMMON/image/oneImageDiffDir/oneImageDiffDir.py | Acidburn0zzz/COLLADA-CTS | 39a36188cf8710bbc003df43ed70b965eb4386bd | [
"MIT"
] | 10 | 2015-03-26T02:52:24.000Z | 2022-02-24T08:43:48.000Z |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | 53.785714 | 467 | 0.728818 |
from StandardDataSets.scripts import JudgeAssistant
tagLst = []
attrName = ''
attrVal = ''
dataToCheck = ''
class SimpleJudgingObject:
def __init__(self, _tagLst, _attrName, _attrVal, _data):
self.tagList = _tagLst
self.attrName = _attrName
self.attrVal = _attrVal
... | true | true |
f710e48f87b066661c04bad6f9ccc2417d946d9c | 10,349 | py | Python | matmul.py | peterwauligmann/sparse_mm | 344c06c183854f72224c1e88ad2ced2e092d4efb | [
"BSD-3-Clause"
] | null | null | null | matmul.py | peterwauligmann/sparse_mm | 344c06c183854f72224c1e88ad2ced2e092d4efb | [
"BSD-3-Clause"
] | null | null | null | matmul.py | peterwauligmann/sparse_mm | 344c06c183854f72224c1e88ad2ced2e092d4efb | [
"BSD-3-Clause"
] | 2 | 2020-12-09T12:46:58.000Z | 2021-07-13T10:56:44.000Z | from typing import Tuple
from codegen.ast import *
from codegen.sugar import *
from codegen.forms import *
from codegen.precision import *
import scripts.old_arm
import scripts.max_bn_knl
from cursors import *
import architecture
import numpy
def decompose_pattern(k, n, pattern:Matrix[bool], bk:int, bn:int) -> Tup... | 35.320819 | 240 | 0.527684 | from typing import Tuple
from codegen.ast import *
from codegen.sugar import *
from codegen.forms import *
from codegen.precision import *
import scripts.old_arm
import scripts.max_bn_knl
from cursors import *
import architecture
import numpy
def decompose_pattern(k, n, pattern:Matrix[bool], bk:int, bn:int) -> Tup... | true | true |
f710e546a33ec5507341c5a48dd231538f0e973b | 3,393 | py | Python | sdk/communication/azure-communication-administration/tests/test_communication_identity_client_async.py | ljos/azure-sdk-for-python | f64b1e269fc4f05a5a2ca68dda3c8f8b4ed0301e | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/communication/azure-communication-administration/tests/test_communication_identity_client_async.py | ljos/azure-sdk-for-python | f64b1e269fc4f05a5a2ca68dda3c8f8b4ed0301e | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-administration/tests/test_communication_identity_client_async.py | ljos/azure-sdk-for-python | f64b1e269fc4f05a5a2ca68dda3c8f8b4ed0301e | [
"MIT"
] | null | null | null | # 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.
# ---------------------------------------------------------------------... | 44.644737 | 95 | 0.736516 | import pytest
from azure.communication.administration.aio import CommunicationIdentityClient
from azure_devtools.scenario_tests import RecordingProcessor
from devtools_testutils import ResourceGroupPreparer
from _shared.helper import URIIdentityReplacer
from _shared.asynctestcase import AsyncCommunicationTestCase
from... | true | true |
f710e55ac5e0fd15213c1588668531cca7d3d44b | 3,815 | py | Python | dy-get.py | 1A2553E/dy-get | fd66a9132e592b5c8f033e37e57ed2ad3dc9207c | [
"Apache-2.0"
] | null | null | null | dy-get.py | 1A2553E/dy-get | fd66a9132e592b5c8f033e37e57ed2ad3dc9207c | [
"Apache-2.0"
] | null | null | null | dy-get.py | 1A2553E/dy-get | fd66a9132e592b5c8f033e37e57ed2ad3dc9207c | [
"Apache-2.0"
] | null | null | null | from moviepy.editor import *
from os import chdir, getcwd, mkdir
from random import randint
import sys
import requests
from concurrent.futures import ThreadPoolExecutor
from requests import get, head
import time
# 自定义
THREAD_NUM=12 # 线程数,默认为12个
HEADER=" "# 请求头,默认为一个空格
class downloader:
def __init__(self, url, nu... | 28.470149 | 100 | 0.597641 | from moviepy.editor import *
from os import chdir, getcwd, mkdir
from random import randint
import sys
import requests
from concurrent.futures import ThreadPoolExecutor
from requests import get, head
import time
THREAD_NUM=12 HEADER=" "
class downloader:
def __init__(self, url, num, name):
self.url = url
... | true | true |
f710e59b79ce144a6b83f278253f4474c45ed44c | 1,067 | py | Python | piquasso/_math/permanent.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | 12 | 2021-09-12T15:51:45.000Z | 2022-03-05T22:25:47.000Z | piquasso/_math/permanent.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | 36 | 2021-09-13T08:01:27.000Z | 2022-03-21T11:53:30.000Z | piquasso/_math/permanent.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2021 Budapest Quantum Computing Group
#
# 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... | 33.34375 | 114 | 0.774133 |
from theboss.boson_sampling_utilities.permanent_calculators.glynn_gray_permanent_calculator import ( GlynnGrayPermanentCalculator,
)
def _permanent(matrix, rows, columns, calculator_class):
calculator = calculator_class(matrix, rows, columns)
return calculator.compute_permanent()
def glynn_gray_perm... | true | true |
f710e5daa7c9cafa194bdd85305f0273e762ebd7 | 5,647 | py | Python | pipeline/recon/helpers.py | ponderng/recon-pipeline | 11d09902c54969af47731b8e235e447806246004 | [
"MIT"
] | null | null | null | pipeline/recon/helpers.py | ponderng/recon-pipeline | 11d09902c54969af47731b8e235e447806246004 | [
"MIT"
] | null | null | null | pipeline/recon/helpers.py | ponderng/recon-pipeline | 11d09902c54969af47731b8e235e447806246004 | [
"MIT"
] | null | null | null | import sys
import pickle
import typing
import inspect
import pkgutil
import importlib
import ipaddress
import json
import re
from pathlib import Path
from cmd2.ansi import style
from collections import defaultdict
from ..recon.config import defaults
def meets_requirements(requirements, exception):
""" Determine... | 38.155405 | 129 | 0.613777 | import sys
import pickle
import typing
import inspect
import pkgutil
import importlib
import ipaddress
import json
import re
from pathlib import Path
from cmd2.ansi import style
from collections import defaultdict
from ..recon.config import defaults
def meets_requirements(requirements, exception):
tools = get_t... | true | true |
f710e627aa4d7866c5fe99d277395b7e63de88da | 2,126 | py | Python | tests/test_decorators.py | matibek/request_limiter | 56d8208d48a7d4a825de170c79b58ae5006101dc | [
"MIT"
] | 1 | 2020-01-21T08:46:37.000Z | 2020-01-21T08:46:37.000Z | tests/test_decorators.py | matibek/request_limiter | 56d8208d48a7d4a825de170c79b58ae5006101dc | [
"MIT"
] | 5 | 2020-06-05T20:29:43.000Z | 2021-06-04T22:17:55.000Z | tests/test_decorators.py | matibek/request_limiter | 56d8208d48a7d4a825de170c79b58ae5006101dc | [
"MIT"
] | null | null | null | import os
import unittest
from typing import Optional
from django.http import HttpResponse
from django.test import RequestFactory
from request_limiter import request_limiter, LimitedIntervalStrategy, \
LimitStrategy, LimitException, django_request_limiter
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_set... | 31.264706 | 78 | 0.707902 | import os
import unittest
from typing import Optional
from django.http import HttpResponse
from django.test import RequestFactory
from request_limiter import request_limiter, LimitedIntervalStrategy, \
LimitStrategy, LimitException, django_request_limiter
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_set... | true | true |
f710e635254e2e0650c360f0940bd529576ce4a8 | 2,098 | py | Python | siliconcompiler/targets/freepdk45_demo.py | siliconcompiler/siliconcompiler | 6aa2b53441608f228bd520b68c0324fc9cf96377 | [
"Apache-2.0"
] | 424 | 2021-12-04T15:45:12.000Z | 2022-03-31T20:27:55.000Z | siliconcompiler/targets/freepdk45_demo.py | siliconcompiler/siliconcompiler | 6aa2b53441608f228bd520b68c0324fc9cf96377 | [
"Apache-2.0"
] | 105 | 2021-12-03T21:25:29.000Z | 2022-03-31T22:36:59.000Z | siliconcompiler/targets/freepdk45_demo.py | siliconcompiler/siliconcompiler | 6aa2b53441608f228bd520b68c0324fc9cf96377 | [
"Apache-2.0"
] | 38 | 2021-12-04T21:26:20.000Z | 2022-03-21T02:39:29.000Z | import siliconcompiler
############################################################################
# DOCS
############################################################################
def make_docs():
'''
Demonstration target for compiling ASICs with FreePDK45 and the open-source
asicflow.
'''
ch... | 27.973333 | 79 | 0.521926 | import siliconcompiler
def make_docs():
chip = siliconcompiler.Chip('<design>')
setup(chip)
return chip
def setup(chip):
chip.set('option', 'target', 'freepdk45_demo')
chip.set('option', 'mode','asic')
chip.load_pdk('freepdk45')
chip.load_flow('lintflow')
chip.load_f... | true | true |
f710e6c669d322132e2dcb4843a6941ea5ad37e6 | 692 | py | Python | docs/src/path_operation_configuration/tutorial005.py | kabirkhan/fastapi | 9ca72f4ea1fc6f04b7d8d4e2f3c4d7da5f6c322e | [
"MIT"
] | 3 | 2019-03-15T02:44:48.000Z | 2020-03-14T15:42:52.000Z | docs/src/path_operation_configuration/tutorial005.py | kabirkhan/fastapi | 9ca72f4ea1fc6f04b7d8d4e2f3c4d7da5f6c322e | [
"MIT"
] | null | null | null | docs/src/path_operation_configuration/tutorial005.py | kabirkhan/fastapi | 9ca72f4ea1fc6f04b7d8d4e2f3c4d7da5f6c322e | [
"MIT"
] | null | null | null | from typing import Set
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
description: str = None
price: float
tax: float = None
tags: Set[str] = []
@app.post(
"/items/",
response_model=Item,
summary="Create an item",
res... | 20.352941 | 58 | 0.648844 | from typing import Set
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
description: str = None
price: float
tax: float = None
tags: Set[str] = []
@app.post(
"/items/",
response_model=Item,
summary="Create an item",
res... | true | true |
f710e71139bfd217a3c3797b5fac1bf60fb7b9ba | 2,446 | py | Python | util/flowerapiclient.py | E-ARK-Software/earkweb | 6b30abf776950bbfffcf4a5a75d10d869a386941 | [
"MIT"
] | 4 | 2019-12-19T17:17:42.000Z | 2021-12-11T23:12:45.000Z | util/flowerapiclient.py | E-ARK-Software/earkweb | 6b30abf776950bbfffcf4a5a75d10d869a386941 | [
"MIT"
] | 32 | 2020-03-19T15:56:05.000Z | 2021-12-23T12:46:06.000Z | util/flowerapiclient.py | E-ARK-Software/earkweb | 6b30abf776950bbfffcf4a5a75d10d869a386941 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=UTF-8
import requests
import json
import datetime
from config.configuration import flower_path, flower_port, flower_server_external, verify_certificate, \
flower_server_internal
def get_task_info(task_id):
flower_request_url = 'http://%s:%s%sapi/tasks' % (flower_server_interna... | 34.450704 | 109 | 0.650859 | import requests
import json
import datetime
from config.configuration import flower_path, flower_port, flower_server_external, verify_certificate, \
flower_server_internal
def get_task_info(task_id):
flower_request_url = 'http://%s:%s%sapi/tasks' % (flower_server_internal, flower_port, flower_path)
prin... | true | true |
f710e73434b5020f06243314999148df6c19f73a | 6,783 | py | Python | celery/tests/test_app/test_log.py | amplify-education/celery | 3ea8824d9bdb6c5928701cf8466287d4259aa0e0 | [
"BSD-3-Clause"
] | null | null | null | celery/tests/test_app/test_log.py | amplify-education/celery | 3ea8824d9bdb6c5928701cf8466287d4259aa0e0 | [
"BSD-3-Clause"
] | null | null | null | celery/tests/test_app/test_log.py | amplify-education/celery | 3ea8824d9bdb6c5928701cf8466287d4259aa0e0 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import with_statement
import sys
import logging
from tempfile import mktemp
from celery import log
from celery.log import (setup_logger, setup_task_logger,
get_default_logger, get_task_logger,
redirect_stdouts_to_lo... | 35.7 | 74 | 0.606959 | from __future__ import absolute_import
from __future__ import with_statement
import sys
import logging
from tempfile import mktemp
from celery import log
from celery.log import (setup_logger, setup_task_logger,
get_default_logger, get_task_logger,
redirect_stdouts_to_lo... | true | true |
f710e7cc0a55f576ed3976d40a305404c5bb7c1a | 290 | py | Python | app/handlers/housekeeping/edit_group.py | jamestiotio/wthslack | 4ada5e2354bfd9ffd46731abe35b65ef8a09d4f1 | [
"MIT"
] | 2 | 2020-07-10T21:06:53.000Z | 2020-10-27T17:05:05.000Z | app/handlers/housekeeping/edit_group.py | wthdevelopers/wthslack | f6566e35b5455fcdfb12d9b33d65843b67aff17c | [
"MIT"
] | 7 | 2020-02-09T12:08:00.000Z | 2021-06-27T16:51:29.000Z | app/handlers/housekeeping/edit_group.py | jamestiotio/wthslack | 4ada5e2354bfd9ffd46731abe35b65ef8a09d4f1 | [
"MIT"
] | 2 | 2020-02-07T15:35:24.000Z | 2020-02-07T17:28:50.000Z | # coding: utf-8
# Modify a specific group entry in database
# Created by James Raphael Tiovalen (2021)
import slack
import ast
import settings
import config
from slackers.hooks import commands
conv_db = config.conv_handler
@commands.on("editgroup")
def editgroup(payload):
return
| 15.263158 | 43 | 0.772414 |
import slack
import ast
import settings
import config
from slackers.hooks import commands
conv_db = config.conv_handler
@commands.on("editgroup")
def editgroup(payload):
return
| true | true |
f710e823f2a52468b6bf8b0468de4cc58fdfd2fd | 2,720 | py | Python | demo_odometry.py | SimonsRoad/UnDeepVO | 956598958e0dba4729a8af70ee7a4cdcc10f09ec | [
"MIT"
] | 1 | 2018-07-16T12:15:29.000Z | 2018-07-16T12:15:29.000Z | demo_odometry.py | SimonsRoad/UnDeepVO | 956598958e0dba4729a8af70ee7a4cdcc10f09ec | [
"MIT"
] | null | null | null | demo_odometry.py | SimonsRoad/UnDeepVO | 956598958e0dba4729a8af70ee7a4cdcc10f09ec | [
"MIT"
] | 1 | 2018-10-15T12:39:51.000Z | 2018-10-15T12:39:51.000Z |
"""Example of pykitti.odometry usage."""
import itertools
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import pykitti
__author__ = "Lee Clement"
__email__ = "lee.clement@robotics.utias.utoronto.ca"
# Change this to the directory where you store KITTI data
basedir = './d... | 33.170732 | 77 | 0.711397 |
import itertools
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import pykitti
__author__ = "Lee Clement"
__email__ = "lee.clement@robotics.utias.utoronto.ca"
basedir = './data/dataset'
sequence = '01'
dataset = pykitti.odometry(basedir, sequence, frames=range(0, 20, 5)... | true | true |
f710e91c291039791cd1d0ecd77934ed50435b77 | 3,460 | py | Python | gaussian_detection/data/dataset/CurrentDateset.py | PKQ1688/text_detection | e306b003f2e8eb9f8d07fc95d2d9def14fa8b38c | [
"Apache-2.0"
] | null | null | null | gaussian_detection/data/dataset/CurrentDateset.py | PKQ1688/text_detection | e306b003f2e8eb9f8d07fc95d2d9def14fa8b38c | [
"Apache-2.0"
] | null | null | null | gaussian_detection/data/dataset/CurrentDateset.py | PKQ1688/text_detection | e306b003f2e8eb9f8d07fc95d2d9def14fa8b38c | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @author :adolf
import os
from data.data_utils import order_points_clockwise
from data.data_aug import *
from data.make_labels import *
class CurrentOcrData(object):
def __init__(self, root, pre_processes=None, transforms=None, filter_keys=None, ignore_tags=None, is_training=True):
... | 34.257426 | 120 | 0.551156 | import os
from data.data_utils import order_points_clockwise
from data.data_aug import *
from data.make_labels import *
class CurrentOcrData(object):
def __init__(self, root, pre_processes=None, transforms=None, filter_keys=None, ignore_tags=None, is_training=True):
self.is_training = is_training
... | true | true |
f710e9b2e374ff122b8766f60cdbc6d0288bae13 | 3,156 | py | Python | leetcode/117_populate_next_right_pointer_in_each_node_2.py | yatao91/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | 3 | 2021-05-25T16:58:52.000Z | 2022-02-05T09:37:17.000Z | leetcode/117_populate_next_right_pointer_in_each_node_2.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | leetcode/117_populate_next_right_pointer_in_each_node_2.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
二叉树:填充每个节点的下一个右侧节点指针2
https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node-ii/
"""
class Node:
def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None):
self.val = val
self.left = left
self.right = ... | 30.057143 | 101 | 0.560837 |
class Node:
def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None):
self.val = val
self.left = left
self.right = right
self.next = next
class Solution:
def processChild(self, childNode: 'Node', prev: 'Node', leftmost: 'Node') -> tuple... | true | true |
f710e9f366623389796c8dc337338647dd2f4046 | 1,251 | py | Python | tests/test_list.py | turbocat2001/tinypy | 843b45b3675bc290d27cf50fedc05373ff2ae62e | [
"PSF-2.0"
] | 17 | 2019-10-07T15:54:01.000Z | 2022-01-20T06:33:16.000Z | tests/test_list.py | turbocat2001/tinypy | 843b45b3675bc290d27cf50fedc05373ff2ae62e | [
"PSF-2.0"
] | 24 | 2019-02-16T07:49:31.000Z | 2021-05-31T07:16:45.000Z | tests/test_list.py | turbocat2001/tinypy | 843b45b3675bc290d27cf50fedc05373ff2ae62e | [
"PSF-2.0"
] | 4 | 2020-11-24T23:03:02.000Z | 2021-05-30T03:34:02.000Z | from tinypy.runtime.testing import UnitTest
class MyTest(UnitTest):
def test_lessthan(self):
assert [1, 2] < [2]
assert [1, 2] <= [2]
assert [1] < [2]
assert [1] <= [2]
assert [] < [1]
def test_greaterthan(self):
assert [2] > [1]
assert [1, 2] > [1]
... | 25.530612 | 64 | 0.460432 | from tinypy.runtime.testing import UnitTest
class MyTest(UnitTest):
def test_lessthan(self):
assert [1, 2] < [2]
assert [1, 2] <= [2]
assert [1] < [2]
assert [1] <= [2]
assert [] < [1]
def test_greaterthan(self):
assert [2] > [1]
assert [1, 2] > [1]
... | true | true |
f710ea07fd04d18c044bb23dbadb145eeb1689c0 | 420 | py | Python | store/migrations/0009_alter_product_images.py | falconsoft3d/clientportal_shop | bc09eda46cb42bbc490dfc6d958250ec000073b5 | [
"MIT"
] | 5 | 2022-03-14T21:15:20.000Z | 2022-03-22T10:11:58.000Z | store/migrations/0009_alter_product_images.py | falconsoft3d/clientportal_shop | bc09eda46cb42bbc490dfc6d958250ec000073b5 | [
"MIT"
] | null | null | null | store/migrations/0009_alter_product_images.py | falconsoft3d/clientportal_shop | bc09eda46cb42bbc490dfc6d958250ec000073b5 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2022-03-24 15:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0008_alter_product_product_name'),
]
operations = [
migrations.AlterField(
model_name='product',
name='imag... | 22.105263 | 77 | 0.616667 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0008_alter_product_product_name'),
]
operations = [
migrations.AlterField(
model_name='product',
name='images',
field=models.ImageField(blank=T... | true | true |
f710eb511746bae3875a98aa7276b03dcf488041 | 1,523 | py | Python | django_extensions/management/commands/clean_pyc.py | KazakovDenis/django-extensions | ef3b3abe3c3d6563b73633bd25e3ff3ac9716661 | [
"MIT"
] | 4,057 | 2015-01-01T17:56:25.000Z | 2022-03-31T16:32:40.000Z | django_extensions/management/commands/clean_pyc.py | KazakovDenis/django-extensions | ef3b3abe3c3d6563b73633bd25e3ff3ac9716661 | [
"MIT"
] | 1,115 | 2015-01-01T14:59:38.000Z | 2022-03-28T22:05:55.000Z | django_extensions/management/commands/clean_pyc.py | KazakovDenis/django-extensions | ef3b3abe3c3d6563b73633bd25e3ff3ac9716661 | [
"MIT"
] | 951 | 2015-01-02T16:57:26.000Z | 2022-03-28T21:42:22.000Z | # -*- coding: utf-8 -*-
import fnmatch
import os
from os.path import join as _j
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_extensions.management.utils import signalcommand
class Command(BaseCommand):
help = "Removes all python bytecode compiled... | 33.108696 | 95 | 0.620486 | import fnmatch
import os
from os.path import join as _j
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_extensions.management.utils import signalcommand
class Command(BaseCommand):
help = "Removes all python bytecode compiled files from the project.... | true | true |
f710ebce031db7b1fee12609e6116bfb2c72f855 | 411 | py | Python | dcctools/freqs_of_matching_projs.py | NACHC-CAD/linkage-agent-tools | 324299e534bc55bd652eb670feb195ce5646f13e | [
"Apache-2.0"
] | null | null | null | dcctools/freqs_of_matching_projs.py | NACHC-CAD/linkage-agent-tools | 324299e534bc55bd652eb670feb195ce5646f13e | [
"Apache-2.0"
] | 1 | 2021-10-01T15:13:15.000Z | 2021-10-01T15:13:15.000Z | dcctools/freqs_of_matching_projs.py | NACHC-CAD/linkage-agent-tools | 324299e534bc55bd652eb670feb195ce5646f13e | [
"Apache-2.0"
] | null | null | null | from config import Configuration
from pymongo import MongoClient
c = Configuration("config.json")
client = MongoClient(c.mongo_uri)
database = client.linkage_agent
results = database.match_groups.aggregate(
[
{
"$group": {
"_id": {"$size": "$run_results"},
"tota... | 19.571429 | 49 | 0.564477 | from config import Configuration
from pymongo import MongoClient
c = Configuration("config.json")
client = MongoClient(c.mongo_uri)
database = client.linkage_agent
results = database.match_groups.aggregate(
[
{
"$group": {
"_id": {"$size": "$run_results"},
"tota... | true | true |
f710ebfe96225e5ddcad7a7dd3bcf159cbd86425 | 2,814 | py | Python | tests/test_test_functions.py | thouska/SALib | fd64136192f00a9e3e65a8c5c05e30d93ed5e750 | [
"MIT"
] | 2 | 2019-02-01T17:24:38.000Z | 2019-02-01T17:30:43.000Z | tests/test_test_functions.py | penghuz/SALib | 5deeaf316ef58ea0a26295c8ad2ca57cdc739d45 | [
"MIT"
] | 3 | 2018-11-06T11:13:43.000Z | 2018-11-16T15:48:44.000Z | tests/test_test_functions.py | penghuz/SALib | 5deeaf316ef58ea0a26295c8ad2ca57cdc739d45 | [
"MIT"
] | 2 | 2019-09-22T05:30:21.000Z | 2021-12-02T03:15:31.000Z | from nose.tools import assert_almost_equal, assert_equal, raises
from numpy.testing import assert_allclose
import numpy as np
from SALib.test_functions.Sobol_G import evaluate, total_variance, \
partial_first_order_variance, \
sensitivity_index... | 28.714286 | 85 | 0.641436 | from nose.tools import assert_almost_equal, assert_equal, raises
from numpy.testing import assert_allclose
import numpy as np
from SALib.test_functions.Sobol_G import evaluate, total_variance, \
partial_first_order_variance, \
sensitivity_index... | true | true |
f710ec229ca894ca35d13cd7b05863a50af3e4d5 | 1,129 | py | Python | azext_iot/sdk/iothub/service/models/digital_twin_interfaces_patch_interfaces_value.py | YingXue/azure-iot-cli-extension | efe7897b1ae1d2a9953f501abe7654b84d69372d | [
"MIT"
] | null | null | null | azext_iot/sdk/iothub/service/models/digital_twin_interfaces_patch_interfaces_value.py | YingXue/azure-iot-cli-extension | efe7897b1ae1d2a9953f501abe7654b84d69372d | [
"MIT"
] | null | null | null | azext_iot/sdk/iothub/service/models/digital_twin_interfaces_patch_interfaces_value.py | YingXue/azure-iot-cli-extension | efe7897b1ae1d2a9953f501abe7654b84d69372d | [
"MIT"
] | null | null | null | # 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 ... | 37.633333 | 114 | 0.649247 |
from msrest.serialization import Model
class DigitalTwinInterfacesPatchInterfacesValue(Model):
_attribute_map = {
'properties': {'key': 'properties', 'type': '{DigitalTwinInterfacesPatchInterfacesValuePropertiesValue}'},
}
def __init__(self, **kwargs):
super(DigitalTwinInterfacesPatchIn... | true | true |
f710ee9b7dec0a3ac267c1d7e46c767a086a4ec8 | 1,450 | py | Python | proselint/checks/consistency/spelling.py | ankita240796/proselint | 50d2a482df8f467737f9c958ace98ba152bec832 | [
"BSD-3-Clause"
] | 4,163 | 2015-10-03T07:37:21.000Z | 2022-03-31T03:52:32.000Z | proselint/checks/consistency/spelling.py | ankita240796/proselint | 50d2a482df8f467737f9c958ace98ba152bec832 | [
"BSD-3-Clause"
] | 878 | 2015-09-30T20:03:33.000Z | 2022-03-28T11:06:15.000Z | proselint/checks/consistency/spelling.py | ankita240796/proselint | 50d2a482df8f467737f9c958ace98ba152bec832 | [
"BSD-3-Clause"
] | 249 | 2015-10-04T12:21:27.000Z | 2022-02-28T22:13:11.000Z | """Inconsistent spelling.
---
layout: post
source: Intelligent Editing Ltd.
source_url: http://bit.ly/1x3hYj7
title: Inconsistent spelling
date: 2014-06-10 12:31:19
categories: writing
---
Intelligent Editing Ltd. says:
> Some words have more than one correct spelling. American, British, Australia... | 30.208333 | 79 | 0.648276 | from proselint.tools import consistency_check, memoize
@memoize
def check(text):
err = "consistency.spelling"
msg = "Inconsistent spelling of '{}' (vs. '{}')."
word_pairs = [
["advisor", "adviser"],
["centre", "center"],
["colour", "color"],
["emphasise", "emphasiz... | true | true |
f710eef1eb36847687f68491ed5a96826bf349fb | 318 | py | Python | setup.py | allenai/manipulathor | 4562eb8c2f67ff67e5b9ba3930da84b6023a58a4 | [
"MIT"
] | 55 | 2021-04-20T03:51:25.000Z | 2022-03-30T02:30:53.000Z | setup.py | allenai/manipulathor | 4562eb8c2f67ff67e5b9ba3930da84b6023a58a4 | [
"MIT"
] | 7 | 2021-04-28T17:35:02.000Z | 2021-08-24T09:37:14.000Z | setup.py | allenai/manipulathor | 4562eb8c2f67ff67e5b9ba3930da84b6023a58a4 | [
"MIT"
] | 10 | 2021-04-23T00:56:39.000Z | 2022-02-22T08:28:33.000Z | from setuptools import find_packages, setup
if __name__ == "__main__":
setup(
name="manipulathor",
packages=find_packages(),
version="0.0.1",
install_requires=[
"allenact==0.2.2",
"allenact_plugins[ithor]==0.2.2",
"setuptools",
],
)
| 22.714286 | 45 | 0.531447 | from setuptools import find_packages, setup
if __name__ == "__main__":
setup(
name="manipulathor",
packages=find_packages(),
version="0.0.1",
install_requires=[
"allenact==0.2.2",
"allenact_plugins[ithor]==0.2.2",
"setuptools",
],
)
| true | true |
f710efea21dad3a91fd998d1e0b0dc08ee754d47 | 9,973 | py | Python | src/nft_analytics.py | dineshpinto/nft_analytics | 99fd4adbfe786f4de6fa2a6a0c5e8a58eaaf338a | [
"MIT"
] | 6 | 2022-01-09T05:04:07.000Z | 2022-03-03T20:26:27.000Z | src/nft_analytics.py | dineshpinto/nft-analytics | 99fd4adbfe786f4de6fa2a6a0c5e8a58eaaf338a | [
"MIT"
] | null | null | null | src/nft_analytics.py | dineshpinto/nft-analytics | 99fd4adbfe786f4de6fa2a6a0c5e8a58eaaf338a | [
"MIT"
] | 1 | 2022-02-09T04:58:51.000Z | 2022-02-09T04:58:51.000Z | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2021 Dinesh Pinto
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... | 39.418972 | 108 | 0.620475 |
import json
import logging
import os
import sys
from json import JSONDecodeError
import numpy as np
import pandas as pd
from tqdm import tqdm
from .infura_api import InfuraAPI
from .opensea_api import OpenSeaAPI
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
s... | true | true |
f710efff7d7574d3bc12318a869b973a6e958e4c | 1,376 | py | Python | 07patterns/proxy_patterns.py | edgells/python-commons | 38c0aa0ec10304a4147ea231c92c9e34da462052 | [
"MIT"
] | null | null | null | 07patterns/proxy_patterns.py | edgells/python-commons | 38c0aa0ec10304a4147ea231c92c9e34da462052 | [
"MIT"
] | null | null | null | 07patterns/proxy_patterns.py | edgells/python-commons | 38c0aa0ec10304a4147ea231c92c9e34da462052 | [
"MIT"
] | null | null | null | """
proxy patterns: 代理模式
为其它对象提供一种代理以控制对这个对象的操作
要素:
一个开放的方法集(interface)
实现相应方法集的proxy 对象
实现了相应方法集的类
应用:
远程代理, 为一个对象在不同地址空间提供局部代表, 这样就可以隐藏一个对象存在于不同地址空间的事实
哪么两个进程间, 是否可以通过这样的方式实现数据共享
虚拟代理, 根据需要创建开销很大的对象, 通过它存放实例化需要很长时间的真实对象
安全代理, 用来控制真实对象访问时... | 18.346667 | 65 | 0.630087 |
class GiveGift:
def give_dolls(self):
raise NotImplemented("give dolls not implementation")
def give_flowers(self):
raise NotImplemented("give flowers not implementation")
def give_give_chocolate(self):
raise NotImplemented("give chocolate not implementation")
class Pursuit(Giv... | true | true |
f710f0a83392d109deba5e1325e4da0add75371c | 992 | py | Python | miranda/templates/eccc_conversion_legacy.py | Ouranosinc/miranda | 5c54767a4e6e6c3c1f638ca0fe22673ea98e2746 | [
"Apache-2.0"
] | 4 | 2019-11-07T17:45:26.000Z | 2021-09-22T18:22:01.000Z | miranda/templates/eccc_conversion_legacy.py | Ouranosinc/miranda | 5c54767a4e6e6c3c1f638ca0fe22673ea98e2746 | [
"Apache-2.0"
] | 12 | 2019-09-19T17:05:39.000Z | 2022-03-31T20:26:16.000Z | miranda/templates/eccc_conversion_legacy.py | Ouranosinc/miranda | 5c54767a4e6e6c3c1f638ca0fe22673ea98e2746 | [
"Apache-2.0"
] | 1 | 2020-02-01T01:01:22.000Z | 2020-02-01T01:01:22.000Z | from datetime import date
from pathlib import Path
from miranda.eccc import aggregate_nc_files, convert_hourly_flat_files
if __name__ == "__main__":
var_names = [
"atmospheric_pressure",
"wind_speed",
"relative_humidity",
"dry_bulb_temperature",
"freezing_rain",
"i... | 28.342857 | 80 | 0.646169 | from datetime import date
from pathlib import Path
from miranda.eccc import aggregate_nc_files, convert_hourly_flat_files
if __name__ == "__main__":
var_names = [
"atmospheric_pressure",
"wind_speed",
"relative_humidity",
"dry_bulb_temperature",
"freezing_rain",
"i... | true | true |
f710f131b31a6ae3297050ebf6dc9c582f0bcce4 | 1,207 | py | Python | emails/migrations/0001_initial.py | vftens/Django-CRM | fd02e42b2e9525abcc0e14ee924e5bdf569117bb | [
"MIT"
] | null | null | null | emails/migrations/0001_initial.py | vftens/Django-CRM | fd02e42b2e9525abcc0e14ee924e5bdf569117bb | [
"MIT"
] | null | null | null | emails/migrations/0001_initial.py | vftens/Django-CRM | fd02e42b2e9525abcc0e14ee924e5bdf569117bb | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-01-28 07:07
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Email",
fields=[
(
"id",
... | 32.621622 | 81 | 0.488815 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Email",
fields=[
(
"id",
models.AutoField(
... | true | true |
f710f14079931a4defa63d5727d3ec20f1744236 | 1,799 | py | Python | colors_from_mpl.py | smsaladi/fixthejet | b3089e6ee8cf2afbf24251de47702e0b1446eb73 | [
"MIT"
] | 3 | 2018-04-18T05:05:34.000Z | 2019-04-30T01:41:10.000Z | colors_from_mpl.py | smsaladi/fixthejet | b3089e6ee8cf2afbf24251de47702e0b1446eb73 | [
"MIT"
] | 2 | 2018-03-29T16:28:23.000Z | 2018-05-13T20:41:48.000Z | colors_from_mpl.py | smsaladi/fixthejet | b3089e6ee8cf2afbf24251de47702e0b1446eb73 | [
"MIT"
] | null | null | null | """
Writes out hex colors from color scales provided in matplotlib
into JS file
python colors_from_mpl.py >> js/colorscales.js
"""
import itertools
import json
import numpy as np
import matplotlib.colors
import matplotlib.cm
# Have colormaps separated into categories:
# http://matplotlib.org/examples/color/colormap... | 33.943396 | 74 | 0.595887 |
import itertools
import json
import numpy as np
import matplotlib.colors
import matplotlib.cm
cmap_names = [
('Perceptually Uniform Sequential', [
'viridis', 'plasma', 'inferno', 'magma']),
('Sequential', [
'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds',
'YlOrBr', 'YlOrRd', ... | true | true |
f710f3dcc85493b56211d6d60424c411329b33b7 | 697 | py | Python | walter/common/walterWidgets/__init__.py | all-in-one-of/OpenWalter | c2034f7fac20b36ffe3e500c01d40b87e84e2b97 | [
"libtiff"
] | 187 | 2018-08-14T19:06:20.000Z | 2022-03-04T06:03:25.000Z | walter/common/walterWidgets/__init__.py | all-in-one-of/OpenWalter | c2034f7fac20b36ffe3e500c01d40b87e84e2b97 | [
"libtiff"
] | 9 | 2018-08-22T15:34:48.000Z | 2019-11-27T13:45:21.000Z | walter/common/walterWidgets/__init__.py | all-in-one-of/OpenWalter | c2034f7fac20b36ffe3e500c01d40b87e84e2b97 | [
"libtiff"
] | 41 | 2018-08-14T19:06:09.000Z | 2021-09-04T20:01:10.000Z | # Copyright 2017 Rodeo FX. All rights reserved.
from .utils import dpiScale
from .utils import toPyObject
from .walterBaseTreeView import ACTIONS
from .walterBaseTreeView import BaseDelegate
from .walterBaseTreeView import BaseItem
from .walterBaseTreeView import BaseModel
from .walterBaseTreeView import BaseTreeView
... | 38.722222 | 54 | 0.875179 |
from .utils import dpiScale
from .utils import toPyObject
from .walterBaseTreeView import ACTIONS
from .walterBaseTreeView import BaseDelegate
from .walterBaseTreeView import BaseItem
from .walterBaseTreeView import BaseModel
from .walterBaseTreeView import BaseTreeView
from .walterBaseTreeView import NODE_BAR_COLOUR
... | true | true |
f710f4117998ddf963e36f7ec2257386788aec0a | 3,240 | py | Python | examples/ssh/asyncssh-server.py | GoTodd/python-prompt-toolkit | a9488fbd2ab1dff8e736b6f15c8811a6e4702f0a | [
"BSD-3-Clause"
] | 1 | 2021-07-09T15:46:40.000Z | 2021-07-09T15:46:40.000Z | examples/ssh/asyncssh-server.py | GoTodd/python-prompt-toolkit | a9488fbd2ab1dff8e736b6f15c8811a6e4702f0a | [
"BSD-3-Clause"
] | 1 | 2020-08-11T19:53:13.000Z | 2020-08-11T19:53:13.000Z | examples/ssh/asyncssh-server.py | GoTodd/python-prompt-toolkit | a9488fbd2ab1dff8e736b6f15c8811a6e4702f0a | [
"BSD-3-Clause"
] | 1 | 2020-10-28T01:55:03.000Z | 2020-10-28T01:55:03.000Z | #!/usr/bin/env python
"""
Example of running a prompt_toolkit application in an asyncssh server.
"""
import asyncio
import logging
import asyncssh
from pygments.lexers.html import HtmlLexer
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.contrib.ssh import PromptToolkitSSHServer, PromptToolkit... | 26.557377 | 86 | 0.641975 | import asyncio
import logging
import asyncssh
from pygments.lexers.html import HtmlLexer
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.contrib.ssh import PromptToolkitSSHServer, PromptToolkitSSHSession
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.shortcuts import Progr... | true | true |
f710f43f2783402dc0325a5df802bd24de543b39 | 5,432 | py | Python | route/login_register.py | ProductiveAndEfficient/openNAMU | af3beee5d6e486a4cf152803483e3878b3347882 | [
"BSD-3-Clause"
] | null | null | null | route/login_register.py | ProductiveAndEfficient/openNAMU | af3beee5d6e486a4cf152803483e3878b3347882 | [
"BSD-3-Clause"
] | null | null | null | route/login_register.py | ProductiveAndEfficient/openNAMU | af3beee5d6e486a4cf152803483e3878b3347882 | [
"BSD-3-Clause"
] | null | null | null | from .tool.func import *
def login_register_2(conn):
curs = conn.cursor()
if ban_check(None, 'login') == 1:
return re_error('/ban')
ip = ip_check()
admin = admin_check()
if admin != 1 and ip_or_user(ip) == 0:
return redirect('/user')
if admin != 1:
curs.execute(db_cha... | 41.784615 | 128 | 0.544919 | from .tool.func import *
def login_register_2(conn):
curs = conn.cursor()
if ban_check(None, 'login') == 1:
return re_error('/ban')
ip = ip_check()
admin = admin_check()
if admin != 1 and ip_or_user(ip) == 0:
return redirect('/user')
if admin != 1:
curs.execute(db_cha... | true | true |
f710f564a7de8e73147bdf29014882d066a8fb91 | 2,157 | py | Python | src/charm.py | manadart/service-discovery-operator | aca8ee64405d549e9b03a324478d15427922e567 | [
"Apache-2.0"
] | null | null | null | src/charm.py | manadart/service-discovery-operator | aca8ee64405d549e9b03a324478d15427922e567 | [
"Apache-2.0"
] | null | null | null | src/charm.py | manadart/service-discovery-operator | aca8ee64405d549e9b03a324478d15427922e567 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2022 joseph
# See LICENSE file for licensing details.
#
# Learn more at: https://juju.is/docs/sdk
import logging
from ops.charm import CharmBase
from ops.framework import StoredState
from ops.main import main
from ops.model import ActiveStatus
from charms.service_discovery_operator.... | 28.381579 | 83 | 0.713027 |
import logging
from ops.charm import CharmBase
from ops.framework import StoredState
from ops.main import main
from ops.model import ActiveStatus
from charms.service_discovery_operator.v0.event import DiscoveryEventCharmEvents
from charms.service_discovery_operator.v0.service_discovery import ServiceDiscovery
logger... | true | true |
f710f6dafcfddb3ac08084fae91ac3551fd92098 | 607 | py | Python | example_project/example_app/models.py | IgnisDa/django-tokens | 02069ed7ea9487c4ed52af99e2d0d704c018ea79 | [
"Apache-2.0"
] | null | null | null | example_project/example_app/models.py | IgnisDa/django-tokens | 02069ed7ea9487c4ed52af99e2d0d704c018ea79 | [
"Apache-2.0"
] | null | null | null | example_project/example_app/models.py | IgnisDa/django-tokens | 02069ed7ea9487c4ed52af99e2d0d704c018ea79 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettext_lazy as _
from . import managers
class CustomUser(AbstractUser):
username = models.CharField(
max_length=150, help_text=_("The username of the user."), unique=True
)
email... | 25.291667 | 77 | 0.69687 | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettext_lazy as _
from . import managers
class CustomUser(AbstractUser):
username = models.CharField(
max_length=150, help_text=_("The username of the user."), unique=True
)
email... | true | true |
f710f843c30bce62ef56f5d70535c8feb9462389 | 85 | py | Python | tests/test_reml.py | jgalar/reml | a1031e9d4a92508d8c4658dc9ad3c1ee2532788a | [
"MIT"
] | null | null | null | tests/test_reml.py | jgalar/reml | a1031e9d4a92508d8c4658dc9ad3c1ee2532788a | [
"MIT"
] | null | null | null | tests/test_reml.py | jgalar/reml | a1031e9d4a92508d8c4658dc9ad3c1ee2532788a | [
"MIT"
] | null | null | null | from reml import __version__
def test_version():
assert __version__ == "0.1.0"
| 14.166667 | 33 | 0.705882 | from reml import __version__
def test_version():
assert __version__ == "0.1.0"
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.