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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4794c83d8776c8c5b558d4635d40488a4106450a | 133 | py | Python | dreamerv2/models/__init__.py | magamba/dreamerv2 | ad7d54e256a03378bfd483e8a4c389ab2b444078 | [
"MIT"
] | 97 | 2021-07-08T07:05:22.000Z | 2022-03-29T11:47:49.000Z | dreamerv2/models/__init__.py | magamba/dreamerv2 | ad7d54e256a03378bfd483e8a4c389ab2b444078 | [
"MIT"
] | 2 | 2021-09-01T09:37:07.000Z | 2022-01-28T15:59:54.000Z | dreamerv2/models/__init__.py | magamba/dreamerv2 | ad7d54e256a03378bfd483e8a4c389ab2b444078 | [
"MIT"
] | 14 | 2021-07-08T07:51:47.000Z | 2022-03-30T14:58:54.000Z | from .actor import DiscreteActionModel
from .rssm import RSSM
from .dense import DenseModel
from .pixel import ObsDecoder, ObsEncoder | 33.25 | 41 | 0.842105 |
125dd99536826e1f3866683480f3484f8a41e82e | 559 | py | Python | test/selenium/src/lib/ui/daily_emails_ui_facade.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-08-26T06:56:01.000Z | 2021-07-08T13:56:20.000Z | test/selenium/src/lib/ui/daily_emails_ui_facade.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-02-02T23:04:30.000Z | 2022-03-02T09:54:47.000Z | test/selenium/src/lib/ui/daily_emails_ui_facade.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2016-08-23T10:51:19.000Z | 2016-08-23T10:51:19.000Z | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Daily emails UI facade."""
from lib.service import daily_emails_service
def get_emails_by_user_names(user_names):
"""Get emails by user names."""
emails_service = daily_emails_service.DailyEmailsServ... | 34.9375 | 78 | 0.779964 |
62585215cf3a7190102a9918346fc067f059335b | 124 | py | Python | example24.py | wnykuang/fluentPython | b0edea9971627f100b3e53a1acda8589fd728552 | [
"MIT"
] | null | null | null | example24.py | wnykuang/fluentPython | b0edea9971627f100b3e53a1acda8589fd728552 | [
"MIT"
] | null | null | null | example24.py | wnykuang/fluentPython | b0edea9971627f100b3e53a1acda8589fd728552 | [
"MIT"
] | null | null | null | colors = ['black', 'white']
sizes = ['S', 'M', 'L']
tshirts = [(col, siz) for col in colors for siz in sizes]
print(tshirts) | 31 | 57 | 0.612903 |
96e6d335e4eac3c3aa430cc20b2e23d85a15f945 | 923 | py | Python | cli.py | midnights-straychild/weatherman | 50354f0639fbcdde01e1ac6290bf71379581868b | [
"MIT"
] | null | null | null | cli.py | midnights-straychild/weatherman | 50354f0639fbcdde01e1ac6290bf71379581868b | [
"MIT"
] | null | null | null | cli.py | midnights-straychild/weatherman | 50354f0639fbcdde01e1ac6290bf71379581868b | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
from app.db import DB
def main():
try:
function = sys.argv[1]
except IndexError:
function = "do all"
print("You have chosen to " + function)
if function is "initdb":
print("init db")
initdb()
elif function is "inittestdata":
... | 20.065217 | 43 | 0.589382 |
ca0e5de98e5883b8639e5b9170a4e249f762d408 | 484 | py | Python | app/product/serializers.py | chiti07/lulo-exercise | 425bf2d05732ebad5302e44306187a3b83921285 | [
"MIT"
] | null | null | null | app/product/serializers.py | chiti07/lulo-exercise | 425bf2d05732ebad5302e44306187a3b83921285 | [
"MIT"
] | null | null | null | app/product/serializers.py | chiti07/lulo-exercise | 425bf2d05732ebad5302e44306187a3b83921285 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from core.models import Tag, Product
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
fields = ('id', 'name')
read_only_fields = ('id',)
class ProductSerializer(serializers.ModelSerializer):
class Meta:
model = ... | 22 | 57 | 0.657025 |
7347f382a42d99dedfbe3a9f3d08ad0debb3da97 | 3,605 | py | Python | ctripspider/ctripspider/middlewares.py | JoeJing/ctripspider | 02861129ff37d766589c644f6989bfdeff85301e | [
"MIT"
] | null | null | null | ctripspider/ctripspider/middlewares.py | JoeJing/ctripspider | 02861129ff37d766589c644f6989bfdeff85301e | [
"MIT"
] | 1 | 2022-03-02T14:59:20.000Z | 2022-03-02T14:59:20.000Z | ctripspider/ctripspider/middlewares.py | JoeJing/ctripspider | 02861129ff37d766589c644f6989bfdeff85301e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class CtripspiderSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scr... | 34.663462 | 78 | 0.666852 |
2b65b21a9edb415ae1affd4e2f5549927203ccf9 | 1,173 | py | Python | src/sw/arp-poisoning/server.py | nniranjhana/dps-p4 | 0b704f98570c3a0d2b44b4c5189ca48b2d1a00a3 | [
"Apache-2.0"
] | 4 | 2019-07-22T04:32:55.000Z | 2022-02-25T02:24:18.000Z | src/sw/arp-poisoning/server.py | nniranjhana/dps-p4 | 0b704f98570c3a0d2b44b4c5189ca48b2d1a00a3 | [
"Apache-2.0"
] | null | null | null | src/sw/arp-poisoning/server.py | nniranjhana/dps-p4 | 0b704f98570c3a0d2b44b4c5189ca48b2d1a00a3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import os
from scapy.all import sniff, sendp, get_if_list, get_if_hwaddr, get_if_raw_hwaddr
from scapy.all import Ether, ARP
def send_response(pkt):
client_hw_addr = pkt[Ether].src
client_ip_addr = pkt[ARP].psrc
print "request detected from client with MAC: %s and IP: %s" % (client... | 30.076923 | 103 | 0.71185 |
f46c7e8c20bd613e31d73e77bc01d6c16742b684 | 40,751 | py | Python | tempest/scenario/test_network_basic_ops.py | Dajvid/tempest | 7fdd39c6dbde37bccd419c4037e1e352a5189c5a | [
"Apache-2.0"
] | 1 | 2020-01-14T03:20:44.000Z | 2020-01-14T03:20:44.000Z | tempest/scenario/test_network_basic_ops.py | Dajvid/tempest | 7fdd39c6dbde37bccd419c4037e1e352a5189c5a | [
"Apache-2.0"
] | 1 | 2019-08-08T10:36:44.000Z | 2019-08-09T05:58:23.000Z | tempest/scenario/test_network_basic_ops.py | Dajvid/tempest | 7fdd39c6dbde37bccd419c4037e1e352a5189c5a | [
"Apache-2.0"
] | 1 | 2019-08-08T09:21:25.000Z | 2019-08-08T09:21:25.000Z | # Copyright 2012 OpenStack Foundation
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ht... | 46.046328 | 79 | 0.635175 |
2ac6b1dd618e3d49ff96ae041c33b0c95b2de1cc | 1,248 | py | Python | errors.py | vlee489/Turnip-Bot | 2571846607d6ca57171325211c5eb6572013c767 | [
"MIT"
] | 5 | 2020-04-19T22:47:28.000Z | 2020-06-01T04:37:12.000Z | errors.py | vlee489/Turnip-Bot | 2571846607d6ca57171325211c5eb6572013c767 | [
"MIT"
] | 7 | 2020-04-21T23:25:20.000Z | 2021-04-20T07:50:11.000Z | errors.py | vlee489/Turnip-Bot | 2571846607d6ca57171325211c5eb6572013c767 | [
"MIT"
] | null | null | null | """
This file contains errors thrown by Turnip Bot internally
"""
class EndPointValidation(Exception):
"""
Raised when an invalid API endpoint is given
"""
pass
class InvalidAPICall(Exception):
"""
Raised when an invalid API returns something other than 200
"""
pass
class FileNotCr... | 15.407407 | 63 | 0.632212 |
d517a29d36c1321f23dd60b5ba7f629b81d7cdda | 737 | py | Python | jevtagram/images/migrations/0003_auto_20181107_1452.py | jjun0214z/FullStack-Instagram-Clone | 142cf37be8a90983a74c576766e5abd1cd0771c1 | [
"MIT"
] | null | null | null | jevtagram/images/migrations/0003_auto_20181107_1452.py | jjun0214z/FullStack-Instagram-Clone | 142cf37be8a90983a74c576766e5abd1cd0771c1 | [
"MIT"
] | 11 | 2020-06-05T19:32:03.000Z | 2022-02-26T14:26:35.000Z | jevtagram/images/migrations/0003_auto_20181107_1452.py | jjun0214z/FullStack-Instagram-Clone | 142cf37be8a90983a74c576766e5abd1cd0771c1 | [
"MIT"
] | 2 | 2019-07-29T14:56:16.000Z | 2019-11-22T01:54:17.000Z | # Generated by Django 2.0.9 on 2018-11-07 05:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('images', '0002_auto_20181106_1038'),
]
operations = [
migrations.AlterField(
model_name='commen... | 29.48 | 136 | 0.632293 |
2a6a2cbb3d72fa8112e58e7c1005f3d604cf47ec | 19,358 | py | Python | tests/interop/test_calls.py | ProvoK/trio-asyncio | 8098e93a63eedf7188545cbda45e54c0bcdd85fc | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/interop/test_calls.py | ProvoK/trio-asyncio | 8098e93a63eedf7188545cbda45e54c0bcdd85fc | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/interop/test_calls.py | ProvoK/trio-asyncio | 8098e93a63eedf7188545cbda45e54c0bcdd85fc | [
"Apache-2.0",
"MIT"
] | null | null | null | import pytest
import asyncio
import trio
import sniffio
from trio_asyncio import aio_as_trio, trio_as_aio
from tests import aiotest
from functools import partial
import sys
from .. import utils as test_utils
class Seen:
flag = 0
async def async_gen_to_list(generator):
result = []
async for item in gener... | 32.479866 | 99 | 0.576506 |
c8e77318fef4550e46073e24bef2340a841bfc6d | 1,269 | py | Python | models/alexnet.py | kamwoh/dpn | b4d721e0e164188399307a4b5944c0a655882c3c | [
"BSD-3-Clause"
] | 2 | 2021-07-06T08:10:33.000Z | 2021-12-03T09:17:36.000Z | models/alexnet.py | kamwoh/dpn | b4d721e0e164188399307a4b5944c0a655882c3c | [
"BSD-3-Clause"
] | null | null | null | models/alexnet.py | kamwoh/dpn | b4d721e0e164188399307a4b5944c0a655882c3c | [
"BSD-3-Clause"
] | 1 | 2021-12-08T09:26:26.000Z | 2021-12-08T09:26:26.000Z | import torch
import torch.nn as nn
from torchvision.models import alexnet
from models import register_network
@register_network('alexnet')
class AlexNet(nn.Module):
def __init__(self, nbit, nclass, pretrained=False, freeze_weight=False, **kwargs):
super(AlexNet, self).__init__()
model = alexnet(... | 28.2 | 86 | 0.608353 |
8bdc0071f3a9653c751bc4ca1d00b538f7490323 | 503 | py | Python | DiRa_Software/Reference/Source code final 2018-2019/PTIT-Fast-and-Fiery_Digital_race_2019/test_fps.py | lamhoangtung/DiRa | 6e92f465c0197f3bd60b1e5719c1cc8fa06c5e4c | [
"MIT"
] | 34 | 2019-05-07T08:44:27.000Z | 2020-05-26T13:52:32.000Z | DiRa_Software/Reference/Source code final 2018-2019/PTIT-Fast-and-Fiery_Digital_race_2019/test_fps.py | giangnt071098/DiRa | 71da5c9f13f3fb32d4cc1efd96d981139fb66ee5 | [
"MIT"
] | 3 | 2019-10-21T04:37:48.000Z | 2019-11-11T12:16:04.000Z | DiRa_Software/Reference/Source code final 2018-2019/PTIT-Fast-and-Fiery_Digital_race_2019/test_fps.py | giangnt071098/DiRa | 71da5c9f13f3fb32d4cc1efd96d981139fb66ee5 | [
"MIT"
] | 58 | 2019-03-13T09:15:15.000Z | 2021-11-19T08:32:27.000Z | from time import time
from keras.models import load_model
import keras.backend as K
import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.2)))
K.set_session(sess)
t = time()
model = load_model("updated.h5")
import numpy as np
fps = 0
count = 0
while(... | 23.952381 | 104 | 0.664016 |
9e279411f2b0edac18e35472e253c15fd9829fe2 | 2,219 | py | Python | cfgparse/test_package.py | fyhuang/archive_box | 1cbbd839012fed5e12341b78027d132c72dd01df | [
"BSD-3-Clause"
] | null | null | null | cfgparse/test_package.py | fyhuang/archive_box | 1cbbd839012fed5e12341b78027d132c72dd01df | [
"BSD-3-Clause"
] | null | null | null | cfgparse/test_package.py | fyhuang/archive_box | 1cbbd839012fed5e12341b78027d132c72dd01df | [
"BSD-3-Clause"
] | null | null | null | import unittest
from typing import Optional, Tuple, List, Dict, NamedTuple
from . import *
class NestedNt(NamedTuple):
n_a: float
n_b: str
class TestNt(NamedTuple):
f_str: str = ""
f_int: int = 0
f_optional: Optional[int] = None
f_tuple: Tuple[int, float] = (0, 0.0)
f_list: List[str] = [... | 35.222222 | 87 | 0.605228 |
3bf442327faccabdfd2bc547e888a866194b1a5d | 1,084 | py | Python | ensysmod/model/energy_storage.py | NOWUM/EnSysMod | 18c8a2198db3510e667c1f0298d00a3dfcb0aab7 | [
"MIT"
] | 1 | 2021-12-10T19:41:01.000Z | 2021-12-10T19:41:01.000Z | ensysmod/model/energy_storage.py | NOWUM/EnSysMod | 18c8a2198db3510e667c1f0298d00a3dfcb0aab7 | [
"MIT"
] | 83 | 2021-10-20T22:54:28.000Z | 2022-03-24T19:07:06.000Z | ensysmod/model/energy_storage.py | NOWUM/EnSysMod | 18c8a2198db3510e667c1f0298d00a3dfcb0aab7 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, ForeignKey, Float
from sqlalchemy.orm import relationship
from ensysmod.database.base_class import Base
class EnergyStorage(Base):
"""
EnergyStorage table definition
See https://vsa-fine.readthedocs.io/en/latest/storageClassDoc.html
"""
ref_component = Col... | 38.714286 | 116 | 0.760148 |
cd980e92c0164d7dbda0264c2fbca7ce5bdc561b | 46,408 | py | Python | torch/_jit_internal.py | fossabot/pytorch | 42ba67992cbb29033c65d76cc3374ea9fbf4127d | [
"Intel"
] | null | null | null | torch/_jit_internal.py | fossabot/pytorch | 42ba67992cbb29033c65d76cc3374ea9fbf4127d | [
"Intel"
] | null | null | null | torch/_jit_internal.py | fossabot/pytorch | 42ba67992cbb29033c65d76cc3374ea9fbf4127d | [
"Intel"
] | null | null | null | """
The weak_script annotation needs to be here instead of inside torch/jit/ so it
can be used in other places in torch/ (namely torch.nn) without running into
circular dependency problems
"""
import contextlib
import collections
import enum
import inspect
import ast
import weakref
import warnings
from textwrap import... | 37.096723 | 130 | 0.664433 |
3282787186a8b09b8e4ee2181664f748f271066d | 878 | py | Python | examples/conversation_read_webhook.py | smadivad/sreemessage | b9642c32bfea65ec7b523bffd7b23306b235e651 | [
"BSD-2-Clause"
] | 57 | 2015-04-07T21:20:12.000Z | 2022-03-30T17:27:48.000Z | examples/conversation_read_webhook.py | smadivad/sreemessage | b9642c32bfea65ec7b523bffd7b23306b235e651 | [
"BSD-2-Clause"
] | 33 | 2015-09-24T21:29:48.000Z | 2022-02-11T22:17:29.000Z | examples/conversation_read_webhook.py | smadivad/sreemessage | b9642c32bfea65ec7b523bffd7b23306b235e651 | [
"BSD-2-Clause"
] | 59 | 2015-01-08T13:00:13.000Z | 2022-03-09T16:55:46.000Z | #!/usr/bin/env python
import messagebird
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--accessKey', help='access key for MessageBird API', type=str, required=True)
parser.add_argument('--webhookId', help='webhook that you want to read', type=str, required=True)
args = vars(parser.parse_args(... | 33.769231 | 98 | 0.702733 |
f59f05d49d5be5ee0cce05a0d061fa931e483f1c | 5,526 | py | Python | src/dochive/__main__.py | Boldware/dochive | e93d794bbf4bb931cbc41f9284632d861bfe300e | [
"Apache-2.0"
] | null | null | null | src/dochive/__main__.py | Boldware/dochive | e93d794bbf4bb931cbc41f9284632d861bfe300e | [
"Apache-2.0"
] | null | null | null | src/dochive/__main__.py | Boldware/dochive | e93d794bbf4bb931cbc41f9284632d861bfe300e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
DocHive
"""
import logging
import sys
import os
from . import __version__
from . import utils
from . import config
from .commands import add, digest
import click
import textwrap
import shutil
log = logging.getLogger(__name__)
config_help = "Provide a specific DocHive config"
class Color... | 35.423077 | 128 | 0.656352 |
59f5a141d578ccb0133547f8cea4edfcf26facff | 2,096 | py | Python | GUI/SoundCloudDL.py | hassaanaliw/SoundCloud-Downloader | 09e7bb9a9cf17d572fcc8cd117aeaddb48334ee9 | [
"MIT"
] | 2 | 2017-11-19T09:30:44.000Z | 2020-04-07T09:18:16.000Z | GUI/SoundCloudDL.py | hassaanaliw/SoundCloud-Downloader | 09e7bb9a9cf17d572fcc8cd117aeaddb48334ee9 | [
"MIT"
] | null | null | null | GUI/SoundCloudDL.py | hassaanaliw/SoundCloud-Downloader | 09e7bb9a9cf17d572fcc8cd117aeaddb48334ee9 | [
"MIT"
] | null | null | null | import urllib
import re,requests,json,sys
useragent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
html = {"User-Agent": useragent, "Content-Type": "application/json", "Accept-Encoding": "gzip"}
client_id='40ae937e42ea2d4d4a04b1e22bb5d371'
def main(url)... | 24.658824 | 120 | 0.62834 |
ef4ada01f6fa06aa216b1853e5a45bcdd2709ff9 | 1,836 | py | Python | vega/algorithms/nas/modnas/compat/importer.py | shaido987/vega | 14d5d49fb8bdf96bd1f3fcfac201ce6b6712c3b6 | [
"MIT"
] | 1 | 2021-05-08T07:47:44.000Z | 2021-05-08T07:47:44.000Z | vega/algorithms/nas/modnas/compat/importer.py | WholeG/vega | d1ccf1c3ce68a118bdb6775594ceed0f895911e7 | [
"MIT"
] | null | null | null | vega/algorithms/nas/modnas/compat/importer.py | WholeG/vega | d1ccf1c3ce68a118bdb6775594ceed0f895911e7 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... | 34 | 113 | 0.661765 |
250ffadbb766e7ece8c5ce56b39d27e56b4a532b | 609 | py | Python | pms/student/migrations/0016_auto_20190406_1608.py | iammeliodas/pms_django | 535f59ff2dc5260ed9c6da62defa6d740afc0289 | [
"Apache-2.0"
] | null | null | null | pms/student/migrations/0016_auto_20190406_1608.py | iammeliodas/pms_django | 535f59ff2dc5260ed9c6da62defa6d740afc0289 | [
"Apache-2.0"
] | 7 | 2020-06-05T20:21:00.000Z | 2021-09-22T18:18:42.000Z | pms/student/migrations/0016_auto_20190406_1608.py | meet86/pms_django | 535f59ff2dc5260ed9c6da62defa6d740afc0289 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-04-06 10:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('student', '0015_auto_20190406_1551'),
]
operations = [
migrations.RemoveField... | 24.36 | 63 | 0.62069 |
5e2f89c8f56062fb5ecd05e99a823841b5e30ec5 | 6,940 | py | Python | src/GAMUTRawData/odmservices/service_manager.py | ODM2/h2outility | 78801e2de68a309069a602f5253a35f57fbc8ffd | [
"BSD-3-Clause"
] | null | null | null | src/GAMUTRawData/odmservices/service_manager.py | ODM2/h2outility | 78801e2de68a309069a602f5253a35f57fbc8ffd | [
"BSD-3-Clause"
] | 30 | 2017-07-19T21:20:36.000Z | 2021-12-13T19:40:25.000Z | src/GAMUTRawData/odmservices/service_manager.py | ODM2/h2outility | 78801e2de68a309069a602f5253a35f57fbc8ffd | [
"BSD-3-Clause"
] | 1 | 2017-07-20T20:51:15.000Z | 2017-07-20T20:51:15.000Z | import sys
import urllib
import os
from sqlalchemy.exc import SQLAlchemyError, DBAPIError
import utilities as util
from series_service import SeriesService
from cv_service import CVService
from edit_service import EditService
from record_service import RecordService
from export_service import ExportService
class ... | 38.77095 | 123 | 0.585303 |
4ddc25728aeac741d566f944ddb191462dcae750 | 1,248 | py | Python | blog/forms.py | J-Chaudhary/blog_site | 6b966a3560cc5d0cbdd8f82203bc7ad4c95dbc95 | [
"MIT"
] | null | null | null | blog/forms.py | J-Chaudhary/blog_site | 6b966a3560cc5d0cbdd8f82203bc7ad4c95dbc95 | [
"MIT"
] | null | null | null | blog/forms.py | J-Chaudhary/blog_site | 6b966a3560cc5d0cbdd8f82203bc7ad4c95dbc95 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
def should_be_empty(value):
if value:
raise forms.ValidationError('Field is not empty...!')
class ContactForm(forms.Form):
name = forms.CharField(max_length=80)
m... | 36.705882 | 109 | 0.663462 |
a94747442bcf34293e604c03ae09879b0976b72f | 9,365 | py | Python | zerver/tests/test_logging_handlers.py | yakkl/yakkl | 89ecf4ee8998554a0634667067e16f428e4c480c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | zerver/tests/test_logging_handlers.py | yakkl/yakkl | 89ecf4ee8998554a0634667067e16f428e4c480c | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-06-06T00:51:42.000Z | 2022-02-10T21:38:40.000Z | zerver/tests/test_logging_handlers.py | yakkl/yakkl | 89ecf4ee8998554a0634667067e16f428e4c480c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import sys
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http import HttpRequest
from django.test import TestCase
from django.utils.log import AdminEmailHandler
from functools import wraps
from mock import MagicMock, patch
from... | 44.383886 | 120 | 0.660651 |
728cd7e76585c51f464f4b7815f21ed50e78b62c | 1,104 | py | Python | coreapp/migrations/0044_auto_20200327_1016.py | Quanscendence/braynai | ab828ca95571c6dffef2b2392522e6a4160a2304 | [
"MIT"
] | null | null | null | coreapp/migrations/0044_auto_20200327_1016.py | Quanscendence/braynai | ab828ca95571c6dffef2b2392522e6a4160a2304 | [
"MIT"
] | null | null | null | coreapp/migrations/0044_auto_20200327_1016.py | Quanscendence/braynai | ab828ca95571c6dffef2b2392522e6a4160a2304 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-03-27 04:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coreapp', '0043_auto_20200326_1521'),
]
operations = [
migrations.RemoveField(
model_name='projectbillingprms',
name='... | 26.285714 | 49 | 0.55163 |
82eb8c44760a23abe2f0ba9b1792e4080728df10 | 1,141 | py | Python | nbheapanalytics/__init__.py | oreillymedia/nbheapanalytics | 0ec4e0ac0c5c2a911a7413dbd36d7a478064f61d | [
"BSD-3-Clause"
] | null | null | null | nbheapanalytics/__init__.py | oreillymedia/nbheapanalytics | 0ec4e0ac0c5c2a911a7413dbd36d7a478064f61d | [
"BSD-3-Clause"
] | null | null | null | nbheapanalytics/__init__.py | oreillymedia/nbheapanalytics | 0ec4e0ac0c5c2a911a7413dbd36d7a478064f61d | [
"BSD-3-Clause"
] | null | null | null | from notebook.services.config import ConfigManager
from traitlets.config import Configurable
from traitlets import Unicode
def _jupyter_server_extension_paths():
return [{
'module': 'nbheapanalytics',
}]
def _jupyter_nbextension_paths():
return [
{
# Load this on all the pages!... | 23.285714 | 51 | 0.5539 |
382bc30f40272ffd005a39929af580b4b7498a7e | 42 | py | Python | tests/test_model.py | tyo-yo/cookiecutter_sample_9 | 56c2e7e6c9b4a7d7164d1d4190df59b264e9486f | [
"MIT"
] | null | null | null | tests/test_model.py | tyo-yo/cookiecutter_sample_9 | 56c2e7e6c9b4a7d7164d1d4190df59b264e9486f | [
"MIT"
] | null | null | null | tests/test_model.py | tyo-yo/cookiecutter_sample_9 | 56c2e7e6c9b4a7d7164d1d4190df59b264e9486f | [
"MIT"
] | null | null | null | def test_exmaple():
assert 1 + 1 == 2
| 14 | 21 | 0.571429 |
3360ca6b4e734a5b4f684162fb9239a01aba6aa9 | 1,230 | py | Python | _unittests/ut_documentation/test_nb_logregclus.py | sdpython/mlinsights | bae59cda775a69bcce83b16b88df2f34a092cb60 | [
"MIT"
] | 48 | 2017-11-19T14:59:41.000Z | 2022-03-03T15:50:24.000Z | _unittests/ut_documentation/test_nb_logregclus.py | sdpython/mlinsights | bae59cda775a69bcce83b16b88df2f34a092cb60 | [
"MIT"
] | 87 | 2017-11-20T00:10:32.000Z | 2021-11-20T01:48:09.000Z | _unittests/ut_documentation/test_nb_logregclus.py | sdpython/mlinsights | bae59cda775a69bcce83b16b88df2f34a092cb60 | [
"MIT"
] | 12 | 2019-05-09T07:45:52.000Z | 2021-06-28T06:55:53.000Z | # -*- coding: utf-8 -*-
"""
@brief test log(time=23s)
"""
import os
import unittest
from sklearn import __version__ as sklver
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import add_missing_development_version
from pyquickhelper.ipythonhelper import test_notebook_execution_coverage
from pyqui... | 30 | 79 | 0.656098 |
5d901c212d4ce4c3b2710e6ee828866ca7656bb6 | 27,990 | py | Python | collaboration/activity.py | vipulgupta2048/activity-turtle-confusion | 8d24b4e48e76ed8401fa6ae89a10c4dd73c3dcd2 | [
"MIT"
] | null | null | null | collaboration/activity.py | vipulgupta2048/activity-turtle-confusion | 8d24b4e48e76ed8401fa6ae89a10c4dd73c3dcd2 | [
"MIT"
] | null | null | null | collaboration/activity.py | vipulgupta2048/activity-turtle-confusion | 8d24b4e48e76ed8401fa6ae89a10c4dd73c3dcd2 | [
"MIT"
] | null | null | null | # Copyright (C) 2007, Red Hat, Inc.
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, ... | 38.029891 | 79 | 0.621222 |
266345479e3032fb741e2f11d45b80aa5fda8eae | 524 | py | Python | regex-and-parsing/validating-parsing-email-address.py | anishLearnsToCode/hackerrank-python | 7d707c07af051e7b00471ebe547effd7e1d6d9d9 | [
"MIT"
] | 2 | 2020-05-21T16:18:26.000Z | 2021-11-28T15:44:33.000Z | regex-and-parsing/validating-parsing-email-address.py | anishLearnsToCode/hackerrank-python | 7d707c07af051e7b00471ebe547effd7e1d6d9d9 | [
"MIT"
] | null | null | null | regex-and-parsing/validating-parsing-email-address.py | anishLearnsToCode/hackerrank-python | 7d707c07af051e7b00471ebe547effd7e1d6d9d9 | [
"MIT"
] | 2 | 2020-11-01T00:55:53.000Z | 2021-10-31T16:05:17.000Z | # https://www.hackerrank.com/challenges/validating-named-email-addresses/problem
import email.utils
import re
email_pattern = r'([a-zA-Z](\w|\d|_|-|[.])*)@([a-zA-Z])*[.]([a-zA-Z]{1,3})'
def is_valid_email_address(person):
email = person[1]
return re.fullmatch(email_pattern, email) is not None
people = []... | 22.782609 | 80 | 0.683206 |
ee4ac62feb1974c6f6bedd51dac813349480d81f | 14,154 | py | Python | skbio/io/format/blast6.py | jairideout/scikit-bio | 81a1ce5acb434603c537f832caee64a76db19190 | [
"BSD-3-Clause"
] | null | null | null | skbio/io/format/blast6.py | jairideout/scikit-bio | 81a1ce5acb434603c537f832caee64a76db19190 | [
"BSD-3-Clause"
] | null | null | null | skbio/io/format/blast6.py | jairideout/scikit-bio | 81a1ce5acb434603c537f832caee64a76db19190 | [
"BSD-3-Clause"
] | null | null | null | """
BLAST+6 format (:mod:`skbio.io.format.blast6`)
==============================================
.. currentmodule:: skbio.io.format.blast6
The BLAST+6 format (``blast+6``) stores the results of a BLAST [1]_ database
search. The results are stored in a simple tabular format with no column
headers. Values are separate... | 46.86755 | 79 | 0.436626 |
47659e07608a00ac7484888e9eb444f46ddb2b71 | 3,454 | py | Python | test1/helper.py | omr00t/Semati | 08f8020b934548818f02de5d6a3ec819098d51eb | [
"BSD-2-Clause"
] | null | null | null | test1/helper.py | omr00t/Semati | 08f8020b934548818f02de5d6a3ec819098d51eb | [
"BSD-2-Clause"
] | null | null | null | test1/helper.py | omr00t/Semati | 08f8020b934548818f02de5d6a3ec819098d51eb | [
"BSD-2-Clause"
] | null | null | null | from .models import Personality, Question
from json import loads
def get_all_book_questions():
"""
This returns the questions in the way that the book presents them.
"""
questions = []
for i in range(0, 6):
for j in Personality.objects.all()[i].first_three_questions:
questions.a... | 40.162791 | 153 | 0.640996 |
08ea0fbc48e236ea1b80aa400f8ac9359f711d22 | 391 | py | Python | allwork/asgi.py | Eysen/allwork_django | 9b15a8a1f93d33752e3530352339bf4bfea4ae41 | [
"MIT"
] | null | null | null | allwork/asgi.py | Eysen/allwork_django | 9b15a8a1f93d33752e3530352339bf4bfea4ae41 | [
"MIT"
] | null | null | null | allwork/asgi.py | Eysen/allwork_django | 9b15a8a1f93d33752e3530352339bf4bfea4ae41 | [
"MIT"
] | null | null | null | """
ASGI config for allwork project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
de254fed62dc52d2020106b0a446361b1d45a20d | 738 | py | Python | python/runner.py | xHeliotrope/led_tweet_writer | ab6de46097e11d79ba7f9a49ea388a09d829da04 | [
"BSD-2-Clause"
] | null | null | null | python/runner.py | xHeliotrope/led_tweet_writer | ab6de46097e11d79ba7f9a49ea388a09d829da04 | [
"BSD-2-Clause"
] | null | null | null | python/runner.py | xHeliotrope/led_tweet_writer | ab6de46097e11d79ba7f9a49ea388a09d829da04 | [
"BSD-2-Clause"
] | null | null | null | from subprocess import Popen, call, PIPE
import os
def run_processes():
my_env = os.environ.copy()
my_env["PYTHONPATH"] = ".:/home/pi/Development/rpi_ws281x/python/build/lib.linux-arm7l-2.7/:/home/pi/Development/rpi_ws281x/pyton/examples/"
proc1 = Popen("%s %s %s" % ('sudo', '/usr/bin/python', 'examples/sc... | 46.125 | 144 | 0.665312 |
e03289d6a7e035b3362fe4678d8e5529cbd06406 | 2,017 | py | Python | python-algorithm/leetcode/problem_206.py | isudox/nerd-algorithm | c1fbe153953cf3fc24395f75d102016fdf9ea0fa | [
"MIT"
] | 5 | 2017-06-11T09:19:34.000Z | 2019-01-16T16:58:31.000Z | python-algorithm/leetcode/problem_206.py | isudox/leetcode-solution | 60085e64deaf396a171367affc94b18114565c43 | [
"MIT"
] | 5 | 2020-03-22T13:53:54.000Z | 2020-03-23T08:49:35.000Z | python-algorithm/leetcode/problem_206.py | isudox/nerd-algorithm | c1fbe153953cf3fc24395f75d102016fdf9ea0fa | [
"MIT"
] | 1 | 2019-03-02T15:50:43.000Z | 2019-03-02T15:50:43.000Z | """206. Reverse Linked List
https://leetcode.com/problems/reverse-linked-list/
Reverse a singly linked list.
Example:
Input: 1->2->3->4->5->NULL
Output: 5->4->3->2->1->NULL
Follow up:
A linked list can be reversed either iteratively or recursively.
Could you implement both?
"""
from typing import Optional
from co... | 25.2125 | 76 | 0.539911 |
2b7d916a27826dff5deb79e71597498d79f7bf45 | 5,695 | py | Python | pylot/perception/fusion/fusion_operator.py | mageofboy/pylot | c3154dc24c9429b9916274894c72ef92e03c946d | [
"Apache-2.0"
] | 231 | 2019-06-05T00:22:00.000Z | 2022-03-28T06:15:00.000Z | pylot/perception/fusion/fusion_operator.py | mageofboy/pylot | c3154dc24c9429b9916274894c72ef92e03c946d | [
"Apache-2.0"
] | 108 | 2019-06-27T16:28:01.000Z | 2022-03-28T19:14:18.000Z | pylot/perception/fusion/fusion_operator.py | mageofboy/pylot | c3154dc24c9429b9916274894c72ef92e03c946d | [
"Apache-2.0"
] | 80 | 2019-06-07T01:08:13.000Z | 2022-03-28T01:44:42.000Z | from collections import deque
import erdos
import numpy as np
from pylot.perception.messages import ObstaclePositionsSpeedsMessage
class FusionOperator(erdos.Operator):
"""Fusion Operator
Args:
rgbd_max_range (:obj:`float`): Maximum distance of the rgbd frame
camera_fov (:obj:`float`): Ang... | 40.678571 | 79 | 0.607902 |
115558f200245f83b4d3485f706365f731a4ee3a | 3,823 | py | Python | examples/classical_ml/misc/neural_network.py | Learn-Live/activity_recognition | 76fa7bcecc3e422f1ea59fd1aaf576669e1248fb | [
"Apache-2.0"
] | 1 | 2022-01-10T21:02:50.000Z | 2022-01-10T21:02:50.000Z | examples/classical_ml/misc/neural_network.py | Learn-Live/activity_recognition | 76fa7bcecc3e422f1ea59fd1aaf576669e1248fb | [
"Apache-2.0"
] | null | null | null | examples/classical_ml/misc/neural_network.py | Learn-Live/activity_recognition | 76fa7bcecc3e422f1ea59fd1aaf576669e1248fb | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Conv1D, GlobalMaxPooling1D, Embedding
from keras.datasets import imdb
from keras.utils import plot_model
from keras import optimizers
import matplotlib... | 30.830645 | 107 | 0.756736 |
24fe1754aa024484abfd062797340cf633a239ad | 904 | py | Python | tests/journal.api/help_notes.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | tests/journal.api/help_notes.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | tests/journal.api/help_notes.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2021 all rights reserved
def test():
"""
Verify access to the channel metadata
"""
# access
import journal
# make a channel
channel = journal.help("test.channel")
# get i... | 21.023256 | 69 | 0.629425 |
79c11158a7ee9c120ddd69d9fa1c69bf314c981d | 4,084 | py | Python | game/round_game.py | DarainS/texas-hold-em-poker | 6bb98f88b19a025affb2898c89ff0bc8c2abf840 | [
"MIT"
] | 1 | 2017-10-13T08:05:47.000Z | 2017-10-13T08:05:47.000Z | game/round_game.py | DarainS/texas-holdem-poker | 6bb98f88b19a025affb2898c89ff0bc8c2abf840 | [
"MIT"
] | null | null | null | game/round_game.py | DarainS/texas-holdem-poker | 6bb98f88b19a025affb2898c89ff0bc8c2abf840 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding=utf-8 -*-
from decimal import Decimal
from card import SevenCard
from deck import Deck
def show(s):
print(s)
class RoundGame():
"""
pot 算法:记录每个玩家的筹码投入量,然后从高到低计算 value ,玩家获得小于等于其最大筹码数的其他玩家的筹码。
"""
def __init__(self):
self.players = []
self.livingPlayers = []
self.sm... | 23.337143 | 72 | 0.680705 |
0ab8a5f6ca2d19559651dd9fe67d1cadd520cf92 | 1,470 | py | Python | tests/tracer/test_version.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | tests/tracer/test_version.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | tests/tracer/test_version.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | import sys
import mock
import pkg_resources
from ddtrace.version import get_version
from tests.tracer import _version # noqa: F401 -> we need to import it so that it can be swapped with the test module
def test_get_version_from_version_file():
with mock.patch.dict(sys.modules, {"ddtrace._version": sys.modules[... | 33.409091 | 118 | 0.738095 |
84918b67f40dfd7db20d55819605fedec44cde70 | 5,614 | py | Python | yt_dlp/extractor/scrippsnetworks.py | mrBliss/yt-dlp | aecd021656b672dbb617e5bae54a8986f9c4ebaf | [
"Unlicense"
] | 80 | 2021-05-25T11:33:49.000Z | 2022-03-29T20:36:53.000Z | yt_dlp/extractor/scrippsnetworks.py | mrBliss/yt-dlp | aecd021656b672dbb617e5bae54a8986f9c4ebaf | [
"Unlicense"
] | 53 | 2017-04-12T19:53:18.000Z | 2022-02-22T10:33:13.000Z | yt_dlp/extractor/scrippsnetworks.py | mrBliss/yt-dlp | aecd021656b672dbb617e5bae54a8986f9c4ebaf | [
"Unlicense"
] | 22 | 2021-05-07T05:01:27.000Z | 2022-03-26T19:10:54.000Z | # coding: utf-8
from __future__ import unicode_literals
import json
import hashlib
from .aws import AWSIE
from .anvato import AnvatoIE
from .common import InfoExtractor
from ..utils import (
smuggle_url,
urlencode_postdata,
xpath_text,
)
class ScrippsNetworksWatchIE(AWSIE):
IE_NAME = 'scrippsnetwork... | 36.934211 | 149 | 0.550053 |
8f94a27439b84c42abf3df7168d5e6a9698570a5 | 870 | py | Python | isi_sdk_8_1_0/test/test_ntp_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/test/test_ntp_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/test/test_ntp_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... | 21.219512 | 79 | 0.694253 |
011c9d049977379f58cddffd512c0577ecd0797d | 1,355 | py | Python | password_generator.py | cavadsalman/password_generator | 6f1bb027220fbc2a1076138b8bedff2b87a3e2c1 | [
"MIT"
] | 1 | 2022-03-01T16:34:34.000Z | 2022-03-01T16:34:34.000Z | password_generator.py | cavadsalman/password_generator | 6f1bb027220fbc2a1076138b8bedff2b87a3e2c1 | [
"MIT"
] | null | null | null | password_generator.py | cavadsalman/password_generator | 6f1bb027220fbc2a1076138b8bedff2b87a3e2c1 | [
"MIT"
] | null | null | null | import random
def get_order():
length = int(input('Length: '))
content_indexes = input("""Content;
1. Lowercases
2. Uppercases
3. Digits
4. Symbols
5. Identific
Select: """)
return {'length': length, 'content_indexes': content_indexes}
class Characters():
# Ascii codes of cha... | 33.04878 | 146 | 0.64059 |
c0e3f902ec25f6244714ea0b99ff5f7a763c4d18 | 133,609 | py | Python | ospgrillage/osp_grillage.py | MonashSmartStructures/ops-grillage | 9b7fea6c1279f704e4ca0a7836538fd8963b60cc | [
"MIT"
] | null | null | null | ospgrillage/osp_grillage.py | MonashSmartStructures/ops-grillage | 9b7fea6c1279f704e4ca0a7836538fd8963b60cc | [
"MIT"
] | 1 | 2021-07-21T06:43:25.000Z | 2021-07-21T06:52:46.000Z | ospgrillage/osp_grillage.py | MonashSmartStructures/ops-grillage | 9b7fea6c1279f704e4ca0a7836538fd8963b60cc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module contain the parent class OspGrillage which handles input information and outputs the grillage model instance
or executable py file. This is done by wrapping `OpenSeesPy` commands for creating models (nodes/elements).
This module also handles all load case assignment, analysis, an... | 45.260501 | 149 | 0.561137 |
86aab1f38c5fffada075fdb4e1ed3c8286bb402f | 98 | py | Python | setup.py | GlenWalker/apipkg | 4322f61343204b030bb5922ef4330f6348b9ffca | [
"MIT"
] | 25 | 2017-06-06T07:06:45.000Z | 2021-11-27T13:50:13.000Z | setup.py | GlenWalker/apipkg | 4322f61343204b030bb5922ef4330f6348b9ffca | [
"MIT"
] | 21 | 2017-09-02T18:50:17.000Z | 2022-03-11T22:49:34.000Z | setup.py | GlenWalker/apipkg | 4322f61343204b030bb5922ef4330f6348b9ffca | [
"MIT"
] | 12 | 2017-09-02T13:25:24.000Z | 2021-09-21T14:12:22.000Z | from setuptools import setup
setup(
use_scm_version={"write_to": "src/apipkg/version.py"},
)
| 16.333333 | 58 | 0.72449 |
46e299d516e358d26a8c45d4830e23e813d6e399 | 1,224 | py | Python | setup.py | simonw/dbf-to-sqlite | 1d1e1e8d64feb74d8a96b99200fb558b06a6957b | [
"Apache-2.0"
] | 30 | 2019-01-31T20:57:55.000Z | 2022-01-25T20:23:11.000Z | setup.py | fg-fly/dbf-to-sqlite | 1d1e1e8d64feb74d8a96b99200fb558b06a6957b | [
"Apache-2.0"
] | 3 | 2019-04-09T01:06:11.000Z | 2020-11-30T03:24:28.000Z | setup.py | fg-fly/dbf-to-sqlite | 1d1e1e8d64feb74d8a96b99200fb558b06a6957b | [
"Apache-2.0"
] | 10 | 2019-04-09T15:34:51.000Z | 2022-01-09T12:05:30.000Z | from setuptools import setup, find_packages
import io
import os
VERSION = "0.1"
def get_long_description():
with io.open(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md"),
encoding="utf8",
) as fp:
return fp.read()
setup(
name="dbf-to-sqlite",
descriptio... | 29.142857 | 82 | 0.634804 |
3e902501a19c49dee5443abf7599cb7ae511d510 | 2,875 | py | Python | gemynd/api/telegramapi/user.py | gemynd/gemynd | e2bca0dc48d19cb2aecf0921e2e5ae5be7a2e2f1 | [
"Apache-2.0"
] | null | null | null | gemynd/api/telegramapi/user.py | gemynd/gemynd | e2bca0dc48d19cb2aecf0921e2e5ae5be7a2e2f1 | [
"Apache-2.0"
] | null | null | null | gemynd/api/telegramapi/user.py | gemynd/gemynd | e2bca0dc48d19cb2aecf0921e2e5ae5be7a2e2f1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# A library that provides a Gemynd AI bot interface
# Copyright (C) 2016
# Gemynd AI Team <devs@gemynd.ai>
#
# 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.a... | 33.430233 | 81 | 0.598261 |
0eccdd9b6215b10722bff50c9168ccf60e8c0aee | 2,792 | py | Python | legacy/steps/preprocesser/base_preprocesser.py | ParikhKadam/zenml | 867e4d4c982a50447bd182b30af37f2141dac5a4 | [
"Apache-2.0"
] | 1,275 | 2020-11-19T14:18:25.000Z | 2021-08-13T07:31:39.000Z | legacy/steps/preprocesser/base_preprocesser.py | ParikhKadam/zenml | 867e4d4c982a50447bd182b30af37f2141dac5a4 | [
"Apache-2.0"
] | 62 | 2020-11-30T16:06:14.000Z | 2021-08-10T08:34:52.000Z | legacy/steps/preprocesser/base_preprocesser.py | ParikhKadam/zenml | 867e4d4c982a50447bd182b30af37f2141dac5a4 | [
"Apache-2.0"
] | 75 | 2020-12-22T19:15:08.000Z | 2021-08-13T03:07:50.000Z | # Copyright (c) ZenML GmbH 2020. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.04878 | 79 | 0.661175 |
6a10bcfd8cb498763c98f8713d652c9041dfca86 | 922 | py | Python | kubernetes_asyncio/test/test_v1_taint.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | 1 | 2021-01-13T09:28:57.000Z | 2021-01-13T09:28:57.000Z | kubernetes_asyncio/test/test_v1_taint.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_taint.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... | 22.487805 | 119 | 0.701735 |
fc38623c40b74424fc69f8b4359491545cea1959 | 706 | py | Python | poop/hfdp/factory/challenge/zone_factory.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | 37 | 2020-12-27T00:13:07.000Z | 2022-01-31T19:30:18.000Z | poop/hfdp/factory/challenge/zone_factory.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | null | null | null | poop/hfdp/factory/challenge/zone_factory.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | 7 | 2020-12-26T22:33:47.000Z | 2021-11-07T01:29:59.000Z | from poop.hfdp.factory.challenge.zone import Zone
from poop.hfdp.factory.challenge.zone_central import ZoneCentral
from poop.hfdp.factory.challenge.zone_eastern import ZoneEastern
from poop.hfdp.factory.challenge.zone_mountain import ZoneMountain
from poop.hfdp.factory.challenge.zone_pacific import ZonePacific
class ... | 35.3 | 66 | 0.681303 |
9fb60fabd4f17e55a9bb6998eab1cd6685540613 | 1,506 | py | Python | tests/test_utils_tracing.py | gva-jjoyce/mabel | eb99e02d0287b851e65ad9a75b5f4188805d4ec9 | [
"Apache-2.0"
] | null | null | null | tests/test_utils_tracing.py | gva-jjoyce/mabel | eb99e02d0287b851e65ad9a75b5f4188805d4ec9 | [
"Apache-2.0"
] | 2 | 2022-01-24T14:56:42.000Z | 2022-01-24T16:04:20.000Z | tests/test_utils_tracing.py | gva-jjoyce/mabel | eb99e02d0287b851e65ad9a75b5f4188805d4ec9 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import string
sys.path.insert(1, os.path.join(sys.path[0], ".."))
from mabel.flows.internals.trace_blocks import TraceBlocks
from mabel.data.formats.json import parse, serialize
from mabel.utils import entropy
from rich import traceback
traceback.install()
def test_hashes():
data_hashes = ... | 28.961538 | 103 | 0.656707 |
cb3aaa4e121c694e0988b5d91573cea276923aff | 15,349 | py | Python | bin/mapped_2hic_dnase.py | gauravj49/nfhic | d21761f50ad39d29fcaaa69a93824793a952c803 | [
"MIT"
] | null | null | null | bin/mapped_2hic_dnase.py | gauravj49/nfhic | d21761f50ad39d29fcaaa69a93824793a952c803 | [
"MIT"
] | null | null | null | bin/mapped_2hic_dnase.py | gauravj49/nfhic | d21761f50ad39d29fcaaa69a93824793a952c803 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# HiC-Pro
# Copyleft 2015 Institut Curie
# Author(s): Nicolas Servant, Eric Viara
# Contact: nicolas.servant@curie.fr
# This software is distributed without any guarantee under the terms of the
# GNU General
# Public License, either Version 2, June 1991 or Version 3, June 2007.
"""
Script to kee... | 33.008602 | 207 | 0.506026 |
8ac5fef0408f0e055d132563ea4e98b7db9b0f89 | 5,749 | py | Python | nltk/corpus/util.py | FGDBTKD/nltk | 384e46e82789c7f47a7fb521ef976f82c3c4c3fb | [
"Apache-2.0"
] | null | null | null | nltk/corpus/util.py | FGDBTKD/nltk | 384e46e82789c7f47a7fb521ef976f82c3c4c3fb | [
"Apache-2.0"
] | null | null | null | nltk/corpus/util.py | FGDBTKD/nltk | 384e46e82789c7f47a7fb521ef976f82c3c4c3fb | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Corpus Reader Utility Functions
#
# Copyright (C) 2001-2018 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
######################################################################
#{ Lazy Corpus Loader
#############... | 39.648276 | 104 | 0.644808 |
3c265a3a4741958163dd36d8398244eeee3e26b0 | 15,837 | py | Python | tests/test_octodns_provider_powerdns.py | swisstxt/octodns-2 | 34e36372b5bd60e27c84fce18d5429978bdfa6b7 | [
"MIT"
] | null | null | null | tests/test_octodns_provider_powerdns.py | swisstxt/octodns-2 | 34e36372b5bd60e27c84fce18d5429978bdfa6b7 | [
"MIT"
] | null | null | null | tests/test_octodns_provider_powerdns.py | swisstxt/octodns-2 | 34e36372b5bd60e27c84fce18d5429978bdfa6b7 | [
"MIT"
] | null | null | null | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from json import loads, dumps
from os.path import dirname, join
from requests import HTTPError
from requests_mock import ANY, mock as requests_mock
from six import text_type
from unittest import TestCase
from octodns.recor... | 38.816176 | 79 | 0.531856 |
cce3c31828f5a4b45c4a3595dd5129052ffaed81 | 699 | py | Python | docker/storperf-master/storperf/workloads/_ssd_preconditioning.py | hashnfv/hashnfv-storperf | 9eebe429ae9ec58a593611063da5b541634f8932 | [
"Apache-2.0"
] | null | null | null | docker/storperf-master/storperf/workloads/_ssd_preconditioning.py | hashnfv/hashnfv-storperf | 9eebe429ae9ec58a593611063da5b541634f8932 | [
"Apache-2.0"
] | null | null | null | docker/storperf-master/storperf/workloads/_ssd_preconditioning.py | hashnfv/hashnfv-storperf | 9eebe429ae9ec58a593611063da5b541634f8932 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2015 EMC and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# ht... | 38.833333 | 78 | 0.567954 |
215175067cd84152cc5dc18459dffae8113b643f | 6,823 | py | Python | env/chessandcard.py | jidiai/ai_lab | 2a9d5a940e3153e1698c2e1800e29723121b529b | [
"MIT"
] | null | null | null | env/chessandcard.py | jidiai/ai_lab | 2a9d5a940e3153e1698c2e1800e29723121b529b | [
"MIT"
] | null | null | null | env/chessandcard.py | jidiai/ai_lab | 2a9d5a940e3153e1698c2e1800e29723121b529b | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# Time : 2021/10/25 下午2:28
# Author: Yahui Cui
import copy
from gym.utils import seeding
from env.simulators.game import Game
from env.obs_interfaces.observation import *
from utils.discrete import Discrete
class ChessAndCard(Game, DictObservation):
def __init__(self, conf):
sup... | 36.486631 | 114 | 0.630808 |
c35ebf2550d5775ccde04c0bfdcdfa902f306f89 | 7,500 | py | Python | admin/rdm_timestampadd/views.py | rdm-dev12/RDM-osf.io | 14d9a924b8c6bc7d79fd34b87830ffa29acafed1 | [
"Apache-2.0"
] | null | null | null | admin/rdm_timestampadd/views.py | rdm-dev12/RDM-osf.io | 14d9a924b8c6bc7d79fd34b87830ffa29acafed1 | [
"Apache-2.0"
] | 20 | 2020-03-24T16:48:03.000Z | 2022-03-08T22:38:38.000Z | admin/rdm_timestampadd/views.py | rdm-dev12/RDM-osf.io | 14d9a924b8c6bc7d79fd34b87830ffa29acafed1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from admin.base import settings
from admin.rdm.utils import RdmPermissionMixin, get_dummy_institution
from django.contrib.auth.mixins import UserPassesTestMixin
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers impor... | 40.106952 | 130 | 0.689067 |
f7101a8b865c1f87f28c1270c97bd9246634db2e | 69 | py | Python | emailtrail/__init__.py | akshaykmr/emailtrail | 8298e4b68c70f9b64198f54e4f3baf77d5fe54fa | [
"MIT"
] | 11 | 2020-04-05T07:24:46.000Z | 2021-01-10T06:58:00.000Z | emailtrail/__init__.py | akshaykmr/emailtrail | 8298e4b68c70f9b64198f54e4f3baf77d5fe54fa | [
"MIT"
] | 1 | 2021-09-09T16:46:18.000Z | 2021-09-09T16:46:18.000Z | emailtrail/__init__.py | akshaykmr/emailtrail | 8298e4b68c70f9b64198f54e4f3baf77d5fe54fa | [
"MIT"
] | 1 | 2020-10-26T17:50:10.000Z | 2020-10-26T17:50:10.000Z | from .module import * # noqa
from .models import Trail, Hop # noqa
| 17.25 | 37 | 0.695652 |
717d75b35f7a398934a5d8ee400199c4c2274e34 | 4,763 | py | Python | nova/tests/api/openstack/compute/plugins/v3/test_extension_info.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-02-21T19:19:11.000Z | 2020-02-21T19:19:11.000Z | nova/tests/api/openstack/compute/plugins/v3/test_extension_info.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_extension_info.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-07-24T09:15:58.000Z | 2020-07-24T09:15:58.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# 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
#
# ... | 42.90991 | 78 | 0.636574 |
7bb86419d7eef865f279f7f4ae745c93a7d77598 | 14,677 | py | Python | codebase/third_party/spos_ofa/ofa/imagenet_classification/data_providers/cifar2.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | codebase/third_party/spos_ofa/ofa/imagenet_classification/data_providers/cifar2.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | codebase/third_party/spos_ofa/ofa/imagenet_classification/data_providers/cifar2.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Optional, Tuple
import numpy as np
import torch
import copy
import torchvision.datasets as datasets
import torchvision.transforms as transforms
from PIL import Image
from torchvision.datasets import CIFAR100
from torch.utils.data.dataset import Dataset, T_co
class2superclass = [4, 1,... | 36.419355 | 117 | 0.633985 |
fe05905f74e18c9930938a46cd7dc883db126f57 | 11,693 | py | Python | ycm_extra_conf.py | amiller27/dotfiles | ba17fbc2dab044999f04db106cb1b2f92e953d1f | [
"Apache-2.0"
] | null | null | null | ycm_extra_conf.py | amiller27/dotfiles | ba17fbc2dab044999f04db106cb1b2f92e953d1f | [
"Apache-2.0"
] | 10 | 2019-01-23T20:51:41.000Z | 2020-04-13T23:43:44.000Z | ycm_extra_conf.py | amiller27/dotfiles | ba17fbc2dab044999f04db106cb1b2f92e953d1f | [
"Apache-2.0"
] | 2 | 2019-08-02T20:14:46.000Z | 2020-04-28T19:07:15.000Z | # -*- coding: utf-8 -*-
##########################################################################
# YouCompleteMe configuration for ROS #
# Original Author: Gaël Ecorchard (2015) #
# Heavily Modified by: Aaron Miller ... | 36.77044 | 83 | 0.595912 |
a90f07b564716efb0eccbf6a4c2ebdeca50db04e | 666 | py | Python | ASE/celery.py | 5wimming/ase | 0d506add3a83caf9afd01f216c256c4678010918 | [
"Apache-2.0"
] | 10 | 2021-07-13T02:15:15.000Z | 2022-02-21T07:27:54.000Z | ASE/celery.py | 5wimming/ase | 0d506add3a83caf9afd01f216c256c4678010918 | [
"Apache-2.0"
] | 3 | 2022-02-21T08:59:01.000Z | 2022-03-05T02:45:34.000Z | ASE/celery.py | 5wimming/ase | 0d506add3a83caf9afd01f216c256c4678010918 | [
"Apache-2.0"
] | 3 | 2021-08-19T07:54:39.000Z | 2022-02-21T07:27:55.000Z | # coding:utf-8
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery, platforms
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ASE.settings')
app = Celery('ASE', backend='redis... | 28.956522 | 138 | 0.758258 |
12da7a042b2e9ce3e36e2416e766509384cc3513 | 4,236 | py | Python | reflex_gripper/src/reflex_gripper/motor.py | rpiRobotics/reflex-gripper-ros-pkg | 12388049d65ebcc7b54c650a87e16718801e6fdb | [
"Apache-2.0"
] | null | null | null | reflex_gripper/src/reflex_gripper/motor.py | rpiRobotics/reflex-gripper-ros-pkg | 12388049d65ebcc7b54c650a87e16718801e6fdb | [
"Apache-2.0"
] | null | null | null | reflex_gripper/src/reflex_gripper/motor.py | rpiRobotics/reflex-gripper-ros-pkg | 12388049d65ebcc7b54c650a87e16718801e6fdb | [
"Apache-2.0"
] | null | null | null | #############################################################################
# Code Modified by Gregory Grebe for use with the CATS Robotics Lab
# http://github.com/rpiRobotics/reflex-gripper-ros-pkg
# Aug 17, 2015
#
# Original License:
#
# Copyright 2015 Right Hand Robotics
#
# Licensed under the Apache License, Ver... | 34.721311 | 107 | 0.673513 |
5cb774271d9d5b9cac65bad3c6f85c033316a5b6 | 1,199 | py | Python | test/generator_spa_test.py | fmcooper/matchingproblems | 0d99e442c581427a7f09dce9f64d487f276e906c | [
"MIT"
] | null | null | null | test/generator_spa_test.py | fmcooper/matchingproblems | 0d99e442c581427a7f09dce9f64d487f276e906c | [
"MIT"
] | 1 | 2021-11-14T03:39:48.000Z | 2021-11-14T03:39:48.000Z | test/generator_spa_test.py | fmcooper/matchingproblems | 0d99e442c581427a7f09dce9f64d487f276e906c | [
"MIT"
] | null | null | null | import matchingproblems
from matchingproblems.generator import generator_spa as generator
import unittest
"""Testing class for the SPA instance generator."""
class TestSPAGenerator(unittest.TestCase):
def test_instance_generation(self):
gen = generator.Generator_spa()
instance = gen.create_instance(
... | 23.509804 | 65 | 0.473728 |
b82632d36f01e1889ce2cb7a6dd429ac43eca8b5 | 8,457 | py | Python | transform_sintel.py | AhmedAlaa10/Consistent_Video_Depth_Estimation | 1a8868eadcf0b2082cdfea8ed339865f0ba8ea01 | [
"MIT"
] | null | null | null | transform_sintel.py | AhmedAlaa10/Consistent_Video_Depth_Estimation | 1a8868eadcf0b2082cdfea8ed339865f0ba8ea01 | [
"MIT"
] | null | null | null | transform_sintel.py | AhmedAlaa10/Consistent_Video_Depth_Estimation | 1a8868eadcf0b2082cdfea8ed339865f0ba8ea01 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import re
import sys
from posix import listdir
from shutil import copyfile
from pathlib import Path
import importlib.util
#from pyquaternion import Quaternion
import numpy as np
from math import sqrt
import cv2 #TODO: pip install opencv-python
import os
from os.path import isfile, join
... | 33.963855 | 192 | 0.614639 |
28052532948fd20618d5c689dd7818672002e0fd | 688 | py | Python | travellite/migrations/0005_review.py | Greko2017/kenda-travel-new | 9fc1fcbd160847a8d266a50345f2bda9a2da99de | [
"MIT"
] | 25 | 2019-01-16T16:24:08.000Z | 2022-03-03T04:43:29.000Z | travellite/migrations/0005_review.py | Greko2017/kenda-travel-new | 9fc1fcbd160847a8d266a50345f2bda9a2da99de | [
"MIT"
] | 3 | 2018-08-02T08:13:37.000Z | 2020-10-15T13:41:17.000Z | travellite/migrations/0005_review.py | Greko2017/kenda-travel-new | 9fc1fcbd160847a8d266a50345f2bda9a2da99de | [
"MIT"
] | 16 | 2019-03-25T11:19:49.000Z | 2021-12-03T10:04:17.000Z | # Generated by Django 2.0.4 on 2018-05-08 00:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('travellite', '0004_auto_20180507_1920'),
]
operations = [
migrations.CreateModel(
name='Review',
fields=[
... | 28.666667 | 114 | 0.56686 |
4c9897a36dff8ecac8168b73bf0927a1b150d53e | 1,063 | py | Python | setup.py | byhyu/explainable-ai-demo | 6e798544facb74b54169f9d55bd1503953db8727 | [
"RSA-MD"
] | null | null | null | setup.py | byhyu/explainable-ai-demo | 6e798544facb74b54169f9d55bd1503953db8727 | [
"RSA-MD"
] | 7 | 2021-02-02T23:12:35.000Z | 2022-01-13T03:32:52.000Z | setup.py | byhyu/explainable-ai-demo | 6e798544facb74b54169f9d55bd1503953db8727 | [
"RSA-MD"
] | null | null | null | from distutils.core import setup
def readme():
"""Import the README.md Markdown file and try to convert it to RST format."""
try:
import pypandoc
return pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
with open('README.md') as readme_file:
return read... | 25.926829 | 81 | 0.584196 |
b2e20bcf97b45ad680e23fa25f257ee700ae53fe | 2,928 | py | Python | VGG-backbone-32/utils.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 5 | 2021-05-23T13:05:45.000Z | 2022-02-13T21:40:59.000Z | VGG-backbone-32/utils.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | null | null | null | VGG-backbone-32/utils.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 3 | 2021-08-11T03:23:31.000Z | 2021-11-17T01:48:52.000Z | from nested_dict import nested_dict
from functools import partial
import torch
from torch.nn.init import kaiming_normal_
from torch.nn.parallel._functions import Broadcast
from torch.nn.parallel import scatter, parallel_apply, gather
import torch.nn.functional as F
def distillation(y, teacher_scores, labels, T, alpha... | 32.533333 | 118 | 0.635587 |
f225b35b5ef9ac310633b62b6790878ea239faf8 | 8,625 | py | Python | src/AI.py | Progitiel/Slideways | 64b8672860893eea6be245b5138f5ec48e97ed8c | [
"MIT"
] | null | null | null | src/AI.py | Progitiel/Slideways | 64b8672860893eea6be245b5138f5ec48e97ed8c | [
"MIT"
] | null | null | null | src/AI.py | Progitiel/Slideways | 64b8672860893eea6be245b5138f5ec48e97ed8c | [
"MIT"
] | null | null | null | import random
import copy
import numpy as np
from Config import *
def coup_AI(plateau, playerNumber, line=None, column=None, direction=None):
"""
Simule le coup d'un joueur sur un plateau
Entrées :
plateau [[int,int,...],[int,int,...],...] : listes de listes représentant le plateau
playe... | 38.333333 | 146 | 0.574609 |
d24d40d992379da2b47471a62b3c0adc861bca62 | 4,625 | py | Python | finishedgames/catalogsources/management/commands/fetch_platforms.py | Kartones/finished-games | 9b1f86aee3ea26be50b666887e3bdecad2c8f757 | [
"Unlicense"
] | 7 | 2019-01-23T20:09:00.000Z | 2021-12-19T17:50:48.000Z | finishedgames/catalogsources/management/commands/fetch_platforms.py | Kartones/finished-games | 9b1f86aee3ea26be50b666887e3bdecad2c8f757 | [
"Unlicense"
] | 2 | 2019-08-11T11:16:00.000Z | 2019-09-04T00:07:04.000Z | finishedgames/catalogsources/management/commands/fetch_platforms.py | Kartones/finished-games | 9b1f86aee3ea26be50b666887e3bdecad2c8f757 | [
"Unlicense"
] | 2 | 2019-01-23T20:09:05.000Z | 2020-09-06T10:43:25.000Z | from typing import Any, Dict, List
from catalogsources.helpers import clean_string_field
from catalogsources.management.helpers import TimeProfiler, source_class_from_id, wait_if_needed
from catalogsources.models import FetchedPlatform
from django.core.management.base import BaseCommand, CommandParser
class Command(... | 45.792079 | 119 | 0.635676 |
1bbe636b1d0d1a3d902a35bbb0d747d630dc1bad | 2,118 | py | Python | src/pyotp/otp.py | ddboline/pyotp | 147885b1b860a4439ca4a89030c0e3c6b97e7de0 | [
"MIT"
] | null | null | null | src/pyotp/otp.py | ddboline/pyotp | 147885b1b860a4439ca4a89030c0e3c6b97e7de0 | [
"MIT"
] | null | null | null | src/pyotp/otp.py | ddboline/pyotp | 147885b1b860a4439ca4a89030c0e3c6b97e7de0 | [
"MIT"
] | null | null | null | import base64
import hashlib
import hmac
from typing import Any, Optional
class OTP(object):
"""
Base class for OTP handlers.
"""
def __init__(self, s: str, digits: int = 6, digest: Any = hashlib.sha1, name: Optional[str] = None,
issuer: Optional[str] = None) -> None:
self.dig... | 35.3 | 103 | 0.576487 |
7e4ad8f928601eb39b474758a597621539885e9e | 2,390 | py | Python | taotao-cloud-python/taotao-cloud-django/taotao_cloud_auto_cmdb/cmdb_server/api/service/disk.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 47 | 2021-04-13T10:32:13.000Z | 2022-03-31T10:30:30.000Z | taotao-cloud-python/taotao-cloud-django/taotao_cloud_auto_cmdb/cmdb_server/api/service/disk.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:41:04.000Z | 2021-11-01T07:41:10.000Z | taotao-cloud-python/taotao-cloud-django/taotao_cloud_auto_cmdb/cmdb_server/api/service/disk.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 21 | 2021-04-13T10:32:17.000Z | 2022-03-26T07:43:22.000Z | from repository import models
class Disk(object):
def __init__(self):
pass
@classmethod
def initial(cls):
return cls()
def process(self, new, server_obj):
new_data = new.get('data')
if new.get('status'):
new_slot = list(new_data.keys()) # 新采集硬盘插槽列表
... | 41.206897 | 119 | 0.535565 |
414797794c963888b85142bc4f206d8fac4cb40a | 1,319 | py | Python | models/han_origin/args.py | Mrmoore98/hedwig | dc8c2f1f5e6886b9ce9999bbd071bce02cfbbaf1 | [
"Apache-2.0"
] | null | null | null | models/han_origin/args.py | Mrmoore98/hedwig | dc8c2f1f5e6886b9ce9999bbd071bce02cfbbaf1 | [
"Apache-2.0"
] | null | null | null | models/han_origin/args.py | Mrmoore98/hedwig | dc8c2f1f5e6886b9ce9999bbd071bce02cfbbaf1 | [
"Apache-2.0"
] | null | null | null | import os
import models.args
def get_args():
parser = models.args.get_args()
parser.add_argument('--mode', type=str, default='static', choices=['rand', 'static', 'non-static'])
parser.add_argument('--dataset', type=str, default='Reuters', choices=['Reuters', 'AAPD', 'IMDB', 'Yelp2014'])
pa... | 47.107143 | 120 | 0.682335 |
b40db11cb05c9fdcad4f0c60733cfc9527da2b2c | 18,468 | py | Python | datasets/vcoco.py | iloveat/HoiTransformer | 904736d80e42158bda988565b12cb65e823e5597 | [
"Apache-2.0"
] | null | null | null | datasets/vcoco.py | iloveat/HoiTransformer | 904736d80e42158bda988565b12cb65e823e5597 | [
"Apache-2.0"
] | null | null | null | datasets/vcoco.py | iloveat/HoiTransformer | 904736d80e42158bda988565b12cb65e823e5597 | [
"Apache-2.0"
] | null | null | null | # ------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License")
# ------------------------------------------------------------------------
# Modified from DETR (https://github.com/facebookresearch/detr)
# Copyright (c) Facebook, Inc. and its af... | 32.174216 | 104 | 0.580355 |
d754fa31a01365082584d76e182fcd659f22c333 | 5,747 | py | Python | rxneqn/half_rxn_balancer.py | djinnome/rxneqn | 357b2caf3ba7081f79a6c3356431b1ed5fca4b20 | [
"MIT"
] | 1 | 2019-02-12T22:56:50.000Z | 2019-02-12T22:56:50.000Z | rxneqn/half_rxn_balancer.py | djinnome/rxneqn | 357b2caf3ba7081f79a6c3356431b1ed5fca4b20 | [
"MIT"
] | null | null | null | rxneqn/half_rxn_balancer.py | djinnome/rxneqn | 357b2caf3ba7081f79a6c3356431b1ed5fca4b20 | [
"MIT"
] | null | null | null | from . import Reaction, Mixture
from .utils import LCM, LCD
import pandas as pd
from fractions import Fraction
class HalfReactionBalancer:
def __init__( self ):
pass
def custom_half_reaction( self, C, H, O, N, charge=0):
"""generate custom half reaction from empirical formula
... | 48.294118 | 123 | 0.562728 |
54dc1da6cab05f45ff308b2e8db93a9b3cc7758d | 6,564 | py | Python | aqt/utils/hparams_utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-19T04:26:12.000Z | 2022-03-19T04:26:12.000Z | aqt/utils/hparams_utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | aqt/utils/hparams_utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 32.49505 | 88 | 0.731261 |
dee4a5a4fb2eb2ae6134a0d6568e50638b695519 | 21,138 | py | Python | src/nnicotine/datasets/cath.py | KIT-MBS/nnicotine | 3681391d05d0a2d92e16431f5bc985cd6ff606fd | [
"MIT"
] | 2 | 2021-03-28T02:02:30.000Z | 2021-09-09T23:27:39.000Z | src/nnicotine/datasets/cath.py | KIT-MBS/nnicotine | 3681391d05d0a2d92e16431f5bc985cd6ff606fd | [
"MIT"
] | null | null | null | src/nnicotine/datasets/cath.py | KIT-MBS/nnicotine | 3681391d05d0a2d92e16431f5bc985cd6ff606fd | [
"MIT"
] | null | null | null | import os
import sys
from collections import OrderedDict
import gzip
import re
import numpy as np
import h5py
import torch
from Bio.PDB.MMCIFParser import MMCIFParser
from Bio import AlignIO
from Bio import pairwise2
from torchvision.datasets.utils import download_url
from tqdm import tqdm
from .utils import cath_tra... | 50.8125 | 346 | 0.612593 |
99aa624f19efa1afde630b3576e0d7e527c447d3 | 2,297 | py | Python | tests/test_text_preprocess.py | crystina-z/nirtools | c2ac5ac515f85353f05b25570a85169babc5f26e | [
"MIT"
] | 1 | 2020-06-19T06:07:05.000Z | 2020-06-19T06:07:05.000Z | tests/test_text_preprocess.py | crystina-z/nir-tools | 19018fa2870c0f0156b7f0cf05a85e81a02cff30 | [
"MIT"
] | 1 | 2020-09-30T12:22:37.000Z | 2020-09-30T12:22:37.000Z | tests/test_text_preprocess.py | crystina-z/nirtools | c2ac5ac515f85353f05b25570a85169babc5f26e | [
"MIT"
] | null | null | null | from nirtools.text import preprocess
def test_get_lang_reserved_words():
words = preprocess.get_lang_reserved_words("ruby")
assert words == [
"__ENCODING__", "__LINE__", "__FILE__", "BEGIN", "END", "alias", "and", "begin",
"break", "case", "class", "def", "defined", "do", "else", "elsif", "end... | 65.628571 | 259 | 0.588158 |
c76621fbd6ea46c51dafb892b056abb73fe77f1b | 2,997 | py | Python | ert3py/node/Pub.py | trihome/eRT3_ros2 | 237cf026b9575fcd2b4341ec6b45dd7e87436ed6 | [
"MIT"
] | null | null | null | ert3py/node/Pub.py | trihome/eRT3_ros2 | 237cf026b9575fcd2b4341ec6b45dd7e87436ed6 | [
"MIT"
] | null | null | null | ert3py/node/Pub.py | trihome/eRT3_ros2 | 237cf026b9575fcd2b4341ec6b45dd7e87436ed6 | [
"MIT"
] | null | null | null | #!/usr/bin/env /usr/bin/python3
# -*- coding: utf-8 -*-
# -----------------------------------------------
# ROS2 Node 送信側
#
# The MIT License (MIT)
# Copyright (C) 2020 myasu.
# -----------------------------------------------
import rclpy
from rclpy.node import Node
# カスタムメッセージ
from ert3_mes.msg import Dio... | 22.877863 | 73 | 0.446446 |
2126cbaf09e551a0654a23721db3febb956a2b85 | 1,546 | py | Python | simplecep/models.py | cauethenorio/django-simplecep | acab8a99fe3df8c6a2f01909c07fa36b1ea2d922 | [
"MIT"
] | 3 | 2020-10-18T16:29:32.000Z | 2021-09-22T12:10:19.000Z | simplecep/models.py | cauethenorio/django-simplecep | acab8a99fe3df8c6a2f01909c07fa36b1ea2d922 | [
"MIT"
] | 6 | 2019-11-26T01:18:43.000Z | 2022-02-10T12:50:16.000Z | simplecep/models.py | cauethenorio/django-simplecep | acab8a99fe3df8c6a2f01909c07fa36b1ea2d922 | [
"MIT"
] | 1 | 2020-03-31T03:52:13.000Z | 2020-03-31T03:52:13.000Z | from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from simplecep import CEPAddress
from simplecep.conf import simplecep_settings
class ValidCepsManager(models.Manager):
def get_queryset(self):
return (
super()
.ge... | 32.208333 | 87 | 0.660414 |
de689f14fd9dd0104cdedeef011654c1fff2ea5e | 1,556 | py | Python | apps/cms/urls.py | dengjinshan/xfz | 2387a214a81b1487518c358291944d84736d7fff | [
"MIT"
] | null | null | null | apps/cms/urls.py | dengjinshan/xfz | 2387a214a81b1487518c358291944d84736d7fff | [
"MIT"
] | null | null | null | apps/cms/urls.py | dengjinshan/xfz | 2387a214a81b1487518c358291944d84736d7fff | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
from . import course_views, staff_views
from django.conf.urls.static import static
from django.conf import settings
app_name = 'cms'
urlpatterns = [
path('index/', views.index, name='index'),
path('news_list/', views.NewsListView.as_view(), name='news_list'),
... | 40.947368 | 86 | 0.715938 |
65d6fc9e42ad286a76244a5bf5c404d35f4ae617 | 24,950 | py | Python | vkontakte_wall/migrations/0015_auto__del_comment__del_field_post_likes__del_field_post_comments__del_.py | ramusus/django-vkontakte-wall | dbbc71f79b2651c6367c706d0cbe66f4dcd1b277 | [
"BSD-3-Clause"
] | 10 | 2015-01-10T15:34:25.000Z | 2021-07-30T11:14:22.000Z | vkontakte_wall/migrations/0015_auto__del_comment__del_field_post_likes__del_field_post_comments__del_.py | gorelikspb/django-vkontakte-wall | 09b921034d909d7162ee48e8a3eb1c29c0747f40 | [
"BSD-3-Clause"
] | 2 | 2015-06-11T15:28:52.000Z | 2015-08-04T11:53:13.000Z | vkontakte_wall/migrations/0015_auto__del_comment__del_field_post_likes__del_field_post_comments__del_.py | gorelikspb/django-vkontakte-wall | 09b921034d909d7162ee48e8a3eb1c29c0747f40 | [
"BSD-3-Clause"
] | 7 | 2015-01-29T15:51:38.000Z | 2020-09-01T03:14:47.000Z | # -*- coding: utf-8 -*-
from django.db import models
from south.db import db
from south.utils import datetime_utils as datetime
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Comment'
db.delete_table(u'vkontakte_wall_comment')
... | 68.922652 | 217 | 0.618637 |
730c7a8660cd5bcaf3c61c637c0730768d6a9a27 | 1,905 | py | Python | src/schmetterling/tag/git_delivery.py | bjuvensjo/schmetterling | 0cdbfe4f379a081d9d4711dd21866b90983365cf | [
"Apache-2.0"
] | null | null | null | src/schmetterling/tag/git_delivery.py | bjuvensjo/schmetterling | 0cdbfe4f379a081d9d4711dd21866b90983365cf | [
"Apache-2.0"
] | null | null | null | src/schmetterling/tag/git_delivery.py | bjuvensjo/schmetterling | 0cdbfe4f379a081d9d4711dd21866b90983365cf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from vang.core.core import pmap_unordered
from vang.pio.shell import run_command
from schmetterling.core.git import get_commit, get_tag
from schmetterling.core.log import log_params_return
from schmetterling.setup.state import SetupState
from schmetterling.tag.state import Repo, Tag, TagState
... | 25.4 | 70 | 0.645669 |
b6eaac90086c01b09d3b865d0cd29bb5a4fa52eb | 1,524 | py | Python | custom/icds_reports/data_pull/exporter.py | scottwedge/commcare-hq | 900ccf81c9f23fb3b435962f065648669817f37a | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/data_pull/exporter.py | scottwedge/commcare-hq | 900ccf81c9f23fb3b435962f065648669817f37a | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/data_pull/exporter.py | scottwedge/commcare-hq | 900ccf81c9f23fb3b435962f065648669817f37a | [
"BSD-3-Clause"
] | null | null | null | import zipfile
from django.utils.functional import cached_property
from corehq.util.context_managers import prevent_parallel_execution
from custom.icds.const import DATA_PULL_CACHE_KEY
from custom.icds_reports.const import CUSTOM_DATA_PULLS
from custom.icds_reports.data_pull.data_pulls import DirectDataPull
class D... | 37.170732 | 82 | 0.698819 |
5eb8146f5e102a7c44eba317b8de6767b046a6f7 | 11,353 | py | Python | graphene_django_extras/fields.py | keithhackbarth/graphene-django-extras | ba7cb36e2eedb603b9369b59ecac3999dc1e5bf9 | [
"MIT"
] | null | null | null | graphene_django_extras/fields.py | keithhackbarth/graphene-django-extras | ba7cb36e2eedb603b9369b59ecac3999dc1e5bf9 | [
"MIT"
] | null | null | null | graphene_django_extras/fields.py | keithhackbarth/graphene-django-extras | ba7cb36e2eedb603b9369b59ecac3999dc1e5bf9 | [
"MIT"
] | 1 | 2022-03-11T11:27:34.000Z | 2022-03-11T11:27:34.000Z | # -*- coding: utf-8 -*-
import operator
from functools import partial
from graphene import Field, List, ID, Argument
from graphene.types.structures import Structure, NonNull
from graphene_django.fields import DjangoListField as DLF
from graphene_django.filter.utils import get_filtering_args_from_filterset
from graphen... | 34.299094 | 115 | 0.583987 |
59329debecf86d90055447448d499bace3dc46ca | 14,106 | py | Python | libcxx/utils/libcxx/test/dsl.py | Diatrus/llvm-project | de78ef470a60fd6eee4b57f656315b0212101ba4 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/dsl.py | Diatrus/llvm-project | de78ef470a60fd6eee4b57f656315b0212101ba4 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/dsl.py | Diatrus/llvm-project | de78ef470a60fd6eee4b57f656315b0212101ba4 | [
"Apache-2.0"
] | null | null | null | #===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------... | 41.125364 | 157 | 0.688005 |
133e40fd0f3371147f4d81065f5ea25dacf62bbc | 5,839 | py | Python | intersight/models/hyperflex_abstract_app_setting_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | intersight/models/hyperflex_abstract_app_setting_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | intersight/models/hyperflex_abstract_app_setting_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight OpenAPI specification.
The Cisco Intersight OpenAPI specification.
OpenAPI spec version: 1.0.9-1461
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexAbstract... | 32.082418 | 576 | 0.614831 |
e82f9bbf0aa8c865c524a93802b10a1a7820a2be | 8,717 | py | Python | openquake/hazardlib/geo/line.py | gfzriesgos/shakyground-lfs | 2caf67cc32e6800286eded2df1efb05973ccf41b | [
"BSD-3-Clause"
] | 1 | 2019-08-01T00:28:24.000Z | 2019-08-01T00:28:24.000Z | openquake/hazardlib/geo/line.py | gfzriesgos/shakyground-lfs | 2caf67cc32e6800286eded2df1efb05973ccf41b | [
"BSD-3-Clause"
] | 4 | 2018-08-31T14:14:35.000Z | 2021-10-11T12:53:13.000Z | openquake/hazardlib/geo/line.py | gfzriesgos/shakyground-lfs | 2caf67cc32e6800286eded2df1efb05973ccf41b | [
"BSD-3-Clause"
] | 3 | 2018-08-31T14:11:00.000Z | 2019-07-17T10:06:02.000Z | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | 35.72541 | 81 | 0.602616 |
944e5faa8c684a2aa973e306e54b14f9ef436444 | 17,657 | py | Python | custard/tests/test.py | kunitoki/django-custard | 3cf3aa5acf84de2f653e96469e2f9c42813df50a | [
"MIT"
] | 6 | 2015-06-15T07:40:26.000Z | 2016-06-27T08:01:34.000Z | custard/tests/test.py | kunitoki/django-custard | 3cf3aa5acf84de2f653e96469e2f9c42813df50a | [
"MIT"
] | 3 | 2015-03-11T22:43:01.000Z | 2015-06-07T21:50:36.000Z | custard/tests/test.py | kunitoki/django-custard | 3cf3aa5acf84de2f653e96469e2f9c42813df50a | [
"MIT"
] | 6 | 2015-03-11T22:19:57.000Z | 2021-03-10T15:40:52.000Z | from __future__ import unicode_literals
from datetime import date, time, datetime
import django
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, Client
from django.test.clien... | 46.960106 | 116 | 0.544543 |
0895e610f9355d7f226588ec8e02e27b320e2d48 | 969 | py | Python | takaggle/tools/create_pickle_data.py | takapy0210/takaggle | fcaa6ef23f3fd2a5a8ebe15e66b66c99d684d8d0 | [
"MIT"
] | 3 | 2021-03-21T02:28:25.000Z | 2022-02-12T07:28:56.000Z | takaggle/tools/create_pickle_data.py | takapy0210/takaggle | fcaa6ef23f3fd2a5a8ebe15e66b66c99d684d8d0 | [
"MIT"
] | null | null | null | takaggle/tools/create_pickle_data.py | takapy0210/takaggle | fcaa6ef23f3fd2a5a8ebe15e66b66c99d684d8d0 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import yaml
import load_data
from util import get_logger, reduce_mem_usage
logger = get_logger()
file_path = os.path.dirname(__file__)
CONFIG_FILE = '../config/config.yaml'
with open(CONFIG_FILE) as file:
yml = yaml.load(file)
INPUT_DIR_NAME = yml['SETTING']['INPUT_DIR_NAME']
def c... | 32.3 | 75 | 0.750258 |
3c83924f1b83b4725fe4f1034bb0e5e5c315f3f8 | 1,848 | py | Python | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/views/project_version_view.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/views/project_version_view.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/views/project_version_view.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | #coding=utf-8
# coding=utf-8
'''
Created on 2014-1-5
@author: ETHAN
'''
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from gatesidelib.common.simplelogger import SimpleLogger
fr... | 24.64 | 92 | 0.752706 |
c77c4eecbdd638bedf7fba794f1af0294ff95ec8 | 383 | py | Python | alembic/versions/f4e906862bfa_.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | 1 | 2022-03-20T21:46:05.000Z | 2022-03-20T21:46:05.000Z | alembic/versions/f4e906862bfa_.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | alembic/versions/f4e906862bfa_.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | """empty message
Revision ID: f4e906862bfa
Revises: 647f600ed6a8, 709ea24ea2ce
Create Date: 2022-02-13 22:58:14.523431
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f4e906862bfa'
down_revision = ('647f600ed6a8', '709ea24ea2ce')
branch_labels = None
depends_o... | 15.32 | 48 | 0.741514 |
914004cb45fc6ae292b1fe99b6051d586293d9d6 | 7,660 | py | Python | kaggle/src/divide.py | hpecl-sspku/hpecl-2017 | 895757eb7d5f984e0268ab99da95663172bc2f50 | [
"MIT"
] | null | null | null | kaggle/src/divide.py | hpecl-sspku/hpecl-2017 | 895757eb7d5f984e0268ab99da95663172bc2f50 | [
"MIT"
] | 8 | 2018-03-19T03:24:56.000Z | 2018-07-31T15:25:25.000Z | kaggle/src/divide.py | hpecl-sspku/hpecl-2017 | 895757eb7d5f984e0268ab99da95663172bc2f50 | [
"MIT"
] | 3 | 2018-11-13T06:46:51.000Z | 2020-07-20T05:53:56.000Z | import numpy as np
def detect_and_disply(model,img,return_mode="thres",verbose = 1):
results = model.detect([img],return_mode=return_mode)
r = results
if r is None:
print("No instance has been detect")
return None,None
else:
r = r[0]
if verbose == 1:
print("total n... | 33.744493 | 152 | 0.55483 |
d640a7a5b2cb84f5e9d014a19da06b435a0be078 | 8,832 | py | Python | tests/test_torchtrain/test_callbacks/test_abstract.py | mv1388/AIToolbox | c64ac4810a02d230ce471d86b758e82ea232a7e7 | [
"MIT"
] | 3 | 2019-10-12T12:24:09.000Z | 2020-08-02T02:42:43.000Z | tests/test_torchtrain/test_callbacks/test_abstract.py | mv1388/aitoolbox | 1060435e6cbdfd19abcb726c4080b663536b7467 | [
"MIT"
] | 3 | 2020-04-10T14:07:07.000Z | 2020-04-22T19:04:38.000Z | tests/test_torchtrain/test_callbacks/test_abstract.py | mv1388/aitoolbox | 1060435e6cbdfd19abcb726c4080b663536b7467 | [
"MIT"
] | null | null | null | import unittest
from tests.utils import *
from aitoolbox.torchtrain.callbacks.abstract import AbstractCallback, AbstractExperimentCallback
from aitoolbox.torchtrain.train_loop import TrainLoop, TrainLoopCheckpointEndSave
from tests.utils import function_exists, NetUnifiedBatchFeed, CallbackTracker
class TestAbstrac... | 52.886228 | 123 | 0.673913 |
b57e53f6573269b496be59883c155128c360eb78 | 34,713 | py | Python | core/domain/opportunity_services.py | kaylahardie/oppia | e93ed02dfc7f654ef4fb62268c1a9b9d9ded30ec | [
"Apache-2.0"
] | 2 | 2020-10-13T12:59:08.000Z | 2020-10-13T17:10:26.000Z | core/domain/opportunity_services.py | kaylahardie/oppia | e93ed02dfc7f654ef4fb62268c1a9b9d9ded30ec | [
"Apache-2.0"
] | 1 | 2020-03-02T21:05:42.000Z | 2020-03-03T07:09:51.000Z | core/domain/opportunity_services.py | kaylahardie/oppia | e93ed02dfc7f654ef4fb62268c1a9b9d9ded30ec | [
"Apache-2.0"
] | 1 | 2020-11-05T12:26:10.000Z | 2020-11-05T12:26:10.000Z | # coding: utf-8
#
# Copyright 2019 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 40.505251 | 80 | 0.735431 |
7cdc04c65383cc9b3588d5045d9274feee8cc8ae | 3,522 | py | Python | lib/django-1.3/django/contrib/markup/templatetags/markup.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | django/contrib/markup/templatetags/markup.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | django/contrib/markup/templatetags/markup.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | """
Set of "markup" template filters for Django. These filters transform plain text
markup syntaxes to HTML; currently there is support for:
* Textile, which requires the PyTextile library available at
http://loopcore.com/python-textile/
* Markdown, which requires the Python-markdown library from
... | 38.282609 | 134 | 0.687394 |
3e1ca8d37f3169718c376bf5d7849566f0d481ac | 25 | py | Python | tests/__init__.py | Polydynamical/morfeus | b50d35477faed6ed40a1f769d27e6ac68c874525 | [
"MIT"
] | 62 | 2021-04-28T23:36:53.000Z | 2022-03-30T07:42:42.000Z | tests/__init__.py | Polydynamical/morfeus | b50d35477faed6ed40a1f769d27e6ac68c874525 | [
"MIT"
] | 5 | 2021-05-25T14:47:14.000Z | 2022-03-29T01:42:22.000Z | tests/__init__.py | Polydynamical/morfeus | b50d35477faed6ed40a1f769d27e6ac68c874525 | [
"MIT"
] | 10 | 2021-04-30T06:42:31.000Z | 2022-03-26T04:47:04.000Z | """Tests for Mᴏʀғᴇᴜs."""
| 12.5 | 24 | 0.6 |
479820918616856f3864ca886786083dfad6e163 | 1,545 | py | Python | sympy/utilities/source.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/source.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/source.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | """
This module adds several functions for interactive source code inspection.
"""
from __future__ import print_function, division
from sympy.core.decorators import deprecated
import inspect
@deprecated(
useinstead="?? in IPython/Jupyter or inspect.getsource",
issue=14905,
deprecated_since_version="1.3"... | 26.186441 | 81 | 0.634951 |
aa0bd12879d74bf71ce3756aea06695e9cb62eca | 8,267 | py | Python | testinfra/modules/file.py | degibenz/testinfra | 3105cea40116b389f9185901f78e3c6db4ebfb18 | [
"Apache-2.0"
] | null | null | null | testinfra/modules/file.py | degibenz/testinfra | 3105cea40116b389f9185901f78e3c6db4ebfb18 | [
"Apache-2.0"
] | null | null | null | testinfra/modules/file.py | degibenz/testinfra | 3105cea40116b389f9185901f78e3c6db4ebfb18 | [
"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
# dist... | 25.996855 | 77 | 0.581952 |
9e37486f8e2ec82c4186330f33bd6327e820e4eb | 79,487 | py | Python | salt/config.py | allmightyspiff/salt | 80e54f8b294ea07e0fbb711f661f4ba79eb2c5be | [
"Apache-2.0"
] | null | null | null | salt/config.py | allmightyspiff/salt | 80e54f8b294ea07e0fbb711f661f4ba79eb2c5be | [
"Apache-2.0"
] | null | null | null | salt/config.py | allmightyspiff/salt | 80e54f8b294ea07e0fbb711f661f4ba79eb2c5be | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
All salt configuration loading and defaults should be in this module
'''
from __future__ import absolute_import, generators
# Import python libs
import os
import re
import sys
import glob
import time
import codecs
import logging
from copy import deepcopy
# Import third party libs
import y... | 35.296181 | 94 | 0.59489 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.