hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47811c36607343eaebc64ce8ddf1bc47ab70e525 | 18,799 | py | Python | dev/breeze/src/airflow_breeze/commands/configuration_and_maintenance.py | hubert-pietron/airflow | 3f9073c46940ef1f25a9f46b447d9cf84435c3ed | [
"Apache-2.0"
] | null | null | null | dev/breeze/src/airflow_breeze/commands/configuration_and_maintenance.py | hubert-pietron/airflow | 3f9073c46940ef1f25a9f46b447d9cf84435c3ed | [
"Apache-2.0"
] | null | null | null | dev/breeze/src/airflow_breeze/commands/configuration_and_maintenance.py | hubert-pietron/airflow | 3f9073c46940ef1f25a9f46b447d9cf84435c3ed | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.152174 | 110 | 0.648066 |
c999d649d3bbd083ca35e8bb9138ddfbf0ac54d9 | 1,490 | py | Python | test/functional/qtum_block_number_corruption.py | zerohourcash/zerohourcash | 2e3be4876e1775e8532b71ecb29c502e6c02616a | [
"MIT"
] | 5 | 2021-04-26T01:15:43.000Z | 2022-02-28T19:48:24.000Z | test/functional/qtum_block_number_corruption.py | zerohourcash/zerohourcash | 2e3be4876e1775e8532b71ecb29c502e6c02616a | [
"MIT"
] | null | null | null | test/functional/qtum_block_number_corruption.py | zerohourcash/zerohourcash | 2e3be4876e1775e8532b71ecb29c502e6c02616a | [
"MIT"
] | 3 | 2021-04-26T00:57:46.000Z | 2022-01-13T07:37:51.000Z | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.zerohour import *
class ZHCASHBlockNumberCorruptionTest(BitcoinTest... | 36.341463 | 267 | 0.709396 |
26ced95f25ed064a9ace1dade09c63bb3c6ce85c | 18,541 | py | Python | pytests/ent_backup_restore/validation_helpers/backup_restore_validations.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | null | null | null | pytests/ent_backup_restore/validation_helpers/backup_restore_validations.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | null | null | null | pytests/ent_backup_restore/validation_helpers/backup_restore_validations.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | null | null | null | import json
import math
import os
import logger
from couchbase_helper.data_analysis_helper import DataCollector
from ent_backup_restore.validation_helpers.directory_structure_validations import DirectoryStructureValidations
from ent_backup_restore.validation_helpers.files_validations import BackupRestoreFilesValidatio... | 48.033679 | 136 | 0.568254 |
c4e5c3b8fcd105f15af09ea445e2cdfa99e0d855 | 222 | py | Python | foo/kafka_test.py | jmnel/datapipeline | b3b023fc8aaae2dd7f97cf0fddcab9d1133f2dc5 | [
"MIT"
] | null | null | null | foo/kafka_test.py | jmnel/datapipeline | b3b023fc8aaae2dd7f97cf0fddcab9d1133f2dc5 | [
"MIT"
] | null | null | null | foo/kafka_test.py | jmnel/datapipeline | b3b023fc8aaae2dd7f97cf0fddcab9d1133f2dc5 | [
"MIT"
] | null | null | null | from nameko_kafka import consume
class MyService:
name = "my_service"
@consume("test-event", group_id="my-group", bootstrap_servers="localhost:9092")
def method(self, message):
print(message.value)
| 20.181818 | 83 | 0.698198 |
0a3d77dead607fa4996225d9000926c3467a880d | 7,147 | py | Python | app/src/thirdparty/telemetry/core/local_server.py | ta2edchimp/big-rig | d08ffaa34b1496ca6c8e69a8797d280583472156 | [
"Apache-2.0"
] | 925 | 2015-11-06T03:04:46.000Z | 2017-09-16T19:08:43.000Z | app/src/thirdparty/telemetry/core/local_server.py | ta2edchimp/big-rig | d08ffaa34b1496ca6c8e69a8797d280583472156 | [
"Apache-2.0"
] | 29 | 2015-11-09T17:37:28.000Z | 2017-08-16T17:50:11.000Z | app/src/thirdparty/telemetry/core/local_server.py | ta2edchimp/big-rig | d08ffaa34b1496ca6c8e69a8797d280583472156 | [
"Apache-2.0"
] | 51 | 2015-11-08T07:06:38.000Z | 2017-08-21T07:27:19.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(aiolos): this should be moved to catapult/base after the repo move.
# It is used by tracing in tvcm/browser_controller.
import collections
import json... | 32.935484 | 80 | 0.72394 |
5462e4aab188673e6073399347eed08cb537f25d | 16,547 | py | Python | pace/encryption/enc_mutation.py | LaudateCorpus1/PACE-python | eb61250886e51647bd1edb6d8f4fa7f83eb0bc81 | [
"BSD-2-Clause"
] | 7 | 2016-11-01T17:36:17.000Z | 2021-03-12T08:54:36.000Z | pace/encryption/enc_mutation.py | LaudateCorpus1/PACE-python | eb61250886e51647bd1edb6d8f4fa7f83eb0bc81 | [
"BSD-2-Clause"
] | 1 | 2016-11-29T00:38:28.000Z | 2016-12-06T14:10:24.000Z | pace/encryption/enc_mutation.py | LaudateCorpus1/PACE-python | eb61250886e51647bd1edb6d8f4fa7f83eb0bc81 | [
"BSD-2-Clause"
] | 6 | 2020-09-09T08:33:17.000Z | 2022-01-06T07:02:40.000Z | ## **************
## Copyright 2014 MIT Lincoln Laboratory
## Project: PACE
## Authors: ATLH
## Description: Definition of encrypted mutation and cells
## Modifications:
## Date Name Modification
## ---- ---- ------------
## 19 Dec 2014 ATLH Original file
## 30 Dec 2014 ATLH Added ... | 38.934118 | 101 | 0.587841 |
0d4ffdbdfa676087b9f1506f0d33d32c74a2d9d5 | 2,452 | py | Python | aliyun-python-sdk-mts/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-mts/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-mts/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | #!/usr/bin/python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"... | 31.435897 | 69 | 0.666395 |
386407953d72f9a020ece36d7fba49e6f1cdbe09 | 394 | py | Python | climb_stair.py | konglx90/algorithm | e79a0753d01a39f33482e5d33663ea81ecd435f8 | [
"MIT"
] | null | null | null | climb_stair.py | konglx90/algorithm | e79a0753d01a39f33482e5d33663ea81ecd435f8 | [
"MIT"
] | null | null | null | climb_stair.py | konglx90/algorithm | e79a0753d01a39f33482e5d33663ea81ecd435f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def climb_stair(n):
"""
动态规划: 爬楼梯
"""
if n == 1 or n==2:
return n
sum1 = 1
sum2 = 1
for i in range(1, n-1):
temp = sum2
sum2 = sum2 + sum1
sum1 = temp
print sum2
if __name__ == "__main__":
climb_stair(3)
climb_stair(4)
... | 17.130435 | 27 | 0.507614 |
cb3547a0ecc794f79f2b95c9dc9bba7e081e333e | 1,219 | py | Python | python-scow/parseJdoc.py | smart-cow/scow | 8c18327605f863bbcaf897bab701f78e98c08de8 | [
"Apache-2.0"
] | null | null | null | python-scow/parseJdoc.py | smart-cow/scow | 8c18327605f863bbcaf897bab701f78e98c08de8 | [
"Apache-2.0"
] | 5 | 2017-05-08T14:40:58.000Z | 2017-05-09T19:18:33.000Z | python-scow/parseJdoc.py | smart-cow/scow | 8c18327605f863bbcaf897bab701f78e98c08de8 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
#xpath samples
#
#/html/body/div[4]/div[1]/ul/li/pre/text()[1] controller annotation
#
#/html/body/div[4]/div[3]/ul/li/ul[2]/li/ul[1]/li = first method
#/html/body/div[4]/div[3]/ul/li/ul[2]/li/ul[2]/li = second method
#
#
#
#/html/body/div[4]/div[3]/ul/li/ul[2]/li/ul[1]/li/h4 = first method nam... | 30.475 | 95 | 0.662838 |
3b8caa3dd0ec3d28db10713f5e4be8cbb919fc7c | 3,711 | py | Python | PaperExperiments/XHExp732/parameters.py | stefan-c-kremer/TE_World2 | 8e1fae218af8a1eabae776deecac62192c22e0ca | [
"MIT"
] | null | null | null | PaperExperiments/XHExp732/parameters.py | stefan-c-kremer/TE_World2 | 8e1fae218af8a1eabae776deecac62192c22e0ca | [
"MIT"
] | null | null | null | PaperExperiments/XHExp732/parameters.py | stefan-c-kremer/TE_World2 | 8e1fae218af8a1eabae776deecac62192c22e0ca | [
"MIT"
] | null | null | null |
# parameters.py
"""
Exp 732 - {'Initial_genes': '5000', 'Host_mutation_rate': '0.30', 'TE_progeny': '0.15, 0, 0.55, 1, 0.30, 2', 'TE_Insertion_Distribution': 'Triangle( pmax=0, pzero=3.0/3.0 )', 'Carrying_capacity': '300', 'TE_excision_rate': '0.5', 'Junk_BP': '14', 'Gene_Insertion_Distribution': 'Triangle( pzero=1.0/... | 38.65625 | 367 | 0.649151 |
73e1afc3f84c60455cf75bd8f5fb85c79ebcf86e | 4,980 | py | Python | src/posts/views.py | KazuhisaTaniguchi/django-blog-api | 1edae35e1fa1cdc6d5ff15c405d902a1cded2bb9 | [
"MIT"
] | null | null | null | src/posts/views.py | KazuhisaTaniguchi/django-blog-api | 1edae35e1fa1cdc6d5ff15c405d902a1cded2bb9 | [
"MIT"
] | null | null | null | src/posts/views.py | KazuhisaTaniguchi/django-blog-api | 1edae35e1fa1cdc6d5ff15c405d902a1cded2bb9 | [
"MIT"
] | null | null | null | # python 2
try:
from urllib import quote_plus
except:
pass
# python 3
try:
from urllib.parse import quote_plus
except:
pass
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from djang... | 32.337662 | 87 | 0.667871 |
04caf20ee4bab36544dabfaf5d7119751fc8f283 | 869 | py | Python | texar/modules/memory/__init__.py | eff-kay/temp-texar-repo | 5c6ee6645c1d78f8294e2a07d111dbb02cd9547e | [
"Apache-2.0"
] | 87 | 2019-09-11T04:41:46.000Z | 2022-03-23T02:37:52.000Z | texar/modules/memory/__init__.py | ysglh/texar | 9c699e8143fd8ecb5d65a41ceef09c45832b9258 | [
"Apache-2.0"
] | 10 | 2019-10-01T16:09:17.000Z | 2021-10-19T21:20:11.000Z | texar/modules/memory/__init__.py | ysglh/texar | 9c699e8143fd8ecb5d65a41ceef09c45832b9258 | [
"Apache-2.0"
] | 20 | 2019-09-13T16:32:37.000Z | 2021-06-03T07:14:11.000Z | # Copyright 2018 The Texar Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 33.423077 | 74 | 0.779056 |
f68fb75d3d6ff9c30a163e0c92008f91f4b7c932 | 7,298 | py | Python | python/age-gender-prediction-real-time.py | GangababuManam/tensorflow-101 | f5ba6b298ecdf0ca77ffe871c678f6699ab59a21 | [
"MIT"
] | 832 | 2017-07-11T08:07:14.000Z | 2022-03-26T17:18:19.000Z | python/age-gender-prediction-real-time.py | saikat1506/tensorflow-101 | d0b8d055fc53ebb1189068243667cc8aca4eabcd | [
"MIT"
] | 22 | 2018-04-20T09:30:04.000Z | 2021-11-25T13:14:33.000Z | python/age-gender-prediction-real-time.py | saikat1506/tensorflow-101 | d0b8d055fc53ebb1189068243667cc8aca4eabcd | [
"MIT"
] | 653 | 2017-09-03T03:11:20.000Z | 2022-03-28T19:07:18.000Z | #Documentation: https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/
import numpy as np
import cv2
from keras.models import Model, Sequential
from keras.layers import Input, Convolution2D, ZeroPadding2D, MaxPooling2D, Flatten, Dense, Dropout, Activation
from PIL import Image
from keras.pre... | 37.045685 | 150 | 0.677172 |
06c46451b8faa44ab86ccce9289468e8de9d3007 | 25,349 | py | Python | music_assistant/managers/config.py | music-assistant/server | 474dd1803fec21d715f8b35acb678812c5e73986 | [
"Apache-2.0"
] | 10 | 2020-09-18T12:32:14.000Z | 2022-01-17T11:17:42.000Z | music_assistant/managers/config.py | music-assistant/server | 474dd1803fec21d715f8b35acb678812c5e73986 | [
"Apache-2.0"
] | 61 | 2020-09-28T06:53:31.000Z | 2022-03-21T17:02:52.000Z | music_assistant/managers/config.py | music-assistant/server | 474dd1803fec21d715f8b35acb678812c5e73986 | [
"Apache-2.0"
] | 1 | 2021-08-24T06:05:46.000Z | 2021-08-24T06:05:46.000Z | """All classes and helpers for the Configuration."""
import copy
import json
import logging
import os
import pathlib
import shutil
from typing import Any, List
from music_assistant.constants import (
CONF_CROSSFADE_DURATION,
CONF_ENABLED,
CONF_GROUP_DELAY,
CONF_KEY_BASE,
CONF_KEY_METADATA_PROVIDER... | 35.702817 | 90 | 0.605862 |
e8e14e28ce3dae89548687aa976e8fbe9553f3ae | 6,188 | py | Python | fairseq/examples/roberta/wsc/wsc_criterion.py | skeshaw/LoReNMT | 32ffd83f38258dfffd324f811695a44ad33954f5 | [
"Apache-2.0"
] | null | null | null | fairseq/examples/roberta/wsc/wsc_criterion.py | skeshaw/LoReNMT | 32ffd83f38258dfffd324f811695a44ad33954f5 | [
"Apache-2.0"
] | null | null | null | fairseq/examples/roberta/wsc/wsc_criterion.py | skeshaw/LoReNMT | 32ffd83f38258dfffd324f811695a44ad33954f5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.data import encoders
from fairse... | 37.053892 | 89 | 0.570297 |
0fd19837872e51b09436a1072dfed20a5d2a97c0 | 15,956 | py | Python | moto/ec2/responses/vpcs.py | jonnangle/moto-1 | 40b4e299abb732aad7f56cc0f680c0a272a46594 | [
"Apache-2.0"
] | 1 | 2020-01-13T21:45:21.000Z | 2020-01-13T21:45:21.000Z | moto/ec2/responses/vpcs.py | jonnangle/moto-1 | 40b4e299abb732aad7f56cc0f680c0a272a46594 | [
"Apache-2.0"
] | 1 | 2016-02-11T14:54:01.000Z | 2016-02-12T14:11:05.000Z | moto/ec2/responses/vpcs.py | jonnangle/moto-1 | 40b4e299abb732aad7f56cc0f680c0a272a46594 | [
"Apache-2.0"
] | 2 | 2017-03-02T05:59:52.000Z | 2020-09-03T13:25:44.000Z | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from moto.ec2.utils import filters_from_querystring
class VPCs(BaseResponse):
def _get_doc_date(self):
return (
"2013-10-15"
if "Boto/" in self.... | 41.229974 | 123 | 0.655741 |
6ae97ac6ea07c7d98782977291c165f2a5454557 | 1,155 | py | Python | baxter_ras_interface/scripts/Escuchar_HRS.py | gabrieldiaz94/RAS-Baxter-Interface | 7766d012617bffd09e42b6b76ea105fb3fe24481 | [
"Apache-2.0"
] | 1 | 2022-03-06T15:47:33.000Z | 2022-03-06T15:47:33.000Z | baxter_ras_interface/scripts/Escuchar_HRS.py | willandru/RAS-Baxter-Interface | 7766d012617bffd09e42b6b76ea105fb3fe24481 | [
"Apache-2.0"
] | null | null | null | baxter_ras_interface/scripts/Escuchar_HRS.py | willandru/RAS-Baxter-Interface | 7766d012617bffd09e42b6b76ea105fb3fe24481 | [
"Apache-2.0"
] | 1 | 2022-03-06T15:46:37.000Z | 2022-03-06T15:46:37.000Z | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from baxter_ras_interface.srv import *
def callback(data):
global x,y,z
rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.linear.z)
x=data.linear.x
y=data.linear.y
z=data.linear.z
def get_obj_calibrate(request):
g... | 32.083333 | 79 | 0.716017 |
b4d60f45090915e3f5240aa4de8f02db3722eff6 | 3,632 | py | Python | crafters/image/ImageNormalizer/__init__.py | sidphbot/jina-hub | ab195030b72353c9b803874e2c99829fb75e1b17 | [
"Apache-2.0"
] | 106 | 2020-04-28T10:24:08.000Z | 2022-03-15T02:30:27.000Z | crafters/image/ImageNormalizer/__init__.py | sidphbot/jina-hub | ab195030b72353c9b803874e2c99829fb75e1b17 | [
"Apache-2.0"
] | 6,808 | 2020-05-01T04:13:43.000Z | 2021-06-23T08:04:02.000Z | crafters/image/ImageNormalizer/__init__.py | sidphbot/jina-hub | ab195030b72353c9b803874e2c99829fb75e1b17 | [
"Apache-2.0"
] | 86 | 2020-04-29T09:50:29.000Z | 2022-01-25T05:42:44.000Z | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from typing import Tuple, Dict, Union, Iterable
import numpy as np
from jina.executors.decorators import single
from jina.executors.crafters import BaseCrafter
from .helper import _load_image, _move_channel_axis, _... | 42.232558 | 107 | 0.645099 |
3ecb0b6f6c44430d3132f016a86a531b7965efad | 11,361 | py | Python | efficientdet/coco_metric.py | swoook/automl | 40dd56c3bfa2c2e2c0b2698f9c52ea804427b682 | [
"Apache-2.0"
] | null | null | null | efficientdet/coco_metric.py | swoook/automl | 40dd56c3bfa2c2e2c0b2698f9c52ea804427b682 | [
"Apache-2.0"
] | null | null | null | efficientdet/coco_metric.py | swoook/automl | 40dd56c3bfa2c2e2c0b2698f9c52ea804427b682 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 40.144876 | 94 | 0.633835 |
fe7ea9f04d99b8be0b80305830005cbfd0a0194e | 20,982 | py | Python | python/polya.py | rosenbrockc/polya | 6ab2d1231829f08509c6b07679666ed7ba153c56 | [
"MIT"
] | 7 | 2015-03-05T16:09:49.000Z | 2021-05-16T08:17:49.000Z | python/polya.py | rosenbrockc/polya | 6ab2d1231829f08509c6b07679666ed7ba153c56 | [
"MIT"
] | 1 | 2016-06-09T00:18:35.000Z | 2016-10-06T07:22:33.000Z | python/polya.py | rosenbrockc/polya | 6ab2d1231829f08509c6b07679666ed7ba153c56 | [
"MIT"
] | 2 | 2016-09-27T21:30:18.000Z | 2021-11-30T02:31:12.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
AUTHORS: Conrad W. Rosenbrock, Wiley S. Morgan (October 2014)
Classes to support the calculation of coefficients for specific terms in a product
of multinomials. Construct a product class by specifying the exponent and target term
and then add multinomials using the Produc... | 43.987421 | 107 | 0.614956 |
ecceb9915efd8df428b1adf2c7d9be042f1a0168 | 569,429 | py | Python | venv/Lib/site-packages/tifffile/tifffile.py | kharezga/CPR | f5662e2b7ce70c558d656a2f35a2deecc52ff02a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tifffile/tifffile.py | kharezga/CPR | f5662e2b7ce70c558d656a2f35a2deecc52ff02a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tifffile/tifffile.py | kharezga/CPR | f5662e2b7ce70c558d656a2f35a2deecc52ff02a | [
"MIT"
] | null | null | null | # tifffile.py
# Copyright (c) 2008-2021, Christoph Gohlke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this l... | 35.024542 | 79 | 0.51402 |
8988c5924ddb87c733f350b345f16a2226456087 | 11,983 | py | Python | nsnqtlib/strategies/xq_trade_WX.py | harry0519/nsnqt | 7b0b9011bc5c42aec77aba5c7bab1d03da8d1a60 | [
"BSD-2-Clause"
] | 1 | 2016-12-13T15:12:54.000Z | 2016-12-13T15:12:54.000Z | nsnqtlib/strategies/xq_trade_WX.py | harry0519/nsnqt | 7b0b9011bc5c42aec77aba5c7bab1d03da8d1a60 | [
"BSD-2-Clause"
] | 4 | 2016-09-11T06:06:55.000Z | 2016-09-12T02:05:17.000Z | nsnqtlib/strategies/xq_trade_WX.py | harry0519/nsnqt | 7b0b9011bc5c42aec77aba5c7bab1d03da8d1a60 | [
"BSD-2-Clause"
] | 2 | 2016-10-07T07:00:58.000Z | 2019-07-19T02:15:27.000Z | # -*- coding: utf-8 -*-
import easytrader
import random
from nsnqtlib.strategies.ETFGRIDStrategy import ETFstrategy
from nsnqtlib.strategies.moneyfundstrategy import moneyfundstrategy
from nsnqtlib.strategies.cashoption_strategy import cashoptionstrategy
from nsnqtlib.strategies.convertiblebondstrategy import convertib... | 39.160131 | 162 | 0.621714 |
e1d7242b46f37292e5276c7f3552fc76fa07dafa | 2,534 | py | Python | receiveSTA/rcv_rb_hybrid.py | ilinastoilkovska/syncTA | 9224ef50d5ada4782d0a1d5723531ebe43149584 | [
"Apache-2.0"
] | 2 | 2021-01-05T11:45:48.000Z | 2021-04-06T12:59:38.000Z | receiveSTA/rcv_rb_hybrid.py | ilinastoilkovska/syncTA | 9224ef50d5ada4782d0a1d5723531ebe43149584 | [
"Apache-2.0"
] | null | null | null | receiveSTA/rcv_rb_hybrid.py | ilinastoilkovska/syncTA | 9224ef50d5ada4782d0a1d5723531ebe43149584 | [
"Apache-2.0"
] | null | null | null | # process local states
local = range(8)
# L states
L = {"x" : [1, 2, 3], "y" : [5, 6, 7], "acc" : [3, 7]}
# receive variables
rcv_vars = ["nr"]
# initial states
initial = [0, 1, 4, 5]
# rules
rules = []
rules.append({'idx': 0, 'from': 0, 'to': 0, 'guard': "(< nr (- n (* 2 tb) (* 2 to)))"})
rules.append({'idx': 1, 'fr... | 45.25 | 140 | 0.513023 |
ca4aa13c5b115e05cf46614ec4d8393b03105d26 | 14,068 | py | Python | mne/preprocessing/ssp.py | 0reza/mne-python | da02a256423404a81929d6de278bc63d3192a280 | [
"BSD-3-Clause"
] | null | null | null | mne/preprocessing/ssp.py | 0reza/mne-python | da02a256423404a81929d6de278bc63d3192a280 | [
"BSD-3-Clause"
] | null | null | null | mne/preprocessing/ssp.py | 0reza/mne-python | da02a256423404a81929d6de278bc63d3192a280 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD-3-Clause
import copy as cp
import numpy as np
from ..epochs import Epochs
from ..proj import compute_proj_evoked, compute_proj_epoc... | 38.332425 | 79 | 0.60627 |
1f4519e10e068665a253802da42565df86acc3b9 | 108 | py | Python | Flask_app/hello.py | owenbres01/CMPT-120L-910-20F | c9840f5316688f023b7cca555ffc97ccb429aae8 | [
"MIT"
] | 231 | 2020-03-11T16:27:44.000Z | 2022-03-29T17:35:45.000Z | Flask_app/hello.py | owenbres01/CMPT-120L-910-20F | c9840f5316688f023b7cca555ffc97ccb429aae8 | [
"MIT"
] | 20 | 2020-03-08T15:04:33.000Z | 2022-02-27T21:45:51.000Z | Flask_app/hello.py | owenbres01/CMPT-120L-910-20F | c9840f5316688f023b7cca555ffc97ccb429aae8 | [
"MIT"
] | 356 | 2020-05-07T09:14:25.000Z | 2022-03-31T12:16:24.000Z | from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!' | 18 | 26 | 0.685185 |
dc19d0f362b886c19cd7240d4df95b51182b6cdb | 3,736 | py | Python | midynet/config/parameter.py | charlesmurphy1/fast-midynet | 22071d49077fce9d5f99a4664f36767b27edea64 | [
"MIT"
] | null | null | null | midynet/config/parameter.py | charlesmurphy1/fast-midynet | 22071d49077fce9d5f99a4664f36767b27edea64 | [
"MIT"
] | null | null | null | midynet/config/parameter.py | charlesmurphy1/fast-midynet | 22071d49077fce9d5f99a4664f36767b27edea64 | [
"MIT"
] | null | null | null | import pathlib
import typing
from typing import Any, Iterable, List, Optional, Set, Union, Type
from dataclasses import dataclass, field
__all__ = ("Parameter",)
@dataclass(order=True)
class Parameter:
name: str
value: Any = None
unique: bool = field(repr=True, default=False)
with_repetition: bool =... | 30.876033 | 79 | 0.589936 |
23134512b9800d2e7528055417b7117e01f832f7 | 6,150 | py | Python | timecontour.py | jerome-jh/timecontour | d93cce427aef97c66f5ca92ac96d68eadc196170 | [
"Apache-2.0"
] | 2 | 2016-07-25T02:32:38.000Z | 2016-08-16T23:49:19.000Z | timecontour.py | jerome-jh/timecontour | d93cce427aef97c66f5ca92ac96d68eadc196170 | [
"Apache-2.0"
] | null | null | null | timecontour.py | jerome-jh/timecontour | d93cce427aef97c66f5ca92ac96d68eadc196170 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2015 Jerome Hourioux
#
# 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 ... | 26.059322 | 138 | 0.614146 |
4eb25c55b3465aeda07b891e4a4bb8b91fbc6f5f | 5,549 | py | Python | tests/integration/test_analysis.py | CentricEngineers/bjsfm | 6643f75efed922b5e34f63891007df994b6ad06a | [
"MIT"
] | null | null | null | tests/integration/test_analysis.py | CentricEngineers/bjsfm | 6643f75efed922b5e34f63891007df994b6ad06a | [
"MIT"
] | null | null | null | tests/integration/test_analysis.py | CentricEngineers/bjsfm | 6643f75efed922b5e34f63891007df994b6ad06a | [
"MIT"
] | null | null | null | import unittest
from numpy.testing import assert_array_almost_equal
from bjsfm.lekhnitskii import rotate_plane_stress, LoadedHole, UnloadedHole
from bjsfm.analysis import MaxStrain
from tests.test_data import *
class TestMaxStrainQuasi(unittest.TestCase):
def setUp(self):
self.analysis = MaxStrain(
... | 41.410448 | 104 | 0.639755 |
8c5489bfbf7a272298e0f34005c6b95bda1f7595 | 951 | py | Python | utils/random_seed.py | leileigan/clean_label_textual_backdoor_attack | 56e3a96f6a4eeaf30b90a275685f37cc7e7b3c7c | [
"Apache-2.0"
] | 10 | 2021-12-01T15:35:05.000Z | 2022-03-16T16:10:24.000Z | utils/random_seed.py | leileigan/clean_label_textual_backdoor_attack | 56e3a96f6a4eeaf30b90a275685f37cc7e7b3c7c | [
"Apache-2.0"
] | null | null | null | utils/random_seed.py | leileigan/clean_label_textual_backdoor_attack | 56e3a96f6a4eeaf30b90a275685f37cc7e7b3c7c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file: random_seed.py
# refer to :
# issue: https://github.com/PyTorchLightning/pytorch-lightning/issues/1868
# Please Notice:
# set for trainer: https://pytorch-lightning.readthedocs.io/en/latest/trainer.html
# from pytorch_lightning import Trainer, seed_everything
# ... | 27.171429 | 82 | 0.719243 |
f6e1d5670da0cb38b26a7944adbf702d0ed96592 | 9,597 | py | Python | client/common/common.py | DiDiDaDiDiDa/python-sdk | c4a4c986fd5b57daadbd362eba1559d873999d58 | [
"MIT"
] | null | null | null | client/common/common.py | DiDiDaDiDiDa/python-sdk | c4a4c986fd5b57daadbd362eba1559d873999d58 | [
"MIT"
] | null | null | null | client/common/common.py | DiDiDaDiDiDa/python-sdk | c4a4c986fd5b57daadbd362eba1559d873999d58 | [
"MIT"
] | null | null | null | '''
FISCO BCOS/Python-SDK is a python client for FISCO BCOS2.0 (https://github.com/FISCO-BCOS/)
FISCO BCOS/Python-SDK is free software: you can redistribute it and/or modify it under the
terms of the MIT License as published by the Free Software Foundation. This project is
distributed in the hope that it wi... | 32.313131 | 96 | 0.586537 |
8ad1a2a1f2d28d416889dd99eb032469a9bc86f1 | 10,982 | py | Python | rllab/sampler/base.py | suryabhupa/rllabplusplus | e1c83881d88204c74bd6dac56eb37c10599153f7 | [
"MIT"
] | 3 | 2020-07-12T23:37:46.000Z | 2021-02-21T20:48:44.000Z | rllab/sampler/base.py | suryabhupa/rllabplusplus | e1c83881d88204c74bd6dac56eb37c10599153f7 | [
"MIT"
] | null | null | null | rllab/sampler/base.py | suryabhupa/rllabplusplus | e1c83881d88204c74bd6dac56eb37c10599153f7 | [
"MIT"
] | 2 | 2020-07-12T23:37:55.000Z | 2021-03-21T09:03:31.000Z |
import numpy as np
from rllab.misc import tensor_utils
from rllab.misc import special2 as special
from rllab.algos import util
import rllab.misc.logger as logger
class Sampler(object):
def start_worker(self):
"""
Initialize the sampler, e.g. launching parallel workers if necessary.
"""
... | 43.579365 | 115 | 0.608177 |
69b45a0e22d754bf68d342a1c2593f1d10e50076 | 60 | py | Python | Gentree/tester.py | hoefkensj/gentree | 2cf19cb534ac3c756cace2a79e0725a1bfda5f81 | [
"MIT"
] | null | null | null | Gentree/tester.py | hoefkensj/gentree | 2cf19cb534ac3c756cace2a79e0725a1bfda5f81 | [
"MIT"
] | null | null | null | Gentree/tester.py | hoefkensj/gentree | 2cf19cb534ac3c756cace2a79e0725a1bfda5f81 | [
"MIT"
] | null | null | null | import bash
bash.run('mkswap','/mnt/gentoo/var/.32GiB.swp') | 20 | 47 | 0.716667 |
2f9de0c638991efd6d20ec24ea95e6b9436cf035 | 46,447 | py | Python | yt_dlp/extractor/vimeo.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/vimeo.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/vimeo.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import base64
import functools
import json
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_kwargs,
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
clean_html,
determine_ext... | 41.030919 | 138 | 0.526729 |
03042e9d48bf4575a726fb7c49354957fe74e393 | 235 | py | Python | Python/Armstrong number.py | ShaileshKumar007/Basic-Programming-Quesions | 5fb8b9a3cd2af7a77ff18d6d064fced518733d12 | [
"MIT"
] | 1 | 2021-09-12T15:50:05.000Z | 2021-09-12T15:50:05.000Z | Python/Armstrong number.py | ShaileshKumar007/Basic-Programming-Quesions | 5fb8b9a3cd2af7a77ff18d6d064fced518733d12 | [
"MIT"
] | 2 | 2021-09-11T19:32:41.000Z | 2021-10-02T07:59:21.000Z | Python/Armstrong number.py | ShaileshKumar007/Basic-Programming-Quesions | 5fb8b9a3cd2af7a77ff18d6d064fced518733d12 | [
"MIT"
] | 2 | 2021-09-11T16:42:44.000Z | 2021-09-12T17:23:34.000Z | num = int(input("Enter a number: "))
sum = 0
temp = num
while temp > 0:
digit = temp % 10
sum += digit ** 3
temp //= 10
if num == sum:
print(num,"is an Armstrong number")
else:
print(num,"is not an Armstrong number")
| 15.666667 | 42 | 0.591489 |
3e02533ff29033996a646e160aae1e8e2e6836a2 | 1,674 | py | Python | city_prediction/params.py | Sophistt/Small_Projects | 354589a461c0d0106b6bccbd8e4a515e9691aabc | [
"MIT"
] | null | null | null | city_prediction/params.py | Sophistt/Small_Projects | 354589a461c0d0106b6bccbd8e4a515e9691aabc | [
"MIT"
] | null | null | null | city_prediction/params.py | Sophistt/Small_Projects | 354589a461c0d0106b6bccbd8e4a515e9691aabc | [
"MIT"
] | null | null | null | #!/home/wcy/software/miniconda3/envs/py3.6/bin/python3
# -*- coding: utf-8 -*-
"""
* @Copyright (c) all right reserved
*
* @file:params.py
* @author: Sophistt
* @date:2019-12-13 10:58
* @description: Python file
"""
import argparse
parser = argparse.ArgumentParser(description='Parameters of neural network')
parse... | 36.391304 | 83 | 0.635006 |
fe7734dca5b71d0926669cfe7f861e4fbd1f3eac | 1,818 | py | Python | Extract animalNotes_Unix.py | KL-Turner/machL-Sleep-Scoring | 48a43bba32ee265b48b3fda666a1a92a2fe93032 | [
"MIT"
] | null | null | null | Extract animalNotes_Unix.py | KL-Turner/machL-Sleep-Scoring | 48a43bba32ee265b48b3fda666a1a92a2fe93032 | [
"MIT"
] | null | null | null | Extract animalNotes_Unix.py | KL-Turner/machL-Sleep-Scoring | 48a43bba32ee265b48b3fda666a1a92a2fe93032 | [
"MIT"
] | null | null | null |
"""
Written by Christina Echagarruga
Edited by Kevin L. Turner to work with macOS/Unix-based systems
Purpose: Extract animalNotes from .mat files and format into DataFrame
Export as csv file
Inputs: animalNotes.mat files
Outputs: .csv files
Last Revised: March 6th, 2019
"""
from scipy.io import loadmat
imp... | 28.857143 | 112 | 0.687019 |
25138ec55f586a78d4ddeedc57f4766d8f3bd36c | 7,946 | py | Python | sdk/python/pulumi_azure_native/mixedreality/v20210101/get_remote_rendering_account.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/mixedreality/v20210101/get_remote_rendering_account.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/mixedreality/v20210101/get_remote_rendering_account.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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... | 35.632287 | 214 | 0.639064 |
c22b1a83789ea611bcf337c9e0f6f549cca3e926 | 5,117 | py | Python | pysnmp/ANIROOT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ANIROOT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ANIROOT-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 ANIROOT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ANIROOT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:06:47 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 0... | 91.375 | 1,114 | 0.721126 |
a7367374a0b2385edd99bba9350b672bc54426c7 | 25,447 | py | Python | pytype/pyi/definitions.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | pytype/pyi/definitions.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | pytype/pyi/definitions.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | """Construct and collect pytd definitions to build a TypeDeclUnit."""
import collections
from typing import Any, Dict, List, Optional, Union
import dataclasses
from pytype.pyi import classdef
from pytype.pyi import types
from pytype.pyi.types import ParseError # pylint: disable=g-importing-member
from pytype.pytd ... | 37.312317 | 80 | 0.663261 |
fafa4a418e762237ae8fde37f3343f713e5a9dd3 | 6,561 | py | Python | __init__.py | pokepay/pokepay-partner-python-sdk | 7437370dc1cd0bde38959713015074315291b1e1 | [
"MIT"
] | null | null | null | __init__.py | pokepay/pokepay-partner-python-sdk | 7437370dc1cd0bde38959713015074315291b1e1 | [
"MIT"
] | null | null | null | __init__.py | pokepay/pokepay-partner-python-sdk | 7437370dc1cd0bde38959713015074315291b1e1 | [
"MIT"
] | 1 | 2022-01-28T03:00:12.000Z | 2022-01-28T03:00:12.000Z | # encoding: utf-8
# DO NOT EDIT: File is generated by code generator.
from pokepay_partner_python_sdk.pokepay.crypto import *
from pokepay_partner_python_sdk.pokepay.client import *
from pokepay_partner_python_sdk.pokepay.request.request import *
from pokepay_partner_python_sdk.pokepay.response.response import *
from ... | 72.9 | 104 | 0.892394 |
30208c4aed803a26030af42852e5058aaa8aea9b | 5,839 | py | Python | PythonJsonScript/2. CarCleanJsonScript.py | DhrumilShah98/CarsDataPythonScript | 9323248c2ddbfb7410d14cc27c5b8d8c8365c610 | [
"MIT"
] | 1 | 2019-09-14T10:03:41.000Z | 2019-09-14T10:03:41.000Z | PythonJsonScript/2. CarCleanJsonScript.py | DhrumilShah98/CarsDataPythonScript | 9323248c2ddbfb7410d14cc27c5b8d8c8365c610 | [
"MIT"
] | 1 | 2021-08-02T19:48:12.000Z | 2021-08-16T21:07:02.000Z | PythonJsonScript/2. CarCleanJsonScript.py | DhrumilShah98/CarsDataPythonScript | 9323248c2ddbfb7410d14cc27c5b8d8c8365c610 | [
"MIT"
] | 1 | 2021-05-22T11:37:02.000Z | 2021-05-22T11:37:02.000Z | # __author__ = "Dhrumil Amish Shah"
# __copyright__ = "Copyright 2019"
# __credits__ = ["Dhrumil Amish Shah"]
# __version__ = "1.0.0"
# __maintainer__ = "Dhrumil Amish Shah"
# __github__ = "https://github.com/DhrumilShah98/"
# NOTE: I CAN NOT SHARE THE NAME OF THE WEBSITE
# I WAS ABLE TO GET TOTAL 1238 CAR DETAILS. PR... | 41.411348 | 141 | 0.580579 |
9a3c971292bbfc15c0c00911c21cb1fc2d517e66 | 4,084 | py | Python | alipay/aop/api/request/KoubeiMarketingDataSceneMemberpointsGetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/KoubeiMarketingDataSceneMemberpointsGetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/KoubeiMarketingDataSceneMemberpointsGetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiMarketingDataSceneMemberpointsGetModel import KoubeiMarketingDataSceneMemberpointsGetModel
class KoubeiMarketing... | 28.165517 | 166 | 0.652302 |
b4a3b55825ae108f5b84ae0a463c71e646b1a44e | 2,922 | py | Python | src/rapidrest/integrations.py | benumbed/rapid-rest | bbb58288405dc769726fa81279ac8b0f28e185b8 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/rapidrest/integrations.py | benumbed/rapid-rest | bbb58288405dc769726fa81279ac8b0f28e185b8 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/rapidrest/integrations.py | benumbed/rapid-rest | bbb58288405dc769726fa81279ac8b0f28e185b8 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Utilities to manage the integrations that an API requires to function
"""
import logging
import os
from rapidrest.exceptions import IntegrationLoadError
from vaultclient import VaultClient
log = logging.getLogger(__name__)
def integrations_required_keys(modules:list) -> set:
"""
... | 30.757895 | 117 | 0.701916 |
e88a36754aec2be0584b0a8df3a66458c3f2120b | 1,599 | py | Python | jans-pycloudlib/tests/test_validators.py | JanssenProject/jans | 8d57d01b998bfe87a2377bbe9023dd97fb03cc9f | [
"Apache-2.0"
] | 18 | 2022-01-13T13:45:13.000Z | 2022-03-30T04:41:18.000Z | jans-pycloudlib/tests/test_validators.py | JanssenProject/jans | 8d57d01b998bfe87a2377bbe9023dd97fb03cc9f | [
"Apache-2.0"
] | 604 | 2022-01-13T12:32:50.000Z | 2022-03-31T20:27:36.000Z | jans-pycloudlib/tests/test_validators.py | JanssenProject/jans | 8d57d01b998bfe87a2377bbe9023dd97fb03cc9f | [
"Apache-2.0"
] | 8 | 2022-01-28T00:23:25.000Z | 2022-03-16T05:12:12.000Z | import pytest
@pytest.mark.parametrize("type_", [
"ldap",
"couchbase",
"hybrid",
"sql",
"spanner",
])
def test_validate_persistence_type(type_):
from jans.pycloudlib.validators import validate_persistence_type
assert validate_persistence_type(type_) is None
def test_validate_persistence_... | 28.052632 | 86 | 0.780488 |
722f18c535d2b37621cec98a772c78e8c1afa8c1 | 5,585 | py | Python | polyglotdb/exceptions.py | msonderegger/PolyglotDB | 583fd8ec14c2e34807b45b9f15fa19cffa130bfa | [
"MIT"
] | null | null | null | polyglotdb/exceptions.py | msonderegger/PolyglotDB | 583fd8ec14c2e34807b45b9f15fa19cffa130bfa | [
"MIT"
] | null | null | null | polyglotdb/exceptions.py | msonderegger/PolyglotDB | 583fd8ec14c2e34807b45b9f15fa19cffa130bfa | [
"MIT"
] | null | null | null | import os
import sys
import traceback
## Base exception classes
class PGError(Exception):
"""
Base class for all exceptions explicitly raised in corpustools.
"""
def __init__(self, value):
self.value = value
def __repr__(self):
return '{}: {}'.format(type(self).__name__, self.va... | 23.565401 | 106 | 0.648523 |
fa07ec0fb75ab47f3250ce0a286d36dc2199ec1e | 7,305 | py | Python | guilded/ext/commands/converters.py | ThomasJRyan/guilded.py | e1bb5cab839c80c851d4538111e4f1563bb15187 | [
"MIT"
] | null | null | null | guilded/ext/commands/converters.py | ThomasJRyan/guilded.py | e1bb5cab839c80c851d4538111e4f1563bb15187 | [
"MIT"
] | null | null | null | guilded/ext/commands/converters.py | ThomasJRyan/guilded.py | e1bb5cab839c80c851d4538111e4f1563bb15187 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present shay (shayypy)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 33.204545 | 134 | 0.662286 |
cf127d5588078f083dfd8e437639136050455f56 | 648 | py | Python | puppersim/__init__.py | jadenvc/puppersim | 1b3f3e3fc0515d5d6101622e0d729c779debfd32 | [
"Apache-2.0"
] | 5 | 2021-06-07T23:50:31.000Z | 2021-10-30T11:36:32.000Z | puppersim/__init__.py | jadenvc/puppersim | 1b3f3e3fc0515d5d6101622e0d729c779debfd32 | [
"Apache-2.0"
] | 7 | 2021-11-01T20:04:31.000Z | 2022-03-31T02:51:55.000Z | puppersim/__init__.py | jadenvc/puppersim | 1b3f3e3fc0515d5d6101622e0d729c779debfd32 | [
"Apache-2.0"
] | 6 | 2021-10-17T08:39:58.000Z | 2021-12-06T07:54:12.000Z | import os
def getPupperSimPath():
resdir = os.path.join(os.path.dirname(__file__))
return resdir
try:
import gym
from gym.envs.registration import registry, make, spec
def register(id, *args, **kvargs):
if id in registry.env_specs:
return
else:
return gym.envs.registration.register(id, *... | 20.25 | 87 | 0.679012 |
c2f179601fd91a82c559be4c459618fc2775e62d | 665 | py | Python | anabin_rest_api/users/tests/test_urls.py | kmvinoth/anabin_rest_api | 0a6024440147007552404ab5b103e3b4ba063d96 | [
"MIT"
] | null | null | null | anabin_rest_api/users/tests/test_urls.py | kmvinoth/anabin_rest_api | 0a6024440147007552404ab5b103e3b4ba063d96 | [
"MIT"
] | 2 | 2020-08-03T15:03:25.000Z | 2020-08-06T11:18:52.000Z | anabin_rest_api/users/tests/test_urls.py | kmvinoth/anabin_rest_api | 0a6024440147007552404ab5b103e3b4ba063d96 | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from anabin_rest_api.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/user... | 26.6 | 74 | 0.679699 |
f1b3517f05bd3a10e35da51c057cf9a7a393d17a | 2,557 | py | Python | src/simmate/database/third_parties/for_providers/jarvis.py | laurenmm/simmate-1 | c06b94c46919b01cda50f78221ad14f75c100a14 | [
"BSD-3-Clause"
] | 9 | 2021-12-21T02:58:21.000Z | 2022-01-25T14:00:06.000Z | src/simmate/database/third_parties/for_providers/jarvis.py | laurenmm/simmate-1 | c06b94c46919b01cda50f78221ad14f75c100a14 | [
"BSD-3-Clause"
] | 51 | 2022-01-01T15:59:58.000Z | 2022-03-26T21:25:42.000Z | src/simmate/database/third_parties/for_providers/jarvis.py | laurenmm/simmate-1 | c06b94c46919b01cda50f78221ad14f75c100a14 | [
"BSD-3-Clause"
] | 7 | 2022-01-01T03:44:32.000Z | 2022-03-29T19:59:27.000Z | # -*- coding: utf-8 -*-
"""
> :warning: This file is only for use by the Simmate team. Users should instead
access data via the load_remote_archive method.
This file is for pulling JARVIS data into the Simmate database.
JARVIS has a python package "jarvis-tools" that let's us pull some of their
database dumps. For... | 35.027397 | 180 | 0.706296 |
583d07f0fdbeaf95f2e01c3add69c8d885298539 | 439 | py | Python | palette.py | d122y/dyno-boom | af89b636be4a86accfef41d4d85375fb1d464661 | [
"MIT"
] | null | null | null | palette.py | d122y/dyno-boom | af89b636be4a86accfef41d4d85375fb1d464661 | [
"MIT"
] | null | null | null | palette.py | d122y/dyno-boom | af89b636be4a86accfef41d4d85375fb1d464661 | [
"MIT"
] | null | null | null | class Palette:
def __init__(self, name, bgColor, foreColor, shadeColor):
self.name = name
self.bgColor = bgColor
self.foreColor = foreColor
self.shadeColor = shadeColor
TargetPalettes = [
Palette("pink-on-yellow", (241,249,2), (201,0,181), (71,2,64)),
Palette("red... | 33.769231 | 68 | 0.585421 |
65b0c22e1015502e69d3b97ecc1566cf38a79bba | 573 | py | Python | examples/rich-presence-images.py | cclauss/pypresence | c9166831e33878e90ae7819513530a3480d526cc | [
"BSD-3-Clause"
] | 591 | 2018-03-14T04:12:33.000Z | 2022-03-27T12:09:08.000Z | examples/rich-presence-images.py | cclauss/pypresence | c9166831e33878e90ae7819513530a3480d526cc | [
"BSD-3-Clause"
] | 136 | 2018-04-03T16:20:42.000Z | 2022-03-13T22:53:02.000Z | examples/rich-presence-images.py | cclauss/pypresence | c9166831e33878e90ae7819513530a3480d526cc | [
"BSD-3-Clause"
] | 111 | 2018-03-27T21:08:16.000Z | 2022-03-31T11:33:50.000Z | from pypresence import Presence
import time
"""
You need to upload your image(s) here:
https://discordapp.com/developers/applications/<APP ID>/rich-presence/assets
"""
client_id = "64567352374564" # Enter your Application ID here.
RPC = Presence(client_id=client_id)
RPC.connect()
# Make sure you are using the same ... | 30.157895 | 78 | 0.745201 |
d50ed8d6d5f4f88af9c3996ceb74fdd115a16fc8 | 2,456 | py | Python | pylbm_ui/mixin.py | pylbm/pylbm_ui | 0a7202ee6ee5424486ce6ade1d3b18d8139d4ffb | [
"BSD-3-Clause"
] | 3 | 2021-05-17T20:38:32.000Z | 2021-11-16T17:54:26.000Z | pylbm_ui/mixin.py | pylbm/pylbm_ui | 0a7202ee6ee5424486ce6ade1d3b18d8139d4ffb | [
"BSD-3-Clause"
] | 32 | 2021-04-29T13:27:13.000Z | 2021-07-01T07:22:58.000Z | pylbm_ui/mixin.py | pylbm/pylbm_ui | 0a7202ee6ee5424486ce6ade1d3b18d8139d4ffb | [
"BSD-3-Clause"
] | 1 | 2021-04-30T06:40:21.000Z | 2021-04-30T06:40:21.000Z |
# Authors:
# Loic Gouarin <loic.gouarin@polytechnique.edu>
# Benjamin Graille <benjamin.graille@universite-paris-saclay.fr>
# Thibaut Van Hoof <thibaut.vanhoof@cenaero.be>
#
# License: BSD 3 clause
class BaseMixin:
def check(self, change):
pass
class FloatMixin(BaseMixin):
def check(self,... | 26.989011 | 68 | 0.533388 |
ce18aded290acee7ce61a2195a6f462432f1dcd8 | 1,570 | py | Python | plugins/CV2Resize/__init__.py | j-h-m/Media-Journaling-Tool | 4ab6961e2768dc002c9bbad182f83188631f01bd | [
"BSD-3-Clause"
] | null | null | null | plugins/CV2Resize/__init__.py | j-h-m/Media-Journaling-Tool | 4ab6961e2768dc002c9bbad182f83188631f01bd | [
"BSD-3-Clause"
] | null | null | null | plugins/CV2Resize/__init__.py | j-h-m/Media-Journaling-Tool | 4ab6961e2768dc002c9bbad182f83188631f01bd | [
"BSD-3-Clause"
] | null | null | null | import cv2
from maskgen.image_wrap import ImageWrapper
from maskgen.tool_set import resizeImage
def transform(img,source,target,**kwargs):
pixelWidth = int(kwargs['width'])
pixelHeight = int(kwargs['height'])
ImageWrapper(resizeImage(img.to_array(),(pixelHeight,pixelWidth),kwargs['interpolation'])).save(ta... | 32.040816 | 107 | 0.467516 |
6576187a2832c68709dbff52079cf0348c3e5f87 | 2,696 | py | Python | tfx/orchestration/portable/resolver_processor.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/resolver_processor.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/resolver_processor.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.432432 | 80 | 0.745549 |
2527a8145a1a8243b0b00baa8c6383590f1f814a | 38,576 | py | Python | datasets.py | liuzhy71/DexiNed | 0d611914518add8e78de37e7ade7f12daa6204ba | [
"MIT"
] | null | null | null | datasets.py | liuzhy71/DexiNed | 0d611914518add8e78de37e7ade7f12daa6204ba | [
"MIT"
] | null | null | null | datasets.py | liuzhy71/DexiNed | 0d611914518add8e78de37e7ade7f12daa6204ba | [
"MIT"
] | null | null | null | import os
import random
import cv2
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
import json
from scipy import ndimage as ndi
from skimage.morphology import dilation, erosion
from skimage.segmentation import find_boundaries
from scipy import ndimage as ndi
resize_scale = 1
DATASET_... | 42.113537 | 120 | 0.518768 |
1d21d7e45e6177874ffd565ef96ef8c3fee2d7f5 | 10,907 | py | Python | test/functional/wallet_labels.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | 12 | 2016-09-16T20:35:56.000Z | 2021-03-11T11:52:47.000Z | test/functional/wallet_labels.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | 5 | 2016-09-14T10:24:57.000Z | 2018-11-26T14:10:26.000Z | test/functional/wallet_labels.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | 20 | 2016-08-08T14:36:36.000Z | 2020-11-14T12:16:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test label RPCs.
RPCs tested are:
- getaccountaddress
- getaddressesbyaccount/getaddresses... | 40.697761 | 101 | 0.640689 |
e31aed7278628dc7e8af07c364ffa7d97d93622e | 3,046 | py | Python | iot/classes/AccountValidation.py | mobius-software-ltd/iotbroker.cloud-python-client | 48242f5c2a7ffeadb9e03e7aa4ab4a961e09af63 | [
"RSA-MD"
] | 2 | 2021-06-25T10:32:32.000Z | 2022-01-20T02:04:21.000Z | iot/classes/AccountValidation.py | mobius-software-ltd/iotbroker.cloud-python-client | 48242f5c2a7ffeadb9e03e7aa4ab4a961e09af63 | [
"RSA-MD"
] | 2 | 2022-01-07T09:12:32.000Z | 2022-03-27T12:57:37.000Z | iot/classes/AccountValidation.py | mobius-software-ltd/iotbroker.cloud-python-client | 48242f5c2a7ffeadb9e03e7aa4ab4a961e09af63 | [
"RSA-MD"
] | 1 | 2019-02-28T21:22:16.000Z | 2019-02-28T21:22:16.000Z | """
# Mobius Software LTD
# Copyright 2015-2018, Mobius Software LTD
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later ve... | 49.129032 | 275 | 0.666448 |
6af13f05b8ee3065981755add63640f95a44240b | 3,391 | py | Python | hard-gists/f3ce814ee66c965638fe/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/f3ce814ee66c965638fe/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/f3ce814ee66c965638fe/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | import idaapi
import idc
class MemoryPattern(object):
def __init__(self, pattern, wildcards, patch):
self._pattern = pattern
self._wildcards = wildcards
self._patch = patch
def compareTo(self, buffer, offset):
if offset + len(self._pattern) > len(buffer):
return Fal... | 34.602041 | 242 | 0.604247 |
230c4546f747a609041c9e5759d073d894eec1b4 | 626 | py | Python | rayvens/cli/rayvens_setup.py | doru1004/rayvens | da89f405586a06b50cc8bb6273d8582400fbca9c | [
"Apache-2.0"
] | 24 | 2021-06-18T21:38:04.000Z | 2022-02-16T19:16:49.000Z | rayvens/cli/rayvens_setup.py | doru1004/rayvens | da89f405586a06b50cc8bb6273d8582400fbca9c | [
"Apache-2.0"
] | 11 | 2021-06-22T14:36:27.000Z | 2021-12-09T16:33:15.000Z | rayvens/cli/rayvens_setup.py | doru1004/rayvens | da89f405586a06b50cc8bb6273d8582400fbca9c | [
"Apache-2.0"
] | 5 | 2021-06-18T22:03:55.000Z | 2021-08-02T05:11:46.000Z | #
# Copyright IBM Corporation 2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 31.3 | 74 | 0.753994 |
0ef8fb664b9c854a7293ad3bf122e7659f0b2a2a | 788 | py | Python | profiles_api/migrations/0002_profilefeeditem.py | danisuram/profiles-rest-api | 72197164e5a932a7fc27f57ed44195f052f67487 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | danisuram/profiles-rest-api | 72197164e5a932a7fc27f57ed44195f052f67487 | [
"MIT"
] | 7 | 2019-12-05T01:03:44.000Z | 2022-02-10T12:38:55.000Z | profiles_api/migrations/0002_profilefeeditem.py | danisuram/profiles-rest-api | 72197164e5a932a7fc27f57ed44195f052f67487 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-12-05 07:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.52 | 126 | 0.633249 |
105b8ba04f3e6bb0f4590ee9366a45aad4dabd2f | 82 | py | Python | Week1_PyThonBasic/Class/Ex2.py | minhvip2001/pythonproject | 0ad9e70203fae2cd038872a8d1a71c0bc9416cf3 | [
"MIT"
] | null | null | null | Week1_PyThonBasic/Class/Ex2.py | minhvip2001/pythonproject | 0ad9e70203fae2cd038872a8d1a71c0bc9416cf3 | [
"MIT"
] | null | null | null | Week1_PyThonBasic/Class/Ex2.py | minhvip2001/pythonproject | 0ad9e70203fae2cd038872a8d1a71c0bc9416cf3 | [
"MIT"
] | null | null | null | # Create a Vehicle class without any variables and methods
class Vehicle:
pass | 27.333333 | 58 | 0.780488 |
3f22a98078d5a2a1b32e90d428fb8f6fc398e39e | 1,270 | py | Python | zerxis_account/auth_backends.py | Kirembu/zerxis-user-accounts | 42338ed98d0249335417ece948d7ea4271a66180 | [
"MIT"
] | null | null | null | zerxis_account/auth_backends.py | Kirembu/zerxis-user-accounts | 42338ed98d0249335417ece948d7ea4271a66180 | [
"MIT"
] | null | null | null | zerxis_account/auth_backends.py | Kirembu/zerxis-user-accounts | 42338ed98d0249335417ece948d7ea4271a66180 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
from .models import EmailAddress
from .utils import get_user_lookup_kwargs
class UsernameAuthenticationBackend(ModelBackend):
def authenticate(self, request, username=None, passwor... | 28.863636 | 76 | 0.659055 |
a9ab1fc4e75c67f70c718a89349c465f3a92f0a5 | 98 | py | Python | app/api_1_0/__init__.py | amsayeed/Flask-Data-visualization | 96b5b0b3cd2a17c8faeae8771e1756987a794798 | [
"MIT"
] | 10 | 2020-02-29T17:39:47.000Z | 2021-01-01T22:38:32.000Z | app/api_1_0/__init__.py | amsayeed/Flask-Data-visualization | 96b5b0b3cd2a17c8faeae8771e1756987a794798 | [
"MIT"
] | null | null | null | app/api_1_0/__init__.py | amsayeed/Flask-Data-visualization | 96b5b0b3cd2a17c8faeae8771e1756987a794798 | [
"MIT"
] | 6 | 2020-02-29T16:40:59.000Z | 2021-03-16T19:25:06.000Z | from flask import Blueprint
bp = Blueprint('data_api', __name__)
from app.api_1_0 import routes
| 16.333333 | 36 | 0.785714 |
9080f086ee30683ab846e96cb3554666683d05a4 | 3,051 | py | Python | nova/api/openstack/compute/contrib/floating_ip_pools.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | 1 | 2015-07-15T08:51:16.000Z | 2015-07-15T08:51:16.000Z | nova/api/openstack/compute/contrib/floating_ip_pools.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/floating_ip_pools.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | 2 | 2019-06-12T00:52:15.000Z | 2020-07-24T10:35:29.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | 31.78125 | 78 | 0.674861 |
fe53f820fc5f961b605f65d0b55fb80e71671f40 | 4,011 | py | Python | buildscripts/resmokelib/testing/hooks/interface.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | null | null | null | buildscripts/resmokelib/testing/hooks/interface.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | null | null | null | buildscripts/resmokelib/testing/hooks/interface.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | null | null | null | """Interface for customizing the behavior of a test fixture."""
from __future__ import absolute_import
import sys
from ..testcases import interface as testcase
from ... import errors
from ...logging import loggers
from ...utils import registry
_HOOKS = {} # type: ignore
def make_hook(class_name, *args, **kwargs)... | 36.135135 | 97 | 0.665919 |
8322b75aafd00a9cec4cfda64407ee62a0e0260b | 9,124 | py | Python | src/queue/main.py | helix84/activae | 0e40bd71577f829b597bbf0931bbeb2c581ac410 | [
"BSD-3-Clause"
] | null | null | null | src/queue/main.py | helix84/activae | 0e40bd71577f829b597bbf0931bbeb2c581ac410 | [
"BSD-3-Clause"
] | null | null | null | src/queue/main.py | helix84/activae | 0e40bd71577f829b597bbf0931bbeb2c581ac410 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2010 CENATIC: Centro Nacional de Referencia de
# Aplicacion de las TIC basadas en Fuentes Abiertas, Spain.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of... | 28.247678 | 94 | 0.605217 |
360d12e0dc812927baf9792905d2f7afe9b934d8 | 428 | py | Python | lista/schemas/instrutor_schema.py | Leo-Cal/lista-de-compras-backend | b1129268a6d46971a19fd71bca9ba9f15fba2a80 | [
"MIT"
] | null | null | null | lista/schemas/instrutor_schema.py | Leo-Cal/lista-de-compras-backend | b1129268a6d46971a19fd71bca9ba9f15fba2a80 | [
"MIT"
] | null | null | null | lista/schemas/instrutor_schema.py | Leo-Cal/lista-de-compras-backend | b1129268a6d46971a19fd71bca9ba9f15fba2a80 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from marshmallow_sqlalchemy import ModelSchema
from marshmallow import fields
from lista.schemas.lista_schema import ListaSchema
from lista.models.aluno_model import AlunoModel
from lista.models.instrutor_model import InstrutorModel
class InstrutorSchema(ModelSchema):
voos = fields.Nested("... | 38.909091 | 87 | 0.785047 |
2928b0ef1d0d6538f652898d2af9f5049cca3e8b | 492 | py | Python | torchember/fastai.py | raynardj/torchember | 635a6578760ede37c2b02b47be84e3bf773a18a4 | [
"Apache-2.0"
] | 2 | 2020-02-16T03:16:20.000Z | 2021-05-22T21:46:48.000Z | torchember/fastai.py | raynardj/torchember | 635a6578760ede37c2b02b47be84e3bf773a18a4 | [
"Apache-2.0"
] | 14 | 2020-02-24T15:44:09.000Z | 2021-09-28T00:41:16.000Z | torchember/fastai.py | raynardj/torchember | 635a6578760ede37c2b02b47be84e3bf773a18a4 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/50_extension_fastai.ipynb (unless otherwise specified).
__all__ = ['EmberCallback']
# Cell
from .core import torchEmber
from fastai.basic_train import Learner,LearnerCallback
# Cell
class EmberCallback(LearnerCallback):
"""
A call back for fastai learner
""... | 25.894737 | 103 | 0.703252 |
d3cf3bcbe8a1154c2be10a4d206bb11a4422665d | 1,731 | py | Python | src/dedup.py | joshmcintyre/dedup | c608a58ad65cc66fb730376962d1200f61dc9f78 | [
"BSD-2-Clause"
] | null | null | null | src/dedup.py | joshmcintyre/dedup | c608a58ad65cc66fb730376962d1200f61dc9f78 | [
"BSD-2-Clause"
] | null | null | null | src/dedup.py | joshmcintyre/dedup | c608a58ad65cc66fb730376962d1200f61dc9f78 | [
"BSD-2-Clause"
] | null | null | null | # This file contains code for finding file duplicates by content in a directory
#
# Author: Josh McIntyre
#
import os
import hashlib
import argparse
# Build the duplicates listing
# This function enumerates the files in the directory and hashes each
# If 2 hashes match, add them to the duplicates listing
def find_dupl... | 29.844828 | 83 | 0.659734 |
97753e4174aa679e83468c7b1a76ba961d553c64 | 2,787 | py | Python | tsp/entry_model.py | frobino/tsp-python-client | c78370229187d554138b247cd0fa5de20aa55fc9 | [
"MIT"
] | null | null | null | tsp/entry_model.py | frobino/tsp-python-client | c78370229187d554138b247cd0fa5de20aa55fc9 | [
"MIT"
] | null | null | null | tsp/entry_model.py | frobino/tsp-python-client | c78370229187d554138b247cd0fa5de20aa55fc9 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (C) 2020 - Ericsson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 35.730769 | 79 | 0.663437 |
9306dd4e7cbc4131d2fa8b77e051df2146ef965d | 157 | py | Python | plugins/prometheus/kpireport_prometheus/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 9 | 2021-05-17T05:32:46.000Z | 2022-03-16T22:49:26.000Z | plugins/prometheus/kpireport_prometheus/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 4 | 2020-10-10T23:38:20.000Z | 2020-11-08T22:41:24.000Z | plugins/prometheus/kpireport_prometheus/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 1 | 2021-01-12T02:49:04.000Z | 2021-01-12T02:49:04.000Z | from .alert_summary import PrometheusAlertSummary
from .datasource import PrometheusDatasource
__all__ = ["PrometheusAlertSummary", "PrometheusDatasource"]
| 31.4 | 60 | 0.853503 |
c091dec2e66497d445ef04ea6fd4deb6eac5cdc8 | 445 | py | Python | plugins/holland.lib.mysql/holland/lib/mysql/client/__init__.py | jkoelker/holland | b53497002b090db24fbbf0545c0683b4b727ab34 | [
"BSD-3-Clause"
] | 1 | 2019-06-06T01:07:34.000Z | 2019-06-06T01:07:34.000Z | plugins/holland.lib.mysql/holland/lib/mysql/client/__init__.py | jkoelker/holland | b53497002b090db24fbbf0545c0683b4b727ab34 | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.lib.mysql/holland/lib/mysql/client/__init__.py | jkoelker/holland | b53497002b090db24fbbf0545c0683b4b727ab34 | [
"BSD-3-Clause"
] | 2 | 2015-12-04T12:17:59.000Z | 2022-03-23T07:22:02.000Z | from holland.lib.mysql.client.base import MySQLClient, MySQLError, \
ProgrammingError, OperationalError, \
connect, \
PassiveMySQLClient, AutoMySQLClient
__all__ = [
'connect',
'MySQLC... | 29.666667 | 79 | 0.51236 |
9e74c46db603b8cfa0eefbbdc4474d1b81011c38 | 71 | py | Python | Tuple/2.Tuple-with-diff-items.py | manish1822510059/Python-1000-program | d03c1920fe63a7e32ac5bd9a13e2766d7a25756c | [
"Apache-2.0"
] | 1 | 2021-03-06T03:33:42.000Z | 2021-03-06T03:33:42.000Z | Tuple/2.Tuple-with-diff-items.py | manish1822510059/Python-1000-programs | d03c1920fe63a7e32ac5bd9a13e2766d7a25756c | [
"Apache-2.0"
] | null | null | null | Tuple/2.Tuple-with-diff-items.py | manish1822510059/Python-1000-programs | d03c1920fe63a7e32ac5bd9a13e2766d7a25756c | [
"Apache-2.0"
] | null | null | null | mytuple = (1,65,'c++','java','c',102)
print('Tuple Content: ',mytuple) | 35.5 | 38 | 0.605634 |
1e85de075a7b5725f845a3aefc0194d72a6a0f92 | 7,746 | py | Python | src/third_party/wiredtiger/src/docs/tools/doxfilter.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 4 | 2018-02-06T01:53:12.000Z | 2018-02-20T01:47:36.000Z | src/third_party/wiredtiger/src/docs/tools/doxfilter.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/src/docs/tools/doxfilter.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 3 | 2018-02-06T01:53:18.000Z | 2021-07-28T09:48:15.000Z | #!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as ... | 38.924623 | 79 | 0.571133 |
e1195f2be7b4cfdbdc0adbb19146572768762420 | 141,102 | py | Python | src/sage/schemes/elliptic_curves/ell_curve_isogeny.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/elliptic_curves/ell_curve_isogeny.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/elliptic_curves/ell_curve_isogeny.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | r"""
Isogenies
An isogeny `\varphi: E_1\to E_2` between two elliptic curves `E_1` and
`E_2` is a morphism of curves that sends the origin of `E_1` to the
origin of `E_2`. Such a morphism is automatically a morphism of group
schemes and the kernel is a finite subgroup scheme of `E_1`. Such a
subscheme can either be gi... | 35.24026 | 333 | 0.561495 |
b861584ed3e0996db5129b9de3b0fbb0a6b4a138 | 4,112 | py | Python | .history/ClassFiles/DatesTimeCalenders/MyCalendars_20210109152314.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DatesTimeCalenders/MyCalendars_20210109152314.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DatesTimeCalenders/MyCalendars_20210109152314.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | """ Working with calendars
The calendar module contains different classes that you can use to create calendars.
A text based calendar # 11
# A HTML based calendar # 32
Part 2: # 50
Part 3
"""
import calendar
# A text based calendar
# cal = calendar.TextCalendar(calendar.SUNDAY) # SUNDAY is the fi... | 33.983471 | 184 | 0.468872 |
79f39bf7bc63fda3982550946a033f7057910a06 | 10,896 | py | Python | cogs/verification.py | MinekPo1/pesu-bot | 134c249fa57dcbebc8a4b4955b1e0344775512b7 | [
"MIT"
] | null | null | null | cogs/verification.py | MinekPo1/pesu-bot | 134c249fa57dcbebc8a4b4955b1e0344775512b7 | [
"MIT"
] | null | null | null | cogs/verification.py | MinekPo1/pesu-bot | 134c249fa57dcbebc8a4b4955b1e0344775512b7 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from time import sleep
from discord.utils import get
BOT_TEST = 749473757843947671
BOT_LOGS = 786084620944146504
GUILD_ID = 742797665301168220
class verification(commands.Cog):
def __init__(self, client):
self.client = client
self.dat... | 40.808989 | 163 | 0.542126 |
e472aa9a26ab564c2f78cd989e96cf2e7ff82d46 | 8,876 | py | Python | eeve/base_classes.py | vMarcelino/eeve | 7dcfa17d34480f5c120ce963680babffff8ab412 | [
"Apache-2.0"
] | 1 | 2019-10-11T18:42:48.000Z | 2019-10-11T18:42:48.000Z | eeve/base_classes.py | vMarcelino/eeve | 7dcfa17d34480f5c120ce963680babffff8ab412 | [
"Apache-2.0"
] | null | null | null | eeve/base_classes.py | vMarcelino/eeve | 7dcfa17d34480f5c120ce963680babffff8ab412 | [
"Apache-2.0"
] | 1 | 2019-10-11T18:42:49.000Z | 2019-10-11T18:42:49.000Z | import inspect
from dataclasses import dataclass
from typing import Union, Any, Callable, List, Tuple
from travel_backpack.exceptions import check_and_raise, except_and_print, format_exception_string
from eeve.wrapper import action_wrapper
@dataclass
class ActionTemplate:
name: str
func: Callable
init_re... | 31.928058 | 123 | 0.62945 |
e1d9711381ed051a53214830376269420d0ad042 | 9,350 | py | Python | vars-gen.py | emilarista/ansible-overlay | 8ef852205b48cc1cd3d8b73a4a2e23d755d06ebc | [
"Apache-2.0"
] | null | null | null | vars-gen.py | emilarista/ansible-overlay | 8ef852205b48cc1cd3d8b73a4a2e23d755d06ebc | [
"Apache-2.0"
] | null | null | null | vars-gen.py | emilarista/ansible-overlay | 8ef852205b48cc1cd3d8b73a4a2e23d755d06ebc | [
"Apache-2.0"
] | null | null | null | from jinja2 import Template
import sys
import yaml
import json
import os
from pathlib import Path
rootpath = "."
clear = lambda: os.system('clear')
def to_json(input):
return json.dumps(input, indent = 2, sort_keys=True)
def save_config():
with open("project.json", "w") as f:
f.write(to_json(config)... | 31.481481 | 104 | 0.480642 |
da9d4e756b7a7f97e99f070dd6d19d37010b7c2d | 969 | py | Python | froide/foirequest/migrations/0054_alter_foirequest_options.py | OpendataCH/froide | 8136bac0d8caa56f9cfc7ba15480be987280e55d | [
"MIT"
] | null | null | null | froide/foirequest/migrations/0054_alter_foirequest_options.py | OpendataCH/froide | 8136bac0d8caa56f9cfc7ba15480be987280e55d | [
"MIT"
] | null | null | null | froide/foirequest/migrations/0054_alter_foirequest_options.py | OpendataCH/froide | 8136bac0d8caa56f9cfc7ba15480be987280e55d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-12-15 20:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("foirequest", "0053_alter_foimessage_email_headers"),
]
operations = [
migrations.AlterModelOptions(
name="foirequest",
optio... | 32.3 | 74 | 0.527348 |
970923b35b3549e0f1c037c62334c219dee4e640 | 2,353 | py | Python | django/template/loaders/filesystem.py | laurilarjo/halvinbensa-appengine | 82602835914e70b6c71993d4b570e1df32a0e71e | [
"BSD-3-Clause"
] | 2 | 2015-11-05T06:07:13.000Z | 2019-01-04T07:35:59.000Z | django/template/loaders/filesystem.py | alex/django-old | 6f964c8f03e5d25c9e36898a001c8463f82fbb81 | [
"BSD-3-Clause"
] | 1 | 2021-06-30T10:10:56.000Z | 2021-06-30T10:10:56.000Z | django/template/loaders/filesystem.py | alex/django-old | 6f964c8f03e5d25c9e36898a001c8463f82fbb81 | [
"BSD-3-Clause"
] | 2 | 2017-08-04T02:42:35.000Z | 2021-06-30T10:10:34.000Z | """
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, template_... | 37.951613 | 140 | 0.651084 |
ecc283ba601a27791e9659fdf5138c303fa59af4 | 2,340 | py | Python | python/rl_agent_level4.py | mgualti/DeepRLManip | 6b982a319edae51d9c7c740c3a83fe8ce3a97ca7 | [
"MIT"
] | 23 | 2018-10-30T02:34:39.000Z | 2022-01-13T09:58:00.000Z | python/rl_agent_level4.py | mgualti/DeepRLManip | 6b982a319edae51d9c7c740c3a83fe8ce3a97ca7 | [
"MIT"
] | null | null | null | python/rl_agent_level4.py | mgualti/DeepRLManip | 6b982a319edae51d9c7c740c3a83fe8ce3a97ca7 | [
"MIT"
] | 5 | 2018-11-03T19:56:59.000Z | 2020-03-02T08:28:31.000Z | '''RL agent which uses the deictic state/action representation.'''
# python
from copy import copy
# scipy
from numpy.linalg import inv
from numpy.random import choice, rand, randint, uniform
from numpy import absolute, argmax, argmin, array, concatenate, dot, exp, hstack, isinf, linspace, \
ones, pi, repeat, stack, ... | 32.5 | 100 | 0.703846 |
0b9a5a961b29d9190107f77ca9c7c2b72f64e3bd | 5,878 | py | Python | tests/unit/plugins/openstack/scenarios/mistral/test_utils.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 1 | 2018-01-01T00:43:41.000Z | 2018-01-01T00:43:41.000Z | tests/unit/plugins/openstack/scenarios/mistral/test_utils.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/mistral/test_utils.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 1 | 2020-06-05T10:06:37.000Z | 2020-06-05T10:06:37.000Z | # Copyright 2015: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 37.43949 | 78 | 0.66179 |
50a2bfdca5a97e7fa4da0ba3a0530f1c546c9e45 | 256 | py | Python | statuscheck/services/sparkpost.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 35 | 2018-10-22T06:04:55.000Z | 2022-02-01T10:20:00.000Z | statuscheck/services/sparkpost.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 209 | 2018-10-22T11:44:57.000Z | 2022-03-31T04:02:37.000Z | statuscheck/services/sparkpost.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 2 | 2020-06-05T02:41:19.000Z | 2020-09-03T07:03:46.000Z | from statuscheck.services.bases._statuspageio import BaseStatusPageAPI
class ServiceAPI(BaseStatusPageAPI):
name = "SparkPost"
domain_id = "7ky1q6zd3fyp"
status_url = "https://status.sparkpost.com/"
service_url = "https://sparkpost.com/"
| 28.444444 | 70 | 0.746094 |
c7fe06f919ce93d6e1c3223854504ffe4a4135f7 | 1,739 | py | Python | library.py | tdd-laboratory/tdd-homework-jerrysen | 3e9285c579d73e9c9a5b377bbb74e3d99a80c167 | [
"Apache-2.0"
] | null | null | null | library.py | tdd-laboratory/tdd-homework-jerrysen | 3e9285c579d73e9c9a5b377bbb74e3d99a80c167 | [
"Apache-2.0"
] | null | null | null | library.py | tdd-laboratory/tdd-homework-jerrysen | 3e9285c579d73e9c9a5b377bbb74e3d99a80c167 | [
"Apache-2.0"
] | null | null | null | import re
_whole_word = lambda x: re.compile(r'(?<=\W)' + x + '(?=\W)')
_mixed_ordinal_pat = _whole_word(r'-?\d+(st|th|nd|rd)')
_integer_pat = _whole_word(r'\d+')
_floating_point_after_pat = re.compile(r'\.\d+[^a-zA-Z.]')
_floating_point_before_pat = re.compile(r'(?<=\d\.)')
_date_iso8601_pat = _whole_word(r'\d{4}-(0\... | 40.44186 | 94 | 0.66475 |
d1d0c4ba914bfd94693c86f500ab5553ebf27c6d | 3,078 | py | Python | examples/mnist/mnist.py | MathiasStokholm/alkymi | 2d8bb1da92a6b05f4ff8d5b2ff1f069d5315b792 | [
"MIT"
] | 37 | 2021-01-15T15:34:25.000Z | 2022-02-02T10:15:02.000Z | examples/mnist/mnist.py | MathiasStokholm/alkymi | 2d8bb1da92a6b05f4ff8d5b2ff1f069d5315b792 | [
"MIT"
] | null | null | null | examples/mnist/mnist.py | MathiasStokholm/alkymi | 2d8bb1da92a6b05f4ff8d5b2ff1f069d5315b792 | [
"MIT"
] | null | null | null | import array
import functools
import gzip
import io
import logging
import operator
import struct
import urllib.request
from typing import List, BinaryIO
import matplotlib.pyplot as plt
import numpy as np
import alkymi as alk
# Print alkymi logging to stderr
alk.log.addHandler(logging.StreamHandler())
alk.log.setLeve... | 32.0625 | 116 | 0.624431 |
8fb253b4c9edcf4a216cdd3d1f4cb5788afbe685 | 4,417 | py | Python | authlib/oauth2/rfc6749/grants/base.py | 3lpsy/authlib | fb174ce865263da54183e0fab07b9c50150a4588 | [
"BSD-3-Clause"
] | null | null | null | authlib/oauth2/rfc6749/grants/base.py | 3lpsy/authlib | fb174ce865263da54183e0fab07b9c50150a4588 | [
"BSD-3-Clause"
] | null | null | null | authlib/oauth2/rfc6749/grants/base.py | 3lpsy/authlib | fb174ce865263da54183e0fab07b9c50150a4588 | [
"BSD-3-Clause"
] | null | null | null | from ..errors import (
InvalidRequestError,
InvalidScopeError,
)
from ..util import scope_to_list
class BaseGrant(object):
SPECIFICATION = 'rfc6749'
#: If this grant type has authorization endpoint
AUTHORIZATION_ENDPOINT = False
#: If this grant type has token endpoint
TOKEN_ENDPOINT = Fal... | 33.976923 | 75 | 0.640706 |
1a6b1c64b53e5add8ca6b0983666c9c2825983a1 | 717 | py | Python | Algorithms/894.all-possible-full-binary-trees/all-possible-full-binary-trees.py | OctopusLian/leetcode-solutions | 40920d11c584504e805d103cdc6ef3f3774172b3 | [
"MIT"
] | 1 | 2020-12-01T18:35:24.000Z | 2020-12-01T18:35:24.000Z | Algorithms/894.all-possible-full-binary-trees/all-possible-full-binary-trees.py | OctopusLian/leetcode-solutions | 40920d11c584504e805d103cdc6ef3f3774172b3 | [
"MIT"
] | 18 | 2020-11-10T05:48:29.000Z | 2020-11-26T08:39:20.000Z | Algorithms/894.all-possible-full-binary-trees/all-possible-full-binary-trees.py | OctopusLian/leetcode-solutions | 40920d11c584504e805d103cdc6ef3f3774172b3 | [
"MIT"
] | 5 | 2020-11-09T07:43:00.000Z | 2021-12-02T14:59:37.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# 二叉树
# f(root) = f(root->left) + f(root->right)
class Solution:
def allPossibleFBT(self, N: int) -> List[TreeNode]:
if N == 1:
retu... | 28.68 | 57 | 0.481172 |
ef4e01b5a5ee96fee5851168e6784738bc27074c | 43 | py | Python | datatree/_version.py | jhamman/datatree | 415cbb7983b6d737aeb82be4e0f526d32f94ff62 | [
"Apache-2.0"
] | null | null | null | datatree/_version.py | jhamman/datatree | 415cbb7983b6d737aeb82be4e0f526d32f94ff62 | [
"Apache-2.0"
] | null | null | null | datatree/_version.py | jhamman/datatree | 415cbb7983b6d737aeb82be4e0f526d32f94ff62 | [
"Apache-2.0"
] | null | null | null | __version__ = "0.1.dev9+g805d97f.d20210817" | 43 | 43 | 0.790698 |
5e73fa22f04c1290faae4d325f107ddf5983e5d2 | 460 | py | Python | myappl/migrations/0006_userprofile_slug.py | hamzzy/advertise | 6655e209b92365c6d05928305301bde86413d33c | [
"MIT"
] | null | null | null | myappl/migrations/0006_userprofile_slug.py | hamzzy/advertise | 6655e209b92365c6d05928305301bde86413d33c | [
"MIT"
] | null | null | null | myappl/migrations/0006_userprofile_slug.py | hamzzy/advertise | 6655e209b92365c6d05928305301bde86413d33c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-27 16:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myappl', '0005_auto_20170927_0829'),
]
operations = [
migrations.AddField(
... | 21.904762 | 59 | 0.617391 |
e80176a9a009109a27d0a6ee15180e4e17e4c201 | 328 | py | Python | 001132StepikITclassPy/Stepik001132ITclassPyсh03p01st06TASK05_20200611.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001132StepikITclassPy/Stepik001132ITclassPyсh03p01st06TASK05_20200611.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001132StepikITclassPy/Stepik001132ITclassPyсh03p01st06TASK05_20200611.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | '''
Напишите программу, в которой в единственной строке вводится число,
а в строку вывода программа печатает ответ на вопрос:
Является ли число вещественным, т.е. есть ли не нулевые значения после запятой?
Stepik001132ITclassPyсh03p01st06TASK05_20200611.py
'''
num = float(input())
a, b = str(num).split('.')
print(int(... | 29.818182 | 79 | 0.762195 |
0f003c2044a942dbb9303b2847640bf71949fdbb | 9,269 | py | Python | attendees/persons/admin.py | xjlin0/-attendees30 | 48a2f2cbec11ec471d7a40d24903b48890feebf9 | [
"MIT"
] | null | null | null | attendees/persons/admin.py | xjlin0/-attendees30 | 48a2f2cbec11ec471d7a40d24903b48890feebf9 | [
"MIT"
] | null | null | null | attendees/persons/admin.py | xjlin0/-attendees30 | 48a2f2cbec11ec471d7a40d24903b48890feebf9 | [
"MIT"
] | null | null | null | from django.db.models import Q
from django_summernote.admin import SummernoteModelAdmin
from django.contrib.postgres import fields
from django_json_widget.widgets import JSONEditorWidget
from django.contrib import admin, messages
from attendees.occasions.models import *
from attendees.whereabouts.models import *
from .... | 39.781116 | 128 | 0.651527 |
0a333806137453481b4b03c6755294f5259148ff | 7,395 | py | Python | nova/virt/vmwareapi/network_util.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | 7 | 2017-06-19T19:37:00.000Z | 2019-06-16T02:06:14.000Z | nova/virt/vmwareapi/network_util.py | muthu1085/nova | d7afa2a4171e699f2e3bc43db7aa6e8814320277 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/network_util.py | muthu1085/nova | d7afa2a4171e699f2e3bc43db7aa6e8814320277 | [
"Apache-2.0"
] | 6 | 2015-06-20T16:07:28.000Z | 2020-08-19T14:57:59.000Z | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# 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://w... | 42.994186 | 79 | 0.637863 |
2cd1e4a47f68b43d4c6e0a159af7c918673b87ca | 175,940 | py | Python | tensorflow/python/eager/function_test.py | koreybea/tensorflow | e252fffb16f2706688604dc91c426bae367ae5e8 | [
"Apache-2.0"
] | 6 | 2021-03-30T07:42:04.000Z | 2022-03-23T02:42:36.000Z | tensorflow/python/eager/function_test.py | koreybea/tensorflow | e252fffb16f2706688604dc91c426bae367ae5e8 | [
"Apache-2.0"
] | 7 | 2021-02-21T21:05:59.000Z | 2022-02-10T01:39:06.000Z | tensorflow/python/eager/function_test.py | koreybea/tensorflow | e252fffb16f2706688604dc91c426bae367ae5e8 | [
"Apache-2.0"
] | 4 | 2019-06-15T01:13:28.000Z | 2020-12-16T02:28:45.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.129971 | 86 | 0.65848 |
c6d08e52d8a776dd6af87d3e75bd03e5d8b167bc | 3,677 | py | Python | plait/app/console.py | dustinlacewell/plait | b57bc353298401af41b286fbefa6120b236be102 | [
"MIT"
] | 2 | 2015-11-30T23:50:37.000Z | 2015-12-04T20:19:38.000Z | plait/app/console.py | dustinlacewell/plait | b57bc353298401af41b286fbefa6120b236be102 | [
"MIT"
] | null | null | null | plait/app/console.py | dustinlacewell/plait | b57bc353298401af41b286fbefa6120b236be102 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import urwid
from blinker import signal
from plait.app.base import PlaitApp
from plait.frame import ConsoleFrame
from plait.tabs import VerticalTabs
class WorkerLog(urwid.ListBox):
def __init__(self):
walker = urwid.SimpleListWalker([])
urwid.ListBox.__init__(self, walker... | 30.641667 | 75 | 0.613272 |
e6680cc734937357242bb41b610aa49553161c35 | 5,128 | py | Python | samples/client/petstore/python-experimental/petstore_api/models/map_test.py | yasammez/openapi-generator | cbc12543a9c949ca0eacc73db5f8c383bf3d0a75 | [
"Apache-2.0"
] | null | null | null | samples/client/petstore/python-experimental/petstore_api/models/map_test.py | yasammez/openapi-generator | cbc12543a9c949ca0eacc73db5f8c383bf3d0a75 | [
"Apache-2.0"
] | null | null | null | samples/client/petstore/python-experimental/petstore_api/models/map_test.py | yasammez/openapi-generator | cbc12543a9c949ca0eacc73db5f8c383bf3d0a75 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 35.365517 | 174 | 0.612324 |
b0ddebaff933561ba82daa1127c2d57072b8a1ab | 1,995 | py | Python | docs/conf.py | jkokosar/resolwe | c23db01494ef863fb2f8e130a59198cfd10bc7aa | [
"Apache-2.0"
] | null | null | null | docs/conf.py | jkokosar/resolwe | c23db01494ef863fb2f8e130a59198cfd10bc7aa | [
"Apache-2.0"
] | null | null | null | docs/conf.py | jkokosar/resolwe | c23db01494ef863fb2f8e130a59198cfd10bc7aa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import django
import os
base_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
# Manual setup is required for standalone Django usage
django.setup()
# Get package metadata from 'resolwe/__about__.py' file
a... | 28.913043 | 78 | 0.703258 |
773a956e9931225e92c47acd219f8dfe0da4235b | 16,966 | py | Python | examples/FasterRCNN/train.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | 5 | 2018-05-04T02:04:15.000Z | 2020-04-02T05:38:48.000Z | examples/FasterRCNN/train.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | null | null | null | examples/FasterRCNN/train.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | 2 | 2018-04-23T13:43:10.000Z | 2019-10-30T09:56:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: train.py
import os
import argparse
import cv2
import shutil
import itertools
import tqdm
import numpy as np
import json
import six
import tensorflow as tf
assert six.PY3, "FasterRCNN requires Python 3!"
from tensorpack import *
from tensorpack.tfutils.summary imp... | 42.099256 | 119 | 0.630496 |
fd79fbeea7cf446e9d5aa0e2ca126060c56fa00b | 3,141 | py | Python | django_projects/django_test/django_test/settings.py | therealiggs/oldpystuff | 45f2d78a9bc2b3841d03570ca0a4d92eef6762be | [
"MIT"
] | null | null | null | django_projects/django_test/django_test/settings.py | therealiggs/oldpystuff | 45f2d78a9bc2b3841d03570ca0a4d92eef6762be | [
"MIT"
] | null | null | null | django_projects/django_test/django_test/settings.py | therealiggs/oldpystuff | 45f2d78a9bc2b3841d03570ca0a4d92eef6762be | [
"MIT"
] | null | null | null | """
Django settings for django_test project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... | 25.745902 | 91 | 0.697549 |
d9122a0585a4218b15a5dfeb91fea2a231234905 | 1,033 | py | Python | domains/fetch/problems/auto/problem24_fetch.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | domains/fetch/problems/auto/problem24_fetch.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | domains/fetch/problems/auto/problem24_fetch.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'patras'
from domains.fetch.domain_fetch import *
from shared.timer import DURATION
DURATION.TIME = {
'put': 2,
'take': 2,
'perceive': 3,
'charge': 5,
'move': 10,
'moveToEmergency': 5,
'moveCharger': 15,
'addressEmergency': 10,
'wait': 5,
}
DURATION.COUNTER = {
'pu... | 20.66 | 59 | 0.520813 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.