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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f2b718a5bfb38a30e82f4f4fc1976b33db6a2f5 | 1,223 | py | Python | fruits/views.py | khajime/fruit-sales-management-console | 4f802578cd9ddcdbbc3259263d0d19df11432a0c | [
"MIT"
] | null | null | null | fruits/views.py | khajime/fruit-sales-management-console | 4f802578cd9ddcdbbc3259263d0d19df11432a0c | [
"MIT"
] | 16 | 2019-02-21T14:12:01.000Z | 2019-03-11T08:00:15.000Z | fruits/views.py | khajime/fruit-sales-management-console | 4f802578cd9ddcdbbc3259263d0d19df11432a0c | [
"MIT"
] | null | null | null | from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView
from django.urls import reverse_lazy
from django.contrib.auth.mixins import LoginRequiredMixin
from . import models
class FruitListView(LoginRequiredMixin, ListView):
"""果物マスタリストビュー"""
model = models.Fruit
login_ur... | 26.586957 | 89 | 0.704007 |
e2cf7f9a544b5850fcba2a2e658d6b13e4f0f480 | 1,380 | py | Python | hazelcast/protocol/codec/map_replace_if_same_codec.py | buraksezer/hazelcast-python-client | 4cc593ef7de994bd84fdac8331b81b309cce30a0 | [
"Apache-2.0"
] | 3 | 2020-05-01T15:01:54.000Z | 2021-01-27T14:51:45.000Z | hazelcast/protocol/codec/map_replace_if_same_codec.py | buraksezer/hazelcast-python-client | 4cc593ef7de994bd84fdac8331b81b309cce30a0 | [
"Apache-2.0"
] | null | null | null | hazelcast/protocol/codec/map_replace_if_same_codec.py | buraksezer/hazelcast-python-client | 4cc593ef7de994bd84fdac8331b81b309cce30a0 | [
"Apache-2.0"
] | 1 | 2020-12-01T20:00:35.000Z | 2020-12-01T20:00:35.000Z | from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.codec.map_message_type import *
REQUEST_TYPE = MAP_REPLACEIFSAME
RESPONSE_TYPE = 101
RETRYABLE = False
def calculate_size(name, key, test_value, value, thread_id):
""" Calculates the req... | 34.5 | 104 | 0.774638 |
dff0836f66fe5e886cf8755d5440059f512137c3 | 5,523 | py | Python | autogluon/contrib/enas/enas_net.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | 6 | 2020-06-16T19:17:36.000Z | 2021-07-07T14:50:31.000Z | autogluon/contrib/enas/enas_net.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | null | null | null | autogluon/contrib/enas/enas_net.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | 2 | 2020-12-13T16:40:04.000Z | 2021-03-08T09:14:16.000Z | import mxnet as mx
from mxnet import gluon
from ...model_zoo.models.utils import *
from ...model_zoo.models.mbconv import MBConvBlock
from ...core.space import *
from .enas import enas_unit, ENAS_Sequential
__all__ = ['ENAS_MbBlock', 'ENAS_MBNet']
@enas_unit()
class ENAS_MbBlock(MBConvBlock):
pass
class ENAS_MBN... | 47.205128 | 160 | 0.642767 |
996ada54faa645ef7ff3b398434cf1bd881e6c1e | 2,376 | py | Python | memery/_nbdev.py | deepfates/memery | 139d15e7c3900c4d1b24ef485b60a4bd8e327f90 | [
"MIT"
] | 86 | 2021-05-23T21:38:48.000Z | 2022-03-30T21:14:14.000Z | memery/_nbdev.py | deepfates/memery | 139d15e7c3900c4d1b24ef485b60a4bd8e327f90 | [
"MIT"
] | 31 | 2021-05-30T06:11:17.000Z | 2022-03-29T20:14:54.000Z | memery/_nbdev.py | deepfates/memery | 139d15e7c3900c4d1b24ef485b60a4bd8e327f90 | [
"MIT"
] | 7 | 2021-06-22T20:35:40.000Z | 2022-03-08T02:29:07.000Z | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"index_flow": "00_core.ipynb",
"query_flow": "00_core.ipynb",
"slugify": "01_loader.ipynb",
"get_image_files": "01_loader.ipynb",
"verify_image": "01_loader.ipynb",
... | 37.125 | 61 | 0.588805 |
9d7d715669248dfa4749302fdb2dd68b6b383712 | 395 | py | Python | packages/python/plotly/plotly/validators/barpolar/_r0.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/barpolar/_r0.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/barpolar/_r0.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class R0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="r0", parent_name="barpolar", **kwargs):
super(R0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwarg... | 32.916667 | 75 | 0.668354 |
561b4c24bb6d495f62a15341ef176684a1a79d70 | 9,556 | py | Python | example/gluon/lstm_crf.py | xudong-sun/mxnet | fe42d30d5885dd576cb871fd70594c53efce9b42 | [
"Apache-2.0"
] | 31 | 2016-04-29T09:13:44.000Z | 2021-02-16T21:27:00.000Z | example/gluon/lstm_crf.py | xudong-sun/mxnet | fe42d30d5885dd576cb871fd70594c53efce9b42 | [
"Apache-2.0"
] | 23 | 2018-06-11T20:03:54.000Z | 2018-08-10T03:17:49.000Z | example/gluon/lstm_crf.py | xudong-sun/mxnet | fe42d30d5885dd576cb871fd70594c53efce9b42 | [
"Apache-2.0"
] | 47 | 2016-04-19T22:46:09.000Z | 2020-09-30T08:09:16.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.367965 | 103 | 0.652679 |
708b0c32c82eb1a72e8ce56478860304d189d049 | 89,199 | py | Python | trac/ticket/web_ui.py | exocad/exotrac | c8207efff78d4736745e975abaa359e8bb21ffdb | [
"BSD-3-Clause"
] | null | null | null | trac/ticket/web_ui.py | exocad/exotrac | c8207efff78d4736745e975abaa359e8bb21ffdb | [
"BSD-3-Clause"
] | null | null | null | trac/ticket/web_ui.py | exocad/exotrac | c8207efff78d4736745e975abaa359e8bb21ffdb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at htt... | 45.232759 | 88 | 0.515365 |
67540f589c38c55359e18b7b398dad270a3c233c | 326 | py | Python | mainapp/urls.py | et-mohedano/BlogManagerPython | a627c95f2e4d5fa1ab6c4ecf5610dd2cd97bb048 | [
"MIT"
] | null | null | null | mainapp/urls.py | et-mohedano/BlogManagerPython | a627c95f2e4d5fa1ab6c4ecf5610dd2cd97bb048 | [
"MIT"
] | null | null | null | mainapp/urls.py | et-mohedano/BlogManagerPython | a627c95f2e4d5fa1ab6c4ecf5610dd2cd97bb048 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="index"),
path('inicio/', views.index, name="inicio"),
path('registro/', views.register_page, name="register"),
path('login/', views.login_page, name="login"),
path('logout/', views.logout_user, name="logout... | 29.636364 | 60 | 0.656442 |
28c6dad9769084dca9c75f09daef3bb1ef01fcc0 | 3,171 | py | Python | trend/src/zutils/bak/task/server/task-bak.py | limingmax/WFCode | f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3 | [
"Apache-2.0"
] | 2 | 2018-10-23T01:56:46.000Z | 2018-10-23T01:56:49.000Z | trend/src/zutils/bak/task/server/task-bak.py | limingmax/WFCode | f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3 | [
"Apache-2.0"
] | null | null | null | trend/src/zutils/bak/task/server/task-bak.py | limingmax/WFCode | f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3 | [
"Apache-2.0"
] | null | null | null | from zutils.task.task_redis import TaskRedis
from zutils.tensorflow.tf_session import TFSession
from zutils.convert import convert_dict,convert_dict_log
from zutils.logger import Logger
from zutils.utils import relative_project_path
import traceback
import time
import json
import os
class Task:
def __init__(self, ... | 33.03125 | 101 | 0.582151 |
115023bd4f0dfceadeff049fa24c5732149dea34 | 696 | py | Python | labelbox/__init__.py | jtsodapop/labelbox-python | aedae1b284a02605ee800a93d858d6126e858606 | [
"Apache-2.0",
"MIT"
] | null | null | null | labelbox/__init__.py | jtsodapop/labelbox-python | aedae1b284a02605ee800a93d858d6126e858606 | [
"Apache-2.0",
"MIT"
] | null | null | null | labelbox/__init__.py | jtsodapop/labelbox-python | aedae1b284a02605ee800a93d858d6126e858606 | [
"Apache-2.0",
"MIT"
] | null | null | null | name = "labelbox"
from labelbox.client import Client
from labelbox.schema.bulk_import_request import BulkImportRequest
from labelbox.schema.project import Project
from labelbox.schema.dataset import Dataset
from labelbox.schema.data_row import DataRow
from labelbox.schema.label import Label
from labelbox.schema.review... | 40.941176 | 66 | 0.867816 |
5f78032accef984bc6eaee1d79ccd08305a8b792 | 8,594 | py | Python | doc/custom_directives.py | Lucaman99/strawberryfields | 627b8e6c1049d1108303bf0d9ba53cf6b120ea1f | [
"Apache-2.0"
] | 1 | 2020-07-12T17:53:56.000Z | 2020-07-12T17:53:56.000Z | doc/custom_directives.py | Lucaman99/strawberryfields | 627b8e6c1049d1108303bf0d9ba53cf6b120ea1f | [
"Apache-2.0"
] | null | null | null | doc/custom_directives.py | Lucaman99/strawberryfields | 627b8e6c1049d1108303bf0d9ba53cf6b120ea1f | [
"Apache-2.0"
] | null | null | null | # BSD 3-Clause License
# Copyright (c) 2017, Pytorch contributors
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
#... | 34.514056 | 143 | 0.62404 |
ad91413bcf12064992fdc7087ed525c677279f91 | 223 | py | Python | datastalker/pipeline/__init__.py | blaa/DataStalker | 673561133d45b9683d7343839fe798d8d3a91aca | [
"MIT"
] | 1 | 2017-06-14T14:21:04.000Z | 2017-06-14T14:21:04.000Z | datastalker/pipeline/__init__.py | blaa/DataStalker | 673561133d45b9683d7343839fe798d8d3a91aca | [
"MIT"
] | null | null | null | datastalker/pipeline/__init__.py | blaa/DataStalker | 673561133d45b9683d7343839fe798d8d3a91aca | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger('root.pipeline')
from .exceptions import StopPipeline
from .stage import Message, Stage, SourceStage
from .pipeline import Pipeline
# Impor/register basic stages
from . import basic
| 22.3 | 46 | 0.802691 |
bb2c24e35128468878a0c173e4e5a684cea22bbc | 474 | py | Python | code/backend/twitter/tests_cc.py | detiuaveiro/social-network-mining | 283ca46b9bdbcc2dffb71e5d4e3718040121380c | [
"BSD-3-Clause"
] | 4 | 2020-07-16T16:01:11.000Z | 2020-07-21T15:17:34.000Z | code/backend/twitter/tests_cc.py | detiuaveiro/social-network-mining | 283ca46b9bdbcc2dffb71e5d4e3718040121380c | [
"BSD-3-Clause"
] | null | null | null | code/backend/twitter/tests_cc.py | detiuaveiro/social-network-mining | 283ca46b9bdbcc2dffb71e5d4e3718040121380c | [
"BSD-3-Clause"
] | 1 | 2020-07-16T15:54:53.000Z | 2020-07-16T15:54:53.000Z | from control_center.tests.save_tweet_relations import test
from control_center.tests import test_logs, test_psql, test_redis, test_mongo
from wrappers.postgresql_wrapper import PostgresAPI
from report.report_gen import Report
def main():
#test_json()
#test.test_neo4j()
#test_logs.test_logs_ts()
#test_logs.test_log... | 27.882353 | 77 | 0.812236 |
580c604efdd301fa2c58c8fd72cc08e9c9ea8dc9 | 119 | py | Python | python3/1006.py | arthurazs/uri | c0ea1badbbb94671132dcff257fde52559afbf13 | [
"MIT"
] | null | null | null | python3/1006.py | arthurazs/uri | c0ea1badbbb94671132dcff257fde52559afbf13 | [
"MIT"
] | 1 | 2019-05-24T21:41:07.000Z | 2019-05-25T20:45:06.000Z | python3/1006.py | arthurazs/uri | c0ea1badbbb94671132dcff257fde52559afbf13 | [
"MIT"
] | null | null | null | a = float(input()) * 2
b = float(input()) * 3
c = float(input()) * 5
print('MEDIA = {:.1f}'.format((a + b + c) / 10))
| 19.833333 | 48 | 0.495798 |
22596422a2fdaa7fac2d35d37b4f3551090a4118 | 1,198 | py | Python | dqo/estimator/relcnn/v1/train_small.py | danield137/deep_query_optimzation | 01a25c966338007f15d14dea1b37e388e47bcfe3 | [
"MIT"
] | null | null | null | dqo/estimator/relcnn/v1/train_small.py | danield137/deep_query_optimzation | 01a25c966338007f15d14dea1b37e388e47bcfe3 | [
"MIT"
] | null | null | null | dqo/estimator/relcnn/v1/train_small.py | danield137/deep_query_optimzation | 01a25c966338007f15d14dea1b37e388e47bcfe3 | [
"MIT"
] | null | null | null | import pytorch_lightning as pl
import torch
from pytorch_lightning import loggers as pl_loggers
from pytorch_lightning import seed_everything
from pytorch_lightning.callbacks import EarlyStopping
from pytorch_lightning.callbacks import ModelCheckpoint
from dqo.estimator.gerelt.data_module import QueriesDataModule
from... | 29.95 | 103 | 0.727045 |
aeba6a0fdba72a19310cbbf5f2500159ecba577b | 411 | py | Python | ecs/pki/migrations/0003_auto_20161207_1754.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 9 | 2017-02-13T18:17:13.000Z | 2020-11-21T20:15:54.000Z | ecs/pki/migrations/0003_auto_20161207_1754.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 2 | 2021-05-20T14:26:47.000Z | 2021-05-20T14:26:48.000Z | ecs/pki/migrations/0003_auto_20161207_1754.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 4 | 2017-04-02T18:48:59.000Z | 2021-11-23T15:40:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pki', '0002_production_compat'),
]
operations = [
migrations.AlterField(
model_name='certificate',
n... | 20.55 | 63 | 0.605839 |
0302b02683189cab5713b48b5efcb7bc83e6cb8a | 9,901 | py | Python | apps/core/utils/sys_tool.py | worry45678/osroom | 1191e306fea5613e9b1e454c0d11662d0ed26e7a | [
"BSD-2-Clause"
] | null | null | null | apps/core/utils/sys_tool.py | worry45678/osroom | 1191e306fea5613e9b1e454c0d11662d0ed26e7a | [
"BSD-2-Clause"
] | null | null | null | apps/core/utils/sys_tool.py | worry45678/osroom | 1191e306fea5613e9b1e454c0d11662d0ed26e7a | [
"BSD-2-Clause"
] | null | null | null | # -*-coding:utf-8-*-
import json
import os
import re
import sys
import subprocess
from getpass import getpass
from copy import deepcopy
from apps.configs.config import CONFIG
from apps.configs.sys_config import PROJECT_PATH
from apps.core.logger.web_logging import web_start_log
__author__ = "Allen Woo"
def copy_confi... | 35.109929 | 120 | 0.57883 |
4d48de0fde458a1bebdee5ee23e104d01981bc3c | 6,781 | py | Python | avrit_backend/profiles_api/schema.py | amiyatulu/avrit_graphql | 2b5428e1a3063559b99e7e4359a2451709290f72 | [
"MIT"
] | 1 | 2019-05-05T09:49:57.000Z | 2019-05-05T09:49:57.000Z | avrit_backend/profiles_api/schema.py | amiyatulu/avrit_graphql | 2b5428e1a3063559b99e7e4359a2451709290f72 | [
"MIT"
] | null | null | null | avrit_backend/profiles_api/schema.py | amiyatulu/avrit_graphql | 2b5428e1a3063559b99e7e4359a2451709290f72 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from graphene import relay, ObjectType
from graphene_django.filter import DjangoFilterConnectionField
import django_filters
import graphene
import graphql_jwt
from graphene_django import DjangoObjectType
from profiles_api.models import ProfileImage, ProfileDetails
from gra... | 36.262032 | 103 | 0.663914 |
96feffcac3c11efceeef1b14a3983ad1f16d053b | 917 | py | Python | creational/singleton_pattern.py | cosmos-sajal/python_design_patterns | d270989f1dfafaef48e4b585eca91603a6c0ac8e | [
"MIT"
] | 1 | 2020-10-19T17:14:33.000Z | 2020-10-19T17:14:33.000Z | creational/singleton_pattern.py | cosmos-sajal/python_design_patterns | d270989f1dfafaef48e4b585eca91603a6c0ac8e | [
"MIT"
] | null | null | null | creational/singleton_pattern.py | cosmos-sajal/python_design_patterns | d270989f1dfafaef48e4b585eca91603a6c0ac8e | [
"MIT"
] | 1 | 2022-03-18T10:10:36.000Z | 2022-03-18T10:10:36.000Z | # https://stackoverflow.com/questions/3192095/where-exactly-the-singleton-pattern-is-used-in-real-application
# https://dzone.com/articles/design-patterns-singleton
# https://www.tutorialspoint.com/python_design_patterns/python_design_patterns_singleton.htm
# https://code.google.com/archive/p/google-singleton-detector/... | 32.75 | 109 | 0.726281 |
9be507d663fc7bb9287794d484f0291bfd8c70a5 | 1,553 | py | Python | tests/unit/hil_auth.py | CCI-MOC/hil | 8c6de2214ddf908c01549b117d5684ac52a93934 | [
"ECL-2.0",
"Apache-2.0"
] | 23 | 2016-09-27T18:41:46.000Z | 2021-12-20T15:06:32.000Z | tests/unit/hil_auth.py | CCI-MOC/hil | 8c6de2214ddf908c01549b117d5684ac52a93934 | [
"ECL-2.0",
"Apache-2.0"
] | 522 | 2016-06-22T21:19:26.000Z | 2020-11-12T20:54:40.000Z | tests/unit/hil_auth.py | CCI-MOC/hil | 8c6de2214ddf908c01549b117d5684ac52a93934 | [
"ECL-2.0",
"Apache-2.0"
] | 30 | 2016-06-24T08:27:59.000Z | 2018-08-20T17:34:45.000Z | """Test general properties of the authentication framework.
This module is called `hil_auth` because pytest is lousy about namespacing;
if we call it `auth`, it chokes on the fact that there's a file `api/auth.py`
as well. grr.
"""
import pytest
from hil import config
from hil.auth import get_auth_backend
from hil.res... | 29.865385 | 78 | 0.669672 |
7dc3a28f92df6537f79c42dff9c93d47d59fc569 | 4,121 | py | Python | bclearer_source/b_code/substages/operations/b_evolve/adjustment_operations/convert_attributes_to_associations/association_from_attribute_creator.py | OscarXiberta/bclearer | 0eb6847f0fb03d4026cdbcf30f5fc6826da51c63 | [
"MIT"
] | null | null | null | bclearer_source/b_code/substages/operations/b_evolve/adjustment_operations/convert_attributes_to_associations/association_from_attribute_creator.py | OscarXiberta/bclearer | 0eb6847f0fb03d4026cdbcf30f5fc6826da51c63 | [
"MIT"
] | null | null | null | bclearer_source/b_code/substages/operations/b_evolve/adjustment_operations/convert_attributes_to_associations/association_from_attribute_creator.py | OscarXiberta/bclearer | 0eb6847f0fb03d4026cdbcf30f5fc6826da51c63 | [
"MIT"
] | null | null | null | from bclearer_source.b_code.substages.operations.common.ea_guid_from_nf_uuid_creator import create_ea_guid_from_nf_uuid
from nf_common_source.code.constants.standard_constants import DEFAULT_NULL_VALUE
from nf_common_source.code.services.identification_services.uuid_service.uuid_helpers.uuid_factory import create_new_u... | 46.303371 | 143 | 0.777967 |
50191de31226799981e6b606cb54ce192f3222e2 | 594,108 | py | Python | resources.py | khanh-ts/annotate | 8c92c770e74bff983cd5627cdb360211f5dc660d | [
"MIT"
] | null | null | null | resources.py | khanh-ts/annotate | 8c92c770e74bff983cd5627cdb360211f5dc660d | [
"MIT"
] | 4 | 2021-03-31T18:56:29.000Z | 2021-12-13T19:56:41.000Z | resources.py | khanh-ts/annotate | 8c92c770e74bff983cd5627cdb360211f5dc660d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x07\x3e\
\x73\
\x61\x76\x65\x41\x73\x44\x65\x74\x61\x69\x6c\x3d\xe5\xb0\x87\xe6\
\... | 65.480877 | 104 | 0.715725 |
4747a32eb3be90bcf0a73ef1fce567eb0de79908 | 42,988 | py | Python | fudge/core/math/pdf.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 14 | 2019-08-29T23:46:24.000Z | 2022-03-21T10:16:25.000Z | fudge/core/math/pdf.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 1 | 2020-08-04T16:14:45.000Z | 2021-12-01T01:54:34.000Z | fudge/core/math/pdf.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 2 | 2022-03-03T22:41:41.000Z | 2022-03-03T22:54:43.000Z | # <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
import math
import numpy
from pqu.PQU import PhysicalQuantityWithUncertainty as PQU
from xData import XYs
SQRT2 = math.sqrt... | 40.402256 | 123 | 0.612078 |
58fbfcf0c995b58bace77dc5b6764dda34c87511 | 25,224 | py | Python | scripts/utf8totex.py | James11222/James_CV | 5887c0ab6a9a8981db25bf30fcbed0b91f54ad30 | [
"CC-BY-4.0"
] | 8 | 2021-03-20T18:50:44.000Z | 2021-11-05T03:32:42.000Z | scripts/utf8totex.py | James11222/James_CV | 5887c0ab6a9a8981db25bf30fcbed0b91f54ad30 | [
"CC-BY-4.0"
] | 22 | 2021-03-14T20:18:12.000Z | 2021-12-23T21:03:32.000Z | scripts/utf8totex.py | arjunsavel/CV | 93d4dd38ed69d0ded074750206d4fd0080b29b39 | [
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Philippe Faist
#
# 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... | 29.228273 | 98 | 0.526641 |
d2b18518b5e046ef800627e213389d1935f6e1d8 | 4,517 | py | Python | test/test_schuss.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | test/test_schuss.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | test/test_schuss.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | from parameterized import parameterized
from nose.tools import assert_equal, assert_true
import os
import sys
dir_path = os.path.dirname(os.path.abspath(__file__))
module_path = os.path.join(dir_path, "../src")
if module_path not in sys.path:
sys.path.append(module_path)
os.chdir(dir_path)
from util.iterator imp... | 43.432692 | 135 | 0.672349 |
9ba055b2e770cdab4c687a002d49752970961f7e | 50 | py | Python | venv/lib/python3.7/site-packages/AccessControl/tests/private_module/submodule/__init__.py | leanhvu86/matrix-server | 6e16fc53dfebaeaf222ff5a371ccffcc65de3818 | [
"Apache-2.0"
] | 10 | 2015-03-30T08:39:50.000Z | 2022-02-28T21:57:51.000Z | venv/lib/python3.7/site-packages/AccessControl/tests/private_module/submodule/__init__.py | leanhvu86/matrix-server | 6e16fc53dfebaeaf222ff5a371ccffcc65de3818 | [
"Apache-2.0"
] | 79 | 2015-06-18T20:21:46.000Z | 2022-03-29T06:33:00.000Z | venv/lib/python3.7/site-packages/AccessControl/tests/private_module/submodule/__init__.py | leanhvu86/matrix-server | 6e16fc53dfebaeaf222ff5a371ccffcc65de3818 | [
"Apache-2.0"
] | 14 | 2015-03-30T08:40:00.000Z | 2022-02-09T00:48:51.000Z | # test module, all private
def priv():
pass
| 8.333333 | 26 | 0.62 |
f6773a72fd11eb115a2cb91d6a529ab6714634d5 | 6,440 | py | Python | python/grizzly/encoders.py | mateiz/weld | 68d42accdcaac55f5b6c2eef4f3cec73119980c8 | [
"BSD-3-Clause"
] | 2 | 2020-03-13T20:59:12.000Z | 2021-06-14T18:13:15.000Z | python/grizzly/encoders.py | mateiz/weld | 68d42accdcaac55f5b6c2eef4f3cec73119980c8 | [
"BSD-3-Clause"
] | null | null | null | python/grizzly/encoders.py | mateiz/weld | 68d42accdcaac55f5b6c2eef4f3cec73119980c8 | [
"BSD-3-Clause"
] | null | null | null | """Summary
Attributes:
numpy_to_weld_type_mapping (TYPE): Description
"""
from weld.weldobject import *
import numpy as np
import os
import sys
numpy_to_weld_type_mapping = {
'str': WeldVec(WeldChar()),
'int32': WeldInt(),
'int64': WeldLong(),
'float32': WeldFloat(),
'float64': WeldDouble(),... | 32.2 | 79 | 0.578727 |
141df2c1f407f338cd555b57780a84a239510a7d | 3,996 | py | Python | postgres/tests/test_common.py | volksman/integrations-core | 34405662b09bf4a8c32feaed16a4745c7e1f24c0 | [
"BSD-3-Clause"
] | null | null | null | postgres/tests/test_common.py | volksman/integrations-core | 34405662b09bf4a8c32feaed16a4745c7e1f24c0 | [
"BSD-3-Clause"
] | null | null | null | postgres/tests/test_common.py | volksman/integrations-core | 34405662b09bf4a8c32feaed16a4745c7e1f24c0 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2010-2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import pytest
import os
from datadog_checks.postgres import PostgreSql
from .common import HOST, PORT, DB_NAME
COMMON_METRICS = [
'postgresql.before_xid_wraparound',
'postgresql.connections',
'postg... | 31.968 | 110 | 0.745245 |
57d7f57fca8db22a4e811013e696e120e8b24b67 | 940 | py | Python | 2018-02/2018-02-04/tests.py | wenjuanchendora/Python_Study | 02d08229210602edf4e1fa96fd7167356275e316 | [
"MIT"
] | null | null | null | 2018-02/2018-02-04/tests.py | wenjuanchendora/Python_Study | 02d08229210602edf4e1fa96fd7167356275e316 | [
"MIT"
] | null | null | null | 2018-02/2018-02-04/tests.py | wenjuanchendora/Python_Study | 02d08229210602edf4e1fa96fd7167356275e316 | [
"MIT"
] | null | null | null | import unittest
class MyTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
print("打开浏览器")
def setUp(self):
print("登录")
def test_up(self):
self.assertEqual("foo".upper(),'FOO')
def test_isUp(self):
self.assertTrue("FOO".isupper())
self.assertFa... | 19.583333 | 53 | 0.611702 |
504eaccba562e3ed26e947a260d79ac9cdbe5165 | 333 | py | Python | exercicios/exercicio104.py | Helton-Rubens/Python-3 | eb6d5ee71bcb2a2a80de4eaea942bd0c41d846b7 | [
"MIT"
] | null | null | null | exercicios/exercicio104.py | Helton-Rubens/Python-3 | eb6d5ee71bcb2a2a80de4eaea942bd0c41d846b7 | [
"MIT"
] | null | null | null | exercicios/exercicio104.py | Helton-Rubens/Python-3 | eb6d5ee71bcb2a2a80de4eaea942bd0c41d846b7 | [
"MIT"
] | null | null | null | #Função que lê a ficha de um jogador
def fichaJogador(jogador, gols):
print(f'O jogador {jogador} fez {gols} gol(s) no campeonato.')
j = input('Digite o nome do jogador: ')
if len(j) == 0:
j = '<desconhecido>'
g = (input('Digite a quantidade de gols: '))
if g.isnumeric():
g = int(g)
else:
g = 0
fichaJ... | 22.2 | 66 | 0.630631 |
3f2e73c44f2bfb1f00a18524b28c27af1e85fada | 401 | py | Python | exercicios_curso_em_video/Exercicio 105.py | Sposigor/Caminho_do_Python | e84d74e9dc89c0966f931a94cb9ebe3ee4671b6d | [
"MIT"
] | 1 | 2021-01-13T18:07:46.000Z | 2021-01-13T18:07:46.000Z | exercicios_curso_em_video/Exercicio 105.py | Sposigor/Caminho_do_Python | e84d74e9dc89c0966f931a94cb9ebe3ee4671b6d | [
"MIT"
] | null | null | null | exercicios_curso_em_video/Exercicio 105.py | Sposigor/Caminho_do_Python | e84d74e9dc89c0966f931a94cb9ebe3ee4671b6d | [
"MIT"
] | null | null | null |
def notas(*x, sit=False):
D = dict()
D['Total'] = len(x)
D['Maior'] = max(x)
D['Menor'] = min(x)
D['Média'] = sum(x)/len(x)
if sit:
if D['Média'] >= 7:
D['Situação'] = 'BOA'
elif D['Média'] >= 5:
D['Situação'] = 'RAZOAVEL'
else:
D['Sit... | 22.277778 | 38 | 0.438903 |
5d12f13eb70d7c53b0e2885b5008f144d3b2e7e9 | 2,987 | py | Python | sandbox/latent_codes.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | sandbox/latent_codes.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | sandbox/latent_codes.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | import dnnlib.tflib as tflib
import training.misc as misc
import tensorflow as tf
import numpy as np
import training.dataset as dataset
import matplotlib.pyplot as plt
session = tflib.create_session(None, force_as_default=True)
latent_placeholder = tf.placeholder(tf.float32, shape=(None, 512))
dlatent_placeholder = t... | 40.364865 | 138 | 0.707399 |
aafdfaea15e39660abbbeac214eb903ecfd21190 | 15,117 | py | Python | torchaudio/models/wavernn.py | underdogliu/audio | 38e530d77e5a194d4e5f91356cc1a191207a3b29 | [
"BSD-2-Clause"
] | null | null | null | torchaudio/models/wavernn.py | underdogliu/audio | 38e530d77e5a194d4e5f91356cc1a191207a3b29 | [
"BSD-2-Clause"
] | null | null | null | torchaudio/models/wavernn.py | underdogliu/audio | 38e530d77e5a194d4e5f91356cc1a191207a3b29 | [
"BSD-2-Clause"
] | null | null | null | import math
from typing import List, Optional, Tuple
import torch
import torch.nn.functional as F
from torch import nn, Tensor
__all__ = [
"ResBlock",
"MelResNet",
"Stretch2d",
"UpsampleNetwork",
"WaveRNN",
]
class ResBlock(nn.Module):
r"""ResNet block based on *Efficient Neural Audio Synthe... | 37.511166 | 118 | 0.599854 |
2b43631c570f7096f3375b78919433596a073b46 | 1,009 | py | Python | spark/util/IpyExit.py | lawruble13/spark | 8008de02ce57156eb4bd99ffd7a713f5e6f8da75 | [
"MIT"
] | 4 | 2020-10-17T00:33:00.000Z | 2021-04-10T00:06:19.000Z | spark/util/IpyExit.py | lawruble13/spark | 8008de02ce57156eb4bd99ffd7a713f5e6f8da75 | [
"MIT"
] | 55 | 2020-10-22T03:20:54.000Z | 2021-03-02T23:41:06.000Z | spark/util/IpyExit.py | lawruble13/spark | 8008de02ce57156eb4bd99ffd7a713f5e6f8da75 | [
"MIT"
] | 4 | 2020-10-19T19:13:39.000Z | 2021-06-23T04:31:46.000Z | # Pulled from https://stackoverflow.com/questions/24005221/ipython-notebook-early-exit-from-cell/48000614
# Used in core.py
"""
# ipython_exit.py
Allows exit() to work if script is invoked with IPython without
raising NameError Exception. Keeps kernel alive.
Use: import variable 'exit' in target script with
'fro... | 23.465116 | 105 | 0.695738 |
9f9de6e69653cf90aef6e892cc4361949270153e | 407 | py | Python | env/Lib/site-packages/plotly/validators/violin/_hovertextsrc.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/violin/_hovertextsrc.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/violin/_hovertextsrc.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hovertextsrc", parent_name="violin", **kwargs):
super(HovertextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | 33.916667 | 83 | 0.683047 |
d1fe4f2d708ce741c0ad63bda5ac5e9417837a84 | 3,135 | py | Python | build_xml/insert_tables.py | DCCouncil/dc-law-tools | 3f016a206d92b7722b8c7638a7b638391f67ab20 | [
"CC0-1.0"
] | 3 | 2015-12-11T17:48:13.000Z | 2016-01-21T18:34:47.000Z | build_xml/insert_tables.py | DCCouncil/dc-law-tools | 3f016a206d92b7722b8c7638a7b638391f67ab20 | [
"CC0-1.0"
] | 5 | 2016-01-04T17:28:07.000Z | 2016-07-28T19:21:10.000Z | build_xml/insert_tables.py | DCCouncil/dc-law-tools | 3f016a206d92b7722b8c7638a7b638391f67ab20 | [
"CC0-1.0"
] | 9 | 2016-03-15T01:04:18.000Z | 2021-01-08T04:33:05.000Z | """
The Lexis parser does not parse tables, so this script
inserts manually-created html tables defined in tables.xml.
tables.xml *must be* updated when a new version of the code
comes out.
"""
import os.path
import lxml.etree as etree, re
DIR = os.path.abspath(os.path.dirname(__file__))
src_file = DIR + '/../working... | 31.666667 | 100 | 0.556619 |
dbaa1b1a7b14895a91ee45fe73ec85ff977f93a0 | 1,460 | py | Python | test/test_gen_mask_pickatlas.py | yl3506/iMVPD_dev | 3e08dbdf45b964a459a7dd1cb2f468c6df72d64b | [
"MIT"
] | 2 | 2018-07-30T15:13:54.000Z | 2018-07-30T18:02:34.000Z | test/test_gen_mask_pickatlas.py | yl3506/iMVPD_denoise | 96dff9d4a72086d1b7348403d0c71c43b5456933 | [
"MIT"
] | null | null | null | test/test_gen_mask_pickatlas.py | yl3506/iMVPD_denoise | 96dff9d4a72086d1b7348403d0c71c43b5456933 | [
"MIT"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as pyplot
from sklearn.linear_model import ElasticNetCV
# load raw func data
a = np.random.random((2,3,4,5)) # 90x90x90x196
# generate a_mask of boolean
a_mask = np.zeros((2,3,4,5)) # 90x90x90x196
b_mask = np.zeros((2,3,4,5))
a_mask[0,0,0,0]=1
a_mask[0,0,0,1]=1
a_... | 21.791045 | 75 | 0.70274 |
9dd6f8ec43422e3abbc15304de9106a5436945f2 | 1,490 | py | Python | plotly/validators/scattermapbox/_textfont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/scattermapbox/_textfont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/scattermapbox/_textfont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='textfont', parent_name='scattermapbox', **kwargs
):
super(TextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | 38.205128 | 75 | 0.56443 |
6d6303594a3e44dec89ea85d735c3a7810ac03c4 | 849 | py | Python | willie/modules/slap.py | ezoSresyeK/willie | 5782628d15996d0cc901bb4ee27d89e9c7ad94ae | [
"EFL-2.0"
] | null | null | null | willie/modules/slap.py | ezoSresyeK/willie | 5782628d15996d0cc901bb4ee27d89e9c7ad94ae | [
"EFL-2.0"
] | null | null | null | willie/modules/slap.py | ezoSresyeK/willie | 5782628d15996d0cc901bb4ee27d89e9c7ad94ae | [
"EFL-2.0"
] | null | null | null | """
slap.py - Slap Module
Copyright 2009, Michael Yanovich, yanovich.net
http://willie.dftba.net
"""
import random
from willie.module import commands
@commands('slap', 'slaps')
def slap(willie, trigger):
""".slap <target> - Slaps <target>"""
text = trigger.group().split()
if len(text) < 2 or text[1].star... | 30.321429 | 118 | 0.608952 |
97f4ca9f6b9bb8706303faade1c87c6e599d017b | 3,171 | py | Python | examples/single_agent2.py | ehtnamuh/Smarts-Fork | 2cd7e85947e7feb7da46753f664ff5e8cc6ace6c | [
"MIT"
] | null | null | null | examples/single_agent2.py | ehtnamuh/Smarts-Fork | 2cd7e85947e7feb7da46753f664ff5e8cc6ace6c | [
"MIT"
] | null | null | null | examples/single_agent2.py | ehtnamuh/Smarts-Fork | 2cd7e85947e7feb7da46753f664ff5e8cc6ace6c | [
"MIT"
] | null | null | null | import logging
import random
import gym
from smarts.core.agent import Agent, AgentSpec
from smarts.core.agent_interface import AgentInterface, AgentType
from smarts.core.sensors import Observation
from smarts.core.utils.episodes import episodes
from smarts.env.wrappers.single_agent import SingleAgent
# The following... | 31.71 | 129 | 0.656575 |
14164930bf2f006ebdf7a57d31e8ed57005c5897 | 1,865 | py | Python | docsrc/conf.py | SHZ66/enm_package | 3e3981560f11146e611625589cc2b1dd3cf6cd17 | [
"MIT"
] | null | null | null | docsrc/conf.py | SHZ66/enm_package | 3e3981560f11146e611625589cc2b1dd3cf6cd17 | [
"MIT"
] | null | null | null | docsrc/conf.py | SHZ66/enm_package | 3e3981560f11146e611625589cc2b1dd3cf6cd17 | [
"MIT"
] | 2 | 2021-05-29T14:58:49.000Z | 2021-10-19T05:38:41.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 36.568627 | 79 | 0.661126 |
9f0d09fc8bca470febc71c29b4263eaa6fab1608 | 2,717 | py | Python | sktps/tests/test_admin.py | jclee81/sktacc | 6f601ce8f61b4e361b17773060ee2544bf35dbe4 | [
"Apache-2.0"
] | 2 | 2017-08-03T06:03:25.000Z | 2017-08-10T08:55:22.000Z | sktps/tests/test_admin.py | jclee81/sktacc | 6f601ce8f61b4e361b17773060ee2544bf35dbe4 | [
"Apache-2.0"
] | 8 | 2020-01-28T21:45:44.000Z | 2022-02-09T23:27:06.000Z | sktps/tests/test_admin.py | jclee81/sktacc | 6f601ce8f61b4e361b17773060ee2544bf35dbe4 | [
"Apache-2.0"
] | null | null | null | import unittest
import util
from admin import MeasureContainer
def get_sample_measurement_data(node_type):
if node_type == 'controller':
return {
'key': 'MEASUREMENT',
'node_type': 'controller',
'train_id': 't095618',
'group_id': u't095618-000000001',
... | 28.904255 | 67 | 0.578947 |
776f4e20e89b898027324b0bcc08383aea9c20cb | 104 | py | Python | 01-data-model/second.py | diegoami/example-code | 932e548cdc52683f6c34f7cd755e8d7a34fa839e | [
"MIT"
] | null | null | null | 01-data-model/second.py | diegoami/example-code | 932e548cdc52683f6c34f7cd755e8d7a34fa839e | [
"MIT"
] | null | null | null | 01-data-model/second.py | diegoami/example-code | 932e548cdc52683f6c34f7cd755e8d7a34fa839e | [
"MIT"
] | null | null | null | from vector2d import Vector
v1 = Vector(2,3)
v2 = Vector(4,5)
print(v1+v2)
print(v1*3)
print(3*v1)
| 8.666667 | 27 | 0.663462 |
e09186afeb1af15f17d93c9d7900045ef37c6d99 | 15,350 | py | Python | tests/cases/collection_test.py | Erotemic/girder | 50efadbaef2976a38eded1dc55a10a1839337ffb | [
"Apache-2.0"
] | null | null | null | tests/cases/collection_test.py | Erotemic/girder | 50efadbaef2976a38eded1dc55a10a1839337ffb | [
"Apache-2.0"
] | null | null | null | tests/cases/collection_test.py | Erotemic/girder | 50efadbaef2976a38eded1dc55a10a1839337ffb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from .. import base
from bson.objectid import ObjectId
from girder.constants import AccessType
from girder.models.collection import Collection
from girder.models.folder import Folder
from girder.models.group import Group
from girder.models.setting import Setting
from girder.models.u... | 39.258312 | 100 | 0.565863 |
4d6e9720b5de0d4e788c157a3cc7801dd8eb25fe | 3,770 | py | Python | servicer/token_interpolator.py | wmgroot/servicer | 13313bcaed2b487848f2b483aea13e538a4484cc | [
"BSD-3-Clause"
] | 3 | 2018-08-15T16:12:22.000Z | 2020-11-04T17:36:53.000Z | servicer/token_interpolator.py | wmgroot/servicer | 13313bcaed2b487848f2b483aea13e538a4484cc | [
"BSD-3-Clause"
] | 25 | 2018-07-11T22:00:59.000Z | 2019-11-12T22:25:48.000Z | servicer/token_interpolator.py | wmgroot/servicer | 13313bcaed2b487848f2b483aea13e538a4484cc | [
"BSD-3-Clause"
] | 1 | 2019-01-17T21:02:07.000Z | 2019-01-17T21:02:07.000Z | import re
class TokenInterpolator():
def __init__(self, logger=None):
self.logger = logger
def interpolate_tokens(self, config, params, ignore_missing_key=False, ignore_default=False):
if isinstance(config, dict):
keys_to_change = []
for key in config.keys():
... | 37.7 | 111 | 0.576923 |
7037df422a37dff83111ca1d0b4f85e836d42e3b | 9,168 | py | Python | pycls/core/trainer.py | AICradle/pycls | 2c361eeb3dc324fb5acc0e15d44cc614d440d19a | [
"MIT"
] | null | null | null | pycls/core/trainer.py | AICradle/pycls | 2c361eeb3dc324fb5acc0e15d44cc614d440d19a | [
"MIT"
] | null | null | null | pycls/core/trainer.py | AICradle/pycls | 2c361eeb3dc324fb5acc0e15d44cc614d440d19a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tools for training and testing a model."""
import random
import numpy as np
import pycls.core.benchmark as benchm... | 39.347639 | 85 | 0.692736 |
6813f78984147272630a46967da799413b4e7975 | 2,750 | py | Python | dataset.py | PVirie/extravagant_learning | 376ef9db4df7e206d665a6c3cc8e82323c9ba6f7 | [
"MIT"
] | null | null | null | dataset.py | PVirie/extravagant_learning | 376ef9db4df7e206d665a6c3cc8e82323c9ba6f7 | [
"MIT"
] | null | null | null | dataset.py | PVirie/extravagant_learning | 376ef9db4df7e206d665a6c3cc8e82323c9ba6f7 | [
"MIT"
] | null | null | null | import torch
import torchvision
import os
import random
root = os.path.dirname(os.path.abspath(__file__))
class FashionMNIST:
def __init__(self, device, batch_size, max_per_class=100, seed=None, group_size=None):
print("prepare dataset")
self.batch_size = batch_size
self.dataset = torchvi... | 31.25 | 190 | 0.597091 |
7b09f5b8f5dcc8cad1e715a28cc5e4d712bd7623 | 4,193 | py | Python | python/pyspark/streaming/tests/test_kinesis.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-11-18T05:24:48.000Z | 2021-11-18T05:24:48.000Z | python/pyspark/streaming/tests/test_kinesis.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2018-06-14T11:15:27.000Z | 2019-01-27T12:11:23.000Z | python/pyspark/streaming/tests/test_kinesis.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-09-19T22:04:32.000Z | 2021-09-19T22:04:32.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 us... | 35.235294 | 95 | 0.630813 |
6c0c5af9cc04d51b10dc3dd997e3d9ff37db4c0f | 754 | py | Python | mayan/apps/converter/migrations/0006_auto_20150708_0120.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/converter/migrations/0006_auto_20150708_0120.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 7 | 2020-06-06T00:01:04.000Z | 2022-01-13T01:47:17.000Z | mayan/apps/converter/migrations/0006_auto_20150708_0120.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2020-07-29T21:03:27.000Z | 2020-07-29T21:03:27.000Z | from __future__ import unicode_literals
from django.db import models, migrations
import mayan.apps.converter.models
class Migration(migrations.Migration):
dependencies = [
('converter', '0005_auto_20150708_0118'),
]
operations = [
migrations.AlterField(
model_name='transfor... | 26.928571 | 76 | 0.583554 |
efd4690972173c2056619ae404951a7096da4642 | 1,272 | py | Python | gcloud/periodictask/migrations/0002_periodictask_project.py | springborland/bk-sops | a9057672c10efb5f2414a805a30ead4092429c76 | [
"Apache-2.0"
] | 1 | 2021-05-19T04:31:34.000Z | 2021-05-19T04:31:34.000Z | gcloud/periodictask/migrations/0002_periodictask_project.py | ZhuoZhuoCrayon/bk-sops | d1475d53c19729915727ce7adc24e3226f15e332 | [
"Apache-2.0"
] | null | null | null | gcloud/periodictask/migrations/0002_periodictask_project.py | ZhuoZhuoCrayon/bk-sops | d1475d53c19729915727ce7adc24e3226f15e332 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 37.411765 | 165 | 0.727987 |
ccedc9e9272aab7c41dd12e6e748e04d28b86854 | 2,916 | py | Python | dataify/dsprites.py | neurospin-deepinsight/dataify | 2620997ac99decf5179a168f905ec078e41b1791 | [
"CECILL-B"
] | null | null | null | dataify/dsprites.py | neurospin-deepinsight/dataify | 2620997ac99decf5179a168f905ec078e41b1791 | [
"CECILL-B"
] | null | null | null | dataify/dsprites.py | neurospin-deepinsight/dataify | 2620997ac99decf5179a168f905ec078e41b1791 | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2021
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | 35.13253 | 75 | 0.598422 |
cfacdbe891b80f319bfccf4c25be03d78196f14c | 4,594 | py | Python | tests/unit/webapi25/test_uvindex.py | jpelaezClub/pyowm | ed8185fb6f1e3b0dcd1adc18d7082a76993ff762 | [
"MIT"
] | null | null | null | tests/unit/webapi25/test_uvindex.py | jpelaezClub/pyowm | ed8185fb6f1e3b0dcd1adc18d7082a76993ff762 | [
"MIT"
] | 162 | 2019-08-25T19:14:18.000Z | 2021-05-10T19:16:30.000Z | tests/unit/webapi25/test_uvindex.py | jpelaezClub/pyowm | ed8185fb6f1e3b0dcd1adc18d7082a76993ff762 | [
"MIT"
] | null | null | null | import unittest
from datetime import datetime
from pyowm.webapi25.location import Location
from pyowm.webapi25.uvindex import UVIndex, uv_intensity_to_exposure_risk
from pyowm.utils.timeformatutils import UTC
from tests.unit.webapi25.json_test_dumps import UVINDEX_JSON_DUMP
from tests.unit.webapi25.xml_test_dumps impor... | 49.397849 | 86 | 0.68067 |
96a9efc3a539ad4a702db6205ff7672551c72554 | 1,191 | py | Python | Cards/filters.py | vabene1111/LearningCards | 00539c8d5d3063eecc306dd68eb3eeeac89dba9f | [
"MIT"
] | 1 | 2020-03-18T15:10:42.000Z | 2020-03-18T15:10:42.000Z | Cards/filters.py | vabene1111/LearningCards | 00539c8d5d3063eecc306dd68eb3eeeac89dba9f | [
"MIT"
] | 1 | 2020-02-22T20:03:02.000Z | 2020-02-23T16:31:56.000Z | Cards/filters.py | vabene1111/LearningCards | 00539c8d5d3063eecc306dd68eb3eeeac89dba9f | [
"MIT"
] | null | null | null | import django_filters
from Cards.forms import SelectWidget
from Cards.models import Question, Course, Chapter, University
class QuestionFilter(django_filters.FilterSet):
question = django_filters.CharFilter(lookup_expr='icontains')
course = django_filters.ModelChoiceFilter(widget=SelectWidget, queryset=Cours... | 34.028571 | 105 | 0.744752 |
89477a55686876083efd00952e30b5cdc22e977b | 366 | py | Python | tests/test_button.py | juusokorhonen/python_homie4 | 5df1b103f8a4427f9dc9bcdeb8000660734e0ae4 | [
"MIT"
] | null | null | null | tests/test_button.py | juusokorhonen/python_homie4 | 5df1b103f8a4427f9dc9bcdeb8000660734e0ae4 | [
"MIT"
] | null | null | null | tests/test_button.py | juusokorhonen/python_homie4 | 5df1b103f8a4427f9dc9bcdeb8000660734e0ae4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
from .context import homie, mqtt_settings # noqa: F401
def test_button_device():
button = homie.device.ButtonDevice(
device_id="button", name="Test Button", mqtt_settings=mqtt_settings)
for _ in range(10):
time.sleep(1)
butt... | 24.4 | 76 | 0.653005 |
2e33fc183984281d9d24da3170e27f4aa9036164 | 17,928 | py | Python | python/ccxt/bit2c.py | web3-guild/ccxt | f309790e3aa005a81dcce3b5a6a29227204ebf8d | [
"MIT"
] | 1 | 2021-11-06T11:06:07.000Z | 2021-11-06T11:06:07.000Z | python/ccxt/bit2c.py | web3-guild/ccxt | f309790e3aa005a81dcce3b5a6a29227204ebf8d | [
"MIT"
] | null | null | null | python/ccxt/bit2c.py | web3-guild/ccxt | f309790e3aa005a81dcce3b5a6a29227204ebf8d | [
"MIT"
] | 2 | 2021-11-02T17:53:12.000Z | 2022-03-12T15:12:18.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 40.745455 | 167 | 0.490741 |
422c99a5221d74ac7e442e4725fdb50eefb35bf9 | 100 | py | Python | src/petronia/defimpl/extensions/loaders/zip/__init__.py | groboclown/petronia | 486338023d19cee989e92f0c5692680f1a37811f | [
"MIT"
] | 19 | 2017-06-21T10:28:24.000Z | 2021-12-31T11:49:28.000Z | src/petronia/defimpl/extensions/loaders/zip/__init__.py | groboclown/petronia | 486338023d19cee989e92f0c5692680f1a37811f | [
"MIT"
] | 10 | 2016-11-11T18:57:57.000Z | 2021-02-01T15:33:43.000Z | src/petronia/defimpl/extensions/loaders/zip/__init__.py | groboclown/petronia | 486338023d19cee989e92f0c5692680f1a37811f | [
"MIT"
] | 3 | 2017-09-17T03:29:35.000Z | 2019-06-03T10:43:08.000Z |
"""
Extension loader for the core Petronia extensions.
"""
from .loader import ZipExtensionLoader
| 14.285714 | 50 | 0.77 |
7954516a71d606bef1c136ae7aa4dadc8bac0938 | 52,557 | py | Python | projects/DensePose/densepose/densepose_coco_evaluation.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/densepose_coco_evaluation.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/densepose_coco_evaluation.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# This is a modified version of cocoeval.py where we also have the densepose evaluation.
__author__ = "tsungyi"
import cop... | 43.94398 | 110 | 0.512206 |
8ee2f06badb3aa0975d9f71caee16f8e72de8d6a | 3,386 | py | Python | ibis/backends/pandas/tests/test_dispatcher.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2020-08-19T03:36:26.000Z | 2020-08-19T03:36:26.000Z | ibis/backends/pandas/tests/test_dispatcher.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2021-03-25T14:07:29.000Z | 2021-03-25T14:07:29.000Z | ibis/backends/pandas/tests/test_dispatcher.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 2 | 2020-11-27T22:21:50.000Z | 2021-04-03T09:36:25.000Z | import pytest
from multipledispatch import Dispatcher
from multipledispatch.conflict import AmbiguityWarning
from ..dispatcher import TwoLevelDispatcher
class A1(object):
pass
class A2(A1):
pass
class A3(A2):
pass
class B1(object):
pass
class B2(B1):
pass
class B3(B2):
pass
@pytes... | 20.035503 | 78 | 0.598346 |
d277c21c6c87afeacb0cfbc3b42620a3133f9bf1 | 1,567 | py | Python | test/test_environment_path.py | brawner/colcon-core | 83bf0391323514ab8ada7aacc693fd16f59c1037 | [
"Apache-2.0"
] | 76 | 2017-04-27T23:13:57.000Z | 2022-03-25T10:02:11.000Z | test/test_environment_path.py | brawner/colcon-core | 83bf0391323514ab8ada7aacc693fd16f59c1037 | [
"Apache-2.0"
] | 442 | 2018-03-13T16:45:28.000Z | 2022-03-30T22:47:42.000Z | test/test_environment_path.py | brawner/colcon-core | 83bf0391323514ab8ada7aacc693fd16f59c1037 | [
"Apache-2.0"
] | 34 | 2018-06-22T09:56:34.000Z | 2022-03-26T23:46:42.000Z | # Copyright 2016-2018 Dirk Thomas
# Licensed under the Apache License, Version 2.0
from pathlib import Path
from tempfile import TemporaryDirectory
from colcon_core.environment.path import PathEnvironment
from mock import patch
def test_path():
extension = PathEnvironment()
with TemporaryDirectory(prefix='... | 36.44186 | 79 | 0.629866 |
01abf159f1a79222e3a1406fdd1aa78ce0d3c139 | 2,635 | py | Python | allennlp/modules/highway.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 1 | 2022-01-06T02:06:23.000Z | 2022-01-06T02:06:23.000Z | allennlp/modules/highway.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 52 | 2020-11-11T13:08:25.000Z | 2021-12-16T13:04:30.000Z | allennlp/modules/highway.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | null | null | null | """
A [Highway layer](https://arxiv.org/abs/1505.00387) that does a gated combination of a linear
transformation and a non-linear transformation of its input.
"""
from typing import Callable
import torch
class Highway(torch.nn.Module):
"""
A [Highway layer](https://arxiv.org/abs/1505.00387) does a gated com... | 41.825397 | 104 | 0.640987 |
6b63c8b91d7f10ecc01c9db3618e9865c5fe5179 | 5,626 | py | Python | vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py | salv-orlando/vmware-nsx | 6ad0d595aa8099004eb6dd5ff62c7a91b0e11dfd | [
"Apache-2.0"
] | null | null | null | vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py | salv-orlando/vmware-nsx | 6ad0d595aa8099004eb6dd5ff62c7a91b0e11dfd | [
"Apache-2.0"
] | null | null | null | vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py | salv-orlando/vmware-nsx | 6ad0d595aa8099004eb6dd5ff62c7a91b0e11dfd | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 VMware, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 37.013158 | 78 | 0.679879 |
72019b31540a943582ebb4699013d9dcfc10769f | 33,547 | py | Python | vendor/github.com/tensorflow/tensorflow/tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py | owennewo/kfserving | 89f73c87525b8e06ea799f69f2979c4ad272fcb3 | [
"Apache-2.0"
] | 52 | 2018-11-12T06:39:35.000Z | 2022-03-08T05:31:27.000Z | vendor/github.com/tensorflow/tensorflow/tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py | owennewo/kfserving | 89f73c87525b8e06ea799f69f2979c4ad272fcb3 | [
"Apache-2.0"
] | 13 | 2020-11-13T18:53:29.000Z | 2022-03-12T00:33:00.000Z | vendor/github.com/tensorflow/tensorflow/tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py | owennewo/kfserving | 89f73c87525b8e06ea799f69f2979c4ad272fcb3 | [
"Apache-2.0"
] | 17 | 2019-03-11T01:17:16.000Z | 2022-02-21T00:44:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.024934 | 82 | 0.696187 |
0fa72a36581150cd9408aa7bf12467bfaaab8893 | 15,194 | py | Python | tensorflow/python/ops/ragged/ragged_getitem.py | huyvohcmc/tensorflow | ee0f5b839d47ef35b1c42321ffb7ddecc3c8a4ba | [
"Apache-2.0"
] | 2 | 2020-03-20T20:05:13.000Z | 2020-03-20T20:05:15.000Z | tensorflow/python/ops/ragged/ragged_getitem.py | wolves7/tensorflow | ae244e6dabeb6b879c5adb9ca4c2a85cb4722dc5 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/ragged/ragged_getitem.py | wolves7/tensorflow | ae244e6dabeb6b879c5adb9ca4c2a85cb4722dc5 | [
"Apache-2.0"
] | 2 | 2019-10-11T00:17:03.000Z | 2020-05-23T18:59:45.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.059126 | 80 | 0.699552 |
ebb04f617265bb89c0460bbefab7d62e8db6feeb | 298 | py | Python | dts_test_project/dts_test_project/urls.py | buraketmen/django-tenants | 39bc6f9de7dff05eed5c2b062809493ef6f77571 | [
"MIT"
] | 514 | 2015-06-12T00:31:32.000Z | 2020-06-08T17:49:23.000Z | dts_test_project/dts_test_project/urls.py | david-luk4s/django-tenants | 67c8b2bbcdb467943d7271eb618a608e3ebc660d | [
"MIT"
] | 363 | 2015-06-12T07:04:04.000Z | 2020-06-09T17:10:17.000Z | dts_test_project/dts_test_project/urls.py | david-luk4s/django-tenants | 67c8b2bbcdb467943d7271eb618a608e3ebc660d | [
"MIT"
] | 159 | 2015-06-12T13:09:15.000Z | 2020-06-04T00:48:35.000Z | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.urls import path
urlpatterns = [
path("public/", lambda request: HttpResponse(), name="public"),
path("private/", login_required(lambda request: HttpResponse()), name="private"),
]
| 29.8 | 85 | 0.751678 |
5be8061ef817bd28ff043ca26c142cc60093f0e8 | 725 | py | Python | hw_03.0/benchmark_script.py | rchintsov/python-course-hw | f8af24e54c1bb3618a1503225d945500021c4833 | [
"Apache-2.0"
] | null | null | null | hw_03.0/benchmark_script.py | rchintsov/python-course-hw | f8af24e54c1bb3618a1503225d945500021c4833 | [
"Apache-2.0"
] | null | null | null | hw_03.0/benchmark_script.py | rchintsov/python-course-hw | f8af24e54c1bb3618a1503225d945500021c4833 | [
"Apache-2.0"
] | null | null | null | import time
import functools
def trace(func):
"""
Декоратор, который выполняет декорируемую функцию и выводит время её работы.
:param object func: функция для декорирования
:return: результат работы декорируемой функции
:rtype: object
"""
@functools.wraps(func)
def inner(*args, **kwargs... | 21.323529 | 80 | 0.634483 |
02afa9e40b5728c3a40f9767791a7dce8d3f773b | 910 | py | Python | setup.py | morsisko/NosTale-Auth | aa447a1c2a409e88c0aff62f9e37a4595593bedf | [
"MIT"
] | 27 | 2019-06-05T13:28:20.000Z | 2021-12-17T13:09:37.000Z | setup.py | morsisko/NosTale-Auth | aa447a1c2a409e88c0aff62f9e37a4595593bedf | [
"MIT"
] | 8 | 2020-10-23T15:48:36.000Z | 2021-12-29T16:04:21.000Z | setup.py | morsisko/NosTale-Auth | aa447a1c2a409e88c0aff62f9e37a4595593bedf | [
"MIT"
] | 10 | 2019-09-15T22:05:48.000Z | 2021-12-29T16:39:06.000Z | import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setup(
name="nosauth",
version="0.1.5",
description="Library that lets you obtain auth token so you can... | 30.333333 | 104 | 0.652747 |
a3d79d49a7630b3c6ddb161fdc7526cfd13d3d91 | 30,509 | py | Python | src/monitoring.py | kworm1/monitor | 97e4195b2ae9683d9b1aab9f1e887a1092255937 | [
"MIT"
] | null | null | null | src/monitoring.py | kworm1/monitor | 97e4195b2ae9683d9b1aab9f1e887a1092255937 | [
"MIT"
] | null | null | null | src/monitoring.py | kworm1/monitor | 97e4195b2ae9683d9b1aab9f1e887a1092255937 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
..
Copyright © 2017-2018 The University of New South Wales
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 limita... | 32.77014 | 167 | 0.582976 |
38cf2a12adccb09eb0c22d9976befd4d2b4f740c | 564 | py | Python | stressEquation.py | snakerboy1234/Cytomech | 69f27e72fc5f771245162b9a9fb63a81baa5b1c7 | [
"MIT"
] | null | null | null | stressEquation.py | snakerboy1234/Cytomech | 69f27e72fc5f771245162b9a9fb63a81baa5b1c7 | [
"MIT"
] | null | null | null | stressEquation.py | snakerboy1234/Cytomech | 69f27e72fc5f771245162b9a9fb63a81baa5b1c7 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
def stressEquation(voltageArray, stressArray):
i = 0
x = 0
xPowerTwo = 0
xPowerThree = 0
xPowerFour = 0
A = 4.9*(pow(10, -14))
B = 1.2*(pow(10, -12))
C = 6.5*(pow(10, -11))
D = -2.4*(pow(10, -11))
while(i<len(voltageArray)):... | 17.625 | 76 | 0.492908 |
963d719d604f0369700143d0df6ebc0f968475e4 | 3,380 | py | Python | itsy/fields/search.py | kostko/itsy | cd3d1f781b55482f44d016b7766830f611747e41 | [
"BSD-3-Clause"
] | 1 | 2017-08-12T00:09:31.000Z | 2017-08-12T00:09:31.000Z | itsy/fields/search.py | kostko/itsy | cd3d1f781b55482f44d016b7766830f611747e41 | [
"BSD-3-Clause"
] | null | null | null | itsy/fields/search.py | kostko/itsy | cd3d1f781b55482f44d016b7766830f611747e41 | [
"BSD-3-Clause"
] | null | null | null | import re
from .base import Field
from ..search.analyzer import ExactTermAnalyzer
__all__ = [
"SearchCompositeField",
"SearchCopyField",
"SearchExactField"
]
class SearchCompositeField(Field):
"""
Field that enables composition of other fields into text strings for
purpuses of search persistance.
"""
... | 26.614173 | 88 | 0.66716 |
886949809da06a87b60bd9c15d2280529ee151fb | 11,362 | py | Python | plottingV2.py | tylera277/voyagerTrajectoryCalculator | fded6356e670fbc2b182cac2bfcc98e7223e2b80 | [
"MIT"
] | null | null | null | plottingV2.py | tylera277/voyagerTrajectoryCalculator | fded6356e670fbc2b182cac2bfcc98e7223e2b80 | [
"MIT"
] | null | null | null | plottingV2.py | tylera277/voyagerTrajectoryCalculator | fded6356e670fbc2b182cac2bfcc98e7223e2b80 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from jplephem.spk import SPK
from fourthRungeKutta import computeRk4
kernel = SPK.open('de440.bsp')
def Plotting(xCraftStart, yCraftStart, zCraftStart,
xVel_leg1, yVel_leg1, zVel_leg1, tof_leg1,
xVel_leg2, yVel_leg2, zV... | 38.127517 | 111 | 0.639412 |
3653b805709ac6c903ec99cf6f7f219db729264e | 270 | py | Python | config/example_credentials.py | PrzemekPobrotyn/what-is-for-lunch-today | 7c70e28e24961621631305526684425319b88c3c | [
"MIT"
] | 5 | 2018-03-06T11:22:56.000Z | 2020-12-21T10:12:02.000Z | config/example_credentials.py | PrzemekPobrotyn/what-is-for-lunch-today | 7c70e28e24961621631305526684425319b88c3c | [
"MIT"
] | null | null | null | config/example_credentials.py | PrzemekPobrotyn/what-is-for-lunch-today | 7c70e28e24961621631305526684425319b88c3c | [
"MIT"
] | null | null | null | # your credentials.py should look as follows
USER_TOKEN = 'your facebook user token'
email_address = 'email address to send out menus'
email_password = 'email password'
admin_email = 'admin email to sent error messages'
slack_webhook = 'slack webhook to post to slack'
| 33.75 | 50 | 0.781481 |
43635556a3c73ceaf1ab45562ff7dc9383b5a0bb | 6,981 | py | Python | sdk/python/pulumi_azure_nextgen/devices/v20200615/iot_hub_resource_event_hub_consumer_group.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/devices/v20200615/iot_hub_resource_event_hub_consumer_group.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/devices/v20200615/iot_hub_resource_event_hub_consumer_group.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 52.097015 | 1,443 | 0.692021 |
7f1257e2ab4f9a5a52f899f528e5e13401bbb199 | 7,230 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py | denyo/openapi-generator | 468d80be4beff74de33a2dd1d533f855030038d5 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py | denyo/openapi-generator | 468d80be4beff74de33a2dd1d533f855030038d5 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py | denyo/openapi-generator | 468d80be4beff74de33a2dd1d533f855030038d5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 37.65625 | 174 | 0.582988 |
7d9a032e448d7ef04aafcc67afe7318feb578c30 | 955 | py | Python | train/util.py | jacobeturpin/segment-it | 1abd2a2f146c82e0bf970e4df9a976b11d3a5f58 | [
"Apache-2.0"
] | 3 | 2020-04-22T22:23:30.000Z | 2021-09-01T17:29:18.000Z | train/util.py | jacobeturpin/segment-it | 1abd2a2f146c82e0bf970e4df9a976b11d3a5f58 | [
"Apache-2.0"
] | 6 | 2020-04-24T21:06:20.000Z | 2020-08-11T09:07:32.000Z | train/util.py | jacobeturpin/segment-it | 1abd2a2f146c82e0bf970e4df9a976b11d3a5f58 | [
"Apache-2.0"
] | null | null | null | """Utility functions for image segmentation"""
import tensorflow as tf
def normalize(input_image, input_mask):
input_image = tf.cast(input_image, tf.float32) / 255.0
input_mask -= 1
return input_image, input_mask
@tf.function
def load_image_train(datapoint):
input_image = tf.image.resize(datapoint[... | 28.939394 | 76 | 0.724607 |
d293a9b254e7b352ead74879de10862a8228169a | 789 | py | Python | var/spack/repos/builtin/packages/gemmlowp/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/gemmlowp/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/gemmlowp/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Gemmlowp(Package):
"""Google low-precision matrix multiplication library"""
homepage ... | 34.304348 | 75 | 0.693283 |
d287c41380fec3b299cf7e99895c7d65222e3a3e | 6,273 | py | Python | tnf2okAssocUnif.py | ptarau/LogicTransformers | 06317378ad43f50471dabf1cdcfc0797ebdc505d | [
"Apache-2.0"
] | 7 | 2020-10-07T08:33:04.000Z | 2021-11-14T17:09:45.000Z | tnf2okAssocUnif.py | ptarau/LogicTransformers | 06317378ad43f50471dabf1cdcfc0797ebdc505d | [
"Apache-2.0"
] | null | null | null | tnf2okAssocUnif.py | ptarau/LogicTransformers | 06317378ad43f50471dabf1cdcfc0797ebdc505d | [
"Apache-2.0"
] | 2 | 2020-10-14T12:48:47.000Z | 2020-12-05T05:33:06.000Z | VAR=1
REF=2
PAIR=3
CONST=4
# unnamed variable
def var() :
v=[None]
v[0]=v
return v
# named variable
def nvar(name):
v=[None,name]
v[0]=v
return v
# return type of data object
def type_of(x) :
if isinstance(x,list) :
return VAR+(not x is x[0]) # VAR or REF
elif isinstance(x,tuple) :
return PAI... | 20.634868 | 56 | 0.523035 |
0616dc342c5b297d2d7fd6e719df79d6a4a02a15 | 16,960 | py | Python | src/page/home.py | jacobrask/critic | 80d30b517de955316d23109df956a6825cc6aa7e | [
"Apache-2.0"
] | null | null | null | src/page/home.py | jacobrask/critic | 80d30b517de955316d23109df956a6825cc6aa7e | [
"Apache-2.0"
] | null | null | null | src/page/home.py | jacobrask/critic | 80d30b517de955316d23109df956a6825cc6aa7e | [
"Apache-2.0"
] | null | null | null | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 Jens Lindström, Opera Software ASA
#
# 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... | 41.365854 | 138 | 0.591686 |
07df900a1d29c2580b912555cfefe680a8341509 | 814 | py | Python | my_classes/.history/ModulesPackages_PackageNamespaces/example3b/importer_20210726184631.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/example3b/importer_20210726184631.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/example3b/importer_20210726184631.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null |
import os.path
import types
import sys
def import_(module_name, module_file. module_path):
if module_name in sys.modules:
return sys.modules[module_name]
module_rel_file_path = os.path.join(module_path, module_file)
module_abs_file_path = os.path.abspath(module_rel_file_path)
# read source... | 24.666667 | 77 | 0.72113 |
72ab16024d8fb4f54df8844f0e31dab874d75f62 | 31,286 | py | Python | flocker/testtools/__init__.py | lukemarsden/flocker | 3f6ba9e5ebd1378f57abf8502686a653337f6278 | [
"Apache-2.0"
] | null | null | null | flocker/testtools/__init__.py | lukemarsden/flocker | 3f6ba9e5ebd1378f57abf8502686a653337f6278 | [
"Apache-2.0"
] | null | null | null | flocker/testtools/__init__.py | lukemarsden/flocker | 3f6ba9e5ebd1378f57abf8502686a653337f6278 | [
"Apache-2.0"
] | null | null | null | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Various utilities to help with unit and functional testing.
"""
from __future__ import absolute_import
import gc
import io
import socket
import sys
import os
import pwd
from collections import namedtuple
from contextlib import contextmanager
from rando... | 33.53269 | 79 | 0.635844 |
451bf8b05676639a69d5ed6e8b490f93d6f327cb | 693 | py | Python | app/core/migrations/0003_tag.py | bowo-anakdesa/belajar-django-api | 3f2a456f29bbc18ec6e4383b929de41c2d2edbf5 | [
"MIT"
] | 1 | 2019-06-28T02:02:56.000Z | 2019-06-28T02:02:56.000Z | app/core/migrations/0003_tag.py | bowo-anakdesa/django-api | 3f2a456f29bbc18ec6e4383b929de41c2d2edbf5 | [
"MIT"
] | null | null | null | app/core/migrations/0003_tag.py | bowo-anakdesa/django-api | 3f2a456f29bbc18ec6e4383b929de41c2d2edbf5 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.8 on 2019-05-30 05:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20190506_1548'),
]
operations = [
migrations.CreateModel... | 28.875 | 118 | 0.621934 |
e231cc6ba9d98af965eadd30b791018dec0cf640 | 902 | py | Python | section 0006/strategies/calendar.py | Isusquiza/Machine-Learning-for-Algorithmic-Trading-Bots-with-Python | ff197644212ee9e26eb3a641dd9944c1b86c12b6 | [
"MIT"
] | 270 | 2018-12-24T14:11:22.000Z | 2022-03-26T07:03:08.000Z | section 0006/strategies/calendar.py | RezaAIDL77/Machine-Learning-for-Algorithmic-Trading-Bots-with-Python | ff197644212ee9e26eb3a641dd9944c1b86c12b6 | [
"MIT"
] | 3 | 2020-01-05T15:27:45.000Z | 2020-08-05T21:05:41.000Z | section 0006/strategies/calendar.py | RezaAIDL77/Machine-Learning-for-Algorithmic-Trading-Bots-with-Python | ff197644212ee9e26eb3a641dd9944c1b86c12b6 | [
"MIT"
] | 136 | 2018-12-09T00:10:05.000Z | 2022-03-25T04:19:40.000Z | from zipline.utils.calendars import TradingCalendar
from datetime import time
from pandas.tseries.offsets import CustomBusinessDay
from pytz import timezone
from zipline.utils.memoize import lazyval
class CryptoCalendar(TradingCalendar):
"""
Exchange calendar for 24/7 trading.
Open Time: 12am, UTC
Cl... | 20.5 | 52 | 0.633038 |
b98161b819bdb49c263ec71673ba1d07e576d17f | 4,046 | py | Python | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_workspace_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | null | null | null | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_workspace_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 1 | 2021-06-07T06:37:28.000Z | 2021-06-07T06:37:28.000Z | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_workspace_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"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 ... | 41.71134 | 133 | 0.667573 |
0b34867b94ad309934e20d4e2832e6f7b212a8cd | 1,190 | py | Python | addon.py | leopheard/TheQuietusRadio | c2b9cfb22922b83d994f297bac6f89490bd404b9 | [
"MIT"
] | null | null | null | addon.py | leopheard/TheQuietusRadio | c2b9cfb22922b83d994f297bac6f89490bd404b9 | [
"MIT"
] | null | null | null | addon.py | leopheard/TheQuietusRadio | c2b9cfb22922b83d994f297bac6f89490bd404b9 | [
"MIT"
] | null | null | null | from xbmcswift2 import Plugin, xbmcgui
from resources.lib import mainaddon
plugin = Plugin()
url1 = "http://radio.thequietus.com/feed/podcast/"
@plugin.route('/')
def main_menu():
items = [
{
'label': plugin.get_string(30001),
'path': plugin.url_for('episodes1'),
... | 33.055556 | 111 | 0.662185 |
11da52f8ede3db98db7679ad2d64ce32b8ff1730 | 683 | py | Python | keyboard/__main__.py | awesome-archive/keyboard | d7774b513412cafb6e5c89b3e5783f1e53e39b40 | [
"MIT"
] | null | null | null | keyboard/__main__.py | awesome-archive/keyboard | d7774b513412cafb6e5c89b3e5783f1e53e39b40 | [
"MIT"
] | null | null | null | keyboard/__main__.py | awesome-archive/keyboard | d7774b513412cafb6e5c89b3e5783f1e53e39b40 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import keyboard
import fileinput
import json
import sys
def print_event_json(event):
# Could use json.dumps(event.__dict__()), but this way we guarantee semantic order.
if event.name.isalnum():
print('{{"event_type": "{}", "name": "{}", "scan_code": {}, "time": {}}}'.format(event.event_type... | 40.176471 | 142 | 0.70571 |
df2e831d7d7fd0207f9b191f3ad8e56f9aabe9a8 | 613 | py | Python | aegnn/models/networks/__init__.py | uzh-rpg/aegnn | d96e13b2f80f3c7515a65baf966544e0914d068d | [
"MIT"
] | null | null | null | aegnn/models/networks/__init__.py | uzh-rpg/aegnn | d96e13b2f80f3c7515a65baf966544e0914d068d | [
"MIT"
] | null | null | null | aegnn/models/networks/__init__.py | uzh-rpg/aegnn | d96e13b2f80f3c7515a65baf966544e0914d068d | [
"MIT"
] | null | null | null | from .graph_res import GraphRes
from .graph_wen import GraphWen
################################################################################################
# Access functions #############################################################################
#############################################################... | 36.058824 | 96 | 0.383361 |
3c8e55b33e7c3c711a1ac381f5dae9ea150a256f | 216 | py | Python | HackerRank/10 Days of Statistics/Day6C.py | ShubhamJagtap2000/competitive-programming-1 | 3a9a2e3dd08f8fa8ab823f295cd020d08d3bff84 | [
"MIT"
] | 1 | 2021-07-22T07:37:31.000Z | 2021-07-22T07:37:31.000Z | HackerRank/10 Days of Statistics/Day6C.py | ShubhamJagtap2000/competitive-programming-1 | 3a9a2e3dd08f8fa8ab823f295cd020d08d3bff84 | [
"MIT"
] | null | null | null | HackerRank/10 Days of Statistics/Day6C.py | ShubhamJagtap2000/competitive-programming-1 | 3a9a2e3dd08f8fa8ab823f295cd020d08d3bff84 | [
"MIT"
] | null | null | null | samples = float(input())
mean = float(input())
sd = float(input())
interval = float(input())
z = float (input())
sd_sample = sd / (samples**0.5)
print(round(mean - sd_sample*z,2))
print(round(mean + sd_sample*z,2))
| 21.6 | 34 | 0.657407 |
c2c943bbeb53ad3866b0dee2bd9235a2b3e9100b | 13,960 | py | Python | mytimm/models/convit.py | wenh18/OnDeviceNAS | d6e39500b794ddd9737ef4bc631cf4f977b47617 | [
"Apache-2.0"
] | 1 | 2022-03-24T08:20:45.000Z | 2022-03-24T08:20:45.000Z | mytimm/models/convit.py | wenh18/OnDeviceNAS | d6e39500b794ddd9737ef4bc631cf4f977b47617 | [
"Apache-2.0"
] | null | null | null | mytimm/models/convit.py | wenh18/OnDeviceNAS | d6e39500b794ddd9737ef4bc631cf4f977b47617 | [
"Apache-2.0"
] | null | null | null | """ ConViT Model
@article{d2021convit,
title={ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biases},
author={d'Ascoli, St{\'e}phane and Touvron, Hugo and Leavitt, Matthew and Morcos, Ari and Biroli, Giulio and Sagun, Levent},
journal={arXiv preprint arXiv:2103.10697},
year={2021}
}
P... | 39.435028 | 126 | 0.634241 |
3efda7e4275a64abbdbf3478ff5369508c6fe38b | 2,112 | py | Python | bin/tools/pykg-config/pykg_config/exceptions.py | apaprocki/bde-tools | 74cee6ed6c2de1bbb0d7cb7fdc96b60a37cab434 | [
"Apache-2.0"
] | 12 | 2015-10-23T10:52:34.000Z | 2022-01-26T04:23:14.000Z | bin/tools/pykg-config/pykg_config/exceptions.py | apaprocki/bde-tools | 74cee6ed6c2de1bbb0d7cb7fdc96b60a37cab434 | [
"Apache-2.0"
] | 6 | 2015-01-01T08:49:15.000Z | 2021-01-27T07:08:39.000Z | bin/tools/pykg-config/pykg_config/exceptions.py | apaprocki/bde-tools | 74cee6ed6c2de1bbb0d7cb7fdc96b60a37cab434 | [
"Apache-2.0"
] | 10 | 2015-04-15T09:45:56.000Z | 2021-02-02T16:55:04.000Z | # Copyright (c) 2009-2012, Geoffrey Biggs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | 37.714286 | 77 | 0.745739 |
b315a2c16db63cf9a310ab3c62e8d923d3e8ea47 | 4,564 | py | Python | src/python/pants/pantsd/service/pailgun_service.py | foursquare/pants | f0627cfa6ab05fc9a10686a499d1fb1d6ebdb68b | [
"Apache-2.0"
] | 1 | 2018-12-10T21:31:02.000Z | 2018-12-10T21:31:02.000Z | src/python/pants/pantsd/service/pailgun_service.py | traviscrawford/pants | 587df52d68e612d2f2c87dbe1f504a7bc69b2c46 | [
"Apache-2.0"
] | 2 | 2016-10-13T21:37:42.000Z | 2018-07-20T20:14:33.000Z | src/python/pants/pantsd/service/pailgun_service.py | traviscrawford/pants | 587df52d68e612d2f2c87dbe1f504a7bc69b2c46 | [
"Apache-2.0"
] | 1 | 2018-03-08T22:21:44.000Z | 2018-03-08T22:21:44.000Z | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | 37.105691 | 104 | 0.715162 |
9500ad08119fe9d275de8fdcd016daa3632f7f63 | 9,688 | py | Python | symbench_athens_client/models/fd_metrics.py | valtron/symbench-athens-client | 11482f5d385217898cfc5cb6ff9d76b19a3f7356 | [
"Apache-2.0"
] | null | null | null | symbench_athens_client/models/fd_metrics.py | valtron/symbench-athens-client | 11482f5d385217898cfc5cb6ff9d76b19a3f7356 | [
"Apache-2.0"
] | 43 | 2021-08-19T20:16:43.000Z | 2022-03-30T18:54:42.000Z | symbench_athens_client/models/fd_metrics.py | valtron/symbench-athens-client | 11482f5d385217898cfc5cb6ff9d76b19a3f7356 | [
"Apache-2.0"
] | 2 | 2021-11-09T06:07:06.000Z | 2022-01-13T17:04:29.000Z | from pydantic import BaseModel, Field
class FDMInputMetric(BaseModel):
flight_path: int = Field(..., description="The Flight path", alias="Flight_Path")
i_xx: float = Field(..., description="Ixx value", alias="Ixx")
i_yy: float = Field(..., description="Iyy value", alias="iyy")
i_zz: float = Field(... | 36.69697 | 91 | 0.62531 |
cf84e0d34c24b8c5bc6d7768e7e20abba03b585b | 446 | py | Python | xpresso/binders/_utils/grouped.py | dantownsend/xpresso | a4c4dbe96972a6f0339f30d7d794932f70510eea | [
"MIT"
] | 75 | 2022-01-18T02:17:57.000Z | 2022-03-24T02:30:04.000Z | xpresso/binders/_utils/grouped.py | dantownsend/xpresso | a4c4dbe96972a6f0339f30d7d794932f70510eea | [
"MIT"
] | 73 | 2022-01-18T03:01:27.000Z | 2022-03-27T16:41:38.000Z | xpresso/binders/_utils/grouped.py | dantownsend/xpresso | a4c4dbe96972a6f0339f30d7d794932f70510eea | [
"MIT"
] | 3 | 2022-01-18T22:47:06.000Z | 2022-01-25T02:03:53.000Z | from typing import Iterable, Sequence, Tuple, TypeVar
T = TypeVar("T")
def grouped(items: Sequence[T], n: int = 2) -> Iterable[Tuple[T, ...]]:
"""s -> [(s0, s1, s2,...sn-1), (sn, sn+1 , sn+2,...s2n-1), ...]
list(grouped([1, 2], 2)) == [(1, 2)]
list(grouped([1, 2, 3, 4], 2)) == [(1, 2), (3, 4)]
"""
... | 31.857143 | 71 | 0.515695 |
89d0bd7f3b3779907a92ff2bfd4ca932ec7e653c | 2,576 | py | Python | src/reactive_mimictraining.py | silverjoda/hopper_experiments | 72cef8dd30defa504b490f68fc2469e7244f7796 | [
"MIT"
] | null | null | null | src/reactive_mimictraining.py | silverjoda/hopper_experiments | 72cef8dd30defa504b490f68fc2469e7244f7796 | [
"MIT"
] | null | null | null | src/reactive_mimictraining.py | silverjoda/hopper_experiments | 72cef8dd30defa504b490f68fc2469e7244f7796 | [
"MIT"
] | null | null | null | from policy import Policy
from utils import Logger, Scaler
import time
from train import init_gym, run_episode
from networks import *
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
def evaluate_mimic(mimicpolicy, masterpolicy, scaler, env, n):
total_mse = 0
for i in range(n):
observes, actions, _, ... | 27.115789 | 75 | 0.556289 |
b644911391b1ba13b05ca358206ac01d8f6538b1 | 27,795 | py | Python | colour/corresponding/prediction.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | colour/corresponding/prediction.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | colour/corresponding/prediction.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | """
Corresponding Chromaticities Prediction
=======================================
Defines the objects to compute corresponding chromaticities prediction.
References
----------
- :cite:`Breneman1987b` : Breneman, E. J. (1987). Corresponding
chromaticities for different states of adaptation to complex visual fi... | 34.104294 | 80 | 0.59007 |
e9c1b0ea38cbbe7cd0032e0a1af4e96dbf5eca43 | 53,790 | py | Python | src/skmultiflow/trees/hoeffding_tree.py | AndreFCruz/scikit-multiflow | c4dbbb70d4ed839d95a18ca799f073ac9ff9ba49 | [
"BSD-3-Clause"
] | null | null | null | src/skmultiflow/trees/hoeffding_tree.py | AndreFCruz/scikit-multiflow | c4dbbb70d4ed839d95a18ca799f073ac9ff9ba49 | [
"BSD-3-Clause"
] | null | null | null | src/skmultiflow/trees/hoeffding_tree.py | AndreFCruz/scikit-multiflow | c4dbbb70d4ed839d95a18ca799f073ac9ff9ba49 | [
"BSD-3-Clause"
] | null | null | null | import logging
import textwrap
from abc import ABCMeta
from operator import attrgetter
import numpy as np
from skmultiflow.utils.utils import get_dimensions, normalize_values_in_dict, calculate_object_size
from skmultiflow.core.base import StreamModel
from skmultiflow.trees.numeric_attribute_class_observer_gaussian imp... | 37.045455 | 120 | 0.590258 |
9ce4125ea73caf33a7ab029eece2376f0110ee6f | 6,886 | py | Python | Minecraft.py | BeahIF/ev3 | 542001b4b58f028bf14f81bfb587da576de082ad | [
"MIT"
] | null | null | null | Minecraft.py | BeahIF/ev3 | 542001b4b58f028bf14f81bfb587da576de082ad | [
"MIT"
] | null | null | null | Minecraft.py | BeahIF/ev3 | 542001b4b58f028bf14f81bfb587da576de082ad | [
"MIT"
] | 4 | 2019-08-20T15:07:01.000Z | 2020-03-10T13:53:18.000Z | #!/usr/bin/env python3
#coding: utf-8
from ev3dev.ev3 import *
from threading import *
import time, socket
import math
import colorsys
m1 = LargeMotor('outD') #Esquerdo
m2 = LargeMotor('outC') #Direito
Sensor_Ultrassonico = [UltrassonicSensor('in3'), UltrassonicSensor('in4')] #1 = Esquerdo, 2 = Direito
Sensor_Ultrass... | 34.43 | 101 | 0.53616 |
4da70ffc8423a8e8460061e6786917047367a492 | 140 | py | Python | list/apps.py | tanmayb104/API-ToDoList | 51c9e0f2da47b60624a7ed6c774f02351370b17b | [
"MIT"
] | 1 | 2021-08-19T14:50:46.000Z | 2021-08-19T14:50:46.000Z | list/apps.py | tanmayb104/API-TodoList | 51c9e0f2da47b60624a7ed6c774f02351370b17b | [
"MIT"
] | null | null | null | list/apps.py | tanmayb104/API-TodoList | 51c9e0f2da47b60624a7ed6c774f02351370b17b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ListConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'list'
| 20 | 56 | 0.75 |
bd251b68c8a362d3eb20642e93ae3814006ae680 | 4,600 | py | Python | train/Transforms.py | n-issei-777/ESPNet | afe71c38edaee3514ca44e0adcafdf36109bf437 | [
"MIT"
] | 539 | 2018-03-20T01:09:21.000Z | 2022-03-29T10:08:42.000Z | ros/src/perception/src/perception/Transforms.py | LouSample/opencaret | 35be29ff2a6c546e71c4bb3bf76c1bc32b567a86 | [
"MIT"
] | 81 | 2018-03-30T13:08:24.000Z | 2021-12-03T08:12:34.000Z | ros/src/perception/src/perception/Transforms.py | LouSample/opencaret | 35be29ff2a6c546e71c4bb3bf76c1bc32b567a86 | [
"MIT"
] | 134 | 2018-03-20T01:34:27.000Z | 2022-03-01T17:24:55.000Z | import numpy as np
import torch
import random
import cv2
__author__ = "Sachin Mehta"
class Scale(object):
"""
Randomly crop and resize the given PIL image with a probability of 0.5
"""
def __init__(self, wi, he):
'''
:param wi: width after resizing
:param he: height after res... | 28.930818 | 110 | 0.573261 |
4504c1d0a6fe0b1d3bc479bf057936c50a995bad | 52,227 | py | Python | modules/pymol/querying.py | noahpieta/pymol-open-source | 4324d726241c1acfc30d8e21d2d988fea453364c | [
"CNRI-Python"
] | 1 | 2019-03-27T02:31:27.000Z | 2019-03-27T02:31:27.000Z | modules/pymol/querying.py | noahpieta/pymol-open-source | 4324d726241c1acfc30d8e21d2d988fea453364c | [
"CNRI-Python"
] | null | null | null | modules/pymol/querying.py | noahpieta/pymol-open-source | 4324d726241c1acfc30d8e21d2d988fea453364c | [
"CNRI-Python"
] | null | null | null | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* -------... | 29.440248 | 107 | 0.550194 |
a9c496122876e75f2e633bca499d9550ad2a21f8 | 3,963 | py | Python | tests/test_RP2.py | brsynth/RetroPath2-wrapper | 545f40ad0df7049332012ee5184138c6c14a9f35 | [
"MIT"
] | 4 | 2021-10-13T22:12:16.000Z | 2021-12-25T13:00:53.000Z | tests/test_RP2.py | brsynth/RetroPath2-wrapper | 545f40ad0df7049332012ee5184138c6c14a9f35 | [
"MIT"
] | 6 | 2020-08-14T15:02:35.000Z | 2022-03-04T13:05:21.000Z | tests/test_RP2.py | brsynth/RetroPath2-wrapper | 545f40ad0df7049332012ee5184138c6c14a9f35 | [
"MIT"
] | null | null | null | """
Created on Jul 15 2020
@author: Joan Hérisson
"""
from unittest import TestCase
from tempfile import TemporaryDirectory, gettempdir
from os import path as os_path
from os import mkdir as os_mkdir
from filecmp import cmp
from brs_utils import extract_gz
from pathlib import Path
from sh... | 30.72093 | 73 | 0.531416 |
142f408910633171d50a2e5e83a3d81a18e3b4fb | 12,907 | py | Python | scripts/uncertainty_scripts/statics/train_moreinfo.py | neuroailab/curiosity_deprecated | 65f7cde13b07cdac52eed39535a94e7544c396b8 | [
"Apache-2.0"
] | null | null | null | scripts/uncertainty_scripts/statics/train_moreinfo.py | neuroailab/curiosity_deprecated | 65f7cde13b07cdac52eed39535a94e7544c396b8 | [
"Apache-2.0"
] | 2 | 2017-11-18T00:53:33.000Z | 2017-11-18T00:53:40.000Z | scripts/uncertainty_scripts/statics/train_moreinfo.py | neuroailab/curiosity_deprecated | 65f7cde13b07cdac52eed39535a94e7544c396b8 | [
"Apache-2.0"
] | null | null | null | '''
A script for training on static data, no interaction.
First iteration, uniform sampling, l2 loss.
'''
import sys
sys.path.append('curiosity')
sys.path.append('tfutils')
import tensorflow as tf
from curiosity.interaction import train, environment, static_data, cfg_generation, update_step
import curiosity.inter... | 27.287526 | 134 | 0.576509 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.