hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
740d7147d41226218a6a1848a57888f7c6193962 | 2,124 | py | Python | .leetcode/390.elimination-game.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/390.elimination-game.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/390.elimination-game.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=390 lang=python3
#
# [390] Elimination Game
#
# https://leetcode.com/problems/elimination-game/description/
#
# algorithms
# Medium (45.71%)
# Likes: 637
# Dislikes: 448
# Total Accepted: 40.6K
# Total Submissions: 88.8K
# Testcase Example: '9'
#
# You have a list arr of all integers in the... | 18 | 78 | 0.59887 |
740d87f1cc5a94a53d932152c32829b9d174efbd | 2,323 | py | Python | ibmsecurity/isam/web/reverse_proxy/mmfa_configuration.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/web/reverse_proxy/mmfa_configuration.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/web/reverse_proxy/mmfa_configuration.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
requires_modules = ["wga"]
requires_version = "9.0.3.0"
def config(isamAppliance, instance_id, lmi, runtime, reuse_acls=None, reuse_certs=None, channel=None,
check_mode=False, force=False):
"""
MMFA configuration for a reverse proxy ins... | 38.081967 | 128 | 0.631941 |
740d8b32ccc84a45fb596729cfdbcee1ddc8a385 | 902 | py | Python | src/scribbler/util.py | okus5416/ScribblerBot | 864bbb9f64c5e667f68e9982626875becb6d33b8 | [
"MIT"
] | null | null | null | src/scribbler/util.py | okus5416/ScribblerBot | 864bbb9f64c5e667f68e9982626875becb6d33b8 | [
"MIT"
] | null | null | null | src/scribbler/util.py | okus5416/ScribblerBot | 864bbb9f64c5e667f68e9982626875becb6d33b8 | [
"MIT"
] | null | null | null | # Copyright 2014 Mitchell Kember. Subject to the MIT License.
"""Some common mathematical utility functions."""
import math
def average(xs):
"""Returns the floating-point average of a list of numbers."""
return sum(xs) / float(len(xs))
def rad_to_deg(theta):
"""Converts radians to degrees."""
retu... | 25.055556 | 78 | 0.640798 |
740d94bdaede163d38c0b132b9ec156d6985bb6b | 1,009 | py | Python | money/admin.py | taqueci/nomoney | 940879ffff0d17724709e642d9c1911ac4e996ce | [
"MIT"
] | null | null | null | money/admin.py | taqueci/nomoney | 940879ffff0d17724709e642d9c1911ac4e996ce | [
"MIT"
] | 2 | 2020-06-06T13:08:38.000Z | 2022-02-10T14:51:16.000Z | money/admin.py | taqueci/nomoney | 940879ffff0d17724709e642d9c1911ac4e996ce | [
"MIT"
] | null | null | null | # Copyright (C) Takeshi Nakamura. All rights reserved.
"""Administrator site settings for money application."""
from django.contrib import admin
from config.settings import SITE_URL
from .models import Account, Journal, Tag, Template
admin.site.site_url = SITE_URL
@admin.register(Account)
class AccountAdmin(admi... | 23.465116 | 72 | 0.696729 |
740db3c60cc2dd02d4d3560fe3e6ff95f6faa245 | 6,097 | py | Python | cnn2d/skp/factory/losses/custom.py | jphdotam/DFDC | b08c31781406e303394642c2af1ab59222115683 | [
"MIT"
] | 48 | 2020-06-12T15:46:14.000Z | 2022-03-19T16:02:05.000Z | cnn2d/skp/factory/losses/custom.py | jphdotam/DFDC | b08c31781406e303394642c2af1ab59222115683 | [
"MIT"
] | 2 | 2020-11-11T10:40:49.000Z | 2020-11-16T02:07:23.000Z | cnn2d/skp/factory/losses/custom.py | jphdotam/DFDC | b08c31781406e303394642c2af1ab59222115683 | [
"MIT"
] | 17 | 2020-06-13T12:25:42.000Z | 2021-11-22T14:49:26.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
class MixupBCELoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, y_pred, y_true):
if type(y_true) == dict:
# Training
y_true1 = y_true['y_true1']
... | 37.635802 | 109 | 0.617681 |
740dc75aa5194298535d4501aa877c193a22039d | 1,400 | py | Python | armi/materials/tests/test_thoriumOxide.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/materials/tests/test_thoriumOxide.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/materials/tests/test_thoriumOxide.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 TerraPower, 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 writi... | 30.434783 | 81 | 0.741429 |
740ddb21cd5d780e4b7f2e6e6d69e6d4bb9d1a1d | 10,225 | py | Python | sunkit_image/time_lag.py | PyDL/sunkit-image | bdfe7b402f204dc204d5e78bf9ca12ad81e1e686 | [
"BSD-2-Clause-NetBSD",
"BSD-2-Clause"
] | 25 | 2018-02-18T06:03:47.000Z | 2022-02-23T19:18:12.000Z | sunkit_image/time_lag.py | PyDL/sunkit-image | bdfe7b402f204dc204d5e78bf9ca12ad81e1e686 | [
"BSD-2-Clause-NetBSD",
"BSD-2-Clause"
] | 69 | 2018-02-13T21:48:29.000Z | 2022-03-24T00:39:37.000Z | sunkit_image/time_lag.py | PyDL/sunkit-image | bdfe7b402f204dc204d5e78bf9ca12ad81e1e686 | [
"BSD-2-Clause-NetBSD",
"BSD-2-Clause"
] | 34 | 2017-11-01T18:32:52.000Z | 2021-12-29T21:30:22.000Z | """
This module contains functions for calculating the cross-correlation and time
lag between intensity cubes.
"""
import numpy as np
import astropy.units as u
__all__ = [
"cross_correlation",
"get_lags",
"max_cross_correlation",
"time_lag",
]
@u.quantity_input
def get_lags(time: u.s):
"""
C... | 38.011152 | 124 | 0.654768 |
740de0a6d36fcc954b5bdae1b8fbb2c1d72edc23 | 3,007 | py | Python | nemo/collections/nlp/data/text_normalization/constants.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | 1 | 2021-09-10T10:40:51.000Z | 2021-09-10T10:40:51.000Z | nemo/collections/nlp/data/text_normalization/constants.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/data/text_normalization/constants.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 26.377193 | 133 | 0.647822 |
740e12d70f2e4396f28e246121d5012165231220 | 560 | py | Python | demos/12-logging/logging-hierarchy/source/data/basemanager.py | sk-dwtoulouse/python-initiation-training | f3883a2ba1fecb615173f27000e5ad944f11ff3f | [
"MIT"
] | 1 | 2021-06-23T06:55:12.000Z | 2021-06-23T06:55:12.000Z | demos/12-logging/logging-hierarchy/source/data/basemanager.py | sk-dwtoulouse/python-initiation-training | f3883a2ba1fecb615173f27000e5ad944f11ff3f | [
"MIT"
] | null | null | null | demos/12-logging/logging-hierarchy/source/data/basemanager.py | sk-dwtoulouse/python-initiation-training | f3883a2ba1fecb615173f27000e5ad944f11ff3f | [
"MIT"
] | 2 | 2021-06-23T12:36:34.000Z | 2021-09-09T14:21:24.000Z | import logging
from os.path import getsize
logger = logging.getLogger("data.basemanager")
class BaseManager:
"""Base data file manager."""
def __init__(self, path: str):
self._path = path
logger.info(f"New file manager initialized for file {path}")
def get_info(self) -> dict:
"... | 22.4 | 68 | 0.591071 |
740e3b79c3c0665c73fa48f899f5860ce42e7720 | 12,435 | py | Python | src/builder.py | cslotboom/planesections | fcb2127a38a78b45de44b75f5805efde89adf5d2 | [
"Apache-2.0"
] | 1 | 2021-11-12T08:36:31.000Z | 2021-11-12T08:36:31.000Z | src/builder.py | cslotboom/planesections | fcb2127a38a78b45de44b75f5805efde89adf5d2 | [
"Apache-2.0"
] | null | null | null | src/builder.py | cslotboom/planesections | fcb2127a38a78b45de44b75f5805efde89adf5d2 | [
"Apache-2.0"
] | null | null | null | import openseespy.opensees as op
import numpy as np
import matplotlib.pyplot as plt
# =============================================================================
# Future additons:
# - plotting features
# - Timoshenko beams
# - Mass for dynamic analysis
# - web interface
# - beam summary?
# ==================... | 26.570513 | 101 | 0.494813 |
740e4a87d2fc92d6825fc1a3d17d086148439b29 | 4,831 | py | Python | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/misc/xmlWriter.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | 1 | 2020-12-07T14:10:03.000Z | 2020-12-07T14:10:03.000Z | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/misc/xmlWriter.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | 9 | 2019-06-15T21:31:27.000Z | 2021-05-08T18:55:51.000Z | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/misc/xmlWriter.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | """xmlWriter.py -- Simple XML authoring class"""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
import sys
import string
INDENT = " "
class XMLWriter(object):
def __init__(self, fileOrPath, indentwhite=INDENT, idlefunc=None, encoding=None):
if encoding is No... | 25.161458 | 82 | 0.646243 |
740e6067a28509426b053bf10ec0406c11be6f80 | 7,721 | py | Python | src/compas/geometry/_shapes/sphere.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | 2 | 2021-03-17T18:14:22.000Z | 2021-09-19T13:50:02.000Z | src/compas/geometry/_shapes/sphere.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | src/compas/geometry/_shapes/sphere.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from math import cos
from math import pi
from math import sin
from compas.geometry import Point
from compas.geometry._shapes import Shape
__all__ = ['Sphere']
class Sphere(Shape):
"""A sphere is define... | 27.974638 | 85 | 0.486465 |
740e78df93acae520df5d5ac55e1f01c4c2c3686 | 3,913 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 may ... | 40.340206 | 122 | 0.682085 |
740e9a4167d6e3e0a32a1797ed178ee8659a095d | 3,052 | py | Python | plugins/phd.py | ItzSjDude/PikaBotPlugins | 6b468a43caefbea5b8f3cd2c1ca83790380e1f5b | [
"Apache-2.0"
] | 1 | 2020-10-29T15:44:57.000Z | 2020-10-29T15:44:57.000Z | plugins/phd.py | ItzSjDude/PikaBotPlugins | 6b468a43caefbea5b8f3cd2c1ca83790380e1f5b | [
"Apache-2.0"
] | null | null | null | plugins/phd.py | ItzSjDude/PikaBotPlugins | 6b468a43caefbea5b8f3cd2c1ca83790380e1f5b | [
"Apache-2.0"
] | 4 | 2020-10-28T09:02:35.000Z | 2020-12-27T22:45:57.000Z | """
Pornhub downloader by @anubisxx
Syntax: .phd link
"""
import asyncio
import requests
from bs4 import BeautifulSoup
from pikabot.utils import ItzSjDude
from telethon.errors.rpcerrorlist import (
UserAlreadyParticipantError,
YouBlockedUserError,
)
from telethon.tl.functions.channels import JoinChannelReque... | 24.416 | 117 | 0.573394 |
740ef4d4b5b9f2bbed85695a4a204799b21f1903 | 1,967 | py | Python | test/test_manufacturability.py | shah-newaz/vaxrank | 65832878f28ce44ccaaf47be3e0c6d38a1743988 | [
"Apache-2.0"
] | null | null | null | test/test_manufacturability.py | shah-newaz/vaxrank | 65832878f28ce44ccaaf47be3e0c6d38a1743988 | [
"Apache-2.0"
] | null | null | null | test/test_manufacturability.py | shah-newaz/vaxrank | 65832878f28ce44ccaaf47be3e0c6d38a1743988 | [
"Apache-2.0"
] | null | null | null | from vaxrank.manufacturability import ManufacturabilityScores
def test_c_terminal_proline():
scores = ManufacturabilityScores.from_amino_acids("A" * 6 + "P")
assert scores.c_terminal_proline
scores = ManufacturabilityScores.from_amino_acids("A" * 7)
assert not scores.c_terminal_proline
def test_n_t... | 32.783333 | 76 | 0.754957 |
740efdac78a7e5e76e93926a4d568fba75318227 | 1,960 | py | Python | app/forms.py | bfeeser/sentinel | db46748463175a3ec8c31034cd25b1a670b0ad53 | [
"MIT"
] | null | null | null | app/forms.py | bfeeser/sentinel | db46748463175a3ec8c31034cd25b1a670b0ad53 | [
"MIT"
] | null | null | null | app/forms.py | bfeeser/sentinel | db46748463175a3ec8c31034cd25b1a670b0ad53 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import (
widgets,
HiddenField,
BooleanField,
TextField,
PasswordField,
SubmitField,
SelectField,
SelectMultipleField,
DateTimeField,
)
from wtforms.validators import Email, Length, Required, EqualTo, Optional
day_map = {
"0": "Mon",
... | 26.849315 | 76 | 0.634694 |
740f0d29f562fdec5d8431c98e9fd49552d959dd | 6,742 | py | Python | lib/kb_Bowtie2/kb_Bowtie2Client.py | mclark58/kb_Bowtie2 | f0426b3d8e5855394864b0bf6bd733bb87b3293a | [
"MIT"
] | 1 | 2020-01-13T19:33:02.000Z | 2020-01-13T19:33:02.000Z | lib/kb_Bowtie2/kb_Bowtie2Client.py | mclark58/kb_Bowtie2 | f0426b3d8e5855394864b0bf6bd733bb87b3293a | [
"MIT"
] | 5 | 2017-08-28T14:47:08.000Z | 2019-06-06T21:56:09.000Z | lib/kb_Bowtie2/kb_Bowtie2Client.py | mclark58/kb_Bowtie2 | f0426b3d8e5855394864b0bf6bd733bb87b3293a | [
"MIT"
] | 8 | 2017-07-10T01:29:51.000Z | 2020-07-17T01:38:25.000Z | # -*- coding: utf-8 -*-
############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
# the following is a hack to get the basec... | 52.263566 | 79 | 0.648324 |
740f370a2f78bdc6aae8851ce9d9a4990efd3e46 | 16,181 | py | Python | bot/cogs/auctionhouse.py | bryanpalmer/AzsocamiBot | 3e163ef793abf2be2b64835f901bec7cdfd10cc6 | [
"MIT"
] | 2 | 2021-03-03T04:28:24.000Z | 2021-10-12T09:36:16.000Z | bot/cogs/auctionhouse.py | bryanpalmer/AzsocamiBot | 3e163ef793abf2be2b64835f901bec7cdfd10cc6 | [
"MIT"
] | null | null | null | bot/cogs/auctionhouse.py | bryanpalmer/AzsocamiBot | 3e163ef793abf2be2b64835f901bec7cdfd10cc6 | [
"MIT"
] | 1 | 2021-03-03T04:28:27.000Z | 2021-03-03T04:28:27.000Z | import discord
from discord.ext import commands
import os, sys, inspect
import asyncio
from datetime import datetime
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import botlib
import wowapi
import umj
D... | 40.655779 | 222 | 0.509981 |
740f4e54bc39e477a9ad6f7be2caf05ae9c24d98 | 960 | py | Python | main/links/migrations/0005_auto_20161115_2208.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | main/links/migrations/0005_auto_20161115_2208.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | main/links/migrations/0005_auto_20161115_2208.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-15 22:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('links', '0004_generate_default_titles_for_titleless_links'),
]
operations = [
... | 30.967742 | 139 | 0.58125 |
740f74ccf4572615cd53824e0f9a8b3dc72e307c | 888 | py | Python | oscar/lib/python2.7/site-packages/django/db/backends/oracle/functions.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/db/backends/oracle/functions.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/db/backends/oracle/functions.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.db.models import DecimalField, DurationField, Func
class IntervalToSeconds(Func):
function = ''
template = """
EXTRACT(day from %(expressions)s) * 86400 +
EXTRACT(hour from %(expressions)s) * 3600 +
EXTRACT(minute from %(expressions)s) * 60 +
EXTRACT(second from %(expressi... | 35.52 | 96 | 0.671171 |
740f7a07dba56f111ed32f9b7e6027fe89549eb4 | 876 | py | Python | hashicorp_vault_client/test/test_body110.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | hashicorp_vault_client/test/test_body110.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | 2 | 2019-09-30T20:56:41.000Z | 2019-10-02T00:22:07.000Z | hashicorp_vault_client/test/test_body110.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
HashiCorp Vault API
HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`. # noqa: E501
OpenAPI spec version: 1.2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
... | 21.9 | 104 | 0.686073 |
740f82b423719ea817e07d3b6924b453fb4d4b68 | 493 | py | Python | tests/data/expected/main/main_jsonschema_complex_any_of/output.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 891 | 2019-07-23T04:23:32.000Z | 2022-03-31T13:36:33.000Z | tests/data/expected/main/main_jsonschema_complex_any_of/output.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 663 | 2019-07-23T09:50:26.000Z | 2022-03-29T01:56:55.000Z | tests/data/expected/main/main_jsonschema_complex_any_of/output.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 108 | 2019-07-23T08:50:37.000Z | 2022-03-09T10:50:22.000Z | # generated by datamodel-codegen:
# filename: complex_any_of.json
# timestamp: 2019-07-26T00:00:00+00:00
from __future__ import annotations
from typing import List, Union
from pydantic import BaseModel, Extra
class Key(BaseModel):
class Config:
extra = Extra.forbid
address: str
nat: str
... | 16.433333 | 41 | 0.691684 |
740f96c482a2fd4c0c54d37d57c43504efceb5eb | 581 | py | Python | django_joblog/migrations/0003_alter_state_choices.py | defgsus/django-joblog | 88467f951d7ebc586c69e421cab39e4caa395cca | [
"MIT"
] | null | null | null | django_joblog/migrations/0003_alter_state_choices.py | defgsus/django-joblog | 88467f951d7ebc586c69e421cab39e4caa395cca | [
"MIT"
] | null | null | null | django_joblog/migrations/0003_alter_state_choices.py | defgsus/django-joblog | 88467f951d7ebc586c69e421cab39e4caa395cca | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-04-29 11:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_joblog', '0002_alter_state_choices'),
]
operations = [
migrations.AlterField(
model_name='joblogmodel',
name='s... | 30.578947 | 236 | 0.619621 |
740f9b7b82fd192d2983586ab6bb155d1c213d8a | 5,378 | py | Python | res/downloadTestResources.py | c64cryptoboy/ChiptuneSAK | 8759135b5c9c26dc9da155b006c575243ba5304a | [
"MIT"
] | 9 | 2020-08-16T05:06:55.000Z | 2021-11-05T06:18:54.000Z | res/downloadTestResources.py | c64cryptoboy/ChiptuneSAK | 8759135b5c9c26dc9da155b006c575243ba5304a | [
"MIT"
] | null | null | null | res/downloadTestResources.py | c64cryptoboy/ChiptuneSAK | 8759135b5c9c26dc9da155b006c575243ba5304a | [
"MIT"
] | null | null | null | # Download additional resources that could be used in testing / demonstrations
# that don't belong in the github code base
import os
import time
import requests
from random import uniform
from chiptunesak.constants import project_to_absolute_path
SKIP_IF_EXISTS = True
last_site = None
class ResourceFile:
def _... | 32.993865 | 150 | 0.668278 |
740fbd254e3ff6a6194fc8d45aa0bca5b4f77d30 | 1,722 | py | Python | tests/test_filter.py | c4deszes/pytest-variant | 0b7de6bd5c11ef0923f986aa7ee3f59af8cc6f65 | [
"MIT"
] | null | null | null | tests/test_filter.py | c4deszes/pytest-variant | 0b7de6bd5c11ef0923f986aa7ee3f59af8cc6f65 | [
"MIT"
] | null | null | null | tests/test_filter.py | c4deszes/pytest-variant | 0b7de6bd5c11ef0923f986aa7ee3f59af8cc6f65 | [
"MIT"
] | null | null | null | #pylint: disable = missing-function-docstring
"""
Tests variant filtering mechanisms
"""
import pytest
@pytest.mark.integration
def test_filter_dict(testdir):
testdir.makeconftest(
"""
# Local variant setting
def pytest_configure(config):
config.variant = {'os': 'win32', 'arch':... | 24.6 | 69 | 0.558072 |
740febd9c9a7485af7a24bbedd4ebc67c34eba4b | 1,350 | py | Python | example/public/__init__.py | tml/pyxer | 4e3677b3f2c7f23ebf039a9ba9733f68a8460189 | [
"MIT"
] | 2 | 2016-01-25T06:01:14.000Z | 2016-02-07T20:30:25.000Z | example/public/__init__.py | tml/pyxer | 4e3677b3f2c7f23ebf039a9ba9733f68a8460189 | [
"MIT"
] | 2 | 2018-03-21T06:27:50.000Z | 2018-03-22T12:57:58.000Z | example/public/__init__.py | tml/pyxer | 4e3677b3f2c7f23ebf039a9ba9733f68a8460189 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
from pyxer.base import *
import sys
import os
import logging
import pyxer
import pprint
log = logging.getLogg... | 25.961538 | 63 | 0.516296 |
7410037e235230eb75205b4581cbbeed1ea9fbcf | 907 | py | Python | tests/test_ngrams_valence_processing.py | warwickpsych/ngramsNVI | 4f07fc22eef973625180c6f9b4827b1324947614 | [
"MIT"
] | null | null | null | tests/test_ngrams_valence_processing.py | warwickpsych/ngramsNVI | 4f07fc22eef973625180c6f9b4827b1324947614 | [
"MIT"
] | null | null | null | tests/test_ngrams_valence_processing.py | warwickpsych/ngramsNVI | 4f07fc22eef973625180c6f9b4827b1324947614 | [
"MIT"
] | 1 | 2020-01-02T17:13:18.000Z | 2020-01-02T17:13:18.000Z | import os
from ngramsNVI.create_NVI import load_valence_data, merge_ngrams_and_ANEW_data
from ngramsNVI.utils import download_nrgams_file
from ngramsNVI.constants import PACKAGE_LOCATION
def test_ngrams_valence_processing():
"""Test whether ngrams data is successfully loading and merging with the ANEW data
... | 30.233333 | 97 | 0.762955 |
7410450cdd77e299a5ce04da1c184e2424eed4b6 | 3,596 | py | Python | dns-client.py | pooleja/DnsE16 | 496c208c051b4da318558c6079de7f67a4c95578 | [
"MIT"
] | 4 | 2016-08-30T19:13:01.000Z | 2018-11-07T19:47:42.000Z | dns-client.py | pooleja/DnsE16 | 496c208c051b4da318558c6079de7f67a4c95578 | [
"MIT"
] | null | null | null | dns-client.py | pooleja/DnsE16 | 496c208c051b4da318558c6079de7f67a4c95578 | [
"MIT"
] | null | null | null |
#
# Command line usage:
# $ python3 dns-client.py --help
#
import json
import sys
import click
# import from the 21 Developer Library
from two1.commands.config import Config
from two1.wallet import Wallet
from two1.bitrequests import BitTransferRequests
# set up bitrequest client for BitTransfer requests
wallet = W... | 23.81457 | 76 | 0.640434 |
74105ba6265a98cb30588b3c4a3ef681f61f27a5 | 1,364 | py | Python | stackoverflow-solutions/submission-scripts/SO_Q56608719_unable-to-get-all-the-names-from-the-landing-page-of-a-website.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 1 | 2020-07-21T23:24:25.000Z | 2020-07-21T23:24:25.000Z | stackoverflow-solutions/submission-scripts/SO_Q56608719_unable-to-get-all-the-names-from-the-landing-page-of-a-website.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 4 | 2021-06-29T00:38:57.000Z | 2022-01-15T00:22:15.000Z | stackoverflow-solutions/submission-scripts/SO_Q56608719_unable-to-get-all-the-names-from-the-landing-page-of-a-website.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | null | null | null |
"""
Topic: Getting all colleges from a site without hitting a "show more results" button.
Ref: https://stackoverflow.com/questions/56608719/unable-to-get-all-the-names-from-the-landing-page-of-a-website/56610460#56610460
"""
import re
import requests
from bs4 import BeautifulSoup
url = r'https://www.abhe.org/dire... | 33.268293 | 149 | 0.728739 |
74107edbc82afaf39feeff5f44c5f93c2560f9bb | 21,117 | py | Python | src/isambard/specifications/helix.py | isambard-uob/isambard | febb9d48cb16d75be7cf4252b5c36bad57897d58 | [
"MIT"
] | 13 | 2018-06-18T14:34:27.000Z | 2021-11-27T19:49:07.000Z | src/isambard/specifications/helix.py | isambard-uob/isambard | febb9d48cb16d75be7cf4252b5c36bad57897d58 | [
"MIT"
] | 14 | 2018-06-18T11:47:39.000Z | 2022-03-18T17:34:40.000Z | src/isambard/specifications/helix.py | isambard-uob/isambard | febb9d48cb16d75be7cf4252b5c36bad57897d58 | [
"MIT"
] | 5 | 2018-06-19T16:01:07.000Z | 2021-07-10T14:23:25.000Z | """Contains classes and functions for modelling helical structure."""
from collections import OrderedDict
import numpy
from ampal.geometry import (Quaternion, dihedral, find_transformations,
cylindrical_to_cartesian, Axis, HelicalCurve)
from ampal import Atom, Residue, Polypeptide
from amp... | 37.641711 | 95 | 0.579722 |
7410831b9588719e73930555a2f27b5a44ba677c | 312 | py | Python | genrl/trainers/__init__.py | mehulrastogi/genrl | 589a3619497b38eaa376168c78b9f84d4ff434e5 | [
"MIT"
] | 390 | 2020-05-03T17:34:02.000Z | 2022-03-05T11:29:07.000Z | genrl/trainers/__init__.py | mehulrastogi/genrl | 589a3619497b38eaa376168c78b9f84d4ff434e5 | [
"MIT"
] | 306 | 2020-05-03T05:53:53.000Z | 2022-03-12T00:27:28.000Z | genrl/trainers/__init__.py | mehulrastogi/genrl | 589a3619497b38eaa376168c78b9f84d4ff434e5 | [
"MIT"
] | 64 | 2020-05-05T20:23:30.000Z | 2022-03-30T08:43:10.000Z | from genrl.trainers.bandit import BanditTrainer, DCBTrainer, MABTrainer # noqa
from genrl.trainers.base import Trainer # noqa
from genrl.trainers.classical import ClassicalTrainer # noqa
from genrl.trainers.offpolicy import OffPolicyTrainer # noqa
from genrl.trainers.onpolicy import OnPolicyTrainer # noqa
| 52 | 79 | 0.826923 |
74109e9f7576fb2f576cf729016c9b22638ca9c5 | 243 | py | Python | server/framework/db/fixtures/__init__.py | tetelevm/OrdeRPG | 5bea9fbaf3fdd84ab14f7e3033e18eead2cf30ab | [
"MIT"
] | null | null | null | server/framework/db/fixtures/__init__.py | tetelevm/OrdeRPG | 5bea9fbaf3fdd84ab14f7e3033e18eead2cf30ab | [
"MIT"
] | null | null | null | server/framework/db/fixtures/__init__.py | tetelevm/OrdeRPG | 5bea9fbaf3fdd84ab14f7e3033e18eead2cf30ab | [
"MIT"
] | null | null | null | from .reader import __all_for_module__ as _reader_all_
from .creator import __all_for_module__ as __creator_all__
from .reader import *
from .creator import *
__all_for_module__ = _reader_all_ + __creator_all__
__all__ = __all_for_module__
| 24.3 | 58 | 0.835391 |
7410a3f3af494d320f54503beb73858c647ca960 | 780 | py | Python | flask_swagger_generator/utils/version.py | coding-kitties/flask-swagger-generator | e3fa56f97e57f4d95231e5a0ef8c0bdeb54e7ae3 | [
"MIT"
] | 2 | 2021-09-02T09:54:58.000Z | 2022-02-10T01:23:20.000Z | flask_swagger_generator/utils/version.py | coding-kitties/flask-swagger-generator | e3fa56f97e57f4d95231e5a0ef8c0bdeb54e7ae3 | [
"MIT"
] | 3 | 2020-12-28T18:57:37.000Z | 2021-07-25T11:14:32.000Z | flask_swagger_generator/utils/version.py | coding-kitties/flask-swagger-generator | e3fa56f97e57f4d95231e5a0ef8c0bdeb54e7ae3 | [
"MIT"
] | 2 | 2021-09-02T09:55:04.000Z | 2021-09-29T12:19:17.000Z | def get_version(version=None):
version = get_complete_version(version)
main = get_main_version(version)
return main
def get_main_version(version=None):
"""Return main version (X.Y[.Z]) from VERSION."""
version = get_complete_version(version)
parts = 2 if version[2] == 0 else 3
return '.'.j... | 28.888889 | 76 | 0.671795 |
7410b4c0f742eaee8ded592bb7ec5767ec0bec8a | 10,175 | py | Python | Allura/allura/scripts/refreshrepo.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | null | null | null | Allura/allura/scripts/refreshrepo.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | null | null | null | Allura/allura/scripts/refreshrepo.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 50.875 | 118 | 0.513612 |
7410c0758aa2f67bb59a622455e7cf6be421f2d0 | 5,034 | py | Python | test_image.py | PrendiProgramming/CTRL-C | 33649170f94f1bdc568163762ab2c1787f2fc948 | [
"Apache-2.0"
] | 43 | 2021-09-06T08:00:41.000Z | 2022-03-24T08:14:31.000Z | test_image.py | PrendiProgramming/CTRL-C | 33649170f94f1bdc568163762ab2c1787f2fc948 | [
"Apache-2.0"
] | 4 | 2021-09-10T17:11:42.000Z | 2022-03-31T02:04:12.000Z | test_image.py | PrendiProgramming/CTRL-C | 33649170f94f1bdc568163762ab2c1787f2fc948 | [
"Apache-2.0"
] | 6 | 2021-09-07T04:04:27.000Z | 2021-11-30T10:48:22.000Z | import os
import os.path as osp
import argparse
from datetime import date
import json
import random
import time
from pathlib import Path
import numpy as np
import numpy.linalg as LA
from tqdm import tqdm
import matplotlib as mpl
import matplotlib.pyplot as plt
import cv2
import csv
import torch
import torch.nn.functio... | 33.56 | 87 | 0.597735 |
7410c111de161b2dc04ba5ee4c4be59943eb7d73 | 17,309 | py | Python | src/networks/Resnet50_encoder.py | knmac/LCDC_release | f977ca1cda972983cac7e33b324f07f2e1463a19 | [
"MIT"
] | 24 | 2019-09-18T09:22:08.000Z | 2022-03-08T06:47:33.000Z | src/networks/Resnet50_encoder.py | knmac/LCDC_release | f977ca1cda972983cac7e33b324f07f2e1463a19 | [
"MIT"
] | 6 | 2019-09-18T09:21:02.000Z | 2022-02-09T23:31:48.000Z | src/networks/Resnet50_encoder.py | knmac/LCDC_release | f977ca1cda972983cac7e33b324f07f2e1463a19 | [
"MIT"
] | 4 | 2020-08-06T02:05:36.000Z | 2021-12-12T07:19:17.000Z | """DC net
"""
from .network import Network
class Resnet50Encoder(Network):
def build_graph(self):
""" Build graph for model
"""
n_classes = self.n_classes
# Feature extraction
(self.feed('data')
.conv(7, 7, 64, 2, 2, relu=False, name='conv1')
.bat... | 52.610942 | 89 | 0.581663 |
7410e166e565de57a0c51f1e8e050e9695c04ca0 | 2,898 | py | Python | submarine-sdk/pysubmarine/tests/tracking/test_tracking.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 544 | 2019-10-29T02:35:31.000Z | 2022-03-31T21:22:44.000Z | submarine-sdk/pysubmarine/tests/tracking/test_tracking.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 545 | 2019-10-29T03:21:38.000Z | 2022-03-30T05:21:15.000Z | submarine-sdk/pysubmarine/tests/tracking/test_tracking.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 220 | 2019-10-29T05:14:03.000Z | 2022-03-28T07:29:30.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 use t... | 38.131579 | 93 | 0.668737 |
7410e545ce63caeb3d5a7dfca6429f88d1d28475 | 1,274 | py | Python | scripts/example_server.py | Noneus/slojsonrpc | 33b5d79486e1562fe4fc7b73b8f3014535168b03 | [
"MIT"
] | null | null | null | scripts/example_server.py | Noneus/slojsonrpc | 33b5d79486e1562fe4fc7b73b8f3014535168b03 | [
"MIT"
] | null | null | null | scripts/example_server.py | Noneus/slojsonrpc | 33b5d79486e1562fe4fc7b73b8f3014535168b03 | [
"MIT"
] | null | null | null | '''
The MIT License (MIT)
Copyright (c) 2014 Stefan Lohmaier
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, mer... | 38.606061 | 80 | 0.797488 |
7410f891422c6f6358ed76d02ac147a2d11e0f92 | 6,212 | py | Python | apps/manager/models.py | hangpark/django-docker-boilerplate | aa3cb19fad00e90df52a0850d3403984804feb4b | [
"MIT"
] | 7 | 2018-06-11T07:55:35.000Z | 2021-12-13T03:07:14.000Z | apps/manager/models.py | hangpark/django-docker-boilerplate | aa3cb19fad00e90df52a0850d3403984804feb4b | [
"MIT"
] | 2 | 2020-06-05T17:38:01.000Z | 2021-06-10T19:11:51.000Z | apps/manager/models.py | hangpark/django-docker-boilerplate | aa3cb19fad00e90df52a0850d3403984804feb4b | [
"MIT"
] | 2 | 2018-12-02T10:30:23.000Z | 2020-09-09T16:45:08.000Z | """
Models of service manager.
"""
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from .constants import *
# Basic service permissions
PERMISSION_CHOICES = (
(PERM_NONE, _("No permission")),
(PERM_ACCESS, _("Can access")),
(PERM_READ, _... | 28.495413 | 99 | 0.643271 |
741113431b520408c8bc9551ef620b8bb3bffc30 | 2,855 | py | Python | addons/wiki/tests/test_models.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | addons/wiki/tests/test_models.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | addons/wiki/tests/test_models.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | import pytest
from modularodm.exceptions import ValidationValueError
from addons.wiki.models import NodeWikiPage
from addons.wiki.tests.factories import NodeWikiFactory
from osf_tests.factories import NodeFactory, UserFactory, ProjectFactory
from tests.base import OsfTestCase
pytestmark = pytest.mark.django_db
# fr... | 35.246914 | 94 | 0.673905 |
74111fdd86a18740eb5e156fe99193ce26823e38 | 8,290 | py | Python | docs/conf.py | EvgeneOskin/django-geohash-cluster | 3b94055e4f1daede7962d2fc6b70075fee338f90 | [
"MIT"
] | 3 | 2019-10-05T03:54:57.000Z | 2020-12-07T04:06:44.000Z | docs/conf.py | EvgeneOskin/django-geohash-cluster | 3b94055e4f1daede7962d2fc6b70075fee338f90 | [
"MIT"
] | 1 | 2017-12-01T04:45:16.000Z | 2017-12-01T04:45:16.000Z | docs/conf.py | EvgeneOskin/django-geohash-cluster | 3b94055e4f1daede7962d2fc6b70075fee338f90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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.
#
# ... | 32.256809 | 82 | 0.720386 |
741123045d815aaecf7195440e753098d7c0b28d | 998 | py | Python | scripts/leetcode/amzn/mergedIntervals.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/leetcode/amzn/mergedIntervals.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/leetcode/amzn/mergedIntervals.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals,
and return an array of the non-overlapping intervals that cover all the intervals in the input.
Example 1:
Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]
Explanation: Since intervals... | 26.263158 | 98 | 0.601202 |
7411311eb938934450f28180998111f3637ed3ea | 11,242 | py | Python | benchmarking/pytorch_geometric/train_ppi.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | benchmarking/pytorch_geometric/train_ppi.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | benchmarking/pytorch_geometric/train_ppi.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | #
# GCN torch-geometric training script for psp
# based on https://github.com/rusty1s/pytorch_geometric/blob/master/examples/gcn.py
import argparse
import datetime
import os
import time
import numpy as np
import ppi_dataloader as dl
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metri... | 37.598662 | 116 | 0.62987 |
741143740722d3f155ae25b6270d4592eb432593 | 5,285 | py | Python | scripts/probe_phi.py | Compiler-max/MEPinterp | e1b8ba0ec4a4c61d61f6555608fb26aeaaf64d71 | [
"MIT"
] | 2 | 2019-05-07T04:53:45.000Z | 2019-08-16T20:52:07.000Z | scripts/probe_phi.py | cMax347/MEPinterp | e1b8ba0ec4a4c61d61f6555608fb26aeaaf64d71 | [
"MIT"
] | null | null | null | scripts/probe_phi.py | cMax347/MEPinterp | e1b8ba0ec4a4c61d61f6555608fb26aeaaf64d71 | [
"MIT"
] | null | null | null | import numpy as np
import datetime
import os
from mep_worker import MEP_worker
import matplotlib.pyplot as plt
class Phi_probe:
def __init__( self,n_phi, val_bands, mp_grid, gamma_scale, kubo_tol,
hw, n_eF, eF_min, eF_max, Tkelvin, eta_smearing,debug_mode, do_gauge_trafo='T' ,
do_write_velo='F', ... | 24.581395 | 143 | 0.60965 |
7411465de8ab3ec7199f9b48d45896993198c7ac | 28,480 | py | Python | tests/registries/test_matching_for_changing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | tests/registries/test_matching_for_changing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | tests/registries/test_matching_for_changing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | import copy
import pytest
import kopf
from kopf.structs.bodies import Body
from kopf.structs.dicts import parse_field
from kopf.structs.filters import ABSENT, PRESENT
from kopf.structs.handlers import ALL_REASONS, Reason, ResourceChangingHandler
# Used in the tests. Must be global-scoped, or its qualname will be af... | 35.555556 | 133 | 0.700808 |
74114f0f446614ae45515f3b56b310981b697604 | 1,918 | py | Python | toontown/dna/DNAWall.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/dna/DNAWall.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/dna/DNAWall.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from panda3d.core import LVector4f, LPoint3f
from toontown.dna import DNANode
# For the oddest reason the toontown.dna breaks the import? Wth
import DNAFlatBuilding
from toontown.dna import DNAError
from toontown.dna import DNAUtil
class DNAWall(DNANode.DNANode):
__slots__ = (
'code', 'height', 'color')
... | 29.507692 | 93 | 0.629301 |
7411bf0ef5ec264152cb79cc5d73075f7fd67256 | 6,834 | py | Python | nanotune/tests/data/test_dotfit.py | microsoft/nanotune | 68be8f5b74a52d57b74ccac228e120d9ab48e3e4 | [
"MIT"
] | 5 | 2021-02-24T14:32:37.000Z | 2022-01-05T16:37:26.000Z | nanotune/tests/data/test_dotfit.py | microsoft/nanotune | 68be8f5b74a52d57b74ccac228e120d9ab48e3e4 | [
"MIT"
] | 149 | 2021-03-23T14:44:39.000Z | 2022-03-31T06:09:07.000Z | nanotune/tests/data/test_dotfit.py | LaudateCorpus1/nanotune | 0ada354597b16f6dbb17ca7be01ab7668b6d5049 | [
"MIT"
] | 10 | 2021-03-29T13:36:38.000Z | 2022-02-16T23:06:35.000Z | import math
import os
import numpy as np
import pytest
import nanotune as nt
from nanotune.fit.dotfit import DotFit
from nanotune.tests.data.conftest import generate_doubledot_data
atol = 1e-05
def test_dotfit_init(nt_dataset_doubledot, tmp_path):
attributes = [
"segment_size",
"triple_points"... | 30.64574 | 81 | 0.653936 |
7411c117b3230942bd8e53a31ee649759b65a28d | 3,077 | py | Python | cvdm/score/ndr.py | joyceho/cvdm | df386290221fd1388bef06104db0dd07978f91d9 | [
"MIT"
] | 2 | 2020-11-29T00:05:05.000Z | 2020-12-01T23:34:17.000Z | cvdm/score/ndr.py | joyceho/cvdm | df386290221fd1388bef06104db0dd07978f91d9 | [
"MIT"
] | null | null | null | cvdm/score/ndr.py | joyceho/cvdm | df386290221fd1388bef06104db0dd07978f91d9 | [
"MIT"
] | null | null | null | """
NDR
See: Zethelius, Björn, et al.
"A new model for 5-year risk of cardiovascular disease in
type 2 diabetes, from the Swedish National Diabetes Register (NDR)."
Diabetes research and clinical practice 93.2 (2011): 276-284.
"""
import numpy as np
from cvdm.score import cox_surv, BaseRisk
from cvdm.score import... | 30.465347 | 84 | 0.470588 |
7411dc9b98dd8f75441c20e02a5e03bc10aa03c4 | 1,071 | py | Python | LC/243.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/243.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/243.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def shortestDistance(self, words, word1, word2):
"""
:type words: List[str]
:type word1: str
:type word2: str
:rtype: int
"""
# current one (or you can call it previous one if you want) records the index and content so that we can compa... | 42.84 | 143 | 0.530345 |
7411f0d7fb5719ff9a0976bfcf499b2c2949f2df | 12,965 | py | Python | scrabbler/MCTSStrategy.py | jfoley-yw/scrabble | 049a69572138b06341af163ec69e18a1eb20b737 | [
"MIT"
] | 1 | 2021-04-01T14:24:17.000Z | 2021-04-01T14:24:17.000Z | scrabbler/MCTSStrategy.py | jfoley-yw/scrabble | 049a69572138b06341af163ec69e18a1eb20b737 | [
"MIT"
] | 3 | 2021-04-05T01:09:16.000Z | 2021-04-19T20:19:30.000Z | scrabbler/MCTSStrategy.py | jfoley-yw/scrabble | 049a69572138b06341af163ec69e18a1eb20b737 | [
"MIT"
] | null | null | null | import copy
import random
import math
from scrabbler.strategy import Strategy
from collections import defaultdict
from scrabbler.MCTSgamestate import MCTSgamestate
''' Represents an implementation of UCT (Upper Confidence bound applied to Trees), which is a
type of Monte Carlo Tree Search algorithm.
'''
class MCT... | 43.361204 | 145 | 0.619591 |
7412099461f9cb5fd5b178a8a891ea05a76d4cab | 10,191 | py | Python | axopy/gui/canvas.py | jdekarske/axopy | a60abb44a12c5e833b9033170825773bb0691394 | [
"MIT"
] | 13 | 2019-01-23T13:00:00.000Z | 2022-01-17T14:45:32.000Z | axopy/gui/canvas.py | jdekarske/axopy | a60abb44a12c5e833b9033170825773bb0691394 | [
"MIT"
] | 45 | 2017-01-16T22:44:59.000Z | 2018-12-18T18:43:08.000Z | axopy/gui/canvas.py | jdekarske/axopy | a60abb44a12c5e833b9033170825773bb0691394 | [
"MIT"
] | 5 | 2017-01-13T00:14:08.000Z | 2018-11-08T13:16:24.000Z | """2D canvas style graphics functionality backed by Qt's QGraphicsView."""
from PyQt5 import QtCore, QtGui, QtWidgets
class Canvas(QtWidgets.QGraphicsView):
"""A 2D canvas interface implemented using a QGraphicsView.
This view essentially just holds a QGraphicsScene that grows to fit the
size of the vie... | 30.061947 | 79 | 0.614071 |
74121351b8932df3fcc53d8bd9ecf11d89737a16 | 3,625 | py | Python | salt/roster/__init__.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | salt/roster/__init__.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | salt/roster/__init__.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Generate roster data, this data is used by non-minion devices which need to be
hit from the master rather than acting as an independent entity. This covers
hitting minions without zeromq in place via an ssh agent, and connecting to
systems that cannot or should not host a minion agent.
'''
f... | 32.657658 | 78 | 0.604138 |
74121b0556927ff16c7d4d24752f15cbca0f1b2b | 3,838 | py | Python | binderhub/tests/test_auth.py | jupyterhub/builderhub | 37551212e47f515186b62fa02443f50b6e7b5839 | [
"BSD-3-Clause"
] | null | null | null | binderhub/tests/test_auth.py | jupyterhub/builderhub | 37551212e47f515186b62fa02443f50b6e7b5839 | [
"BSD-3-Clause"
] | null | null | null | binderhub/tests/test_auth.py | jupyterhub/builderhub | 37551212e47f515186b62fa02443f50b6e7b5839 | [
"BSD-3-Clause"
] | null | null | null | """Test authentication"""
import ipaddress
import json
from unittest import mock
from urllib.parse import urlparse
import pytest
from .conftest import skip_remote
from .utils import async_requests
@pytest.fixture
def use_session():
# setup
async_requests.set_session()
yield "run the test function"
... | 29.29771 | 97 | 0.604742 |
74122aef427f247dfc2e648f0c2f015f62ef43f2 | 17,397 | py | Python | grblocalization/GRBToyModel3D.py | marivasq/gamma-ai | 735953e80901afea3e5cdeb2a7b27c9ab5725434 | [
"MIT"
] | 6 | 2020-01-29T07:24:14.000Z | 2022-03-16T10:05:25.000Z | grblocalization/GRBToyModel3D.py | marivasq/gamma-ai | 735953e80901afea3e5cdeb2a7b27c9ab5725434 | [
"MIT"
] | 6 | 2020-07-03T00:31:10.000Z | 2021-09-10T07:45:01.000Z | grblocalization/GRBToyModel3D.py | marivasq/gamma-ai | 735953e80901afea3e5cdeb2a7b27c9ab5725434 | [
"MIT"
] | 5 | 2019-02-27T22:56:49.000Z | 2019-08-24T19:01:41.000Z | ###################################################################################################
#
# GRBToyModel.py
#
# Copyright (C) by Andreas Zoglauer, Anna Shang & Jasmine Singh.
# All rights reserved.
#
# Please see the file LICENSE in the main repository for the copyright-notice.
#
#########################... | 30.255652 | 298 | 0.643559 |
7412335dc1a3c997eece94ec331dd5586dafa9a1 | 762 | py | Python | 0x0A-python-inheritance/11-square.py | gogomillan/holbertonschool-higher_level_programming | 1549ffc4fdc284271684321ff6edd882a314193a | [
"MIT"
] | null | null | null | 0x0A-python-inheritance/11-square.py | gogomillan/holbertonschool-higher_level_programming | 1549ffc4fdc284271684321ff6edd882a314193a | [
"MIT"
] | null | null | null | 0x0A-python-inheritance/11-square.py | gogomillan/holbertonschool-higher_level_programming | 1549ffc4fdc284271684321ff6edd882a314193a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
This module for the Square class
"""
Rectangle = __import__("9-rectangle").Rectangle
class Square(Rectangle):
"""
Class Square
"""
def __init__(self, size):
"""
Constructor method that returns an instance of a Square class
Args:
size (int): ... | 21.166667 | 69 | 0.523622 |
74124d97281d5c9f163f676c67e9c37bd0120347 | 942 | py | Python | pyplan/pyplan/user_company_preference/permissions.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 17 | 2019-12-04T19:22:19.000Z | 2021-07-28T11:17:05.000Z | pyplan/pyplan/user_company_preference/permissions.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 9 | 2019-12-13T15:34:43.000Z | 2022-02-10T11:43:00.000Z | pyplan/pyplan/user_company_preference/permissions.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 5 | 2019-12-04T15:57:06.000Z | 2021-08-20T19:59:26.000Z | from rest_framework import permissions
class UserCompanyPreferencePermissions(permissions.BasePermission):
def has_permission(self, request, view):
"""
Checks permissions
"""
has_action_permission = False
if request.user and request.user.is_authenticated:
if vi... | 44.857143 | 100 | 0.679406 |
741255f2e1bc124539895aa91c7dff677624fe7d | 2,814 | py | Python | dopamine/thesis/custom_pytrees.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | dopamine/thesis/custom_pytrees.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | dopamine/thesis/custom_pytrees.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Dict, Union
import optax
from dopamine.jax import losses
from flax import linen as nn
from flax.core.frozen_dict import FrozenDict
from jax import numpy as jnp
from jax import random as jrand
from jax import tree_util
from thesis import networks
@tree_util.regist... | 30.258065 | 83 | 0.656006 |
74127e37a0bc3df16feb8110723af3e94632a7a8 | 7,484 | py | Python | tests/interact.py | sravichandran-contractor/boardfarm | cb8cbe75db5f0323bb56cf9563d7e9b4e940a880 | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/interact.py | sravichandran-contractor/boardfarm | cb8cbe75db5f0323bb56cf9563d7e9b4e940a880 | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/interact.py | sravichandran-contractor/boardfarm | cb8cbe75db5f0323bb56cf9563d7e9b4e940a880 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-03-05T01:58:34.000Z | 2020-03-05T01:58:34.000Z | # Copyright (c) 2015
#
# All rights reserved.
#
# This file is distributed under the Clear BSD license.
# The full text can be found in LICENSE in the root directory.
import rootfs_boot
import lib
import os
import sys
import glob
from devices import board, wan, lan, wlan, prompt
def print_subclasses(cls):
for x i... | 37.42 | 130 | 0.432523 |
7412852f16a0e684c635ec3b19a36bedf31b1013 | 86,990 | py | Python | atx/adbkit/openstf/stfwire_pb2.py | jamjven/ATX | 09571aa2745fc9c3583b17c466869db5b86bf5f5 | [
"Apache-2.0"
] | 1,132 | 2017-07-21T05:08:56.000Z | 2022-03-23T01:29:00.000Z | atx/adbkit/openstf/stfwire_pb2.py | jamjven/ATX | 09571aa2745fc9c3583b17c466869db5b86bf5f5 | [
"Apache-2.0"
] | 74 | 2017-07-21T06:00:32.000Z | 2019-01-25T05:10:20.000Z | atx/adbkit/openstf/stfwire_pb2.py | jamjven/ATX | 09571aa2745fc9c3583b17c466869db5b86bf5f5 | [
"Apache-2.0"
] | 277 | 2017-07-28T07:23:54.000Z | 2022-03-22T08:39:08.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: stfwire.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _m... | 35.578732 | 6,752 | 0.745603 |
74129883265fa036d4be4614d49ed0f09d0b9fd4 | 2,280 | py | Python | boxpython/auth.py | hkjallbring/boxpython | dde55db20a2918555432e2658df7e8eee853a54f | [
"MIT"
] | null | null | null | boxpython/auth.py | hkjallbring/boxpython | dde55db20a2918555432e2658df7e8eee853a54f | [
"MIT"
] | null | null | null | boxpython/auth.py | hkjallbring/boxpython | dde55db20a2918555432e2658df7e8eee853a54f | [
"MIT"
] | null | null | null | from .request import BoxRestRequest
from .exceptions import BoxError, BoxHttpResponseError
class BoxAuthenticateFlow(object):
"""From the Client ID and Client Secret from Box, get the Access Token and the Refresh Token.
Usage:
>>> flow = BoxAuthenticateFlow('my_id', 'my_secret')
>>> url = flo... | 34.545455 | 193 | 0.654825 |
7412e0390359a936897d9e98c8fd7b9cbf7b3755 | 1,232 | py | Python | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/runtimes/python.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/runtimes/python.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/runtimes/python.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2015 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 by applicable law or ag... | 36.235294 | 74 | 0.745942 |
7412ecf70fb83ed8a9455b5130e461c89c4d19c3 | 13,028 | py | Python | txdav/who/vcard.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/who/vcard.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/who/vcard.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2006-2015 Apple 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 by applicable l... | 37.329513 | 129 | 0.534848 |
7412f7a97376d156bdbe96de55f4f9fccc1bc9be | 10,743 | py | Python | services/tests/test_api_report.py | theirc/IRC-Services-Legacy | 818ffd13fecb8a7f1c29c341d427d0a339809f8b | [
"BSD-3-Clause"
] | 2 | 2020-10-05T14:43:24.000Z | 2020-10-14T12:46:56.000Z | services/tests/test_api_report.py | pg-irc/IRC-Services-Legacy | 818ffd13fecb8a7f1c29c341d427d0a339809f8b | [
"BSD-3-Clause"
] | 3 | 2019-02-26T18:21:01.000Z | 2020-06-18T14:56:16.000Z | services/tests/test_api_report.py | pg-irc/IRC-Services-Legacy | 818ffd13fecb8a7f1c29c341d427d0a339809f8b | [
"BSD-3-Clause"
] | null | null | null | import json
from http.client import OK
from unittest import skip
from django.core.urlresolvers import reverse
from django.test import TestCase
from services.models import Feedback, ProviderType, ServiceArea, ServiceType
from services.tests.factories import ServiceFactory, FeedbackFactory
from services.tests.test_api ... | 43.318548 | 87 | 0.601694 |
7413095a1c22a1030d9f06c540534c48a99328aa | 3,490 | py | Python | kglib/spectral_type/Mamajek_Table.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | 4 | 2016-02-22T02:34:32.000Z | 2018-11-02T02:31:58.000Z | kglib/spectral_type/Mamajek_Table.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | null | null | null | kglib/spectral_type/Mamajek_Table.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | 1 | 2018-03-19T13:59:25.000Z | 2018-03-19T13:59:25.000Z | from __future__ import print_function, division, absolute_import
import os
from scipy.interpolate import InterpolatedUnivariateSpline as spline
import pandas as pd
from kglib.spectral_type import SpectralTypeRelations
_ROOT = os.path.abspath(os.path.dirname(__file__))
def get_data(path):
return os.path.join(_RO... | 36.354167 | 125 | 0.590258 |
74132fb0ee3a7fcacd0acfd0edd10e68a8555231 | 3,473 | py | Python | archr/targets/flight.py | 2over12/archr | ba31e7b5f4b4df515c988155dd2320ee118036c9 | [
"BSD-2-Clause"
] | 58 | 2019-02-20T20:46:28.000Z | 2021-09-30T17:27:46.000Z | archr/targets/flight.py | 2over12/archr | ba31e7b5f4b4df515c988155dd2320ee118036c9 | [
"BSD-2-Clause"
] | 58 | 2019-02-20T20:22:51.000Z | 2022-01-28T21:19:01.000Z | archr/targets/flight.py | 2over12/archr | ba31e7b5f4b4df515c988155dd2320ee118036c9 | [
"BSD-2-Clause"
] | 16 | 2019-02-20T19:44:19.000Z | 2022-03-28T21:41:49.000Z | import subprocess
import logging
from .actions import OpenChannelAction
l = logging.getLogger("archr.target.flight")
class InteractionError(BaseException):
pass
class Interaction:
"""
An Interaction specifies how to interact with a target
An Interaction is generally the result of ContextAnalyzer.fir... | 34.04902 | 105 | 0.609559 |
7413339e18919be96a15822a8f84303fefa413d7 | 1,271 | py | Python | performerXLSXtoModel.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | null | null | null | performerXLSXtoModel.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | null | null | null | performerXLSXtoModel.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | 4 | 2018-01-27T06:01:41.000Z | 2018-02-21T12:18:35.000Z | #!/usr/bin/env python
from openpyxl import load_workbook
filepath = 'performer.xlsx'
wb = load_workbook(filepath)
sheets = wb.get_sheet_names()
sheet1 = sheets[1]
ws = wb.get_sheet_by_name(sheet1)
rows = ws.rows
columns = ws.columns
import django
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "IMnight.i... | 23.981132 | 70 | 0.642014 |
74133509b5f6f9685c6054bf5cf8386f25c605cd | 994 | py | Python | sound.py | Artemia76/discord-audio-pipe | 2023e5c72c33fe8b0c63c7830c4b949cf6caa2dd | [
"MIT"
] | null | null | null | sound.py | Artemia76/discord-audio-pipe | 2023e5c72c33fe8b0c63c7830c4b949cf6caa2dd | [
"MIT"
] | null | null | null | sound.py | Artemia76/discord-audio-pipe | 2023e5c72c33fe8b0c63c7830c4b949cf6caa2dd | [
"MIT"
] | null | null | null | import numpy as np
import sounddevice as sd
MME = 0
sd.default.channels = 2
sd.default.dtype = 'int16'
sd.default.latency = 'low'
sd.default.samplerate = 48000
class PCMStream:
def __init__(self):
self.stream = None
def read(self, num_bytes):
# frame is 4 bytes
... | 23.666667 | 80 | 0.569416 |
74135eeab7a283ac4ccf0184b493d6200c51d72d | 1,570 | py | Python | twinotter/util/scripting.py | leifdenby/twin-otter | 05d66304d03b27cbd0ac8d4add83d3b67518daa3 | [
"MIT"
] | 1 | 2021-09-16T16:50:47.000Z | 2021-09-16T16:50:47.000Z | twinotter/util/scripting.py | leifdenby/twin-otter | 05d66304d03b27cbd0ac8d4add83d3b67518daa3 | [
"MIT"
] | 6 | 2020-03-02T12:41:27.000Z | 2020-09-02T09:15:44.000Z | twinotter/util/scripting.py | leifdenby/twin-otter | 05d66304d03b27cbd0ac8d4add83d3b67518daa3 | [
"MIT"
] | 2 | 2020-06-11T15:20:07.000Z | 2021-03-19T10:38:44.000Z | import re
def parse_docopt_arguments(function, __doc__):
"""
Args:
function:
__doc__: The docstring of the function being parsed
Returns:
"""
# Load in the arguments
import docopt
arguments = docopt.docopt(__doc__)
# Remove the help argument
del arguments["--he... | 32.708333 | 85 | 0.58535 |
74136e57db67ded3d2760887d78b013fad1a159b | 10,462 | py | Python | merlin/study/step.py | ymubarka/merlin | 3f1e4318c20ccdcca95dd6044bc0d8727ed9ca8a | [
"MIT"
] | 50 | 2019-11-20T03:14:16.000Z | 2022-03-30T07:55:37.000Z | merlin/study/step.py | ymubarka/merlin | 3f1e4318c20ccdcca95dd6044bc0d8727ed9ca8a | [
"MIT"
] | 150 | 2019-11-26T23:31:55.000Z | 2022-03-28T21:23:05.000Z | merlin/study/step.py | ymubarka/merlin | 3f1e4318c20ccdcca95dd6044bc0d8727ed9ca8a | [
"MIT"
] | 12 | 2019-11-20T20:48:33.000Z | 2021-08-10T15:08:36.000Z | ###############################################################################
# Copyright (c) 2019, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory
# Written by the Merlin dev team, listed in the CONTRIBUTORS file.
# <merlin@llnl.gov>
#
# LLNL-CODE-797170
# All righ... | 37.633094 | 109 | 0.633818 |
741380710f31ba758b5a9f1b7567e48a8739741b | 1,224 | py | Python | oscar/lib/python2.7/site-packages/django/contrib/admindocs/urls.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/admindocs/urls.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/admindocs/urls.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from django.contrib.admindocs import views
urlpatterns = [
url(r'^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'),
name='django-admindocs-docroot'),
url(r'^bookmarklets/$',
views.BookmarkletsView.as_view(),
name... | 37.090909 | 79 | 0.607026 |
741391a993a3792916527a1636db5481c8e7e37b | 5,881 | py | Python | tests/test_models/test_temporal_fusion_transformer.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-09T09:51:13.000Z | 2021-06-09T09:51:13.000Z | tests/test_models/test_temporal_fusion_transformer.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | null | null | null | tests/test_models/test_temporal_fusion_transformer.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-15T11:31:44.000Z | 2021-06-15T11:31:44.000Z | import shutil
import sys
import pytest
import pytorch_lightning as pl
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
from pytorch_lightning.loggers import TensorBoardLogger
import torch
from torch.utils.data import dataloader
from pytorch_forecasting import TimeSeriesDataSet
from pytorch_forec... | 35.642424 | 116 | 0.707363 |
7413997f57723e34e17ce6f8e6d5382568b757aa | 6,398 | py | Python | ThirdParty/Twisted/twisted/internet/utils.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 1 | 2021-10-13T01:57:14.000Z | 2021-10-13T01:57:14.000Z | ThirdParty/Twisted/twisted/internet/utils.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/twisted/internet/utils.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | # -*- test-case-name: twisted.test.test_iutils -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility methods.
"""
import sys, warnings
from twisted.internet import protocol, defer
from twisted.internet._utilspy3 import runWithWarningsSuppressed
from twisted.internet._utilspy3 import... | 35.743017 | 84 | 0.659269 |
7413e80449cbafcff08b8482fcf87bc6aeaccd8f | 1,468 | py | Python | splitter/extern/cache.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | 11 | 2019-10-07T22:06:30.000Z | 2020-08-26T22:10:53.000Z | splitter/extern/cache.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | 16 | 2019-11-02T00:32:00.000Z | 2022-02-10T00:23:32.000Z | splitter/extern/cache.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | 9 | 2019-10-07T13:33:13.000Z | 2020-09-27T09:50:58.000Z | import numpy as np
import os
def _array_shape(vstream):
#gets the array shape of the vstream
cnt = 0
for frame in vstream:
cnt += 1
width, height, channels = frame['data'].shape
#print(frame['data'])
return (cnt, width, height, channels)
def is_cache_file(filename):
root... | 24.065574 | 73 | 0.660763 |
7413eead8166f8b804163b4973c0bf35eb8d9254 | 4,589 | py | Python | discord.py-async/discord/ext/commands/context.py | SporadicToast/yukino-bot | 80e1be96341d628490738e5c9a3a7b91043ed441 | [
"MIT"
] | 1 | 2021-04-28T21:35:01.000Z | 2021-04-28T21:35:01.000Z | discord.py-async/discord/ext/commands/context.py | SporadicToast/yukino-bot | 80e1be96341d628490738e5c9a3a7b91043ed441 | [
"MIT"
] | null | null | null | discord.py-async/discord/ext/commands/context.py | SporadicToast/yukino-bot | 80e1be96341d628490738e5c9a3a7b91043ed441 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to us... | 38.889831 | 80 | 0.670734 |
7414195d260545fde365e4515ba4763a898f345b | 357 | py | Python | Problems/other-001/solve.py | luanshiyinyang/LCNotes | 093b109aefd65c2263f59472f7118059d7eeb256 | [
"MIT"
] | 3 | 2021-09-04T05:24:20.000Z | 2022-02-19T08:31:28.000Z | Problems/other-001/solve.py | luanshiyinyang/LCNotes | 093b109aefd65c2263f59472f7118059d7eeb256 | [
"MIT"
] | null | null | null | Problems/other-001/solve.py | luanshiyinyang/LCNotes | 093b109aefd65c2263f59472f7118059d7eeb256 | [
"MIT"
] | null | null | null | class Solution(object):
def solve(self, n: int, k: int, a: list):
accu = [a[-1]]
# 累加后缀和
for i in range(1, n):
accu.append(accu[i - 1] + a[-(i + 1)])
ans = accu[-1] # 必有原始数组
accu.pop(-1)
accu.sort(reverse=True) # 降序排列
ans += sum(accu[:(k - 1)]) ... | 32.454545 | 54 | 0.470588 |
7414312813969972ae5a7691bc2f01120b3d8c93 | 3,721 | py | Python | tests/mdts/lib/binding_manager.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | tests/mdts/lib/binding_manager.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | tests/mdts/lib/binding_manager.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Midokura SARL
#
# 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... | 35.103774 | 75 | 0.629401 |
74143f90b4371b461a898827b43a8cbf8c2cf751 | 6,568 | py | Python | vsphere/datadog_checks/vsphere/utils.py | blaines/integrations-core | ff54d2d864bf37eea3a021d316e42742d499e3ca | [
"BSD-3-Clause"
] | null | null | null | vsphere/datadog_checks/vsphere/utils.py | blaines/integrations-core | ff54d2d864bf37eea3a021d316e42742d499e3ca | [
"BSD-3-Clause"
] | null | null | null | vsphere/datadog_checks/vsphere/utils.py | blaines/integrations-core | ff54d2d864bf37eea3a021d316e42742d499e3ca | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from typing import List, Pattern, Type
from pyVmomi import vim
from six import iteritems
from datadog_checks.base import to_native_string
from datadog_checks.vsphere.config import VSphereConfig
from datadog_ch... | 38.409357 | 114 | 0.697016 |
7414535350f6467b7820ae3ba6aa7dc479e732b3 | 3,560 | py | Python | pytorch_lightning/accelerators/ddp2_backend.py | PhilJd/pytorch-lightning | 28af34bc5134fddf544425fed9ffe04445b237e3 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/ddp2_backend.py | PhilJd/pytorch-lightning | 28af34bc5134fddf544425fed9ffe04445b237e3 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/ddp2_backend.py | PhilJd/pytorch-lightning | 28af34bc5134fddf544425fed9ffe04445b237e3 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 35.247525 | 116 | 0.706461 |
74146ea595f3d289ca456ef50142ff5d395012ab | 2,928 | py | Python | repos/spikewidgets/spikewidgets/tables/sortingcomparisontable/sortingcomparisontable.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | repos/spikewidgets/spikewidgets/tables/sortingcomparisontable/sortingcomparisontable.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | repos/spikewidgets/spikewidgets/tables/sortingcomparisontable/sortingcomparisontable.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from IPython.display import HTML
class SortingComparisonTable():
def __init__(self, comparison, reference=1, unit_properties=[]):
self._comparison = comparison
self._unit_properties = unit_properties
self._reference = reference
for i in range(len(self._unit_prop... | 43.701493 | 107 | 0.540301 |
741472198c025516280cfbe8a0a85df9c98c72ae | 1,153 | py | Python | __main__.py | rutendos/hmm_sequencer | c3d86b743495e2cf134a6db4cfdaaa43b6b08601 | [
"MIT"
] | null | null | null | __main__.py | rutendos/hmm_sequencer | c3d86b743495e2cf134a6db4cfdaaa43b6b08601 | [
"MIT"
] | null | null | null | __main__.py | rutendos/hmm_sequencer | c3d86b743495e2cf134a6db4cfdaaa43b6b08601 | [
"MIT"
] | null | null | null | import argparse
import main
parser = argparse.ArgumentParser(description = 'Generating sequences using a first order HMM')
parser.add_argument('-f', '--frequencies', dest="freq", help = 'per position base frequency', metavar="FILE")
parser.add_argument('-e', '--experiment', dest="exp", help = 'title of experiment ie.... | 67.823529 | 272 | 0.717259 |
741481234c18c5123b86ac573f539dc74b7843ce | 11,924 | py | Python | open-hackathon-server/src/hackathon/docker/alauda_docker.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/docker/alauda_docker.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/docker/alauda_docker.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | 1 | 2019-04-03T23:13:55.000Z | 2019-04-03T23:13:55.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without res... | 39.483444 | 117 | 0.650872 |
7414a1f4923e024b385a8848c8b10eda336008ac | 600 | py | Python | spellcheck.py | shortjared/mtg-card-identification | 9168a36f13d4c184464e56c335bd0d9a56042584 | [
"MIT"
] | null | null | null | spellcheck.py | shortjared/mtg-card-identification | 9168a36f13d4c184464e56c335bd0d9a56042584 | [
"MIT"
] | null | null | null | spellcheck.py | shortjared/mtg-card-identification | 9168a36f13d4c184464e56c335bd0d9a56042584 | [
"MIT"
] | null | null | null | from symspellpy import SymSpell
from symspellpy.symspellpy import Verbosity
from itertools import islice
sym_spell_name_words = SymSpell()
sym_spell_name_words.load_dictionary('name-words.txt', 0, 1, separator="$")
sym_spell_name_words.load_dictionary('name-full.txt', 0, 1, separator="$")
# sym_spell_name_words.load_b... | 37.5 | 91 | 0.798333 |
74153efbd9409e0f25564b19f8b51e4a362827d6 | 243 | py | Python | pyplan/pyplan/department/admin.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 17 | 2019-12-04T19:22:19.000Z | 2021-07-28T11:17:05.000Z | pyplan/pyplan/department/admin.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 9 | 2019-12-13T15:34:43.000Z | 2022-02-10T11:43:00.000Z | pyplan/pyplan/department/admin.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 5 | 2019-12-04T15:57:06.000Z | 2021-08-20T19:59:26.000Z | from django.contrib import admin
from .models import Department
@admin.register(Department)
class DepartmentAdmin(admin.ModelAdmin):
list_display = ('id', 'company', 'code', 'name', 'engine_definitions', 'login_action', 'denied_items',)
| 30.375 | 107 | 0.753086 |
74154ea249e990089d28665fbb0b7b36b388e2ca | 9,008 | py | Python | word2vec_basic.py | TITAN-PyCompat/tensorflow-playground | 349db97c9f2c3f10c3534bac37668af5c1d95e6f | [
"MIT"
] | 91 | 2016-07-13T02:26:42.000Z | 2021-09-30T08:03:16.000Z | word2vec_basic.py | TITAN-PyCompat/tensorflow-playground | 349db97c9f2c3f10c3534bac37668af5c1d95e6f | [
"MIT"
] | 7 | 2016-09-27T12:37:30.000Z | 2019-05-09T17:02:15.000Z | word2vec_basic.py | TITAN-PyCompat/tensorflow-playground | 349db97c9f2c3f10c3534bac37668af5c1d95e6f | [
"MIT"
] | 44 | 2016-08-29T03:42:18.000Z | 2021-05-25T10:13:35.000Z | # Copyright 2015 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 by applicable law or a... | 36.469636 | 109 | 0.699933 |
74157e5c287ac8537577ae9edd29641389cbe49a | 2,143 | py | Python | gquantlab/setup.py | goosen78/gQuant | cc0bff4ac524ccfbe8097acd647a8b3fad5fe578 | [
"Apache-2.0"
] | null | null | null | gquantlab/setup.py | goosen78/gQuant | cc0bff4ac524ccfbe8097acd647a8b3fad5fe578 | [
"Apache-2.0"
] | null | null | null | gquantlab/setup.py | goosen78/gQuant | cc0bff4ac524ccfbe8097acd647a8b3fad5fe578 | [
"Apache-2.0"
] | null | null | null | """
Setup Module to setup Python Handlers for the gquantlab extension.
"""
import os
from jupyter_packaging import (
create_cmdclass, install_npm, ensure_targets,
combine_commands, ensure_python, get_version,
)
import setuptools
HERE = os.path.abspath(os.path.dirname(__file__))
# The name of the project
name... | 24.632184 | 66 | 0.672422 |
741589f7b0e28d32c7a6ff56948f5125b8dd89de | 144,388 | py | Python | geosoft/gxapi/GXDB.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 25 | 2017-07-14T06:39:37.000Z | 2022-03-09T21:39:51.000Z | geosoft/gxapi/GXDB.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 100 | 2016-12-13T17:30:41.000Z | 2021-08-01T20:21:13.000Z | geosoft/gxapi/GXDB.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 28 | 2016-12-12T17:34:40.000Z | 2022-03-16T15:39:39.000Z | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
from .GXLST import GXLST
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the c... | 31.754563 | 224 | 0.601761 |
7415937a9569ce36c9109b2e27659f0a43de61a8 | 32,232 | py | Python | mrestimator/fit.py | balajisriram/mrestimator | 62a17ed8b101362862364850bb93991dd7e3893a | [
"BSD-3-Clause"
] | 6 | 2018-11-27T10:14:56.000Z | 2021-03-09T14:53:10.000Z | mrestimator/fit.py | balajisriram/mrestimator | 62a17ed8b101362862364850bb93991dd7e3893a | [
"BSD-3-Clause"
] | 1 | 2021-05-15T21:35:29.000Z | 2021-05-15T21:35:29.000Z | mrestimator/fit.py | balajisriram/mrestimator | 62a17ed8b101362862364850bb93991dd7e3893a | [
"BSD-3-Clause"
] | 3 | 2019-08-19T21:44:17.000Z | 2021-05-18T20:32:59.000Z | import inspect
import logging
from collections import namedtuple
import numpy as np
import scipy
import scipy.stats
import scipy.optimize
from mrestimator import utility as ut
log = ut.log
tqdm = ut.tqdm
from mrestimator import CoefficientResult
def f_linear(k, A, O):
""":math:`A k + O`"""
return A*k + O*np.... | 37.92 | 88 | 0.514706 |
7415ba367ac4983faec828333ee0c939331e6784 | 16,002 | py | Python | data.py | fsk119/RFCN | f0f28d1f9bdcdc54c7b38591bcffe2a27fc22134 | [
"MIT"
] | 1 | 2018-11-06T13:12:40.000Z | 2018-11-06T13:12:40.000Z | data.py | fsk119/RFCN | f0f28d1f9bdcdc54c7b38591bcffe2a27fc22134 | [
"MIT"
] | null | null | null | data.py | fsk119/RFCN | f0f28d1f9bdcdc54c7b38591bcffe2a27fc22134 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# File: data.py
import cv2
import numpy as np
import copy
import itertools
from tensorpack.utils.argtools import memoized, log_once
from tensorpack.dataflow import (
imgaug, TestDataSpeed,
MultiProcessMapDataZMQ, MultiThreadMapData,
MapDataComponent, DataFromList)
from tensorpack.u... | 38.1 | 120 | 0.659043 |
74162b03cf8c3082319b369d64ca94dda8d27a3b | 4,643 | py | Python | view/simulation_tab.py | Saiket/easymoney | 01ba95ce584ee472c56607ee6c0e2a290f88b402 | [
"MIT-0",
"MIT"
] | 1 | 2020-02-26T14:20:04.000Z | 2020-02-26T14:20:04.000Z | view/simulation_tab.py | Saiket/EasyMoney | 01ba95ce584ee472c56607ee6c0e2a290f88b402 | [
"MIT-0",
"MIT"
] | null | null | null | view/simulation_tab.py | Saiket/EasyMoney | 01ba95ce584ee472c56607ee6c0e2a290f88b402 | [
"MIT-0",
"MIT"
] | null | null | null | """Defines `SimulationTab` and supporting classes."""
__copyright__ = 'Copyright © 2019, Erik Anderson, James Abernathy, and Tyler Gerritsen'
__license__ = 'MIT'
import datetime
import typing
from kivy.app import App
from kivy.uix.tabbedpanel import TabbedPanelItem
from kivy.uix.floatlayout import FloatLayout
from... | 31.371622 | 87 | 0.658411 |
74163364eec309d8643f20b8749c431ec1ebc38c | 3,460 | py | Python | gitlab_runner/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | gitlab_runner/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | gitlab_runner/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
import json
import re
here = path.abspath(path.dirname(__file__))
def parse_req_line(line):
line = line.strip()
if not line or line.startswith('--hash') or line[0]... | 28.595041 | 92 | 0.63526 |
7416523384cb4a3fed80a33617bad3af70b9554c | 3,634 | py | Python | core/argo/core/keras_models/deprecated/bayesian3D_vgg.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | core/argo/core/keras_models/deprecated/bayesian3D_vgg.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | core/argo/core/keras_models/deprecated/bayesian3D_vgg.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | import tensorflow as tf
import tensorflow_probability as tfp
from .keras_utils import get_renorm_clipping
def bayesian3D_vgg(filters = [32, 64, 128],#[32, 64, 64, 128, 128],
kernels = [3, 3, 3],
strides = [2, 2, 2],
logits_size = None,
flipout = True,... | 30.537815 | 108 | 0.611723 |
7416545ed2ccecd7dd31f89621656209e4f32f25 | 7,634 | py | Python | python/ray/ml/preprocessors/encoder.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | null | null | null | python/ray/ml/preprocessors/encoder.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | null | null | null | python/ray/ml/preprocessors/encoder.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | null | null | null | from typing import List, Dict, Optional, Union
import pandas as pd
from ray.data import Dataset
from ray.ml.preprocessor import Preprocessor
class OrdinalEncoder(Preprocessor):
"""Encode values within columns as ordered integer values.
Currently, order within a column is based on the values from the fitted... | 34.858447 | 87 | 0.642782 |
741656da45a039c0ea485c1d5256e2ec267199a4 | 2,484 | py | Python | ibis/backends/bigquery/__init__.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | null | null | null | ibis/backends/bigquery/__init__.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | null | null | null | ibis/backends/bigquery/__init__.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | null | null | null | """BigQuery public API."""
from typing import Optional
import google.auth.credentials
import google.cloud.bigquery # noqa: F401, fail early if bigquery is missing
import pydata_google_auth
import ibis.common.exceptions as com
import ibis.config
from ibis.config import options # noqa: F401
from .client import BigQ... | 24.116505 | 79 | 0.680354 |
74165a9b11e9ec9c447a78e6acbb58772c4ccf8c | 1,817 | py | Python | middlewares/cache_middleware.py | project-nichijou/spider-common | ad7344ec156a9fe6fdd143aaf4d3435b19271ed8 | [
"MIT"
] | null | null | null | middlewares/cache_middleware.py | project-nichijou/spider-common | ad7344ec156a9fe6fdd143aaf4d3435b19271ed8 | [
"MIT"
] | null | null | null | middlewares/cache_middleware.py | project-nichijou/spider-common | ad7344ec156a9fe6fdd143aaf4d3435b19271ed8 | [
"MIT"
] | 1 | 2021-07-11T13:49:58.000Z | 2021-07-11T13:49:58.000Z | from common.cache.cache_response import CacheResponse
from common.utils.checker import is_null
import traceback
from common.utils.logger import format_log
from common.database.database import CommonDatabase
from scrapy import signals
class CommonCacheMiddleware:
# Not all methods need to be defined. If a method is n... | 28.84127 | 72 | 0.729224 |
74166b3073c11d24e192654ede942a136182ccf4 | 9,631 | py | Python | calendarserver/push/notifier.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | calendarserver/push/notifier.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | calendarserver/push/notifier.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2005-2015 Apple 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 by applicable l... | 34.396429 | 109 | 0.647908 |
741671d1e2a8ea8af393275981ccce595b840e43 | 753 | py | Python | .eggs/docutils-0.14-py2.7.egg/EGG-INFO/scripts/rst2odt.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/docutils-0.14-py2.7.egg/EGG-INFO/scripts/rst2odt.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/docutils-0.14-py2.7.egg/EGG-INFO/scripts/rst2odt.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | #!python
# $Id: rst2odt.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
A front end to the Docutils Publisher, producing OpenOffice documents.
"""
import sys
try:
import locale
locale.setlocale(locale.LC_ALL... | 25.1 | 78 | 0.75166 |
74167458884dcc36d7af365d07bbdbd672aa7d44 | 1,243 | py | Python | incasem/utils/create_multiple_config.py | kirchhausenlab/incasem | ee9e007c5c04571e547e2fb5af5e800bd2d2b435 | [
"BSD-3-Clause"
] | null | null | null | incasem/utils/create_multiple_config.py | kirchhausenlab/incasem | ee9e007c5c04571e547e2fb5af5e800bd2d2b435 | [
"BSD-3-Clause"
] | null | null | null | incasem/utils/create_multiple_config.py | kirchhausenlab/incasem | ee9e007c5c04571e547e2fb5af5e800bd2d2b435 | [
"BSD-3-Clause"
] | null | null | null | import os
import json
def create_multiple_config(config_file):
'''
From one config .json file that contains multiple datasets,
create multiple .json files, each one containing a single dataset.
Used to perform validation/prediction on multiple cells/datasets.
Arguments:
config_file (s... | 28.25 | 92 | 0.572808 |
7416c6818272f895609b5480e048ca1a676700c8 | 8,823 | py | Python | appengine/monorail/tools/ml/trainer/task.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/monorail/tools/ml/trainer/task.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/monorail/tools/ml/trainer/task.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 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 or at
# https://developers.google.com/open-source/licenses/bsd
from __future__ import absolute_import
from __future__ import division
from __future__ import p... | 30.957895 | 80 | 0.688088 |
7416d6102b10fe98933676a4b12725e1b59f0cf1 | 7,604 | py | Python | kuha/importer/ddi_file_provider.py | JohnJiangLA/kuha | e6ed93e71132a3637a80d47f16b4a1020961e688 | [
"BSD-3-Clause"
] | 4 | 2016-11-30T08:29:00.000Z | 2021-04-16T15:21:22.000Z | kuha/importer/ddi_file_provider.py | JohnJiangLA/kuha | e6ed93e71132a3637a80d47f16b4a1020961e688 | [
"BSD-3-Clause"
] | null | null | null | kuha/importer/ddi_file_provider.py | JohnJiangLA/kuha | e6ed93e71132a3637a80d47f16b4a1020961e688 | [
"BSD-3-Clause"
] | 3 | 2020-11-22T15:21:02.000Z | 2021-05-16T11:09:48.000Z | import os
import logging
from datetime import datetime
from lxml import etree
class DdiFileProvider(object):
"""
Metadata provider for DDI Codebook XML files.
This provider scans a directory for XML files and converts them from
DDI Codebook to OAI DC.
"""
def __init__(self, dom... | 34.252252 | 76 | 0.55405 |
7416dff91fd0203d1ecf8d3387e3d7c4195e7d25 | 24,488 | py | Python | intersight/models/adapter_host_fc_interface.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/adapter_host_fc_interface.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/adapter_host_fc_interface.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class AdapterHostFcInterface(object):
"""
NOTE: Thi... | 27.269488 | 491 | 0.598293 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.