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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b7344a88989773ec2509c191ad4c18a55af38cab | 718 | py | Python | rest_base/utils/token.py | devluci/django-rest-base | c934cb0b80156d5ad6ea415834acfefbf404a47a | [
"MIT"
] | 1 | 2019-11-12T04:01:52.000Z | 2019-11-12T04:01:52.000Z | rest_base/utils/token.py | devluci/django-rest-base | c934cb0b80156d5ad6ea415834acfefbf404a47a | [
"MIT"
] | null | null | null | rest_base/utils/token.py | devluci/django-rest-base | c934cb0b80156d5ad6ea415834acfefbf404a47a | [
"MIT"
] | null | null | null | from django.core.cache import cache
from django.utils import timezone
__all__ = ['is_cache_token_left']
def is_cache_token_left(token_id: str, token_max_cnt: int, token_duration: timezone.timedelta) -> bool:
token = cache.get(token_id)
if token is None:
token_cnt = token_max_cnt
token_cooldow... | 28.72 | 103 | 0.68663 |
44f2527a43cd257763c1b594a38a41591bd7bc01 | 6,691 | py | Python | garaged/tests/garage/tf/algos/test_trpo.py | artberryx/LSD | 99ee081de2502b4d13c140b474f772db8a5f92fe | [
"MIT"
] | 7 | 2022-02-01T03:02:24.000Z | 2022-02-10T12:54:05.000Z | garaged/tests/garage/tf/algos/test_trpo.py | artberryx/LSD | 99ee081de2502b4d13c140b474f772db8a5f92fe | [
"MIT"
] | null | null | null | garaged/tests/garage/tf/algos/test_trpo.py | artberryx/LSD | 99ee081de2502b4d13c140b474f772db8a5f92fe | [
"MIT"
] | 2 | 2022-02-03T03:33:25.000Z | 2022-02-10T12:54:07.000Z | """
This script creates a test that fails when garage.tf.algos.TRPO performance is
too low.
"""
import gym
import pytest
import tensorflow as tf
from garage.envs import GarageEnv, normalize
from garage.experiment import deterministic
from garage.experiment import LocalTFRunner
from garage.experiment import snapshotter... | 37.589888 | 79 | 0.557166 |
86c2f6460b9550c02fd49670586f062a28b7ba3f | 9,140 | py | Python | tests/unit/test_config_manager.py | ajwelch4/professional-services-data-validator | 5c084633708b13f7eb4b505749dd52d0f43617cc | [
"Apache-2.0"
] | null | null | null | tests/unit/test_config_manager.py | ajwelch4/professional-services-data-validator | 5c084633708b13f7eb4b505749dd52d0f43617cc | [
"Apache-2.0"
] | null | null | null | tests/unit/test_config_manager.py | ajwelch4/professional-services-data-validator | 5c084633708b13f7eb4b505749dd52d0f43617cc | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.642857 | 89 | 0.722648 |
40c4d46d6a647167a21e2edda1269d0dcd1de66e | 556 | py | Python | users/views/employees.py | thehimel/django-multi-user-types-bs | 621763c4a67ed89fac7117d9d4440f1963e5e747 | [
"CC0-1.0"
] | null | null | null | users/views/employees.py | thehimel/django-multi-user-types-bs | 621763c4a67ed89fac7117d9d4440f1963e5e747 | [
"CC0-1.0"
] | null | null | null | users/views/employees.py | thehimel/django-multi-user-types-bs | 621763c4a67ed89fac7117d9d4440f1963e5e747 | [
"CC0-1.0"
] | null | null | null | from allauth.account.views import SignupView
from users.forms.employees import EmployeeSignupForm
# Employee Signup View
class EmployeeSignupView(SignupView):
template_name = 'users/signup.html' # Custom template is mandatory
form_class = EmployeeSignupForm
redirect_field_name = 'next' # Important to r... | 32.705882 | 78 | 0.742806 |
a6dfd89e45a137cbbfb7a55667c998f3b218501f | 7,495 | py | Python | homeassistant/components/sensor/glances.py | sara0871/laughing--barnacle- | 70412fc0ba42ccfe446c0c62e327eceeda56a2ab | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | homeassistant/components/sensor/glances.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2021-09-08T03:06:43.000Z | 2022-03-12T00:56:04.000Z | homeassistant/components/sensor/glances.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2018-12-04T11:54:27.000Z | 2019-08-31T14:41:32.000Z | """
Support gathering system information of hosts which are running glances.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.glances/
"""
import logging
from datetime import timedelta
import requests
import voluptuous as vol
import homeassistant.... | 38.239796 | 78 | 0.573983 |
bb8debf0799e87acb594de0faa37bceb82f08021 | 2,513 | py | Python | fhir/resources/tests/test_enrollmentrequest.py | mmabey/fhir.resources | cc73718e9762c04726cd7de240c8f2dd5313cbe1 | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/tests/test_enrollmentrequest.py | mmabey/fhir.resources | cc73718e9762c04726cd7de240c8f2dd5313cbe1 | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/tests/test_enrollmentrequest.py | mmabey/fhir.resources | cc73718e9762c04726cd7de240c8f2dd5313cbe1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import enrollmentrequest
from ..fhirdate import FHIRDate... | 36.955882 | 118 | 0.669717 |
d5fe9533b409803eadb16db46442c6d04722e9fc | 645 | py | Python | Business/bustemplate/migrations/0001_initial.py | Kshashank9/Business-Topology-Website | 17d0c5ccabb17c52b6162e147640275de32e5169 | [
"MIT"
] | null | null | null | Business/bustemplate/migrations/0001_initial.py | Kshashank9/Business-Topology-Website | 17d0c5ccabb17c52b6162e147640275de32e5169 | [
"MIT"
] | null | null | null | Business/bustemplate/migrations/0001_initial.py | Kshashank9/Business-Topology-Website | 17d0c5ccabb17c52b6162e147640275de32e5169 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-06 13:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='courses',
fields=[
('id', models.AutoField(... | 25.8 | 114 | 0.548837 |
808582e819e7cae78c1334e776b01e6973351858 | 26,642 | py | Python | src/transformers/trainer_tf.py | antisrdy/transformers | 603cd81a01003e1d2be9357f4e517d1686df017f | [
"Apache-2.0"
] | 2 | 2020-10-19T16:40:47.000Z | 2021-11-11T06:39:08.000Z | src/transformers/trainer_tf.py | antisrdy/transformers | 603cd81a01003e1d2be9357f4e517d1686df017f | [
"Apache-2.0"
] | null | null | null | src/transformers/trainer_tf.py | antisrdy/transformers | 603cd81a01003e1d2be9357f4e517d1686df017f | [
"Apache-2.0"
] | 1 | 2020-10-19T16:41:00.000Z | 2020-10-19T16:41:00.000Z | """Tensorflow trainer class."""
import datetime
import logging
import math
import os
import sys
import warnings
from typing import Callable, Dict, Optional, Tuple
import numpy as np
import tensorflow as tf
from packaging.version import parse
from .modeling_tf_utils import TFPreTrainedModel
from .optimization_tf impo... | 41.563183 | 146 | 0.618122 |
fa14e7f5897b9b0717744dcd31075cf946191d43 | 51 | py | Python | crabageprediction/venv/Lib/site-packages/mpl_toolkits/axes_grid/angle_helper.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | venv/lib/python3.7/site-packages/mpl_toolkits/axes_grid/angle_helper.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | venv/lib/python3.7/site-packages/mpl_toolkits/axes_grid/angle_helper.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | from mpl_toolkits.axisartist.angle_helper import *
| 25.5 | 50 | 0.862745 |
62e0c442a34660f23bf4ac8dd5f3ceed5f0581b3 | 2,229 | py | Python | django_utils/settings/logging.py | 4teamwork/django-utils | d0d589c512d11d4c82bb63a849a66de83cfa2a4f | [
"MIT"
] | 1 | 2021-11-18T14:02:08.000Z | 2021-11-18T14:02:08.000Z | django_utils/settings/logging.py | 4teamwork/django-utils | d0d589c512d11d4c82bb63a849a66de83cfa2a4f | [
"MIT"
] | 3 | 2021-01-26T19:04:15.000Z | 2022-01-21T09:23:21.000Z | django_utils/settings/logging.py | 4teamwork/django-utils | d0d589c512d11d4c82bb63a849a66de83cfa2a4f | [
"MIT"
] | null | null | null | import sys
from configurations import values
class LogMixin:
"""
This mixins contains the logging configuration of our Django based
web applications. Its default values are suited for production.
"""
LOGGING_LEVEL = values.Value("WARNING")
LOGGING_HANDLERS = values.ListValue(["stream"])
... | 30.534247 | 83 | 0.425303 |
37df9170e616deb808cc72f81887e04597938940 | 317 | py | Python | test.py | pbatey/flask-staticdirs | 294d68d7ca49d3dc9111026e4fa88a24ea0d1465 | [
"MIT"
] | null | null | null | test.py | pbatey/flask-staticdirs | 294d68d7ca49d3dc9111026e4fa88a24ea0d1465 | [
"MIT"
] | null | null | null | test.py | pbatey/flask-staticdirs | 294d68d7ca49d3dc9111026e4fa88a24ea0d1465 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.dirname(__file__)) # allow modules in subdirectories to be imported
from flask import Flask
from flask_staticdirs import staticdirs
app = Flask(__name__)
app.register_blueprint(staticdirs("public"), url_prefix="/")
if __name__ == '__main__':
app.run(debug=True)
| 24.384615 | 94 | 0.769716 |
14545eb0c652c6ddca73fea615cd63767fa4252a | 366 | py | Python | coreir/global_value.py | rswarbrick/pycoreir | 855d18eab067d27aad4d4bc11f486fbf43c04f08 | [
"BSD-3-Clause"
] | null | null | null | coreir/global_value.py | rswarbrick/pycoreir | 855d18eab067d27aad4d4bc11f486fbf43c04f08 | [
"BSD-3-Clause"
] | null | null | null | coreir/global_value.py | rswarbrick/pycoreir | 855d18eab067d27aad4d4bc11f486fbf43c04f08 | [
"BSD-3-Clause"
] | null | null | null | from .base import CoreIRType
import ctypes as ct
import coreir
from .lib import libcoreir_c
class COREGlobalValue(ct.Structure):
pass
COREGlobalValue_p = ct.POINTER(COREGlobalValue)
class GlobalValue(CoreIRType):
@property
def namespace(self):
return coreir.namespace.Namespace(libcoreir_c.COREGlo... | 24.4 | 106 | 0.786885 |
e863075a3033187516cf3c5e6717b4485bf8c4c3 | 953 | py | Python | leetcode/1252_cells-with-odd-values-in-a-matrix.py | heyf/cloaked-octo-adventure | 8180684a8a1859efb836edd48556b5f3088be398 | [
"MIT"
] | null | null | null | leetcode/1252_cells-with-odd-values-in-a-matrix.py | heyf/cloaked-octo-adventure | 8180684a8a1859efb836edd48556b5f3088be398 | [
"MIT"
] | null | null | null | leetcode/1252_cells-with-odd-values-in-a-matrix.py | heyf/cloaked-octo-adventure | 8180684a8a1859efb836edd48556b5f3088be398 | [
"MIT"
] | null | null | null | # Cells with Odd Values in a Matrix - LeetCode Contest
# https://leetcode.com/contest/weekly-contest-162/problems/cells-with-odd-values-in-a-matrix/
from typing import List
class Solution:
def oddCells(self, n: int, m: int, indices: List[List[int]]) -> int:
'''oddCells'''
ris = [ 0 for i in range(... | 29.78125 | 93 | 0.501574 |
cff319fb78c0159ba005238059f1e666aa8f5272 | 2,003 | py | Python | mushroom_rl/policy/noise_policy.py | k4ntz/mushroom-rl | 17c8e9b2a9648a59169f3599c4ef8d259afc39f4 | [
"MIT"
] | 1 | 2022-02-06T22:04:42.000Z | 2022-02-06T22:04:42.000Z | mushroom_rl/policy/noise_policy.py | AmmarFahmy/mushroom-rl | 2625ee7f64d5613b3b9fba00f0b7a39fece88ca5 | [
"MIT"
] | null | null | null | mushroom_rl/policy/noise_policy.py | AmmarFahmy/mushroom-rl | 2625ee7f64d5613b3b9fba00f0b7a39fece88ca5 | [
"MIT"
] | null | null | null | import numpy as np
from .policy import ParametricPolicy
class OrnsteinUhlenbeckPolicy(ParametricPolicy):
"""
Ornstein-Uhlenbeck process as implemented in:
https://github.com/openai/baselines/blob/master/baselines/ddpg/noise.py.
This policy is commonly used in the Deep Deterministic Policy Gradient
... | 27.438356 | 102 | 0.598103 |
d20021095b11925db663439bdb056ba19687045e | 4,420 | py | Python | modules/REGEXBOT_command.py | linnil1/slack_emoji_bot | b31b465cdab5ecdcbfc987000e182724e86a83c8 | [
"MIT"
] | 4 | 2016-07-25T12:07:19.000Z | 2020-11-25T15:09:16.000Z | modules/REGEXBOT_command.py | linnil1/slack_emoji_bot | b31b465cdab5ecdcbfc987000e182724e86a83c8 | [
"MIT"
] | null | null | null | modules/REGEXBOT_command.py | linnil1/slack_emoji_bot | b31b465cdab5ecdcbfc987000e182724e86a83c8 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor, wait, _base
from threading import Timer
import re
import random
from functools import partial
class REGEXBOT:
def require():
return [{'name': "CustomResponse", 'module': "True"},
{'name': "interval", 'default': '60'}]
def __init__(sel... | 36.229508 | 77 | 0.504299 |
362c84665be7d7f48274594e62f3643e7b1117b2 | 24,339 | py | Python | splikes/utils.py | bblais/Plasticnet | e450e56a9b993e361873b6a235fdcc55a5690abb | [
"MIT"
] | null | null | null | splikes/utils.py | bblais/Plasticnet | e450e56a9b993e361873b6a235fdcc55a5690abb | [
"MIT"
] | null | null | null | splikes/utils.py | bblais/Plasticnet | e450e56a9b993e361873b6a235fdcc55a5690abb | [
"MIT"
] | 1 | 2020-01-16T18:20:53.000Z | 2020-01-16T18:20:53.000Z | from numpy import exp,concatenate,array,float,r_
from pylab import plot,ylabel,xlabel,gca,draw,legend,subplot,show,text,gcf,rand
from numpy import zeros,arange,ones,convolve,floor
import numpy as np
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 3
mpl.rcParams['figure.figsize'] = (10,8)
mpl.rcParams['axes.... | 25.485864 | 113 | 0.515264 |
9391232e038db5589e350e6f8514f4773083e5d1 | 1,446 | py | Python | tests/examples/minlplib/wall.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/wall.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/wall.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # NLP written by GAMS Convert at 04/21/18 13:55:05
#
# Equation counts
# Total E G L N X C B
# 6 6 0 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 33.627907 | 95 | 0.488935 |
60003385c688c968cf9d19a822de398aa63bd3cb | 2,763 | py | Python | gilded_rose.py | vaibhavgrwl7/GlidedRoseKataChallange | 07877121337564b9106c972ad68684102321fa81 | [
"MIT"
] | null | null | null | gilded_rose.py | vaibhavgrwl7/GlidedRoseKataChallange | 07877121337564b9106c972ad68684102321fa81 | [
"MIT"
] | null | null | null | gilded_rose.py | vaibhavgrwl7/GlidedRoseKataChallange | 07877121337564b9106c972ad68684102321fa81 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from asyncio import constants
class GildedRose(object):
def __init__(self, items):
self.items = items
def update_quality(self):
for item in self.items:
self.doUpdateQuality(item)
def decquality(self, item):
if item.quality > 0 and item.quali... | 30.032609 | 69 | 0.538183 |
897cb0d40e052256cb283c3479443ef8a4da042a | 1,957 | py | Python | scripts/test/integration-tests.py | KorhanOzturk90/init-service.g8 | 7f41f2eccbdca5c2eee9160d84739a6c88b80ff1 | [
"Apache-2.0"
] | null | null | null | scripts/test/integration-tests.py | KorhanOzturk90/init-service.g8 | 7f41f2eccbdca5c2eee9160d84739a6c88b80ff1 | [
"Apache-2.0"
] | null | null | null | scripts/test/integration-tests.py | KorhanOzturk90/init-service.g8 | 7f41f2eccbdca5c2eee9160d84739a6c88b80ff1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import shutil
import sys
import subprocess
from subprocess import call
import uuid
import unittest
class IntegrationTestActions(unittest.TestCase):
def setUp(self):
self.createscript = os.path.abspath(os.path.dirname(__file__)) + '/' + '../bin/create.py'
self.works... | 32.616667 | 97 | 0.594788 |
853e2ca9ea86e7e7aae1d3e035445a0fb411aedf | 8,922 | py | Python | jwskate/jwk/okp.py | guillp/jwskate | 271e88d4eca929a4be85e765f3bdbf8b649a2b9a | [
"MIT"
] | null | null | null | jwskate/jwk/okp.py | guillp/jwskate | 271e88d4eca929a4be85e765f3bdbf8b649a2b9a | [
"MIT"
] | null | null | null | jwskate/jwk/okp.py | guillp/jwskate | 271e88d4eca929a4be85e765f3bdbf8b649a2b9a | [
"MIT"
] | null | null | null | """This module implements JWK representing Octet Key Pairs from [RFC8037](https://datatracker.ietf.org/doc/rfc8037/)."""
from __future__ import annotations
from typing import Any, Mapping
from binapy import BinaPy
from cryptography.hazmat.primitives.asymmetric import ed448, ed25519, x448, x25519
from cryptography.ha... | 32.209386 | 120 | 0.568146 |
e624e2150308033f040af8314320589532aa3d5d | 564 | py | Python | rl_main/trade_main/upbit_trade_live.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | rl_main/trade_main/upbit_trade_live.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | rl_main/trade_main/upbit_trade_live.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | 1 | 2021-11-23T12:30:37.000Z | 2021-11-23T12:30:37.000Z | from common.environments import TimeUnit, EnvironmentType
from common.environments import UpbitEnvironment
from common.environments import get_previous_one_unit_date_time
def main():
previous_one_datetime = get_previous_one_unit_date_time(TimeUnit.ONE_HOUR)
print(previous_one_datetime)
env = UpbitEnviron... | 28.2 | 92 | 0.776596 |
7727bac7890bbcb830695fa1cdfa789a160a1b6b | 752 | py | Python | tests/test_parse.py | ciphergoth/pylambdac | aca951efee9dc2720b3da7ba3cee35a31196abec | [
"Apache-2.0"
] | 10 | 2019-05-22T16:50:47.000Z | 2022-02-28T03:25:44.000Z | tests/test_parse.py | ciphergoth/pylambdac | aca951efee9dc2720b3da7ba3cee35a31196abec | [
"Apache-2.0"
] | null | null | null | tests/test_parse.py | ciphergoth/pylambdac | aca951efee9dc2720b3da7ba3cee35a31196abec | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.181818 | 74 | 0.757979 |
2f028fa9d3282ed6d3e3ae02676dbe4638dc73ba | 4,197 | py | Python | nkdsu/tests.py | theshillito/nkd.su | 9d1166454dd909c755206e27a35c51391a12c588 | [
"BSD-3-Clause"
] | null | null | null | nkdsu/tests.py | theshillito/nkd.su | 9d1166454dd909c755206e27a35c51391a12c588 | [
"BSD-3-Clause"
] | null | null | null | nkdsu/tests.py | theshillito/nkd.su | 9d1166454dd909c755206e27a35c51391a12c588 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
from instant_coverage import InstantCoverageMixin, optional
class EverythingTest(
optional.ExternalLinks, optional.ValidHTML5, optional.ValidJSON,
InstantCoverageMixin, TestCase
):
fixtures = ['vote.json']
covered_urls =... | 29.765957 | 105 | 0.562783 |
3840a7d81ef0fb6aa8322b1cc615b47588cf1326 | 1,559 | py | Python | fbpcs/scripts/gen_ids_from_spine.py | adshastri/fbpcs | 81d816ee56ea36f8f58dca6ae803fa50138cb91e | [
"MIT"
] | null | null | null | fbpcs/scripts/gen_ids_from_spine.py | adshastri/fbpcs | 81d816ee56ea36f8f58dca6ae803fa50138cb91e | [
"MIT"
] | null | null | null | fbpcs/scripts/gen_ids_from_spine.py | adshastri/fbpcs | 81d816ee56ea36f8f58dca6ae803fa50138cb91e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
CLI tool to generate a list of IDs from a spine
Usage:
gen_ids_from_spine <spine_path> <output_path> [options]... | 28.87037 | 87 | 0.615779 |
38cc4af3698ffdb2387a1ae511321dd39c8f9068 | 2,526 | py | Python | py/kois.py | rodluger/exoq | 9436457ebfa0f4bc253a094950a50b648b71562a | [
"MIT"
] | null | null | null | py/kois.py | rodluger/exoq | 9436457ebfa0f4bc253a094950a50b648b71562a | [
"MIT"
] | null | null | null | py/kois.py | rodluger/exoq | 9436457ebfa0f4bc253a094950a50b648b71562a | [
"MIT"
] | null | null | null | """Download the KOIs."""
import numpy as np
import kplr
from kplr import KOI
import pickle
def GetKOIs():
"""Return a list of all KOIs with minor vetting."""
try:
kois = pickle.load(open("kois.pickle", "rb"))
except (FileNotFoundError, pickle.UnpicklingError):
# A little hack
KOI... | 31.575 | 76 | 0.523753 |
2d1b49661e9f0dbd303df7bdbafcf6d54e2d463d | 8,704 | py | Python | utils/config.py | xinshengwang/Tacotron-pytorch | 6cad258a9bcfe6dfe51c35e971119cbf2b38c3a7 | [
"MIT"
] | 4 | 2021-09-30T12:12:02.000Z | 2021-12-16T09:14:16.000Z | utils/config.py | xinshengwang/Tacotron-pytorch | 6cad258a9bcfe6dfe51c35e971119cbf2b38c3a7 | [
"MIT"
] | null | null | null | utils/config.py | xinshengwang/Tacotron-pytorch | 6cad258a9bcfe6dfe51c35e971119cbf2b38c3a7 | [
"MIT"
] | null | null | null | import yaml
import numpy as np
from easydict import EasyDict as edict
from text import symbols
__C = edict()
cfg = __C
# tacotron model
__C.ref_type = ''
__C.with_reference = False
__C.gst_token_embed_dim = 256
__C.vae_latent_dim = 10
__C.gst_num_tokens = 10
__C.gst_num_heads = 8
__C.gst_num_convs = ... | 38.175439 | 175 | 0.709789 |
be92a1bd6d9671babef045f43589c854bbce935a | 1,671 | py | Python | sentiment-analysis/python-lib/preprocessing_utils.py | RedaAffane/dataiku-contrib | d409ddc25d31570972a14abb19a84ac101afc6cc | [
"Apache-2.0"
] | 1 | 2020-10-11T14:53:53.000Z | 2020-10-11T14:53:53.000Z | sentiment-analysis/python-lib/preprocessing_utils.py | RedaAffane/dataiku-contrib | d409ddc25d31570972a14abb19a84ac101afc6cc | [
"Apache-2.0"
] | null | null | null | sentiment-analysis/python-lib/preprocessing_utils.py | RedaAffane/dataiku-contrib | d409ddc25d31570972a14abb19a84ac101afc6cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import string
maketrans = string.maketrans
# Twitter related tokens
RE_HASHTAG = ur'#[a-zA-Z0-9_]+'
RE_MENTION = ur'@[a-zA-Z0-9_]+'
RE_URL = ur'(?:https?://|www\.)(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'
RE_EMAIL = ur'\b[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-... | 26.52381 | 99 | 0.585278 |
d6e282918b65e01ca35c73083df9961f7a0dd037 | 918 | py | Python | Slist.py | prajwalmr62/Slist | e845bbb4d71aedd2996732a8b3953d8a127f7813 | [
"Apache-2.0"
] | null | null | null | Slist.py | prajwalmr62/Slist | e845bbb4d71aedd2996732a8b3953d8a127f7813 | [
"Apache-2.0"
] | null | null | null | Slist.py | prajwalmr62/Slist | e845bbb4d71aedd2996732a8b3953d8a127f7813 | [
"Apache-2.0"
] | null | null | null | """
slist ver 1.0
github repository: prajwalmr62
slist is a new class which is extended version of the default list type.
Modifications:
sort:
This list, sorts using the size of the elements and within same type of elements, upon their values.
size:
creates property size list and prints the size of elements
""... | 34 | 104 | 0.572985 |
b6451892235e0ae8581a65bee176ec85de24a368 | 2,422 | py | Python | src_py/hat/monitor/server/blessing.py | hrvojekeserica/hat-core | 759def68620cf4f8c11e7bbbdbfd1e701dbafb09 | [
"MIT"
] | null | null | null | src_py/hat/monitor/server/blessing.py | hrvojekeserica/hat-core | 759def68620cf4f8c11e7bbbdbfd1e701dbafb09 | [
"MIT"
] | null | null | null | src_py/hat/monitor/server/blessing.py | hrvojekeserica/hat-core | 759def68620cf4f8c11e7bbbdbfd1e701dbafb09 | [
"MIT"
] | null | null | null | """Implementation of blessing calculation algorithms"""
import enum
from hat import util
Algorithm = util.extend_enum_doc(enum.Enum('Algorithm', [
'BLESS_ALL',
'BLESS_ONE']))
_last_token_id = 0
def calculate_blessing(group_algorithms, components,
default_algorithm=Algorithm.BLESS_... | 30.658228 | 75 | 0.658134 |
d10817692c9e86aa300851e9070db8c6eb215b66 | 9,677 | py | Python | docs/conf.py | koningrobot/blocks | 58994253579d30fb63a2cfa53499a68b1237c3c0 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | koningrobot/blocks | 58994253579d30fb63a2cfa53499a68b1237c3c0 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | koningrobot/blocks | 58994253579d30fb63a2cfa53499a68b1237c3c0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Blocks documentation build configuration file, created by
# sphinx-quickstart2 on Wed Oct 8 17:59:44 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 31.521173 | 79 | 0.707864 |
9d163c235300a0b7fbb1b88807f51f156b80b5f8 | 5,677 | py | Python | src/datadog_api_client/v1/model/host_mute_settings.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 32 | 2021-01-07T15:09:56.000Z | 2022-01-30T05:49:23.000Z | src/datadog_api_client/v1/model/host_mute_settings.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 228 | 2020-09-03T14:03:54.000Z | 2022-03-31T20:16:12.000Z | src/datadog_api_client/v1/model/host_mute_settings.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 12 | 2020-09-15T21:36:03.000Z | 2022-03-31T17:13:17.000Z | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 42.365672 | 162 | 0.591333 |
c5f92d73b0875d980f21c2a45bddae36c8f190bf | 16,831 | py | Python | design_baselines/cbas/experiments.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 9 | 2022-02-18T07:07:27.000Z | 2022-03-18T11:19:53.000Z | design_baselines/cbas/experiments.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | null | null | null | design_baselines/cbas/experiments.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | null | null | null | from ray import tune
import click
import ray
import os
@click.group()
def cli():
"""A group of experiments for training Conservative Score Models
and reproducing our ICLR 2021 results.
"""
#############
@cli.command()
@click.option('--local-dir', type=str, default='cbas-dkitty')
@click.option('--cpus'... | 32.681553 | 84 | 0.580061 |
826f197d4fbf22e112414cc610e963720cd4cd7e | 1,143 | py | Python | subseasonal_toolkit/models/perpp/attributes.py | UtopiaLLC/subseasonal_toolkit | 35e120a010606d10a7d94cdfbf4cb8347a234dfb | [
"MIT"
] | 2 | 2021-10-02T07:37:52.000Z | 2022-01-27T07:46:31.000Z | subseasonal_toolkit/models/perpp/attributes.py | UtopiaLLC/subseasonal_toolkit | 35e120a010606d10a7d94cdfbf4cb8347a234dfb | [
"MIT"
] | null | null | null | subseasonal_toolkit/models/perpp/attributes.py | UtopiaLLC/subseasonal_toolkit | 35e120a010606d10a7d94cdfbf4cb8347a234dfb | [
"MIT"
] | 3 | 2021-09-27T16:53:35.000Z | 2021-12-27T21:39:07.000Z | # Model attributes
import json
import os
from pkg_resources import resource_filename
MODEL_NAME="perpp"
SELECTED_SUBMODEL_PARAMS_FILE=resource_filename("subseasonal_toolkit",
os.path.join("models",MODEL_NAME,"selected_submodel.json"))
def get_selected_submodel_name(gt_id, target_horizon):
"""Returns the name... | 35.71875 | 78 | 0.724409 |
0a466d1c81c1c916af84c1b720de0a48f35710c5 | 361 | py | Python | blog/migrations/0002_blog_url.py | shifat151/portfolio | de025dd345232385e31f1e9741ddcbfe1ca33f93 | [
"MIT"
] | null | null | null | blog/migrations/0002_blog_url.py | shifat151/portfolio | de025dd345232385e31f1e9741ddcbfe1ca33f93 | [
"MIT"
] | 6 | 2021-06-09T17:58:42.000Z | 2021-09-25T14:39:22.000Z | blog/migrations/0002_blog_url.py | shifat151/portfolio | de025dd345232385e31f1e9741ddcbfe1ca33f93 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2019-12-08 18:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='blog',
name='url',
field=model... | 19 | 47 | 0.570637 |
56abb89256ed5e83b60cbad92107bafb6c18e1eb | 35,291 | py | Python | converter/nnef_converters/caffe_converters/nnef_to_caffe/converters.py | asdor/NNEF-Tools | e84c3db29c1bffbd1938d40a10765badc0848606 | [
"Apache-2.0"
] | null | null | null | converter/nnef_converters/caffe_converters/nnef_to_caffe/converters.py | asdor/NNEF-Tools | e84c3db29c1bffbd1938d40a10765badc0848606 | [
"Apache-2.0"
] | null | null | null | converter/nnef_converters/caffe_converters/nnef_to_caffe/converters.py | asdor/NNEF-Tools | e84c3db29c1bffbd1938d40a10765badc0848606 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 40.149033 | 118 | 0.587714 |
0348c6450b8a4fea90f6823e1cc702d15b0d1f3f | 2,923 | py | Python | brian2/tests/features/neurongroup.py | rgerkin/brian2 | 34761a58b0d4c2275194e648449419b3dd73286b | [
"BSD-2-Clause"
] | 1 | 2019-08-17T21:19:03.000Z | 2019-08-17T21:19:03.000Z | brian2/tests/features/neurongroup.py | rgerkin/brian2 | 34761a58b0d4c2275194e648449419b3dd73286b | [
"BSD-2-Clause"
] | null | null | null | brian2/tests/features/neurongroup.py | rgerkin/brian2 | 34761a58b0d4c2275194e648449419b3dd73286b | [
"BSD-2-Clause"
] | null | null | null | '''
Check that the features of `NeuronGroup` are available and correct.
'''
from __future__ import absolute_import
from brian2 import *
from brian2.tests.features import FeatureTest, InaccuracyError
class NeuronGroupIntegrationLinear(FeatureTest):
category = "NeuronGroup"
name = "Linear integration"
t... | 27.575472 | 79 | 0.569278 |
34fbe2d6347c02e9745bc1ad3f930e36dfcc91c7 | 3,687 | py | Python | functions/readEikonData.py | AukeVanSighem/ECB-Bond-Purchases | 10efcdc5f2361dcda63c0df3b07e73fce90f370e | [
"Apache-2.0"
] | null | null | null | functions/readEikonData.py | AukeVanSighem/ECB-Bond-Purchases | 10efcdc5f2361dcda63c0df3b07e73fce90f370e | [
"Apache-2.0"
] | null | null | null | functions/readEikonData.py | AukeVanSighem/ECB-Bond-Purchases | 10efcdc5f2361dcda63c0df3b07e73fce90f370e | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from functions import downloadECBBonds
# The path to the folder in the S3 bucket in which the data is stored
eikon_data_folder = "https://s3groupsweden.s3.eu-central-1.amazonaws.com/Data/EIKON/"
# Get dataframes with the data in the files holdingsECBEnvironment.txt and holdingsECBGeneralInfo.txt
d... | 47.883117 | 118 | 0.724708 |
6f5662d2fadc552eaf5eced3121e828e3dd3085f | 18,803 | py | Python | main_unsupervised.py | haideraltahan/CLAR | 3b5a7828744333f8915de4e64d87a544c8ce91fd | [
"MIT"
] | 4 | 2021-11-25T18:58:43.000Z | 2022-01-27T14:42:38.000Z | main_unsupervised.py | haideraltahan/CLAR | 3b5a7828744333f8915de4e64d87a544c8ce91fd | [
"MIT"
] | null | null | null | main_unsupervised.py | haideraltahan/CLAR | 3b5a7828744333f8915de4e64d87a544c8ce91fd | [
"MIT"
] | 3 | 2021-04-14T02:09:38.000Z | 2021-12-14T06:01:20.000Z | import os
# import torchsummary
from functools import partial
import fire
import torchaudio
from pl_bolts.models.self_supervised.resnets import resnet18
from pl_bolts.optimizers.lars_scheduling import LARSWrapper
from pl_bolts.optimizers.lr_scheduler import LinearWarmupCosineAnnealingLR
from pytorch_lightning.callback... | 38.6893 | 119 | 0.540712 |
07e1c61f16319ad0ba93f2cd1601faae7f13d30b | 22,392 | py | Python | magnum/db/api.py | piersharding/magnum | 451358a57c4bd8fd93bab8121cfb5698d5471568 | [
"Apache-2.0"
] | null | null | null | magnum/db/api.py | piersharding/magnum | 451358a57c4bd8fd93bab8121cfb5698d5471568 | [
"Apache-2.0"
] | 2 | 2019-06-14T12:13:53.000Z | 2020-07-10T00:30:53.000Z | magnum/db/api.py | zonca/magnum | 3217e75b63fb9ebeb37b462677cdb72315ca1067 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | 34.030395 | 79 | 0.590702 |
d6e33e7104784c1904c447aa6b955a13352eda84 | 452 | py | Python | blog/migrations/0025_auto_20190515_1534.py | ufotable/DjangoBlog | 64ac857d2d105b39200984816187e5a7bf6be43a | [
"MIT"
] | null | null | null | blog/migrations/0025_auto_20190515_1534.py | ufotable/DjangoBlog | 64ac857d2d105b39200984816187e5a7bf6be43a | [
"MIT"
] | null | null | null | blog/migrations/0025_auto_20190515_1534.py | ufotable/DjangoBlog | 64ac857d2d105b39200984816187e5a7bf6be43a | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2019-05-15 15:34
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0024_auto_20190515_1519'),
]
operations = [
migrations.AlterField(
model_name='post',
name='... | 22.6 | 99 | 0.619469 |
a3fd42277a845374bee733d40a571f5a4ab17475 | 495 | py | Python | shop/admin.py | Ayushman-Singh/ecommerce | 78f007fea89ead412d10554e69b9f4854f67d277 | [
"MIT"
] | 1 | 2019-11-25T06:42:47.000Z | 2019-11-25T06:42:47.000Z | shop/admin.py | Ayushman-Singh/ecommerce | 78f007fea89ead412d10554e69b9f4854f67d277 | [
"MIT"
] | 12 | 2020-02-12T02:54:15.000Z | 2022-03-12T00:06:14.000Z | shop/admin.py | Ayushman-Singh/ecommerce | 78f007fea89ead412d10554e69b9f4854f67d277 | [
"MIT"
] | 3 | 2019-11-25T19:53:18.000Z | 2020-10-01T12:01:24.000Z | from django.contrib import admin
# Register your models here.
from .models import Product,Category,User, Contact, Order,OrderItem,Cart,CartItem,Wishlist,WishlistItem
admin.site.register(Product)
admin.site.register(Category)
admin.site.register(Contact)
admin.site.register(Order)
admin.site.register(Orde... | 19.038462 | 104 | 0.767677 |
67af9d0f23a66993e82720201f46b587ecb1778c | 530 | py | Python | aoc20191206a.py | BarnabyShearer/aoc | 4feb66c668b068f0f42ad99b916e80732eba5a2d | [
"MIT"
] | null | null | null | aoc20191206a.py | BarnabyShearer/aoc | 4feb66c668b068f0f42ad99b916e80732eba5a2d | [
"MIT"
] | null | null | null | aoc20191206a.py | BarnabyShearer/aoc | 4feb66c668b068f0f42ad99b916e80732eba5a2d | [
"MIT"
] | null | null | null | def parse(data):
result = {}
for c, o in [line.split(")") for line in data.split("\n")]:
if c not in result:
result[c] = set()
result[c].add(o)
return result
def aoc(data):
orbits = parse(data)
total = 0
visited = set()
to = set((("COM", 0),))
while to:
... | 23.043478 | 63 | 0.486792 |
d0722f4bffdcb485e2637621912119dbefc30cfd | 5,893 | py | Python | MICCAI/2D_3D_CNN/read.py | DudleA/multislice | a7673974423b6fc12bde8b391f64c8f54b2869e2 | [
"Apache-2.0"
] | 2 | 2021-12-09T14:37:26.000Z | 2022-01-13T13:40:30.000Z | MICCAI/2D_3D_CNN/read.py | DudleA/multislice | a7673974423b6fc12bde8b391f64c8f54b2869e2 | [
"Apache-2.0"
] | 1 | 2022-03-16T19:48:35.000Z | 2022-03-16T19:48:35.000Z | MICCAI/2D_3D_CNN/read.py | DudleA/multislice | a7673974423b6fc12bde8b391f64c8f54b2869e2 | [
"Apache-2.0"
] | 2 | 2019-07-09T06:43:58.000Z | 2019-11-04T12:53:12.000Z | import numpy as np
import SimpleITK as sitk
import pandas as pd
import keras
import random
import os, glob
from find_center import (find_center, correct_center, correct_size,
correct_size3D)
def xReadFunction(ID, params, im_mask="both", data=None):
"""
Read and crop MR image and segmentation mask
""... | 32.202186 | 73 | 0.554726 |
fe1ee580dec4c24eef9d488d8e4fdd93369c0661 | 134 | py | Python | src/architecture_repository/architectures/auxiliary_architecture.py | Davide-DD/fog05-orchestrator | 5f011170c99dbccfc8600b10bc734eb982b166ba | [
"Apache-2.0"
] | 4 | 2019-10-07T12:26:48.000Z | 2019-12-18T15:14:03.000Z | src/architecture_repository/architectures/auxiliary_architecture.py | Davide-DD/fog05-orchestrator | 5f011170c99dbccfc8600b10bc734eb982b166ba | [
"Apache-2.0"
] | null | null | null | src/architecture_repository/architectures/auxiliary_architecture.py | Davide-DD/fog05-orchestrator | 5f011170c99dbccfc8600b10bc734eb982b166ba | [
"Apache-2.0"
] | null | null | null | class AuxiliaryArchitecture(Architecture):
def set_auxiliary_endpoint(self,auxiliary_endpoint):
raise NotImplementedError() | 26.8 | 53 | 0.813433 |
687bc72be9bfe04ad9423406128e1ee69e19cf57 | 3,126 | py | Python | rlkit/torch/pytorch_util.py | panpanyunshi/rlkit | e1f6c9e59ab2baab93d35385cdc43ab3632b2b65 | [
"MIT"
] | null | null | null | rlkit/torch/pytorch_util.py | panpanyunshi/rlkit | e1f6c9e59ab2baab93d35385cdc43ab3632b2b65 | [
"MIT"
] | null | null | null | rlkit/torch/pytorch_util.py | panpanyunshi/rlkit | e1f6c9e59ab2baab93d35385cdc43ab3632b2b65 | [
"MIT"
] | null | null | null | import torch
import numpy as np
def soft_update_from_to(source, target, tau):
for target_param, param in zip(target.parameters(), source.parameters()):
target_param.data.copy_(
target_param.data * (1.0 - tau) + param.data * tau
)
def copy_model_params_from_to(source, target):
for... | 24.421875 | 77 | 0.662188 |
dd87e265012280a3ee09116dfd88c95ce0733a17 | 17,268 | py | Python | h2o-py/h2o/expr.py | xiaochi-liu/h2o-3 | 7b8ce34597705cab930395db9ecfcc046f556c4e | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/expr.py | xiaochi-liu/h2o-3 | 7b8ce34597705cab930395db9ecfcc046f556c4e | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/expr.py | xiaochi-liu/h2o-3 | 7b8ce34597705cab930395db9ecfcc046f556c4e | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Rapids expressions. These are helper classes for H2OFrame.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from collections import OrderedDict
import copy
i... | 38.979684 | 123 | 0.595958 |
7c3d718a6cf900467fa6d3c8d0d38be1d82a5ea2 | 2,283 | py | Python | setup.py | Supratix/django-recurrence | 372c1bfb07fe2fc88f8232d3eb3bd3170e714eee | [
"BSD-3-Clause"
] | null | null | null | setup.py | Supratix/django-recurrence | 372c1bfb07fe2fc88f8232d3eb3bd3170e714eee | [
"BSD-3-Clause"
] | null | null | null | setup.py | Supratix/django-recurrence | 372c1bfb07fe2fc88f8232d3eb3bd3170e714eee | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
try:
from setuptools import setup
has_setuptools = True
except ImportError:
from distutils.core import setup
has_setuptools = False
if has_setuptools:
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):... | 28.5375 | 65 | 0.598774 |
8bb9db46fa7f268779fdbe54548fa9e9ec8c5803 | 2,651 | py | Python | Covid-19/Covid-19 (Simple Pie Charts).py | T-Skipper/EDA | b190d71de0098eac3c4263efbd1099cc36eed446 | [
"MIT"
] | null | null | null | Covid-19/Covid-19 (Simple Pie Charts).py | T-Skipper/EDA | b190d71de0098eac3c4263efbd1099cc36eed446 | [
"MIT"
] | null | null | null | Covid-19/Covid-19 (Simple Pie Charts).py | T-Skipper/EDA | b190d71de0098eac3c4263efbd1099cc36eed446 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Import 3rd party libraries
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
# Find dataset/file path using current date
file = datetime.now().strftime("%d-%b-%Y")
path = f'Covid-19-Datasets/Covid-19-Api/Datasets/{file}.csv'
# Catch error if file ... | 31.559524 | 86 | 0.568465 |
681c63506e1f659634a57074b775568eced914f2 | 9,890 | py | Python | SSINS/match_filter.py | cjordan/SSINS | 72d01e83eba73e08519800ea71de92b6e3a5da85 | [
"BSD-2-Clause"
] | null | null | null | SSINS/match_filter.py | cjordan/SSINS | 72d01e83eba73e08519800ea71de92b6e3a5da85 | [
"BSD-2-Clause"
] | null | null | null | SSINS/match_filter.py | cjordan/SSINS | 72d01e83eba73e08519800ea71de92b6e3a5da85 | [
"BSD-2-Clause"
] | null | null | null | """
Match Filter class
"""
import numpy as np
import time
class MF():
"""
Defines the Match Filter (MF) class.
"""
def __init__(self, freq_array, sig_thresh, shape_dict={}, N_samp_thresh=0,
narrow=True, streak=True):
"""
Args:
freq_array: Sets the freq_... | 49.20398 | 155 | 0.604348 |
bbbb5436eaf67b71fd0d62c922c30e6ecb7b5bd3 | 1,032 | py | Python | Chapter08/code/chapter8_02.py | sTone3/Tkinter-GUI-Application-Development-Cookbook | 6c42edaa66c30d13e1903f3a3a66f609f20783d9 | [
"MIT"
] | 43 | 2018-05-09T23:29:07.000Z | 2022-03-05T02:03:32.000Z | Chapter08/code/chapter8_02.py | wenxuefeng3930/Tkinter-GUI-Application-Development-Cookbook | 6e22bc472e07a9aaa017ef66bfd32644578a873a | [
"MIT"
] | null | null | null | Chapter08/code/chapter8_02.py | wenxuefeng3930/Tkinter-GUI-Application-Development-Cookbook | 6e22bc472e07a9aaa017ef66bfd32644578a873a | [
"MIT"
] | 40 | 2018-06-18T14:44:13.000Z | 2022-03-12T09:11:50.000Z | import tkinter as tk
import tkinter.ttk as ttk
class App(tk.Tk):
def __init__(self):
super().__init__()
self.title("Ttk Combobox")
colors = ("Purple", "Yellow", "Red", "Blue")
self.label = ttk.Label(self, text="Please select a color")
self.combo = ttk.Combobox(self, values=... | 30.352941 | 67 | 0.581395 |
38f99b39ed6e8cc987b86b9fad56d8f43cd73069 | 8,909 | py | Python | src/dispatch/alembic/versions/38f0b01448ba_.py | trinhth2601/dispatch | de736295950ffbf3c55e6d3940fc3d87b82f14a5 | [
"Apache-2.0"
] | null | null | null | src/dispatch/alembic/versions/38f0b01448ba_.py | trinhth2601/dispatch | de736295950ffbf3c55e6d3940fc3d87b82f14a5 | [
"Apache-2.0"
] | null | null | null | src/dispatch/alembic/versions/38f0b01448ba_.py | trinhth2601/dispatch | de736295950ffbf3c55e6d3940fc3d87b82f14a5 | [
"Apache-2.0"
] | null | null | null | """Adds on delete cascade behavior and renames primary and foreign keys, and sequence id for report
Revision ID: 38f0b01448ba
Revises: 1c3f808aa00c
Create Date: 2020-12-17 16:20:11.517862
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "38f0b01448ba"
down_revis... | 45.687179 | 110 | 0.683129 |
6e580d540b58c6508e99d982cfa3ea2db69a4acf | 92,495 | py | Python | virtual/lib/python3.6/site-packages/astroid/scoped_nodes.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | virtual/lib/python3.6/site-packages/astroid/scoped_nodes.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 12 | 2018-12-06T22:06:49.000Z | 2022-02-25T17:40:44.000Z | virtual/lib/python3.6/site-packages/astroid/scoped_nodes.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2010 Daniel Harding <dharding@gmail.com>
# Copyright (c) 2011, 2013-2015 Google, Inc.
# Copyright (c) 2013-2018 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2013 Phil Schaf <flying-sheep@web.de>
#... | 32.975045 | 96 | 0.590389 |
d68e97dd279dc10b0e83c2aeeb918cfc29024a0c | 727 | py | Python | sh/architectures/elmo/preprocess_article.py | sdll/phramer | e2af4e4a6fec5b5099d1487c07165cc7a0229954 | [
"MIT"
] | 1 | 2021-09-22T15:25:49.000Z | 2021-09-22T15:25:49.000Z | sh/architectures/elmo/preprocess_article.py | sdll/phramer | e2af4e4a6fec5b5099d1487c07165cc7a0229954 | [
"MIT"
] | null | null | null | sh/architectures/elmo/preprocess_article.py | sdll/phramer | e2af4e4a6fec5b5099d1487c07165cc7a0229954 | [
"MIT"
] | 1 | 2020-11-23T03:19:41.000Z | 2020-11-23T03:19:41.000Z | import argparse
from phramer.data.dataset import RIANewsDataset
ria = RIANewsDataset()
def process_article(data_path, save_path):
with open(data_path, 'r+') as f:
article = f.read()
article = ria._process_article(article)
article = article.replace('\n', ' ')
f = open(save_path, 'w+')
f.... | 26.925926 | 107 | 0.685007 |
099228e58b9b26c025448791291a22d3f89dabd5 | 363 | py | Python | scripts_python/Pares.py | anthony-tupaz/FrameWorks_8A | 2b22c54fc7edd25f1136e13654cee4731cce4d01 | [
"Apache-2.0"
] | null | null | null | scripts_python/Pares.py | anthony-tupaz/FrameWorks_8A | 2b22c54fc7edd25f1136e13654cee4731cce4d01 | [
"Apache-2.0"
] | null | null | null | scripts_python/Pares.py | anthony-tupaz/FrameWorks_8A | 2b22c54fc7edd25f1136e13654cee4731cce4d01 | [
"Apache-2.0"
] | null | null | null | # descripcion: Script Python que permite identificar el mayor de dos numeros ingresados por consola
import os
os.system("clear")
print("ingrese primer numero: ")
n1 = int(input())
n2 = int(input("ingrese segundo numero: "))
if n1 > n2 :
print("El mayor es: ", n1)
elif n1 < n2:
print("el mayor es: ", n2)... | 18.15 | 99 | 0.669421 |
ad1b84523c590cd95487a6b379bbc65e4aa0f33a | 8,474 | py | Python | research/cv/hardnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/hardnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/hardnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 45.074468 | 117 | 0.625561 |
c60bf039a1fb3b4e110fbc7c251217ca153de585 | 3,872 | py | Python | gen3_etl/utils/models.py | ohsu-comp-bio/gen3-etl | 9114f75cc8c8085111152ce0ef686a8a12f67f8e | [
"MIT"
] | 1 | 2020-01-22T17:05:58.000Z | 2020-01-22T17:05:58.000Z | gen3_etl/utils/models.py | ohsu-comp-bio/gen3-etl | 9114f75cc8c8085111152ce0ef686a8a12f67f8e | [
"MIT"
] | 2 | 2019-02-08T23:24:58.000Z | 2021-05-13T22:42:28.000Z | gen3_etl/utils/models.py | ohsu-comp-bio/gen3_etl | 9114f75cc8c8085111152ce0ef686a8a12f67f8e | [
"MIT"
] | null | null | null | import json
import hashlib
def default_case(experiment_code, participantid, project_id):
"""Creates a minimal case."""
return {
"type": "case",
"experiments": {"submitter_id": experiment_code},
"submitter_id": participantid,
"primary_site": "unknown",
"disease_type": "u... | 38.336634 | 119 | 0.647211 |
f1d9eaeba9175ab6ab87a03d807d9772144ae14c | 1,904 | py | Python | platform/board_robotling_1_3_huzzah32.py | teuler/robotling_lib | db5a7f3a186db3a392752b30f81668b4567e609e | [
"MIT"
] | 1 | 2021-06-11T11:18:24.000Z | 2021-06-11T11:18:24.000Z | platform/board_robotling_1_3_huzzah32.py | teuler/robotling_lib | db5a7f3a186db3a392752b30f81668b4567e609e | [
"MIT"
] | null | null | null | platform/board_robotling_1_3_huzzah32.py | teuler/robotling_lib | db5a7f3a186db3a392752b30f81668b4567e609e | [
"MIT"
] | 3 | 2021-05-18T16:35:12.000Z | 2021-05-19T09:42:30.000Z | # ----------------------------------------------------------------------------
# board_robotling_1_3_huzzah32.py
# Pins and devices on `robotling" board, version 1.3
#
# The MIT License (MIT)
# Copyright (c) 2020-21 Thomas Euler
# 2020-08-01, v1
# 2021-09-23, v1.1, MISO -> SDI, MOSI -> SDO
# ---------------------------... | 30.709677 | 78 | 0.560399 |
e6d4884f2a2c5b7c29ab85ded7f670c45a0bdcb4 | 4,378 | py | Python | benchmark/startQiskit1413.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1413.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1413.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=55
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 32.42963 | 82 | 0.614664 |
8a6b1127267801205d74886e34042d68afc5d036 | 1,423 | py | Python | lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py | Shailendre/simpleproject | cd7319636d0569be06bb9dab4c5546c1e9542b07 | [
"BSD-2-Clause"
] | 2 | 2016-09-27T09:30:19.000Z | 2016-10-17T01:47:43.000Z | env/lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 10 | 2019-12-26T17:31:31.000Z | 2022-03-21T22:17:33.000Z | env/lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 1 | 2015-02-21T07:59:08.000Z | 2015-02-21T07:59:08.000Z | from django.db.models.lookups import Lookup
from django.db.models.sql.expressions import SQLEvaluator
class GISLookup(Lookup):
def as_sql(self, qn, connection):
from django.contrib.gis.db.models.sql import GeoWhereNode
# We use the same approach as was used by GeoWhereNode. It would
# be a... | 49.068966 | 92 | 0.677442 |
af1d8fdfdb1e420c9a549da0ff7bf14e763ecb72 | 1,661 | py | Python | tests/test_motion_planning.py | Nick-AhSen/iGibson | c6854f11eec5d935fa3ef3d6d4852c6571beab4b | [
"MIT"
] | null | null | null | tests/test_motion_planning.py | Nick-AhSen/iGibson | c6854f11eec5d935fa3ef3d6d4852c6571beab4b | [
"MIT"
] | null | null | null | tests/test_motion_planning.py | Nick-AhSen/iGibson | c6854f11eec5d935fa3ef3d6d4852c6571beab4b | [
"MIT"
] | null | null | null | import os
import matplotlib.pyplot as plt
import numpy as np
import igibson
from igibson.envs.igibson_env import iGibsonEnv
from igibson.utils.assets_utils import download_assets, download_demo_data
from igibson.utils.motion_planning_wrapper import MotionPlanningWrapper
def test_occupancy_grid():
print("Test en... | 30.759259 | 95 | 0.701987 |
0f26927afffc95d713128c728bbf2fe8aed23c1f | 10,285 | py | Python | TranskribusDU/graph/pkg_GraphBinaryConjugateSegmenter/GraphBinaryConjugateSegmenter.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 20 | 2017-01-24T20:08:25.000Z | 2021-10-30T15:20:44.000Z | TranskribusDU/graph/pkg_GraphBinaryConjugateSegmenter/GraphBinaryConjugateSegmenter.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 11 | 2017-06-27T11:41:42.000Z | 2020-10-12T04:59:25.000Z | TranskribusDU/graph/pkg_GraphBinaryConjugateSegmenter/GraphBinaryConjugateSegmenter.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 5 | 2017-01-12T15:55:34.000Z | 2019-10-10T05:13:20.000Z | # -*- coding: utf-8 -*-
"""
Train, test, predict steps for a graph-based model using a binary conjugate
(two classes on the primal edges)
Structured machine learning, currently using graph-CRF or Edge Convolution Network
Copyright NAVER(C) 2019 JL. Meunier
Developed for the EU proje... | 36.342756 | 142 | 0.501021 |
69c29db81ce2813956595250fe38effe3ed82c41 | 5,757 | py | Python | src/tools/scripts.py | webclinic017/advisor_app | 9cdab4aca19e193850943ef8308bad5c5ea0415d | [
"MIT"
] | null | null | null | src/tools/scripts.py | webclinic017/advisor_app | 9cdab4aca19e193850943ef8308bad5c5ea0415d | [
"MIT"
] | null | null | null | src/tools/scripts.py | webclinic017/advisor_app | 9cdab4aca19e193850943ef8308bad5c5ea0415d | [
"MIT"
] | null | null | null | # - - - - - HOME PAGE - - - - -
github_repo = "https://github.com/ramraider011235/portfolio_app"
how_to_operate_app = f"\
- To navigate to any part of the App Use the Side Bar on the left side of the screen \n\
- All Pages, Models, Ticker-Lists, or Entries will be prompted on the Side Bar \n\
- To run any a... | 46.056 | 137 | 0.671878 |
0811fad9b926c6c423205433c190759ef935cda0 | 873 | py | Python | model-optimizer/extensions/front/caffe/tanh.py | fujunwei/dldt | 09497b7724de4be92629f7799b8538b483d809a2 | [
"Apache-2.0"
] | 1 | 2021-07-30T17:03:50.000Z | 2021-07-30T17:03:50.000Z | model-optimizer/extensions/front/caffe/tanh.py | fujunwei/dldt | 09497b7724de4be92629f7799b8538b483d809a2 | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/front/caffe/tanh.py | fujunwei/dldt | 09497b7724de4be92629f7799b8538b483d809a2 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2018-2020 Intel Corporation
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 i... | 29.1 | 73 | 0.752577 |
d3f4ab0ce4126acb91cfc9cf8bbad81e818faa41 | 11,980 | py | Python | losses.py | alexrusciano/nms_free_retinanet | 3461a86e9dea71a756b92a434c62798bbf86b52d | [
"Apache-2.0"
] | null | null | null | losses.py | alexrusciano/nms_free_retinanet | 3461a86e9dea71a756b92a434c62798bbf86b52d | [
"Apache-2.0"
] | null | null | null | losses.py | alexrusciano/nms_free_retinanet | 3461a86e9dea71a756b92a434c62798bbf86b52d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import time
from utils import bbox_iou, broadcast_bbox_iou
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1)... | 41.310345 | 133 | 0.595659 |
d4ee1883b37c6afdd58e61c7b1f7518f10ca9787 | 2,149 | py | Python | PyStrong/Exceptions.py | JaredDyreson/TypeEnforcer | 421dcd8eef800b904a1f9d856710dbe11bdc35f6 | [
"MIT"
] | null | null | null | PyStrong/Exceptions.py | JaredDyreson/TypeEnforcer | 421dcd8eef800b904a1f9d856710dbe11bdc35f6 | [
"MIT"
] | null | null | null | PyStrong/Exceptions.py | JaredDyreson/TypeEnforcer | 421dcd8eef800b904a1f9d856710dbe11bdc35f6 | [
"MIT"
] | null | null | null | class PyStrongBaseException(Exception):
def __init__(self, message: str):
if not(isinstance(message, str)):
raise ValueError(
f'expected `str`; obtained {type(message).__name__}')
self.message = message
class InvalidTypeError(PyStrongBaseException):
"""
Can be s... | 23.107527 | 75 | 0.655654 |
3f73a5d7a863f01a0d9eb62ae2640c588fbfbec8 | 1,987 | py | Python | tools/telemetry/telemetry/core/backends/chrome/inspector_console.py | nagineni/chromium-crosswalk | 5725642f1c67d0f97e8613ec1c3e8107ab53fdf8 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | tools/telemetry/telemetry/core/backends/chrome/inspector_console.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2018-02-10T21:00:08.000Z | 2018-03-20T05:09:50.000Z | tools/telemetry/telemetry/core/backends/chrome/inspector_console.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
class InspectorConsole(object):
def __init__(self, inspector_backend):
self._inspector_backend = inspector_backend
self.... | 32.048387 | 72 | 0.677906 |
e16a23a73990d8f40cc729001e9a871372e82e05 | 4,819 | py | Python | general/dataloader.py | FilippoAleotti/Dwarf-Tensorflow | 3b44d3a791b75e93f8d1cabded736440ce84bca0 | [
"Apache-2.0"
] | 16 | 2019-12-04T14:42:07.000Z | 2022-03-22T05:06:01.000Z | general/dataloader.py | FilippoAleotti/Dwarf-Tensorflow | 3b44d3a791b75e93f8d1cabded736440ce84bca0 | [
"Apache-2.0"
] | 10 | 2020-04-12T03:26:25.000Z | 2022-03-12T00:14:16.000Z | general/dataloader.py | FilippoAleotti/Dwarf-Tensorflow | 3b44d3a791b75e93f8d1cabded736440ce84bca0 | [
"Apache-2.0"
] | 3 | 2020-03-08T01:50:44.000Z | 2020-07-10T07:51:47.000Z | '''
General Dataloader
Author: Filippo Aleotti
Mail: filippo.aleotti2@unibo.it
'''
import tensorflow as tf
from tensorflow.data import Dataset, Iterator
from main_utils.dataloader_utils import *
import multiprocessing
import numpy as np
from filters.filter_manager import FilterManager
class GeneralLoader(object):
... | 38.246032 | 105 | 0.616933 |
b9df8b950950f5a815dd1689fe08b94e8e692757 | 24,486 | py | Python | dogenode.py | DogepartyXDP/dogenode | 1e8ab144b2175bcea885325b812c33594bf6d6e0 | [
"MIT"
] | null | null | null | dogenode.py | DogepartyXDP/dogenode | 1e8ab144b2175bcea885325b812c33594bf6d6e0 | [
"MIT"
] | 1 | 2022-01-20T15:53:18.000Z | 2022-01-20T16:30:31.000Z | dogenode.py | DogepartyXDP/dogenode | 1e8ab144b2175bcea885325b812c33594bf6d6e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
dogenode.py: script to set up and manage a Dogeparty federated node
'''
import sys
import os
import re
import argparse
import copy
import subprocess
import configparser
import socket
import glob
import shutil
import json
import difflib
from datetime import datetime, timezone
VERSION="2.3.0... | 50.590909 | 184 | 0.648616 |
42ce3e5f9bd00abe05db2606ca00c4f91f9e2e8c | 157 | py | Python | contrib/wallettools/walletunlock.py | Adaryian/eCurrency | efa63c7c2a9a008ad9ae30125826e7495ae8bff5 | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | Adaryian/eCurrency | efa63c7c2a9a008ad9ae30125826e7495ae8bff5 | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | Adaryian/eCurrency | efa63c7c2a9a008ad9ae30125826e7495ae8bff5 | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8079")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) | 39.25 | 46 | 0.770701 |
3a581f8e506d9cac14d0058623b2d79d1dfce84b | 3,787 | py | Python | initcmds/management/commands/inittasks.py | alldevic/mtauksync | 1a5d325ca8a7878aba5b292d7835546b24bb554c | [
"MIT"
] | null | null | null | initcmds/management/commands/inittasks.py | alldevic/mtauksync | 1a5d325ca8a7878aba5b292d7835546b24bb554c | [
"MIT"
] | null | null | null | initcmds/management/commands/inittasks.py | alldevic/mtauksync | 1a5d325ca8a7878aba5b292d7835546b24bb554c | [
"MIT"
] | null | null | null | from datetime import timedelta
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from django.utils import timezone
from django_q.models import Schedule
class Command(BaseCommand):
help = 'Инициализация тасок'
def handle... | 40.72043 | 74 | 0.569052 |
879a4a1b7a7292532528c51eac87907063aee2da | 770 | py | Python | server/models/user.py | dormspam/campus-events | 1041fdc350ea699fe095bfdd969dafe36e3951ef | [
"MIT"
] | 1 | 2020-02-18T20:14:49.000Z | 2020-02-18T20:14:49.000Z | server/models/user.py | dormspam/campus-events | 1041fdc350ea699fe095bfdd969dafe36e3951ef | [
"MIT"
] | 13 | 2020-09-07T23:20:30.000Z | 2022-02-26T23:53:11.000Z | server/models/user.py | dormspam/campus-events | 1041fdc350ea699fe095bfdd969dafe36e3951ef | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, DateTime
from sqlalchemy.orm import relationship
from server.models import Base
import datetime
import secrets
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True,
unique=True, autoincrement=True)
... | 27.5 | 77 | 0.692208 |
4c1e4e0df705eced6187930fdcd86a7dbbd5015e | 201 | py | Python | section-06-operators/1-arithmetic/4-division.py | mugan86/bootcamp-basic-to-expert-from-scratch | 028aab243386e5a75d84aea319c480ec54913c53 | [
"MIT"
] | 31 | 2022-01-19T18:33:40.000Z | 2022-03-29T16:24:44.000Z | section-06-operators/1-arithmetic/4-division.py | mugan86/bootcamp-basic-to-expert-from-scratch | 028aab243386e5a75d84aea319c480ec54913c53 | [
"MIT"
] | 1 | 2022-02-09T17:47:17.000Z | 2022-02-09T17:47:17.000Z | section-06-operators/1-arithmetic/4-division.py | mugan86/bootcamp-basic-to-expert-from-scratch | 028aab243386e5a75d84aea319c480ec54913c53 | [
"MIT"
] | 4 | 2022-01-20T15:41:09.000Z | 2022-03-29T16:25:08.000Z | # Divisiones
x, y , z = 23, 4, 2
a = x / z # 11.5
a = int(x / z) # 11
a = y / y / y # 0.25
a = int(z / y) # 0
a = z / y # 0.5
a = y / z # 2.0
a = int(y / z) # 2
print("Final") | 15.461538 | 22 | 0.358209 |
ab22340a4152f8f7bc877fb878b22c354260cea0 | 26 | py | Python | Server/app/text/Sys.py | lanlian7/MyServer | aa91adb219cb2d0ee0aead05eb2b140e873a7441 | [
"Apache-2.0"
] | null | null | null | Server/app/text/Sys.py | lanlian7/MyServer | aa91adb219cb2d0ee0aead05eb2b140e873a7441 | [
"Apache-2.0"
] | null | null | null | Server/app/text/Sys.py | lanlian7/MyServer | aa91adb219cb2d0ee0aead05eb2b140e873a7441 | [
"Apache-2.0"
] | null | null | null | import sys
print sys.path | 8.666667 | 14 | 0.807692 |
175150b680468f697cb9d434e0a3d5919fea3c8d | 1,795 | py | Python | logger/utils/read_json.py | vwarner1411/openrvdas-1 | 57e8b12aa7e0f840293e8727000f69252578e8a3 | [
"MIT"
] | null | null | null | logger/utils/read_json.py | vwarner1411/openrvdas-1 | 57e8b12aa7e0f840293e8727000f69252578e8a3 | [
"MIT"
] | null | null | null | logger/utils/read_json.py | vwarner1411/openrvdas-1 | 57e8b12aa7e0f840293e8727000f69252578e8a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Utilities for reading/processing JSON data.
"""
import json
import logging
import re
import sys
################################################################################
def _strip(json_str):
"""Strip //-prefixed comments from a JSON string."""
lines = []
for line in json_str.spl... | 33.867925 | 80 | 0.566017 |
a5fbc87c86a5fc6a3e102071db15e7d45bad7329 | 1,563 | py | Python | ProjectEulerCode/prob47.py | khaleeque-ansari/Online-Coding-Problems-Solutions-Python | c8378ccad88ce5f50239f82cf9569344e1b92f18 | [
"Apache-2.0"
] | null | null | null | ProjectEulerCode/prob47.py | khaleeque-ansari/Online-Coding-Problems-Solutions-Python | c8378ccad88ce5f50239f82cf9569344e1b92f18 | [
"Apache-2.0"
] | null | null | null | ProjectEulerCode/prob47.py | khaleeque-ansari/Online-Coding-Problems-Solutions-Python | c8378ccad88ce5f50239f82cf9569344e1b92f18 | [
"Apache-2.0"
] | null | null | null | from prime_check import isprime
prim_list = []
for i in range(2,1000):
if isprime(i):
prim_list.append(i)
#print prim_list
for i in range(100000,140000):
num1 = i
num2 = i+1
num3 = i+2
num4 = i+3
count = 0
count1 = 0
count2 = 0
count3 = 0
loop_c... | 19.78481 | 44 | 0.328215 |
a5ce85c02a0b1e14760a698fda8a869df2e0de84 | 13,050 | py | Python | tests/test_validators.py | gnexcoin/jussi | 02c1044aa38bf4236075c5ec7cf80485eeacda60 | [
"MIT"
] | 26 | 2017-04-05T02:39:37.000Z | 2020-11-03T02:13:56.000Z | tests/test_validators.py | gnexcoin/jussi | 02c1044aa38bf4236075c5ec7cf80485eeacda60 | [
"MIT"
] | 122 | 2017-04-04T18:33:13.000Z | 2021-05-17T02:02:29.000Z | tests/test_validators.py | gnexcoin/jussi | 02c1044aa38bf4236075c5ec7cf80485eeacda60 | [
"MIT"
] | 37 | 2017-08-07T22:55:44.000Z | 2022-01-21T22:56:30.000Z | # -*- coding: utf-8 -*-
import pytest
from .conftest import TEST_UPSTREAM_CONFIG
from jussi.errors import JsonRpcError
from jussi.errors import JussiLimitsError
from jussi.errors import JussiCustomJsonOpLengthError
from jussi.errors import InvalidRequest
from jussi.request.jsonrpc import JSONRPCRequest
from jussi.requ... | 34.073107 | 162 | 0.672874 |
f5f07255f22bcf509b6e902677816bee5d6fc5de | 1,242 | py | Python | bin/doc_extract/doc_extract/repository.py | s-weigand/darglint | 6bc5d764db86626a996de1ff50925f976bf1449e | [
"MIT"
] | 405 | 2017-10-19T11:04:21.000Z | 2022-03-23T07:58:40.000Z | bin/doc_extract/doc_extract/repository.py | s-weigand/darglint | 6bc5d764db86626a996de1ff50925f976bf1449e | [
"MIT"
] | 186 | 2018-03-26T20:33:37.000Z | 2022-03-20T22:47:54.000Z | bin/doc_extract/doc_extract/repository.py | s-weigand/darglint | 6bc5d764db86626a996de1ff50925f976bf1449e | [
"MIT"
] | 43 | 2018-10-14T23:49:48.000Z | 2022-02-10T12:39:16.000Z | """Containts the repository class representing a git repo."""
import os
import subprocess
import tempfile
from typing import (
Dict,
Iterator,
)
class Repository(object):
"""Represents a git repository containing a python project."""
def __init__(self, path: str) -> None:
self.files = dict()... | 32.684211 | 75 | 0.566023 |
b6ad2f5807f668116231d6249902e6347b31599d | 6,843 | py | Python | DataGenerators/utils/camera.py | Reself-C/Dataexpand | 2454fa974deccea8989f46ffd014edf208191616 | [
"MIT"
] | 4 | 2021-06-01T13:48:39.000Z | 2021-11-27T02:34:40.000Z | DataGenerators/utils/camera.py | Reself-C/Dataexpand | 2454fa974deccea8989f46ffd014edf208191616 | [
"MIT"
] | null | null | null | DataGenerators/utils/camera.py | Reself-C/Dataexpand | 2454fa974deccea8989f46ffd014edf208191616 | [
"MIT"
] | null | null | null | import numpy as np
from utils.cam_traj import *
"""Note(Jack BAI):
This file is to deal with the camera part, incl.
- converting the camera from 3D to 2D
- decide the extrinsic and intrinsic camera params.
- simulate the translational movements of the camera
"""
def get_center(data_3d_st... | 34.913265 | 127 | 0.595499 |
83e5d8cf3ea131a02151e77a9a452670d7f42894 | 987 | py | Python | avgamah/modules/Misc/ping.py | thenishantsapkota/Avgamah | c7f1f9a69f8a3f4c4ea53b25dbf62e272750f76c | [
"MIT"
] | 6 | 2021-11-03T06:37:33.000Z | 2022-01-26T15:09:37.000Z | avgamah/modules/Misc/ping.py | thenishantsapkota/Avgamah | c7f1f9a69f8a3f4c4ea53b25dbf62e272750f76c | [
"MIT"
] | 7 | 2021-11-03T14:58:38.000Z | 2022-03-29T23:16:21.000Z | avgamah/modules/Misc/ping.py | thenishantsapkota/Avgamah | c7f1f9a69f8a3f4c4ea53b25dbf62e272750f76c | [
"MIT"
] | 1 | 2021-08-31T08:04:51.000Z | 2021-08-31T08:04:51.000Z | import random
import hikari
import tanjun
from avgamah.core.client import Client
from avgamah.utils.buttons import DELETE_ROW
ping_component = tanjun.Component()
@ping_component.with_slash_command
@tanjun.with_own_permission_check(
hikari.Permissions.SEND_MESSAGES
| hikari.Permissions.VIEW_CHANNEL
| hi... | 28.2 | 103 | 0.738602 |
d4ffd1314bf6ab8b0015c6697d66b44963e5dfb4 | 730 | py | Python | manager/projects/migrations/0007_auto_20200722_2249.py | jlbrewe/hub | c737669e6493ad17536eaa240bed3394b20c6b7d | [
"Apache-2.0"
] | 30 | 2016-03-26T12:08:04.000Z | 2021-12-24T14:48:32.000Z | manager/projects/migrations/0007_auto_20200722_2249.py | jlbrewe/hub | c737669e6493ad17536eaa240bed3394b20c6b7d | [
"Apache-2.0"
] | 1,250 | 2016-03-23T04:56:50.000Z | 2022-03-28T02:27:58.000Z | manager/projects/migrations/0007_auto_20200722_2249.py | jlbrewe/hub | c737669e6493ad17536eaa240bed3394b20c6b7d | [
"Apache-2.0"
] | 11 | 2016-07-14T17:04:20.000Z | 2021-07-01T16:19:09.000Z | # Generated by Django 3.0.8 on 2020-07-22 22:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0006_auto_20200722_0510'),
]
operations = [
migrations.AddField(
model_name='snapshot',
name='path',
... | 30.416667 | 149 | 0.628767 |
ec2a38e7a9aa34a25253dd8e682c41be462f7c36 | 913 | py | Python | first_pj_by_kenny/users/migrations/0002_auto_20190912_2210.py | Loco-doco/first_pj_by_kenny | e67a084ef1f09f105c911c8ffa77874185f8b6f3 | [
"MIT"
] | null | null | null | first_pj_by_kenny/users/migrations/0002_auto_20190912_2210.py | Loco-doco/first_pj_by_kenny | e67a084ef1f09f105c911c8ffa77874185f8b6f3 | [
"MIT"
] | null | null | null | first_pj_by_kenny/users/migrations/0002_auto_20190912_2210.py | Loco-doco/first_pj_by_kenny | e67a084ef1f09f105c911c8ffa77874185f8b6f3 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-12 13:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='bio',
field=mode... | 26.852941 | 147 | 0.538883 |
43cf8e24a0df757455417fb5f4b0cb284c7ccfd7 | 4,126 | py | Python | fpgaedu/hdl/_message_transmitter.py | fpgaedu/controller-nexys4 | 7d9399444feedb17663d391c9770b415e6baa163 | [
"Apache-2.0"
] | null | null | null | fpgaedu/hdl/_message_transmitter.py | fpgaedu/controller-nexys4 | 7d9399444feedb17663d391c9770b415e6baa163 | [
"Apache-2.0"
] | null | null | null | fpgaedu/hdl/_message_transmitter.py | fpgaedu/controller-nexys4 | 7d9399444feedb17663d391c9770b415e6baa163 | [
"Apache-2.0"
] | null | null | null | from myhdl import (enum, always_comb, always_seq, Signal, intbv, always)
def MessageTransmitter(spec, clk, reset, tx_fifo_data_write, tx_fifo_full,
tx_fifo_enqueue, message, ready, transmit_next):
'''
Input signals:
clk
reset
message
tx_fifo_full
transmit_next
... | 37.853211 | 84 | 0.634513 |
680efdf9036da651b139e385cfbbab88d41639e2 | 3,239 | py | Python | Game/Generators.py | NoNotCar/SpaceX | 803390fdf0ed3deee18d8f0d101ae575cf9b55e1 | [
"MIT"
] | null | null | null | Game/Generators.py | NoNotCar/SpaceX | 803390fdf0ed3deee18d8f0d101ae575cf9b55e1 | [
"MIT"
] | null | null | null | Game/Generators.py | NoNotCar/SpaceX | 803390fdf0ed3deee18d8f0d101ae575cf9b55e1 | [
"MIT"
] | null | null | null | from Lib.Vector import VectorX as V
from Objects import Overlays,Special,World,Agriculture
from NoiseGen.perlin import UltraPerlin,HarmonicPerlin
from random import randint,uniform
from Engine import Ores
class Generator(object):
def generate(self,area):
for p in area.bounds.iter_space():
self.g... | 42.064935 | 149 | 0.617475 |
f95e81697a355aa566d482c735b0397f33d3f560 | 755 | py | Python | stuffsharing/urls.py | PukiPuki/CS21022 | ca0d6a35f59e1e0d77d911ced7ece28070cce0b7 | [
"MIT"
] | null | null | null | stuffsharing/urls.py | PukiPuki/CS21022 | ca0d6a35f59e1e0d77d911ced7ece28070cce0b7 | [
"MIT"
] | null | null | null | stuffsharing/urls.py | PukiPuki/CS21022 | ca0d6a35f59e1e0d77d911ced7ece28070cce0b7 | [
"MIT"
] | null | null | null | """stuffsharing URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 32.826087 | 77 | 0.709934 |
cc43d04d732d30983ff4eddee7ea78d9b1e08850 | 9,901 | py | Python | src/action/scripts/record/data/h5utils.py | sbrodeur/ros-icreate-bbb | a9816acb73f3506a3b4e3a19c432341524c9a7e9 | [
"BSD-3-Clause"
] | 4 | 2016-09-22T18:28:21.000Z | 2019-05-21T11:07:06.000Z | src/action/scripts/record/data/h5utils.py | sbrodeur/ros-icreate-bbb | a9816acb73f3506a3b4e3a19c432341524c9a7e9 | [
"BSD-3-Clause"
] | 40 | 2016-09-08T20:08:19.000Z | 2016-12-22T17:38:55.000Z | src/action/scripts/record/data/h5utils.py | sbrodeur/ros-icreate-bbb | a9816acb73f3506a3b4e3a19c432341524c9a7e9 | [
"BSD-3-Clause"
] | 2 | 2016-12-28T08:22:00.000Z | 2021-03-04T17:06:45.000Z | #!/usr/bin/env python
# Copyright (c) 2016, Simon Brodeur
# 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, th... | 38.080769 | 117 | 0.522068 |
3b19ede37ecac972942b423f0fbd266cc20baa7b | 1,152 | py | Python | lab_test/rsa.py | earthshakira/BITS-NS | 4bcd914155e42a0e626d041abb82f731f271f00f | [
"MIT"
] | null | null | null | lab_test/rsa.py | earthshakira/BITS-NS | 4bcd914155e42a0e626d041abb82f731f271f00f | [
"MIT"
] | null | null | null | lab_test/rsa.py | earthshakira/BITS-NS | 4bcd914155e42a0e626d041abb82f731f271f00f | [
"MIT"
] | null | null | null | class RSA:
@classmethod
def gcd(cls,a,b):
if (a%b):
return cls.gcd(b,a%b)
return b
@classmethod
def mod_inv(cls,a,m):
for i in range(2,m):
if (a*i)%m == 1:
return i
return None
@classmethod
def generate(cls,phi):
pairs = []
for pub in range(2,phi):
if (cls.gcd(pub,phi) == 1):
pair ... | 19.862069 | 50 | 0.638889 |
a654f3e7cf48fdff36e07ecfe5d85acb7d17eb30 | 1,963 | py | Python | worker/az.py | sihuan/XZZ | 3704466469ae141631d509d36ef3b445056a09a4 | [
"MIT"
] | 11 | 2021-03-03T08:57:47.000Z | 2022-02-12T16:53:49.000Z | worker/az.py | Brx86/XZZ | 70cc3f25fc4d64e414e2110e85e52c1fd357a0df | [
"MIT"
] | 3 | 2021-03-30T11:31:49.000Z | 2021-12-07T12:11:56.000Z | worker/az.py | Brx86/XZZ | 70cc3f25fc4d64e414e2110e85e52c1fd357a0df | [
"MIT"
] | 9 | 2021-04-14T12:37:21.000Z | 2021-12-03T15:28:12.000Z | # -*- encoding: utf-8 -*-
"""
@File : az.py
@Time : 2021/11/12 13:40:15
@Author : Ayatale
@Version : 1.1
@Contact : ayatale@qq.com
@Github : https://github.com/brx86/
@Desc : 啊这加密,在“啊”与“这”之间隐写文本内容(其实图片也可以,但只能在QQ解密)
"""
from binascii import a2b_hex
from zzcore import StdAns
all_map = {
"c... | 30.671875 | 164 | 0.561895 |
664544664211db59681088893868312c8b7ebce3 | 1,607 | py | Python | examples/adspygoogle/dfp/v201311/creative_service/get_creative.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | null | null | null | examples/adspygoogle/dfp/v201311/creative_service/get_creative.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | null | null | null | examples/adspygoogle/dfp/v201311/creative_service/get_creative.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 33.479167 | 80 | 0.712508 |
7a7fa2292409608f0f081fd47b716000c20dee9f | 4,412 | py | Python | DATA_SORT/3cities/CAM/outputcesmexp_SHFLX_construct.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/CAM/outputcesmexp_SHFLX_construct.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/CAM/outputcesmexp_SHFLX_construct.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | import importlib
import xarray as xr
import numpy as np
import pandas as pd
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
from CASutils import linfit_utils as linfit
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
... | 40.477064 | 96 | 0.677924 |
e1e855174715d4f39bc3bdedb5ceb605c546c5ba | 796 | py | Python | tests/__init__.py | harrisjoseph/incubator-airflow | ac9167f37b586f9ece381763b91a0ee25d736f38 | [
"Apache-2.0"
] | 1 | 2019-03-21T21:25:06.000Z | 2019-03-21T21:25:06.000Z | tests/__init__.py | harrisjoseph/incubator-airflow | ac9167f37b586f9ece381763b91a0ee25d736f38 | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | harrisjoseph/incubator-airflow | ac9167f37b586f9ece381763b91a0ee25d736f38 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
... | 31.84 | 74 | 0.756281 |
9474a1af59962779ad97e659fd5077d199086fc1 | 1,004 | py | Python | willie/modules/isup.py | kmaglione/cfc | aee12bc7165a3bb3d061d729b3984a54b4ff9d74 | [
"EFL-2.0"
] | null | null | null | willie/modules/isup.py | kmaglione/cfc | aee12bc7165a3bb3d061d729b3984a54b4ff9d74 | [
"EFL-2.0"
] | null | null | null | willie/modules/isup.py | kmaglione/cfc | aee12bc7165a3bb3d061d729b3984a54b4ff9d74 | [
"EFL-2.0"
] | null | null | null | # coding=utf8
"""
isup.py - Simple website status check with isup.me
Author: Edward Powell http://embolalia.net
About: http://willie.dftba.net
This allows users to check if a website is up through isup.me.
"""
from __future__ import unicode_literals
from willie import web
from willie.module import commands
@command... | 26.421053 | 70 | 0.596614 |
05d8dc70370545138dc0906f0f9eaf150617ea71 | 9,235 | py | Python | tests/unit/test_buyers_helpers.py | pebblecode/cirrus-buyer-frontend | 506c45eab09fa9538c0eb05643e24feecdcca56f | [
"MIT"
] | null | null | null | tests/unit/test_buyers_helpers.py | pebblecode/cirrus-buyer-frontend | 506c45eab09fa9538c0eb05643e24feecdcca56f | [
"MIT"
] | null | null | null | tests/unit/test_buyers_helpers.py | pebblecode/cirrus-buyer-frontend | 506c45eab09fa9538c0eb05643e24feecdcca56f | [
"MIT"
] | null | null | null | import mock
import unittest
import datetime
from werkzeug.exceptions import NotFound
import app.helpers as helpers
from dmutils.content_loader import ContentLoader
from dmapiclient import api_stubs
content_loader = ContentLoader('tests/fixtures/content')
content_loader.load_manifest('dos', 'data', 'edit_brief')
ques... | 45.945274 | 117 | 0.610612 |
256dcc3f1aa20de142c14f758c74b72d1ef66d63 | 522 | py | Python | utils/eval.py | cutz-j/ICML | aa367de9b2fe2381ca13b11488ebe19159854229 | [
"MIT"
] | 12 | 2020-06-06T09:02:54.000Z | 2021-12-19T06:07:34.000Z | utils/eval.py | cutz-j/ICML | aa367de9b2fe2381ca13b11488ebe19159854229 | [
"MIT"
] | 2 | 2020-08-16T10:11:18.000Z | 2020-12-12T02:59:03.000Z | utils/eval.py | cutz-j/ICML | aa367de9b2fe2381ca13b11488ebe19159854229 | [
"MIT"
] | 8 | 2020-08-13T03:47:54.000Z | 2021-12-08T10:19:07.000Z | from __future__ import print_function, absolute_import
__all__ = ['accuracy']
def accuracy(output, target, topk=[1]):
"""Computes the precision@k for the specified values of k"""
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = ... | 29 | 64 | 0.637931 |
bb0038713763bea8136066f301f4a6dceb281070 | 986 | py | Python | kubernetes_asyncio/test/test_v1_pod_template_list.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_pod_template_list.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_pod_template_list.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 24.65 | 124 | 0.731237 |
e10497f7e572633b0df3f4957daa9dd009e97092 | 6,509 | py | Python | sdk/python/pulumi_azure_native/eventgrid/v20190601/domain.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/eventgrid/v20190601/domain.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/eventgrid/v20190601/domain.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 43.97973 | 1,177 | 0.651713 |
2c0442adfc399a82ffb214118a792e77ed3d909a | 9,563 | py | Python | mango/perpmarketoperations.py | lawrenceyan/mango-explorer | ea16f2a27c51e9e5e0f79d491828ad250f970452 | [
"MIT"
] | null | null | null | mango/perpmarketoperations.py | lawrenceyan/mango-explorer | ea16f2a27c51e9e5e0f79d491828ad250f970452 | [
"MIT"
] | null | null | null | mango/perpmarketoperations.py | lawrenceyan/mango-explorer | ea16f2a27c51e9e5e0f79d491828ad250f970452 | [
"MIT"
] | null | null | null | # # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... | 50.867021 | 235 | 0.742654 |
4b06c0e1b4db24262c05573cad6e087c7fe612eb | 2,238 | py | Python | LeetcodeAlgorithms/188. Best Time to Buy and Sell Stock IV/best-time-to-buy-and-sell-stock-iv.py | Fenghuapiao/PyLeetcode | d804a62643fe935eb61808196a2c093ea9583654 | [
"MIT"
] | 3 | 2019-08-20T06:54:38.000Z | 2022-01-07T12:56:46.000Z | LeetcodeAlgorithms/188. Best Time to Buy and Sell Stock IV/best-time-to-buy-and-sell-stock-iv.py | yhangf/PyLeetcode | d804a62643fe935eb61808196a2c093ea9583654 | [
"MIT"
] | null | null | null | LeetcodeAlgorithms/188. Best Time to Buy and Sell Stock IV/best-time-to-buy-and-sell-stock-iv.py | yhangf/PyLeetcode | d804a62643fe935eb61808196a2c093ea9583654 | [
"MIT"
] | 2 | 2018-11-01T16:10:34.000Z | 2020-06-02T03:24:43.000Z | import heapq
import random
class Solution(object):
def findKthLargest(self, nums, k):
"""
:type A: List[int]
:type k: int
:rtype: int
"""
def quickselect(start, end, nums, k):
if start == end:
return nums[start]
... | 31.083333 | 70 | 0.400357 |
7deda1447e4c1e5b198fa226a2d139dae76939b6 | 2,836 | py | Python | makePOIM.py | mcvidomi/poim2motif | 528602f25dff4124d7858a4f55d726887cd96d17 | [
"MIT"
] | 2 | 2015-07-23T08:30:13.000Z | 2021-05-03T09:42:12.000Z | makePOIM.py | mcvidomi/poim2motif | 528602f25dff4124d7858a4f55d726887cd96d17 | [
"MIT"
] | null | null | null | makePOIM.py | mcvidomi/poim2motif | 528602f25dff4124d7858a4f55d726887cd96d17 | [
"MIT"
] | 1 | 2015-07-23T08:30:16.000Z | 2015-07-23T08:30:16.000Z | import copy
import math
import pdb
import random
import timeit
import cPickle as pickle
import numpy as np
from poim import *
import poim
from shogun.Features import *
from shogun.Kernel import *
from shogun.Classifier import *
from shogun.Evaluation import *
from shutil import *
dna = ['A', 'C', 'G', 'T']
def simula... | 27.803922 | 89 | 0.663611 |
0e4d9261f935bbd94b8fa8c1bbba4687b072f2db | 9,119 | py | Python | 05 - Modules/10 - packages - whl file/sample-setup.py | python-demo-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 2 | 2019-08-23T06:05:55.000Z | 2019-08-26T03:56:07.000Z | 05 - Modules/10 - packages - whl file/sample-setup.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | null | null | null | 05 - Modules/10 - packages - whl file/sample-setup.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 4 | 2020-10-01T07:16:07.000Z | 2021-07-17T07:55:08.000Z | """A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# DETAILS OF SETUP TOOLS SETUP FUNCTION
# https://setuptools.readthedocs.io/en/latest/setuptools.html
# https://packaging.python.org/tutorials/packaging-projec... | 42.61215 | 98 | 0.689001 |
085833f0bf75c7e9e8964b5259d9cc055fa642f1 | 334 | py | Python | Lab/L8/ex2.py | Mi7ai/Algoritmia | 2f1c7b3990e4971f4f977fd0ea4d308004ab3db5 | [
"Apache-2.0"
] | null | null | null | Lab/L8/ex2.py | Mi7ai/Algoritmia | 2f1c7b3990e4971f4f977fd0ea4d308004ab3db5 | [
"Apache-2.0"
] | null | null | null | Lab/L8/ex2.py | Mi7ai/Algoritmia | 2f1c7b3990e4971f4f977fd0ea4d308004ab3db5 | [
"Apache-2.0"
] | null | null | null | from random import shuffle
def punto_fijo(a):
def p(a, i, j):
if j <= i:
return None
m = (i+j)//2
if a[m] == m:
return m
if a[m] > m:
return p(a, i, m)
return p(a, m+1, j)
return p(a, 0, len(a))
a = [5,4,2,3,6,7,8]
print(a)
print(... | 15.904762 | 29 | 0.428144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.