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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bc8e0795beca857fd768bebf12bbfc80d2f36028 | 1,506 | py | Python | core/storage/question/gae_models_test.py | Panda2498/oppia | fccfd7e89c6904c244deaccdee80cc5658f2520a | [
"Apache-2.0"
] | null | null | null | core/storage/question/gae_models_test.py | Panda2498/oppia | fccfd7e89c6904c244deaccdee80cc5658f2520a | [
"Apache-2.0"
] | 1 | 2020-01-26T14:02:43.000Z | 2020-01-26T14:02:43.000Z | core/storage/question/gae_models_test.py | ryanboris/oppia | bc39e54e00d53ea2f00bca906fe02162d0c422ac | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Oppia 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 ... | 38.615385 | 75 | 0.745684 |
774a4ac0a5f1d65bd8288387389a7b937611ba55 | 913 | py | Python | metasdk/examples/media_api/set_auth_user_id.py | devision-io/metasdk | e3340ab4c62a9f6c7317d768bc12ea5ceff01275 | [
"MIT"
] | 1 | 2020-08-07T02:52:14.000Z | 2020-08-07T02:52:14.000Z | metasdk/examples/media_api/set_auth_user_id.py | devision-io/metasdk | e3340ab4c62a9f6c7317d768bc12ea5ceff01275 | [
"MIT"
] | 2 | 2019-10-22T09:50:30.000Z | 2020-08-05T14:22:50.000Z | metasdk/examples/media_api/set_auth_user_id.py | devision-io/metasdk | e3340ab4c62a9f6c7317d768bc12ea5ceff01275 | [
"MIT"
] | 1 | 2020-08-07T02:58:45.000Z | 2020-08-07T02:58:45.000Z | import base64
from metasdk import MetaApp
from metasdk.utils import pretty_json
META = MetaApp(meta_url="http://localhost:8080")
log = META.log
#
# Вы можете установить ID пользователя, от лица которого будут работать запросы
# Это полезно, когда вам надо сгенерировать приватный файл в фоновом режиме.
# Это user_id ... | 30.433333 | 80 | 0.740416 |
f542c4199f005244f68e0965ad2eeaba96db7587 | 2,073 | py | Python | train_exp.py | chaiyujin/AudioDVP | 1b7a6bc85bda6df16c9709d08d7b1415b449c584 | [
"MIT"
] | 200 | 2020-11-14T16:23:11.000Z | 2022-03-31T17:40:37.000Z | train_exp.py | chaiyujin/AudioDVP | 1b7a6bc85bda6df16c9709d08d7b1415b449c584 | [
"MIT"
] | 36 | 2020-11-15T14:17:51.000Z | 2022-01-04T08:22:43.000Z | train_exp.py | chaiyujin/AudioDVP | 1b7a6bc85bda6df16c9709d08d7b1415b449c584 | [
"MIT"
] | 42 | 2020-11-14T16:29:18.000Z | 2022-03-20T01:16:39.000Z | import time
from options.options import Options
from models import audio_expression_model
from datasets import create_dataset
from utils.visualizer import Visualizer
if __name__ == '__main__':
opt = Options().parse_args() # get training options
dataset = create_dataset(opt)
model = audio_expression_m... | 39.865385 | 116 | 0.666184 |
9051a1a1ca678660821931e07eeb266ed868bac0 | 634 | py | Python | consumeraffairs/reviews/urls.py | sqyttles/Django-Backend-Test | c46d5b2d8a1f98bf3ec69524ab7a2e344514e538 | [
"MIT"
] | null | null | null | consumeraffairs/reviews/urls.py | sqyttles/Django-Backend-Test | c46d5b2d8a1f98bf3ec69524ab7a2e344514e538 | [
"MIT"
] | null | null | null | consumeraffairs/reviews/urls.py | sqyttles/Django-Backend-Test | c46d5b2d8a1f98bf3ec69524ab7a2e344514e538 | [
"MIT"
] | null | null | null | from django.urls import path
from consumeraffairs.reviews.views import (
review_list_view, review_redirect_view, review_create_view,
review_detail_view, review_update_view, review_delete_view)
app_name = "reviews"
urlpatterns = [
path("", view=review_list_view, name="list"),
path("~redirect/", view=re... | 39.625 | 73 | 0.731861 |
3a0dcc37a47120f0deefaeda94e5bd31fc33c0ef | 2,032 | py | Python | edx_rest_framework_extensions/auth/jwt/tests/test_cookies.py | Jawayria/edx-drf-extensions | ff138f24f1695f97988356c46fc2f4c4774019a1 | [
"Apache-2.0"
] | null | null | null | edx_rest_framework_extensions/auth/jwt/tests/test_cookies.py | Jawayria/edx-drf-extensions | ff138f24f1695f97988356c46fc2f4c4774019a1 | [
"Apache-2.0"
] | null | null | null | edx_rest_framework_extensions/auth/jwt/tests/test_cookies.py | Jawayria/edx-drf-extensions | ff138f24f1695f97988356c46fc2f4c4774019a1 | [
"Apache-2.0"
] | null | null | null | """
Unit tests for jwt cookies module.
"""
import ddt
import mock
from django.test import TestCase, override_settings
from edx_rest_framework_extensions.auth.jwt.decoder import jwt_decode_handler
from edx_rest_framework_extensions.auth.jwt.tests.utils import (
generate_jwt_token,
generate_latest_version_payloa... | 37.62963 | 117 | 0.752461 |
c3a68580661274146b3a0eeabd7858694aff0617 | 309 | py | Python | test/solution_tests/SUM/test_sum.py | DPNT-Sourcecode/CHK-cylq01 | a8ca9e25b3577370ebf0d35da8298ee523f8e46b | [
"Apache-2.0"
] | null | null | null | test/solution_tests/SUM/test_sum.py | DPNT-Sourcecode/CHK-cylq01 | a8ca9e25b3577370ebf0d35da8298ee523f8e46b | [
"Apache-2.0"
] | null | null | null | test/solution_tests/SUM/test_sum.py | DPNT-Sourcecode/CHK-cylq01 | a8ca9e25b3577370ebf0d35da8298ee523f8e46b | [
"Apache-2.0"
] | null | null | null | import unittest
from solutions.SUM import sum_solution
class TestSum(unittest.TestCase):
def test_sum(self):
self.assertEqual(sum_solution.compute(1, 2), 3)
def test_notequal(self):
self.assertNotEqual(sum_solution.compute(1,1), 3)
if __name__ == '__main__':
unittest.main()
| 19.3125 | 57 | 0.705502 |
3a4c1ca03c28b85d63f798781fe1ad8421f4f045 | 386 | py | Python | tasks/__init__.py | ttzhou/poetry-workspace-plugin | 078d8ab323b0d33e0b542cac93ae7144bace87e8 | [
"MIT"
] | 46 | 2021-08-10T09:30:58.000Z | 2022-03-31T16:18:46.000Z | tasks/__init__.py | ttzhou/poetry-workspace-plugin | 078d8ab323b0d33e0b542cac93ae7144bace87e8 | [
"MIT"
] | 1 | 2021-12-07T11:00:02.000Z | 2021-12-07T11:29:19.000Z | tasks/__init__.py | ttzhou/poetry-workspace-plugin | 078d8ab323b0d33e0b542cac93ae7144bace87e8 | [
"MIT"
] | 4 | 2021-08-18T02:30:18.000Z | 2022-02-11T23:23:58.000Z | from invoke import Collection
from tasks.changelog_check import changelog_check
from tasks.lint import lint
from tasks.release import build, release
from tasks.test import coverage, test
from tasks.typecheck import typecheck
from tasks.verify import verify
namespace = Collection(
build,
changelog_check,
c... | 20.315789 | 49 | 0.766839 |
103549d200e973e501c14eb496e73d2d80c9a6ee | 2,428 | py | Python | examples/pipeline/hetero_feature_binning/pipeline-hetero-binning-bucket-binning.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | examples/pipeline/hetero_feature_binning/pipeline-hetero-binning-bucket-binning.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | examples/pipeline/hetero_feature_binning/pipeline-hetero-binning-bucket-binning.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The FATE 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 appli... | 31.128205 | 93 | 0.644152 |
6f3060ee6d617c6c01ac1ea3bcb011c915657ba2 | 13,876 | py | Python | kubernetes/client/models/v1_api_resource.py | palnabarun/Python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_api_resource.py | palnabarun/Python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | 7 | 2020-11-07T10:35:21.000Z | 2022-02-07T03:06:25.000Z | kubernetes/client/models/v1_api_resource.py | palnabarun/python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 36.515789 | 445 | 0.634765 |
d386e5b8811179974e6f5072947f5f0c653e4d4e | 254 | py | Python | jalali_test/manage.py | ajahansh/django-jalali | 5be8845f500fc18d96d0b624f74b4e83161c4645 | [
"BSD-3-Clause"
] | null | null | null | jalali_test/manage.py | ajahansh/django-jalali | 5be8845f500fc18d96d0b624f74b4e83161c4645 | [
"BSD-3-Clause"
] | null | null | null | jalali_test/manage.py | ajahansh/django-jalali | 5be8845f500fc18d96d0b624f74b4e83161c4645 | [
"BSD-3-Clause"
] | 1 | 2018-11-21T14:31:52.000Z | 2018-11-21T14:31:52.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jalali_test.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.090909 | 75 | 0.775591 |
45a9b868ca14f4f48414c003dff9c395080c61d9 | 41,198 | py | Python | reinforcement_learning/common/policies.py | mizolotu/DonkeyCarExperiments | 3d6be742915efe51c0f5abda4c69a4349a555373 | [
"MIT"
] | null | null | null | reinforcement_learning/common/policies.py | mizolotu/DonkeyCarExperiments | 3d6be742915efe51c0f5abda4c69a4349a555373 | [
"MIT"
] | null | null | null | reinforcement_learning/common/policies.py | mizolotu/DonkeyCarExperiments | 3d6be742915efe51c0f5abda4c69a4349a555373 | [
"MIT"
] | null | null | null | import warnings
from itertools import zip_longest
from abc import ABC, abstractmethod
import numpy as np
import tensorflow as tf
from reinforcement_learning.gym.spaces import Discrete
from reinforcement_learning.common.tf_util import batch_to_seq, seq_to_batch
from reinforcement_learning.common.tf_layers import conv,... | 50.180268 | 224 | 0.656998 |
9c9b7dffec761731570a26a55c96024e33cf3229 | 2,105 | py | Python | dandi/support/tests/test_iterators.py | TheChymera/dandi-cli | 9a42b1fa2f9af3be01254f7457f5a21d834c1864 | [
"Apache-2.0"
] | 10 | 2020-07-27T02:34:28.000Z | 2022-02-18T19:36:17.000Z | dandi/support/tests/test_iterators.py | TheChymera/dandi-cli | 9a42b1fa2f9af3be01254f7457f5a21d834c1864 | [
"Apache-2.0"
] | 908 | 2019-08-16T20:40:09.000Z | 2022-03-31T19:38:51.000Z | dandi/support/tests/test_iterators.py | TheChymera/dandi-cli | 9a42b1fa2f9af3be01254f7457f5a21d834c1864 | [
"Apache-2.0"
] | 10 | 2019-10-08T03:12:23.000Z | 2022-02-18T19:36:22.000Z | from time import sleep
import pytest
from ..iterators import IteratorWithAggregation
def sleeping_range(n, secs=0.01, thr=None):
"""Fast generator based on range
Parameters
----------
n : int
Number to pass to `range`
secs : float, optional
Seconds to sleep between iterations
th... | 28.445946 | 86 | 0.610451 |
54780ffc04060cacaf9139840829ffc66e979477 | 11,011 | py | Python | data/cro_transformer_models.py | dafrie/fin-disclosures-nlp | aa89013a1b3c621df261d70cad16aeef15c34d25 | [
"MIT"
] | 2 | 2020-06-08T17:07:17.000Z | 2020-06-25T16:04:38.000Z | data/cro_transformer_models.py | dafrie/fin-disclosures-nlp | aa89013a1b3c621df261d70cad16aeef15c34d25 | [
"MIT"
] | 2 | 2020-05-11T17:37:59.000Z | 2020-05-11T17:41:12.000Z | data/cro_transformer_models.py | dafrie/fin-disclosures-nlp | aa89013a1b3c621df261d70cad16aeef15c34d25 | [
"MIT"
] | null | null | null | import os
import numpy as np
from sklearn.metrics import average_precision_score, accuracy_score, balanced_accuracy_score, precision_recall_fscore_support, roc_auc_score, matthews_corrcoef
from sklearn.utils.class_weight import compute_class_weight
from transformers import logging, AutoModelForSequenceClassification,... | 42.513514 | 160 | 0.592226 |
308e63c76843dc2c83c6e852f8d1de8f5c88dc24 | 236 | py | Python | thirdweb/modules/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | 1 | 2022-02-18T16:59:12.000Z | 2022-02-18T16:59:12.000Z | thirdweb/modules/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | null | null | null | thirdweb/modules/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | null | null | null | """All Modules"""
from .nft import NftModule as NftModuleV2
from .nft_v1 import *
from .nft_types import *
from .currency import *
from .market import *
from .pack import *
from .collection import CollectionModule
from .bundle import *
| 23.6 | 41 | 0.762712 |
cf963af522d3404b66c4873948913ee959b74f72 | 10,945 | py | Python | plants_disease_classify_pytorch/main.py | wanghao15536870732/plants_disease_classify | 6d0d1d39f0ec15fc2bd523142c5c403a1577da84 | [
"Apache-2.0"
] | null | null | null | plants_disease_classify_pytorch/main.py | wanghao15536870732/plants_disease_classify | 6d0d1d39f0ec15fc2bd523142c5c403a1577da84 | [
"Apache-2.0"
] | null | null | null | plants_disease_classify_pytorch/main.py | wanghao15536870732/plants_disease_classify | 6d0d1d39f0ec15fc2bd523142c5c403a1577da84 | [
"Apache-2.0"
] | null | null | null | import os
import random
import time
import json
import torch
import torchvision
import numpy as np
import pandas as pd
import warnings
from datetime import datetime
from torch import nn, optim
from config import config
from collections import OrderedDict
from torch.autograd import Variable
from torch.utils.data import ... | 42.921569 | 140 | 0.59863 |
28cec6f2704a461d573f458dd9f5544f37d39c91 | 1,111 | py | Python | src/python/dependencies.py | yinghsienwu/cloud | 9f6d0c0a2b26f0cab307492ef137353fdac842b3 | [
"Apache-2.0"
] | null | null | null | src/python/dependencies.py | yinghsienwu/cloud | 9f6d0c0a2b26f0cab307492ef137353fdac842b3 | [
"Apache-2.0"
] | null | null | null | src/python/dependencies.py | yinghsienwu/cloud | 9f6d0c0a2b26f0cab307492ef137353fdac842b3 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# 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 ... | 28.487179 | 74 | 0.660666 |
95a29421407ab33bb64509191acee4b401870cba | 623 | py | Python | backend/Techfesia2019/events/permissions.py | Sayam753/Techfesia2019 | 40b497a1d98fc27910bba4ad2aad039acdea81f9 | [
"MIT"
] | null | null | null | backend/Techfesia2019/events/permissions.py | Sayam753/Techfesia2019 | 40b497a1d98fc27910bba4ad2aad039acdea81f9 | [
"MIT"
] | null | null | null | backend/Techfesia2019/events/permissions.py | Sayam753/Techfesia2019 | 40b497a1d98fc27910bba4ad2aad039acdea81f9 | [
"MIT"
] | null | null | null | from rest_framework import permissions
class IsStaffUser(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method == 'GET':
return True
else:
if request.user.is_staff or request.user.is_superuser:
return True
... | 28.318182 | 66 | 0.571429 |
7caf358bc7133176fd4fd867f42e095f51a8e575 | 447 | py | Python | jsonschematypes/tests/fixtures.py | locationlabs/jsonschema-types | 82491390ddfed3b17ff6e5fc8d62b4cb92ab05c7 | [
"Apache-2.0"
] | 2 | 2015-05-27T16:40:48.000Z | 2015-05-27T17:25:50.000Z | jsonschematypes/tests/fixtures.py | locationlabs/jsonschema-types | 82491390ddfed3b17ff6e5fc8d62b4cb92ab05c7 | [
"Apache-2.0"
] | 2 | 2015-06-03T17:43:42.000Z | 2022-02-10T08:26:00.000Z | jsonschematypes/tests/fixtures.py | locationlabs/jsonschema-types | 82491390ddfed3b17ff6e5fc8d62b4cb92ab05c7 | [
"Apache-2.0"
] | 2 | 2015-06-03T17:12:10.000Z | 2021-09-08T09:49:45.000Z | """
Common test fixtures.
"""
from os.path import dirname, join
ADDRESS = dict(
street="1600 Pennsylvania Ave",
city="Washington",
state="DC",
)
NAME = dict(
first="George",
last="Washington",
)
RECORD = dict(
name=NAME,
address=ADDRESS,
)
ADDRESS_ID = "http://x.y.z/bar/address"
NAME_I... | 14.419355 | 40 | 0.63311 |
fd197682937f8d9d7cb9145c73bbb0ea2eb2714a | 1,548 | py | Python | migrations/versions/2efa047fe343_fix_issue_increase_string_length_of_.py | Bubblbu/fhe-collector | b587a952eec318eab6cf430383fe83ca85277895 | [
"MIT"
] | null | null | null | migrations/versions/2efa047fe343_fix_issue_increase_string_length_of_.py | Bubblbu/fhe-collector | b587a952eec318eab6cf430383fe83ca85277895 | [
"MIT"
] | null | null | null | migrations/versions/2efa047fe343_fix_issue_increase_string_length_of_.py | Bubblbu/fhe-collector | b587a952eec318eab6cf430383fe83ca85277895 | [
"MIT"
] | null | null | null | """fix issue: increase string length of source in Import() class to 500
Revision ID: 2efa047fe343
Revises: 4a3a663ce25d
Create Date: 2019-03-05 00:30:15.707276
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2efa047fe343'
down_revision = '4a3a663ce25d'
branch_... | 31.591837 | 71 | 0.614987 |
86d50490a6ad74e8526814f464613628ef1c88ea | 2,367 | py | Python | tests/unit/api/test_config.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | 2 | 2019-07-18T22:43:49.000Z | 2020-03-09T03:27:41.000Z | tests/unit/api/test_config.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | 20 | 2019-02-27T19:08:03.000Z | 2021-06-22T16:47:32.000Z | tests/unit/api/test_config.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | null | null | null | import pytest
from discovery import api
def sample_payload():
return {
"Kind": "service-defaults",
"Name": "web",
"Protocol": "http",
}
def config_response():
return {
"Kind": "service-defaults",
"Name": "web",
"Protocol": "http",
"CreateIndex": 1... | 23.909091 | 61 | 0.637938 |
416e9acb820f091da6e50a785a6436e2e0edc9b9 | 801 | py | Python | app/main/forms.py | ruthjelimo/Pitch-app | c70258bd5dfc99520ed662276ef405137597cb1f | [
"MIT"
] | null | null | null | app/main/forms.py | ruthjelimo/Pitch-app | c70258bd5dfc99520ed662276ef405137597cb1f | [
"MIT"
] | null | null | null | app/main/forms.py | ruthjelimo/Pitch-app | c70258bd5dfc99520ed662276ef405137597cb1f | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField,SelectField
from wtforms.validators import DataRequired
class PitchForm(FlaskForm):
details = TextAreaField('Add your pitch', validators=[DataRequired()])
category = SelectField("Choose Category",choices=[('interview','inter... | 42.157895 | 125 | 0.755306 |
bb1d9d55e5935ef59f7cc6aabf762d99f032dd54 | 4,304 | py | Python | update_rundeck_ldap_info.py | dsumike/scripts | 2bbf631248ec6478f1558e54f887b18db7dcacee | [
"MIT"
] | null | null | null | update_rundeck_ldap_info.py | dsumike/scripts | 2bbf631248ec6478f1558e54f887b18db7dcacee | [
"MIT"
] | null | null | null | update_rundeck_ldap_info.py | dsumike/scripts | 2bbf631248ec6478f1558e54f887b18db7dcacee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2015 Mike Johnson
#
# 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 ri... | 30.524823 | 98 | 0.639173 |
e8474f23122c62d914311431ee3b2d054ec78f33 | 11,253 | py | Python | tensorflow/python/saved_model/load.py | KulieX/tensorflow | 0064ad1e1c0fe79832cd8cbb588338683b38c937 | [
"Apache-2.0"
] | 1 | 2019-02-07T13:58:03.000Z | 2019-02-07T13:58:03.000Z | tensorflow/python/saved_model/load.py | KulieX/tensorflow | 0064ad1e1c0fe79832cd8cbb588338683b38c937 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/saved_model/load.py | KulieX/tensorflow | 0064ad1e1c0fe79832cd8cbb588338683b38c937 | [
"Apache-2.0"
] | 2 | 2019-12-27T07:48:05.000Z | 2020-06-13T19:20:14.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.832669 | 107 | 0.734915 |
7b214e6cfab86941e910dd6e1287556f9fb80953 | 10,119 | py | Python | notebooks/helpers.py | leouieda/case-studies-gravity | f1b0b3c18b752ee67b515afb93ebac03f11ea2b4 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 3 | 2018-08-31T05:39:57.000Z | 2020-06-24T08:32:37.000Z | notebooks/helpers.py | GeophysicsLibrary/gravity-case-studies | f1b0b3c18b752ee67b515afb93ebac03f11ea2b4 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 2 | 2018-04-13T03:35:40.000Z | 2018-04-13T21:32:26.000Z | notebooks/helpers.py | GeophysicsLibrary/gravity-case-studies | f1b0b3c18b752ee67b515afb93ebac03f11ea2b4 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | """
Helper functions for displaying data and making interactive plots.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import ipywidgets as widgets
from IPython.display import display, clear_output
import cmocean
import cartopy.crs as ccrs
from cartopy.mpl.ticker import L... | 38.329545 | 79 | 0.591066 |
b399dffd7981ce9c428a48573cc758582b6d208e | 1,793 | py | Python | test/unit/applications/lang/python.py | matuhinal/unit | e019b7113a533b96e1e0fd5acc7b7e28101300d8 | [
"Apache-2.0"
] | null | null | null | test/unit/applications/lang/python.py | matuhinal/unit | e019b7113a533b96e1e0fd5acc7b7e28101300d8 | [
"Apache-2.0"
] | null | null | null | test/unit/applications/lang/python.py | matuhinal/unit | e019b7113a533b96e1e0fd5acc7b7e28101300d8 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
from urllib.parse import quote
import pytest
from unit.applications.proto import TestApplicationProto
from unit.option import option
class TestApplicationPython(TestApplicationProto):
application_type = "python"
load_module = "wsgi"
def load(self, script, name=None, module=None, ... | 27.166667 | 76 | 0.50251 |
641c39c468914770962fe5653c41cb8f6ec4c29c | 605 | py | Python | reverse-vowels-of-a-string/Solution.62349711.py | rahul-ramadas/leetcode | 6c84c2333a613729361c5cdb63dc3fc80203b340 | [
"MIT"
] | null | null | null | reverse-vowels-of-a-string/Solution.62349711.py | rahul-ramadas/leetcode | 6c84c2333a613729361c5cdb63dc3fc80203b340 | [
"MIT"
] | 1 | 2016-09-11T22:26:17.000Z | 2016-09-13T01:49:48.000Z | reverse-vowels-of-a-string/Solution.62349711.py | rahul-ramadas/leetcode | 6c84c2333a613729361c5cdb63dc3fc80203b340 | [
"MIT"
] | null | null | null | class Solution:
def is_vowel(self, c):
vowels = {"a", "e", "i", "o", "u"}
return c.lower() in vowels
def reverseVowels(self, s):
left = 0
right = len(s) - 1
s = list(s)
while left < right:
while left < right and not self.is_v... | 26.304348 | 64 | 0.406612 |
dba7b4c06c721fb49908d94d268f3689fe5b763a | 2,569 | py | Python | kedro/templates/project/{{ cookiecutter.repo_name }}/src/setup.py | monkeyclass/kedro | 65e786bd737de66d3977712dfde6ecca9e81c320 | [
"Apache-2.0"
] | 1 | 2022-01-26T04:50:53.000Z | 2022-01-26T04:50:53.000Z | kedro/templates/project/{{ cookiecutter.repo_name }}/src/setup.py | monkeyclass/kedro | 65e786bd737de66d3977712dfde6ecca9e81c320 | [
"Apache-2.0"
] | null | null | null | kedro/templates/project/{{ cookiecutter.repo_name }}/src/setup.py | monkeyclass/kedro | 65e786bd737de66d3977712dfde6ecca9e81c320 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 QuantumBlack Visual Analytics 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 38.924242 | 86 | 0.694044 |
1968bec034599b962d4f66d4f93b70769b10f7d9 | 2,931 | py | Python | tests/clients/test_dapr_grpc_response.py | karishma-chawla/python-sdk | 15e018d48418cca5e1660c8afe37403b91f6298d | [
"MIT"
] | null | null | null | tests/clients/test_dapr_grpc_response.py | karishma-chawla/python-sdk | 15e018d48418cca5e1660c8afe37403b91f6298d | [
"MIT"
] | null | null | null | tests/clients/test_dapr_grpc_response.py | karishma-chawla/python-sdk | 15e018d48418cca5e1660c8afe37403b91f6298d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
"""
import unittest
from google.protobuf.any_pb2 import Any as GrpcAny
from dapr.clients.grpc._response import DaprResponse, InvokeMethodResponse, BindingResponse
from dapr.proto import common_v1
class DaprResponseTes... | 30.53125 | 91 | 0.655408 |
da453df8a5d5738769f2aeb89e3ad132453f19ff | 4,197 | py | Python | utils/selenium_browser.py | Xiao233-q/JDMemberCloseAccount | 2617ef1e9fc332a7bffceb02c8d11c8596d22b2b | [
"MIT"
] | 1 | 2021-06-06T08:33:21.000Z | 2021-06-06T08:33:21.000Z | utils/selenium_browser.py | Xiao233-q/JDMemberCloseAccount | 2617ef1e9fc332a7bffceb02c8d11c8596d22b2b | [
"MIT"
] | null | null | null | utils/selenium_browser.py | Xiao233-q/JDMemberCloseAccount | 2617ef1e9fc332a7bffceb02c8d11c8596d22b2b | [
"MIT"
] | 1 | 2021-07-05T10:13:35.000Z | 2021-07-05T10:13:35.000Z | import os
import sys
from utils.config import get_file
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
def get_browser(_config):
"""
获取浏览器对象
:return:
"""
browser_type = _config['browserType']
headless = _config['headless']
binary = _config['binary'... | 48.241379 | 120 | 0.582797 |
37f1baa109cd1c5a4c60bb8347e3407aea032ed7 | 6,718 | py | Python | pidi_mpris/screens.py | chme/pidi-mpris | beb96d5221fc6d033333e831624847ba402d05ce | [
"MIT"
] | 1 | 2020-11-26T13:11:43.000Z | 2020-11-26T13:11:43.000Z | pidi_mpris/screens.py | chme/pidi-mpris | beb96d5221fc6d033333e831624847ba402d05ce | [
"MIT"
] | 1 | 2020-11-26T15:06:18.000Z | 2020-11-28T07:19:43.000Z | pidi_mpris/screens.py | chme/pidi-mpris | beb96d5221fc6d033333e831624847ba402d05ce | [
"MIT"
] | null | null | null | '''
The MIT License (MIT)
Copyright (c) 2020 Christian Meffert
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, m... | 31.539906 | 109 | 0.638434 |
3f9884f52a99a1f66bf4b73f3731ae2436246d6b | 5,934 | py | Python | src/sentry/features/__init__.py | lauryndbrown/sentry | c5304e303966566386f5e61df1b72624a30803b4 | [
"BSD-3-Clause"
] | 1 | 2020-02-27T02:46:25.000Z | 2020-02-27T02:46:25.000Z | src/sentry/features/__init__.py | lauryndbrown/sentry | c5304e303966566386f5e61df1b72624a30803b4 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/features/__init__.py | lauryndbrown/sentry | c5304e303966566386f5e61df1b72624a30803b4 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from .base import * # NOQA
from .handler import * # NOQA
from .manager import * # NOQA
# The feature flag system provides a way to turn on or off features of Sentry.
#
# Registering a new feature:
#
# - Determine what scope your feature falls under. By convention we have a
# ... | 49.041322 | 90 | 0.786653 |
c0359db92138e0b43ec02dce90ab9966d4de8fad | 5,281 | py | Python | vqc_qiskit/qdata.py | QML-HEP/ae_qml | f9061fe4eca76aaf0945255c48e13ced2fb6c24c | [
"MIT"
] | 7 | 2021-11-17T12:52:08.000Z | 2022-02-03T14:49:44.000Z | vqc_qiskit/qdata.py | QML-HEP/ae_qml | f9061fe4eca76aaf0945255c48e13ced2fb6c24c | [
"MIT"
] | 2 | 2022-01-21T15:18:37.000Z | 2022-02-11T13:24:34.000Z | vqc_qiskit/qdata.py | QML-HEP/ae_qml | f9061fe4eca76aaf0945255c48e13ced2fb6c24c | [
"MIT"
] | 1 | 2021-12-01T09:22:38.000Z | 2021-12-01T09:22:38.000Z | # Loads the data and an autoencoder model. The original data is passed
# through the AE and the latent space is fed to the qsvm network.
import sys
import os
import numpy as np
sys.path.append("..")
from .terminal_colors import tcols
from autoencoders import data as aedata
from autoencoders import util as aeutil
cl... | 33.636943 | 85 | 0.587199 |
3cefce3965d6bb441e91a8b958de490b05540c0d | 1,414 | py | Python | projects/oldProyects/EWESim/LightBulb.py | GGP00/soba | c193f323f26eccf579a454b8bb4bec4e80644444 | [
"MIT"
] | 1 | 2017-03-06T12:33:02.000Z | 2017-03-06T12:33:02.000Z | projects/oldProyects/EWESim/LightBulb.py | GGP00/soba | c193f323f26eccf579a454b8bb4bec4e80644444 | [
"MIT"
] | 3 | 2017-04-26T08:57:35.000Z | 2019-04-24T08:28:24.000Z | projects/oldProyects/EWESim/LightBulb.py | GGP00/soba | c193f323f26eccf579a454b8bb4bec4e80644444 | [
"MIT"
] | 1 | 2019-01-20T17:39:00.000Z | 2019-01-20T17:39:00.000Z | from transitions import Machine
from mesa import Agent, Model
from transitions import State
class Bulb(Agent):
states = [
State(name='off', on_enter=['set_off']),
State(name='on', on_enter=['set_on'])
]
def __init__(self, unique_id, model, room):
super().__init__(unique_id, mo... | 30.085106 | 85 | 0.522631 |
be1a04c59c7bba10777a3e202050426595e1de10 | 3,330 | py | Python | web2py/applications/rip/modules/VMPrac.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | 1 | 2019-10-02T13:25:03.000Z | 2019-10-02T13:25:03.000Z | web2py/applications/rip/modules/VMPrac.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | null | null | null | web2py/applications/rip/modules/VMPrac.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | 1 | 2021-11-05T09:51:02.000Z | 2021-11-05T09:51:02.000Z | import pyVmomi
from pyVmomi import vim, vmodl
def find_obj(si, name, vimtype, threaded=False):
"""
Find an object in vSphere by it's name and return it
"""
content = si.content
obj_view = content.viewManager.CreateContainerView(content.rootFolder, vimtype, True)
obj_list = obj_view.v... | 32.970297 | 90 | 0.643844 |
bcc5878b0a8eca7943e48f63940555d09efaf0e6 | 778 | py | Python | drnalpha/sic_codes/models.py | UKGovernmentBEIS/BRE_DigitalRegulationNavigator_Alpha | bfa6d08212bc18034b20b9c922a554a6e1ddd0f1 | [
"MIT"
] | null | null | null | drnalpha/sic_codes/models.py | UKGovernmentBEIS/BRE_DigitalRegulationNavigator_Alpha | bfa6d08212bc18034b20b9c922a554a6e1ddd0f1 | [
"MIT"
] | null | null | null | drnalpha/sic_codes/models.py | UKGovernmentBEIS/BRE_DigitalRegulationNavigator_Alpha | bfa6d08212bc18034b20b9c922a554a6e1ddd0f1 | [
"MIT"
] | 1 | 2021-04-21T09:41:43.000Z | 2021-04-21T09:41:43.000Z | from django.db import models
class CodeQuerySet(models.QuerySet):
def related_to_food(self):
return self.filter(
models.Q(code__startswith="10")
| models.Q(code__startswith="11")
| models.Q(code__startswith="56")
)
class Code(models.Model):
code = models.P... | 25.096774 | 59 | 0.661954 |
d86c3b04fb475bc8c62b45803487b9e4e19cac4e | 5,264 | py | Python | cnns/nnlib/robustness/batch_attack/raw_pgd.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 1 | 2018-03-25T13:19:46.000Z | 2018-03-25T13:19:46.000Z | cnns/nnlib/robustness/batch_attack/raw_pgd.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | cnns/nnlib/robustness/batch_attack/raw_pgd.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from typing import Union
def project(x: torch.Tensor, x_adv: torch.Tensor, norm: Union[str, int],
eps: float) -> torch.Tensor:
"""Projects x_adv into the l_norm ball around x
Assumes x and x_adv are 4D Tensors representing batches of images
Args:
x: ... | 34.631579 | 97 | 0.542553 |
6242474447ce0d60548535d3478479418e111873 | 21,356 | py | Python | client/software/resources/modules/MU_Musica.py | MU-Software/Project_Musica_for_Contest | c1f63f381b167d6bfe701a36e998727cf4ed3bec | [
"MIT"
] | null | null | null | client/software/resources/modules/MU_Musica.py | MU-Software/Project_Musica_for_Contest | c1f63f381b167d6bfe701a36e998727cf4ed3bec | [
"MIT"
] | null | null | null | client/software/resources/modules/MU_Musica.py | MU-Software/Project_Musica_for_Contest | c1f63f381b167d6bfe701a36e998727cf4ed3bec | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Project Musica main definition module
import json
try:
from . import *
except:
pass
from __init__ import *
from MU_GUI import *
COMBO_TEXT = \
"""\
COMBO
{0}\
"""
def randomID(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) fo... | 37.865248 | 142 | 0.708653 |
1fd52e657e719d5aa5e86e8f3b96c3512bd00e6a | 2,536 | py | Python | lib/django-1.4/django/contrib/sites/tests.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 26 | 2015-01-20T08:02:38.000Z | 2020-06-10T04:57:41.000Z | lib/django-1.4/django/contrib/sites/tests.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 4 | 2016-02-28T05:53:54.000Z | 2017-01-03T07:39:50.000Z | lib/django-1.4/django/contrib/sites/tests.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 13 | 2016-02-28T00:14:23.000Z | 2021-05-03T15:47:36.000Z | from django.conf import settings
from django.contrib.sites.models import Site, RequestSite, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
from django.test import TestCase
from django.test.utils import override_settings
class SitesFrameworkTests(TestCase):
... | 39.015385 | 82 | 0.680205 |
354acac3f4650bc15132c32b15b69b644fd966eb | 4,630 | py | Python | models/import_products.py | hedra-digital/SOC | 36a99dca15424ff8c06d51eaad2bb21afbfdace5 | [
"MIT"
] | null | null | null | models/import_products.py | hedra-digital/SOC | 36a99dca15424ff8c06d51eaad2bb21afbfdace5 | [
"MIT"
] | null | null | null | models/import_products.py | hedra-digital/SOC | 36a99dca15424ff8c06d51eaad2bb21afbfdace5 | [
"MIT"
] | null | null | null | from odoo import models, fields, api
#try:
# import cStringIO as StringIO
#except ImportError:
# import StringIO
#import csv
#import base64
class import_wizard_product_adj(models.Model):
_name = 'import.wizard.product.adj'
csv_file = fields.Binary("CSV File", required=True)
log = fields.Char()
... | 52.613636 | 163 | 0.520734 |
559593f00d1b4d4a522778582e34ccfc1c85ac83 | 745 | py | Python | visuals/2022-python/circles.py | houseofleft/Processing | 13e65c9ef5918c153ed83dcb44c4b53277f8bdd6 | [
"MIT"
] | 8 | 2020-03-14T20:32:00.000Z | 2020-07-22T17:51:31.000Z | visuals/2022-python/circles.py | houseofleft/generative_processing_scripts | 13e65c9ef5918c153ed83dcb44c4b53277f8bdd6 | [
"MIT"
] | null | null | null | visuals/2022-python/circles.py | houseofleft/generative_processing_scripts | 13e65c9ef5918c153ed83dcb44c4b53277f8bdd6 | [
"MIT"
] | 2 | 2020-03-14T16:33:11.000Z | 2020-03-17T18:07:53.000Z | import shades
import random
canvas = shades.Canvas(1500, 1500)
noise = shades.NoiseField(scale=0.02)
ink = shades.BlockColor()
colors = [
(249, 65, 68),
(243, 114, 44),
(248, 150, 30),
(249, 132, 74),
(249, 199, 79),
(144, 190, 109),
(67, 170, 139),
(77, 144, 142),
(87, 117, 144),
... | 22.575758 | 70 | 0.544966 |
29a9ff2af58a72c0a6358d2019a9a62d3ca481c1 | 287 | py | Python | task_scheduler/src/send_mail_task/views.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | null | null | null | task_scheduler/src/send_mail_task/views.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | 40 | 2020-06-05T22:10:58.000Z | 2022-03-11T23:56:09.000Z | task_scheduler/src/send_mail_task/views.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | 1 | 2021-03-31T10:30:03.000Z | 2021-03-31T10:30:03.000Z | from django.http import HttpResponse
from .tasks import sleepy, deliver_mail_task
def index(request):
sleepy.delay(5)
return HttpResponse('<h1>Done!</h1>')
def deliver_mail(request):
deliver_mail_task.delay()
return HttpResponse('<h1>EMAIL HAS BEEN DELIVERED!</h1>')
| 22.076923 | 61 | 0.731707 |
d9efb4185bdea7b71a00f547041b6ec0f38f282c | 2,612 | py | Python | jwt_frappe/auth.py | anvilerp/jwt_frappe | b034ed23070fdc7ee9dc4a17403d48be75bb8c9e | [
"MIT"
] | 4 | 2020-11-20T18:53:49.000Z | 2021-07-29T05:41:13.000Z | jwt_frappe/auth.py | anvilerp/jwt_frappe | b034ed23070fdc7ee9dc4a17403d48be75bb8c9e | [
"MIT"
] | null | null | null | jwt_frappe/auth.py | anvilerp/jwt_frappe | b034ed23070fdc7ee9dc4a17403d48be75bb8c9e | [
"MIT"
] | 2 | 2021-07-28T20:49:26.000Z | 2021-08-14T22:47:04.000Z | import frappe
import jwt
from frappe.auth import HTTPRequest, LoginManager, get_lang_code, check_session_stopped, CookieManager
# frappe's CookieManager is having old class style
class CookieManagerJWT(CookieManager, object):
def flush_cookies(self, response):
# use this opportunity to set the response headers
... | 31.853659 | 102 | 0.696401 |
c67c179258c3ed3c3cd80fe1ccbbc4a013ab17b7 | 31,043 | py | Python | Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py | sthagen/nasa-fprime | 7762d633d1c0728e68ef9217fb12a7c3070b61ac | [
"Apache-2.0"
] | 1 | 2022-03-15T16:17:15.000Z | 2022-03-15T16:17:15.000Z | Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py | sthagen/nasa-fprime | 7762d633d1c0728e68ef9217fb12a7c3070b61ac | [
"Apache-2.0"
] | null | null | null | Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py | sthagen/nasa-fprime | 7762d633d1c0728e68ef9217fb12a7c3070b61ac | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# NAME: ComponentVisitorBase.py
#
# DESCRIPTION: A base class for test code generation.
#
# AUTHOR: bocchino
# EMAIL: bocchino@jpl.nasa.gov
# DATE CREATED : August 24, 2015
#
# Based on code by Leonard Reder
#
# Copyright 2013, Californ... | 33.669197 | 99 | 0.557807 |
bcc8c1ed778a0e12690192b491efa6d7a64e2b09 | 7,969 | py | Python | scripts/hapbuilder.py | openharmony-gitee-mirror/build | 2eee03d63d877a247e6634438239b38aaa7d3ba6 | [
"Apache-2.0"
] | null | null | null | scripts/hapbuilder.py | openharmony-gitee-mirror/build | 2eee03d63d877a247e6634438239b38aaa7d3ba6 | [
"Apache-2.0"
] | 14 | 2021-09-07T08:39:43.000Z | 2021-09-17T08:50:23.000Z | scripts/hapbuilder.py | openharmony-gitee-mirror/build | 2eee03d63d877a247e6634438239b38aaa7d3ba6 | [
"Apache-2.0"
] | 1 | 2021-09-07T06:19:48.000Z | 2021-09-07T06:19:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Huawei Device 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
#
#... | 39.646766 | 78 | 0.642364 |
f3ed016b0041b597c6087389e18f02754883a817 | 192 | py | Python | app/admin.py | nyagajr/neighborhood | 98955d9c0df46b15d39e861a6eb22655990d7769 | [
"Unlicense"
] | null | null | null | app/admin.py | nyagajr/neighborhood | 98955d9c0df46b15d39e861a6eb22655990d7769 | [
"Unlicense"
] | null | null | null | app/admin.py | nyagajr/neighborhood | 98955d9c0df46b15d39e861a6eb22655990d7769 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Profile, Hood, Business
# Register your models here.
admin.site.register(Profile)
admin.site.register(Hood)
admin.site.register(Business)
| 24 | 43 | 0.807292 |
041dea46e60d90c95da8516067595ebea21277ff | 2,852 | py | Python | opacus/grad_sample/utils.py | parkbeomsik/opacus-reweight | 5c58867a0a405382b107d2d0c1c498a3c98e85b4 | [
"Apache-2.0"
] | null | null | null | opacus/grad_sample/utils.py | parkbeomsik/opacus-reweight | 5c58867a0a405382b107d2d0c1c498a3c98e85b4 | [
"Apache-2.0"
] | null | null | null | opacus/grad_sample/utils.py | parkbeomsik/opacus-reweight | 5c58867a0a405382b107d2d0c1c498a3c98e85b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from opacus.utils.cuda_timer import cuda_timer
from typing import Sequence, Union
import torch
import torch.nn as nn
from .grad_sample_module import GradSampleModule
def register_grad_sampler(target_class_or_classes: Unio... | 33.952381 | 109 | 0.683731 |
bade8151a2401f61492ff799c4a08828923cd11e | 4,748 | py | Python | python/perspective/bench/stresstest/server/server.py | gidsg/perspective | 337ee8ef696b41bbfc83f24451af862166d3b24e | [
"Apache-2.0"
] | null | null | null | python/perspective/bench/stresstest/server/server.py | gidsg/perspective | 337ee8ef696b41bbfc83f24451af862166d3b24e | [
"Apache-2.0"
] | null | null | null | python/perspective/bench/stresstest/server/server.py | gidsg/perspective | 337ee8ef696b41bbfc83f24451af862166d3b24e | [
"Apache-2.0"
] | null | null | null | ################################################################################
#
# Copyright (c) 2019, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
import logging
import argpars... | 27.445087 | 109 | 0.614785 |
e540b4d652ce323a30c353df7781c9ba61e8af23 | 987 | py | Python | src/glod/api/transaction_node.py | gordon-elliott/glod | a381e21455d05d9c005942a3dee4ac67e10f366a | [
"MIT"
] | null | null | null | src/glod/api/transaction_node.py | gordon-elliott/glod | a381e21455d05d9c005942a3dee4ac67e10f366a | [
"MIT"
] | 1 | 2021-03-10T16:48:34.000Z | 2021-03-10T16:48:34.000Z | src/glod/api/transaction_node.py | gordon-elliott/glod | a381e21455d05d9c005942a3dee4ac67e10f366a | [
"MIT"
] | null | null | null | __copyright__ = 'Copyright(c) Gordon Elliott 2018'
"""
"""
from a_tuin.api import (
node_class,
node_connection_field,
get_update_mutation,
get_create_mutation,
get_local_fields
)
from glod.api.transaction_leaf import TransactionLeaf
from glod.db.transaction import Transaction, TransactionQuery
... | 26.675676 | 93 | 0.806484 |
f2f4e10b76d3f2a841b89e24f26a4202e4aefb87 | 21 | py | Python | Unidad 2/packages/extra/good/beta.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | Unidad 2/packages/extra/good/beta.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | Unidad 2/packages/extra/good/beta.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | def funB():
pass
| 7 | 11 | 0.52381 |
fe3a25868d20c9588a6474c66f084dcaba0adaf4 | 1,044 | py | Python | test/test_resources.py | luca-penasa/circle-craters | 62881f7fa7f032c8377dee130598ec7a93ccdae3 | [
"BSD-3-Clause"
] | 1 | 2021-02-01T13:59:29.000Z | 2021-02-01T13:59:29.000Z | test/test_resources.py | europlanet-gmap/circle-craters | 62881f7fa7f032c8377dee130598ec7a93ccdae3 | [
"BSD-3-Clause"
] | null | null | null | test/test_resources.py | europlanet-gmap/circle-craters | 62881f7fa7f032c8377dee130598ec7a93ccdae3 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T13:50:34.000Z | 2020-10-21T13:50:34.000Z | # coding=utf-8
"""Resources test.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = '... | 23.2 | 78 | 0.668582 |
87b48d242faa2f1c7c0757c3f07caa97b9a5fa33 | 852 | py | Python | benchmarks/parse_unsat.py | guluchen/z3 | f96ae3a0f0d7b9fa7cc5cbd9ad138eda2208ca4d | [
"MIT"
] | 3 | 2018-11-01T06:58:00.000Z | 2019-04-25T13:57:59.000Z | benchmarks/parse_unsat.py | PhucVH888/z3 | f7402f8b6134e366a2060571c5176c0e6ea34ddc | [
"MIT"
] | null | null | null | benchmarks/parse_unsat.py | PhucVH888/z3 | f7402f8b6134e366a2060571c5176c0e6ea34ddc | [
"MIT"
] | 4 | 2019-07-19T07:17:12.000Z | 2021-06-21T17:27:14.000Z | #!/usr/bin/env python3
import sys
import os
_base_dir = os.path.dirname(os.path.realpath(__file__))
def main(path):
files = sorted([os.path.join(root, file)
for root, dirs, files in os.walk(path) for file in files])
cmd = "cvc4 --tlimit=15000 --dump-unsat-cores-full --lang sm... | 28.4 | 89 | 0.4777 |
84cb78ab31fa4abc9250e6ac055f33d074da0f0e | 2,164 | py | Python | share/qt/extract_strings_qt.py | swampcoin/AeriumX | 76c4340a9e16ec326b20c4d7a07be88d84ee97e3 | [
"MIT"
] | 5 | 2018-06-10T21:32:12.000Z | 2019-01-13T14:47:12.000Z | share/qt/extract_strings_qt.py | swampcoin/AeriumX | 76c4340a9e16ec326b20c4d7a07be88d84ee97e3 | [
"MIT"
] | 1 | 2019-07-07T08:25:21.000Z | 2019-07-07T08:25:21.000Z | share/qt/extract_strings_qt.py | swampcoin/AeriumX | 76c4340a9e16ec326b20c4d7a07be88d84ee97e3 | [
"MIT"
] | 13 | 2018-06-16T18:01:29.000Z | 2020-08-02T16:36:33.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/aeriumxstrings.cp... | 25.761905 | 105 | 0.619686 |
57e5f53c71ff2d1281ad3f48215d660ced32d547 | 2,078 | py | Python | tests/integration/mci/test_happy_path.py | MebinAbraham/eq-survey-runner | f8bb059bca19371043d79abeefd5d1e6c0e82e79 | [
"MIT"
] | null | null | null | tests/integration/mci/test_happy_path.py | MebinAbraham/eq-survey-runner | f8bb059bca19371043d79abeefd5d1e6c0e82e79 | [
"MIT"
] | null | null | null | tests/integration/mci/test_happy_path.py | MebinAbraham/eq-survey-runner | f8bb059bca19371043d79abeefd5d1e6c0e82e79 | [
"MIT"
] | null | null | null | from tests.integration.integration_test_case import IntegrationTestCase
class HappyPathHelperMixin():
def _happy_path(self, form_type_id, eq_id):
self.launchSurvey(eq_id, form_type_id)
# We are on the introduction page
self.assertInBody('>Start survey<')
self.assertInBody('Monthly... | 34.065574 | 127 | 0.625602 |
e448d02d4af0a4f4d45bc79ec4e176efde0694a4 | 398 | py | Python | chat/admin.py | Pygmy-Final/social-club-backend | ceb2d4ee879900597cf65685f7119c1f03e92637 | [
"MIT"
] | null | null | null | chat/admin.py | Pygmy-Final/social-club-backend | ceb2d4ee879900597cf65685f7119c1f03e92637 | [
"MIT"
] | null | null | null | chat/admin.py | Pygmy-Final/social-club-backend | ceb2d4ee879900597cf65685f7119c1f03e92637 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Message
class MessageAdmin(admin.ModelAdmin):
list_display = ['message', 'seen','sender', 'receiver', 'date_created']
model = Message
def save_model(self, request, obj, form, change):
if obj.receiver != request.user:
obj.sender =... | 30.615385 | 75 | 0.643216 |
66734461d376307888a65124e6a6ae2d98544fbe | 10,134 | py | Python | python/kfserving/kfserving/api/creds_utils.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 6 | 2022-02-15T21:54:19.000Z | 2022-02-16T21:18:54.000Z | python/kfserving/kfserving/api/creds_utils.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 7 | 2021-08-31T23:55:06.000Z | 2022-03-02T11:34:58.000Z | python/kfserving/kfserving/api/creds_utils.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 2 | 2021-12-16T10:32:07.000Z | 2022-02-28T17:08:52.000Z | # Copyright 2019 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 38.679389 | 98 | 0.67091 |
69767362695f02aa204d4a40ac63f4051d009e16 | 1,876 | py | Python | solutions/543. Diameter of Binary Tree.py | JacopoPan/leetcode-top100-liked-questions | 03dc05f087d05805d54b7585ce740338f3128833 | [
"MIT"
] | null | null | null | solutions/543. Diameter of Binary Tree.py | JacopoPan/leetcode-top100-liked-questions | 03dc05f087d05805d54b7585ce740338f3128833 | [
"MIT"
] | null | null | null | solutions/543. Diameter of Binary Tree.py | JacopoPan/leetcode-top100-liked-questions | 03dc05f087d05805d54b7585ce740338f3128833 | [
"MIT"
] | null | null | null | """
Runtime: 472 ms, faster than 6.80% of Python3 online submissions for Diameter of Binary Tree.
Memory Usage: 16 MB, less than 93.37% of Python3 online submissions for Diameter of Binary Tree.
"""
from typing import List
from typing import Optional
class TreeNode:
def __init__(self, val=0, left=None, right=None)... | 38.285714 | 99 | 0.637527 |
a81eee5a35567b4f49467a43fb07a1f130595f4f | 10,963 | py | Python | runstats/core.py | cimeister/runstats | 81bb3f7eb8dc1adc197dc3761c28dcc46fc76976 | [
"Apache-2.0"
] | 1 | 2020-12-07T11:23:01.000Z | 2020-12-07T11:23:01.000Z | runstats/core.py | cimeister/runstats | 81bb3f7eb8dc1adc197dc3761c28dcc46fc76976 | [
"Apache-2.0"
] | null | null | null | runstats/core.py | cimeister/runstats | 81bb3f7eb8dc1adc197dc3761c28dcc46fc76976 | [
"Apache-2.0"
] | null | null | null | """Python RunStats
Compute Statistics and Regression in a single pass.
"""
from __future__ import division
class Statistics(object):
"""Compute statistics in a single pass.
# pylint: disable=too-many-instance-attributes
Computes the minimum, maximum, mean, variance, standard deviation,
skewness, a... | 27.966837 | 79 | 0.551035 |
7f5534c8573bae5036dbd860f93da0aea314de22 | 21,151 | py | Python | com/vmware/nsx_policy/infra/deployment_zones_client.py | vishal-12/vsphere-automation-sdk-python | 9cf363971db77ea5a12928eecd5cf5170a7fcd8a | [
"MIT"
] | null | null | null | com/vmware/nsx_policy/infra/deployment_zones_client.py | vishal-12/vsphere-automation-sdk-python | 9cf363971db77ea5a12928eecd5cf5170a7fcd8a | [
"MIT"
] | null | null | null | com/vmware/nsx_policy/infra/deployment_zones_client.py | vishal-12/vsphere-automation-sdk-python | 9cf363971db77ea5a12928eecd5cf5170a7fcd8a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2019 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.nsx_policy.infra.deployment_zones.
#------------------------------------------------... | 44.622363 | 127 | 0.604463 |
3c8fe959d77775122bfbb76d80b4ae1c2ccf6e8c | 4,928 | py | Python | tests/test_valid_tzdatetimefield.py | heavenshell/django-timezone-utils | e6a3da069dd3490135c57dc8ca94877e03026ac5 | [
"MIT"
] | 28 | 2015-02-06T01:41:15.000Z | 2020-12-27T19:23:18.000Z | tests/test_valid_tzdatetimefield.py | heavenshell/django-timezone-utils | e6a3da069dd3490135c57dc8ca94877e03026ac5 | [
"MIT"
] | 15 | 2015-02-06T01:41:15.000Z | 2022-02-16T02:04:17.000Z | tests/test_valid_tzdatetimefield.py | heavenshell/django-timezone-utils | e6a3da069dd3490135c57dc8ca94877e03026ac5 | [
"MIT"
] | 10 | 2015-02-06T01:57:08.000Z | 2022-02-14T10:46:38.000Z | # ==============================================================================
# IMPORTS
# ==============================================================================
# Python
from datetime import datetime
import pytz
# Django
from django.conf import settings
from django.test import TestCase
from django.utils.tim... | 33.753425 | 80 | 0.576705 |
1199940b95d378f5b87c8ff37e6af5beb2ef0b3b | 4,465 | py | Python | examples/surname_classification_with_cnn/surname_dataset.py | Jochen-M/pytorch_nlp | 75ffbe60d1a9c383981396f346c6dcbabbb9e5d7 | [
"Apache-2.0"
] | 1 | 2019-11-21T13:07:41.000Z | 2019-11-21T13:07:41.000Z | examples/surname_classification_with_cnn/surname_dataset.py | Jochen-M/pytorch_nlp | 75ffbe60d1a9c383981396f346c6dcbabbb9e5d7 | [
"Apache-2.0"
] | null | null | null | examples/surname_classification_with_cnn/surname_dataset.py | Jochen-M/pytorch_nlp | 75ffbe60d1a9c383981396f346c6dcbabbb9e5d7 | [
"Apache-2.0"
] | null | null | null | # coding: utf8
import json
import torch
import pandas as pd
from torch.utils.data import Dataset
from examples.surname_classification_with_cnn.surname_vectorizer import SurnameVectorizer
class SurnameDataset(Dataset):
def __init__(self, surname_df, vectorizer):
"""
:param surname_df (pandas.Data... | 36.300813 | 92 | 0.663382 |
37c7c6653da52bab1d4dd0c31c7b66f987f0f2ae | 890 | py | Python | wdfn-server/waterdata/services/sifta.py | skaymen/waterdataui | 3f419360771a007f8b441d631c782cd67a4e78b4 | [
"CC0-1.0"
] | null | null | null | wdfn-server/waterdata/services/sifta.py | skaymen/waterdataui | 3f419360771a007f8b441d631c782cd67a4e78b4 | [
"CC0-1.0"
] | null | null | null | wdfn-server/waterdata/services/sifta.py | skaymen/waterdataui | 3f419360771a007f8b441d631c782cd67a4e78b4 | [
"CC0-1.0"
] | null | null | null | """
Helpers to retrieve SIFTA cooperator data.
"""
from waterdata import app
from waterdata.utils import execute_get_request
def get_cooperators(site_no, district_cd):
"""
Gets the cooperator data from a json file, currently a feature toggle, and limited to district codes 20 and 51
:param site_no: USGS ... | 30.689655 | 114 | 0.708989 |
43e229010da2ae4bc7eb6e09e7f0b3b191ea1a4f | 21,552 | py | Python | python-package/basedosdados/cli/cli.py | ProfLeao/mais | 364baa36a21d1189be594ecb9915f6fcc73c8990 | [
"MIT"
] | 1 | 2021-02-25T04:04:23.000Z | 2021-02-25T04:04:23.000Z | python-package/basedosdados/cli/cli.py | ProfLeao/mais | 364baa36a21d1189be594ecb9915f6fcc73c8990 | [
"MIT"
] | null | null | null | python-package/basedosdados/cli/cli.py | ProfLeao/mais | 364baa36a21d1189be594ecb9915f6fcc73c8990 | [
"MIT"
] | null | null | null | import os
import time
import basedosdados as bd
import click
from basedosdados.upload.base import Base
from basedosdados.upload.dataset import Dataset
from basedosdados.upload.storage import Storage
from basedosdados.upload.table import Table
@click.group()
@click.option("--templates", default=None, help="Templates ... | 26.872818 | 211 | 0.673859 |
932d3fa3f91b8994038486156652d6e54a31080e | 482 | py | Python | tests/test_rsp.py | giltom/megastone | 0ef02c724d53acf7a06430f58bc5f777676d78a9 | [
"MIT"
] | 2 | 2021-04-03T01:55:09.000Z | 2021-04-12T15:12:10.000Z | tests/test_rsp.py | giltom/megastone | 0ef02c724d53acf7a06430f58bc5f777676d78a9 | [
"MIT"
] | null | null | null | tests/test_rsp.py | giltom/megastone | 0ef02c724d53acf7a06430f58bc5f777676d78a9 | [
"MIT"
] | null | null | null | import pytest
from megastone.rsp import connection
def test_escape():
data = b'}a$#+b*j'
escaped = connection._escape_data(data)
assert len(escaped) == len(data) + 4
assert escaped.count(connection.ESCAPE_BYTE) == 4
assert connection._unescape_data(escaped) == data
def test_unescape():
data ... | 28.352941 | 55 | 0.697095 |
f101e0665ca7e7e98702a9725f431c0326ab86be | 1,210 | py | Python | src/others/logging.py | husnain-ali21/ctx-rewriter-for-summ | cd172bd934d804aec2c15127fc16276bd60213f4 | [
"MIT"
] | 22 | 2021-03-10T14:43:13.000Z | 2022-03-18T02:20:12.000Z | src/others/logging.py | husnain-ali21/ctx-rewriter-for-summ | cd172bd934d804aec2c15127fc16276bd60213f4 | [
"MIT"
] | 2 | 2021-03-02T09:19:48.000Z | 2021-03-14T13:22:09.000Z | src/others/logging.py | husnain-ali21/ctx-rewriter-for-summ | cd172bd934d804aec2c15127fc16276bd60213f4 | [
"MIT"
] | 3 | 2021-09-27T09:39:46.000Z | 2022-02-05T03:42:06.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
logger = logging.getLogger()
def init_logger(log_file=None, log_file_level=logging.NOTSET):
log_format = logging.Formatter("[%(asctime)s %(levelname)s] %(message)s")
logger = logging.getLogger()
logger.setLevel(logging.INFO)
... | 32.702703 | 77 | 0.726446 |
941085ac8e0a1044e47bf960dea29a2727972a75 | 1,605 | py | Python | salt/returners/cassandra_return.py | mattrobenolt/salt | e01a4c2d26adc705d8056970777a6313ad10291b | [
"Apache-2.0"
] | 4 | 2015-10-06T22:20:27.000Z | 2017-09-04T08:03:44.000Z | salt/returners/cassandra_return.py | mika/salt | 8430482c7177356964c894d161830c94d09f1cab | [
"Apache-2.0"
] | null | null | null | salt/returners/cassandra_return.py | mika/salt | 8430482c7177356964c894d161830c94d09f1cab | [
"Apache-2.0"
] | null | null | null | '''
Return data to a Cassandra ColumnFamily
Here's an example Keyspace / ColumnFamily setup that works with this
returner::
create keyspace salt;
use salt;
create column family returns
with key_validation_class='UTF8Type'
and comparator='UTF8Type'
and default_validation_class='UTF8Type';... | 25.887097 | 72 | 0.624922 |
562f4e6956c303d0471482bb5d8fe8841ce911a7 | 3,379 | py | Python | queue.py | deepti-chauhan/Data_Structures_in_python | 7a3c88fb636b0b69ed880e2da08802e473da657a | [
"MIT"
] | null | null | null | queue.py | deepti-chauhan/Data_Structures_in_python | 7a3c88fb636b0b69ed880e2da08802e473da657a | [
"MIT"
] | null | null | null | queue.py | deepti-chauhan/Data_Structures_in_python | 7a3c88fb636b0b69ed880e2da08802e473da657a | [
"MIT"
] | null | null | null |
''' Like stack, queue is a linear data structure that stores items in First In First Out (FIFO) manner.
With a queue the least recently added item is removed first.
A good example of queue is any queue of consumers for a resource where the consumer that came first is served first.'''
class Queue(obje... | 31 | 124 | 0.483575 |
af198764fda7f5c13e34d6a91c029d9a4a8a1427 | 12,030 | py | Python | test/testers/winforms/numericupdown-regression.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | 1 | 2019-08-13T15:22:12.000Z | 2019-08-13T15:22:12.000Z | test/testers/winforms/numericupdown-regression.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | null | null | null | test/testers/winforms/numericupdown-regression.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | 1 | 2019-08-13T15:22:17.000Z | 2019-08-13T15:22:17.000Z | #!/usr/bin/env python
# vim: set tabstop=4 shiftwidth=4 expandtab
##############################################################################
# Written by: Cachen Chen <cachen@novell.com>
# Date: 09/08/2008
# Description: main test script of numericupdown
# ../samples/winforms/numericupdown.py i... | 39.313725 | 116 | 0.738238 |
bdddf6204a6c0847c23c129705bb231b06e4670a | 310 | py | Python | packages/pycopy/v2.11.0.1/esp32/stubs/ntptime.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 18 | 2019-07-11T13:31:09.000Z | 2022-01-27T06:38:40.000Z | packages/pycopy/v2.11.0.1/esp32/stubs/ntptime.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 9 | 2019-09-01T21:44:49.000Z | 2022-02-04T20:55:08.000Z | packages/pycopy/v2.11.0.1/esp32/stubs/ntptime.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 6 | 2019-10-08T05:31:21.000Z | 2021-04-22T10:21:01.000Z | """
Module: 'ntptime' on esp32 1.11.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v2.11.0.1 on 2019-07-26', machine='ESP32 module with ESP32')
# Stubber: 1.2.0
NTP_DELTA = 3155673600
host = 'pool.ntp.org'
def settime():
pass
socket = None
struct = None
def time():
pass
| 19.375 | 130 | 0.648387 |
69b78bce2963194b3d3e2b2a286371b2db336773 | 810 | py | Python | manage.py | yashasvibajpai/UrlShortener | 28f9de5309cd3aec7bd5c0f061a5baa87dafa4f2 | [
"MIT"
] | 64 | 2017-06-14T14:35:16.000Z | 2021-04-20T07:52:53.000Z | manage.py | yashasvibajpai/UrlShortener | 28f9de5309cd3aec7bd5c0f061a5baa87dafa4f2 | [
"MIT"
] | 26 | 2017-06-04T17:57:05.000Z | 2021-09-22T17:38:09.000Z | manage.py | yashasvibajpai/UrlShortener | 28f9de5309cd3aec7bd5c0f061a5baa87dafa4f2 | [
"MIT"
] | 118 | 2017-06-05T22:08:02.000Z | 2020-10-04T07:52:14.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "UrlShortener.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that... | 35.217391 | 77 | 0.644444 |
9e0bc0e3381df61cb87b4c26e5241fef2a648c4d | 7,975 | py | Python | decryptoquote/cypherlettermap.py | ROldford/decryptoquote | daa30d5594fac4472e01ed3dd2f83f4520ff0e6d | [
"MIT"
] | null | null | null | decryptoquote/cypherlettermap.py | ROldford/decryptoquote | daa30d5594fac4472e01ed3dd2f83f4520ff0e6d | [
"MIT"
] | 6 | 2020-02-26T19:23:49.000Z | 2021-08-04T03:38:35.000Z | decryptoquote/cypherlettermap.py | ROldford/decryptoquote | daa30d5594fac4472e01ed3dd2f83f4520ff0e6d | [
"MIT"
] | null | null | null | from typing import Dict, Optional, List, Tuple
from decryptoquote.constants import LETTERS, PUNCTUATION
class CypherLetterMap:
"""
This class maps coded letters to matching decoded letters, or to `None` if
no matching value has been determined.
"""
def __init__(self):
self._clmap: Dict[s... | 39.285714 | 83 | 0.573417 |
17c0a1c2c539f118d7131dab17ea861cd4934694 | 1,221 | py | Python | podcast-backend/src/app/__init__.py | cuappdev/archives | 061d0f9cccf278363ffaeb27fc655743b1052ae5 | [
"MIT"
] | null | null | null | podcast-backend/src/app/__init__.py | cuappdev/archives | 061d0f9cccf278363ffaeb27fc655743b1052ae5 | [
"MIT"
] | null | null | null | podcast-backend/src/app/__init__.py | cuappdev/archives | 061d0f9cccf278363ffaeb27fc655743b1052ae5 | [
"MIT"
] | null | null | null | import os
import datetime
import logging
from logging.handlers import RotatingFileHandler
from flask import Flask, render_template, jsonify, make_response
from flask_sqlalchemy import SQLAlchemy
import config
# Configure Flask app
app = Flask(__name__, static_url_path='/templates')
app.config.from_object(os.environ['A... | 29.780488 | 66 | 0.773137 |
78e955ad94734a28b5874d2109859be64aca8802 | 1,965 | py | Python | tests/models/test_clf_evaluation.py | WadhwaniAI/cac-test-release | 066c554a354f0043f8ac83c9d6421a8397b17ba5 | [
"Apache-2.0"
] | 24 | 2021-05-13T13:34:27.000Z | 2022-03-02T13:52:29.000Z | tests/models/test_clf_evaluation.py | WadhwaniAI/cac-test-release | 066c554a354f0043f8ac83c9d6421a8397b17ba5 | [
"Apache-2.0"
] | 2 | 2021-07-09T08:21:31.000Z | 2022-02-11T15:30:55.000Z | tests/models/test_clf_evaluation.py | WadhwaniAI/cac-test-release | 066c554a354f0043f8ac83c9d6421a8397b17ba5 | [
"Apache-2.0"
] | 6 | 2021-06-10T07:47:48.000Z | 2022-01-27T07:36:09.000Z | """Tests cac.models.classification.ClassificationModel evaluation"""
import os
from os.path import dirname, join, exists
from copy import deepcopy
import torch
import wandb
import unittest
from tqdm import tqdm
import numpy as np
from torch import optim
from torch.nn import Conv2d, BatchNorm2d, LeakyReLU
from cac.confi... | 33.87931 | 69 | 0.678372 |
28e224389be540007d9d07ecf53ed229b77c3e85 | 1,928 | py | Python | frontend/amundsen_application/proxy/issue_tracker_clients/__init__.py | defendercrypt/amundsen | 83c728b646020f60cf2270c12e766fe4af8c9948 | [
"Apache-2.0"
] | 2,072 | 2020-08-11T20:16:48.000Z | 2022-03-31T07:04:05.000Z | frontend/amundsen_application/proxy/issue_tracker_clients/__init__.py | defendercrypt/amundsen | 83c728b646020f60cf2270c12e766fe4af8c9948 | [
"Apache-2.0"
] | 795 | 2020-08-11T15:24:39.000Z | 2022-03-31T18:56:13.000Z | frontend/amundsen_application/proxy/issue_tracker_clients/__init__.py | defendercrypt/amundsen | 83c728b646020f60cf2270c12e766fe4af8c9948 | [
"Apache-2.0"
] | 671 | 2020-08-11T20:39:56.000Z | 2022-03-31T08:39:07.000Z | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from flask import current_app as app
from threading import Lock
from werkzeug.utils import import_string
from amundsen_application.base.base_issue_tracker_client import BaseIssueTrackerClient
_issue_tracker_client = None
_issue_t... | 41.021277 | 89 | 0.624481 |
1a84bb98f04894507afbc980aecf632e023b2343 | 373 | py | Python | setup.py | mcflugen/roms-lite | 9c226314d6c81227d311e3348193b66acaf548fe | [
"MIT"
] | null | null | null | setup.py | mcflugen/roms-lite | 9c226314d6c81227d311e3348193b66acaf548fe | [
"MIT"
] | null | null | null | setup.py | mcflugen/roms-lite | 9c226314d6c81227d311e3348193b66acaf548fe | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name='roms_lite',
version='0.1.0',
author='Eric Hutton',
author_email='eric.hutton@colorado.edu',
description='Python BMI for ROMS-Lite',
long_description=open('R... | 24.866667 | 48 | 0.697051 |
f1e30e8d2e10a88ac72831ee99db3b728ac645ca | 2,072 | py | Python | Collect/GLDASnew/__init__.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | 3 | 2021-01-26T11:21:31.000Z | 2021-12-31T21:28:18.000Z | Collect/GLDAS/__init__.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | null | null | null | Collect/GLDAS/__init__.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | 4 | 2019-01-02T06:45:55.000Z | 2021-06-30T11:51:38.000Z | # -*- coding: utf-8 -*-
"""
Authors: Tim Hessels
Module: Collect/GLDAS
Description:
This script automatically downloads GLDAS 2.0 or 2.1 data with a 0.25 degree
resolution for different extends based on their opendap server. The time
interval available are: three-hourly ('3hour'), daily ('day'), and monthly
('month')... | 45.043478 | 191 | 0.725869 |
b651fdd242c348963262636ab0abc81c3f4bdbd0 | 1,085 | py | Python | libs/astro_data/__init__.py | crazygmr101/Almanac | 2309325f21ef06f96c700740162875b2f085678a | [
"MIT"
] | null | null | null | libs/astro_data/__init__.py | crazygmr101/Almanac | 2309325f21ef06f96c700740162875b2f085678a | [
"MIT"
] | null | null | null | libs/astro_data/__init__.py | crazygmr101/Almanac | 2309325f21ef06f96c700740162875b2f085678a | [
"MIT"
] | null | null | null | """
Copyright 2021 crazygmr101
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, publish, distribute, subl... | 60.277778 | 119 | 0.795392 |
e9c8ed11528ac1a7a03a9e2e5c4609a301717f9f | 7,876 | py | Python | test/kernel/test_kernel_cordiv_kernel_in_stream.py | jingjieli95/UnarySim | 775b38fa2d6b05a69fd73acb4766e50200a5cc37 | [
"MIT"
] | 17 | 2020-04-26T19:38:03.000Z | 2022-02-23T02:05:08.000Z | test/kernel/test_kernel_cordiv_kernel_in_stream.py | pan185/UnarySim | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | [
"MIT"
] | 3 | 2021-11-03T18:20:29.000Z | 2022-02-11T16:30:16.000Z | test/kernel/test_kernel_cordiv_kernel_in_stream.py | pan185/UnarySim | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | [
"MIT"
] | 9 | 2019-12-03T05:08:55.000Z | 2022-01-04T20:24:55.000Z | # %%
import torch
from UnarySim.kernel.div import FSUDiv
from UnarySim.stream.gen import RNG, SourceGen, BSGen
from UnarySim.metric.metric import ProgError
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import ticker, cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import t... | 39.979695 | 146 | 0.5871 |
91c7bc5c1f05ac5a89d6ff3e0448e83520e7bf5d | 3,570 | py | Python | google/ads/googleads/v6/services/services/topic_view_service/transports/base.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/topic_view_service/transports/base.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/topic_view_service/transports/base.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35 | 78 | 0.67619 |
60e02f1b6c501c976e585b2565c484a9ffbfb59d | 7,543 | py | Python | battleship/battleship.py | TrustyJAID/FlameCogs | 8a3bb1b54fea760b2f9c019e4fb6782453ea4f29 | [
"MIT"
] | null | null | null | battleship/battleship.py | TrustyJAID/FlameCogs | 8a3bb1b54fea760b2f9c019e4fb6782453ea4f29 | [
"MIT"
] | null | null | null | battleship/battleship.py | TrustyJAID/FlameCogs | 8a3bb1b54fea760b2f9c019e4fb6782453ea4f29 | [
"MIT"
] | null | null | null | import discord
from redbot.core import commands
from redbot.core import Config
from redbot.core import checks
import asyncio
class Battleship(commands.Cog):
"""Play battleship with one other person."""
def __init__(self, bot):
self.bot = bot
self.runningin = []
self.config = Config.get_conf(self, identifier=73... | 38.28934 | 415 | 0.593663 |
a7ce3239986414c113f9cf29d9137991d40366a5 | 301 | py | Python | onnx_coreml/__init__.py | karfly/onnx-coreml | 0e423d0b4779af21479c338ed82f3864434e4c21 | [
"MIT"
] | null | null | null | onnx_coreml/__init__.py | karfly/onnx-coreml | 0e423d0b4779af21479c338ed82f3864434e4c21 | [
"MIT"
] | null | null | null | onnx_coreml/__init__.py | karfly/onnx-coreml | 0e423d0b4779af21479c338ed82f3864434e4c21 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .converter import convert
# onnx-coreml version
__version__ = '1.3'
__all__ = ['convert']
print("You're using onnx-coreml hacked by @karfly!")
| 21.5 | 52 | 0.803987 |
9c8028af6de8b854bce77af04ff149d397be3ff9 | 14,819 | py | Python | RobotMovingPanel/interface/interfaceLogic.py | Vlad12344/Pulseapi_Integration | 2acf93a17dd2911328141886b8724134fff84f00 | [
"MIT"
] | null | null | null | RobotMovingPanel/interface/interfaceLogic.py | Vlad12344/Pulseapi_Integration | 2acf93a17dd2911328141886b8724134fff84f00 | [
"MIT"
] | null | null | null | RobotMovingPanel/interface/interfaceLogic.py | Vlad12344/Pulseapi_Integration | 2acf93a17dd2911328141886b8724134fff84f00 | [
"MIT"
] | null | null | null | import os
import sys
import time
from math import radians
from PyQt5 import QtWidgets, QtCore, QtGui
# from RobotMovingPanel.features import tcp
from pulseapi_integration import NewRobotPulse, jog, PulseApiException
from pulseapi_integration.utils import position_2_xyzrpw
from pulseapi import tool_info, tool_shape, po... | 36.680693 | 106 | 0.623186 |
56036887d4a57e51cac65632b323abebb9772fe7 | 8,626 | py | Python | opytimizer/optimizers/swarm/sfo.py | anukaal/opytimizer | 5f1ccc0da80e6a4cabd99578fa24cf4f6466f9b9 | [
"Apache-2.0"
] | 528 | 2018-10-01T20:00:09.000Z | 2022-03-27T11:15:31.000Z | opytimizer/optimizers/swarm/sfo.py | anukaal/opytimizer | 5f1ccc0da80e6a4cabd99578fa24cf4f6466f9b9 | [
"Apache-2.0"
] | 17 | 2019-10-30T00:47:03.000Z | 2022-03-21T11:39:28.000Z | opytimizer/optimizers/swarm/sfo.py | anukaal/opytimizer | 5f1ccc0da80e6a4cabd99578fa24cf4f6466f9b9 | [
"Apache-2.0"
] | 35 | 2018-10-01T20:03:23.000Z | 2022-03-20T03:54:15.000Z | """Sailfish Optimizer.
"""
import copy
import numpy as np
import opytimizer.math.random as r
import opytimizer.utils.exception as ex
import opytimizer.utils.logging as l
from opytimizer.core import Optimizer
logger = l.get_logger(__name__)
class SFO(Optimizer):
"""A SFO class, inherited from Optimizer.
T... | 28.657807 | 99 | 0.585092 |
a2890b3e014659ba9de1d3be0cdba0b646ed80e1 | 1,562 | py | Python | pype/plugins/maya/create/create_rendersetup.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | pype/plugins/maya/create/create_rendersetup.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | pype/plugins/maya/create/create_rendersetup.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | import avalon.maya
import pype.maya.lib as lib
from maya import cmds
class CreateRenderSetup(avalon.maya.Creator):
"""Create rendersetup template json data"""
name = "rendersetup"
label = "Render Setup Preset"
family = "rendersetup"
icon = "tablet"
def __init__(self, *args, **kwargs):
... | 28.925926 | 78 | 0.567862 |
dabdebf702e5ca56463c2a35a369cb463da8098a | 15,501 | py | Python | src/toast/pipeline_tools/madam.py | ziotom78/toast | 66aef04c833a28f0928a0bbc221da45882aae475 | [
"BSD-2-Clause"
] | null | null | null | src/toast/pipeline_tools/madam.py | ziotom78/toast | 66aef04c833a28f0928a0bbc221da45882aae475 | [
"BSD-2-Clause"
] | null | null | null | src/toast/pipeline_tools/madam.py | ziotom78/toast | 66aef04c833a28f0928a0bbc221da45882aae475 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2019 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
import argparse
import copy
import os
import re
import numpy as np
from ..timing import function_timer, Timer
from ..utils import... | 30.817097 | 85 | 0.582737 |
f02943c6aeebccab135dab55c6c24578010567d6 | 1,479 | py | Python | multiAgentEnv/MARL/DDPG/agents/replay_buffer.py | eranbTAU/Closing-the-Reality-Gap-for-a-Multi-Agent-System-Using-GAN | 3df5f8ba1069ce3f16f1ab743da9cbdd3bddd43c | [
"MIT"
] | null | null | null | multiAgentEnv/MARL/DDPG/agents/replay_buffer.py | eranbTAU/Closing-the-Reality-Gap-for-a-Multi-Agent-System-Using-GAN | 3df5f8ba1069ce3f16f1ab743da9cbdd3bddd43c | [
"MIT"
] | null | null | null | multiAgentEnv/MARL/DDPG/agents/replay_buffer.py | eranbTAU/Closing-the-Reality-Gap-for-a-Multi-Agent-System-Using-GAN | 3df5f8ba1069ce3f16f1ab743da9cbdd3bddd43c | [
"MIT"
] | 1 | 2022-02-22T11:06:40.000Z | 2022-02-22T11:06:40.000Z | import numpy as np
class ReplayBuffer():
def __init__(self, size=10**6, batch_size = 64, state_dim = 14, action_dim = 2):
self.buffer_size = size
self.states_buffer = np.zeros((size, state_dim), dtype=np.float)
self.actions_buffer = np.zeros((size, action_dim), dtype=np.float)
sel... | 44.818182 | 99 | 0.665991 |
9fe8dafcc8edd6b80625c61a4a0e783e65b44720 | 56,526 | py | Python | tensorflow/contrib/lookup/lookup_ops_test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 36 | 2016-12-17T15:25:25.000Z | 2022-01-29T21:50:53.000Z | tensorflow/contrib/lookup/lookup_ops_test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 59 | 2019-06-17T09:37:49.000Z | 2022-01-19T01:21:34.000Z | tensorflow/contrib/lookup/lookup_ops_test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2016 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... | 38.01345 | 80 | 0.657768 |
0351b80de5a7bdd33a3a4c42bcbf248e41f2532f | 54,240 | py | Python | biothings/hub/databuild/differ.py | sirloon/biothings.api | 8a981fa2151e368d0ca76aaf226eb565d794d4fb | [
"Apache-2.0"
] | null | null | null | biothings/hub/databuild/differ.py | sirloon/biothings.api | 8a981fa2151e368d0ca76aaf226eb565d794d4fb | [
"Apache-2.0"
] | null | null | null | biothings/hub/databuild/differ.py | sirloon/biothings.api | 8a981fa2151e368d0ca76aaf226eb565d794d4fb | [
"Apache-2.0"
] | null | null | null | import os, re, shutil, copy
import time, hashlib
import pickle, json
from datetime import datetime
from pprint import pformat, pprint
import asyncio
from functools import partial
import glob, random
from biothings.utils.common import timesofar, iter_n, get_timestamp, \
dump, rmdashfr... | 47.495622 | 173 | 0.556895 |
3e89a4be790a68625982bd59ec8d0dac460424e6 | 109,762 | py | Python | sympy/core/expr.py | nishithshah2211/sympy | edc620ca662f7163637c7fb5823f22523b7f2fe9 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/expr.py | nishithshah2211/sympy | edc620ca662f7163637c7fb5823f22523b7f2fe9 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/expr.py | nishithshah2211/sympy | edc620ca662f7163637c7fb5823f22523b7f2fe9 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from .core import C
from .sympify import sympify, _sympify, SympifyError
from .basic import Basic, Atom
from .singleton import S
from .evalf import EvalfMixin, pure_complex
from .decorators import _sympifyit, call_highest_priority
from .cache import cacheit
from .compati... | 34.636163 | 109 | 0.524881 |
287301ccc71e2a8280fe9e14b1ccd360ce80414f | 2,254 | py | Python | rasa_core/visualize.py | DavidSted/rasa_core | 2b072e564373ad680600947521805911f44f3732 | [
"Apache-2.0"
] | 1 | 2018-12-05T22:30:43.000Z | 2018-12-05T22:30:43.000Z | rasa_core/visualize.py | DavidSted/rasa_core | 2b072e564373ad680600947521805911f44f3732 | [
"Apache-2.0"
] | 6 | 2020-01-28T22:38:59.000Z | 2022-02-10T00:11:15.000Z | rasa_core/visualize.py | DavidSted/rasa_core | 2b072e564373ad680600947521805911f44f3732 | [
"Apache-2.0"
] | 6 | 2018-09-19T20:53:13.000Z | 2018-10-24T14:37:12.000Z | import argparse
import logging
import os
from rasa_core import utils, config, cli
from rasa_core.agent import Agent
logger = logging.getLogger(__name__)
def create_argument_parser():
"""Parse all the command line arguments for the visualisation script."""
parser = argparse.ArgumentParser(
descripti... | 30.876712 | 76 | 0.672582 |
354a5b06363de9e8dcf44e2c8f7978c32b121579 | 17,765 | py | Python | Examples/FanFicFare-master/fanficfare/adapters/base_efiction_adapter.py | TomNorrie/ePubify | 89c89bd22cafdea787f3131ca9cdc8336209ed6c | [
"MIT"
] | null | null | null | Examples/FanFicFare-master/fanficfare/adapters/base_efiction_adapter.py | TomNorrie/ePubify | 89c89bd22cafdea787f3131ca9cdc8336209ed6c | [
"MIT"
] | null | null | null | Examples/FanFicFare-master/fanficfare/adapters/base_efiction_adapter.py | TomNorrie/ePubify | 89c89bd22cafdea787f3131ca9cdc8336209ed6c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Fanficdownloader team, 2017 FanFicFare team
#
# 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
#
# Un... | 38.122318 | 142 | 0.590149 |
f9a95880fd2da2a30d55148539cb1ef04bfc78b0 | 5,457 | py | Python | framework/auth/core.py | shun-nakazawa/RDM-osf.io | cdf0101426e3a3637f76bd7f477897947f163366 | [
"Apache-2.0"
] | null | null | null | framework/auth/core.py | shun-nakazawa/RDM-osf.io | cdf0101426e3a3637f76bd7f477897947f163366 | [
"Apache-2.0"
] | 8 | 2018-11-09T05:57:09.000Z | 2019-07-25T10:27:55.000Z | framework/auth/core.py | shun-nakazawa/RDM-osf.io | cdf0101426e3a3637f76bd7f477897947f163366 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime as dt
import logging
from django.utils import timezone
from django.db.models import Q
from django.db.models import Subquery
from django.core.validators import URLValidator
from flask import request
from framework.sessions import session
from osf.exceptions import ValidationVa... | 28.873016 | 119 | 0.665934 |
2682cc0d57503e566e54dfd1368ed46ad7ce1325 | 1,492 | py | Python | setup.py | johnkozina/ansible-pan | 335e05daa2f955194ca77328b5bf754b5e3d6751 | [
"Apache-2.0"
] | 1 | 2019-04-19T23:08:27.000Z | 2019-04-19T23:08:27.000Z | setup.py | johnkozina/ansible-pan | 335e05daa2f955194ca77328b5bf754b5e3d6751 | [
"Apache-2.0"
] | null | null | null | setup.py | johnkozina/ansible-pan | 335e05daa2f955194ca77328b5bf754b5e3d6751 | [
"Apache-2.0"
] | 2 | 2019-01-31T02:51:08.000Z | 2020-09-03T15:45:52.000Z | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='ansible-pan',
version='1.0.1',
... | 33.909091 | 85 | 0.63807 |
f0c4c29a6065c6231f7ff7c380d5d992ab5e0d69 | 5,058 | py | Python | frappe/config/settings.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | frappe/config/settings.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | frappe/config/settings.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.moduleview import add_setup_section
def get_data():
data = [
{
"label": _("Core"),
"items": [
{
"type": "doctype",
"name": "System Settings",
"label": _("System Settings"),
"description": _("Lan... | 24.916256 | 106 | 0.546263 |
9dad61fe5b338e1c2087628999147f8ac573ea96 | 6,729 | py | Python | etc/tf_tutorial/learning_tf/21.py | zhangbo2008/facenet | 4dfabcb5cf14f99622dbe5f9f12f0539821c169c | [
"MIT"
] | null | null | null | etc/tf_tutorial/learning_tf/21.py | zhangbo2008/facenet | 4dfabcb5cf14f99622dbe5f9f12f0539821c169c | [
"MIT"
] | 7 | 2019-12-16T22:10:01.000Z | 2022-02-10T00:27:35.000Z | etc/tf_tutorial/learning_tf/21.py | zhangbo2008/facenet | 4dfabcb5cf14f99622dbe5f9f12f0539821c169c | [
"MIT"
] | null | null | null | """ Generative Adversarial Networks (GAN).
Using generative adversarial networks (GAN) to generate digit images from a
noise distribution.
References:
- Generative adversarial nets. I Goodfellow, J Pouget-Abadie, M Mirza,
B Xu, D Warde-Farley, S Ozair, Y. Bengio. Advances in neural information
processing sy... | 33.477612 | 104 | 0.685689 |
1a3f4e05d0e7d1c43ddc01b0a5a35c6e116c78fa | 24,656 | py | Python | conkycolors/scripts/conkyRhythmbox.py | CarryJzzZ/pithy-conky-colors | 573aaa262f86ec510927ed81bc3beb25e2195a9e | [
"MIT"
] | 4 | 2018-08-22T05:28:32.000Z | 2018-08-23T06:44:17.000Z | conkycolors/scripts/conkyRhythmbox.py | CarryJzzZ/pithy-conky-colors | 573aaa262f86ec510927ed81bc3beb25e2195a9e | [
"MIT"
] | null | null | null | conkycolors/scripts/conkyRhythmbox.py | CarryJzzZ/pithy-conky-colors | 573aaa262f86ec510927ed81bc3beb25e2195a9e | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
###############################################################################
# conkyRhythmbox.py is a simple python script to gather
# details of from Rhythmbox for use in conky.
#
# Author: Kaivalagi
# Created: 23/09/2008
from datetime import datetime
from optparse i... | 46.96381 | 470 | 0.495539 |
5e22663fd5063c30fa9d38192f940bb174319f4c | 888 | py | Python | tests/cloud_operations/dns_fine_grained_iam/test_plan.py | 00inboxtest/cloud-foundation-fabric | ee25965c895aa4bc3f62090a08b797d45b82d178 | [
"Apache-2.0"
] | null | null | null | tests/cloud_operations/dns_fine_grained_iam/test_plan.py | 00inboxtest/cloud-foundation-fabric | ee25965c895aa4bc3f62090a08b797d45b82d178 | [
"Apache-2.0"
] | null | null | null | tests/cloud_operations/dns_fine_grained_iam/test_plan.py | 00inboxtest/cloud-foundation-fabric | ee25965c895aa4bc3f62090a08b797d45b82d178 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.714286 | 74 | 0.757883 |
2f710c6cb25795b9ebe2abc7ba6739c8a0fb5a46 | 629 | py | Python | main/migrations/0002_auto_20210817_1406.py | Mneimoh/gestionimmo | b6c631b198537b04e07eaa59b48b2b24f9d2ee0d | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20210817_1406.py | Mneimoh/gestionimmo | b6c631b198537b04e07eaa59b48b2b24f9d2ee0d | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20210817_1406.py | Mneimoh/gestionimmo | b6c631b198537b04e07eaa59b48b2b24f9d2ee0d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-17 21:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='dossier',
... | 25.16 | 124 | 0.600954 |
7a542a1b120079a9e3ceb28de56c671c182ef69d | 5,134 | py | Python | venv/lib/python3.8/site-packages/docs/conf.py | OscarJHernandez/qc_portfolio_optimization | 30f0e27689ad6bf37fb87880c2813a5b9858608d | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | venv/lib/python3.8/site-packages/docs/conf.py | OscarJHernandez/qc_mentorship_project | 30f0e27689ad6bf37fb87880c2813a5b9858608d | [
"Apache-2.0"
] | 4 | 2020-11-27T09:34:13.000Z | 2021-04-30T21:13:41.000Z | venv/lib/python3.8/site-packages/docs/conf.py | OscarJHernandez/qc_mentorship_project | 30f0e27689ad6bf37fb87880c2813a5b9858608d | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 33.122581 | 80 | 0.652513 |
81b09ea05170b1ac8018627908439318d68c4eab | 1,643 | py | Python | tests/unit/test_extract_email.py | georgettica/URLExtract | 638c0e2d4d8fec077b13b0eefb2c96ffaee112be | [
"MIT"
] | 184 | 2017-03-05T22:17:14.000Z | 2022-03-02T22:45:54.000Z | tests/unit/test_extract_email.py | georgettica/URLExtract | 638c0e2d4d8fec077b13b0eefb2c96ffaee112be | [
"MIT"
] | 93 | 2017-03-20T21:58:55.000Z | 2022-03-16T20:09:37.000Z | tests/unit/test_extract_email.py | georgettica/URLExtract | 638c0e2d4d8fec077b13b0eefb2c96ffaee112be | [
"MIT"
] | 55 | 2017-03-19T23:35:36.000Z | 2022-03-14T02:58:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
.. Licence MIT
.. codeauthor:: Jan Lipovský <janlipovsky@gmail.com>, janlipovsky.cz
"""
import pytest
@pytest.mark.parametrize(
"text, expected",
[
(
"URI with User info in Authority ftp://jan@example.com:123/test",
["ftp://jan... | 32.215686 | 84 | 0.654291 |
d0bcf6e2325bf58e84217551512dbc19038223d2 | 1,163 | py | Python | GeneralPython/PyDataStructure/multiValuedDict.py | prashantas/MyOwnR | 8db4f288b30840161c6422bde7c7a7770f85c09d | [
"BSD-2-Clause"
] | null | null | null | GeneralPython/PyDataStructure/multiValuedDict.py | prashantas/MyOwnR | 8db4f288b30840161c6422bde7c7a7770f85c09d | [
"BSD-2-Clause"
] | null | null | null | GeneralPython/PyDataStructure/multiValuedDict.py | prashantas/MyOwnR | 8db4f288b30840161c6422bde7c7a7770f85c09d | [
"BSD-2-Clause"
] | null | null | null | #http://code.activestate.com/recipes/52219-associating-multiple-values-with-each-key-in-a-dic/
#https://www.oreilly.com/library/view/python-cookbook/0596001673/ch01s06.html
def repeatedValue():
# this method allows duplicate values for the same key
d = dict()
# To add a key->value pair, do this:
#d.set... | 27.046512 | 94 | 0.607051 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.