hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | 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 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_forks_repo_name stringlengths 5 125 | 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c30a8241bc4eb176e2d35bfc53ddbf79b7ca685f | 77 | py | Python | test/settings/test_kafka_consumer_config.py | DebasishMaji/PI | e293982cae8f8755d28d7b3de22966dc74759b90 | [
"Apache-2.0"
] | null | null | null | test/settings/test_kafka_consumer_config.py | DebasishMaji/PI | e293982cae8f8755d28d7b3de22966dc74759b90 | [
"Apache-2.0"
] | null | null | null | test/settings/test_kafka_consumer_config.py | DebasishMaji/PI | e293982cae8f8755d28d7b3de22966dc74759b90 | [
"Apache-2.0"
] | null | null | null | import unittest
class TestKafkaConsumerConfig(unittest.TestCase):
pass
| 12.833333 | 49 | 0.805195 | 58 | 0.753247 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c30ea52dd60b15b77f690236c9544837627ac0f7 | 7,684 | py | Python | Pycraft/StartupAnimation.py | demirdogukan/InsiderPycraft | 5567107326fbd222a7df6aabf4ab265e0a157636 | [
"MIT"
] | 22 | 2021-03-25T17:47:45.000Z | 2022-03-29T01:56:12.000Z | Pycraft/StartupAnimation.py | demirdogukan/InsiderPycraft | 5567107326fbd222a7df6aabf4ab265e0a157636 | [
"MIT"
] | 1 | 2021-12-22T16:12:59.000Z | 2021-12-22T16:12:59.000Z | Pycraft/StartupAnimation.py | demirdogukan/InsiderPycraft | 5567107326fbd222a7df6aabf4ab265e0a157636 | [
"MIT"
] | 3 | 2021-09-05T14:10:05.000Z | 2022-01-10T12:57:34.000Z | if not __name__ == "__main__":
print("Started <Pycraft_StartupAnimation>")
class GenerateStartupScreen:
def __init__(self):
pass
def Start(self):
try:
self.Display.fill(self.BackgroundCol)
self.mod_Pygame__... | 53.361111 | 141 | 0.511322 | 7,307 | 0.950937 | 0 | 0 | 0 | 0 | 0 | 0 | 394 | 0.051275 |
c30f35ba35fbd12a0fe79d62b724f5343db144f1 | 2,985 | py | Python | kattishunter/kattis/submission.py | ParksProjets/kattis-hunter | c4990edf59fba6d91d22fdc126673781ab423d0f | [
"MIT"
] | null | null | null | kattishunter/kattis/submission.py | ParksProjets/kattis-hunter | c4990edf59fba6d91d22fdc126673781ab423d0f | [
"MIT"
] | null | null | null | kattishunter/kattis/submission.py | ParksProjets/kattis-hunter | c4990edf59fba6d91d22fdc126673781ab423d0f | [
"MIT"
] | null | null | null | """
Submit files for a Kattis problem.
Copyright (C) 2019, Guillaume Gonnet
This project is under the MIT license.
"""
import os.path as path
import re
from typing import Dict, List, Text
import requests
import logging
from .login import login
logger = logging.getLogger(__name__)
# Base headers to use.
HEADERS ... | 26.415929 | 83 | 0.622781 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,159 | 0.388275 |
c30f9cd42abaa561a1c9cda944cad65e60a4fabe | 785 | py | Python | scripts/set_health_led.py | alanmitchell/mini-monitor | 5d60e1f69fc61d53f3090a159445595a9987c36a | [
"Apache-2.0"
] | 7 | 2016-01-11T23:54:31.000Z | 2022-02-16T11:58:16.000Z | scripts/set_health_led.py | alanmitchell/mini-monitor | 5d60e1f69fc61d53f3090a159445595a9987c36a | [
"Apache-2.0"
] | null | null | null | scripts/set_health_led.py | alanmitchell/mini-monitor | 5d60e1f69fc61d53f3090a159445595a9987c36a | [
"Apache-2.0"
] | 5 | 2015-12-17T15:22:45.000Z | 2018-08-13T17:40:38.000Z | #!/usr/bin/env python3
"""Script to do basic health checks of the system and turn on an LED on
BCM pin 12 (pin 32 on header) if they pass, turn Off otherwise.
"""
import time
import RPi.GPIO as GPIO
import subprocess
# The BCM pin number that the LED is wired to. When the pin
# is at 3.3V the LED is On.
LED_PIN = 12... | 25.322581 | 71 | 0.71465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 430 | 0.547771 |
c30fa03b89f6de54fae9f895f13e66390afbeacc | 2,676 | py | Python | vqa_txt_data/compare_experiment_results.py | billyang98/UNITER | c7f0833f14aa9dcb1e251a986c72e49edde1bdd4 | [
"MIT"
] | null | null | null | vqa_txt_data/compare_experiment_results.py | billyang98/UNITER | c7f0833f14aa9dcb1e251a986c72e49edde1bdd4 | [
"MIT"
] | null | null | null | vqa_txt_data/compare_experiment_results.py | billyang98/UNITER | c7f0833f14aa9dcb1e251a986c72e49edde1bdd4 | [
"MIT"
] | null | null | null | import json
import numpy as np
from tqdm import tqdm
# Change these based on experiment
#exp_dataset = 'mask_char_oov_test_set.db'
#exp_name = 'results_test_mask_char'
#exp_dataset = 'mask_2_oov_test_set.db'
#exp_name = 'results_test_mask_2'
#exp_dataset = 'mask_2_oov_test_set.db'
#exp_name = 'results_test_synonyms_ma... | 32.240964 | 155 | 0.763079 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,463 | 0.546712 |
c31181ed7742f029eee26ce5c90c82ae4b887fbd | 528 | py | Python | app/articles/forms.py | AlexRAV/flask-blog | df8036e01794914ca0e88856ed93f8a91cc1d47a | [
"BSD-3-Clause"
] | null | null | null | app/articles/forms.py | AlexRAV/flask-blog | df8036e01794914ca0e88856ed93f8a91cc1d47a | [
"BSD-3-Clause"
] | null | null | null | app/articles/forms.py | AlexRAV/flask-blog | df8036e01794914ca0e88856ed93f8a91cc1d47a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Article forms."""
from flask_wtf import Form, FlaskForm
from wtforms import PasswordField, StringField, TextAreaField
from wtforms.validators import DataRequired, Email, EqualTo, Length
class NewArticleForm(FlaskForm):
title = StringField('Article title', validators=[DataRequired(), Len... | 35.2 | 93 | 0.746212 | 309 | 0.585227 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.153409 |
c3119f2506c627ca857b498eb0bfe45c4bd66fbc | 9,582 | py | Python | dataanalysis.py | Rev-Jiang/Python | c91d5724a6843f095bfe1a05f65d9fc885e01b88 | [
"MIT"
] | null | null | null | dataanalysis.py | Rev-Jiang/Python | c91d5724a6843f095bfe1a05f65d9fc885e01b88 | [
"MIT"
] | null | null | null | dataanalysis.py | Rev-Jiang/Python | c91d5724a6843f095bfe1a05f65d9fc885e01b88 | [
"MIT"
] | null | null | null | #-*- coding: UTF-8 -*-
#上句表示可用中文注释,否则默认ASCII码保存
# Filename : dataanalysis.py
# author by : Rev_997
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def isiterable(obj):
try:
iter(obj)
return True
except TypeError:#not iterable
return False
#if i... | 20.08805 | 100 | 0.644124 | 0 | 0 | 63 | 0.00655 | 0 | 0 | 0 | 0 | 4,392 | 0.456644 |
c311dcd3f870bbdf6b67118d6ccc561653945f40 | 259 | py | Python | show_model_info.py | panovr/Brain-Tumor-Segmentation | bf1ac2360af46a484d632474ce93de339ad2b496 | [
"MIT"
] | null | null | null | show_model_info.py | panovr/Brain-Tumor-Segmentation | bf1ac2360af46a484d632474ce93de339ad2b496 | [
"MIT"
] | null | null | null | show_model_info.py | panovr/Brain-Tumor-Segmentation | bf1ac2360af46a484d632474ce93de339ad2b496 | [
"MIT"
] | null | null | null | import bts.model as model
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
BATCH_SIZE = 6
FILTER_LIST = [16,32,64,128,256]
unet_model = model.DynamicUNet(FILTER_LIST)
unet_model.summary(batch_size=BATCH_SIZE, device=device)
| 28.777778 | 69 | 0.783784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0.042471 |
c31289e9e024e29ebc9122d648b85bcf484eedb5 | 1,031 | py | Python | docs/source/conf.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 600 | 2015-05-20T00:37:21.000Z | 2022-03-09T03:48:38.000Z | docs/source/conf.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 323 | 2015-05-19T22:35:29.000Z | 2021-12-09T12:55:09.000Z | docs/source/conf.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 137 | 2015-05-14T19:51:58.000Z | 2022-01-31T19:36:32.000Z | # -*- coding: utf-8 -*-
import sphinx_rtd_theme
# -- General configuration -----------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_te... | 22.413043 | 77 | 0.645975 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 639 | 0.619787 |
c313212d51b9e2cc91e003a4faa89dafdee74dd8 | 13,900 | py | Python | edgedb/_testbase.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | null | null | null | edgedb/_testbase.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | null | null | null | edgedb/_testbase.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | 30.151844 | 79 | 0.566403 | 11,150 | 0.802158 | 1,817 | 0.130719 | 7,936 | 0.570935 | 350 | 0.02518 | 2,480 | 0.178417 |
c315663a28ae143f4027a8b0b899801904c9cfc7 | 824 | py | Python | konwledge_extraction/ner/bert_crf_ner/losses/focal_loss.py | mlshenkai/KGQA | 08e72d68da6519aaca7f39fabf8c0194bebd0314 | [
"Apache-2.0"
] | null | null | null | konwledge_extraction/ner/bert_crf_ner/losses/focal_loss.py | mlshenkai/KGQA | 08e72d68da6519aaca7f39fabf8c0194bebd0314 | [
"Apache-2.0"
] | null | null | null | konwledge_extraction/ner/bert_crf_ner/losses/focal_loss.py | mlshenkai/KGQA | 08e72d68da6519aaca7f39fabf8c0194bebd0314 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Kai Shen
# @Created Time: 2022/2/23 10:14 AM
# @Organization: YQN
# @Email: mlshenkai@163.com
import torch
import torch.nn as nn
import torch.nn.functional as F
class FocalLoss(nn.Module):
def __init__(self, gamma=2, weight=None, ignore_index=-100):
super(FocalLoss, self... | 28.413793 | 85 | 0.598301 | 625 | 0.758495 | 0 | 0 | 0 | 0 | 0 | 0 | 241 | 0.292476 |
c3159e702eacd0f494cdd9cb0e3428247b34b8ae | 669 | py | Python | tests/biology/test_join_fasta.py | shandou/pyjanitor | d7842613b4e4a7532a88f673fd54e94c3ba5a96b | [
"MIT"
] | 1 | 2021-03-25T10:46:57.000Z | 2021-03-25T10:46:57.000Z | tests/biology/test_join_fasta.py | shandou/pyjanitor | d7842613b4e4a7532a88f673fd54e94c3ba5a96b | [
"MIT"
] | null | null | null | tests/biology/test_join_fasta.py | shandou/pyjanitor | d7842613b4e4a7532a88f673fd54e94c3ba5a96b | [
"MIT"
] | null | null | null | import importlib
import os
import pytest
from helpers import running_on_ci
import janitor.biology # noqa: F403, F401
# Skip all tests if Biopython not installed
pytestmark = pytest.mark.skipif(
(importlib.util.find_spec("Bio") is None) & ~running_on_ci(),
reason="Biology tests relying on Biopython only requ... | 25.730769 | 71 | 0.714499 | 0 | 0 | 0 | 0 | 330 | 0.493274 | 0 | 0 | 246 | 0.367713 |
c3166bb775db3bf02b0cf82cc41168152ed9ad5b | 12,182 | py | Python | test/test_tilepyramid.py | ungarj/tilematrix | f5797cf2056f7de8de8f284db40b10943e5e40fb | [
"MIT"
] | 16 | 2016-07-27T22:21:12.000Z | 2022-01-15T18:13:43.000Z | test/test_tilepyramid.py | ungarj/tilematrix | f5797cf2056f7de8de8f284db40b10943e5e40fb | [
"MIT"
] | 30 | 2015-10-09T18:10:13.000Z | 2022-03-15T16:56:54.000Z | test/test_tilepyramid.py | ungarj/tilematrix | f5797cf2056f7de8de8f284db40b10943e5e40fb | [
"MIT"
] | 2 | 2021-07-30T07:23:13.000Z | 2021-09-13T12:24:11.000Z | """TilePyramid creation."""
import pytest
from shapely.geometry import Point
from shapely.ops import unary_union
from types import GeneratorType
from tilematrix import TilePyramid, snap_bounds
def test_init():
"""Initialize TilePyramids."""
for tptype in ["geodetic", "mercator"]:
assert TilePyramid(... | 34.315493 | 86 | 0.64111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,057 | 0.086767 |
c316f38f732cf3a6b4ada4ff98b624a3bbbf8f67 | 1,180 | py | Python | setup.py | giovannicuriel/report_builder | e728e77d7647f248198e39521278ed246171b256 | [
"BSD-2-Clause"
] | null | null | null | setup.py | giovannicuriel/report_builder | e728e77d7647f248198e39521278ed246171b256 | [
"BSD-2-Clause"
] | null | null | null | setup.py | giovannicuriel/report_builder | e728e77d7647f248198e39521278ed246171b256 | [
"BSD-2-Clause"
] | 1 | 2019-11-25T12:51:29.000Z | 2019-11-25T12:51:29.000Z | # -*- coding: utf-8 -*-
"""
setup.py script
"""
import io
from collections import OrderedDict
from setuptools import setup, find_packages
with io.open('README.md', 'rt', encoding='utf8') as f:
README = f.read()
setup(
name='reportbuilder',
version='0.0.1',
url='http://github.com/giovannicuriel/report... | 26.818182 | 85 | 0.634746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 582 | 0.49322 |
c3184306de4eb3bd08a9f52149a34046ea7333f3 | 2,296 | py | Python | pyfunds/option.py | lucaruzzola/pyfunds | 498c5a0a3eb9423ca9f267b8d8c47f0f23987f3d | [
"MIT"
] | 6 | 2021-08-16T16:15:05.000Z | 2022-03-21T15:46:29.000Z | pyfunds/option.py | lucaruzzola/pyfunds | 498c5a0a3eb9423ca9f267b8d8c47f0f23987f3d | [
"MIT"
] | null | null | null | pyfunds/option.py | lucaruzzola/pyfunds | 498c5a0a3eb9423ca9f267b8d8c47f0f23987f3d | [
"MIT"
] | null | null | null | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Callable, Generic, TypeVar
T = TypeVar("T")
U = TypeVar("U")
class NoElement(Exception):
pass
class Option(ABC, Generic[T]):
def __init__(self):
super().__init__()
@staticmethod
def apply(value: T):
... | 23.916667 | 79 | 0.582753 | 2,131 | 0.928136 | 0 | 0 | 336 | 0.146341 | 0 | 0 | 197 | 0.085801 |
c318b45aea4400e446baec5f077cb60419864b6f | 1,237 | py | Python | generate_dataset/visualize_mask.py | Kaju-Bubanja/PoseCNN | c2f7c4e8f98bc7c67d5cbc0be3167d3cb3bea396 | [
"MIT"
] | 20 | 2018-08-30T08:02:56.000Z | 2021-09-15T12:22:22.000Z | generate_dataset/visualize_mask.py | Kaju-Bubanja/PoseCNN | c2f7c4e8f98bc7c67d5cbc0be3167d3cb3bea396 | [
"MIT"
] | null | null | null | generate_dataset/visualize_mask.py | Kaju-Bubanja/PoseCNN | c2f7c4e8f98bc7c67d5cbc0be3167d3cb3bea396 | [
"MIT"
] | 5 | 2018-10-16T15:01:15.000Z | 2020-08-29T03:52:51.000Z | import cv2
import rosbag
import rospy
from cv_bridge import CvBridge
def main():
# bag = rosbag.Bag("/home/satco/PycharmProjects/PoseCNN/bag/dataset_one_box.bag")
bag = rosbag.Bag("/home/satco/PycharmProjects/PoseCNN/bag/test.bag")
# topics = ["/camera1/color/image_raw", "/camera2/color/image_raw"]
to... | 35.342857 | 100 | 0.595796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 426 | 0.344382 |
c318c41ae02a5b1bce71b7e42ebcd848cf95e1f3 | 909 | py | Python | itembase/core/urls/location_urls.py | wedwardbeck/ibase | 5647fa5aff6c1bdc99b6c93884ff0d5aef17d85b | [
"MIT"
] | null | null | null | itembase/core/urls/location_urls.py | wedwardbeck/ibase | 5647fa5aff6c1bdc99b6c93884ff0d5aef17d85b | [
"MIT"
] | 9 | 2020-01-17T14:16:08.000Z | 2020-02-18T15:07:40.000Z | itembase/core/urls/location_urls.py | wedwardbeck/ibase | 5647fa5aff6c1bdc99b6c93884ff0d5aef17d85b | [
"MIT"
] | null | null | null | from django.urls import path
from itembase.core.views.location_views import LocationAddressCreateView, LocationAddressDetailView, \
LocationAddressUpdateView, LocationCreateView, LocationDeleteView, LocationDetailView, LocationListView, \
LocationUpdateView
app_name = "locations"
urlpatterns = [
path("", ... | 50.5 | 110 | 0.729373 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 200 | 0.220022 |
c318d66c0ef14a2821d36ef3adf7ffcb264139ea | 3,455 | py | Python | web/addons/product_margin/wizard/product_margin.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | 1 | 2019-12-29T11:53:56.000Z | 2019-12-29T11:53:56.000Z | odoo/addons/product_margin/wizard/product_margin.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | odoo/addons/product_margin/wizard/product_margin.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | 3 | 2020-10-08T14:42:10.000Z | 2022-01-28T14:12:29.000Z | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | 35.618557 | 81 | 0.589001 | 2,320 | 0.671102 | 0 | 0 | 0 | 0 | 0 | 0 | 1,930 | 0.558288 |
c31b0a85e27980acdba6410b67f84602e15446a0 | 1,038 | py | Python | scripts/analysis_one.py | VikkiMba/Programmable-matter | d340c0b370a7e610892ffd8351f7aa576928d05c | [
"MIT"
] | null | null | null | scripts/analysis_one.py | VikkiMba/Programmable-matter | d340c0b370a7e610892ffd8351f7aa576928d05c | [
"MIT"
] | null | null | null | scripts/analysis_one.py | VikkiMba/Programmable-matter | d340c0b370a7e610892ffd8351f7aa576928d05c | [
"MIT"
] | null | null | null | name = input('Enter file name: ')
lst=list()
lst2=list()
with open(name) as f:
for line in f:
#print(line)
blops=line.rstrip()
blop=blops.split()
#for val in blop:
my_lst = [float(val) for val in blop]#list_comprehension
for num in my_lst:
if num ... | 20.352941 | 64 | 0.578998 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 376 | 0.362235 |
c31bd0f2505a1c4be1c52fbd6469723bb696bfa9 | 2,470 | py | Python | account/models.py | Hasanozzaman-Khan/Django-User-Authentication | 96482a51ed01bbdc7092d6ca34383054967a8aa0 | [
"MIT"
] | null | null | null | account/models.py | Hasanozzaman-Khan/Django-User-Authentication | 96482a51ed01bbdc7092d6ca34383054967a8aa0 | [
"MIT"
] | null | null | null | account/models.py | Hasanozzaman-Khan/Django-User-Authentication | 96482a51ed01bbdc7092d6ca34383054967a8aa0 | [
"MIT"
] | null | null | null |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from PIL import Image
# Create your models here.
class Home(models.Model):
pass
class CustomUserManager(BaseUserManager):
"""Manager for user profiles"""
def create_user(self, email, f... | 30.493827 | 90 | 0.676923 | 2,288 | 0.926316 | 0 | 0 | 0 | 0 | 0 | 0 | 433 | 0.175304 |
c31dc50c8e3e9b895471f34a5cb531f2da5f9d94 | 316 | py | Python | Numeric Patterns/numericpattern37.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | null | null | null | Numeric Patterns/numericpattern37.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 471 | 2022-01-15T07:07:18.000Z | 2022-02-28T16:01:42.000Z | Numeric Patterns/numericpattern37.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 2 | 2022-01-17T09:43:16.000Z | 2022-01-29T15:15:47.000Z | height = int(input())
for i in range(1,height+1) :
for j in range(1, i+1):
m = i*j
if(m <= 9):
print("",m,end = " ")
else:
print(m,end = " ")
print()
# Sample Input :- 5
# Output :-
# 1
# 2 4
# 3 6 9
# 4 8 12 16
# 5 10 15 20 25
| 13.73913 | 33 | 0.379747 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 89 | 0.281646 |
c31e95b8404220c927502906ac5a4aee6be489dd | 2,617 | py | Python | reviewboard/search/testing.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/search/testing.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/search/testing.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | """Search-related testing utilities."""
import tempfile
import time
from contextlib import contextmanager
import haystack
from django.conf import settings
from django.core.management import call_command
from djblets.siteconfig.models import SiteConfiguration
from reviewboard.admin.siteconfig import load_site_config
... | 30.788235 | 78 | 0.659534 | 0 | 0 | 1,814 | 0.69316 | 1,830 | 0.699274 | 0 | 0 | 1,104 | 0.421857 |
c31e9aaa2f138851e26e15e8a729a624dea9ce5b | 6,434 | py | Python | pydron/config/config.py | DelphianCalamity/pydron | 1518dc71b5cf64fde563b864db2a4de74e092c8e | [
"MIT"
] | 5 | 2020-04-06T15:20:56.000Z | 2022-01-05T23:11:13.000Z | pydron/config/config.py | mahmoudimus/pydron | a7b484dec8bcc2730ba9bd76bc63bf3362c05e4d | [
"MIT"
] | null | null | null | pydron/config/config.py | mahmoudimus/pydron | a7b484dec8bcc2730ba9bd76bc63bf3362c05e4d | [
"MIT"
] | 2 | 2020-11-27T20:21:34.000Z | 2021-02-26T23:02:11.000Z | # Copyright (C) 2015 Stefan C. Mueller
import json
import os.path
from remoot import pythonstarter, smartstarter
import anycall
from pydron.backend import worker
from pydron.interpreter import scheduler, strategies
from twisted.internet import defer
preload_packages = []
def load_config(configfile=None):
if... | 32.331658 | 96 | 0.562791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,039 | 0.161486 |
c31eedaebb01514423f430e25d6d4f8b0f2cba6b | 4,678 | py | Python | astropy/tests/plugins/display.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | null | null | null | astropy/tests/plugins/display.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | 10 | 2017-03-15T16:14:43.000Z | 2018-11-22T14:40:54.000Z | astropy/tests/plugins/display.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | 1 | 2020-01-23T00:41:10.000Z | 2020-01-23T00:41:10.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This plugin provides customization of the header displayed by pytest for
reporting purposes.
"""
import os
import sys
import datetime
import locale
import math
from collections import OrderedDict
from astropy.tests.helper import ignore_warnings
from ... | 32.943662 | 78 | 0.614793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,679 | 0.358914 |
c31f343b321d0b0d195053ec8d68315783bcc174 | 2,782 | py | Python | packages/api-server/api_server/routes/lifts.py | Sald-for-Communication-and-IT/rmf-web | ec5996ab0b06440d7147170f3030b14c73d26116 | [
"Apache-2.0"
] | null | null | null | packages/api-server/api_server/routes/lifts.py | Sald-for-Communication-and-IT/rmf-web | ec5996ab0b06440d7147170f3030b14c73d26116 | [
"Apache-2.0"
] | null | null | null | packages/api-server/api_server/routes/lifts.py | Sald-for-Communication-and-IT/rmf-web | ec5996ab0b06440d7147170f3030b14c73d26116 | [
"Apache-2.0"
] | null | null | null | from typing import Any, List, cast
from fastapi import Depends
from rx import operators as rxops
from api_server.base_app import BaseApp
from api_server.fast_io import FastIORouter, WatchRequest
from api_server.models import Lift, LiftHealth, LiftRequest, LiftState
from api_server.repositories import RmfRepository
f... | 36.12987 | 86 | 0.586988 | 2,430 | 0.873472 | 0 | 0 | 2,259 | 0.812006 | 1,637 | 0.588426 | 221 | 0.079439 |
c320f2c59ba3ca84a73f6a79313b9f9398f03283 | 5,228 | py | Python | src/opnsense/scripts/suricata/queryAlertLog.py | ass-a2s/opnsense-core | a0634d180325f6afe3be7f514b4470e47ff5eb75 | [
"BSD-2-Clause"
] | 2 | 2019-03-15T03:35:54.000Z | 2019-03-15T07:50:36.000Z | src/opnsense/scripts/suricata/queryAlertLog.py | ass-a2s/opnsense-core | a0634d180325f6afe3be7f514b4470e47ff5eb75 | [
"BSD-2-Clause"
] | null | null | null | src/opnsense/scripts/suricata/queryAlertLog.py | ass-a2s/opnsense-core | a0634d180325f6afe3be7f514b4470e47ff5eb75 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python3.6
"""
Copyright (c) 2015-2019 Ad Schellevis <ad@opnsense.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain ... | 39.606061 | 106 | 0.599273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,305 | 0.440895 |
c3214282673aaeda28c84c61fc6d8f9be877c23b | 3,592 | py | Python | cairis/gui/DictionaryListCtrl.py | RachelLar/cairis_update | 0b1d6d17ce49bc74887d1684e28c53c1b06e2fa2 | [
"Apache-2.0"
] | null | null | null | cairis/gui/DictionaryListCtrl.py | RachelLar/cairis_update | 0b1d6d17ce49bc74887d1684e28c53c1b06e2fa2 | [
"Apache-2.0"
] | null | null | null | cairis/gui/DictionaryListCtrl.py | RachelLar/cairis_update | 0b1d6d17ce49bc74887d1684e28c53c1b06e2fa2 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 37.030928 | 133 | 0.733018 | 2,693 | 0.749722 | 0 | 0 | 0 | 0 | 0 | 0 | 850 | 0.236637 |
c32367d43e08138167f815beb65fbee346856f66 | 1,965 | py | Python | old_test/test-large.py | briandobbins/pynio | 1dd5fc0fc133f2b8d329ae68929bd3c6c1c5fa7c | [
"Apache-2.0"
] | null | null | null | old_test/test-large.py | briandobbins/pynio | 1dd5fc0fc133f2b8d329ae68929bd3c6c1c5fa7c | [
"Apache-2.0"
] | null | null | null | old_test/test-large.py | briandobbins/pynio | 1dd5fc0fc133f2b8d329ae68929bd3c6c1c5fa7c | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division
import numpy as np
import Nio
import time, os
#
# Creating a file
#
init_time = time.clock()
ncfile = 'test-large.nc'
if (os.path.exists(ncfile)):
os.system("/bin/rm -f " + ncfile)
opt = Nio.options()
opt.Format = "LargeFile"
opt.PreFill = False
file = Nio.open_file(nc... | 23.674699 | 71 | 0.689567 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 622 | 0.316539 |
c323fd0a281a1d87543bdabbbe5b4427e5eec191 | 36,178 | py | Python | eeauditor/auditors/aws/Amazon_ECS_Auditor.py | kbhagi/ElectricEye | 31960e1e1cfb75c5d354844ea9e07d5295442823 | [
"Apache-2.0"
] | 442 | 2020-03-15T20:56:36.000Z | 2022-03-31T22:13:07.000Z | eeauditor/auditors/aws/Amazon_ECS_Auditor.py | kbhagi/ElectricEye | 31960e1e1cfb75c5d354844ea9e07d5295442823 | [
"Apache-2.0"
] | 57 | 2020-03-15T22:09:56.000Z | 2022-03-31T13:17:06.000Z | eeauditor/auditors/aws/Amazon_ECS_Auditor.py | kbhagi/ElectricEye | 31960e1e1cfb75c5d354844ea9e07d5295442823 | [
"Apache-2.0"
] | 59 | 2020-03-15T21:19:10.000Z | 2022-03-31T15:01:31.000Z | #This file is part of ElectricEye.
#SPDX-License-Identifier: Apache-2.0
#Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you un... | 57.60828 | 254 | 0.409199 | 0 | 0 | 34,833 | 0.962823 | 34,961 | 0.966361 | 0 | 0 | 14,280 | 0.394715 |
c324c7d6ffabe1bf0c4f2f6e3eba09b511032c92 | 7,470 | py | Python | Mask/Interpolate slider without prepolate.py | typedev/RoboFont-1 | 307c3c953a338f58cd0070aa5b1bb737bde08cc9 | [
"MIT"
] | 1 | 2016-03-27T17:07:16.000Z | 2016-03-27T17:07:16.000Z | Mask/Interpolate slider without prepolate.py | typedev/RoboFont-1 | 307c3c953a338f58cd0070aa5b1bb737bde08cc9 | [
"MIT"
] | null | null | null | Mask/Interpolate slider without prepolate.py | typedev/RoboFont-1 | 307c3c953a338f58cd0070aa5b1bb737bde08cc9 | [
"MIT"
] | null | null | null | """
This slider controls interpolation between foreground and mask layers.
Initial position for slider is at 1.0 (current foreground outline)
Sliding left to 0.0 interpolates to mask
Sliding right to 3.0 extrapolates away from mask.
NOTE:
Running this script opens an observer on the current glyph in the Glyph View wi... | 30.614754 | 105 | 0.493574 | 792 | 0.106024 | 0 | 0 | 0 | 0 | 0 | 0 | 1,800 | 0.240964 |
c3261a4d2211366618f8d261cfec66b8e3825641 | 429 | py | Python | ex062.py | paulo-caixeta/Exercicios_Curso_Python | 3b77925499c174ea9ff81dec65d6319125219b9a | [
"MIT"
] | null | null | null | ex062.py | paulo-caixeta/Exercicios_Curso_Python | 3b77925499c174ea9ff81dec65d6319125219b9a | [
"MIT"
] | null | null | null | ex062.py | paulo-caixeta/Exercicios_Curso_Python | 3b77925499c174ea9ff81dec65d6319125219b9a | [
"MIT"
] | null | null | null | # Continuação do ex061 (Termos de PA)
print('Gerador de PA')
print('-=' * 10)
primeiro = int(input('Primeiro termo: '))
razão = int(input('Razão: '))
i = 0
n = 10
novos = 10
total = 0
while novos != 0:
total = total + novos
while i < total:
termo = primeiro + razão * i
i += 1
print(termo... | 23.833333 | 63 | 0.578089 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 143 | 0.329493 |
c3266d2fbd585c2d178a2034896380f763b83e0c | 4,151 | py | Python | order/tests.py | DanLivassan/bookstore | f054c3dcb7d6b57c24f98ea28a23de0061d2ccf2 | [
"MIT"
] | null | null | null | order/tests.py | DanLivassan/bookstore | f054c3dcb7d6b57c24f98ea28a23de0061d2ccf2 | [
"MIT"
] | 1 | 2022-02-25T01:38:50.000Z | 2022-02-25T01:38:50.000Z | order/tests.py | DanLivassan/bookstore | f054c3dcb7d6b57c24f98ea28a23de0061d2ccf2 | [
"MIT"
] | null | null | null | from random import randint
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from order.serializers import OrderSerializer
from product.models import Product
from order.models import Order
from rest_framework import status
from rest_framework.test import API... | 33.747967 | 113 | 0.645387 | 3,134 | 0.754999 | 0 | 0 | 0 | 0 | 0 | 0 | 596 | 0.14358 |
c326bebf1fd8cf9fedf46e490c5cf11624fd3c7e | 6,950 | py | Python | sam-app/tests/unit/test_apns.py | mgacy/Adequate-Backend | 7f62f692a3fff53f825e597289515bffadb8f25c | [
"MIT"
] | 1 | 2021-06-03T07:27:18.000Z | 2021-06-03T07:27:18.000Z | sam-app/tests/unit/test_apns.py | mgacy/Adequate-Backend | 7f62f692a3fff53f825e597289515bffadb8f25c | [
"MIT"
] | 3 | 2021-04-06T18:36:02.000Z | 2021-06-16T04:22:27.000Z | sam-app/tests/unit/test_apns.py | mgacy/Adequate-Backend | 7f62f692a3fff53f825e597289515bffadb8f25c | [
"MIT"
] | null | null | null | import unittest
from .mocks import BotoSessionMock
from push_notification import apns
class APNSTestCase(unittest.TestCase):
def_apns_category = 'MGDailyDealCategory'
# def setUp(self):
# def tearDown(self):
# push_notification
# push_background
# make_new_deal_message
# make_delta_... | 29.079498 | 109 | 0.489784 | 6,861 | 0.987194 | 0 | 0 | 0 | 0 | 0 | 0 | 2,474 | 0.355971 |
c327543b799027a0d190954bd8149ab8b7d7603f | 809 | py | Python | scrapets/extract.py | ownport/scrapets | e52609aae4d55fb9d4315f90d4e2fe3804ef8ff6 | [
"MIT"
] | 2 | 2017-06-22T15:45:52.000Z | 2019-08-23T03:34:40.000Z | scrapets/extract.py | ownport/scrapets | e52609aae4d55fb9d4315f90d4e2fe3804ef8ff6 | [
"MIT"
] | 9 | 2016-10-23T17:56:34.000Z | 2016-12-12T10:39:23.000Z | scrapets/extract.py | ownport/scrapets | e52609aae4d55fb9d4315f90d4e2fe3804ef8ff6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from HTMLParser import HTMLParser
# -------------------------------------------------------
#
# LinkExtractor: extract links from html page
#
class BaseExtractor(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self._links = []
@property
def links(se... | 20.74359 | 80 | 0.566131 | 631 | 0.779975 | 0 | 0 | 58 | 0.071693 | 0 | 0 | 148 | 0.182942 |
c327b1f258b5961f3d1085b7f824f0cb5ee2f32a | 2,227 | py | Python | tour/forms.py | superdev0505/mtp-web | 8288765a89daaa7b02dfd7e78cc51c4f12d7fcce | [
"MIT"
] | null | null | null | tour/forms.py | superdev0505/mtp-web | 8288765a89daaa7b02dfd7e78cc51c4f12d7fcce | [
"MIT"
] | null | null | null | tour/forms.py | superdev0505/mtp-web | 8288765a89daaa7b02dfd7e78cc51c4f12d7fcce | [
"MIT"
] | null | null | null | ## Django Packages
from django import forms
from django_select2 import forms as s2forms
## App packages
from .models import *
from datetime import datetime
from bootstrap_datepicker_plus import DatePickerInput, TimePickerInput, DateTimePickerInput, MonthPickerInput, YearPickerInput
from tags_input import fields
from l... | 31.814286 | 133 | 0.562191 | 1,710 | 0.767849 | 0 | 0 | 0 | 0 | 0 | 0 | 482 | 0.216435 |
c327d2cfdab4947c294367dcb469b4dd7dc0ab92 | 485 | py | Python | bots/test_analyseGithub.py | RSE2-D2/RSE2-D2 | eb535669cbc476b67d7cb6e1092eb0babe2f24df | [
"MIT"
] | 3 | 2020-04-02T09:39:44.000Z | 2020-04-02T14:26:48.000Z | bots/test_analyseGithub.py | RSE2-D2/RSE2-D2 | eb535669cbc476b67d7cb6e1092eb0babe2f24df | [
"MIT"
] | 16 | 2020-04-02T08:21:16.000Z | 2020-04-02T15:44:29.000Z | bots/test_analyseGithub.py | RSE2-D2/RSE2-D2 | eb535669cbc476b67d7cb6e1092eb0babe2f24df | [
"MIT"
] | 1 | 2020-04-02T08:36:41.000Z | 2020-04-02T08:36:41.000Z | import analyseGithub
def test_containsGithubURL_empty():
assert not analyseGithub.containsGitHubURL("")
def test_containsGithubURL_noUrl():
assert not analyseGithub.containsGitHubURL("Some test tweet")
def test_containsGithubURL_url():
repo = "https://github.com/git/git"
assert analyseGithub.contains... | 30.3125 | 77 | 0.762887 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 104 | 0.214433 |
c3283cdb2fefed11f9dc322c324670fa2d4fbccd | 1,069 | py | Python | tests/unit/utils/filebuffer_test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:56.000Z | 2021-03-08T18:59:46.000Z | tests/unit/utils/filebuffer_test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/filebuffer_test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2020-12-04T11:28:06.000Z | 2020-12-04T11:28:06.000Z | # -*- coding: utf-8 -*-
'''
tests.unit.utils.filebuffer_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2012 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
'''
# Import salt libs
... | 30.542857 | 75 | 0.663237 | 463 | 0.43271 | 0 | 0 | 0 | 0 | 0 | 0 | 381 | 0.356075 |
c328c8c92438a707d941d9592d5c8e996b8cd217 | 2,881 | py | Python | ranking_baselines/ARCII/rank_metrics.py | dileep1996/mnsrf_ranking_suggestion | 5bd241fb49f08fa4937539991e12e5a502d5a072 | [
"MIT"
] | 1 | 2020-02-04T18:27:25.000Z | 2020-02-04T18:27:25.000Z | ranking_baselines/DRMM/rank_metrics.py | dileep1996/mnsrf_ranking_suggestion | 5bd241fb49f08fa4937539991e12e5a502d5a072 | [
"MIT"
] | null | null | null | ranking_baselines/DRMM/rank_metrics.py | dileep1996/mnsrf_ranking_suggestion | 5bd241fb49f08fa4937539991e12e5a502d5a072 | [
"MIT"
] | null | null | null | ###############################################################################
# Author: Wasi Ahmad
# Project: ARC-II: Convolutional Matching Model
# Date Created: 7/18/2017
#
# File Description: This script contains ranking evaluation functions.
##################################################################... | 34.710843 | 81 | 0.560222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,081 | 0.375217 |
c3292201406d3697087e8916c4dd2621e50dc55a | 192 | py | Python | src/wwucs/bot/__init__.py | reillysiemens/wwucs-bot | 9e48ba5dc981e36cd8b18345bcbd3768c3deeeb8 | [
"0BSD"
] | null | null | null | src/wwucs/bot/__init__.py | reillysiemens/wwucs-bot | 9e48ba5dc981e36cd8b18345bcbd3768c3deeeb8 | [
"0BSD"
] | null | null | null | src/wwucs/bot/__init__.py | reillysiemens/wwucs-bot | 9e48ba5dc981e36cd8b18345bcbd3768c3deeeb8 | [
"0BSD"
] | null | null | null | """WWUCS Bot module."""
__all__ = [
"__author__",
"__email__",
"__version__",
]
__author__ = "Reilly Tucker Siemens"
__email__ = "reilly@tuckersiemens.com"
__version__ = "0.1.0"
| 16 | 38 | 0.651042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 0.598958 |
c3295559778e2a7c61a68e36cb3971cb3e83f7f7 | 10,638 | py | Python | deploy/python/det_keypoint_unite_infer.py | Amanda-Barbara/PaddleDetection | 65ac13074eaaa2447c644a2df71969d8a3dd1fae | [
"Apache-2.0"
] | null | null | null | deploy/python/det_keypoint_unite_infer.py | Amanda-Barbara/PaddleDetection | 65ac13074eaaa2447c644a2df71969d8a3dd1fae | [
"Apache-2.0"
] | null | null | null | deploy/python/det_keypoint_unite_infer.py | Amanda-Barbara/PaddleDetection | 65ac13074eaaa2447c644a2df71969d8a3dd1fae | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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... | 39.254613 | 112 | 0.611957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,976 | 0.185749 |
c329db170d0245164f12a99cffcce2a4d1c0ef5a | 551 | py | Python | plugins/google_cloud_compute/komand_google_cloud_compute/actions/disk_detach/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/google_cloud_compute/komand_google_cloud_compute/actions/disk_detach/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/google_cloud_compute/komand_google_cloud_compute/actions/disk_detach/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import insightconnect_plugin_runtime
from .schema import DiskDetachInput, DiskDetachOutput, Input, Component
class DiskDetach(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="disk_detach", description=Component.DESCRIPTION, input=DiskDetac... | 34.4375 | 117 | 0.718693 | 438 | 0.794918 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0.023593 |
c32a765467990449b567bcb5b74b49876b530290 | 431 | py | Python | troupon/payment/serializers.py | andela/troupon | 3704cbe6e69ba3e4c53401d3bbc339208e9ebccd | [
"MIT"
] | 14 | 2016-01-12T07:31:09.000Z | 2021-11-20T19:29:35.000Z | troupon/payment/serializers.py | andela/troupon | 3704cbe6e69ba3e4c53401d3bbc339208e9ebccd | [
"MIT"
] | 52 | 2015-09-02T14:54:43.000Z | 2016-08-01T08:22:21.000Z | troupon/payment/serializers.py | andela/troupon | 3704cbe6e69ba3e4c53401d3bbc339208e9ebccd | [
"MIT"
] | 17 | 2015-09-30T13:18:48.000Z | 2021-11-18T16:25:12.000Z | """Serializers for the payment app."""
from rest_framework import serializers
from models import Purchases
class TransactionSerializer(serializers.ModelSerializer):
"""Serializer for Transaction instances.
"""
class Meta:
model = Purchases
fields = ('id', 'item', 'price', 'quantity', 'ti... | 26.9375 | 61 | 0.654292 | 320 | 0.742459 | 0 | 0 | 0 | 0 | 0 | 0 | 183 | 0.424594 |
c32ab97ad989123fa02793d4bdfb1b13b2fa964a | 4,817 | py | Python | mla/kmeans.py | anshulg5/MLAlgorithms | 6c12ebe64016eabb9527fb1f18be81cd3ff0c599 | [
"MIT"
] | 1 | 2020-04-22T22:03:51.000Z | 2020-04-22T22:03:51.000Z | mla/kmeans.py | anshulg5/MLAlgorithms | 6c12ebe64016eabb9527fb1f18be81cd3ff0c599 | [
"MIT"
] | 1 | 2021-06-25T15:40:35.000Z | 2021-06-25T15:40:35.000Z | mla/kmeans.py | anshulg5/MLAlgorithms | 6c12ebe64016eabb9527fb1f18be81cd3ff0c599 | [
"MIT"
] | 2 | 2019-07-21T13:19:17.000Z | 2020-12-28T05:46:37.000Z | import random
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from mla.base import BaseEstimator
from mla.metrics.distance import euclidean_distance
random.seed(1111)
class KMeans(BaseEstimator):
"""Partition a dataset into K clusters.
Finds clusters by repeatedly assigning each d... | 34.654676 | 119 | 0.622379 | 4,619 | 0.958896 | 0 | 0 | 0 | 0 | 0 | 0 | 1,389 | 0.288354 |
c32ad26a1993eb568f93f3377b6a0497a0eab914 | 10,741 | py | Python | train_classifier.py | justusmattern/dist-embeds | 2a5fd97bcfc3eed5c7f11e76d82c4ff49709cbe8 | [
"MIT"
] | null | null | null | train_classifier.py | justusmattern/dist-embeds | 2a5fd97bcfc3eed5c7f11e76d82c4ff49709cbe8 | [
"MIT"
] | null | null | null | train_classifier.py | justusmattern/dist-embeds | 2a5fd97bcfc3eed5c7f11e76d82c4ff49709cbe8 | [
"MIT"
] | null | null | null | import os
import sys
import argparse
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
# from sru import *
import dataloader
import modules
class Model(nn.Module):
def __init__(self, embe... | 34.536977 | 147 | 0.553114 | 2,615 | 0.24346 | 0 | 0 | 0 | 0 | 0 | 0 | 2,797 | 0.260404 |
c32b3afbd77078a6af646cb681c0da4280c9fc0a | 1,844 | py | Python | app/request/queue.py | infrared5/massroute-pi | c2e16d655058c6c5531ec66f8a82fe41ad4e8427 | [
"MIT"
] | null | null | null | app/request/queue.py | infrared5/massroute-pi | c2e16d655058c6c5531ec66f8a82fe41ad4e8427 | [
"MIT"
] | null | null | null | app/request/queue.py | infrared5/massroute-pi | c2e16d655058c6c5531ec66f8a82fe41ad4e8427 | [
"MIT"
] | null | null | null | import logging
from time import sleep
logger = logging.getLogger(__name__)
class StopRequestQueue:
cursor = 0
queue = None
service = None
current_request = None
request_delay = 0 # seconds
def __init__(self, service, request_delay=10):
self.queue = []
self.service = service
self.request_dela... | 28.8125 | 96 | 0.679501 | 1,766 | 0.957701 | 0 | 0 | 0 | 0 | 0 | 0 | 484 | 0.262473 |
c32c528f23adfd98c6057b14b36d3ef97d2f6fbf | 5,826 | py | Python | trimap_module.py | lnugraha/trimap_generator | a279562b0d0f387896330cf88549e67618d1eb7f | [
"MIT"
] | 168 | 2018-04-14T09:46:03.000Z | 2022-03-29T08:14:11.000Z | trimap_module.py | lnugraha/trimap_generator | a279562b0d0f387896330cf88549e67618d1eb7f | [
"MIT"
] | 7 | 2018-05-14T12:54:23.000Z | 2021-10-12T01:16:20.000Z | trimap_module.py | lnugraha/trimap_generator | a279562b0d0f387896330cf88549e67618d1eb7f | [
"MIT"
] | 35 | 2019-05-13T03:13:11.000Z | 2022-03-22T11:55:58.000Z | #!/usr/bin/env python
import cv2, os, sys
import numpy as np
def extractImage(path):
# error handller if the intended path is not found
image = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
return image
def checkImage(image):
"""
Args:
image: input image to be checked
Returns:
binary ... | 35.309091 | 120 | 0.562993 | 1,781 | 0.305699 | 0 | 0 | 653 | 0.112084 | 0 | 0 | 2,697 | 0.462925 |
c32c82635b0888813302ed2b3bc7efe4aeb79fdb | 4,047 | py | Python | integration/keeper_secrets_manager_ansible/tests/keeper_init.py | Keeper-Security/secrets-manager | 0044dec7f323ae2e531f52ef2435bd7205949fe9 | [
"MIT"
] | 9 | 2022-01-10T18:39:45.000Z | 2022-03-06T03:51:41.000Z | integration/keeper_secrets_manager_ansible/tests/keeper_init.py | Keeper-Security/secrets-manager | 0044dec7f323ae2e531f52ef2435bd7205949fe9 | [
"MIT"
] | 10 | 2022-01-27T00:51:05.000Z | 2022-03-30T08:42:01.000Z | integration/keeper_secrets_manager_ansible/tests/keeper_init.py | Keeper-Security/secrets-manager | 0044dec7f323ae2e531f52ef2435bd7205949fe9 | [
"MIT"
] | 6 | 2021-12-17T18:59:26.000Z | 2022-03-28T16:47:28.000Z | import unittest
from unittest.mock import patch
import os
from .ansible_test_framework import AnsibleTestFramework, RecordMaker
import keeper_secrets_manager_ansible.plugins
import tempfile
records = {
"TRd_567FkHy-CeGsAzs8aA": RecordMaker.make_record(
uid="TRd_567FkHy-CeGsAzs8aA",
title="JW-F1-R1... | 37.472222 | 111 | 0.596244 | 3,104 | 0.766988 | 0 | 0 | 236 | 0.058315 | 0 | 0 | 998 | 0.246602 |
c32db06fd5b31b4a1c0ead0ae4470b3896648d58 | 1,180 | py | Python | wonambi/attr/__init__.py | wonambi-python/wonambi | 4e2834cdd799576d1a231ecb48dfe4da1364fe3a | [
"BSD-3-Clause"
] | 63 | 2017-12-30T08:11:17.000Z | 2022-01-28T10:34:20.000Z | wonambi/attr/__init__.py | wonambi-python/wonambi | 4e2834cdd799576d1a231ecb48dfe4da1364fe3a | [
"BSD-3-Clause"
] | 23 | 2017-09-08T08:29:49.000Z | 2022-03-17T08:19:13.000Z | wonambi/attr/__init__.py | wonambi-python/wonambi | 4e2834cdd799576d1a231ecb48dfe4da1364fe3a | [
"BSD-3-Clause"
] | 12 | 2017-09-18T12:48:36.000Z | 2021-09-22T07:16:07.000Z | """Packages containing all the possible attributes to recordings, such as
- channels (module "chan") with class:
- Chan
- anatomical info (module "anat") with class:
- Surf
- annotations and sleep scores (module "annotations") with class:
- Annotations
Possibly include forward and i... | 43.703704 | 79 | 0.766102 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,047 | 0.887288 |
c32fe65d24a5f464b2f3a2a3ac48a2c68f408fd3 | 1,418 | py | Python | Corpus/Pyramid Score/PyrEval/Pyramid/parameters.py | LCS2-IIITD/summarization_bias | d66846bb7657439347f4714f2672350447474c5a | [
"MIT"
] | 1 | 2020-11-11T19:48:10.000Z | 2020-11-11T19:48:10.000Z | Corpus/Pyramid Score/PyrEval/Pyramid/parameters.py | LCS2-IIITD/summarization_bias | d66846bb7657439347f4714f2672350447474c5a | [
"MIT"
] | null | null | null | Corpus/Pyramid Score/PyrEval/Pyramid/parameters.py | LCS2-IIITD/summarization_bias | d66846bb7657439347f4714f2672350447474c5a | [
"MIT"
] | null | null | null | """
=========== What is Matter Parameters ===================
"""
#tups = [(125.0, 1.0), (125.0, 1.5), (125.0, 2.0), (125.0, 2.5), (125.0, 3.0), (150.0, 1.0), (150.0, 1.5), (150.0, 2.0), (150.0, 2.5), (150.0, 3.0), (175.0, 1.0), (175.0, 1.5), (175.0, 2.0), (175.0, 2.5), (175.0, 3.0), (200.0, 1.0), (200.0, 1.5), (200.0,... | 78.777778 | 428 | 0.43512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,405 | 0.990832 |
c33017f8651ee60d0cc6f759fc632d532c899c80 | 3,213 | py | Python | deploy/terraform/tasks.py | kinecosystem/blockchain-ops | fc21bbd2d3d405844857a8b3413718bacbaad294 | [
"MIT"
] | 15 | 2018-08-08T23:47:53.000Z | 2020-02-13T17:14:15.000Z | deploy/terraform/tasks.py | kinfoundation/stellar-ops | fc21bbd2d3d405844857a8b3413718bacbaad294 | [
"MIT"
] | 21 | 2018-10-16T09:20:32.000Z | 2019-12-15T19:01:56.000Z | deploy/terraform/tasks.py | yonikashi/blocktest | db044d74afc62f80f8f74060830347e82dd03adb | [
"MIT"
] | 9 | 2018-11-05T17:28:55.000Z | 2019-08-02T20:10:14.000Z | """Call various Terraform actions."""
import os
import os.path
from invoke import task
import jinja2
import yaml
TERRAFORM_VERSION = '0.11.7'
@task
def install(c, ostype='linux', version=TERRAFORM_VERSION):
"""Download a local version of Terraform."""
if ostype == 'mac':
ostype = 'darwin'
file... | 24.157895 | 81 | 0.62714 | 0 | 0 | 0 | 0 | 3,000 | 0.933707 | 0 | 0 | 1,470 | 0.457516 |
c331cb67fa44126ad7899136fc1a363b37ea7fe2 | 263 | py | Python | gdal/swig/python/scripts/gdal2xyz.py | Sokigo-GLS/gdal | 595f74bf60dff89fc5df53f9f4c3e40fc835e909 | [
"MIT"
] | null | null | null | gdal/swig/python/scripts/gdal2xyz.py | Sokigo-GLS/gdal | 595f74bf60dff89fc5df53f9f4c3e40fc835e909 | [
"MIT"
] | null | null | null | gdal/swig/python/scripts/gdal2xyz.py | Sokigo-GLS/gdal | 595f74bf60dff89fc5df53f9f4c3e40fc835e909 | [
"MIT"
] | null | null | null | import sys
# import osgeo.utils.gdal2xyz as a convenience to use as a script
from osgeo.utils.gdal2xyz import * # noqa
from osgeo.utils.gdal2xyz import main
from osgeo.gdal import deprecation_warn
deprecation_warn('gdal2xyz', 'utils')
sys.exit(main(sys.argv))
| 26.3 | 65 | 0.787072 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.334601 |
c33241bd3d20aeeac4e2cda557798ad660937ce2 | 587 | py | Python | inferencia/task/person_reid/body_reid/model/body_reid_model_factory.py | yuya-mochimaru-np/inferencia | e09f298d0a80672fc5bb9383e23c941290eff334 | [
"Apache-2.0"
] | null | null | null | inferencia/task/person_reid/body_reid/model/body_reid_model_factory.py | yuya-mochimaru-np/inferencia | e09f298d0a80672fc5bb9383e23c941290eff334 | [
"Apache-2.0"
] | 5 | 2021-07-25T23:19:29.000Z | 2021-07-26T23:35:13.000Z | inferencia/task/person_reid/body_reid/model/body_reid_model_factory.py | yuya-mochimaru-np/inferencia | e09f298d0a80672fc5bb9383e23c941290eff334 | [
"Apache-2.0"
] | 1 | 2021-09-18T12:06:13.000Z | 2021-09-18T12:06:13.000Z | from .body_reid_model_name import BodyReidModelName
class BodyReidModelFactory():
def create(model_name,
model_path,
model_precision):
if model_name == BodyReidModelName.osnet_x0_25.value:
from .model.osnet.osnet_x0_25 import OSNetX025
return OSNetX025... | 32.611111 | 66 | 0.577513 | 532 | 0.906303 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 0.068143 |
c3327d62d6a5e087ae5d5a099ea856c563dc576f | 3,931 | py | Python | cheatingbee/twitter.py | exoskellyman/cheatingbee | 1dd0710f9be8f40c3f23aa5bcac568588ac8feeb | [
"MIT"
] | null | null | null | cheatingbee/twitter.py | exoskellyman/cheatingbee | 1dd0710f9be8f40c3f23aa5bcac568588ac8feeb | [
"MIT"
] | null | null | null | cheatingbee/twitter.py | exoskellyman/cheatingbee | 1dd0710f9be8f40c3f23aa5bcac568588ac8feeb | [
"MIT"
] | null | null | null | import datetime
import io
import os
import tweepy
from dotenv import load_dotenv
from PIL import Image, ImageDraw, ImageFont
class Twitter:
"""
A class used to manage the connection with the Twitter API
...
Methods
-------
post_tweet(solver_answers, nyt_answers, pangrams)
Creates the... | 34.787611 | 86 | 0.58204 | 3,812 | 0.967513 | 0 | 0 | 0 | 0 | 0 | 0 | 1,769 | 0.448985 |
c332b852b9ea902789bff01e3510374ac9b4407d | 106 | py | Python | variables.py | MuhweziDeo/python_refresher | 0d100f88524ff780f1cee8afabfee1025c648f8b | [
"MIT"
] | null | null | null | variables.py | MuhweziDeo/python_refresher | 0d100f88524ff780f1cee8afabfee1025c648f8b | [
"MIT"
] | null | null | null | variables.py | MuhweziDeo/python_refresher | 0d100f88524ff780f1cee8afabfee1025c648f8b | [
"MIT"
] | null | null | null | x = 2
print(x)
# multiple assignment
a, b, c, d = (1, 2, 5, 9)
print(a, b, c, d)
print(type(str(a)))
| 8.833333 | 25 | 0.528302 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 0.198113 |
c332e2fe6b727044df2454bc3e05a8e3dca73a1d | 4,773 | py | Python | examples/authentication/demo_auth.py | jordiyeh/safrs | eecfaf6d63ed44b9dc44b7b86c600db02989b512 | [
"MIT"
] | null | null | null | examples/authentication/demo_auth.py | jordiyeh/safrs | eecfaf6d63ed44b9dc44b7b86c600db02989b512 | [
"MIT"
] | null | null | null | examples/authentication/demo_auth.py | jordiyeh/safrs | eecfaf6d63ed44b9dc44b7b86c600db02989b512 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# This is a demo application to demonstrate the functionality of the safrs_rest REST API with authentication
#
# you will have to install the requirements:
# pip3 install passlib flask_httpauth flask_login
#
# This script can be ran standalone like this:
# python3 demo_auth.py [Listen... | 31.82 | 109 | 0.673581 | 1,451 | 0.304002 | 0 | 0 | 1,565 | 0.327886 | 0 | 0 | 1,306 | 0.273622 |
c3335a14a14888a29737d6b5d92bb38bedb9c886 | 2,045 | py | Python | ev3/sensors/color.py | NewThingsCo/ev3-controller | 70d30617fa3ea6ef73a39a8c5360e8e4c72a9e98 | [
"BSD-2-Clause"
] | 1 | 2019-08-06T10:16:39.000Z | 2019-08-06T10:16:39.000Z | ev3/sensors/color.py | NewThingsCo/ev3-controller | 70d30617fa3ea6ef73a39a8c5360e8e4c72a9e98 | [
"BSD-2-Clause"
] | null | null | null | ev3/sensors/color.py | NewThingsCo/ev3-controller | 70d30617fa3ea6ef73a39a8c5360e8e4c72a9e98 | [
"BSD-2-Clause"
] | 1 | 2018-03-06T10:59:50.000Z | 2018-03-06T10:59:50.000Z | import goless
import time
from sys import platform
if platform == "linux" or platform == "linux2":
import brickpi3
def start_color_sensor(brick, port, channel):
print("start color sensor")
setup_sensor(brick, port)
goless.go(run_color_sensor, brick, port, channel)
print("color sensor started")
... | 30.984848 | 89 | 0.642543 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 471 | 0.230318 |
c333f525069086ebb8689eece355d91dd6b64f69 | 8,757 | py | Python | model/BPE.py | djmhunt/TTpy | 0f0997314bf0f54831494b2ef1a64f1bff95c097 | [
"MIT"
] | null | null | null | model/BPE.py | djmhunt/TTpy | 0f0997314bf0f54831494b2ef1a64f1bff95c097 | [
"MIT"
] | 4 | 2020-04-19T11:43:41.000Z | 2020-07-21T09:57:51.000Z | model/BPE.py | djmhunt/TTpy | 0f0997314bf0f54831494b2ef1a64f1bff95c097 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:Author: Dominic Hunt
"""
import logging
import numpy as np
import scipy as sp
import collections
import itertools
from model.modelTemplate import Model
class BPE(Model):
"""The Bayesian predictor model
Attributes
----------
Name : string
... | 33.680769 | 145 | 0.628183 | 8,552 | 0.97659 | 0 | 0 | 0 | 0 | 0 | 0 | 4,917 | 0.561494 |
c336028d3170491bb761554d05258241830c82fc | 1,688 | py | Python | affiliates/banners/tests/__init__.py | glogiotatidis/affiliates | 34d0ded8e24be9dd207d6419a5157dc8ce34bc06 | [
"BSD-3-Clause"
] | 15 | 2015-01-01T07:17:44.000Z | 2020-11-09T06:28:29.000Z | affiliates/banners/tests/__init__.py | glogiotatidis/affiliates | 34d0ded8e24be9dd207d6419a5157dc8ce34bc06 | [
"BSD-3-Clause"
] | 16 | 2015-02-25T23:17:27.000Z | 2015-08-20T10:28:18.000Z | affiliates/banners/tests/__init__.py | glogiotatidis/affiliates | 34d0ded8e24be9dd207d6419a5157dc8ce34bc06 | [
"BSD-3-Clause"
] | 12 | 2015-01-17T20:57:03.000Z | 2019-11-03T15:04:31.000Z | from django.db.models.signals import post_init
from factory import DjangoModelFactory, Sequence, SubFactory
from factory.django import mute_signals
from affiliates.banners import models
class CategoryFactory(DjangoModelFactory):
FACTORY_FOR = models.Category
name = Sequence(lambda n: 'test{0}'.format(n))
... | 25.575758 | 70 | 0.776659 | 1,423 | 0.843009 | 0 | 0 | 513 | 0.30391 | 0 | 0 | 193 | 0.114336 |
c337200f464a7d012b7b952e50ed5709111473ef | 7,996 | py | Python | cradlepy/framework/http.py | cblanquera/cradlepy | 1634fe38a0cc58f92dbfc2b0c84ace9d16821c3c | [
"MIT"
] | null | null | null | cradlepy/framework/http.py | cblanquera/cradlepy | 1634fe38a0cc58f92dbfc2b0c84ace9d16821c3c | [
"MIT"
] | null | null | null | cradlepy/framework/http.py | cblanquera/cradlepy | 1634fe38a0cc58f92dbfc2b0c84ace9d16821c3c | [
"MIT"
] | null | null | null | from .request import Request
from .response import Response
class HttpRequestCookieTrait:
'Designed for the Request Object; Adds methods to store COOKIE data'
def get_cookies(self, *args):
'Returns COOKIE given name or all COOKIE'
return self.get('cookie', *args)
def remove_cookies(self,... | 23.380117 | 83 | 0.617184 | 7,902 | 0.988244 | 0 | 0 | 0 | 0 | 0 | 0 | 2,824 | 0.353177 |
c3372092201a1e6f33ba16a8e3cd911550232f4d | 326 | py | Python | src/plugins/command/main.py | AlexCaranha/MyLauncher | d15037d5e26eee61e851a938b432ee1107f441ab | [
"MIT"
] | null | null | null | src/plugins/command/main.py | AlexCaranha/MyLauncher | d15037d5e26eee61e851a938b432ee1107f441ab | [
"MIT"
] | null | null | null | src/plugins/command/main.py | AlexCaranha/MyLauncher | d15037d5e26eee61e851a938b432ee1107f441ab | [
"MIT"
] | null | null | null |
import pluggy
hookimpl = pluggy.HookimplMarker('mylauncher')
def get_class():
return CommandPlugin()
class CommandPlugin:
@hookimpl
def setup(self):
print("Setup ...")
@hookimpl
def get_alias(self):
return "command"
@hookimpl
def execute(self, input:str):
return... | 15.52381 | 46 | 0.631902 | 216 | 0.662577 | 0 | 0 | 179 | 0.54908 | 0 | 0 | 32 | 0.09816 |
c3374bd201ea3739cfe629bae1ecfda55d32a4e4 | 5,022 | py | Python | setup.py | kmike/UnbalancedDataset | 777f26cee73c04ae2f3d59e43c990cbfd1725b23 | [
"MIT"
] | 6 | 2016-06-02T09:27:41.000Z | 2021-04-21T06:46:12.000Z | setup.py | kmike/UnbalancedDataset | 777f26cee73c04ae2f3d59e43c990cbfd1725b23 | [
"MIT"
] | null | null | null | setup.py | kmike/UnbalancedDataset | 777f26cee73c04ae2f3d59e43c990cbfd1725b23 | [
"MIT"
] | 1 | 2018-08-25T03:11:05.000Z | 2018-08-25T03:11:05.000Z | #! /usr/bin/env python
"""Toolbox for unbalanced dataset in machine learning."""
from setuptools import setup, find_packages
import os
import sys
import setuptools
from distutils.command.build_py import build_py
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
descr = """Tool... | 37.477612 | 79 | 0.597172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,041 | 0.406412 |
c33796a44fa6fcd9a0852b7e8f6f953771655ffa | 64 | py | Python | ores/scoring/models/__init__.py | elukey/ores | 18f6e2da642dd124daf4dc122d58032eb15485c9 | [
"MIT"
] | 69 | 2015-07-15T15:04:12.000Z | 2018-08-20T15:00:27.000Z | ores/scoring/models/__init__.py | elukey/ores | 18f6e2da642dd124daf4dc122d58032eb15485c9 | [
"MIT"
] | 146 | 2015-06-13T18:56:49.000Z | 2018-08-17T22:38:52.000Z | ores/scoring/models/__init__.py | elukey/ores | 18f6e2da642dd124daf4dc122d58032eb15485c9 | [
"MIT"
] | 34 | 2018-10-15T16:58:50.000Z | 2022-03-08T20:01:34.000Z | from .rev_id_scorer import RevIdScorer
__all__ = [RevIdScorer]
| 16 | 38 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3386296bb9f34b0112bf5ce7c89306471d38bbf | 4,311 | py | Python | conjuntos.py | Tiesco789/guppe | 464702a2d618e149439a9b5c763f82c5376d2c32 | [
"MIT"
] | null | null | null | conjuntos.py | Tiesco789/guppe | 464702a2d618e149439a9b5c763f82c5376d2c32 | [
"MIT"
] | null | null | null | conjuntos.py | Tiesco789/guppe | 464702a2d618e149439a9b5c763f82c5376d2c32 | [
"MIT"
] | null | null | null | """
Conjuntos
— Conjunto em qualquer linguagem de programação, estamos fazendo referência à teoria de conjuntos da matemática
— Aqui no Python, os conjuntos são chamados de sets
Dito isto, da mesma forma que na matemática:
— Sets (conjuntos) não possuem valores duplicados;
— Sets (conjuntos) não possuem valores ordena... | 27.812903 | 140 | 0.740895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,384 | 0.999772 |
c338d3a2b98ef137f9b2463dce7a00499cad0407 | 1,346 | py | Python | tests/test_gpreg.py | cdgreenidge/gdec | 1ee6ab0156fa8f74683f5b7a7dfcb2c3f2a57d7f | [
"MIT"
] | null | null | null | tests/test_gpreg.py | cdgreenidge/gdec | 1ee6ab0156fa8f74683f5b7a7dfcb2c3f2a57d7f | [
"MIT"
] | null | null | null | tests/test_gpreg.py | cdgreenidge/gdec | 1ee6ab0156fa8f74683f5b7a7dfcb2c3f2a57d7f | [
"MIT"
] | null | null | null | """Test gpreg.py."""
from typing import Tuple
import numpy as np
import pytest
from gdec import gpreg, npgp
@pytest.fixture(scope="module")
def dataset() -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
np.random.seed(42)
amplitude = 1.0
lengthscale = 12
sigma = 0.5
n = 128
def spe... | 26.392157 | 80 | 0.665676 | 0 | 0 | 0 | 0 | 639 | 0.47474 | 0 | 0 | 28 | 0.020802 |
c33952e0e337955829e818701b7429be3b750ed1 | 1,008 | py | Python | gizer/all_schema_engines.py | racker/gizer | 4600999c35e99bce54071ea4f952b09b3fd5dc9b | [
"Apache-2.0"
] | null | null | null | gizer/all_schema_engines.py | racker/gizer | 4600999c35e99bce54071ea4f952b09b3fd5dc9b | [
"Apache-2.0"
] | null | null | null | gizer/all_schema_engines.py | racker/gizer | 4600999c35e99bce54071ea4f952b09b3fd5dc9b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
__author__ = "Yaroslav Litvinov"
__copyright__ = "Copyright 2016, Rackspace Inc."
__email__ = "yaroslav.litvinov@rackspace.com"
from mongo_schema import schema_engine
import os
def get_schema_files(schemas_dirpath):
""" get list of js / json files resided in dirpath param. """
res = []
... | 33.6 | 76 | 0.709325 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 274 | 0.271825 |
c33a308f4b93fcb1577dde001c5501e493e62b57 | 146 | py | Python | WeatherPy/config.py.py | Brownc03/python-api-challenge | 24af57a6652b2990e8bdbc1e8e01566a2e7878b8 | [
"ADSL"
] | null | null | null | WeatherPy/config.py.py | Brownc03/python-api-challenge | 24af57a6652b2990e8bdbc1e8e01566a2e7878b8 | [
"ADSL"
] | null | null | null | WeatherPy/config.py.py | Brownc03/python-api-challenge | 24af57a6652b2990e8bdbc1e8e01566a2e7878b8 | [
"ADSL"
] | null | null | null | # OpenWeatherMap API Key
weather_api_key = "ae41fcf95db0d612b74e2b509abe9684"
# Google API Key
g_key = "AIzaSyCuF1rT6NscWq62bcBm0tZM7hKlaeWfONQ" | 29.2 | 52 | 0.842466 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 0.787671 |
c33b670e9c5af9440c581f7412728d80706d9eb8 | 5,240 | py | Python | bin/runinterpret.py | christine-liu/somaticCNVpipeline | 254b709e611e56e5c891c663508ac79fa1093c07 | [
"MIT"
] | null | null | null | bin/runinterpret.py | christine-liu/somaticCNVpipeline | 254b709e611e56e5c891c663508ac79fa1093c07 | [
"MIT"
] | 2 | 2018-03-09T00:22:18.000Z | 2019-03-12T11:26:42.000Z | bin/runinterpret.py | christine-liu/somaticCNVpipeline | 254b709e611e56e5c891c663508ac79fa1093c07 | [
"MIT"
] | 6 | 2018-03-09T02:10:49.000Z | 2020-05-14T09:19:11.000Z | #!usr/bin/python
import os
import numpy as np
import common
from interpret import qcfile, funcfile, analyzefiles
def runAll(args):
print('\n\n\nYou have requested to analyze CNV call data')
print('\tWARNING:')
print('\t\tIF USING ANY REFERENCES OTHER THAN THOSE I PROVIDE I CANNOT GUARANTEE RESULT ACCURACY... | 31.566265 | 202 | 0.698473 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,137 | 0.407824 |
c33c7a593798637e5989678bfdadfbeb83157154 | 29,527 | py | Python | mbio/EM/mrc.py | wzmao/mbio | af78cfdb47577199585179c3b04cc6cf3d6b401c | [
"MIT"
] | 2 | 2015-05-28T12:23:02.000Z | 2018-05-25T14:01:17.000Z | mbio/EM/mrc.py | wzmao/mbio | af78cfdb47577199585179c3b04cc6cf3d6b401c | [
"MIT"
] | null | null | null | mbio/EM/mrc.py | wzmao/mbio | af78cfdb47577199585179c3b04cc6cf3d6b401c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""This module contains the MRC file class.
"""
__author__ = 'Wenzhi Mao'
__all__ = ['MRC']
class MRCHeader():
"""A header class for mrc file."""
def __init__(self, filename=None, **kwargs):
"""Provide the filename to parse or set it later."""
self.nx = self.ny = s... | 44.602719 | 265 | 0.507739 | 29,403 | 0.9958 | 0 | 0 | 0 | 0 | 0 | 0 | 6,119 | 0.207234 |
c33c9ccdc0ba66d9833eb045f4eb9b0711984aa5 | 2,416 | py | Python | links/management/commands/seed_data.py | darth-dodo/hackernews-backend | 402497a47271a90402624ed2c34b46ac08638440 | [
"MIT"
] | 3 | 2020-04-20T09:15:39.000Z | 2020-05-25T18:27:44.000Z | links/management/commands/seed_data.py | darth-dodo/hackernews-backend | 402497a47271a90402624ed2c34b46ac08638440 | [
"MIT"
] | null | null | null | links/management/commands/seed_data.py | darth-dodo/hackernews-backend | 402497a47271a90402624ed2c34b46ac08638440 | [
"MIT"
] | 1 | 2022-01-29T06:05:15.000Z | 2022-01-29T06:05:15.000Z | from random import randint
from django.core.management.base import BaseCommand
from django.db import transaction
from faker import Faker
from hn_users.models import HNUser, User
from links.models import Link, Vote
faker = Faker()
class Command(BaseCommand):
help = "Generate Links from a small user subset"
... | 31.789474 | 105 | 0.624586 | 2,180 | 0.902318 | 0 | 0 | 640 | 0.264901 | 0 | 0 | 238 | 0.09851 |
c33fdea58a4606282019dc0ca418482457a10cef | 3,010 | py | Python | locations/spiders/cenex.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/cenex.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/cenex.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
class CenexSpider(scrapy.Spider):
name = "cenex"
item_attributes = {"brand": "Cenex", "brand_wikidata": "Q5011381"}
allowed_domains = ["www.cenex.com"]
def start_requests(self):
yield scrapy.http.Js... | 40.675676 | 88 | 0.469435 | 2,912 | 0.967442 | 2,737 | 0.909302 | 0 | 0 | 0 | 0 | 1,001 | 0.332558 |
c3402d0f4328c3cbff771ca36bde6cdd1c05dd43 | 6,794 | py | Python | core/dbt/flags.py | tskleonard/dbt-core | c112050455e1f7b984c5c0d42a57a90a0d4d7053 | [
"Apache-2.0"
] | null | null | null | core/dbt/flags.py | tskleonard/dbt-core | c112050455e1f7b984c5c0d42a57a90a0d4d7053 | [
"Apache-2.0"
] | null | null | null | core/dbt/flags.py | tskleonard/dbt-core | c112050455e1f7b984c5c0d42a57a90a0d4d7053 | [
"Apache-2.0"
] | null | null | null | import os
import multiprocessing
if os.name != "nt":
# https://bugs.python.org/issue41567
import multiprocessing.popen_spawn_posix # type: ignore
from pathlib import Path
from typing import Optional
# PROFILES_DIR must be set before the other flags
# It also gets set in main.py and in set_from_args because t... | 35.94709 | 97 | 0.704592 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,258 | 0.332352 |
c341709c7b99e4263e43265985148f2594b1d447 | 2,223 | py | Python | DataShine/DataShine.py | monk-after-90s/DataShine | e707d5a737ad1aca84a2646aa6d39fcfe430b58d | [
"MIT"
] | null | null | null | DataShine/DataShine.py | monk-after-90s/DataShine | e707d5a737ad1aca84a2646aa6d39fcfe430b58d | [
"MIT"
] | null | null | null | DataShine/DataShine.py | monk-after-90s/DataShine | e707d5a737ad1aca84a2646aa6d39fcfe430b58d | [
"MIT"
] | null | null | null | import asyncio
import functools
from copy import deepcopy
from ensureTaskCanceled import ensureTaskCanceled
def _no_closed(method):
'''
Can not be run when closed.
:return:
'''
@functools.wraps(method)
def wrapper(*args, **kwargs):
self = args[0]
if self._closed:
r... | 24.977528 | 123 | 0.604139 | 1,689 | 0.759784 | 0 | 0 | 1,022 | 0.459739 | 1,185 | 0.533063 | 668 | 0.300495 |
c343356ef27f41702366f05b06f61bd4669c4a8d | 13,886 | py | Python | src/python/deepseq2.py | yotamfr/prot2vec | eaee36f9e3929054b1c324acd053a52d0e7be2bd | [
"MIT"
] | 8 | 2017-10-01T14:34:25.000Z | 2021-04-27T13:18:00.000Z | src/python/deepseq2.py | yotamfr/prot2vec | eaee36f9e3929054b1c324acd053a52d0e7be2bd | [
"MIT"
] | 1 | 2020-01-23T17:17:18.000Z | 2020-01-23T17:17:18.000Z | src/python/deepseq2.py | yotamfr/prot2vec | eaee36f9e3929054b1c324acd053a52d0e7be2bd | [
"MIT"
] | 1 | 2018-05-04T04:54:32.000Z | 2018-05-04T04:54:32.000Z | import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from src.python.baselines import *
from pymongo import MongoClient
from tqdm import tqdm
import tensorflow as tf
### Keras
from keras import optimizers
from keras.models import Model
from keras.layers import Input... | 32.983373 | 124 | 0.631931 | 722 | 0.051995 | 1,581 | 0.113856 | 0 | 0 | 0 | 0 | 1,869 | 0.134596 |
c343f679c520b2ae7bc168a588760750faee9e80 | 5,977 | py | Python | inbima.py | SkoltechAI/inbima | 4c22a864208091e3fb41ea7703c463c4189e78d1 | [
"MIT"
] | null | null | null | inbima.py | SkoltechAI/inbima | 4c22a864208091e3fb41ea7703c463c4189e78d1 | [
"MIT"
] | null | null | null | inbima.py | SkoltechAI/inbima | 4c22a864208091e3fb41ea7703c463c4189e78d1 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import openpyxl
import sys
from fs import FS
from journals import Journals
from utils import load_sheet
from utils import log
from word import Word
YEARS = [2017, 2018, 2019, 2020, 2021]
class InBiMa():
def __init__(self, is_new_folder=False):
self.fs = FS(is_new_folder... | 32.840659 | 79 | 0.543918 | 5,356 | 0.896102 | 0 | 0 | 0 | 0 | 0 | 0 | 919 | 0.153756 |
c3462530e3c62749cd08fd4db0ee3cc3926324bb | 2,183 | py | Python | UkDatabaseAPI/UkDatabaseAPI/database/mongo_db.py | kplachkov/UkDatabase | 51db3183a86d3b07e0f97cc685f6f47ad4a8fc2e | [
"Apache-2.0"
] | null | null | null | UkDatabaseAPI/UkDatabaseAPI/database/mongo_db.py | kplachkov/UkDatabase | 51db3183a86d3b07e0f97cc685f6f47ad4a8fc2e | [
"Apache-2.0"
] | 3 | 2018-04-02T20:32:51.000Z | 2019-02-09T16:19:39.000Z | UkDatabaseAPI/UkDatabaseAPI/database/mongo_db.py | kplachkov/UkDatabase | 51db3183a86d3b07e0f97cc685f6f47ad4a8fc2e | [
"Apache-2.0"
] | null | null | null | import pymongo
from bson.json_util import dumps
from pymongo import MongoClient
from UkDatabaseAPI.database.database import Database
from UkDatabaseAPI.database.query_builder.mongo_query_builder import MongoQueryBuilder
MONGO_URI = "mongodb://localhost:27017"
"""str: The MongoDB URI."""
class MongoDB(Database):
... | 38.982143 | 103 | 0.639945 | 1,890 | 0.865781 | 0 | 0 | 0 | 0 | 0 | 0 | 841 | 0.38525 |
c34648b7e6fe0e43164dec6e0c0022e1e1efabdd | 1,485 | py | Python | fb/forms.py | pure-python/brainmate | 79c83e707a4811dd881832d22f17c29f33c4d7f2 | [
"Apache-2.0"
] | null | null | null | fb/forms.py | pure-python/brainmate | 79c83e707a4811dd881832d22f17c29f33c4d7f2 | [
"Apache-2.0"
] | 1 | 2016-04-14T14:42:52.000Z | 2016-04-14T14:42:52.000Z | fb/forms.py | pure-python/brainmate | 79c83e707a4811dd881832d22f17c29f33c4d7f2 | [
"Apache-2.0"
] | null | null | null | from django.forms import (
Form, CharField, Textarea, PasswordInput, ChoiceField, DateField,
ImageField, BooleanField, IntegerField, MultipleChoiceField
)
from django import forms
from fb.models import UserProfile
class UserPostForm(Form):
text = CharField(widget=Textarea(
attrs={'rows': 1, 'cols... | 31.595745 | 102 | 0.682828 | 1,246 | 0.839057 | 0 | 0 | 0 | 0 | 0 | 0 | 174 | 0.117172 |
c346562511e160197f5f2be08e436cdf509a8cc0 | 28,863 | py | Python | Galaxy_Invander/user23_fTVPDKIDhRdCfUp.py | triump0870/Interactive_Programming_Python | 97e0f1f5639aecac683053ed742632db14dc6954 | [
"Apache-2.0"
] | 1 | 2015-06-09T22:40:15.000Z | 2015-06-09T22:40:15.000Z | Galaxy_Invander/user23_fTVPDKIDhRdCfUp.py | triump0870/Interactive_Programming_Python | 97e0f1f5639aecac683053ed742632db14dc6954 | [
"Apache-2.0"
] | null | null | null | Galaxy_Invander/user23_fTVPDKIDhRdCfUp.py | triump0870/Interactive_Programming_Python | 97e0f1f5639aecac683053ed742632db14dc6954 | [
"Apache-2.0"
] | null | null | null | # Simple implementation of GalaxyInvanders game
# Rohan Roy (India) - 3 Nov 2013
# www.codeskulptor.org/#user23_fTVPDKIDhRdCfUp
VER = "1.0"
# "add various aliens"
import simplegui, math, random, time
#Global const
FIELD_WIDTH = 850
FIELD_HEIGHT = 500
TOP_MARGIN = 75
LEFT_MARGIN = 25
ALIEN_WIDTH = 48
... | 35.988778 | 131 | 0.562346 | 10,997 | 0.381007 | 0 | 0 | 0 | 0 | 0 | 0 | 4,679 | 0.162111 |
c3482f320f27c64a0db4f2f20db98025fee332ce | 1,664 | py | Python | components/py-flask-wa/app.py | ajayns/amoc-project | c22ae62789568c1a784f165fbd4547ac20c290a0 | [
"MIT"
] | 26 | 2017-04-21T06:05:44.000Z | 2020-03-09T11:41:34.000Z | components/py-flask-wa/app.py | ajayns/amoc-project | c22ae62789568c1a784f165fbd4547ac20c290a0 | [
"MIT"
] | 6 | 2017-04-16T03:53:28.000Z | 2019-02-26T07:02:48.000Z | components/py-flask-wa/app.py | ajayns/amoc-project | c22ae62789568c1a784f165fbd4547ac20c290a0 | [
"MIT"
] | 5 | 2017-06-09T06:44:59.000Z | 2019-12-13T07:34:11.000Z | from flask import Flask, jsonify, request, render_template, redirect
from flask_pymongo import PyMongo
from werkzeug import secure_filename
import base64
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'restdb'
app.config['MONGO_URI'] = 'mongodb://localhost:27017/restdb'
mongo = PyMongo(app)
@app.route('/')
def ... | 24.115942 | 73 | 0.658053 | 0 | 0 | 0 | 0 | 1,298 | 0.780048 | 0 | 0 | 406 | 0.24399 |
c34951b6e45c7100c95839ca25a8df621a593d38 | 2,190 | py | Python | wc_lang/util.py | KarrLab/wc_lang | 113a8b473576fa9c13688d2deb71b4b2ab400a03 | [
"MIT"
] | 7 | 2018-05-14T09:26:14.000Z | 2021-05-20T01:11:45.000Z | wc_lang/util.py | KarrLab/wc_lang | 113a8b473576fa9c13688d2deb71b4b2ab400a03 | [
"MIT"
] | 142 | 2018-03-14T16:50:56.000Z | 2021-01-03T16:25:23.000Z | wc_lang/util.py | KarrLab/wc_lang | 113a8b473576fa9c13688d2deb71b4b2ab400a03 | [
"MIT"
] | 4 | 2019-01-06T08:32:23.000Z | 2021-05-20T01:11:49.000Z | """ Utilities
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2016-11-10
:Copyright: 2016, Karr Lab
:License: MIT
"""
from obj_tables import get_models as base_get_models
from wc_lang import core
from wc_lang import io
from wc_utils.util import git
def get_model_size(model):
""" Get numbers of model components
... | 28.441558 | 89 | 0.616895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,018 | 0.46484 |
c349777d037bf08d8ee79327a13369ab404b7431 | 5,267 | py | Python | synapse/tests/test_tools_autodoc.py | kcreyts/synapse | fe740fd1e0febfa32f8d431b32ab48f8a0cf306e | [
"Apache-2.0"
] | 1 | 2021-02-15T22:07:05.000Z | 2021-02-15T22:07:05.000Z | synapse/tests/test_tools_autodoc.py | kcreyts/synapse | fe740fd1e0febfa32f8d431b32ab48f8a0cf306e | [
"Apache-2.0"
] | null | null | null | synapse/tests/test_tools_autodoc.py | kcreyts/synapse | fe740fd1e0febfa32f8d431b32ab48f8a0cf306e | [
"Apache-2.0"
] | null | null | null | import synapse.common as s_common
import synapse.tests.utils as s_t_utils
import synapse.tools.autodoc as s_autodoc
class TestAutoDoc(s_t_utils.SynTest):
async def test_tools_autodoc_docmodel(self):
with self.getTestDir() as path:
argv = ['--doc-model', '--savedir', path]
outp... | 41.801587 | 136 | 0.566926 | 5,147 | 0.977217 | 0 | 0 | 0 | 0 | 5,086 | 0.965635 | 2,021 | 0.38371 |
c34a6dd4d560ec8071e9109e3ca674e32bbace38 | 4,174 | py | Python | tf_idf.py | ricosr/retrieval_chatbot | 567e860f09771cae19e32b3bf20b5ce87266cda6 | [
"MIT"
] | 16 | 2018-12-04T13:55:56.000Z | 2021-11-21T05:53:57.000Z | tf_idf.py | ricosr/retrieval_chatbot | 567e860f09771cae19e32b3bf20b5ce87266cda6 | [
"MIT"
] | 5 | 2019-05-21T12:40:18.000Z | 2019-05-31T18:23:51.000Z | tf_idf.py | ricosr/retrieval_chatbot | 567e860f09771cae19e32b3bf20b5ce87266cda6 | [
"MIT"
] | 4 | 2018-11-22T13:45:05.000Z | 2019-09-16T16:30:28.000Z | # -*- coding: utf-8 -*-
import pickle
import os
import jieba
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.externals import joblib
from sklearn.metrics.pairwise import cosine_similarity
class TfIdf:
def __init__(self, config):
self.config = config
self.model_dict = {}... | 36.614035 | 94 | 0.626977 | 3,952 | 0.946814 | 0 | 0 | 0 | 0 | 0 | 0 | 530 | 0.126977 |
c34b267716c64dbcac0061ea5f7b0de5338ff153 | 19,015 | py | Python | d373c7/pytorch/models/classifiers.py | t0kk35/d373c7 | 7780b97545e581244fb4fb74347bb1b052b9ec3f | [
"Apache-2.0"
] | 1 | 2021-07-23T18:04:55.000Z | 2021-07-23T18:04:55.000Z | d373c7/pytorch/models/classifiers.py | t0kk35/d373c7 | 7780b97545e581244fb4fb74347bb1b052b9ec3f | [
"Apache-2.0"
] | null | null | null | d373c7/pytorch/models/classifiers.py | t0kk35/d373c7 | 7780b97545e581244fb4fb74347bb1b052b9ec3f | [
"Apache-2.0"
] | null | null | null | """
Module for classifier Models
(c) 2020 d373c7
"""
import logging
import torch
import torch.nn as nn
from .common import PyTorchModelException, ModelDefaults, _History, _ModelGenerated, _ModelStream
from .encoders import GeneratedAutoEncoder
from ..layers import LSTMBody, ConvolutionalBody1d, AttentionLastEntry, Line... | 46.041162 | 120 | 0.645438 | 18,427 | 0.969077 | 0 | 0 | 6,996 | 0.36792 | 0 | 0 | 6,935 | 0.364712 |
c34bda54e37900d299bfad9266c734ecc115936d | 5,369 | py | Python | qklnn/plots/hyperpar_scan.py | cambouvy/BSc-Thesis-Project | ca2504cb828ab068545e130eac393ceb34f2a457 | [
"MIT"
] | 1 | 2021-10-02T11:15:10.000Z | 2021-10-02T11:15:10.000Z | qklnn/plots/hyperpar_scan.py | cambouvy/BSc-Thesis-Project | ca2504cb828ab068545e130eac393ceb34f2a457 | [
"MIT"
] | null | null | null | qklnn/plots/hyperpar_scan.py | cambouvy/BSc-Thesis-Project | ca2504cb828ab068545e130eac393ceb34f2a457 | [
"MIT"
] | null | null | null | import re
import numpy as np
import pandas as pd
import matplotlib as mpl
mpl.use("pdf")
import matplotlib.pyplot as plt
from matplotlib import gridspec
from peewee import AsIs, JOIN, prefetch, SQL
from IPython import embed
from bokeh.layouts import row, column
from bokeh.plotting import figure, show, output_file
fr... | 30.856322 | 99 | 0.67778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 948 | 0.176536 |
c34c38cdb59ab3adcb9297c65de4aee9cda600b1 | 1,328 | py | Python | py3canvas/tests/shared_brand_configs.py | tylerclair/py3canvas | 7485d458606b65200f0ffa5bbe597a9d0bee189f | [
"MIT"
] | null | null | null | py3canvas/tests/shared_brand_configs.py | tylerclair/py3canvas | 7485d458606b65200f0ffa5bbe597a9d0bee189f | [
"MIT"
] | null | null | null | py3canvas/tests/shared_brand_configs.py | tylerclair/py3canvas | 7485d458606b65200f0ffa5bbe597a9d0bee189f | [
"MIT"
] | null | null | null | """SharedBrandConfigs API Tests for Version 1.0.
This is a testing template for the generated SharedBrandConfigsAPI Class.
"""
import unittest
import requests
import secrets
from py3canvas.apis.shared_brand_configs import SharedBrandConfigsAPI
from py3canvas.apis.shared_brand_configs import Sharedbrandconfig
class T... | 37.942857 | 126 | 0.752259 | 1,014 | 0.763554 | 0 | 0 | 0 | 0 | 0 | 0 | 668 | 0.503012 |
c34deabfbf09d812a3e974c9b52d0665996b8dda | 1,095 | py | Python | apps/cars/tests/api/abstract/abstract_base_api_test.py | agorsk1/car-rating-app | 354c5933f4cbad69c9a57d1839f9086cd5cf9a1d | [
"MIT"
] | 1 | 2022-03-03T11:15:25.000Z | 2022-03-03T11:15:25.000Z | apps/cars/tests/api/abstract/abstract_base_api_test.py | agorsk1/car-rating-app | 354c5933f4cbad69c9a57d1839f9086cd5cf9a1d | [
"MIT"
] | null | null | null | apps/cars/tests/api/abstract/abstract_base_api_test.py | agorsk1/car-rating-app | 354c5933f4cbad69c9a57d1839f9086cd5cf9a1d | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from django.test import TestCase
from rest_framework.generics import GenericAPIView
from rest_framework.test import APIRequestFactory
from apps.cars.factory import UserFactory
class AbstractBaseTest(object):
class AbstractBaseApiTestCase(TestCase, ABC):
"""
A... | 29.594595 | 72 | 0.621918 | 877 | 0.800913 | 0 | 0 | 460 | 0.420091 | 0 | 0 | 238 | 0.217352 |
c34e3c84ae9852ef18383b6753e4f283c886e50c | 995 | py | Python | templating-tool.py | salayatana66/vw-serving-flask | 7b91f986b0e03e9784cf481b1f8833508dc40bfb | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2020-10-01T17:31:00.000Z | 2021-05-09T12:21:41.000Z | templating-tool.py | salayatana66/vw-serving-flask | 7b91f986b0e03e9784cf481b1f8833508dc40bfb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | templating-tool.py | salayatana66/vw-serving-flask | 7b91f986b0e03e9784cf481b1f8833508dc40bfb | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2020-10-01T17:31:01.000Z | 2020-10-02T17:48:01.000Z | """
A simple templating tool for Dockerfiles
"""
import sys
import os
import click
import jinja2
import yaml
@click.group()
def cli():
""" @Unimplemented """
pass
@cli.command()
@click.argument("template", required=True, type=str)
@click.option("-y", "--yaml_file", required=True,
help="Yaml ... | 19.509804 | 61 | 0.648241 | 0 | 0 | 0 | 0 | 811 | 0.815075 | 0 | 0 | 216 | 0.217085 |
c3508126a16d94b29f0bc62586532976da28f49d | 11,552 | py | Python | verbforms.py | wmcooper2/Clean-Code-English-Tests | a966ed40e13608a75bb618d35bf812d9229cacc3 | [
"MIT"
] | null | null | null | verbforms.py | wmcooper2/Clean-Code-English-Tests | a966ed40e13608a75bb618d35bf812d9229cacc3 | [
"MIT"
] | 1 | 2018-09-02T12:46:41.000Z | 2018-09-02T12:55:30.000Z | verbforms.py | wmcooper2/TotalEnglishAssistant | a966ed40e13608a75bb618d35bf812d9229cacc3 | [
"MIT"
] | null | null | null | """File for holding the different verb forms for all of the verbs in the Total
English book series."""
verb_forms = {
'become' :
{
'normal' : 'become',
'present' : ['become','becomes'],
'past' : 'became',
'past participle' : 'become',
'gerund' : 'becoming',
},
'be':
{
'n... | 18.814332 | 78 | 0.428497 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,678 | 0.578082 |
c3518b43a0aa4df0b06d8f5ad7ea43c927361987 | 169 | py | Python | bokeh/themes/__init__.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | null | null | null | bokeh/themes/__init__.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | null | null | null | bokeh/themes/__init__.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | null | null | null | ''' Provides API for loading themes
'''
from __future__ import absolute_import
from os.path import join
from .theme import Theme
default = Theme(json={})
del join
| 12.071429 | 38 | 0.739645 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 0.236686 |
c351ebb4f07cf7eccdee13a557a0b9df8efb0303 | 4,321 | py | Python | files/spam-filter/tracspamfilter/captcha/keycaptcha.py | Puppet-Finland/puppet-trac | ffdf467ba80ff995778c30b0bdc6dc3e7d4e6cd3 | [
"BSD-2-Clause"
] | null | null | null | files/spam-filter/tracspamfilter/captcha/keycaptcha.py | Puppet-Finland/puppet-trac | ffdf467ba80ff995778c30b0bdc6dc3e7d4e6cd3 | [
"BSD-2-Clause"
] | null | null | null | files/spam-filter/tracspamfilter/captcha/keycaptcha.py | Puppet-Finland/puppet-trac | ffdf467ba80ff995778c30b0bdc6dc3e7d4e6cd3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Dirk Stöcker <trac@dstoecker.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software... | 38.238938 | 82 | 0.610507 | 3,566 | 0.825081 | 0 | 0 | 0 | 0 | 0 | 0 | 1,600 | 0.370199 |
c353ac7f88d4d2f15d7dbe0bb2a19e95c08d7680 | 3,222 | py | Python | app/model/causalnex.py | splunk/splunk-mltk-container-docker | 6e98e5984d99d7a3318f3e68c224d2a5163b717b | [
"Apache-2.0"
] | 20 | 2019-10-28T10:10:00.000Z | 2022-02-17T02:31:54.000Z | app/model/causalnex.py | splunk/splunk-mltk-container-docker | 6e98e5984d99d7a3318f3e68c224d2a5163b717b | [
"Apache-2.0"
] | 13 | 2019-11-22T16:00:02.000Z | 2022-01-12T10:57:08.000Z | app/model/causalnex.py | splunk/splunk-mltk-container-docker | 6e98e5984d99d7a3318f3e68c224d2a5163b717b | [
"Apache-2.0"
] | 15 | 2019-10-25T23:19:43.000Z | 2022-03-27T16:49:21.000Z | #!/usr/bin/env python
# coding: utf-8
# In[18]:
# this definition exposes all python module imports that should be available in all subsequent commands
import json
import numpy as np
import pandas as pd
from causalnex.structure import DAGRegressor
from sklearn.model_selection import cross_val_score
from sklear... | 16.272727 | 108 | 0.624146 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,305 | 0.405028 |
c3545eaf7cf8c0dfbca19e2063b2250b17a5d6be | 6,500 | py | Python | Assignment1/Q4/q4.py | NavneelSinghal/COL774 | d8b473b9cd05984ef4ffe8642ce3ce5cb9a17252 | [
"MIT"
] | null | null | null | Assignment1/Q4/q4.py | NavneelSinghal/COL774 | d8b473b9cd05984ef4ffe8642ce3ce5cb9a17252 | [
"MIT"
] | null | null | null | Assignment1/Q4/q4.py | NavneelSinghal/COL774 | d8b473b9cd05984ef4ffe8642ce3ce5cb9a17252 | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation
matplotlib.use('Agg')
import math
import numpy as np
import sys
from os.path import join, isfile
import warnings
warnings.filterwarnings("ignore")
def gda(x, y):
x = x.T
y = y.T
# phi = P(y = 1)
# mu[i] = mea... | 31.400966 | 158 | 0.534923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,432 | 0.220308 |
c35493185a871b0c5b3f41a18ba8dd0865c75b5e | 1,521 | py | Python | var/spack/repos/builtin/packages/bcache/package.py | milljm/spack | b476f8aa63d48f4b959522ece0406caa32992d4a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/bcache/package.py | milljm/spack | b476f8aa63d48f4b959522ece0406caa32992d4a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/bcache/package.py | milljm/spack | b476f8aa63d48f4b959522ece0406caa32992d4a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bcache(MakefilePackage):
"""Bcache is a patch for the Linux kernel to use SSDs to cache ot... | 40.026316 | 104 | 0.738988 | 1,300 | 0.854701 | 0 | 0 | 0 | 0 | 0 | 0 | 952 | 0.625904 |
c354a245e57f7c727ba4576fb602286db50cc1a3 | 645 | py | Python | core/migrations/0010_wagtailsitepage_screenshot.py | admariner/madewithwagtail | a43b3263c0f151ece4994fccd561b0575db4979f | [
"MIT"
] | null | null | null | core/migrations/0010_wagtailsitepage_screenshot.py | admariner/madewithwagtail | a43b3263c0f151ece4994fccd561b0575db4979f | [
"MIT"
] | null | null | null | core/migrations/0010_wagtailsitepage_screenshot.py | admariner/madewithwagtail | a43b3263c0f151ece4994fccd561b0575db4979f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-21 23:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0009_wagtail112upgrade'),
]
operations = [
migrations.RenameField(
model_name='wagtailsitepage',
... | 22.241379 | 48 | 0.568992 | 534 | 0.827907 | 0 | 0 | 0 | 0 | 0 | 0 | 211 | 0.327132 |
c3556300b12020a7a08798e9741d8eecbab08f07 | 1,555 | py | Python | circuitpython/schedule.py | Flameeyes/birch-books-smarthome | 245a8afc848b2a8cf4dbcde31b36716b44937200 | [
"MIT"
] | null | null | null | circuitpython/schedule.py | Flameeyes/birch-books-smarthome | 245a8afc848b2a8cf4dbcde31b36716b44937200 | [
"MIT"
] | null | null | null | circuitpython/schedule.py | Flameeyes/birch-books-smarthome | 245a8afc848b2a8cf4dbcde31b36716b44937200 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: © 2020 The birch-books-smarthome Authors
# SPDX-License-Identifier: MIT
BOOKSTORE_GROUND_FLOOR = 0x0007
BOOKSTORE_FIRST_FLOOR = 0x0008
BOOKSTORE_TERRARIUM = 0x0010
BOOKSTORE_BEDROOM = 0x0020
HOUSE_BASEMENT = 0x0040
HOUSE_GROUND_FLOOR = 0x0380
HOUSE_BEDROOM_LIGHT = 0x0400
HOUSE_BEDROOM_LAMP = ... | 33.804348 | 87 | 0.803859 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 0.062339 |
c3561322c8fe83a3cce278173951cb1c3bdb4ed4 | 284 | py | Python | imdb/utils.py | rinkurajole/imdb_sanic_app | 502852b911eb2cfdc5dfcdb4fba585b91e2ce7c6 | [
"BSD-3-Clause"
] | null | null | null | imdb/utils.py | rinkurajole/imdb_sanic_app | 502852b911eb2cfdc5dfcdb4fba585b91e2ce7c6 | [
"BSD-3-Clause"
] | null | null | null | imdb/utils.py | rinkurajole/imdb_sanic_app | 502852b911eb2cfdc5dfcdb4fba585b91e2ce7c6 | [
"BSD-3-Clause"
] | null | null | null | import bcrypt
salt = bcrypt.gensalt()
def generate_hash(passwd, salt=salt):
return str(bcrypt.hashpw(passwd, salt))
def match_password(req_pwd, db_pwd):
db_pwd = db_pwd.replace('b\'','').replace('\'','').encode('utf-8')
return db_pwd == bcrypt.hashpw(req_pwd, db_pwd)
| 23.666667 | 70 | 0.683099 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0.070423 |
c3562d1b40f2737d409b58bb9f4467b0ae1bbe8c | 14,200 | py | Python | test/test_modules/test_math.py | dragonteros/unsuspected-hangeul | 52dda3768809f5ba91e4fd7bb754223737b2da3d | [
"MIT"
] | 62 | 2019-02-24T17:45:04.000Z | 2021-06-14T07:34:57.000Z | test/test_modules/test_math.py | dragonteros/unsuspected-hangeul | 52dda3768809f5ba91e4fd7bb754223737b2da3d | [
"MIT"
] | 11 | 2019-02-25T17:19:45.000Z | 2020-07-18T05:04:17.000Z | test/test_modules/test_math.py | dragonteros/unsuspected-hangeul | 52dda3768809f5ba91e4fd7bb754223737b2da3d | [
"MIT"
] | 2 | 2019-02-25T07:51:14.000Z | 2019-09-23T12:36:08.000Z | from test.test_base import TestBase
class TestMath(TestBase):
def test_isclose(self):
_test = self._assert_execute
_test('ㄹ (ㄱㅇㄱ ㄱㅇㄱ ㄴㄱ ㅅㅎㄷ ㄱㅎㄷ ㄴ (ㅂ ㅅ ㄱ ㅂㅎㄹ)ㅎㄷㅎ)ㅎㄴ', 'True')
_test('ㅂ ㅅ ㅂ ㅂㅎㄹ (ㄱㅇㄱ ㄱㅇㄱ ㄴㄱ ㅅㅎㄷ ㄱㅎㄷ ㄴ (ㅂ ㅅ ㄱ ㅂㅎㄹ)ㅎㄷㅎ)ㅎㄴ', 'True')
_test('ㅂ ㅅ ㅈ ㅂㅎㄹ (ㄱㅇㄱ ㄱㅇㄱ ㄴㄱ ㅅㅎㄷ ㄱㅎㄷ ㄴ (ㅂ... | 55.905512 | 158 | 0.520352 | 24,351 | 0.998401 | 0 | 0 | 0 | 0 | 0 | 0 | 19,677 | 0.806765 |
c3565453ab31565d1b32ad8f383deec201854e66 | 1,563 | py | Python | services/smtp.py | sourceperl/docker.mqttwarn | 9d87337f766843c8bdee34eba8d29776e7032009 | [
"MIT"
] | null | null | null | services/smtp.py | sourceperl/docker.mqttwarn | 9d87337f766843c8bdee34eba8d29776e7032009 | [
"MIT"
] | null | null | null | services/smtp.py | sourceperl/docker.mqttwarn | 9d87337f766843c8bdee34eba8d29776e7032009 | [
"MIT"
] | 2 | 2016-09-03T09:12:17.000Z | 2020-03-03T11:58:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Jan-Piet Mens <jpmens()gmail.com>'
__copyright__ = 'Copyright 2014 Jan-Piet Mens'
__license__ = """Eclipse Public License - v 1.0 (http://www.eclipse.org/legal/epl-v10.html)"""
import smtplib
from email.mime.text import MIMEText
def plugin(srv, item):
... | 33.978261 | 124 | 0.621241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 466 | 0.298145 |
c3566cc0d033b24fec07c1d00481ebc4541fed37 | 1,865 | py | Python | xknx/knxip/disconnect_request.py | Trance-Paradox/xknx | d5603361080f96aafd19c14d17fb1ff391064b3f | [
"MIT"
] | null | null | null | xknx/knxip/disconnect_request.py | Trance-Paradox/xknx | d5603361080f96aafd19c14d17fb1ff391064b3f | [
"MIT"
] | null | null | null | xknx/knxip/disconnect_request.py | Trance-Paradox/xknx | d5603361080f96aafd19c14d17fb1ff391064b3f | [
"MIT"
] | null | null | null | """
Module for Serialization and Deserialization of a KNX Disconnect Request information.
Disconnect requests are used to disconnect a tunnel from a KNX/IP device.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from xknx.exceptions import CouldNotParseKNXIP
from .body import KNXIPBody
from ... | 29.603175 | 85 | 0.657909 | 1,433 | 0.768365 | 0 | 0 | 0 | 0 | 0 | 0 | 615 | 0.329759 |
c357fdd1d20a6b3edc1499c2dfe1f260522fc967 | 391 | py | Python | src/database_setup.py | liuchanglilian/crowdsourcing-text-msg | 8270a8175bc78141d9eff00b53f4b292d0d2678c | [
"MIT"
] | null | null | null | src/database_setup.py | liuchanglilian/crowdsourcing-text-msg | 8270a8175bc78141d9eff00b53f4b292d0d2678c | [
"MIT"
] | null | null | null | src/database_setup.py | liuchanglilian/crowdsourcing-text-msg | 8270a8175bc78141d9eff00b53f4b292d0d2678c | [
"MIT"
] | null | null | null | from src.sqlite_helper import create_message_table, drop_message_table
"""
This script will create a SQLite table for you, and should be one time setup
The table name is message which will store all the Post message
"""
create_message_table()
"""
If you need to drop the message table, un-comment the following code ... | 24.4375 | 108 | 0.769821 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 289 | 0.73913 |
c3590d5e9d8eea5dee2b2753a4c5f63a26af1754 | 5,401 | py | Python | home/pedrosenarego/zorba/zorba1.0.py | rv8flyboy/pyrobotlab | 4e04fb751614a5cb6044ea15dcfcf885db8be65a | [
"Apache-2.0"
] | 63 | 2015-02-03T18:49:43.000Z | 2022-03-29T03:52:24.000Z | home/pedrosenarego/zorba/zorba1.0.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 16 | 2016-01-26T19:13:29.000Z | 2018-11-25T21:20:51.000Z | home/pedrosenarego/zorba/zorba1.0.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 151 | 2015-01-03T18:55:54.000Z | 2022-03-04T07:04:23.000Z | from java.lang import String
import threading
import random
import codecs
import io
import itertools
import time
import os
import urllib2
import textwrap
import socket
import shutil
#############################################################
# This is the ZOrba
#
##################################################... | 31.95858 | 89 | 0.587854 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,721 | 0.503796 |