hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ec32c5d19d9ecee103848ad41723ca7b1e920e88 | 3,466 | py | Python | tests/chainerx_tests/dtype_utils.py | hikjik/chainer | 324a1bc1ea3edd63d225e4a87ed0a36af7fd712f | [
"MIT"
] | 1 | 2019-03-09T07:39:07.000Z | 2019-03-09T07:39:07.000Z | tests/chainerx_tests/dtype_utils.py | hitsgub/chainer | 20d4d70f5cdacc1f24f243443f5bebc2055c8f8e | [
"MIT"
] | null | null | null | tests/chainerx_tests/dtype_utils.py | hitsgub/chainer | 20d4d70f5cdacc1f24f243443f5bebc2055c8f8e | [
"MIT"
] | null | null | null | import itertools
import numpy
import chainerx
def _permutate_dtype_mapping(dtype_mapping_list):
# Permutates in dtypes of dtype mapping.
d = {}
for in_dtypes, out_dtype in dtype_mapping_list:
for in_dtypes_ in itertools.permutations(in_dtypes):
d[in_dtypes_] = out_dtype
return so... | 32.392523 | 78 | 0.549913 |
966691a28d2d70bca9dbe151910724fe86b94c4c | 5,381 | py | Python | schedules/migrations/0004_auto_20160816_2356.py | janga1997/video_village | 58cba131c97dd3a033935e0675ba62daff7ca64a | [
"MIT"
] | 1 | 2017-03-10T22:44:35.000Z | 2017-03-10T22:44:35.000Z | schedules/migrations/0004_auto_20160816_2356.py | janga1997/video_village | 58cba131c97dd3a033935e0675ba62daff7ca64a | [
"MIT"
] | 14 | 2016-07-08T13:52:46.000Z | 2017-02-13T20:57:18.000Z | schedules/migrations/0004_auto_20160816_2356.py | janga1997/video_village | 58cba131c97dd3a033935e0675ba62daff7ca64a | [
"MIT"
] | 8 | 2016-07-11T16:23:20.000Z | 2018-10-13T06:07:58.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-16 23:56
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('videos', '0006_... | 40.458647 | 183 | 0.57703 |
c14a957fa70acf0000b78a217c407185e84a3db8 | 9,673 | py | Python | datasimulator/graph.py | AustralianBioCommons/data-simulator | 0c33620a18c62cc098ec83e2118c4e8b76eb6f26 | [
"Apache-2.0"
] | 3 | 2019-02-19T04:48:49.000Z | 2020-08-26T20:39:35.000Z | datasimulator/graph.py | AustralianBioCommons/data-simulator | 0c33620a18c62cc098ec83e2118c4e8b76eb6f26 | [
"Apache-2.0"
] | 25 | 2019-02-19T22:37:30.000Z | 2022-01-31T18:08:53.000Z | datasimulator/graph.py | AustralianBioCommons/data-simulator | 0c33620a18c62cc098ec83e2118c4e8b76eb6f26 | [
"Apache-2.0"
] | 4 | 2019-10-11T21:25:27.000Z | 2021-11-19T03:28:56.000Z | import json
from os.path import join
from .node import Node, logger
from .errors import UserError, DictionaryError
from .generator import generate_list_numbers
from .utils import generate_list_numbers_from_file
EXCLUDED_NODE = ["program", "root", "data_release"]
class Graph(object):
"""
Graph representation... | 32.789831 | 87 | 0.519177 |
fa25e9130f6b6f3734916defd96fa03864c58a22 | 32,965 | py | Python | google/ads/googleads/v7/googleads-py/tests/unit/gapic/googleads.v7/services/test_campaign_simulation_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/tests/unit/gapic/googleads.v7/services/test_campaign_simulation_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v7/googleads-py/tests/unit/gapic/googleads.v7/services/test_campaign_simulation_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- 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 or... | 44.911444 | 280 | 0.719551 |
1208e913c0849f3e5c625c7af7447cf9365e9879 | 4,536 | py | Python | greentest/test__event.py | bkad/gevent | 185b71cc472db413515059ab4a197207cdaf1f6c | [
"MIT"
] | 2 | 2015-12-19T01:34:43.000Z | 2018-02-02T12:32:01.000Z | greentest/test__event.py | alex/gevent | 454a77ca561868854760b2d9cbfa3bf3bbd2e062 | [
"MIT"
] | null | null | null | greentest/test__event.py | alex/gevent | 454a77ca561868854760b2d9cbfa3bf3bbd2e062 | [
"MIT"
] | 2 | 2019-11-24T12:11:50.000Z | 2020-12-26T19:00:20.000Z | import greentest
import gevent
import sys
from gevent.event import Event, AsyncResult
DELAY = 0.01
class TestEventWait(greentest.GenericWaitTestCase):
def wait(self, timeout):
Event().wait(timeout=timeout)
class TestWaitEvent(greentest.GenericWaitTestCase):
def wait(self, timeout):
gevent... | 26.219653 | 100 | 0.604277 |
eca8d1ecf02340ce4c8b1b61a89dddfe0a37364c | 8,645 | py | Python | tppflush.py | hlixed/TPPFLUSH | e162edca158228a32e12b0912a034da0229e1af3 | [
"MIT"
] | 13 | 2017-06-13T09:49:53.000Z | 2021-08-01T17:26:23.000Z | tppflush.py | hlixed/TPPFLUSH | e162edca158228a32e12b0912a034da0229e1af3 | [
"MIT"
] | 5 | 2017-06-13T21:24:32.000Z | 2017-11-15T02:47:15.000Z | tppflush.py | hlixed/TPPFLUSH | e162edca158228a32e12b0912a034da0229e1af3 | [
"MIT"
] | null | null | null | VERSION = 1.22
import sys
if sys.version_info[0] < 3 or sys.version_info[1] < 6:
raise ImportError("You are using python {}.{}. Python 3.6 or greater is required to use TPPFLUSH.\nYou can download the latest version of python from http://www.python.org.\n".format(sys.version_info[0],sys.version_info[1]))
import s... | 33.901961 | 228 | 0.730943 |
642b27a3e880bea0b09640ccd9d5ad9c0ce51763 | 7,010 | py | Python | src/main/nluas/language/word_checker.py | ErickKramer/ecg_framework_code | 65c2966a37ffe829b81d610dd2b9902898101cc2 | [
"Apache-2.0"
] | null | null | null | src/main/nluas/language/word_checker.py | ErickKramer/ecg_framework_code | 65c2966a37ffe829b81d610dd2b9902898101cc2 | [
"Apache-2.0"
] | null | null | null | src/main/nluas/language/word_checker.py | ErickKramer/ecg_framework_code | 65c2966a37ffe829b81d610dd2b9902898101cc2 | [
"Apache-2.0"
] | null | null | null | """
Combines the features of spell checking and swapping for synonyms with a token.
------
See LICENSE.txt for licensing information.
------
"""
import enchant
import string
import os
import re
import nltk
from nltk.corpus import wordnet
from nltk.stem import WordNetLemmatizer
from nluas.language.spell_checker import ... | 32.155963 | 105 | 0.636519 |
e91b01be9c97ca794ee2a0adfedbdd01944d94dd | 1,369 | py | Python | wst/version.py | martingkelly/ws | 541fc015db7c9c7042aed064b00d3de4dd7ca856 | [
"BSD-3-Clause"
] | null | null | null | wst/version.py | martingkelly/ws | 541fc015db7c9c7042aed064b00d3de4dd7ca856 | [
"BSD-3-Clause"
] | null | null | null | wst/version.py | martingkelly/ws | 541fc015db7c9c7042aed064b00d3de4dd7ca856 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
#
# Module version. Though this could go in wst/__init__.py, it's nice to keep
# all "bump version" commits contained in one file and not mucking up the rest
# of the code.
#
# Copyright (c) 2018-2019 Xevo Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtai... | 40.264706 | 79 | 0.763331 |
e2fc498a3fa3a82f6d96a41549f7b9d73f356da1 | 608 | py | Python | codeswiftr/home/migrations/0007_applanding_reviews.py | bogdan-veliscu/dev-portfolio-website | 43eb323c67f3fd691388e79039e32479c1bc0974 | [
"Apache-2.0"
] | null | null | null | codeswiftr/home/migrations/0007_applanding_reviews.py | bogdan-veliscu/dev-portfolio-website | 43eb323c67f3fd691388e79039e32479c1bc0974 | [
"Apache-2.0"
] | 4 | 2021-03-30T13:40:00.000Z | 2021-09-22T19:12:56.000Z | codeswiftr/home/migrations/0007_applanding_reviews.py | bogdan-veliscu/dev-portfolio-website | 43eb323c67f3fd691388e79039e32479c1bc0974 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-06-25 03:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('testimonials', '0001_initial'),
('home', '0006_applanding_about_info'),
]
operations = [
migrations... | 27.636364 | 158 | 0.652961 |
decc91308aa37a5094a37e597c92f90ae3534513 | 61 | py | Python | settings/__init__.py | ihoru/todoist_bot | a83648786a1a6f7d6ef50248e1f931b166013216 | [
"MIT"
] | 37 | 2017-07-21T10:45:03.000Z | 2022-02-02T20:13:40.000Z | settings/__init__.py | mateuszasdf/todoist_bot | e56c2d729f8cbb31642e3774708208c67295483a | [
"MIT"
] | 4 | 2018-01-10T23:30:00.000Z | 2020-01-30T19:43:29.000Z | settings/__init__.py | mateuszasdf/todoist_bot | e56c2d729f8cbb31642e3774708208c67295483a | [
"MIT"
] | 6 | 2017-12-12T15:32:54.000Z | 2022-03-24T14:21:43.000Z | from .global_settings import *
from .local_settings import *
| 20.333333 | 30 | 0.803279 |
aab9d3d9b028cd7c952ab8da0f7da661474aeaa2 | 26,099 | py | Python | test/test_functional_tensor.py | StadlerMaximilian/vision | 5dae7a69c18ed3f59c2b6b37a6899d2ef7c08c97 | [
"BSD-3-Clause"
] | null | null | null | test/test_functional_tensor.py | StadlerMaximilian/vision | 5dae7a69c18ed3f59c2b6b37a6899d2ef7c08c97 | [
"BSD-3-Clause"
] | null | null | null | test/test_functional_tensor.py | StadlerMaximilian/vision | 5dae7a69c18ed3f59c2b6b37a6899d2ef7c08c97 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import random
import colorsys
import math
from PIL import Image
from PIL.Image import NEAREST, BILINEAR, BICUBIC
import numpy as np
import torch
import torchvision.transforms as transforms
import torchvision.transforms.functional_tensor as F_t
import torchvision.transforms.functional_pil as F_pil
imp... | 45.86819 | 119 | 0.523123 |
88999df5a26e49f3577699f660527ea3613b70bf | 5,367 | py | Python | tools/pubsub2inbox/helpers/grant-gsuite-role.py | ruchirjain86/professional-services | 739ac0f5ffc8237f750804fa9f0f14d4d918a0fa | [
"Apache-2.0"
] | 3 | 2019-03-22T12:55:55.000Z | 2020-09-23T11:41:07.000Z | tools/pubsub2inbox/helpers/grant-gsuite-role.py | ruchirjain86/professional-services | 739ac0f5ffc8237f750804fa9f0f14d4d918a0fa | [
"Apache-2.0"
] | 7 | 2021-08-18T19:14:12.000Z | 2022-03-27T07:20:02.000Z | tools/pubsub2inbox/helpers/grant-gsuite-role.py | ruchirjain86/professional-services | 739ac0f5ffc8237f750804fa9f0f14d4d918a0fa | [
"Apache-2.0"
] | 2 | 2019-03-22T12:55:59.000Z | 2019-10-24T20:21:55.000Z | #!/usr/bin/env python3
# Copyright 2021 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 applic... | 38.891304 | 118 | 0.647289 |
6a70540db41d25943aacfbef2e7e1c5391cb006b | 9,113 | py | Python | karbor/tests/unit/protection/test_resource_flow.py | Hybrid-Cloud/hybrid-smaug | a50b4fefb1677134aa8206724342fdff6e3b058b | [
"Apache-2.0"
] | null | null | null | karbor/tests/unit/protection/test_resource_flow.py | Hybrid-Cloud/hybrid-smaug | a50b4fefb1677134aa8206724342fdff6e3b058b | [
"Apache-2.0"
] | null | null | null | karbor/tests/unit/protection/test_resource_flow.py | Hybrid-Cloud/hybrid-smaug | a50b4fefb1677134aa8206724342fdff6e3b058b | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 43.189573 | 78 | 0.587293 |
354965bde44164268dd7b09a596453eab29201d4 | 252 | py | Python | discounts/src/database/migration/config.py | dalmarcogd/mobstore | 0b542b9267771a1f4522990d592028dc30ee246f | [
"Apache-2.0"
] | null | null | null | discounts/src/database/migration/config.py | dalmarcogd/mobstore | 0b542b9267771a1f4522990d592028dc30ee246f | [
"Apache-2.0"
] | null | null | null | discounts/src/database/migration/config.py | dalmarcogd/mobstore | 0b542b9267771a1f4522990d592028dc30ee246f | [
"Apache-2.0"
] | null | null | null | from alembic.config import Config
from src.settings import BASE_DIR, DATABASE_URI
alembic_cfg = Config()
alembic_cfg.set_main_option("script_location", f"{BASE_DIR}/src/database/migration")
alembic_cfg.set_main_option("sqlalchemy.url", DATABASE_URI)
| 31.5 | 84 | 0.825397 |
3f4b0717a7b75f4c6c4f7feebe36531561085149 | 25,153 | py | Python | silx/io/test/test_spech5.py | PiRK/silx | db6c1d2bdccfc6ec0811f2068dfbe9edefc38f20 | [
"CC0-1.0"
] | null | null | null | silx/io/test/test_spech5.py | PiRK/silx | db6c1d2bdccfc6ec0811f2068dfbe9edefc38f20 | [
"CC0-1.0"
] | 1 | 2019-05-16T14:18:23.000Z | 2019-05-16T14:18:23.000Z | silx/io/test/test_spech5.py | PiRK/silx | db6c1d2bdccfc6ec0811f2068dfbe9edefc38f20 | [
"CC0-1.0"
] | 1 | 2022-01-24T16:19:27.000Z | 2022-01-24T16:19:27.000Z | # coding: utf-8
# /*##########################################################################
# Copyright (C) 2016-2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... | 34.789765 | 97 | 0.580885 |
daa85232c721e599e0c6aeef4c365e0e007ff16d | 848 | py | Python | models/models.py | cx921003/UPG-GAN | b2d2f2f2a36edb4b92495056d207ca10c3b8c621 | [
"BSD-3-Clause"
] | 7 | 2019-06-10T13:46:34.000Z | 2019-11-27T12:44:43.000Z | models/models.py | cx921003/UPG-GAN | b2d2f2f2a36edb4b92495056d207ca10c3b8c621 | [
"BSD-3-Clause"
] | 1 | 2020-01-15T13:30:55.000Z | 2021-02-23T18:48:25.000Z | models/models.py | xuchen-ethz/UPG-GAN | b2d2f2f2a36edb4b92495056d207ca10c3b8c621 | [
"BSD-3-Clause"
] | null | null | null |
def create_model(opt):
model = None
print(opt.model)
if opt.model == 'ae_cycle_gan_all':
assert (opt.dataset_mode in ['unaligned','unaligned_with_label'])
from .ae_cycle_gan_model import AECycleGANModel
model = AECycleGANModel()
elif opt.model == 'vae_cycle_gan':
assert... | 36.869565 | 73 | 0.669811 |
a2de2103a640aecf9d6257c29cb2330e52afd9e9 | 2,170 | py | Python | lisa/extern/sPickle/sPickle.py | mjirik/lisa | 06c5cb8f375f51302341e768512f02236774c8a3 | [
"BSD-3-Clause"
] | 22 | 2015-01-26T12:58:54.000Z | 2021-04-15T17:48:13.000Z | lisa/extern/sPickle/sPickle.py | mjirik/lisa | 06c5cb8f375f51302341e768512f02236774c8a3 | [
"BSD-3-Clause"
] | 31 | 2015-01-23T14:46:13.000Z | 2018-05-18T14:47:18.000Z | lisa/extern/sPickle/sPickle.py | mjirik/lisa | 06c5cb8f375f51302341e768512f02236774c8a3 | [
"BSD-3-Clause"
] | 13 | 2015-06-30T08:54:27.000Z | 2020-09-11T16:08:19.000Z | """Streaming pickle implementation for efficiently serializing and
de-serializing an iterable (e.g., list)
Created on 2010-06-19 by Philip Guo
http://code.google.com/p/streaming-pickle/
Modified by Brian Thorne 2013 to add base64 encoding to support
python3 bytearray and the like.
"""
import base64
from pickle imp... | 29.726027 | 116 | 0.620276 |
adc967abff0718d3e01829f07a99ada02bd37766 | 2,166 | py | Python | mangecko/utilities/library_scanner.py | jjsmall009/manga-volume-tracker | 306157f95233d1f1c2adaa2e1a6f89048532c899 | [
"BSD-3-Clause"
] | null | null | null | mangecko/utilities/library_scanner.py | jjsmall009/manga-volume-tracker | 306157f95233d1f1c2adaa2e1a6f89048532c899 | [
"BSD-3-Clause"
] | null | null | null | mangecko/utilities/library_scanner.py | jjsmall009/manga-volume-tracker | 306157f95233d1f1c2adaa2e1a6f89048532c899 | [
"BSD-3-Clause"
] | null | null | null | # JJ Small
# Manga Volume Tracker
# library_scanner.py - Code to scan a directory and get a list of manga title/volume count
from pathlib import Path
class LibraryScanner():
"""
This is a class because it's easier to track the state of which folder in the directory is what.
"""
FILE_EXT: tuple = (".cbz... | 38.678571 | 100 | 0.574331 |
e3d6cb7cb73ee3dc70bbb33bb67da14b2b2ab63d | 2,926 | py | Python | tests/integration/controllers/test_notify_gateway.py | uk-gov-mirror/ONSdigital.ras-frontstage | 4bf0f779f37d2a9ce7efe9f11c9b55a7a398faae | [
"MIT"
] | null | null | null | tests/integration/controllers/test_notify_gateway.py | uk-gov-mirror/ONSdigital.ras-frontstage | 4bf0f779f37d2a9ce7efe9f11c9b55a7a398faae | [
"MIT"
] | null | null | null | tests/integration/controllers/test_notify_gateway.py | uk-gov-mirror/ONSdigital.ras-frontstage | 4bf0f779f37d2a9ce7efe9f11c9b55a7a398faae | [
"MIT"
] | null | null | null | import unittest
from config import TestingConfig
from frontstage import app
from frontstage.controllers.notify_controller import NotifyGateway
from frontstage.exceptions.exceptions import RasNotifyError
class TestNotifyController(unittest.TestCase):
"""Tests that the notify controller is working as expected"""
... | 47.193548 | 111 | 0.698906 |
a9972d4ed4edcd150e11582abb591f4b1bcc9f2a | 1,725 | py | Python | src/probnum/randprocs/kernels/_exponentiated_quadratic.py | treid5/probnum | fabb51243d0952fbd35e542aeb5c2dc9a449ec81 | [
"MIT"
] | 1 | 2021-04-16T14:45:26.000Z | 2021-04-16T14:45:26.000Z | src/probnum/randprocs/kernels/_exponentiated_quadratic.py | simeoncarstens/probnum | b69587b07e2fffbdcd4c850acc98bb3de97a6e0b | [
"MIT"
] | 42 | 2021-03-08T07:20:40.000Z | 2022-03-28T05:04:48.000Z | src/probnum/randprocs/kernels/_exponentiated_quadratic.py | JonathanWenger/probnum | 1c5499883672cfa029c12045848ea04491c69e08 | [
"MIT"
] | null | null | null | """Exponentiated quadratic kernel."""
from typing import Optional
import numpy as np
import probnum.utils as _utils
from probnum.typing import IntArgType, ScalarArgType
from ._kernel import IsotropicMixin, Kernel
class ExpQuad(Kernel, IsotropicMixin):
r"""Exponentiated quadratic / RBF kernel.
Covariance ... | 28.75 | 87 | 0.635362 |
a0468e17b0b29a01b067dd8000c79f7c8f4ee95d | 1,632 | py | Python | accounts/views.py | victorbrittoferreira/product_hunt | e304359a903da3c84bf342832e92666c514ec42a | [
"BSD-3-Clause"
] | null | null | null | accounts/views.py | victorbrittoferreira/product_hunt | e304359a903da3c84bf342832e92666c514ec42a | [
"BSD-3-Clause"
] | null | null | null | accounts/views.py | victorbrittoferreira/product_hunt | e304359a903da3c84bf342832e92666c514ec42a | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.contrib import auth
# Create your views here.
# SIGN UP
def signup(request):
if request.method == 'POST':
#POST the info and wants an account now!
if request.POST['password1'] == request.POST['p... | 29.142857 | 103 | 0.584559 |
155e2252c8ee2c292f4c1bd41ce629d9571b2790 | 36 | py | Python | python/matplotlib-tests/run_test.py | jaimergp/conda-recipes | b663b2edeb3381b57601af92db4b8074c6ab6681 | [
"BSD-3-Clause"
] | 302 | 2015-01-04T18:21:56.000Z | 2021-11-16T12:14:37.000Z | python/matplotlib-tests/run_test.py | jaimergp/conda-recipes | b663b2edeb3381b57601af92db4b8074c6ab6681 | [
"BSD-3-Clause"
] | 393 | 2015-01-03T14:35:48.000Z | 2019-12-09T15:09:07.000Z | python/matplotlib-tests/run_test.py | jaimergp/conda-recipes | b663b2edeb3381b57601af92db4b8074c6ab6681 | [
"BSD-3-Clause"
] | 325 | 2015-01-04T17:26:39.000Z | 2021-11-04T16:25:54.000Z | import matplotlib
matplotlib.test()
| 12 | 17 | 0.833333 |
3c857692d80b07d91c5d3422acf3be5dc3a3e37c | 1,200 | py | Python | bspider/agent/controller/data_source.py | littlebai3618/bspider | ff4d003cd0825247db4efe62db95f9245c0a303c | [
"BSD-3-Clause"
] | 3 | 2020-06-19T03:52:29.000Z | 2021-05-21T05:50:46.000Z | bspider/agent/controller/data_source.py | littlebai3618/bspider | ff4d003cd0825247db4efe62db95f9245c0a303c | [
"BSD-3-Clause"
] | 2 | 2021-03-31T19:39:03.000Z | 2021-05-12T02:10:26.000Z | bspider/agent/controller/data_source.py | littlebai3618/bspider | ff4d003cd0825247db4efe62db95f9245c0a303c | [
"BSD-3-Clause"
] | null | null | null | """
封装对cache中data_source信息的操作为api
"""
from flask import Blueprint
from bspider.core.api import auth
from .validators.data_source_form import AddForm, UpdateForm
from bspider.agent.service.data_source import DataSourceService
data_source = Blueprint('data_source_bp', __name__)
data_source_service = DataSourceServi... | 29.268293 | 71 | 0.780833 |
b0cb706376a538650edd7453f6bf6fb4e04d0fa0 | 789 | py | Python | deps/mozjs/src/gdb/lib-for-tests/catcher.py | ktrzeciaknubisa/jxcore-binary-packaging | 5759df084be10a259a4a4f1b38c214c6084a7c0f | [
"Apache-2.0"
] | 2,494 | 2015-02-11T04:34:13.000Z | 2022-03-31T14:21:47.000Z | deps/mozjs/src/gdb/lib-for-tests/catcher.py | ktrzeciaknubisa/jxcore-binary-packaging | 5759df084be10a259a4a4f1b38c214c6084a7c0f | [
"Apache-2.0"
] | 685 | 2015-02-11T17:14:26.000Z | 2021-04-13T09:58:39.000Z | deps/mozjs/src/gdb/lib-for-tests/catcher.py | ktrzeciaknubisa/jxcore-binary-packaging | 5759df084be10a259a4a4f1b38c214c6084a7c0f | [
"Apache-2.0"
] | 442 | 2015-02-12T13:45:46.000Z | 2022-03-21T05:28:05.000Z | # Apparently, there's simply no way to ask GDB to exit with a non-zero
# status when the script run with the --eval-command option fails. Thus, if
# we have --eval-command run prolog.py directly, syntax errors there will
# lead GDB to exit with no indication anything went wrong.
#
# To avert that, we use this very smal... | 34.304348 | 75 | 0.731305 |
c179828e87d67c62a7992e482ca59c45b45a1279 | 1,621 | py | Python | mitmproxy/contentviews/graphql.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | mitmproxy/contentviews/graphql.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | mitmproxy/contentviews/graphql.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | import json
from typing import Any, Optional
from mitmproxy.contentviews import base
from mitmproxy.contentviews.json import parse_json, PARSE_ERROR
def format_graphql(data):
query = data["query"]
header_data = data.copy()
header_data["query"] = "..."
return """{header}
---
{query}
""".format(
... | 26.57377 | 86 | 0.63541 |
be4f438aab8ffde6c41977406d72a72672a60551 | 28,135 | py | Python | mosfit/main.py | klukosiute/MOSFiT | 4bc6c74f4b592e4f023aad69fd17fe95078d518d | [
"MIT"
] | null | null | null | mosfit/main.py | klukosiute/MOSFiT | 4bc6c74f4b592e4f023aad69fd17fe95078d518d | [
"MIT"
] | null | null | null | mosfit/main.py | klukosiute/MOSFiT | 4bc6c74f4b592e4f023aad69fd17fe95078d518d | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""The main function."""
import argparse
import codecs
import locale
import os
import shutil
import sys
import time
from operator import attrgetter
from unicodedata import normalize
import numpy as np
from astropy.time import Time as astrotime
from mosfit import __author__, __contributors__,... | 29.491614 | 77 | 0.536805 |
be23aa79adc8d79558ddcdc53353c22199cfefdb | 2,938 | py | Python | keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2022-03-21T02:42:58.000Z | 2022-03-21T02:42:58.000Z | keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2022-03-31T16:40:51.000Z | 2022-03-31T16:40:51.000Z | keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2020-12-13T22:14:48.000Z | 2020-12-13T22:14:48.000Z | # Copyright 2020 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... | 36.271605 | 102 | 0.736215 |
e15c89f3fddcf39a3ae5722f091571510ba82164 | 191 | py | Python | esp32/tilt switch example.py | Steve-Fisher/PiExperiments | 81a08b99b53ed9921353cf436b09b40650032a2b | [
"MIT"
] | null | null | null | esp32/tilt switch example.py | Steve-Fisher/PiExperiments | 81a08b99b53ed9921353cf436b09b40650032a2b | [
"MIT"
] | null | null | null | esp32/tilt switch example.py | Steve-Fisher/PiExperiments | 81a08b99b53ed9921353cf436b09b40650032a2b | [
"MIT"
] | null | null | null | from machine import Pin
import time
switch = Pin(23, Pin.IN)
while True:
state = not(switch.value())
print("Switch is " + ("on " if state else "off"), end='\r')
time.sleep(0.2)
| 19.1 | 63 | 0.617801 |
25a4e4993a953b1fc344d3e06ee53f78b695122e | 12,304 | py | Python | qp_klp/klp.py | antgonza/qp-knight-lab-processing | 23e5646c6a47d894372e7d5d972169511f47570f | [
"BSD-3-Clause"
] | null | null | null | qp_klp/klp.py | antgonza/qp-knight-lab-processing | 23e5646c6a47d894372e7d5d972169511f47570f | [
"BSD-3-Clause"
] | null | null | null | qp_klp/klp.py | antgonza/qp-knight-lab-processing | 23e5646c6a47d894372e7d5d972169511f47570f | [
"BSD-3-Clause"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 40.340984 | 79 | 0.556404 |
6a60b84b933a66c710be203379f56bf94339572d | 3,837 | py | Python | examples/scans.py | alanfung/Tenable.io-SDK-for-Python | 21db906b652a700e11e0cd3435413f7dc7c9f6be | [
"MIT"
] | null | null | null | examples/scans.py | alanfung/Tenable.io-SDK-for-Python | 21db906b652a700e11e0cd3435413f7dc7c9f6be | [
"MIT"
] | null | null | null | examples/scans.py | alanfung/Tenable.io-SDK-for-Python | 21db906b652a700e11e0cd3435413f7dc7c9f6be | [
"MIT"
] | 1 | 2019-07-24T21:03:04.000Z | 2019-07-24T21:03:04.000Z | import os
from datetime import datetime
from time import time
from tenable_io.api.models import Scan
from tenable_io.api.scans import ScanExportRequest
from tenable_io.client import TenableIOClient
from tenable_io.exceptions import TenableIOApiException
def example(test_name, test_file):
# Generate unique name... | 26.462069 | 96 | 0.661976 |
76d1adb53a921e8a5efbd11a4a61f211baf77fb1 | 307 | py | Python | tests/pwb/print_argv.py | ZabeMath/pywikibot | 856a197c53efcb80b16475a8d203a4ecd79eee2f | [
"MIT"
] | 326 | 2017-11-21T07:04:19.000Z | 2022-03-26T01:25:44.000Z | tests/pwb/print_argv.py | ZabeMath/pywikibot | 856a197c53efcb80b16475a8d203a4ecd79eee2f | [
"MIT"
] | 17 | 2017-12-20T13:41:32.000Z | 2022-02-16T16:42:41.000Z | tests/pwb/print_argv.py | ZabeMath/pywikibot | 856a197c53efcb80b16475a8d203a4ecd79eee2f | [
"MIT"
] | 147 | 2017-11-22T19:13:40.000Z | 2022-03-29T04:47:07.000Z | #!/usr/bin/python
"""Script that forms part of pwb_tests.
.. versionadded:: 7.0
"""
#
# (C) Pywikibot team, 2021
#
# Distributed under the terms of the MIT license.
#
import pywikibot
def main() -> None:
"""Print pywikibot.argvu."""
print(pywikibot.argvu)
if __name__ == '__main__':
main()
| 14.619048 | 49 | 0.648208 |
87437d93fb7b1083c4ba63db573a38d1489ca337 | 24,099 | py | Python | blender/arm/utils.py | anadin/armory | a346af59e9d35d51e9b45cfcb6a99824719af295 | [
"Zlib"
] | null | null | null | blender/arm/utils.py | anadin/armory | a346af59e9d35d51e9b45cfcb6a99824719af295 | [
"Zlib"
] | null | null | null | blender/arm/utils.py | anadin/armory | a346af59e9d35d51e9b45cfcb6a99824719af295 | [
"Zlib"
] | null | null | null | import bpy
import json
import os
import glob
import platform
import re
import subprocess
import webbrowser
import numpy as np
import arm.lib.armpack
import arm.make_state as state
import arm.log as log
class NumpyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarray):
... | 35.808321 | 127 | 0.606332 |
119df43b10ab313670f0d71bdab1a4f24794532a | 3,488 | py | Python | update.py | tedder/ffmpeg | 852756e95100f65e702d791c689d141fe4f5005e | [
"Apache-2.0"
] | null | null | null | update.py | tedder/ffmpeg | 852756e95100f65e702d791c689d141fe4f5005e | [
"Apache-2.0"
] | null | null | null | update.py | tedder/ffmpeg | 852756e95100f65e702d791c689d141fe4f5005e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Get latest release from ffmpeg.org
import os
import sys
import re
import urllib2
from distutils.version import StrictVersion
MIN_VERSION = '2.8'
VARIANTS = ['ubuntu', 'alpine', 'centos', 'scratch', 'vaapi']
FFMPEG_RELEASES = 'https://ffmpeg.org/releases/'
travis = []
response = urllib2.urlop... | 37.106383 | 118 | 0.622133 |
f558917101aa855f947f41a8ff870dbdbc3c5f30 | 2,618 | py | Python | download_futures_equities.py | westonplatter/ibdatafetcher | ba8f6d873cffeeb4ffc24cdccb4eed401c4a9b49 | [
"BSD-3-Clause"
] | 10 | 2021-03-14T23:00:35.000Z | 2021-11-19T22:46:48.000Z | download_futures_equities.py | westonplatter/ibdatafetcher | ba8f6d873cffeeb4ffc24cdccb4eed401c4a9b49 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T15:50:05.000Z | 2021-06-28T15:50:05.000Z | download_futures_equities.py | westonplatter/ibdatafetcher | ba8f6d873cffeeb4ffc24cdccb4eed401c4a9b49 | [
"BSD-3-Clause"
] | 5 | 2020-12-03T10:06:39.000Z | 2022-03-08T17:23:36.000Z | from datetime import date
from dateutil.relativedelta import relativedelta
from ib_insync import Future
from loguru import logger
from ibdatafetcher.security_master import InMemSecuritiesMaster
from ibdatafetcher.spreads import Exchange
from ibdatafetcher.ib_client import gen_ib_client, fetch_data
from ibdatafetcher.m... | 28.769231 | 87 | 0.699389 |
30e23fd60832ebf9257756d4d37c8dcc1572439c | 26,276 | py | Python | com.geonode.chloropleth/chloropleth/ElementarySchool/migrations/0001_initial.py | coderfromanotherearth/School-GIS | 5675972f8dca8f28172da0cdfc3824a87b33d831 | [
"MIT"
] | null | null | null | com.geonode.chloropleth/chloropleth/ElementarySchool/migrations/0001_initial.py | coderfromanotherearth/School-GIS | 5675972f8dca8f28172da0cdfc3824a87b33d831 | [
"MIT"
] | 1 | 2020-06-05T22:36:02.000Z | 2020-06-05T22:36:02.000Z | com.geonode.chloropleth/chloropleth/ElementarySchool/migrations/0001_initial.py | joelabrahamkeerickal/School-GIS | 5675972f8dca8f28172da0cdfc3824a87b33d831 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-24 09:32
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migr... | 80.109756 | 114 | 0.613373 |
df268b6cb8c0f2c3ef1ff5dff8f2e241e9c4dbb4 | 6,642 | py | Python | mnist_stdp_multiple_exploration_v19.py | nikhil-garg/VDSP_ocl | 906867f8cd8a899a1ce309c5ec843fa1ce865373 | [
"MIT"
] | null | null | null | mnist_stdp_multiple_exploration_v19.py | nikhil-garg/VDSP_ocl | 906867f8cd8a899a1ce309c5ec843fa1ce865373 | [
"MIT"
] | null | null | null | mnist_stdp_multiple_exploration_v19.py | nikhil-garg/VDSP_ocl | 906867f8cd8a899a1ce309c5ec843fa1ce865373 | [
"MIT"
] | 1 | 2021-03-17T20:04:08.000Z | 2021-03-17T20:04:08.000Z | import itertools
import random
import logging
import numpy as np
import matplotlib.pyplot as plt
import os
from mnist_stdp_multiple_baseline import *
from utilis import *
from args_mnist import args as my_args
# from ax import optimize
import pandas as pd
from itertools import product
import time
if __name__ == '__ma... | 30.46789 | 377 | 0.578139 |
7adeb8263019a02593844850c54be7d02cd04458 | 2,448 | py | Python | code/tools/resample.py | Sirius291/trafficsign-cyclegan | 181f794a7c31311ab4cb9b76df5f1ab3bc6ef64d | [
"MIT"
] | 3 | 2020-06-08T16:58:07.000Z | 2020-12-29T17:13:58.000Z | code/tools/resample.py | Sirius291/trafficsign-cyclegan | 181f794a7c31311ab4cb9b76df5f1ab3bc6ef64d | [
"MIT"
] | null | null | null | code/tools/resample.py | Sirius291/trafficsign-cyclegan | 181f794a7c31311ab4cb9b76df5f1ab3bc6ef64d | [
"MIT"
] | 5 | 2019-06-07T13:05:17.000Z | 2022-02-28T16:57:02.000Z | '''
Application for resampling a set of files such that all classes are balanced.
Usage: resample in_path labels_path out_path [extension]
Dominic Spata,
Real-Time Computer Vision,
Institut fuer Neuroinformatik,
Ruhr University Bochum.
'''
import os
import sys
import shutil
import json
def resample(in_path, labels... | 33.081081 | 151 | 0.668709 |
9e051d57167dd132ef837720152a709124301272 | 622 | py | Python | examples/test_parse_html_2.py | jkpubsrc/python-module-jk-xmlparser | eaf6141f1cb3ab2d90f2a8444175b779584f5efe | [
"Apache-1.1"
] | null | null | null | examples/test_parse_html_2.py | jkpubsrc/python-module-jk-xmlparser | eaf6141f1cb3ab2d90f2a8444175b779584f5efe | [
"Apache-1.1"
] | null | null | null | examples/test_parse_html_2.py | jkpubsrc/python-module-jk-xmlparser | eaf6141f1cb3ab2d90f2a8444175b779584f5efe | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python3
import jk_xmlparser
from jk_simplexml import *
TEXT_DATA = """<!-- This is a comment -->
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
<hr/>
<script src="js/scripts.js"></script>
<h1>Heading 1</h1>
<p>
Tes... | 11.518519 | 59 | 0.628617 |
2d20ea6a2c93f1e7db9c1ce32661fb84e0f40354 | 6,278 | py | Python | venv/Lib/site-packages/sqlalchemy/event/api.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | 5 | 2021-09-05T16:11:12.000Z | 2022-03-20T12:28:42.000Z | venv/Lib/site-packages/sqlalchemy/event/api.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | 22 | 2019-01-18T02:57:36.000Z | 2019-02-24T22:38:54.000Z | venv/Lib/site-packages/sqlalchemy/event/api.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | 6 | 2019-02-19T09:03:28.000Z | 2019-02-21T06:38:35.000Z | # event/api.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Public API functions for the event system.
"""
from __future__ import absolute_impo... | 31.547739 | 79 | 0.652915 |
1c0a6b7bf41a5e50556cfd22e6fc91ee5ff016a8 | 2,183 | py | Python | ptsemseg/models/unet.py | czha5168/pytorch-semseg | 10e7b2d199bb6245fde3d1557632d8ee1ebac663 | [
"MIT"
] | 28 | 2019-04-30T05:05:33.000Z | 2021-07-15T08:04:28.000Z | ptsemseg/models/unet.py | linxi159/Pytorch-Semseg | 5cd845f1c911ab6ee4cbc6a3ce90f01229326fab | [
"MIT"
] | 3 | 2019-10-18T07:50:22.000Z | 2021-02-17T16:10:41.000Z | ptsemseg/models/unet.py | linxi159/Pytorch-Semseg | 5cd845f1c911ab6ee4cbc6a3ce90f01229326fab | [
"MIT"
] | 7 | 2019-07-29T02:48:15.000Z | 2020-11-23T13:22:49.000Z | import torch.nn as nn
from ptsemseg.models.utils import *
class unet(nn.Module):
def __init__(
self,
feature_scale=4,
n_classes=21,
is_deconv=True,
in_channels=3,
is_batchnorm=True,
):
super(unet, self).__init__()
self.is_deconv = is_deconv
... | 31.185714 | 79 | 0.628035 |
53f9665e80f8ddaf2797bf11312dd4fe038d3cf5 | 35,406 | py | Python | tspymfe/global_stats.py | FelSiq/ts-pymfe | 61cc1f63fa055c7466151cfefa7baff8df1702b7 | [
"MIT"
] | 9 | 2020-05-28T01:24:07.000Z | 2021-09-03T11:33:04.000Z | tspymfe/global_stats.py | FelSiq/ts-pymfe | 61cc1f63fa055c7466151cfefa7baff8df1702b7 | [
"MIT"
] | 1 | 2021-02-18T19:27:50.000Z | 2021-02-18T20:27:29.000Z | tspymfe/global_stats.py | FelSiq/ts-pymfe | 61cc1f63fa055c7466151cfefa7baff8df1702b7 | [
"MIT"
] | 2 | 2020-09-18T06:29:38.000Z | 2021-02-17T23:07:18.000Z | """Module dedicated to global statistics time-series meta-features."""
import typing as t
import warnings
import numpy as np
import nolds
import scipy.stats
import tspymfe._period as _period
import tspymfe._utils as _utils
import tspymfe._summary as _summary
class MFETSGlobalStats:
"""Extract time-series meta-f... | 38.235421 | 79 | 0.529995 |
5878b3deb1f47f8cf5a7d7f8dd37338142b4616c | 1,897 | py | Python | bindings/python/examples/types.py | mmccarty/legion | 30e00fa6016527c4cf60025a461fb7865f8def6b | [
"Apache-2.0"
] | 555 | 2015-01-19T07:50:27.000Z | 2022-03-22T11:35:48.000Z | bindings/python/examples/types.py | mmccarty/legion | 30e00fa6016527c4cf60025a461fb7865f8def6b | [
"Apache-2.0"
] | 1,157 | 2015-01-07T18:34:23.000Z | 2022-03-31T19:45:27.000Z | bindings/python/examples/types.py | mmccarty/legion | 30e00fa6016527c4cf60025a461fb7865f8def6b | [
"Apache-2.0"
] | 145 | 2015-02-03T02:31:42.000Z | 2022-02-28T12:03:51.000Z | #!/usr/bin/env python3
# Copyright 2021 Stanford University
#
# 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 applicab... | 24.960526 | 74 | 0.60991 |
1e9a9a2e679327d9bce896d8099417518451fecc | 3,858 | py | Python | The_Loan_Qualifier_Application/01_Test_the_Calculator/Completed/app.py | jpweldon/Module_2_Practice | cb546bbfcf5ffb7c6388f854e0eb8873834cfab9 | [
"MIT"
] | null | null | null | The_Loan_Qualifier_Application/01_Test_the_Calculator/Completed/app.py | jpweldon/Module_2_Practice | cb546bbfcf5ffb7c6388f854e0eb8873834cfab9 | [
"MIT"
] | null | null | null | The_Loan_Qualifier_Application/01_Test_the_Calculator/Completed/app.py | jpweldon/Module_2_Practice | cb546bbfcf5ffb7c6388f854e0eb8873834cfab9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Loan Qualifier Application.
This is a command line application to match applicants with qualifying loans.
Example:
$ python app.py
"""
import sys
from pathlib import Path
import fire
import questionary
from qualifier.utils.fileio import load_csv, save_csv
from qualifier.utils.calculat... | 32.420168 | 86 | 0.724469 |
7d7effeb46a34fb666e66222e60d5fe071ccf8f2 | 5,912 | py | Python | wiki/web/user.py | jzengerling/WikiWiki5 | 72f23187afe03dbb1fde3f2d98c083e7adc7bd06 | [
"BSD-3-Clause"
] | null | null | null | wiki/web/user.py | jzengerling/WikiWiki5 | 72f23187afe03dbb1fde3f2d98c083e7adc7bd06 | [
"BSD-3-Clause"
] | 1 | 2018-04-17T22:54:33.000Z | 2018-04-17T22:54:33.000Z | wiki/web/user.py | jzengerling/WikiWiki5 | 72f23187afe03dbb1fde3f2d98c083e7adc7bd06 | [
"BSD-3-Clause"
] | 1 | 2018-04-05T22:07:48.000Z | 2018-04-05T22:07:48.000Z | """
User classes & helpers
~~~~~~~~~~~~~~~~~~~~~~
"""
import sqlite3
import os
import binascii
import hashlib
from functools import wraps
from flask import current_app
from flask_login import current_user
class UserManager(object):
def __init__(self, defaultAuthenticationMethod = "hash", path="."):
... | 30.791667 | 120 | 0.58931 |
a873f49b61c91fd515e237dbd92683bb01b859e2 | 103 | py | Python | time_utils.py | nicktien007/Nick.Udic.Kcm | ba5fb48fc1b2cfe1eb40085f0165d5d7c172c627 | [
"MIT"
] | null | null | null | time_utils.py | nicktien007/Nick.Udic.Kcm | ba5fb48fc1b2cfe1eb40085f0165d5d7c172c627 | [
"MIT"
] | null | null | null | time_utils.py | nicktien007/Nick.Udic.Kcm | ba5fb48fc1b2cfe1eb40085f0165d5d7c172c627 | [
"MIT"
] | null | null | null | from datetime import datetime
def show_current_time():
return datetime.now().strftime("%H:%M:%S") | 20.6 | 46 | 0.718447 |
a80e27b4fe643e0f6d40076ddf5c6297504e056c | 925 | py | Python | addons/oejia_wx/models/wx_config.py | marionumza/vocal_v12 | 480990e919c9410903e06e7813ee92800bd6a569 | [
"Unlicense"
] | null | null | null | addons/oejia_wx/models/wx_config.py | marionumza/vocal_v12 | 480990e919c9410903e06e7813ee92800bd6a569 | [
"Unlicense"
] | null | null | null | addons/oejia_wx/models/wx_config.py | marionumza/vocal_v12 | 480990e919c9410903e06e7813ee92800bd6a569 | [
"Unlicense"
] | 1 | 2021-05-05T07:59:08.000Z | 2021-05-05T07:59:08.000Z | # -*- coding: utf-8 -*-
from odoo import models, fields, api
from .menu_about_models import ACTION_OPTION
class WxConfig(models.Model):
_name = 'wx.config'
_description = u'公众号配置'
action = fields.Reference(string='关注后的自动回复', selection=ACTION_OPTION)
@api.multi
def write(self, vals):
re... | 25.694444 | 83 | 0.648649 |
3616917c3113516a728b3ef1f7e7a2593cc1c35e | 1,299 | py | Python | catalog/admin.py | omegatrix/django-local-library-tutorial | 2f6d05d88cba19e9bf1c4d66742e63edb609c461 | [
"MIT"
] | null | null | null | catalog/admin.py | omegatrix/django-local-library-tutorial | 2f6d05d88cba19e9bf1c4d66742e63edb609c461 | [
"MIT"
] | null | null | null | catalog/admin.py | omegatrix/django-local-library-tutorial | 2f6d05d88cba19e9bf1c4d66742e63edb609c461 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Author, Book, BookInstance, Genre, Language
@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
list_display = (
"last_name",
"first_name",
"date_of_birth",
"date_of_death",
)
fields = [
"first_name",
... | 21.295082 | 73 | 0.620477 |
f2a79941032a5b995adfb8c69d35e2a241d1cb9a | 17,103 | py | Python | grr/client/vfs_handlers/registry.py | theGreenJedi/grr | d9e11e304dc299d49c76b7fdf6fdbfcd4b8eec39 | [
"Apache-2.0"
] | null | null | null | grr/client/vfs_handlers/registry.py | theGreenJedi/grr | d9e11e304dc299d49c76b7fdf6fdbfcd4b8eec39 | [
"Apache-2.0"
] | null | null | null | grr/client/vfs_handlers/registry.py | theGreenJedi/grr | d9e11e304dc299d49c76b7fdf6fdbfcd4b8eec39 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Implement access to the windows registry."""
import ctypes
import ctypes.wintypes
import exceptions
import os
import stat
import StringIO
import _winreg
from grr.client import vfs
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths... | 32.639313 | 80 | 0.651991 |
2db7ab26bc06e67fb858f1ebabea79c6eb2b43d2 | 37,483 | py | Python | sdk/python/pulumi_azure_native/securityinsights/v20210301preview/watchlist.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/securityinsights/v20210301preview/watchlist.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/securityinsights/v20210301preview/watchlist.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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, overload
from ... import _utilities
fro... | 44.997599 | 569 | 0.652189 |
73cd37d073f4f86da6162439d5c3faa3c139e6d1 | 977 | py | Python | labour_common_qualifications/management/commands/setup_labour_common_qualifications.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | labour_common_qualifications/management/commands/setup_labour_common_qualifications.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | labour_common_qualifications/management/commands/setup_labour_common_qualifications.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from labour.models import Qualification
from ...models import JVKortti
class Command(BaseCommand):
args = ''
help = 'Setup common labour qualifications'
def handle(*args, **options):
con... | 33.689655 | 84 | 0.62129 |
b66cd9fcfcca9c806c69454c4314c46bd591d0dc | 7,598 | py | Python | youtuatools/extractor/jamendo.py | Pagasis/YouTua | edb44b2065a7224f8b26aaf76166bf7287901567 | [
"MIT"
] | 47 | 2021-01-02T07:44:50.000Z | 2022-02-28T22:02:13.000Z | youtuatools/extractor/jamendo.py | Pagasis/YouTua | edb44b2065a7224f8b26aaf76166bf7287901567 | [
"MIT"
] | 4 | 2021-02-07T03:35:13.000Z | 2021-10-31T19:23:53.000Z | youtuatools/extractor/jamendo.py | Pagasis/YouTua | edb44b2065a7224f8b26aaf76166bf7287901567 | [
"MIT"
] | 8 | 2021-01-03T05:44:39.000Z | 2021-11-01T05:46:32.000Z | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import random
from ..compat import compat_str
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
try_get,
)
class JamendoIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://
... | 34.694064 | 88 | 0.43801 |
956669b868c5279339f881b8d3369268cee5a474 | 4,575 | py | Python | python/metaspore/nn/wide_and_deep.py | meta-soul/MetaSpore | e6fbc12c6a3139df76c87215b16f9dba65962ec7 | [
"Apache-2.0"
] | 32 | 2022-03-30T10:24:00.000Z | 2022-03-31T16:19:15.000Z | python/metaspore/nn/wide_and_deep.py | meta-soul/MetaSpore | e6fbc12c6a3139df76c87215b16f9dba65962ec7 | [
"Apache-2.0"
] | null | null | null | python/metaspore/nn/wide_and_deep.py | meta-soul/MetaSpore | e6fbc12c6a3139df76c87215b16f9dba65962ec7 | [
"Apache-2.0"
] | 3 | 2022-03-30T10:28:57.000Z | 2022-03-30T11:37:39.000Z | #
# Copyright 2022 DMetaSoul
#
# 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, ... | 48.670213 | 99 | 0.679563 |
d312a07203cf82c5a0b9192f623b6ea89204cb97 | 2,368 | py | Python | alipay/aop/api/domain/AlipayUserGroupbuyingSyncModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserGroupbuyingSyncModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserGroupbuyingSyncModel.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.constant.ParamConstants import *
class AlipayUserGroupbuyingSyncModel(object):
def __init__(self):
self._group_expire = None
self._group_id = None
self._havana_id = None
self._item_id = No... | 27.534884 | 75 | 0.58277 |
382bfc8743ca87587ae01978807ddbbdf0950339 | 5,395 | py | Python | thingsboard_gateway/connectors/modbus/bytes_modbus_downlink_converter.py | hguomin/thingsboard-gateway | e776c4454d9a1a037517046f3ebdfe7900cb02ef | [
"Apache-2.0"
] | 1 | 2021-09-27T05:32:26.000Z | 2021-09-27T05:32:26.000Z | thingsboard_gateway/connectors/modbus/bytes_modbus_downlink_converter.py | hguomin/thingsboard-gateway | e776c4454d9a1a037517046f3ebdfe7900cb02ef | [
"Apache-2.0"
] | null | null | null | thingsboard_gateway/connectors/modbus/bytes_modbus_downlink_converter.py | hguomin/thingsboard-gateway | e776c4454d9a1a037517046f3ebdfe7900cb02ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2021. ThingsBoard
#
# 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 ... | 49.953704 | 118 | 0.596293 |
a154e610d7dc8f07e2ccbd8801812a4b72e61423 | 971 | py | Python | pastry_shop/blog/models.py | Raekker/pastry-shop | 27e4e98594c57cbe5825a6571c6f93ad97dc1eb3 | [
"MIT"
] | null | null | null | pastry_shop/blog/models.py | Raekker/pastry-shop | 27e4e98594c57cbe5825a6571c6f93ad97dc1eb3 | [
"MIT"
] | null | null | null | pastry_shop/blog/models.py | Raekker/pastry-shop | 27e4e98594c57cbe5825a6571c6f93ad97dc1eb3 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
from django.utils.translation import gettext_lazy as _
from pastry_shop.users.models import User
class Post(models.Model):
title = models.CharField(_("Title"), max_length=64)
content = models.TextField(_("Content"))
author = models.ForeignKey(User,... | 30.34375 | 87 | 0.717817 |
4f520305fad753c5af1e9e6038c3469122a64819 | 24 | py | Python | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/DailyRewards/daily_rewards.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/DailyRewards/daily_rewards.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/DailyRewards/daily_rewards.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class DailyRewards: pass | 24 | 24 | 0.875 |
6a49a84d8bc67d095db3bc31c4a03e6ea67a3a5d | 6,715 | py | Python | selfdrive/debug/test_fw_query_on_routes.py | Basketkase/openpilot | 769e1cf7a8322ca83d1a86a2f547acf5e3a5a52e | [
"MIT"
] | 73 | 2017-10-28T20:52:31.000Z | 2022-03-05T21:41:34.000Z | selfdrive/debug/test_fw_query_on_routes.py | Basketkase/openpilot | 769e1cf7a8322ca83d1a86a2f547acf5e3a5a52e | [
"MIT"
] | 60 | 2020-09-03T15:23:38.000Z | 2021-12-17T12:39:50.000Z | selfdrive/debug/test_fw_query_on_routes.py | Basketkase/openpilot | 769e1cf7a8322ca83d1a86a2f547acf5e3a5a52e | [
"MIT"
] | 130 | 2020-08-19T04:20:02.000Z | 2022-03-24T23:05:22.000Z | #!/usr/bin/env python3
# type: ignore
from collections import defaultdict
import argparse
import os
import traceback
from tqdm import tqdm
from tools.lib.logreader import LogReader
from tools.lib.route import Route
from selfdrive.car.car_helpers import interface_names
from selfdrive.car.fw_versions import match_fw_to_... | 34.973958 | 121 | 0.633656 |
129f7982c5811f20fe920f65044ceb59c534df6a | 11,224 | py | Python | _BACKUPS_V4/v4_5/LightPicture_Test.py | nagame/LightPicture | f9b00a39bc16aea4abac60c0dd0aab2acac5adcf | [
"Unlicense"
] | null | null | null | _BACKUPS_V4/v4_5/LightPicture_Test.py | nagame/LightPicture | f9b00a39bc16aea4abac60c0dd0aab2acac5adcf | [
"Unlicense"
] | null | null | null | _BACKUPS_V4/v4_5/LightPicture_Test.py | nagame/LightPicture | f9b00a39bc16aea4abac60c0dd0aab2acac5adcf | [
"Unlicense"
] | null | null | null | from LightPicture import *
import unittest
import random
import time
class TestConstructor_Vertex(unittest.TestCase):
"""
Test Vertex class calls
"""
def test_none(self):
"""
Calling Vertex class with no key (key = None)
"""
v0 = Vertex()
... | 34.324159 | 120 | 0.511226 |
c61784f5227ccf6ae3c6be9edfbda0becb696f07 | 1,214 | py | Python | sdf_timing/sdfparse.py | chipsalliance/python-sdf-timing | 119eee06c5a8700da594c5e066259a96858ececa | [
"Apache-2.0"
] | 1 | 2022-02-22T09:41:42.000Z | 2022-02-22T09:41:42.000Z | sdf_timing/sdfparse.py | chipsalliance/f4pga-sdf-timing | 119eee06c5a8700da594c5e066259a96858ececa | [
"Apache-2.0"
] | null | null | null | sdf_timing/sdfparse.py | chipsalliance/f4pga-sdf-timing | 119eee06c5a8700da594c5e066259a96858ececa | [
"Apache-2.0"
] | 1 | 2022-02-27T18:09:31.000Z | 2022-02-27T18:09:31.000Z | #!/usr/bin/env python3
# coding: utf-8
#
# Copyright 2020-2022 F4PGA 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 requ... | 25.291667 | 74 | 0.720758 |
c3148a5580a5bee60640531f3799f422807c1316 | 299 | py | Python | src/views/web.py | Dourv/tornado-mongo | 95dbd1151abac2831d98b6d768a86f59b11c273d | [
"MIT"
] | 2 | 2015-04-21T14:49:05.000Z | 2015-04-21T15:15:40.000Z | src/views/web.py | Dourv/tornado-mongo | 95dbd1151abac2831d98b6d768a86f59b11c273d | [
"MIT"
] | null | null | null | src/views/web.py | Dourv/tornado-mongo | 95dbd1151abac2831d98b6d768a86f59b11c273d | [
"MIT"
] | null | null | null | import calendar
import config
import hashlib
import json
import os
import pymongo
import tornado
import base # Heredando de base para todas las vistas.
from bson.objectid import ObjectId
from datetime import datetime, timedelta
class home(base.base):
def get(self):
self._render('index.html') | 18.6875 | 55 | 0.795987 |
2b94a593790c06ec36614b382aacd4e5c002daf3 | 5,308 | py | Python | src/garage/tf/policies/categorical_mlp_policy_with_model.py | researchai/unsupervised_meta_rl | 9ca4b41438277ef6cfea047482b98de9da07815a | [
"MIT"
] | 1 | 2019-07-31T06:53:38.000Z | 2019-07-31T06:53:38.000Z | src/garage/tf/policies/categorical_mlp_policy_with_model.py | researchai/unsupervised_meta_rl | 9ca4b41438277ef6cfea047482b98de9da07815a | [
"MIT"
] | null | null | null | src/garage/tf/policies/categorical_mlp_policy_with_model.py | researchai/unsupervised_meta_rl | 9ca4b41438277ef6cfea047482b98de9da07815a | [
"MIT"
] | null | null | null | """CategoricalMLPPolicy with model."""
import akro
import tensorflow as tf
from garage.misc.overrides import overrides
from garage.tf.distributions import Categorical
from garage.tf.models import MLPModel
from garage.tf.policies.base2 import StochasticPolicy2
class CategoricalMLPPolicyWithModel(StochasticPolicy2):
... | 37.914286 | 78 | 0.648644 |
cd0185096a030d018ce0c4b5b59a1a3e6b1a98fe | 3,990 | py | Python | lib/surface/service_directory/endpoints/create.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/service_directory/endpoints/create.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/service_directory/endpoints/create.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 Google 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 requir... | 37.641509 | 210 | 0.72005 |
e866a1eda0f45a4ee1330431811c5b8591679963 | 1,639 | py | Python | augly/video/augmenters/ffmpeg/pad.py | Ierezell/AugLy | a7dca8c36bc05dbd7694373fe9b883d6ff720f56 | [
"MIT"
] | 1 | 2021-09-29T21:27:50.000Z | 2021-09-29T21:27:50.000Z | augly/video/augmenters/ffmpeg/pad.py | Ierezell/AugLy | a7dca8c36bc05dbd7694373fe9b883d6ff720f56 | [
"MIT"
] | null | null | null | augly/video/augmenters/ffmpeg/pad.py | Ierezell/AugLy | a7dca8c36bc05dbd7694373fe9b883d6ff720f56 | [
"MIT"
] | 1 | 2021-07-02T13:08:55.000Z | 2021-07-02T13:08:55.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
from typing import Dict, Tuple
from augly.utils import validate_rgb_color
from augly.video.augmenters.ffmpeg import BaseFFMPEGAugmenter
from augly.video.helpers import get_video_info
from ffmpeg.nodes import FilterableStream
class VideoAugmen... | 32.137255 | 86 | 0.594875 |
184509d0ff629360ccc3f12be014115d963bc99d | 4,661 | py | Python | cifar_data.py | xiaoyoyoada/MNIST_CIFAR_Classification_TF | edad97f58a5259896b0c2bd677e75c4a703b54cb | [
"MIT"
] | null | null | null | cifar_data.py | xiaoyoyoada/MNIST_CIFAR_Classification_TF | edad97f58a5259896b0c2bd677e75c4a703b54cb | [
"MIT"
] | null | null | null | cifar_data.py | xiaoyoyoada/MNIST_CIFAR_Classification_TF | edad97f58a5259896b0c2bd677e75c4a703b54cb | [
"MIT"
] | null | null | null | from urllib.request import urlretrieve
import tarfile
import os
import pickle
import numpy as np
from tqdm import tqdm
class DownloadProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_size=None):
self.total = total_size
self.update((block_num - self.last_block) * b... | 41.247788 | 119 | 0.692555 |
191c5808b589c8a2ea58a45e445ff272718c3b60 | 17,529 | py | Python | qmplot/modules/_manhattan.py | julibeg/qmplot | 6fad9dffeb068aa5d88cb91ec0399bdc0c359ef6 | [
"MIT"
] | 24 | 2021-02-20T08:03:00.000Z | 2021-12-04T08:11:43.000Z | qmplot/modules/_manhattan.py | julibeg/qmplot | 6fad9dffeb068aa5d88cb91ec0399bdc0c359ef6 | [
"MIT"
] | 6 | 2021-05-28T14:13:51.000Z | 2022-03-25T07:50:01.000Z | qmplot/modules/_manhattan.py | julibeg/qmplot | 6fad9dffeb068aa5d88cb91ec0399bdc0c359ef6 | [
"MIT"
] | 7 | 2021-02-21T17:21:29.000Z | 2021-11-01T20:12:14.000Z | """Plotting functions for manhattan plot.
Copyright (c) Shujia Huang
Date: 2021-02-21
This model is based on brentp's script on github:
https://github.com/brentp/bio-playground/blob/master/plots/manhattan-plot.py
Thanks for Brentp's contributions
"""
from itertools import cycle
from pandas import DataFrame
import n... | 39.127232 | 132 | 0.618518 |
ce92d2bbc5c110ae686f5899b6af721fdfb1fab5 | 3,706 | py | Python | mindspore/ops/_op_impl/_custom_op/correction_mul.py | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | 1 | 2020-06-17T07:05:45.000Z | 2020-06-17T07:05:45.000Z | mindspore/ops/_op_impl/_custom_op/correction_mul.py | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | null | null | null | mindspore/ops/_op_impl/_custom_op/correction_mul.py | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.849462 | 107 | 0.702105 |
ac78e1b19bff863c157491ad0153d38fd0f75fd5 | 9,343 | py | Python | tests/conftest.py | theonlyklas/vyper | e3d802fd471e663d75847bdfebea81edda59b472 | [
"MIT"
] | null | null | null | tests/conftest.py | theonlyklas/vyper | e3d802fd471e663d75847bdfebea81edda59b472 | [
"MIT"
] | null | null | null | tests/conftest.py | theonlyklas/vyper | e3d802fd471e663d75847bdfebea81edda59b472 | [
"MIT"
] | null | null | null | import eth_tester
import logging
import pytest
import web3
from functools import wraps
from eth_tester import (
EthereumTester,
)
from eth_tester.exceptions import (
TransactionFailed
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3 import (
Web3,
)
from web3.contract imp... | 30.632787 | 121 | 0.670341 |
e01a70d5313911173aa592ea2cc70e8aa47e0ed2 | 595 | py | Python | L1Trigger/L1TTrackMatch/python/L1GTTInputProducer_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 2 | 2018-06-01T05:18:55.000Z | 2021-04-08T21:44:06.000Z | L1Trigger/L1TTrackMatch/python/L1GTTInputProducer_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 26 | 2018-10-30T12:47:58.000Z | 2022-03-29T08:39:00.000Z | L1Trigger/L1TTrackMatch/python/L1GTTInputProducer_cfi.py | p2l1pfp/cmssw | 9bda22bf33ecf18dd19a3af2b3a8cbdb1de556a9 | [
"Apache-2.0"
] | 1 | 2021-11-23T09:25:45.000Z | 2021-11-23T09:25:45.000Z | import FWCore.ParameterSet.Config as cms
L1GTTInputProducer = cms.EDProducer('L1GTTInputProducer',
l1TracksInputTag = cms.InputTag("TTTracksFromTrackletEmulation", "Level1TTTracks"),
outputCollectionName = cms.string("Level1TTTracksConverted"),
debug = cms.int32(0) # Verbosity levels: 0, 1, 2, 3
)
L1GTTInputPro... | 42.5 | 93 | 0.784874 |
b7bbedf98e3c95b50e91b2339bc0c7317fa7cf8a | 536 | py | Python | examples/basic/texturecubes.py | leftwillow/vedo | b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b | [
"CC0-1.0"
] | 1 | 2021-04-25T06:28:01.000Z | 2021-04-25T06:28:01.000Z | examples/basic/texturecubes.py | leftwillow/vedo | b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b | [
"CC0-1.0"
] | null | null | null | examples/basic/texturecubes.py | leftwillow/vedo | b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b | [
"CC0-1.0"
] | null | null | null | """
Show a cube for each available texture name.
Any jpg file can be used as texture.
"""
from vedo import settings, Plotter, Cube, Text2D
from vedo.settings import textures, textures_path
print(__doc__)
print('textures_path:', settings.textures_path)
print('textures:', settings.textures)
settings.immediateRendering ... | 25.52381 | 49 | 0.740672 |
84540425aad038e7ecf2f4a40e52fffd74b48ce8 | 4,638 | py | Python | doc/conf.py | rfoliva/tmuxp | 5c1d9bc7f4fce8b68a50838c9c6d08c08a4dad92 | [
"MIT"
] | null | null | null | doc/conf.py | rfoliva/tmuxp | 5c1d9bc7f4fce8b68a50838c9c6d08c08a4dad92 | [
"MIT"
] | null | null | null | doc/conf.py | rfoliva/tmuxp | 5c1d9bc7f4fce8b68a50838c9c6d08c08a4dad92 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import inspect
import os
import sys
from os.path import dirname, relpath
import alagitpull
import tmuxp
# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
sys.path.append(os.path.abspath(os.path.j... | 23.306533 | 85 | 0.603924 |
7df01957682ccacc16f049051d9ddcd71fbcb756 | 852 | py | Python | example.py | JakeRoggenbuck/mongofastlogger | 92b23e8fb7134c3a01b24f273f3a7774c10c716f | [
"MIT"
] | null | null | null | example.py | JakeRoggenbuck/mongofastlogger | 92b23e8fb7134c3a01b24f273f3a7774c10c716f | [
"MIT"
] | 1 | 2020-11-28T06:41:26.000Z | 2020-11-28T06:41:26.000Z | example.py | JakeRoggenbuck/mongofastlogger | 92b23e8fb7134c3a01b24f273f3a7774c10c716f | [
"MIT"
] | null | null | null | from mongofastlogger import Logger, LogViewer
# Make logger
logger = Logger()
# Log message with tag of "Something"
logger.log("Something", "This is bad as well i guess but i dont actually know")
# Log message with tag of "Something" and display log in console
logger.log("Something", "This is a message", display=True... | 26.625 | 79 | 0.762911 |
885b9722cd8350c97b3a388a9eb240207fb87c4c | 4,130 | py | Python | ament_package/templates.py | DLu/ament_package | f5cc3b4bc4ceb1937d8e15a85035f14270f5af71 | [
"Apache-2.0"
] | 6 | 2016-11-20T21:33:10.000Z | 2020-03-19T21:21:33.000Z | ament_package/templates.py | DLu/ament_package | f5cc3b4bc4ceb1937d8e15a85035f14270f5af71 | [
"Apache-2.0"
] | 95 | 2015-03-10T16:28:45.000Z | 2021-12-20T20:00:02.000Z | ament_package/templates.py | DLu/ament_package | f5cc3b4bc4ceb1937d8e15a85035f14270f5af71 | [
"Apache-2.0"
] | 16 | 2016-06-24T17:06:12.000Z | 2021-11-15T14:07:26.000Z | # Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.052632 | 96 | 0.680872 |
e1b224931b177f86ed6b976f16cff2d8db30eecb | 114 | py | Python | tests/test_version.py | cariad/naughtty | 76822b016dc71ca1705384fcdddc3292f857699a | [
"MIT"
] | null | null | null | tests/test_version.py | cariad/naughtty | 76822b016dc71ca1705384fcdddc3292f857699a | [
"MIT"
] | 3 | 2021-09-19T08:08:12.000Z | 2021-10-05T14:47:24.000Z | tests/test_version.py | cariad/naughtty | 76822b016dc71ca1705384fcdddc3292f857699a | [
"MIT"
] | null | null | null | from naughtty.version import get_version
def test_get_version() -> None:
assert get_version() == "-1.-1.-1"
| 19 | 40 | 0.692982 |
b7681b5861e3ef4cf3f5a0eead8fe14283ecc7d7 | 6,961 | py | Python | clients/client/python/ory_client/model/ui_nodes.py | extraymond/sdk | d4e9ffe7335648b7af3fb8d4363e7991d1ba36b5 | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/ui_nodes.py | extraymond/sdk | d4e9ffe7335648b7af3fb8d4363e7991d1ba36b5 | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/ui_nodes.py | extraymond/sdk | d4e9ffe7335648b7af3fb8d4363e7991d1ba36b5 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.15
Contact: support@ory.sh
Generated by: htt... | 37.424731 | 194 | 0.575492 |
417916767ba7ab49d889aac227ed5d61a0e8b5d9 | 2,081 | py | Python | tests/snippets/types_snippet.py | psy2848048/RustPython | ff6935b37f6d93d3cd016d805772ebbb7303a326 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2019-08-16T06:53:06.000Z | 2019-08-16T06:53:06.000Z | tests/snippets/types_snippet.py | psy2848048/RustPython | ff6935b37f6d93d3cd016d805772ebbb7303a326 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | tests/snippets/types_snippet.py | psy2848048/RustPython | ff6935b37f6d93d3cd016d805772ebbb7303a326 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2022-02-28T08:54:49.000Z | 2022-02-28T08:54:49.000Z | try:
import gc
except ImportError:
gc = None
assert type(type) is type
assert type(object) is type
assert type(object()) is object
new_type = type('New', (object,), {})
assert type(new_type) is type
assert type(new_type()) is new_type
metaclass = type('MCl', (type,), {})
cls = metaclass('Cls', (object,), {}... | 20.401961 | 68 | 0.681884 |
05610beef60c7102cba0bea3b1b8e5625e0ce535 | 1,673 | py | Python | tests/test_proxy.py | toke-kogama/proxy-python | e0153a3df8e7df936b2b656dfbf8f86832b0032b | [
"MIT"
] | null | null | null | tests/test_proxy.py | toke-kogama/proxy-python | e0153a3df8e7df936b2b656dfbf8f86832b0032b | [
"MIT"
] | null | null | null | tests/test_proxy.py | toke-kogama/proxy-python | e0153a3df8e7df936b2b656dfbf8f86832b0032b | [
"MIT"
] | 1 | 2019-06-12T10:37:44.000Z | 2019-06-12T10:37:44.000Z | import proxy
import time
import unittest
from proxy.proxy import ClientState
from proxy.compat import _urlparse
class ClientStateTest(unittest.TestCase):
def test_should_try_online(self):
state = ClientState()
self.assertEquals(state.should_try(), True)
def test_should_try_new_error(self):
... | 32.803922 | 78 | 0.655111 |
b7366981120047b736934c90ecd9f5bcb9227b0c | 585 | py | Python | mc/__init__.py | iximeow/binja-m16c | debf368e5df90a96d6c8b0bc128626a9d6834bb4 | [
"0BSD"
] | 12 | 2020-01-15T00:51:06.000Z | 2021-10-02T12:45:50.000Z | mc/__init__.py | iximeow/binja-m16c | debf368e5df90a96d6c8b0bc128626a9d6834bb4 | [
"0BSD"
] | 2 | 2020-02-03T08:26:26.000Z | 2020-07-01T19:51:44.000Z | mc/__init__.py | iximeow/binja-m16c | debf368e5df90a96d6c8b0bc128626a9d6834bb4 | [
"0BSD"
] | 4 | 2020-02-03T07:51:12.000Z | 2021-02-14T19:13:07.000Z | from binaryninja import log
from .coding import *
from .instr import Instruction
from . import opcodes
__all__ = ['decode', 'encode']
def decode(data, addr):
decoder = Decoder(data)
try:
instr = Instruction(decoder)
instr.decode(decoder, addr)
return instr
except KeyError:
... | 20.892857 | 61 | 0.632479 |
be0dcc59423ec46feab51ed104f2edd188a947fd | 2,517 | py | Python | python3/rplugin.py | lambdalisue/vim-rplugin | 4352c403356228c4716d3cb223620a3eddace0b5 | [
"MIT"
] | 10 | 2016-09-29T03:22:14.000Z | 2020-04-01T14:39:42.000Z | python3/rplugin.py | lambdalisue/vim-rplugin | 4352c403356228c4716d3cb223620a3eddace0b5 | [
"MIT"
] | null | null | null | python3/rplugin.py | lambdalisue/vim-rplugin | 4352c403356228c4716d3cb223620a3eddace0b5 | [
"MIT"
] | null | null | null | import vim
# NOTE:
# vim.options['encoding'] returns bytes so use vim.eval('&encoding')
ENCODING = vim.eval('&encoding')
def reform_bytes(value):
if isinstance(value, bytes):
return value.decode(ENCODING, 'surrogateescape')
elif isinstance(value, (dict, vim.Dictionary, vim.Options)):
return ... | 25.683673 | 74 | 0.629718 |
8f9f20588dffd0243d574cf6a40d2ce9a9a50f5b | 7,597 | py | Python | sktime/forecasting/theta.py | pabworks/sktime | 3ab1ecc20ab2e5d2a19f3df13f07fa88b7c8d652 | [
"BSD-3-Clause"
] | 1 | 2021-02-04T00:31:02.000Z | 2021-02-04T00:31:02.000Z | sktime/forecasting/theta.py | pabworks/sktime | 3ab1ecc20ab2e5d2a19f3df13f07fa88b7c8d652 | [
"BSD-3-Clause"
] | null | null | null | sktime/forecasting/theta.py | pabworks/sktime | 3ab1ecc20ab2e5d2a19f3df13f07fa88b7c8d652 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__all__ = ["ThetaForecaster"]
__author__ = ["@big-o", "Markus Löning"]
from warnings import warn
import numpy as np
import pandas as pd
from scipy.stats import norm
from sktime.forecasting.base._base import DEFAULT_ALPHA
from sktime.forecasting.exp_smoothing import ExponentialSmoothing
from s... | 30.388 | 87 | 0.625247 |
017ffada3473be5d4df9f3b0b0e96bbe6d67e6b1 | 1,874 | py | Python | bob/pipelines/tests/test_datasets.py | bioidiap/bob.pipelines | cbefdaf3b384ee11cb26a279281f007adc2d8f19 | [
"BSD-3-Clause"
] | 1 | 2020-10-13T19:58:44.000Z | 2020-10-13T19:58:44.000Z | bob/pipelines/tests/test_datasets.py | bioidiap/bob.pipelines | cbefdaf3b384ee11cb26a279281f007adc2d8f19 | [
"BSD-3-Clause"
] | null | null | null | bob/pipelines/tests/test_datasets.py | bioidiap/bob.pipelines | cbefdaf3b384ee11cb26a279281f007adc2d8f19 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""Test code for datasets"""
import os
import numpy as np
import pkg_resources
import pytest
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import FunctionTransformer
from bob.pipelines.datasets import FileListDatabase
from bob.pipelines.transformers impo... | 27.970149 | 74 | 0.661153 |
a39d4a34a3c676dbd81f374e2ca5858869effc68 | 2,967 | py | Python | quantitative/variable_transforms.py | sujason/quantitative | 42b7fdea05629934f513a7b15e5b03c7697c5c46 | [
"MIT"
] | 7 | 2016-02-21T21:30:52.000Z | 2022-01-07T18:17:55.000Z | quantitative/variable_transforms.py | sujason/quantitative | 42b7fdea05629934f513a7b15e5b03c7697c5c46 | [
"MIT"
] | null | null | null | quantitative/variable_transforms.py | sujason/quantitative | 42b7fdea05629934f513a7b15e5b03c7697c5c46 | [
"MIT"
] | 3 | 2016-01-27T09:52:38.000Z | 2020-05-19T03:59:39.000Z | import numpy as np
def normalize_transform(z, match_array=None, total=1.):
"""
Takes an array and turns them into positive weights. This transform is scale invariant.
"""
if match_array is not None:
z, _ = np.broadcast_arrays(z, match_array)
w = z**2.
return total*w/w.sum()
def norm... | 31.231579 | 114 | 0.644085 |
2589bb5c89d75adf0b6d3f8041bb478a01f9efeb | 3,020 | py | Python | rally_os/plugins/openstack/scenario.py | vishnu-kumar/PeformanceFramework | 79daebe41ee654aa6d9ca3c37aa0c3d77858dadc | [
"Apache-2.0"
] | null | null | null | rally_os/plugins/openstack/scenario.py | vishnu-kumar/PeformanceFramework | 79daebe41ee654aa6d9ca3c37aa0c3d77858dadc | [
"Apache-2.0"
] | null | null | null | rally_os/plugins/openstack/scenario.py | vishnu-kumar/PeformanceFramework | 79daebe41ee654aa6d9ca3c37aa0c3d77858dadc | [
"Apache-2.0"
] | null | null | null | # 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... | 38.717949 | 78 | 0.646358 |
ec1f89d06411a4f3a7b1f1c0eeba614677e592fa | 444 | py | Python | src/supplier/migrations/0011_auto_20191204_0821.py | vandana0608/Pharmacy-Managament | f99bdec11c24027a432858daa19247a21cecc092 | [
"bzip2-1.0.6"
] | null | null | null | src/supplier/migrations/0011_auto_20191204_0821.py | vandana0608/Pharmacy-Managament | f99bdec11c24027a432858daa19247a21cecc092 | [
"bzip2-1.0.6"
] | null | null | null | src/supplier/migrations/0011_auto_20191204_0821.py | vandana0608/Pharmacy-Managament | f99bdec11c24027a432858daa19247a21cecc092 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.0.7 on 2019-12-04 02:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('supplier', '0010_auto_20191013_1630'),
]
operations = [
migrations.AlterField(
model_name='supplier',
name='supplier... | 23.368421 | 100 | 0.626126 |
f370427bf7ea3e2fcc458b911c9e9698162a63f6 | 859 | py | Python | tests/test_dbscan.py | kristinebilgrav/SVDB | ebb4b189a6a6e70725781dcfb87771e6c37b5a35 | [
"MIT"
] | 20 | 2017-03-07T13:58:07.000Z | 2022-03-18T14:03:10.000Z | tests/test_dbscan.py | kristinebilgrav/SVDB | ebb4b189a6a6e70725781dcfb87771e6c37b5a35 | [
"MIT"
] | 48 | 2017-02-01T10:11:41.000Z | 2022-03-31T02:13:15.000Z | tests/test_dbscan.py | kristinebilgrav/SVDB | ebb4b189a6a6e70725781dcfb87771e6c37b5a35 | [
"MIT"
] | 13 | 2016-07-08T11:35:45.000Z | 2022-03-28T08:43:56.000Z | import unittest
import numpy
from svdb.DBSCAN import main
class TestReadVCFLine(unittest.TestCase):
#test that distant points are not merged
def test_distant_points(self):
data = numpy.array([[1,1],[1,101]])
epsilon=100
m=2
result=main(data,epsilon,m)
assert (result[0... | 26.84375 | 59 | 0.592549 |
1cba2a599023cc9a587e568323d555ddd049367c | 1,016 | py | Python | ScheduledDeliveryWebApplication/app/resources/order_resource.py | leitao-bcc/MovileNext3_Backend_LucasLeitao | 15bdd8a96711a2e305078cd2f152b86374dbe276 | [
"Unlicense"
] | null | null | null | ScheduledDeliveryWebApplication/app/resources/order_resource.py | leitao-bcc/MovileNext3_Backend_LucasLeitao | 15bdd8a96711a2e305078cd2f152b86374dbe276 | [
"Unlicense"
] | null | null | null | ScheduledDeliveryWebApplication/app/resources/order_resource.py | leitao-bcc/MovileNext3_Backend_LucasLeitao | 15bdd8a96711a2e305078cd2f152b86374dbe276 | [
"Unlicense"
] | null | null | null | from flask_restful import Resource, reqparse
class OrderResource(Resource):
parser = reqparse.RequestParser()
parser.add_argument('customerId', type=str, required=True)
parser.add_argument('merchantId', type=str, required=True)
parser.add_argument('deliveryAddress', type=str, required=True)
parser... | 27.459459 | 68 | 0.697835 |
bf621ea543e556fea7933b5127a18a99b2564d9d | 1,357 | py | Python | Evaluation/helper.py | jnice-81/FpgaHbmForDaCe | b80749524264b4884cbd852d2db825cf8a6007aa | [
"BSD-3-Clause"
] | null | null | null | Evaluation/helper.py | jnice-81/FpgaHbmForDaCe | b80749524264b4884cbd852d2db825cf8a6007aa | [
"BSD-3-Clause"
] | null | null | null | Evaluation/helper.py | jnice-81/FpgaHbmForDaCe | b80749524264b4884cbd852d2db825cf8a6007aa | [
"BSD-3-Clause"
] | null | null | null | from typing import List
from dace import memlet
from dace.sdfg.state import SDFGState
from dace.transformation.optimizer import Optimizer
from hbm_bank_split import HbmBankSplit
from hbm_transform import set_shape
from dace.sdfg import graph, nodes, propagation, utils
def get_first_node(state: SDFGState, cond):
... | 33.097561 | 110 | 0.690494 |
418253a108f32f7b3792a40f796b4eb26df21b09 | 8,682 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/monitoring/grafana_plugin.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/monitoring/grafana_plugin.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/monitoring/grafana_plugin.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | 33.651163 | 118 | 0.590187 |
6aa1d360e22530723943e4fd2d32da6fe0b4f614 | 3,091 | py | Python | databuilder/wm_data_loaders/wm_databuilder/extractor/wm_redshift_metadata_extractor.py | jkomar-wm/amundsen | 4381e47ade902f2614358be7a6b59586616cb7c0 | [
"Apache-2.0"
] | null | null | null | databuilder/wm_data_loaders/wm_databuilder/extractor/wm_redshift_metadata_extractor.py | jkomar-wm/amundsen | 4381e47ade902f2614358be7a6b59586616cb7c0 | [
"Apache-2.0"
] | null | null | null | databuilder/wm_data_loaders/wm_databuilder/extractor/wm_redshift_metadata_extractor.py | jkomar-wm/amundsen | 4381e47ade902f2614358be7a6b59586616cb7c0 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from typing import ( # noqa: F401
Any, Dict, Iterator, Union,
)
from pyhocon import ConfigFactory, ConfigTree # noqa: F401
from .wm_base_postgres_metadata_extractor import BasePostgresMetadataExtractor
class RedshiftMetad... | 34.730337 | 117 | 0.622452 |
f9a6c92c3f8017a4b3a57b2eea931e655fcfc772 | 20,733 | py | Python | tests/metarl/tf/models/test_lstm.py | icml2020submission6857/metarl | 9b66cefa2b6bcb6a38096d629ce8853b47c7171d | [
"MIT"
] | 2 | 2020-03-15T14:35:15.000Z | 2021-02-15T16:38:00.000Z | tests/metarl/tf/models/test_lstm.py | icml2020submission6857/metarl | 9b66cefa2b6bcb6a38096d629ce8853b47c7171d | [
"MIT"
] | null | null | null | tests/metarl/tf/models/test_lstm.py | icml2020submission6857/metarl | 9b66cefa2b6bcb6a38096d629ce8853b47c7171d | [
"MIT"
] | 1 | 2020-02-24T03:04:23.000Z | 2020-02-24T03:04:23.000Z | import numpy as np
import pytest
import tensorflow as tf
from metarl.tf.models.lstm import lstm
from tests.fixtures import TfGraphTestCase
from tests.helpers import recurrent_step_lstm
class TestLSTM(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size = 2
sel... | 43.374477 | 79 | 0.526504 |
aaf88cb5cfdfdaf26657d75bb059665258b8930f | 1,949 | py | Python | omas/examples/connect_gkdb.py | gafusion/omas | 8e9b725483655db0ccbf9a4f7aa9eba7c6c04864 | [
"MIT"
] | 20 | 2017-11-07T14:36:21.000Z | 2021-03-27T19:14:17.000Z | omas/examples/connect_gkdb.py | Reksoatr/omas | 6740fd040d6af59e0aec54f977637b221733bd07 | [
"MIT"
] | 170 | 2017-11-09T06:40:11.000Z | 2022-03-29T17:33:26.000Z | omas/examples/connect_gkdb.py | Reksoatr/omas | 6740fd040d6af59e0aec54f977637b221733bd07 | [
"MIT"
] | 6 | 2017-11-22T14:44:54.000Z | 2022-01-10T19:52:47.000Z | #!/usr/bin/env python
# # -*- coding: utf-8 -*-
"""
Interface with GKDB
===================
Use OMAS to interface with Gyro-Kinetic DataBase (GKDB) https://gitlab.com/gkdb/gkdb
GKDB is a publicly accessible database of delta-f flux-tube gyro-kinetic simulations of tokamak plasmas
which stores its data according to the ... | 32.483333 | 125 | 0.741919 |
b2644caed688a96ba4da4820bf5c6f16f8e1c8fa | 384 | py | Python | ngo_cms/wsgi.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 5 | 2019-08-12T17:56:25.000Z | 2021-08-31T04:36:42.000Z | ngo_cms/wsgi.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 12 | 2020-02-12T00:38:11.000Z | 2022-03-11T23:50:12.000Z | ngo_cms/wsgi.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 8 | 2019-06-19T18:54:02.000Z | 2021-01-05T19:31:30.000Z | """
WSGI config for blog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | 24 | 78 | 0.783854 |
16377b1d054031285830631099162d4c9d1a63c7 | 952 | py | Python | 43_Hammurabi/python/test_hamurabi.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-24T17:56:31.000Z | 2022-03-24T17:56:31.000Z | 43_Hammurabi/python/test_hamurabi.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-24T20:16:26.000Z | 2022-03-24T20:16:26.000Z | 43_Hammurabi/python/test_hamurabi.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-11T14:14:06.000Z | 2022-03-11T14:14:06.000Z | import io
import hamurabi
def test_main(monkeypatch, capsys):
monkeypatch.setattr("sys.stdin", io.StringIO("100\n100\n100"))
hamurabi.main()
captured = capsys.readouterr()
actual_lines = captured.out.splitlines()
expected_lines = [
"HAMURABI", # 0
"CREATIVE COMPUTING MORRISTOWN,... | 30.709677 | 78 | 0.537815 |
cce7a09d2d557d9ad28ef8f69a29b750fe3e70e5 | 3,868 | py | Python | pymc3/tuning/scaling.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | 1 | 2020-09-30T06:26:53.000Z | 2020-09-30T06:26:53.000Z | pymc3/tuning/scaling.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | pymc3/tuning/scaling.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 27.048951 | 99 | 0.66727 |
48de49b7f548b12936c40b7822febcc1c38724d3 | 4,035 | py | Python | influxdb_client/domain/lesser_threshold.py | MASIFAYUB/influxdb-client-python | a067fa5670a6fbc600db2ac4e54e29e1b7124998 | [
"MIT"
] | null | null | null | influxdb_client/domain/lesser_threshold.py | MASIFAYUB/influxdb-client-python | a067fa5670a6fbc600db2ac4e54e29e1b7124998 | [
"MIT"
] | null | null | null | influxdb_client/domain/lesser_threshold.py | MASIFAYUB/influxdb-client-python | a067fa5670a6fbc600db2ac4e54e29e1b7124998 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
InfluxDB OSS API Service.
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa:... | 28.415493 | 159 | 0.566543 |
d6ac06429b2d87afdbfce0c1ef279e76f7da24da | 19,774 | py | Python | code/datasets.py | 1o0ko/StackGAN-v2 | b3b94d0ddf2372b849d7bb79db78469a4cce77ca | [
"MIT"
] | null | null | null | code/datasets.py | 1o0ko/StackGAN-v2 | b3b94d0ddf2372b849d7bb79db78469a4cce77ca | [
"MIT"
] | null | null | null | code/datasets.py | 1o0ko/StackGAN-v2 | b3b94d0ddf2372b849d7bb79db78469a4cce77ca | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import os.path
import random
import six
import sys
from collections import Counter
import h5py
import numpy as np
import pandas as pd
import torch
import torc... | 36.754647 | 116 | 0.592697 |
5e88f31760bc1e31cfaa60f3a56835c9e826c9c5 | 6,764 | py | Python | project/User/api/views.py | mrvafa/flask-user-jwt-api-token | 80379e3e8eca8e78a82d31b3f851768181430931 | [
"MIT"
] | null | null | null | project/User/api/views.py | mrvafa/flask-user-jwt-api-token | 80379e3e8eca8e78a82d31b3f851768181430931 | [
"MIT"
] | null | null | null | project/User/api/views.py | mrvafa/flask-user-jwt-api-token | 80379e3e8eca8e78a82d31b3f851768181430931 | [
"MIT"
] | null | null | null | from flask import request, make_response, jsonify
from flask.views import MethodView
from werkzeug.routing import ValidationError
from project import db, bcrypt
from project.User.models import User
class RegisterAPI(MethodView):
def post(self):
post_data = request.get_json()
username = post_data.... | 40.746988 | 104 | 0.532821 |
c754a0d82dd11c7998c134455e3d336ddc9ab702 | 1,516 | py | Python | Section5/Part1/login_user.py | ochsec/Hands-On-Amazon-DynamoDB-for-Developers-V- | 4700a372c2de017b015f947815fc555b862fc8a5 | [
"MIT"
] | 5 | 2020-03-25T08:17:35.000Z | 2021-10-04T04:52:59.000Z | Section5/Part1/login_user.py | ochsec/Hands-On-Amazon-DynamoDB-for-Developers-V- | 4700a372c2de017b015f947815fc555b862fc8a5 | [
"MIT"
] | 2 | 2021-03-25T22:35:27.000Z | 2021-03-25T22:35:58.000Z | Section5/Part1/login_user.py | ochsec/Hands-On-Amazon-DynamoDB-for-Developers-V- | 4700a372c2de017b015f947815fc555b862fc8a5 | [
"MIT"
] | 5 | 2020-08-27T04:14:28.000Z | 2022-01-27T20:40:36.000Z | import hashlib
import json
import os
import time
import traceback
import uuid
import boto3
from boto3.dynamodb.conditions import Key
dynamodb = boto3.resource('dynamodb')
table_name = os.environ['USER_TABLE']
table = dynamodb.Table(table_name)
def lambda_handler(event, context):
request_body = json.loads(event["... | 23.6875 | 69 | 0.623351 |
79e2d324eb015069b500704118b53e1800a9701d | 1,593 | py | Python | PollingExample.py | Poohl/Gamepad | ca3884211e03b867138b6b7135d6fe4d4314af78 | [
"MIT"
] | 50 | 2019-10-17T21:52:51.000Z | 2022-03-31T20:20:39.000Z | PollingExample.py | Poohl/Gamepad | ca3884211e03b867138b6b7135d6fe4d4314af78 | [
"MIT"
] | 6 | 2020-01-30T08:31:22.000Z | 2022-03-21T09:42:44.000Z | PollingExample.py | Poohl/Gamepad | ca3884211e03b867138b6b7135d6fe4d4314af78 | [
"MIT"
] | 20 | 2020-01-30T08:38:10.000Z | 2022-02-16T14:59:09.000Z | #!/usr/bin/env python
# coding: utf-8
# Load the gamepad and time libraries
import Gamepad
import time
# Gamepad settings
gamepadType = Gamepad.PS4
buttonHappy = 'CROSS'
buttonBeep = 'CIRCLE'
buttonExit = 'PS'
joystickSpeed = 'LEFT-Y'
joystickSteering = 'RIGHT-X'
# Wait for a connection
if not Gamepad.available():
... | 26.55 | 82 | 0.57941 |
33dea30317028a208c0c06d9078f544879efe2f7 | 456 | py | Python | config/variable/string.py | phirasit/TestcaseGenerator | 443f320e927a606d9d64933b60591c67c83b6630 | [
"MIT"
] | null | null | null | config/variable/string.py | phirasit/TestcaseGenerator | 443f320e927a606d9d64933b60591c67c83b6630 | [
"MIT"
] | null | null | null | config/variable/string.py | phirasit/TestcaseGenerator | 443f320e927a606d9d64933b60591c67c83b6630 | [
"MIT"
] | null | null | null | from config.variable.char import Char
class String(Char):
def __init__(self, args, props):
super().__init__(args, props)
self.var = Char(args, props)
assert ('length' in props)
def generate(self):
self.var.props = self.props
return [self.var.generate() for _ in range(... | 26.823529 | 91 | 0.629386 |
3898ca002d106a1462fdc186606af308bc26ce0b | 1,710 | py | Python | Nduja/utility/pattern.py | herrBez/Nduja | 51f93c6a8827ddf8605f88cf062d524b0ca5cebf | [
"BSD-3-Clause"
] | 2 | 2019-07-12T00:52:39.000Z | 2020-02-13T17:09:07.000Z | Nduja/utility/pattern.py | herrBez/Nduja | 51f93c6a8827ddf8605f88cf062d524b0ca5cebf | [
"BSD-3-Clause"
] | 2 | 2018-05-04T09:28:37.000Z | 2019-11-09T13:37:00.000Z | Nduja/utility/pattern.py | herrBez/Nduja | 51f93c6a8827ddf8605f88cf062d524b0ca5cebf | [
"BSD-3-Clause"
] | 2 | 2018-12-04T11:33:31.000Z | 2021-09-07T20:13:52.000Z | import re
from typing import List, Tuple, Dict
class Pattern:
def __init__(self, format_object: Dict[str, str]) -> None:
self._pattern = re.compile(format_object["wallet_regexp"])
self._name = format_object["name"]
self._group = format_object["group"]
self._symbol = format_object[... | 28.5 | 70 | 0.621637 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.