hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2f6a2791e689de4f000da208f146bdedeea71ebf | 397 | py | Python | webproctor/wsgi.py | mrabhi05/webproctor | a5da4d909f71b3f7b50b00727edbdf52483451d1 | [
"MIT"
] | null | null | null | webproctor/wsgi.py | mrabhi05/webproctor | a5da4d909f71b3f7b50b00727edbdf52483451d1 | [
"MIT"
] | null | null | null | webproctor/wsgi.py | mrabhi05/webproctor | a5da4d909f71b3f7b50b00727edbdf52483451d1 | [
"MIT"
] | null | null | null | """
WSGI config for webproctor 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/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
21059fdf7e8fb238da43d0c6f0282cdfceadf45b | 3,547 | py | Python | scripts/run_twoDnet.py | joaquimcampos/deepsplines | d9a11e9a8e66bb65e8099de68ba3739d3c81de67 | [
"MIT"
] | 10 | 2021-01-24T15:16:13.000Z | 2022-02-28T12:35:00.000Z | scripts/run_twoDnet.py | joaquimcampos/deepsplines | d9a11e9a8e66bb65e8099de68ba3739d3c81de67 | [
"MIT"
] | null | null | null | scripts/run_twoDnet.py | joaquimcampos/deepsplines | d9a11e9a8e66bb65e8099de68ba3739d3c81de67 | [
"MIT"
] | 2 | 2020-10-23T20:55:08.000Z | 2021-05-21T07:04:34.000Z | #!/usr/bin/env python3
'''
This script reproduces the results for twoDnet
on an s-shape or circle 2D dataset.
See https://ieeexplore.ieee.org/document/9264754.
'''
import os
import argparse
import copy
import torch
from deepsplines.main import main_prog
from deepsplines.datasets import generate_save_dataset
def ru... | 31.954955 | 78 | 0.569495 |
b9bdaddeeef48ef4feb644b4418d1b5a6b477a28 | 2,483 | py | Python | algorithms_on_graphs/2.3_strongly_connected.py | roctubre/data-structures-algorithms | 396bde5da4c26dff6a044db94f6f7483ba47d3f6 | [
"MIT"
] | null | null | null | algorithms_on_graphs/2.3_strongly_connected.py | roctubre/data-structures-algorithms | 396bde5da4c26dff6a044db94f6f7483ba47d3f6 | [
"MIT"
] | null | null | null | algorithms_on_graphs/2.3_strongly_connected.py | roctubre/data-structures-algorithms | 396bde5da4c26dff6a044db94f6f7483ba47d3f6 | [
"MIT"
] | null | null | null | #Uses python3
import sys
def reverseGraph(adj):
n = len(adj)
r_adj = [[] for _ in range(n)]
for idx in range(n):
for w in adj[idx]:
r_adj[w].append(idx)
return r_adj
def number_of_strongly_connected_components(adj):
result = 0
n = len(adj)
r_adj = reverseGraph(adj)
... | 25.336735 | 59 | 0.454289 |
eec975ee4104fb8e49b3ce0791cb52d6a7f65bf1 | 53,514 | py | Python | src/sage/crypto/sbox.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | 1 | 2016-11-04T16:31:48.000Z | 2016-11-04T16:31:48.000Z | src/sage/crypto/sbox.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | src/sage/crypto/sbox.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | r"""
S-Boxes and Their Algebraic Representations
"""
from __future__ import print_function, division
from six.moves import range
from six import integer_types
from sage.combinat.integer_vector import IntegerVectors
from sage.crypto.boolean_function import BooleanFunction
from sage.matrix.constructor import Matrix
from... | 30.649485 | 105 | 0.49815 |
3d8b9f964ed59719edfe1e683b5011d009cfdf20 | 3,644 | py | Python | src/core/tecnicas/egreedy.py | ssebastianj/ia2013-tpi-rl | 4e15f7e46118252db449d6185229582e9e53ab91 | [
"MIT"
] | null | null | null | src/core/tecnicas/egreedy.py | ssebastianj/ia2013-tpi-rl | 4e15f7e46118252db449d6185229582e9e53ab91 | [
"MIT"
] | null | null | null | src/core/tecnicas/egreedy.py | ssebastianj/ia2013-tpi-rl | 4e15f7e46118252db449d6185229582e9e53ab91 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy
import random
from core.tecnicas.tecnica import QLTecnica
class EGreedy(QLTecnica):
u"""Técnica EGreedy"""
def __init__(self, epsilon, paso_decremento=0, intervalo_decremento=0):
u"""
Inicializa... | 34.704762 | 104 | 0.626509 |
7961b120511564a19c03e348df75c148d42427ba | 5,912 | py | Python | c2cgeoportal/tests/test_init.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/tests/test_init.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/tests/test_init.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2016, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
#... | 37.18239 | 87 | 0.648681 |
e458bc6929e69db1bb4d0341045017b12ab29b4c | 1,613 | py | Python | Day 4/day_4.py | yuhao-lin007/Advent-of-Code-2020 | 78f42be051bd6693d150048ae2e8c50c0298a127 | [
"Unlicense"
] | 3 | 2020-12-20T01:56:35.000Z | 2020-12-31T11:29:19.000Z | Day 4/day_4.py | yuhao-lin007/Advent-of-Code-2020 | 78f42be051bd6693d150048ae2e8c50c0298a127 | [
"Unlicense"
] | null | null | null | Day 4/day_4.py | yuhao-lin007/Advent-of-Code-2020 | 78f42be051bd6693d150048ae2e8c50c0298a127 | [
"Unlicense"
] | 2 | 2020-12-23T16:23:19.000Z | 2021-03-03T05:26:09.000Z | from re import match
with open("input.txt", "r") as file:
data = [data.split() for data in file.read().split("\n\n")]
passport_data = []
for datum in data:
passport_datum = {}
for key_value in datum:
key_value = key_value.split(":")
key = key_value[0]
... | 30.433962 | 81 | 0.50713 |
ab640ecfef5ce4e6b797f46a32192678956eba59 | 406 | py | Python | File/migrations/0007_auto_20190324_1816.py | nikminer/HomeCloud | 7571e8002ef0919b382c3802d680421bd094d866 | [
"MIT"
] | null | null | null | File/migrations/0007_auto_20190324_1816.py | nikminer/HomeCloud | 7571e8002ef0919b382c3802d680421bd094d866 | [
"MIT"
] | null | null | null | File/migrations/0007_auto_20190324_1816.py | nikminer/HomeCloud | 7571e8002ef0919b382c3802d680421bd094d866 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-24 15:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('File', '0006_auto_20190324_1752'),
]
operations = [
migrations.AlterField(
model_name='publicfile',
name='isvisible'... | 21.368421 | 66 | 0.605911 |
039ea0ff02c53266a618a01b9f669592957af68d | 2,974 | py | Python | kornia/filters/laplacian.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/filters/laplacian.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/filters/laplacian.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from typing import Tuple
import torch
import torch.nn as nn
import kornia
from kornia.filters.kernels import get_laplacian_kernel2d
from kornia.filters.kernels import normalize_kernel2d
def laplacian(
input: torch.Tensor, kernel_size: int, border_type: str = 'reflect', normalized: bool = True
) -> torch.Tensor:... | 35.831325 | 104 | 0.629455 |
878701c5adcea7d808f481267e338da38472f738 | 3,958 | py | Python | closed/FuriosaAI/code/quantization/furiosa_sdk_quantizer/frontend/onnx/transformer/convert_conv1d_to_conv2d.py | ctuning/inference_results_v1.1 | d9176eca28fcf6d7a05ccb97994362a76a1eb5ab | [
"Apache-2.0"
] | 12 | 2021-09-23T08:05:57.000Z | 2022-03-21T03:52:11.000Z | closed/FuriosaAI/code/quantization/furiosa_sdk_quantizer/frontend/onnx/transformer/convert_conv1d_to_conv2d.py | ctuning/inference_results_v1.1 | d9176eca28fcf6d7a05ccb97994362a76a1eb5ab | [
"Apache-2.0"
] | 11 | 2021-09-23T20:34:06.000Z | 2022-01-22T07:58:02.000Z | closed/FuriosaAI/code/quantization/furiosa_sdk_quantizer/frontend/onnx/transformer/convert_conv1d_to_conv2d.py | ctuning/inference_results_v1.1 | d9176eca28fcf6d7a05ccb97994362a76a1eb5ab | [
"Apache-2.0"
] | 16 | 2021-09-23T20:26:38.000Z | 2022-03-09T12:59:56.000Z | import abc
import onnx
import numpy as np
from furiosa_sdk_quantizer.interfaces.transformer import Transformer
from furiosa_sdk_quantizer.frontend.onnx.transformer import ONNXTransformer
class ConvertConv1dToConv2d(Transformer):
def transform(self, model: onnx.ModelProto) -> onnx.ModelProto:
for transfo... | 34.417391 | 96 | 0.555584 |
fe955c62abde3db7b4500ae3349441f183807795 | 111 | py | Python | URI/Problems/average1.py | BlackDereker/Universidade | bfd96689df0aab0905ddcc7ef6fff2098f838e51 | [
"MIT"
] | 1 | 2018-02-27T11:47:34.000Z | 2018-02-27T11:47:34.000Z | URI/Problems/average1.py | BlackDereker/Universidade | bfd96689df0aab0905ddcc7ef6fff2098f838e51 | [
"MIT"
] | null | null | null | URI/Problems/average1.py | BlackDereker/Universidade | bfd96689df0aab0905ddcc7ef6fff2098f838e51 | [
"MIT"
] | null | null | null | a = float(input())
b = float(input())
media = (a * 3.5 + b * 7.5) / (3.5 + 7.5)
print("MEDIA = %.5f" % media) | 18.5 | 41 | 0.486486 |
cfc2683bb4231528890eac767903db974d123552 | 255 | py | Python | build.py | memsharded/conan-ilmbase | 39a73145cb77f0a0606348787b612030e78e1317 | [
"MIT"
] | null | null | null | build.py | memsharded/conan-ilmbase | 39a73145cb77f0a0606348787b612030e78e1317 | [
"MIT"
] | null | null | null | build.py | memsharded/conan-ilmbase | 39a73145cb77f0a0606348787b612030e78e1317 | [
"MIT"
] | null | null | null | from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager(username="Mikayex", channel="stable", args="--build=missing")
builder.add_common_builds(shared_option_name="IlmBase:shared")
builder.run()
| 31.875 | 94 | 0.756863 |
3978b4e776f17b25039ff9402ffd6aae1bb4516c | 273 | py | Python | iniesta/choices.py | crazytruth/iniesta | 1e1cc079d04758f319c6bcee4a8a14a176e7b24e | [
"MIT"
] | 1 | 2021-03-14T08:27:43.000Z | 2021-03-14T08:27:43.000Z | iniesta/choices.py | crazytruth/iniesta | 1e1cc079d04758f319c6bcee4a8a14a176e7b24e | [
"MIT"
] | 1 | 2020-10-08T08:14:04.000Z | 2020-10-08T08:14:04.000Z | iniesta/choices.py | crazytruth/iniesta | 1e1cc079d04758f319c6bcee4a8a14a176e7b24e | [
"MIT"
] | null | null | null | from enum import IntFlag
class InitializationTypes(IntFlag):
"""
Different initialization types and combinations.
"""
QUEUE_POLLING = 1 #: 0001 = 1
EVENT_POLLING = 2 #: 0010 = 2
SNS_PRODUCER = 16 #: 10000 = 16
CUSTOM = 32 #: 100000 = 32
| 19.5 | 52 | 0.622711 |
756b055c2d2ea4d23d105108e668101a54b89b61 | 1,035 | py | Python | imodels/irf/irf.py | bachsh/interpretability-implementations-demos | 8c03c535d19445d27073702080072f8c28852a36 | [
"MIT"
] | null | null | null | imodels/irf/irf.py | bachsh/interpretability-implementations-demos | 8c03c535d19445d27073702080072f8c28852a36 | [
"MIT"
] | null | null | null | imodels/irf/irf.py | bachsh/interpretability-implementations-demos | 8c03c535d19445d27073702080072f8c28852a36 | [
"MIT"
] | null | null | null | from irf import irf_utils # installed from https://github.com/Yu-Group/iterative-Random-Forest
from irf.ensemble import wrf, RandomForestClassifierWithWeights # https://github.com/Yu-Group/iterative-Random-Forest
import numpy as np
class IRFClassifier():
def __init__(self):
self.model = wrf()
self.... | 33.387097 | 117 | 0.601932 |
f6483e94b56d4210280cc260fac9746370262bde | 1,431 | py | Python | ooobuild/lo/drawing/circle_kind.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/drawing/circle_kind.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/drawing/circle_kind.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 25.553571 | 146 | 0.681342 |
3363961bf7513b08a95696e27a40964009f195bf | 2,557 | py | Python | hassio-google-drive-backup/backup/model/drivesnapshot.py | RubenKelevra/hassio-google-drive-backup | d3b12e50d9ccdbd11a5f65474b04128000dcfb82 | [
"MIT"
] | null | null | null | hassio-google-drive-backup/backup/model/drivesnapshot.py | RubenKelevra/hassio-google-drive-backup | d3b12e50d9ccdbd11a5f65474b04128000dcfb82 | [
"MIT"
] | null | null | null | hassio-google-drive-backup/backup/model/drivesnapshot.py | RubenKelevra/hassio-google-drive-backup | d3b12e50d9ccdbd11a5f65474b04128000dcfb82 | [
"MIT"
] | null | null | null | from .snapshots import AbstractSnapshot
from typing import Any, Dict
from ..const import SOURCE_GOOGLE_DRIVE
from ..exceptions import ensureKey
from ..config import BoolValidator
from ..time import Time
from ..logger import getLogger
logger = getLogger(__name__)
PROP_KEY_SLUG = "snapshot_slug"
PROP_KEY_DATE = "snaps... | 33.644737 | 91 | 0.645287 |
91681bb639fc8a23427b617abc8c23d3196ec734 | 461 | py | Python | alipay/aop/api/response/AlipayOpenMiniInnerversionOnlineResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayOpenMiniInnerversionOnlineResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayOpenMiniInnerversionOnlineResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenMiniInnerversionOnlineResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenMiniInnerversionOnlineResponse, self).__init__()
def parse_response_conten... | 28.8125 | 113 | 0.789588 |
8fb9049a4ef6d2f005f36ff0c14a6fe0d37c8641 | 4,980 | py | Python | acoular/tests/unsupported/functionalBeamformer.py | ishine/acoular | 4d790517adb38dc012b1f06966262b94f3625358 | [
"BSD-3-Clause"
] | 294 | 2015-03-24T09:19:12.000Z | 2022-03-11T02:59:11.000Z | acoular/tests/unsupported/functionalBeamformer.py | haoshimaster/acoular | 3f630abde2ffbe1183aefceba2c4f7faa586656a | [
"BSD-3-Clause"
] | 45 | 2015-11-06T15:15:22.000Z | 2022-03-18T07:05:30.000Z | acoular/tests/unsupported/functionalBeamformer.py | haoshimaster/acoular | 3f630abde2ffbe1183aefceba2c4f7faa586656a | [
"BSD-3-Clause"
] | 100 | 2015-05-05T15:18:57.000Z | 2022-03-21T09:48:05.000Z | # -*- coding: utf-8 -*-
"""
Example 6 for acoular library
demonstrates different steering vectors in acoular,
and CSM diagonal removal
with same setup as in example 1
uses measured data in file example_data.h5
calibration in file example_calib.xml
microphone geometry in array_56.xml (part of acoular)
... | 40.16129 | 90 | 0.526506 |
0dcddb7d94b0a5b59b79bc918d9041c5227d07cd | 700 | py | Python | DailyProgrammer/DP20141029W.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/DP20141029W.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/DP20141029W.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
[Weekly #15] Architectural Patterns
https://www.reddit.com/r/dailyprogrammer/comments/2ki6mt/weekly_15_architectural_patterns/
Let's say you're taking on a larger project than usual. It spans multiple files/namespaces and requires a large variety
of different components to all slot in together. What approach do y... | 33.333333 | 119 | 0.77 |
7c18307b66932e8b7335e7e004ec7f3c9d2a6075 | 569 | py | Python | ProgramlamayaGiris/1 - Float and Int/2 - Aliasing.py | ErenKaracan47/TemelProgramlama | 5d9f2f806d0a8b2340aea59bd33f8717d3a773c8 | [
"MIT"
] | 4 | 2022-03-04T12:56:12.000Z | 2022-03-07T11:35:33.000Z | ProgramlamayaGiris/1 - Float and Int/2 - Aliasing.py | ErenKaracan47/TemelProgramlama | 5d9f2f806d0a8b2340aea59bd33f8717d3a773c8 | [
"MIT"
] | null | null | null | ProgramlamayaGiris/1 - Float and Int/2 - Aliasing.py | ErenKaracan47/TemelProgramlama | 5d9f2f806d0a8b2340aea59bd33f8717d3a773c8 | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
samplerate = 200
frequency = 1
amplitude = 1.0
time = []
sinewave = []
over_samplerate = 400
over_sinewave = []
over_time = []
for i in range(samplerate):
time.append(i / samplerate)
sinewave.append(math.sin(2 * math.pi * frequency * time[i]) * amplitude)
for i ... | 21.074074 | 86 | 0.702988 |
ce0d8d8a7054c3bf7cfec15ae01de0b8d6699d76 | 377 | py | Python | tests/system/safecastbeat.py | radoondas/safecastbeat | db1202cc035e89f633b9b4759427e3d7af7c4b00 | [
"Apache-2.0"
] | null | null | null | tests/system/safecastbeat.py | radoondas/safecastbeat | db1202cc035e89f633b9b4759427e3d7af7c4b00 | [
"Apache-2.0"
] | 1 | 2019-05-02T11:46:41.000Z | 2019-05-04T12:35:26.000Z | tests/system/safecastbeat.py | radoondas/safecastbeat | db1202cc035e89f633b9b4759427e3d7af7c4b00 | [
"Apache-2.0"
] | null | null | null | import os
import sys
sys.path.append('../../vendor/github.com/elastic/beats/libbeat/tests/system')
from beat.beat import TestCase
class BaseTest(TestCase):
@classmethod
def setUpClass(self):
self.beat_name = "safecastbeat"
self.beat_path = os.path.abspath(os.path.join(os.path.dirname(__file__... | 26.928571 | 91 | 0.687003 |
ad205704f9c6b2e01dd3a3257bf483307848f817 | 7,621 | py | Python | ddtrace/internal/periodic.py | ganeshkumarsv/dd-trace-py | 0665507ecfd95a4c247c1d789321f9ab5004977f | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/internal/periodic.py | ganeshkumarsv/dd-trace-py | 0665507ecfd95a4c247c1d789321f9ab5004977f | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2021-07-26T01:22:38.000Z | 2022-03-21T19:20:53.000Z | ddtrace/internal/periodic.py | ganeshkumarsv/dd-trace-py | 0665507ecfd95a4c247c1d789321f9ab5004977f | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-03T12:41:49.000Z | 2021-08-03T12:41:49.000Z | # -*- encoding: utf-8 -*-
import sys
import threading
import time
import typing
import attr
from ddtrace.internal import nogevent
from ddtrace.internal import service
from . import forksafe
class PeriodicThread(threading.Thread):
"""Periodic thread.
This class can be used to instantiate a worker thread th... | 32.568376 | 118 | 0.618029 |
8e3ff3541f5d26dc291c139ac3e4efd9ce5a1c22 | 9,577 | py | Python | darknight/functions.py | xuliang2019/darknight | 4c89a4d584d050c320eab6028971948a45314e17 | [
"MIT"
] | 3 | 2019-11-20T22:54:39.000Z | 2020-05-17T08:58:29.000Z | darknight/functions.py | xuliang2019/darknight | 4c89a4d584d050c320eab6028971948a45314e17 | [
"MIT"
] | 10 | 2020-03-24T18:15:10.000Z | 2022-03-12T00:16:34.000Z | darknight/functions.py | xuliang2019/darknight | 4c89a4d584d050c320eab6028971948a45314e17 | [
"MIT"
] | 1 | 2020-01-12T05:08:40.000Z | 2020-01-12T05:08:40.000Z | """
DarKnight.functions
~~~~~~~~~~~~~~~~~~~
General utility functions for DarKnight.
"""
# Imports
import pandas as pd
import numpy as np
from rdkit.Chem import AllChem as Chem
from rdkit.Chem import PandasTools, Draw
import math
import openbabel
import darkchem
from IPython.display import display
import tensorflow a... | 32.35473 | 123 | 0.626919 |
a577da9d402066b5b11ac41cf2aae0d753f4daee | 9,026 | py | Python | tests/infer/mcmc/test_mcmc_api.py | kashif/pyro | b65b329d8b851c7402acaef9c176a8964caadaf3 | [
"Apache-2.0"
] | 2 | 2021-01-04T01:35:23.000Z | 2021-01-04T01:35:32.000Z | tests/infer/mcmc/test_mcmc_api.py | Ezecc/pyro | 11a96cde05756def826c232d76f9cff66f6e6d4f | [
"Apache-2.0"
] | 1 | 2020-05-12T16:26:21.000Z | 2020-05-12T17:23:13.000Z | tests/infer/mcmc/test_mcmc_api.py | Ezecc/pyro | 11a96cde05756def826c232d76f9cff66f6e6d4f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import os
from functools import partial
import pytest
import torch
import pyro
import pyro.distributions as dist
from pyro import poutine
from pyro.infer.mcmc import HMC, NUTS
from pyro.infer.mcmc.api import MCMC, _UnarySampler, ... | 36.54251 | 107 | 0.654221 |
b500e6550c82c3e89a8074c3a6e3829cd08588e6 | 8,775 | py | Python | tests/handlers/test_data_sources.py | zero1number/redash | caabc4afa4e60e273782a46d84099857821c6500 | [
"BSD-2-Clause"
] | 20,680 | 2015-11-16T15:38:37.000Z | 2022-03-31T21:43:43.000Z | tests/handlers/test_data_sources.py | zero1number/redash | caabc4afa4e60e273782a46d84099857821c6500 | [
"BSD-2-Clause"
] | 3,934 | 2015-11-16T14:46:49.000Z | 2022-03-31T13:22:31.000Z | tests/handlers/test_data_sources.py | zero1number/redash | caabc4afa4e60e273782a46d84099857821c6500 | [
"BSD-2-Clause"
] | 4,147 | 2015-11-17T15:57:23.000Z | 2022-03-31T11:57:43.000Z | from funcy import pairwise
from tests import BaseTestCase
from mock import patch
from redash.models import DataSource
from redash.query_runner.pg import PostgreSQL
class TestDataSourceGetSchema(BaseTestCase):
def test_fails_if_user_doesnt_belong_to_org(self):
other_user = self.factory.create_user(org=sel... | 36.260331 | 88 | 0.645356 |
f63ac7b23dabb6af00e05bb96ccde00ae5dcfb06 | 81 | py | Python | fllowchart_1.py | ybjybj457/test_algorithm | 7f099e7699561e3746c88bb76c0b992d2b03b84a | [
"Apache-2.0"
] | null | null | null | fllowchart_1.py | ybjybj457/test_algorithm | 7f099e7699561e3746c88bb76c0b992d2b03b84a | [
"Apache-2.0"
] | null | null | null | fllowchart_1.py | ybjybj457/test_algorithm | 7f099e7699561e3746c88bb76c0b992d2b03b84a | [
"Apache-2.0"
] | null | null | null |
A,B,C,D = 1,3,5,7
if B ==3 :
A = 10
else :
C = 5
C = 5 + D
print("1") | 9 | 17 | 0.37037 |
3516164a719ba4e41555b03f426a51a84bb2a9ea | 583 | py | Python | src/llull/taxon.py | francisco-perez-sorrosal/llull | fcb482f5251bf2998e78980ee38552aca314c780 | [
"MIT"
] | null | null | null | src/llull/taxon.py | francisco-perez-sorrosal/llull | fcb482f5251bf2998e78980ee38552aca314c780 | [
"MIT"
] | null | null | null | src/llull/taxon.py | francisco-perez-sorrosal/llull | fcb482f5251bf2998e78980ee38552aca314c780 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Dict, Optional
@dataclass
class Taxon:
id: str
name: Optional[str] = None
level: int = -1
parent: Optional["Taxon"] = None
children: Dict[str, "Taxon"] = field(default_factory=lambda: ({}))
def __post_init__(self):
if self.na... | 24.291667 | 70 | 0.584906 |
c0d894c8286eb7d8a12e8313da08641eaa202447 | 246 | py | Python | v1/data/clean.py | avgupta456/statbotics | 8847cec161104ec54f4c501653cd4ec558d30379 | [
"MIT"
] | 14 | 2020-05-28T21:54:45.000Z | 2022-03-17T19:39:23.000Z | v1/data/clean.py | avgupta456/statbotics | 8847cec161104ec54f4c501653cd4ec558d30379 | [
"MIT"
] | 59 | 2020-05-28T21:39:45.000Z | 2022-03-25T23:51:39.000Z | v1/data/clean.py | avgupta456/statbotics | 8847cec161104ec54f4c501653cd4ec558d30379 | [
"MIT"
] | 1 | 2020-07-04T07:30:40.000Z | 2020-07-04T07:30:40.000Z | import os
from dotenv import load_dotenv
load_dotenv()
os.environ["LOCAL_DB"] = "True"
from src.process.process_main import process_main # noqa: E402
start_year = 2002
end_year = 2021
clean = True
process_main(start_year, end_year, clean)
| 15.375 | 63 | 0.768293 |
cd368d6d71092f150d7750ab252a7607bab4777a | 5,825 | py | Python | tensorflow_asr/runners/transducer_runners.py | Honghe/TensorFlowASR | ade78916987b6a61642b650cc10d259aeeb1d92e | [
"Apache-2.0"
] | 1 | 2020-10-20T11:42:08.000Z | 2020-10-20T11:42:08.000Z | tensorflow_asr/runners/transducer_runners.py | dathudeptrai/TensorFlowASR | 72cd5d2b932d66ddd61e79ab41bb0d64cb8c4919 | [
"Apache-2.0"
] | null | null | null | tensorflow_asr/runners/transducer_runners.py | dathudeptrai/TensorFlowASR | 72cd5d2b932d66ddd61e79ab41bb0d64cb8c4919 | [
"Apache-2.0"
] | 1 | 2021-10-16T22:40:42.000Z | 2021-10-16T22:40:42.000Z | # Copyright 2020 Huy Le Nguyen (@usimarit)
#
# 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 t... | 40.451389 | 95 | 0.6503 |
fbab7716d8bc2def29c1f52ce169a2518e331817 | 2,164 | py | Python | share/qt/extract_strings_qt.py | gnorbsl/Ucacoin2 | d10baf360bfb7e7b66efb0856da43d33e5941196 | [
"MIT"
] | 4 | 2020-07-31T12:27:23.000Z | 2021-06-05T23:07:37.000Z | share/qt/extract_strings_qt.py | gnorbsl/Ucacoin2 | d10baf360bfb7e7b66efb0856da43d33e5941196 | [
"MIT"
] | 3 | 2020-08-02T10:47:08.000Z | 2021-07-07T06:41:54.000Z | share/qt/extract_strings_qt.py | gnorbsl/Ucacoin2 | d10baf360bfb7e7b66efb0856da43d33e5941196 | [
"MIT"
] | 3 | 2020-08-24T15:36:47.000Z | 2020-10-13T15:51:47.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/ucacoinstrings.cp... | 25.761905 | 105 | 0.619686 |
5a19743933b4a96edd7960eb14cee060cf003d1b | 572 | py | Python | model/group.py | LukinVV/python_training | 9e6eb57fe9527fd591d563b4219c19e49188c4de | [
"Apache-2.0"
] | null | null | null | model/group.py | LukinVV/python_training | 9e6eb57fe9527fd591d563b4219c19e49188c4de | [
"Apache-2.0"
] | null | null | null | model/group.py | LukinVV/python_training | 9e6eb57fe9527fd591d563b4219c19e49188c4de | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s;%s;%s" % (self.id, self.name, self.header, self.footer)
... | 22.88 | 103 | 0.58042 |
31e7ddb0addf64696d8d65b82ac3d9a12e3f5676 | 9,790 | py | Python | tests/unit/plugins/openstack/scenarios/neutron/test_bgpvpn.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/neutron/test_bgpvpn.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/neutron/test_bgpvpn.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"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
# d... | 43.318584 | 79 | 0.639428 |
191054877fa35bc8ae9e73841c450459a1ad5c31 | 3,061 | py | Python | build/lib/UKCOVIDDashboard/dashboard.py | nickoc294/UKCOVIDDashboard | 56fc1cacc59442f5795bd2d70c44cbb22279fc59 | [
"MIT"
] | null | null | null | build/lib/UKCOVIDDashboard/dashboard.py | nickoc294/UKCOVIDDashboard | 56fc1cacc59442f5795bd2d70c44cbb22279fc59 | [
"MIT"
] | null | null | null | build/lib/UKCOVIDDashboard/dashboard.py | nickoc294/UKCOVIDDashboard | 56fc1cacc59442f5795bd2d70c44cbb22279fc59 | [
"MIT"
] | null | null | null | """This is the main program of the covid data dashboard"""
import webbrowser
import json
import logging
from datetime import date
from flask import Flask
from flask import render_template
from flask import request
from flask import redirect
import covid_news_handling as cnh
import covid_data_handler as cdh
... | 38.2625 | 100 | 0.588697 |
b6d6777bf4b736deaa5be84a7112f54ceff10fed | 3,975 | py | Python | contrib/linearize/linearize-hashes.py | parkingcrypto/parking | df01fe37e79ad841b17f5e351bc444ddd5e2ac8c | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | parkingcrypto/parking | df01fe37e79ad841b17f5e351bc444ddd5e2ac8c | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | parkingcrypto/parking | df01fe37e79ad841b17f5e351bc444ddd5e2ac8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ impo... | 29.014599 | 90 | 0.685031 |
b1b4adad9a9d65805c02867b6c0b2e79de08b2ad | 152 | py | Python | tests/web_platform/CSS2/linebox/test_line_height_bleed.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/linebox/test_line_height_bleed.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/linebox/test_line_height_bleed.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | 1 | 2020-01-16T01:56:41.000Z | 2020-01-16T01:56:41.000Z | from tests.utils import W3CTestCase
class TestLineHeightBleed(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'line-height-bleed-'))
| 25.333333 | 73 | 0.789474 |
4843c57c6f7c2a7b44696bf8ee5fd2645862186e | 7,058 | py | Python | pop/mods/pop/testing.py | smokeytheblair/pop | f3a67f913ee92cf855889719a23f662dd435f39d | [
"Apache-2.0"
] | 48 | 2019-05-21T16:10:49.000Z | 2021-12-04T18:02:20.000Z | pop/mods/pop/testing.py | smokeytheblair/pop | f3a67f913ee92cf855889719a23f662dd435f39d | [
"Apache-2.0"
] | 43 | 2019-05-21T22:39:44.000Z | 2020-02-07T16:37:29.000Z | pop/mods/pop/testing.py | smokeytheblair/pop | f3a67f913ee92cf855889719a23f662dd435f39d | [
"Apache-2.0"
] | 18 | 2019-05-21T16:10:42.000Z | 2019-12-13T16:28:36.000Z | # -*- coding: utf-8 -*-
'''
Provides tools to help unit test projects using pop.
For now, provides mock Hub instances.
'''
# Import python libs
import inspect
import copy
from asyncio import iscoroutinefunction
from functools import partial
# Import third party libs
try:
from asynctest.mock import create_autospec
... | 31.936652 | 118 | 0.634599 |
f41d2c9e28aec82847624a2a9ae0ac6c6ff990a0 | 4,901 | py | Python | ingredientsfast copy.py | shiningsunnyday/aiFood | 688f48f1c0064bb39d6735e89f279856eb31d899 | [
"MIT"
] | null | null | null | ingredientsfast copy.py | shiningsunnyday/aiFood | 688f48f1c0064bb39d6735e89f279856eb31d899 | [
"MIT"
] | null | null | null | ingredientsfast copy.py | shiningsunnyday/aiFood | 688f48f1c0064bb39d6735e89f279856eb31d899 | [
"MIT"
] | null | null | null | import pandas as pd
import random
import json
import numpy as np
def main(target_mcros):
global dfs
global dic
global values
global new_count
global train
df = pd.read_csv('/Users/shiningsunnyday/Desktop/Food/ingredients.csv')
train = pd.read_json('/Users/shiningsunnyday/Desktop/Food/... | 31.619355 | 204 | 0.572128 |
6f0a4a1d78941bbac21ba625b199de84913646e5 | 31,026 | py | Python | src/transformers/models/segformer/modeling_segformer.py | VasudevGupta7/transformers | 525dbbf84a0d2933686281c513689da9794b7dd1 | [
"Apache-2.0"
] | 1 | 2022-02-02T11:37:05.000Z | 2022-02-02T11:37:05.000Z | src/transformers/models/segformer/modeling_segformer.py | VasudevGupta7/transformers | 525dbbf84a0d2933686281c513689da9794b7dd1 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/segformer/modeling_segformer.py | VasudevGupta7/transformers | 525dbbf84a0d2933686281c513689da9794b7dd1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 NVIDIA The HuggingFace Inc. team. 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
#
# U... | 40.556863 | 131 | 0.671662 |
3ce722212249173896aab2c8e71cb9b61ed3994f | 5,612 | py | Python | inventory_management/backend/views.py | AxiosDeminence/InventoryDB | d0680692091d7bf6226a1cf4f8c293a212e9131b | [
"BSD-2-Clause"
] | 1 | 2020-11-18T02:21:05.000Z | 2020-11-18T02:21:05.000Z | inventory_management/backend/views.py | AxiosDeminence/InventoryDB | d0680692091d7bf6226a1cf4f8c293a212e9131b | [
"BSD-2-Clause"
] | null | null | null | inventory_management/backend/views.py | AxiosDeminence/InventoryDB | d0680692091d7bf6226a1cf4f8c293a212e9131b | [
"BSD-2-Clause"
] | null | null | null | # from django.shortcuts import render
from django.db.models import Q
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from django.utils.datastructures import MultiValueDictKeyError as MissingParamError
from .models import User, Character, Item
fro... | 35.745223 | 113 | 0.573236 |
bd3970aceec7db2a5697c02111273be9e2f2054c | 8,834 | py | Python | train.py | shaikhon/ClockworkRNN_Porosity_Log_Prediction | 1cac6126cf5c1fd3d730e361fb4c5152490341fa | [
"MIT"
] | 1 | 2020-04-22T09:24:35.000Z | 2020-04-22T09:24:35.000Z | train.py | shaikhon/Clockwork-RNN-Porosity-Log-Prediction | 1cac6126cf5c1fd3d730e361fb4c5152490341fa | [
"MIT"
] | null | null | null | train.py | shaikhon/Clockwork-RNN-Porosity-Log-Prediction | 1cac6126cf5c1fd3d730e361fb4c5152490341fa | [
"MIT"
] | 3 | 2020-06-05T00:50:08.000Z | 2020-11-03T15:04:09.000Z | from datetime import datetime
import os
import math
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
from models.clockwork_rnn2 import ClockworkRNN
from config import Config
# Notes:
# in case error: reference validation loss before assignment, solu... | 36.655602 | 158 | 0.578447 |
987667dc64cb2a957c96278c18d5ee0774543a3d | 5,672 | py | Python | indy_node/server/config_req_handler.py | ArtObr/indy-node | f3491c42eba1a1b45df98f0e4dabe749d281ae33 | [
"Apache-2.0"
] | null | null | null | indy_node/server/config_req_handler.py | ArtObr/indy-node | f3491c42eba1a1b45df98f0e4dabe749d281ae33 | [
"Apache-2.0"
] | null | null | null | indy_node/server/config_req_handler.py | ArtObr/indy-node | f3491c42eba1a1b45df98f0e4dabe749d281ae33 | [
"Apache-2.0"
] | null | null | null | from typing import List
from plenum.common.exceptions import InvalidClientRequest, \
UnauthorizedClientRequest
from plenum.common.txn_util import reqToTxn, isTxnForced
from plenum.server.req_handler import RequestHandler
from plenum.common.constants import TXN_TYPE, NAME, VERSION, FORCE
from indy_common.auth impor... | 41.705882 | 106 | 0.606312 |
b964662d20be6f19625d1962bf2aa8ec09a91e2d | 4,666 | py | Python | tests/cli/test_update.py | john1711/patientMatcher | 516a2a73a2cea1e87ed2f9ae6a4f0b1b715281d9 | [
"MIT"
] | null | null | null | tests/cli/test_update.py | john1711/patientMatcher | 516a2a73a2cea1e87ed2f9ae6a4f0b1b715281d9 | [
"MIT"
] | null | null | null | tests/cli/test_update.py | john1711/patientMatcher | 516a2a73a2cea1e87ed2f9ae6a4f0b1b715281d9 | [
"MIT"
] | 1 | 2018-12-20T09:15:08.000Z | 2018-12-20T09:15:08.000Z | import responses
from patientMatcher.cli.commands import cli
from patientMatcher.constants import PHENOTYPE_TERMS
@responses.activate
def test_update_resources(mock_app):
"""Test the command that updates the database resources (diseases and HPO terms)"""
# Given a mocked response from the servers containing ... | 32.17931 | 122 | 0.626447 |
4c5cfac6494aa89d60172f750ebb6c8b403fb972 | 1,352 | py | Python | tests/conftest.py | arpitremarkable/django-dynamic-models | 175c32bdbbde464a1543f4f1209e1e3795f8dd47 | [
"MIT"
] | 2 | 2020-12-10T08:23:17.000Z | 2021-05-21T11:27:47.000Z | tests/conftest.py | arpitremarkable/django-dynamic-models | 175c32bdbbde464a1543f4f1209e1e3795f8dd47 | [
"MIT"
] | null | null | null | tests/conftest.py | arpitremarkable/django-dynamic-models | 175c32bdbbde464a1543f4f1209e1e3795f8dd47 | [
"MIT"
] | null | null | null | import pytest
from django.apps import apps
from django.core.cache import cache
from dynamic_models import utils
from dynamic_models.models import ModelFieldSchema
from .models import ModelSchema, FieldSchema
# pylint: disable=unused-argument,invalid-name
TEST_APP_LABEL = 'tests'
MODEL_REGISTRY = utils.ModelRegistry(... | 28.765957 | 79 | 0.744083 |
684fdc62bfcfe40ce9b26b48d9dcf42a753e5764 | 1,573 | py | Python | crires_data_challenge/data_challenge.py | AWehrhahn/CATS | 40b9f21ffccda8f70f9d1a9d7335102083847ce3 | [
"MIT"
] | 1 | 2022-02-02T16:14:02.000Z | 2022-02-02T16:14:02.000Z | crires_data_challenge/data_challenge.py | AWehrhahn/CATS | 40b9f21ffccda8f70f9d1a9d7335102083847ce3 | [
"MIT"
] | null | null | null | crires_data_challenge/data_challenge.py | AWehrhahn/CATS | 40b9f21ffccda8f70f9d1a9d7335102083847ce3 | [
"MIT"
] | null | null | null | import logging
from os.path import dirname, join
import numpy as np
import pandas as pd
from astropy import units as u
from astropy.utils.iers import IERS_Auto
from cats.simulator.detector import Crires
from cats.extractor.runner import CatsRunner
# TODO List:
# - automatically mask points before fitting with SME
#... | 26.216667 | 76 | 0.732994 |
450898facaa3f093f6450d31cc53b2d75d95c306 | 245 | py | Python | module4-software-testing-documentation-and-licensing/sqrt_testing/new_test.py | EvidenceN/DS-Unit-3-Sprint-1-Software-Engineering | 5f481299e1cc7b360f6b0da23fc73f4b435514e4 | [
"MIT"
] | null | null | null | module4-software-testing-documentation-and-licensing/sqrt_testing/new_test.py | EvidenceN/DS-Unit-3-Sprint-1-Software-Engineering | 5f481299e1cc7b360f6b0da23fc73f4b435514e4 | [
"MIT"
] | 18 | 2020-03-24T18:02:54.000Z | 2021-08-23T20:35:52.000Z | sqrt_testing/new_test.py | EvidenceN/lambda-data-ds9 | d6cd018935817901a2c16157b6d424cf5b8f3720 | [
"MIT"
] | null | null | null | import unittest
from sqrt import newton_sqrt1, newton_sqrt2, lazy_sqrt, builtin_sqrt
class sqrtTests(unittest.TestCase):
def test_sqrt9(self):
self.assertEqual(lazy_sqrt(9), 3)
if __name__ == "__main__":
unittest.main() | 27.222222 | 69 | 0.718367 |
64dabc67569eb5097113401c9665641ad337cea0 | 727 | py | Python | Python Tkinter Open Files Dialog Box/openFilesDialogBox.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 20 | 2020-08-19T23:27:01.000Z | 2022-02-03T12:02:17.000Z | Python Tkinter Open Files Dialog Box/openFilesDialogBox.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 1 | 2021-04-10T18:06:05.000Z | 2021-04-10T18:06:05.000Z | Python Tkinter Open Files Dialog Box/openFilesDialogBox.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 2 | 2020-12-03T19:35:36.000Z | 2021-11-10T14:58:39.000Z | # Python Tkinter Open Files Dialog Box
# ventana para cargar imagenes
from tkinter import *
from PIL import ImageTk, Image
from tkinter import filedialog
root = Tk()
root.title('Learn to Python')
root.iconbitmap('Python Tkinter Open Files Dialog Box/icon.ico')
def open():
global my_iamge
root.filename = fi... | 29.08 | 183 | 0.723521 |
48aa916b99ed49acf3a3d6db388af210487662f7 | 1,360 | py | Python | src/vimnote.py | d0iasm/vimnote | b2b13f83803f6bc497bdda6327bcdfc6be5efa64 | [
"MIT"
] | 2 | 2017-05-02T10:15:04.000Z | 2017-05-05T08:49:30.000Z | src/vimnote.py | d0iasm/vimnote | b2b13f83803f6bc497bdda6327bcdfc6be5efa64 | [
"MIT"
] | null | null | null | src/vimnote.py | d0iasm/vimnote | b2b13f83803f6bc497bdda6327bcdfc6be5efa64 | [
"MIT"
] | null | null | null | import sys
import vim
from datetime import datetime
from evernote.api.client import EvernoteClient
import evernote.edam.type.ttypes as Types
# from setting import Setting
class Vimnote(object):
_instance = None
_client = None
_dev_token = None
def __init__(self, *args, **keys):
pass
@c... | 26.666667 | 128 | 0.611765 |
f91b6435323c788819210defb59402d1614082de | 5,864 | py | Python | pomdp_problems/HTN_CoachDial/HTN-GRP-PO/TaskHint.py | IfrahIdrees/pomdp-py | c61e66ef29eaad119e7829cd8be78052548151f2 | [
"MIT"
] | null | null | null | pomdp_problems/HTN_CoachDial/HTN-GRP-PO/TaskHint.py | IfrahIdrees/pomdp-py | c61e66ef29eaad119e7829cd8be78052548151f2 | [
"MIT"
] | null | null | null | pomdp_problems/HTN_CoachDial/HTN-GRP-PO/TaskHint.py | IfrahIdrees/pomdp-py | c61e66ef29eaad119e7829cd8be78052548151f2 | [
"MIT"
] | null | null | null | """------------------------------------------------------------------------------------------
Hierarchical Task Recognition and Planning in Smart Homes with Partially Observability
Author: Dan Wang danwangkoala@gmail.com (May 2016 - June 2017)
Supervised by Prof. Jesse Hoey (https://cs.uwaterloo.ca/~jhoey/)
Association... | 43.437037 | 334 | 0.533765 |
6fd75459031330a6210f552b3c9c5c56f13f1ff6 | 417 | py | Python | toolsql/cli/commands/sql/migrate/apply_command.py | sslivkoff/toolsql | 7f41c3ee1b4e5a67732244ce54893fca746aa9e7 | [
"MIT"
] | null | null | null | toolsql/cli/commands/sql/migrate/apply_command.py | sslivkoff/toolsql | 7f41c3ee1b4e5a67732244ce54893fca746aa9e7 | [
"MIT"
] | null | null | null | toolsql/cli/commands/sql/migrate/apply_command.py | sslivkoff/toolsql | 7f41c3ee1b4e5a67732244ce54893fca746aa9e7 | [
"MIT"
] | null | null | null | from __future__ import annotations
import toolcli
import toolsql
def get_command_spec() -> toolcli.CommandSpec:
return {
'f': migrate_apply_command,
'help': 'apply migrations',
'special': {
'inject': ['migrate_config'],
},
}
def migrate_apply_command(migrate_conf... | 20.85 | 73 | 0.673861 |
abee931f22abf9df4876f5cd8a8461465b5aa46d | 38,556 | py | Python | se/se_epub.py | zoeypeterson/tools | 7e3e49d578362174f613f79aaa933004b65210d6 | [
"CC0-1.0"
] | null | null | null | se/se_epub.py | zoeypeterson/tools | 7e3e49d578362174f613f79aaa933004b65210d6 | [
"CC0-1.0"
] | null | null | null | se/se_epub.py | zoeypeterson/tools | 7e3e49d578362174f613f79aaa933004b65210d6 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
"""
Defines the SeEpub class, the master class for representing and operating on
Standard Ebooks epub3 files.
"""
import base64
import concurrent.futures
import datetime
import fnmatch
import os
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from sys import getsiz... | 35.050909 | 377 | 0.68988 |
1cf1ddf984262afba39d7096ef3c3f97ee0f953f | 1,850 | py | Python | Others/Source/11/11.4/simple_bind.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | 1 | 2018-05-30T01:38:23.000Z | 2018-05-30T01:38:23.000Z | Others/Source/11/11.4/simple_bind.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | null | null | null | Others/Source/11/11.4/simple_bind.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version... | 46.25 | 81 | 0.332432 |
9923c3ef0992ee3e25b00516ce0cfef027e8f56a | 25,716 | py | Python | venv/Lib/site-packages/pandas/tests/arrays/categorical/test_constructors.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | 1 | 2021-02-06T21:00:00.000Z | 2021-02-06T21:00:00.000Z | venv/Lib/site-packages/pandas/tests/arrays/categorical/test_constructors.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/arrays/categorical/test_constructors.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | from datetime import datetime
import numpy as np
import pytest
from pandas.compat.numpy import _np_version_under1p16
from pandas.core.dtypes.common import is_float_dtype, is_integer_dtype
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
Categorical,
... | 39.869767 | 89 | 0.584072 |
f6d174c859934701679d8acfad784a1984d3bb06 | 84,590 | py | Python | front-end/testsuite-python-lib/Python-3.1/Lib/locale.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2020-11-26T18:53:46.000Z | 2020-11-26T18:53:46.000Z | front-end/testsuite-python-lib/Python-3.1/Lib/locale.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | null | null | null | front-end/testsuite-python-lib/Python-3.1/Lib/locale.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... | 47.204241 | 103 | 0.455278 |
472136dfe8746be9f1dbb1c7cae3b6b7e128eaac | 1,906 | py | Python | wintermute/policy_evaluation/epsilon_greedy.py | bogdanbranescu/wintermute | 82bb1eb4065a6791b9b6f53ed0906df29bf881f4 | [
"MIT"
] | null | null | null | wintermute/policy_evaluation/epsilon_greedy.py | bogdanbranescu/wintermute | 82bb1eb4065a6791b9b6f53ed0906df29bf881f4 | [
"MIT"
] | null | null | null | wintermute/policy_evaluation/epsilon_greedy.py | bogdanbranescu/wintermute | 82bb1eb4065a6791b9b6f53ed0906df29bf881f4 | [
"MIT"
] | null | null | null | """ Epsilon Greedy. """
from typing import Union, Dict, Iterator, NamedTuple
from numpy import random
from .deterministic import DeterministicPolicy
from .exploration_schedules import get_schedule as get_epsilon_schedule
class EpsilonGreedyOutput(NamedTuple):
""" The output of the epsilon greedy policy. """
... | 29.323077 | 77 | 0.633263 |
19aa0591256dbd61fb87b525411d6d36b45f026c | 6,718 | py | Python | bindings/python/ensmallen_graph/datasets/string/clostridiumspiroforme.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/clostridiumspiroforme.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/clostridiumspiroforme.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Clostridium spiroforme.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... | 35.172775 | 223 | 0.704972 |
0cab18bd9929022a2d41b278979a9235f8514110 | 8,899 | py | Python | pydeconz/gateway.py | blackcoffeerider/deconz | 8e26d07ad1796cded165d1c2966f7ba090c533fe | [
"MIT"
] | null | null | null | pydeconz/gateway.py | blackcoffeerider/deconz | 8e26d07ad1796cded165d1c2966f7ba090c533fe | [
"MIT"
] | null | null | null | pydeconz/gateway.py | blackcoffeerider/deconz | 8e26d07ad1796cded165d1c2966f7ba090c533fe | [
"MIT"
] | null | null | null | """Python library to connect deCONZ and Home Assistant to work together."""
import logging
from pprint import pformat
from typing import Any, Callable, Dict, Optional, Union
import aiohttp
from .alarm_system import RESOURCE_TYPE as ALARM_SYSTEM_RESOURCE, AlarmSystems
from .config import RESOURCE_TYPE as CONFIG_RESOU... | 33.965649 | 98 | 0.613889 |
6cc7f1624bebb4e8b5f8c0d84dbf7504d521dfa3 | 5,898 | py | Python | scripts/prepare_training_data.py | sentinel-hub/hiector | 95102c1fcfa63d127a389262e9d569e3aa3495cc | [
"MIT"
] | 3 | 2022-03-15T11:19:27.000Z | 2022-03-24T15:59:49.000Z | scripts/prepare_training_data.py | sentinel-hub/hiector | 95102c1fcfa63d127a389262e9d569e3aa3495cc | [
"MIT"
] | null | null | null | scripts/prepare_training_data.py | sentinel-hub/hiector | 95102c1fcfa63d127a389262e9d569e3aa3495cc | [
"MIT"
] | null | null | null | """
Prepare training data by processing EOPatches
"""
import argparse
import json
import logging
import sys
import fs
import geopandas as gpd
import ray
from tqdm.auto import tqdm
from eolearn.core import EOExecutor, EOPatch, FeatureType, LoadTask, SaveTask, get_filesystem
from eolearn.core.extra.ray import RayExecut... | 37.09434 | 119 | 0.703798 |
0b669d527b13cb39a74dfa0eb61e5c04b2092ee4 | 8,312 | py | Python | examples/microjson/mutants/AOR_BinOp_mutant_1486201168.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 90 | 2015-04-07T10:26:53.000Z | 2022-03-07T15:14:57.000Z | examples/microjson/mutants/AOR_BinOp_mutant_1486201168.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 14 | 2015-10-13T16:25:59.000Z | 2021-01-21T18:31:03.000Z | examples/microjson/mutants/AOR_BinOp_mutant_1486201168.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 32 | 2015-04-07T10:41:29.000Z | 2022-02-26T05:17:28.000Z | import math
import StringIO
import types
__pychecker__ = 'no-returnvalues'
WS = set([' ', '\t', '\r', '\n', '\x08', '\x0c'])
DIGITS = set([str(i) for i in range(0, 10)])
NUMSTART = DIGITS.union(['.', '-', '+'])
NUMCHARS = NUMSTART.union(['e', 'E'])
ESC_MAP = {'n': '\n', 't': '\t', 'r': '\r', 'b': '\x08', 'f': '\x0c'}
R... | 27.892617 | 178 | 0.526468 |
24e57928778d1bf2c52c5a127d4fbecbba9d1d9d | 971 | py | Python | python/tvm/meta_schedule/testing/__init__.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | python/tvm/meta_schedule/testing/__init__.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | python/tvm/meta_schedule/testing/__init__.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.346154 | 62 | 0.760041 |
bb152fb6a61a166dca4d9dce0f5a73f330c5e963 | 1,103 | py | Python | cli/conditions.py | kiamco/CryptoAlert | ba0c190d0f030a5db8efb7c4ecea630c39e77807 | [
"MIT"
] | null | null | null | cli/conditions.py | kiamco/CryptoAlert | ba0c190d0f030a5db8efb7c4ecea630c39e77807 | [
"MIT"
] | null | null | null | cli/conditions.py | kiamco/CryptoAlert | ba0c190d0f030a5db8efb7c4ecea630c39e77807 | [
"MIT"
] | null | null | null | import operator
class Conditions:
def __init__(self,type,signal):
self.type = {}
self.signal = signal
def update_signal(self, new_signal):
self.signal = new_signal
def static_threshold(self, threshold, option):
operators = {
'gt':operator.gt(self.si... | 25.651163 | 70 | 0.532185 |
8a1d9bbf39d7a22677c9bb38d12bf24a9920927a | 2,728 | py | Python | benchexec/tablegenerator/test/test_statvalue.py | ahealy19/F-IDE-2016 | 82fd4664fc105174cbe2f1a57e2a099fbf3c81d8 | [
"Apache-2.0"
] | 2 | 2017-10-13T09:16:01.000Z | 2018-01-23T04:03:19.000Z | benchexec/tablegenerator/test/test_statvalue.py | ahealy19/F-IDE-2016 | 82fd4664fc105174cbe2f1a57e2a099fbf3c81d8 | [
"Apache-2.0"
] | null | null | null | benchexec/tablegenerator/test/test_statvalue.py | ahealy19/F-IDE-2016 | 82fd4664fc105174cbe2f1a57e2a099fbf3c81d8 | [
"Apache-2.0"
] | null | null | null | # BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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 Lic... | 34.531646 | 82 | 0.649927 |
3cb4154601f739cf8cf303597db849989ffc10fe | 16,548 | py | Python | test/functional/rpc_packages.py | crptec/sinovate | 345a81f99ec7e624e0ec244a7dbe1ebb3698c347 | [
"MIT"
] | 7 | 2020-11-09T15:10:26.000Z | 2022-03-04T21:55:39.000Z | test/functional/rpc_packages.py | crptec/sinovate | 345a81f99ec7e624e0ec244a7dbe1ebb3698c347 | [
"MIT"
] | 2 | 2021-03-29T01:09:59.000Z | 2021-07-02T04:34:25.000Z | test/functional/rpc_packages.py | crptec/sinovate | 345a81f99ec7e624e0ec244a7dbe1ebb3698c347 | [
"MIT"
] | 2 | 2021-09-05T22:45:02.000Z | 2021-09-08T16:16:40.000Z | #!/usr/bin/env python3
# Copyright (c) 2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""RPCs that handle raw transaction packages."""
from decimal import Decimal
import random
from test_framewor... | 53.209003 | 160 | 0.670957 |
505ce0fa81ac020004fc36c6c103a77d65ee7df7 | 3,664 | py | Python | tinder/login/tinderlogin.py | stanfortonski/Tinder-Bot | a00172974ac209a174f16b4237417265eeacd0fa | [
"MIT"
] | 35 | 2020-05-03T09:28:14.000Z | 2022-03-27T08:21:02.000Z | tinder/login/tinderlogin.py | joshua-classen/Tinder-Bot | 3ff3e1e90d9c58aa8422f398118d24d1570ce548 | [
"MIT"
] | 14 | 2020-11-17T18:43:22.000Z | 2022-01-25T14:47:38.000Z | tinder/login/tinderlogin.py | joshua-classen/Tinder-Bot | 3ff3e1e90d9c58aa8422f398118d24d1570ce548 | [
"MIT"
] | 12 | 2020-08-24T20:19:59.000Z | 2022-01-28T20:28:29.000Z | # Author: Stan Fortoński
# Date: 02.05.2020
# Login To Tinder
from time import sleep
from tinder.config import Config
from tinder.login.googlelogin import GoogleLogin
from tinder.login.facebooklogin import FacebookLogin
from selenium.common.exceptions import NoSuchElementException
class TinderLogin:
def __init__(... | 40.263736 | 147 | 0.570142 |
f2cc715db1ce9b8149561856fd5e309899ffd87b | 2,120 | py | Python | Python/P300speller_visualization_ERP.py | KyunghoWon-GIST/EEG-dataset-for-RSVP-P300-speller | 7c32ceec6f5c38fbff7b76b1f7e8402f89e90139 | [
"MIT"
] | 1 | 2022-01-02T20:29:00.000Z | 2022-01-02T20:29:00.000Z | Python/P300speller_visualization_ERP.py | KyunghoWon-GIST/EEG-dataset-for-RSVP-P300-speller | 7c32ceec6f5c38fbff7b76b1f7e8402f89e90139 | [
"MIT"
] | 1 | 2022-03-16T17:41:30.000Z | 2022-03-18T03:53:15.000Z | Python/P300speller_visualization_ERP.py | KyunghoWon-GIST/EEG-dataset-for-RSVP-P300-speller | 7c32ceec6f5c38fbff7b76b1f7e8402f89e90139 | [
"MIT"
] | 1 | 2022-03-16T17:16:38.000Z | 2022-03-16T17:16:38.000Z | import mat73
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')
from functions.func_filters import butter_bandpass_filter
from functions import func_preproc as preproc
# pre-defined parameters
baseline = [-200, 0] # in ms
frame = [-200, 1000] # in ms
# One need to specify da... | 33.650794 | 92 | 0.728302 |
3a3878288e22bec0c72dab3d62623df64b671c94 | 931 | py | Python | remindMe/venv/lib/python2.7/site-packages/gntp/shim.py | rishigb/bro | 7963f8055b626a0d2c4c616c844c7ffb70d85f0e | [
"MIT"
] | null | null | null | remindMe/venv/lib/python2.7/site-packages/gntp/shim.py | rishigb/bro | 7963f8055b626a0d2c4c616c844c7ffb70d85f0e | [
"MIT"
] | null | null | null | remindMe/venv/lib/python2.7/site-packages/gntp/shim.py | rishigb/bro | 7963f8055b626a0d2c4c616c844c7ffb70d85f0e | [
"MIT"
] | null | null | null | # Copyright: 2013 Paul Traylor
# These sources are released under the terms of the MIT license: see LICENSE
"""
Python2.5 and Python3.3 compatibility shim
Heavily inspirted by the "six" library.
https://pypi.python.org/pypi/six
"""
import sys
PY3 = sys.version_info[0] == 3
if PY3:
def b(s):
if isinstance(s, byt... | 20.23913 | 76 | 0.699248 |
63182c11f5d6fac28d16632ebd78a24bf47db373 | 3,102 | py | Python | graphs_trees/bst/bst_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | graphs_trees/bst/bst_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | graphs_trees/bst/bst_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# # Challenge Notebook
# ## Problem: Implement a binary search tree with an insert method.
#
# *... | 23.323308 | 273 | 0.640554 |
96bf5bb5f1be885a0bd2878ef9884bdf72897754 | 1,157 | py | Python | panzoto/enums.py | yangliu2/panzoto | 86fb0e6ab26a682b360dd45394f894fa03b5d433 | [
"MIT"
] | null | null | null | panzoto/enums.py | yangliu2/panzoto | 86fb0e6ab26a682b360dd45394f894fa03b5d433 | [
"MIT"
] | null | null | null | panzoto/enums.py | yangliu2/panzoto | 86fb0e6ab26a682b360dd45394f894fa03b5d433 | [
"MIT"
] | null | null | null | """ Set up enums to eliminate magic strings """
from enum import Enum, auto
class AutoName(Enum):
def _generate_next_value_(name, start, count, last_values):
"""
the value of the ENUM now become the lower case of the name
:params: left because parent class has them
"""
ret... | 21.036364 | 67 | 0.62057 |
dc61d9242b85d2ea6259d549ed5d7a7f55ecee5e | 1,673 | py | Python | pyModelLearning/ann_model.py | FrancescoRegazzoni/model-learning | 9fdfa0dcb498a197aa88050ce1d323d465fedffd | [
"MIT"
] | 11 | 2019-08-23T15:46:37.000Z | 2021-12-26T05:30:09.000Z | pyModelLearning/ann_model.py | FrancescoRegazzoni/model-learning | 9fdfa0dcb498a197aa88050ce1d323d465fedffd | [
"MIT"
] | null | null | null | pyModelLearning/ann_model.py | FrancescoRegazzoni/model-learning | 9fdfa0dcb498a197aa88050ce1d323d465fedffd | [
"MIT"
] | 5 | 2019-08-24T09:45:53.000Z | 2021-12-26T05:32:48.000Z | import scipy.io as sio
import numpy as np
import configparser
import os
class ANNmodel:
def __init__(self, path, relative = True):
if relative:
config = configparser.ConfigParser()
script_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
print(script_... | 30.418182 | 94 | 0.55529 |
b36baad2b1d819e7f7b4fd857b749b9deffca92e | 1,256 | py | Python | team_9/cocos/test/test_draw.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | 1 | 2019-09-15T18:59:49.000Z | 2019-09-15T18:59:49.000Z | team_9/cocos/test/test_draw.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | null | null | null | team_9/cocos/test/test_draw.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "t 0.1, s, q"
tags = "Canvas, line_to"
import cocos
from cocos.director import... | 24.627451 | 72 | 0.61465 |
0317be0ff1f83af83a6ab2f1b7bebc0ef9bfab6b | 14,398 | py | Python | top2vec/tests/test_top2vec.py | MackieBlackburn/Top2Vec | f65ed58263cce4e4e1c436298dad55a467e5497d | [
"BSD-3-Clause"
] | null | null | null | top2vec/tests/test_top2vec.py | MackieBlackburn/Top2Vec | f65ed58263cce4e4e1c436298dad55a467e5497d | [
"BSD-3-Clause"
] | null | null | null | top2vec/tests/test_top2vec.py | MackieBlackburn/Top2Vec | f65ed58263cce4e4e1c436298dad55a467e5497d | [
"BSD-3-Clause"
] | null | null | null | import pytest
from top2vec import Top2Vec
from sklearn.datasets import fetch_20newsgroups
import numpy as np
# get 20 newsgroups data
newsgroups_train = fetch_20newsgroups(subset='all', remove=('headers', 'footers', 'quotes'))
newsgroups_documents = newsgroups_train.data[0:2000]
# train top2vec model without doc_ids ... | 43.762918 | 120 | 0.708501 |
8e44a548dc6db70aed1025b275bd709a3b2a9280 | 11,506 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ipv4_bgp_datatypes.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 177 | 2016-03-15T17:03:51.000Z | 2022-03-18T16:48:44.000Z | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ipv4_bgp_datatypes.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 18 | 2016-03-30T10:45:22.000Z | 2020-07-14T16:28:13.000Z | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ipv4_bgp_datatypes.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 85 | 2016-03-16T20:38:57.000Z | 2022-02-22T04:26:02.000Z | """ Cisco_IOS_XR_ipv4_bgp_datatypes
This module contains a collection of generally useful
derived YANG data types.
Copyright (c) 2013\-2018 by Cisco Systems, Inc.
All rights reserved.
"""
import sys
from collections import OrderedDict
from ydk.types import Entity as _Entity_
from ydk.types import EntityPath, Ident... | 16.920588 | 126 | 0.61255 |
2a06ea33df7e56b19e945e0a187b5245f9f383f3 | 441 | py | Python | survae/tests/transforms/bijections/__init__.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 262 | 2020-07-05T20:57:44.000Z | 2022-03-28T02:24:43.000Z | survae/tests/transforms/bijections/__init__.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 17 | 2020-08-15T05:43:34.000Z | 2022-01-31T12:24:21.000Z | survae/tests/transforms/bijections/__init__.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 35 | 2020-08-24T06:55:37.000Z | 2022-02-11T05:17:58.000Z | from .base import BijectionTest
from .affine import *
from .elementwise_nonlinear import *
from .squeeze import *
from .unsqueeze import *
from .reshape import *
from .rotate import *
from .permute import *
from .permute_axes import *
from .linear import *
from .linear_lu import *
from .conv1x1 import *
from .actn... | 17.64 | 36 | 0.755102 |
dc0732ed3e744a0559ff73677e586e6efa738a5a | 3,481 | py | Python | proteus/tests/SWFlows/dam3Bumps.py | dloney/proteus | 615cdf57f765b2e99bac904bb6eb71e39e58ab56 | [
"MIT"
] | null | null | null | proteus/tests/SWFlows/dam3Bumps.py | dloney/proteus | 615cdf57f765b2e99bac904bb6eb71e39e58ab56 | [
"MIT"
] | null | null | null | proteus/tests/SWFlows/dam3Bumps.py | dloney/proteus | 615cdf57f765b2e99bac904bb6eb71e39e58ab56 | [
"MIT"
] | null | null | null | from __future__ import division
from builtins import object
from past.utils import old_div
from proteus import *
from proteus.default_p import *
from proteus.mprans import SW2D
from proteus.mprans import SW2DCV
from proteus.Domain import RectangularDomain
import numpy as np
from proteus import (Domain, Context,
... | 33.796117 | 87 | 0.510773 |
9416fc3d3a9e08c2521c043347e4d395266232a3 | 17,744 | py | Python | cime/scripts/lib/CIME/XML/namelist_definition.py | cbeall123/E3SM | ec32b40d549b292f14acd11e6774686564539d3c | [
"FTL",
"zlib-acknowledgement",
"RSA-MD"
] | 1 | 2020-08-28T14:57:15.000Z | 2020-08-28T14:57:15.000Z | cime/scripts/lib/CIME/XML/namelist_definition.py | cbeall123/E3SM | ec32b40d549b292f14acd11e6774686564539d3c | [
"FTL",
"zlib-acknowledgement",
"RSA-MD"
] | null | null | null | cime/scripts/lib/CIME/XML/namelist_definition.py | cbeall123/E3SM | ec32b40d549b292f14acd11e6774686564539d3c | [
"FTL",
"zlib-acknowledgement",
"RSA-MD"
] | 1 | 2021-03-11T23:20:58.000Z | 2021-03-11T23:20:58.000Z | """Interface to `namelist_definition.xml`.
This module contains only one class, `NamelistDefinition`, inheriting from
`EntryID`.
"""
# Warnings we typically ignore.
# pylint:disable=invalid-name
# Disable warnings due to using `standard_module_setup`
# pylint:disable=wildcard-import,unused-wildcard-import
import re... | 43.278049 | 181 | 0.615983 |
6fb1371356c64624d9eb72c40f1fdde0457a0804 | 12,802 | py | Python | dygraph/models/architectures/resnet_vd.py | pennypm/PaddleSeg | 6de94868f246d2fa21de2b94d3f01063b16e5fef | [
"Apache-2.0"
] | null | null | null | dygraph/models/architectures/resnet_vd.py | pennypm/PaddleSeg | 6de94868f246d2fa21de2b94d3f01063b16e5fef | [
"Apache-2.0"
] | null | null | null | dygraph/models/architectures/resnet_vd.py | pennypm/PaddleSeg | 6de94868f246d2fa21de2b94d3f01063b16e5fef | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.689474 | 107 | 0.51492 |
0fe8e057876abaea43cbd4075c98e9a6a64578f8 | 868 | py | Python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 29.931034 | 76 | 0.562212 |
8b7543a99299ce1c8553e1de22162d00c3a7a913 | 51,276 | py | Python | redun/tests/test_aws_batch.py | dakoner/redun | 3e1003cfe8e2bcee435aa6f4aa5bf42ee1d162d0 | [
"Apache-2.0"
] | null | null | null | redun/tests/test_aws_batch.py | dakoner/redun | 3e1003cfe8e2bcee435aa6f4aa5bf42ee1d162d0 | [
"Apache-2.0"
] | null | null | null | redun/tests/test_aws_batch.py | dakoner/redun | 3e1003cfe8e2bcee435aa6f4aa5bf42ee1d162d0 | [
"Apache-2.0"
] | null | null | null | import json
import os
import pickle
import uuid
from typing import cast
from unittest.mock import Mock, patch
import boto3
import pytest
from freezegun import freeze_time
from moto import mock_logs, mock_s3
import redun.executors.aws_batch
from redun import File, job_array, task
from redun.cli import RedunClient, imp... | 30.503272 | 99 | 0.638037 |
b778e43a7e9b8bbdf12b9209a4906e1acf682742 | 200 | py | Python | server/contests/status/resolvers.py | jauhararifin/ugrade | c5bc0ce3920534cf289c739ffe8b83ceed9f52e8 | [
"MIT"
] | 15 | 2019-02-27T19:28:23.000Z | 2019-07-20T17:54:46.000Z | server/contests/status/resolvers.py | jauhararifin/ugrade | c5bc0ce3920534cf289c739ffe8b83ceed9f52e8 | [
"MIT"
] | 9 | 2020-09-04T18:30:56.000Z | 2022-03-25T18:41:11.000Z | server/contests/status/resolvers.py | jauhararifin/ugrade | c5bc0ce3920534cf289c739ffe8b83ceed9f52e8 | [
"MIT"
] | 2 | 2019-03-29T14:15:47.000Z | 2019-04-12T06:08:11.000Z | import datetime
from django.utils import timezone
def ping_resolver(_root, _info) -> str:
return 'pong'
def server_clock_resolver(_root, _info) -> datetime.datetime:
return timezone.now()
| 18.181818 | 61 | 0.745 |
b13f3af9875b6245f287bfb9107fde67872937f8 | 2,217 | py | Python | venv/lib/python2.7/site-packages/plotnine/geoms/geom_rect.py | nuriale207/preprocesspack | cc06a9cb79c5e3b392371fcd8d1ccf7185e71821 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/plotnine/geoms/geom_rect.py | nuriale207/preprocesspack | cc06a9cb79c5e3b392371fcd8d1ccf7185e71821 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/plotnine/geoms/geom_rect.py | nuriale207/preprocesspack | cc06a9cb79c5e3b392371fcd8d1ccf7185e71821 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.collections import PolyCollection
from six.moves import zip
import numpy as np
from ..utils import to_rgba, SIZE_FACTOR
from ..doctools import document
from .geom import geom
@document
class ... | 29.959459 | 66 | 0.567433 |
4a4e611f4de240a3b0d72c33da579ddaebe811f8 | 1,280 | py | Python | mimiron/schemas/config.py | Nirovision/mimiron | adba1e762b1ae272c833f1843b179f3438f20774 | [
"MIT"
] | 3 | 2017-02-26T20:34:22.000Z | 2017-02-26T23:28:28.000Z | mimiron/schemas/config.py | Nirovision/mimiron | adba1e762b1ae272c833f1843b179f3438f20774 | [
"MIT"
] | null | null | null | mimiron/schemas/config.py | Nirovision/mimiron | adba1e762b1ae272c833f1843b179f3438f20774 | [
"MIT"
] | 1 | 2017-02-27T00:15:12.000Z | 2017-02-27T00:15:12.000Z | # -*- coding: utf-8 -*-
config_schema = {
'type': 'object',
'properties': {
'terraformRepositories': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'path': {
'type': 'string',
... | 28.444444 | 65 | 0.302344 |
9be3bc32913944d16f3eca7bc8df77a5201187d5 | 811 | py | Python | insta/urls.py | shureim/Instagram-Website | 4713fd1a0d0463c416a31e0105d9646d2393c402 | [
"MIT"
] | null | null | null | insta/urls.py | shureim/Instagram-Website | 4713fd1a0d0463c416a31e0105d9646d2393c402 | [
"MIT"
] | null | null | null | insta/urls.py | shureim/Instagram-Website | 4713fd1a0d0463c416a31e0105d9646d2393c402 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$',views.today,name='instaToday'),
url(r'^no_profile/$',views.welcome,name = 'welcome'),
url(r'^image/(\d+)',views.image,name ='image'),
url(r'^new/image... | 42.684211 | 81 | 0.70037 |
7627e0ce06553b025ba4598b4272f64b38a1d5af | 9,208 | py | Python | tests/commands/test_string.py | dynalz/coredis | 54c95a323897a9742bf30ceff67141d9a1cfc97a | [
"MIT"
] | null | null | null | tests/commands/test_string.py | dynalz/coredis | 54c95a323897a9742bf30ceff67141d9a1cfc97a | [
"MIT"
] | null | null | null | tests/commands/test_string.py | dynalz/coredis | 54c95a323897a9742bf30ceff67141d9a1cfc97a | [
"MIT"
] | null | null | null | import datetime
import pytest
from coredis.utils import b, iteritems
from tests.conftest import targets
@targets("redis_basic", "redis_cluster")
@pytest.mark.asyncio()
class TestString:
async def test_append(self, client):
assert await client.append("a", "a1") == 2
assert await client.get("a") =... | 38.366667 | 85 | 0.563315 |
52543e522186663753e5be303e892d6d52952ec2 | 395 | py | Python | motif/main.py | clarkedb/motif | 9c882a2cd7958ccb9e8a0db26ee25e3f3b5673f4 | [
"MIT"
] | null | null | null | motif/main.py | clarkedb/motif | 9c882a2cd7958ccb9e8a0db26ee25e3f3b5673f4 | [
"MIT"
] | null | null | null | motif/main.py | clarkedb/motif | 9c882a2cd7958ccb9e8a0db26ee25e3f3b5673f4 | [
"MIT"
] | null | null | null | # motif main
from data import genre_dataframe, generate_genre_dataframe
from features import FeatureProcessor
from os import path
if __name__ == '__main__':
if not path.exists("../data/genres.csv"):
generate_genre_dataframe()
df = genre_dataframe()
fp = FeatureProcessor()
features_df = fp.pr... | 24.6875 | 61 | 0.718987 |
ecf82c97a675d2ad1fa7e58aecedc9e034141071 | 2,805 | py | Python | webedit/generic.py | callowayproject/django-webedit | 4fb81a28c4eab752820b5fafbafb7ba5f3fdd5ec | [
"Apache-2.0"
] | 1 | 2020-02-15T08:08:31.000Z | 2020-02-15T08:08:31.000Z | webedit/generic.py | callowayproject/django-webedit | 4fb81a28c4eab752820b5fafbafb7ba5f3fdd5ec | [
"Apache-2.0"
] | null | null | null | webedit/generic.py | callowayproject/django-webedit | 4fb81a28c4eab752820b5fafbafb7ba5f3fdd5ec | [
"Apache-2.0"
] | null | null | null |
class BaseApi(object):
"""
Handles all the methods
"""
parent_model = None
model = None
field_map = {
'author': 'author',
'author_id': 'author_id',
'status': 'status',
'id': 'id',
'permalink': 'permalink',
'categories': 'categories',
... | 23.771186 | 79 | 0.490196 |
c173c208882b60605988917d69398587a362d5ab | 2,265 | py | Python | logbook/urls.py | DistrictDataLabs/logbook | 7cea37f3516d1ef47c8869388a0691cd89ae988c | [
"Apache-2.0"
] | 4 | 2015-11-11T23:56:32.000Z | 2019-07-14T03:35:40.000Z | logbook/urls.py | DistrictDataLabs/logbook | 7cea37f3516d1ef47c8869388a0691cd89ae988c | [
"Apache-2.0"
] | 30 | 2015-04-02T13:04:00.000Z | 2016-06-23T15:22:19.000Z | logbook/urls.py | DistrictDataLabs/logbook | 7cea37f3516d1ef47c8869388a0691cd89ae988c | [
"Apache-2.0"
] | 2 | 2015-04-02T03:08:00.000Z | 2020-03-04T00:38:04.000Z | # logbook.urls
# Application url definition and routers.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Fri Aug 21 13:21:31 2015 -0500
#
# Copyright (C) 2015 District Data Labs
# For license information, see LICENSE.txt
#
# ID: urls.py [] benjamin@bengfort.com $
"""
Application url defini... | 33.80597 | 102 | 0.556291 |
b2cc97fa31cc75826f6fd8352c386d007ff2b06b | 6,284 | py | Python | momentumnet/trainer_CIFAR_10.py | peerdavid/momentumnet | 6343d7be4963e80e5e7401d85f92ef01153549f7 | [
"MIT"
] | null | null | null | momentumnet/trainer_CIFAR_10.py | peerdavid/momentumnet | 6343d7be4963e80e5e7401d85f92ef01153549f7 | [
"MIT"
] | null | null | null | momentumnet/trainer_CIFAR_10.py | peerdavid/momentumnet | 6343d7be4963e80e5e7401d85f92ef01153549f7 | [
"MIT"
] | null | null | null | # Authors: Michael Sander, Pierre Ablin
# License: MIT
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import torchvision
import torchvision.transforms as transforms
import os
import tqdm
import time
from .models import (
ResNet101,
mResNet101,
ResNet18,
mResNet18,
... | 29.227907 | 79 | 0.555538 |
3e721c6e2c8468fc074c6847c2e35f36038b2831 | 27 | py | Python | tools/__init__.py | NotJoeMartinez/python3-groupme-tools | 19cb96f6bb00225dc2654b764b74f48cd9ba514a | [
"MIT"
] | 5 | 2021-03-20T01:38:58.000Z | 2022-03-16T11:43:36.000Z | tools/__init__.py | NotJoeMartinez/python3-groupme-tools | 19cb96f6bb00225dc2654b764b74f48cd9ba514a | [
"MIT"
] | 6 | 2021-02-22T08:46:34.000Z | 2022-03-11T20:08:37.000Z | tools/__init__.py | NotJoeMartinez/python3-groupme-tools | 19cb96f6bb00225dc2654b764b74f48cd9ba514a | [
"MIT"
] | null | null | null | from .avatar_fetch import * | 27 | 27 | 0.814815 |
667660e11742aeb44ee3a5524bb15b8ef25b803b | 154 | py | Python | tests/test_Alert.py | Felix-Pi/huepyapi | 020fbe531ab8000278ca88b2abce30325b6d9394 | [
"MIT"
] | null | null | null | tests/test_Alert.py | Felix-Pi/huepyapi | 020fbe531ab8000278ca88b2abce30325b6d9394 | [
"MIT"
] | null | null | null | tests/test_Alert.py | Felix-Pi/huepyapi | 020fbe531ab8000278ca88b2abce30325b6d9394 | [
"MIT"
] | null | null | null | from unittest import TestCase
from huePyApi.enums.Alert import *
class TestAlert(TestCase):
def test_enum(self):
print(Alert.LSELECT.value)
| 19.25 | 34 | 0.74026 |
e6b22f859f7f732b5b7d92197cb937b8b2c5e5f5 | 3,131 | py | Python | news/settings.py | siddharth25pandey/news-fetcher | 7bd627e43fa1dee8a98fce1b27a6216dc5854067 | [
"MIT"
] | null | null | null | news/settings.py | siddharth25pandey/news-fetcher | 7bd627e43fa1dee8a98fce1b27a6216dc5854067 | [
"MIT"
] | null | null | null | news/settings.py | siddharth25pandey/news-fetcher | 7bd627e43fa1dee8a98fce1b27a6216dc5854067 | [
"MIT"
] | null | null | null | """
Django settings for news project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Bu... | 25.663934 | 91 | 0.696583 |
354e5bbc48cecafcb8bebb3607b2f66958d9bcb6 | 1,709 | py | Python | src/matching/src/base/mentor.py | njounkengdaizem/UCMigrantFinder | ddbeee0595a60ceceb392b12641933d6d4a77711 | [
"MIT"
] | null | null | null | src/matching/src/base/mentor.py | njounkengdaizem/UCMigrantFinder | ddbeee0595a60ceceb392b12641933d6d4a77711 | [
"MIT"
] | null | null | null | src/matching/src/base/mentor.py | njounkengdaizem/UCMigrantFinder | ddbeee0595a60ceceb392b12641933d6d4a77711 | [
"MIT"
] | null | null | null | """
Module for mentors with certain parameters to find
their ideal mentees as they come into the country
"""
from typing import List
from .user import User
from .migrant import Migrant
class Mentor(User):
"""
Class for a mentor object.
"""
def __init__(self):
"""
Initiates the class for a Mentors
"""
sup... | 24.070423 | 58 | 0.700995 |
fe6b0f1d7626fbd6e4b2f1d25ca1233a00ea1bc2 | 1,308 | py | Python | scripts/make_sheet_from_all_pairs.py | sdomanskyi/decneo | c3b78d7cb24fbecde317850ea5068394029a7d03 | [
"MIT"
] | null | null | null | scripts/make_sheet_from_all_pairs.py | sdomanskyi/decneo | c3b78d7cb24fbecde317850ea5068394029a7d03 | [
"MIT"
] | null | null | null | scripts/make_sheet_from_all_pairs.py | sdomanskyi/decneo | c3b78d7cb24fbecde317850ea5068394029a7d03 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import sys
arg_list = sys.argv
lig = arg_list[1]
rec = arg_list[2]
end = '.h5.xlsx'
fname = 'v3_allpairs_0.0_choroid_'+lig+'_'+rec+end
data = pd.read_excel(fname)
f_comps = fname.split('_')
version = f_comps[0]
cutoff = f_comps[2]
ct1 = f_comps[4]
ct2 = f_comp... | 28.434783 | 113 | 0.626147 |
1e5fb06344ef001f12dcc9ed21103556fd11a0e8 | 2,032 | py | Python | AuthServer/method.py | CryptoCompetition2019-RNG/AuthServer | c22e2b13af2cc51f62fdc55e3f682eb344d4fbcb | [
"Apache-2.0"
] | null | null | null | AuthServer/method.py | CryptoCompetition2019-RNG/AuthServer | c22e2b13af2cc51f62fdc55e3f682eb344d4fbcb | [
"Apache-2.0"
] | 10 | 2020-06-05T23:28:04.000Z | 2022-03-12T00:02:52.000Z | AuthServer/method.py | CryptoCompetition2019-RNG/AuthServer | c22e2b13af2cc51f62fdc55e3f682eb344d4fbcb | [
"Apache-2.0"
] | null | null | null | from django.http import JsonResponse
def json_response_zh(json_data):
"""
因为返回含中文的 Json 数据总是需要设置 {'ensure_ascii': False},所以直接在此集成
:param json_data: 需要返回的数据
"""
import json
return JsonResponse(json_data, json_dumps_params={'ensure_ascii': False})
def get_json_ret(code, msg=None, err=None, dat... | 32.253968 | 99 | 0.610728 |
3680cbb70634d726f5d9e700af963bf8aa00fe25 | 4,903 | py | Python | certcheck.py | nfwstg/certcheck | 774094123760c7e016ba4bdeead4f98ad12b81f6 | [
"MIT"
] | null | null | null | certcheck.py | nfwstg/certcheck | 774094123760c7e016ba4bdeead4f98ad12b81f6 | [
"MIT"
] | null | null | null | certcheck.py | nfwstg/certcheck | 774094123760c7e016ba4bdeead4f98ad12b81f6 | [
"MIT"
] | null | null | null | from apistblz import downloadonce
from apistblz import wait_and_retry
from cryptography import x509
import requests
import socket
import subprocess
import re
class FQDNInfo:
def __init__(self, fqdn_str):
self.fqdn_str = fqdn_str
self.ip = self._check_dns(self.fqdn_str)
(self.origin, self.d... | 30.079755 | 77 | 0.561901 |
b128bd42efa16c9999a3fa39f9d45bc5e9aca2eb | 1,615 | py | Python | hstpl/localize.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 2 | 2015-07-19T02:55:06.000Z | 2021-07-07T02:38:26.000Z | hstpl/localize.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 5 | 2017-03-11T16:30:26.000Z | 2021-04-10T16:42:10.000Z | hstpl/localize.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 10 | 2015-07-19T03:05:42.000Z | 2021-08-24T14:48:59.000Z | from __future__ import print_function, division
import sys
from os.path import expanduser, join, exists
# Localize hessian affine code
code_dir = join(expanduser('~'), 'code')
hsdir = join(code_dir, 'hotspotter')
if not exists(hsdir):
# For advisors computer
code_dir = join(expanduser('~'), 'Code-RPI')
... | 31.666667 | 78 | 0.647678 |
2d89b5a42dbd6324cff08e101af5f0a22e7bc09a | 8,995 | py | Python | EventEncoder/make_sample.py | neohanju/GarbageDumpingDetection | e5c1be44ef79445449a2d6b01c557035d864f3bd | [
"BSD-2-Clause"
] | null | null | null | EventEncoder/make_sample.py | neohanju/GarbageDumpingDetection | e5c1be44ef79445449a2d6b01c557035d864f3bd | [
"BSD-2-Clause"
] | null | null | null | EventEncoder/make_sample.py | neohanju/GarbageDumpingDetection | e5c1be44ef79445449a2d6b01c557035d864f3bd | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import random
import json
import os
import copy
import progressbar
params = {'step': 10, # step은 한번 sample을 뽑고 몇 frame 이동 후에 뽑을지 결정합니다.
'interval': 30, # interval은 sample을 최대 몇 frame 연속으로 이어 붙일지를 결정합니다.
'threshold': 30, # sample을 만들 때 투기 pose가 threshold값 이상이라면 sample도 투... | 36.417004 | 117 | 0.534853 |
a75a78f9a898eb43cb3815d91d10e7ac63f5fe5d | 227 | py | Python | akdsite.py | chesterlbtan/AKD-Flask | 8a94b56d194544d34a16cd0f0803684bd0a6a1cd | [
"MIT"
] | 1 | 2019-03-25T00:58:59.000Z | 2019-03-25T00:58:59.000Z | akdsite.py | chesterlbtan/AKD-Flask | 8a94b56d194544d34a16cd0f0803684bd0a6a1cd | [
"MIT"
] | null | null | null | akdsite.py | chesterlbtan/AKD-Flask | 8a94b56d194544d34a16cd0f0803684bd0a6a1cd | [
"MIT"
] | null | null | null | from webapp import app, db
from webapp.models import Watchables, Status, Episodes
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'Watchables': Watchables, 'Status': Status, 'Episodes': Episodes}
| 28.375 | 87 | 0.757709 |
695d72dfe43dee0d62a678b0fb388f484747d00b | 567 | py | Python | ultra/learning_algorithm/__init__.py | phyllist/ULTRA | a4ca36b2f55b33f88f646390ee7fabac28df6986 | [
"Apache-2.0"
] | 2 | 2021-12-07T08:43:19.000Z | 2022-02-21T18:34:07.000Z | ultra/learning_algorithm/__init__.py | phyllist/ULTRA | a4ca36b2f55b33f88f646390ee7fabac28df6986 | [
"Apache-2.0"
] | null | null | null | ultra/learning_algorithm/__init__.py | phyllist/ULTRA | a4ca36b2f55b33f88f646390ee7fabac28df6986 | [
"Apache-2.0"
] | null | null | null | # note:
from __future__ import absolute_import
from .base_algorithm import *
from .dla import *
from .ipw_rank import *
from .regression_EM import *
from .pdgd import *
from .dbgd import *
from .pairwise_debias import *
from .navie_algorithm import *
from .navie_mtl_algorithm import *
from .mgd import *
from .nsgd impo... | 28.35 | 72 | 0.793651 |
78ff7157ebf831f4351783efeddf71302c4a7c60 | 5,222 | py | Python | pydsm/NTFdesign/tests/test_NTFdesign_hybrid.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pydsm/NTFdesign/tests/test_NTFdesign_hybrid.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pydsm/NTFdesign/tests/test_NTFdesign_hybrid.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2012, Sergio Callegari
# All rights reserved.
# This file is part of PyDSM.
# PyDSM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | 40.169231 | 76 | 0.514745 |
461fe5d8a9cc2bb21c09dab77cc46f3c1c50b0a4 | 12,578 | py | Python | cdbifunc.py | toddn1704/Client_Database | 523426e9f80b062ea39b1317a00eac8e2c576676 | [
"MIT"
] | null | null | null | cdbifunc.py | toddn1704/Client_Database | 523426e9f80b062ea39b1317a00eac8e2c576676 | [
"MIT"
] | null | null | null | cdbifunc.py | toddn1704/Client_Database | 523426e9f80b062ea39b1317a00eac8e2c576676 | [
"MIT"
] | null | null | null | """cdbifunc.py
Developer: Noelle Todd
Last Updated: September 12, 2014
This module holds all functions that will be called directly by the user
interface. This module uses several functions in cdbfunctions.py; the two
modules have been split to make designing the user interface as simple as
simple as possible.
"""
i... | 30.16307 | 83 | 0.717046 |
5797276874f26f8ba600bd64bd74cdc36e4ea0f8 | 802 | py | Python | .scripts/mp3numberify.py | GreenBlast/dotfiles | 12de7c9e5d8eda0a7f314ed6d19974e7ea549116 | [
"MIT"
] | 2 | 2018-08-08T12:39:10.000Z | 2019-03-19T13:24:15.000Z | .scripts/mp3numberify.py | GreenBlast/dotfiles | 12de7c9e5d8eda0a7f314ed6d19974e7ea549116 | [
"MIT"
] | null | null | null | .scripts/mp3numberify.py | GreenBlast/dotfiles | 12de7c9e5d8eda0a7f314ed6d19974e7ea549116 | [
"MIT"
] | null | null | null | """
File: mp3numberify.py
Author: Greenblast
Github: https://github.com/Greenblast
Description: Numberifying mp3 files in a given path
"""
import os
import sys
from mutagen.mp3 import EasyMP3
ARGS_COUNT = 2
def organize(path):
for f in os.listdir(path):
if f.endswith("mp3"):
a = EasyMP3(os.pa... | 21.105263 | 84 | 0.609726 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.