hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a309bbed8b8d838c5cf768de6a3518266a5473ad | 13,539 | py | Python | mmdet/models/dense_heads/anchor_free_head.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/anchor_free_head.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/anchor_free_head.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | from abc import abstractmethod
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
from mmcv.runner import force_fp32
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from .base_dense_head import BaseDenseHead
from .dense_test_mixins import BB... | 39.703812 | 82 | 0.566216 |
5112299e9268ddcdd966f52bff221591d2417c87 | 4,743 | py | Python | anydrive_typing_aid/src/anydrive_typing_aid/controllers/base_controller.py | ethz-asl/typing_aid | ee44575b5198c34162b6f38dda798d97ae10f7d7 | [
"BSD-3-Clause"
] | null | null | null | anydrive_typing_aid/src/anydrive_typing_aid/controllers/base_controller.py | ethz-asl/typing_aid | ee44575b5198c34162b6f38dda798d97ae10f7d7 | [
"BSD-3-Clause"
] | null | null | null | anydrive_typing_aid/src/anydrive_typing_aid/controllers/base_controller.py | ethz-asl/typing_aid | ee44575b5198c34162b6f38dda798d97ae10f7d7 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import rospy
from std_msgs.msg import String
import anydrive_typing_aid.utils.utilities as utilities
class BaseController:
def __init__(self, drv_interface, parameters, save_dir):
self.drv_interface = drv_interface
self.parameters = parameters
self.save_dir = save_dir
... | 32.9375 | 87 | 0.591187 |
f38bee993a3763eeb3c67716a717c9c98e9d919a | 878 | py | Python | setup.py | v-morello/sffix | 5d27d729524519f3f7399018c3e5c149cc493647 | [
"MIT"
] | null | null | null | setup.py | v-morello/sffix | 5d27d729524519f3f7399018c3e5c149cc493647 | [
"MIT"
] | null | null | null | setup.py | v-morello/sffix | 5d27d729524519f3f7399018c3e5c149cc493647 | [
"MIT"
] | null | null | null | import os
import setuptools
from setuptools import setup
def parse_version():
thisdir = os.path.dirname(__file__)
version_file = os.path.join(thisdir, 'sffix', '_version.py')
with open(version_file, 'r') as fobj:
text = fobj.read()
items = {}
exec(text, None, items)
return items['__vers... | 28.322581 | 98 | 0.697039 |
043aa277d765f7c8418c1d9ee5e006446719c955 | 5,037 | py | Python | flexget/plugins/output/dump.py | jacaru/flexget | 2ac1799f76b6b1572c0b088299abf9683d4afba6 | [
"MIT"
] | null | null | null | flexget/plugins/output/dump.py | jacaru/flexget | 2ac1799f76b6b1572c0b088299abf9683d4afba6 | [
"MIT"
] | null | null | null | flexget/plugins/output/dump.py | jacaru/flexget | 2ac1799f76b6b1572c0b088299abf9683d4afba6 | [
"MIT"
] | null | null | null | from loguru import logger
from flexget import options, plugin
from flexget.event import event
from flexget.terminal import console
logger = logger.bind(name='dump')
def dump(entries, debug=False, eval_lazy=False, trace=False, title_only=False):
"""
Dump *entries* to stdout
:param list entries: Entries ... | 37.311111 | 97 | 0.532658 |
54cb996072028b165811e4bc7d2114b89cd252cd | 3,309 | py | Python | research/audioset/vggish_input.py | xychu/models | 0344c5503ee55e24f0de7f37336a6e08f10976fd | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | research/audioset/vggish_input.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | research/audioset/vggish_input.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 1,474 | 2018-02-01T04:33:18.000Z | 2022-03-08T07:02:20.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 applicab... | 38.034483 | 80 | 0.737987 |
02f9297e4576269d3456d25895fc6eef000ad0b6 | 2,655 | py | Python | longitude/core/data_sources/postgres/default.py | Rovaro/Longitude | b17b40a7b19edb10c62238ea20d136a3a8147f13 | [
"MIT"
] | 1 | 2020-11-06T11:12:42.000Z | 2020-11-06T11:12:42.000Z | longitude/core/data_sources/postgres/default.py | Rovaro/Longitude | b17b40a7b19edb10c62238ea20d136a3a8147f13 | [
"MIT"
] | 22 | 2017-11-20T21:18:55.000Z | 2021-07-06T10:22:14.000Z | longitude/core/data_sources/postgres/default.py | Rovaro/Longitude | b17b40a7b19edb10c62238ea20d136a3a8147f13 | [
"MIT"
] | 4 | 2018-03-22T08:38:03.000Z | 2020-06-14T04:29:15.000Z | import psycopg2
import psycopg2.extensions
from ...common.query_response import LongitudeQueryResponse
from ..base import DataSource
from .common import psycopg2_type_as_string
class PostgresDataSource(DataSource):
def __init__(self, options={}):
super().__init__(options)
self._conn = psycopg2.c... | 34.934211 | 111 | 0.629755 |
abb21caede1458937ad3bd9ec2f1a9f9ae434a88 | 4,077 | py | Python | boards/tests/test_postEdit_view.py | Xerrex/django_boards_project | 60be478867afa4c9dbc6eb9494dfc046f438b75a | [
"MIT"
] | null | null | null | boards/tests/test_postEdit_view.py | Xerrex/django_boards_project | 60be478867afa4c9dbc6eb9494dfc046f438b75a | [
"MIT"
] | 4 | 2020-06-05T23:12:01.000Z | 2021-06-29T07:06:30.000Z | boards/tests/test_postEdit_view.py | Xerrex/django_boards_project | 60be478867afa4c9dbc6eb9494dfc046f438b75a | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse, resolve
from django.forms import ModelForm
from boards.models import Board, Topic, Post
from boards.views import PostEditView
class PostEditViewTestCase(TestCase):
'''
Base test case to be used in all... | 35.763158 | 112 | 0.668629 |
b80ccdaa7aa49960f4deb9d2feed6994a22a2c52 | 270 | py | Python | acmicpc/1764/1764.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 3 | 2019-03-09T05:19:23.000Z | 2019-04-06T09:26:36.000Z | acmicpc/1764/1764.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2020-02-23T10:38:04.000Z | 2020-02-23T10:38:04.000Z | acmicpc/1764/1764.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2019-05-22T13:47:53.000Z | 2019-05-22T13:47:53.000Z | N, M = map(int, input().split())
unknown_not_listened = {input() for param in range(N)}
unknown_not_seen = {input() for param in range(M)}
intersection = sorted(unknown_not_listened & unknown_not_seen)
print(len(intersection))
for item in intersection:
print(item)
| 30 | 62 | 0.740741 |
96030cea2ef77f3fbc003808007135e08e52281a | 4,973 | py | Python | python/model/Actor_Critic.py | maswin/DeepRTS | 9922078951810d65fc212a0c2ee32f75765d3cd0 | [
"MIT"
] | null | null | null | python/model/Actor_Critic.py | maswin/DeepRTS | 9922078951810d65fc212a0c2ee32f75765d3cd0 | [
"MIT"
] | 1 | 2019-11-25T06:40:34.000Z | 2019-12-03T03:59:13.000Z | python/model/Actor_Critic.py | maswin/DeepRTS | 9922078951810d65fc212a0c2ee32f75765d3cd0 | [
"MIT"
] | null | null | null | from keras.layers import Dense, Input, Activation, Dropout
from keras.optimizers import Adam
from keras.layers.core import Dense
import random
import keras
import keras.backend as K
from keras.models import Sequential, Model, load_model
import numpy as np
from keras.callbacks import TensorBoard, History
import tensorfl... | 36.566176 | 111 | 0.65373 |
ff579d5e53d3feff6c6afbcc75def3210e64b664 | 776 | py | Python | codedigger/codeforces/tests/test_views.py | jyothiprakashpanaik/Backend | 9ab1b57436a0a1a6197777c0b36c842e71121d3a | [
"Apache-2.0"
] | 17 | 2020-10-07T22:40:37.000Z | 2022-01-20T07:19:09.000Z | codedigger/codeforces/tests/test_views.py | jyothiprakashpanaik/Backend | 9ab1b57436a0a1a6197777c0b36c842e71121d3a | [
"Apache-2.0"
] | 42 | 2021-06-03T01:58:04.000Z | 2022-01-31T14:49:22.000Z | codedigger/codeforces/tests/test_views.py | jyothiprakashpanaik/Backend | 9ab1b57436a0a1a6197777c0b36c842e71121d3a | [
"Apache-2.0"
] | 25 | 2020-10-06T17:55:19.000Z | 2021-12-09T07:56:50.000Z | from rest_framework import response
from .test_setup import TestSetUp
from user.exception import ValidationException
from codeforces.api import (user_info, user_rating, contest_list,
contest_standings, contest_ratingChanges,
user_status)
from django.urls import re... | 35.272727 | 69 | 0.639175 |
083dc606cf8076db883cb4e9f3760fdfa852c2e4 | 313 | py | Python | DQMServices/Components/python/DQMMessageLogger_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQMServices/Components/python/DQMMessageLogger_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQMServices/Components/python/DQMMessageLogger_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z |
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
DQMMessageLogger = DQMEDAnalyzer('DQMMessageLogger',
Categories = cms.vstring(),
Directory = cms.string("MessageLogger")
)
| 26.083333 | 68 | 0.58147 |
b7e0dce2097d475e43cc63bb5de10d78fdff55ac | 11,702 | py | Python | scenario_runner/srunner/scenariomanager/result_writer.py | barasm-hita/carla-vehicle-testing | 9fdfbb9af5bccaa66f510e7db214740975cc1613 | [
"MIT"
] | 302 | 2018-11-21T20:13:03.000Z | 2022-03-30T05:40:40.000Z | scenario_runner/srunner/scenariomanager/result_writer.py | barasm-hita/carla-vehicle-testing | 9fdfbb9af5bccaa66f510e7db214740975cc1613 | [
"MIT"
] | 466 | 2018-11-30T13:49:04.000Z | 2022-03-30T09:54:04.000Z | scenario_runner/srunner/scenariomanager/result_writer.py | barasm-hita/carla-vehicle-testing | 9fdfbb9af5bccaa66f510e7db214740975cc1613 | [
"MIT"
] | 291 | 2018-11-21T10:12:26.000Z | 2022-03-28T10:36:55.000Z | #!/usr/bin/env python
# Copyright (c) 2018-2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module contains the result gatherer and write for CARLA scenarios.
It shall be used from the ScenarioManager only.
"""
from... | 40.213058 | 108 | 0.532559 |
b21045f7e474be5d6b08b7868378686f08f907b4 | 4,744 | py | Python | api/portfolio_api.py | NikolayXHD/tinkoff-api-python | 4a4b71f7af1d752b8566299c058b712b513fa92f | [
"MIT"
] | null | null | null | api/portfolio_api.py | NikolayXHD/tinkoff-api-python | 4a4b71f7af1d752b8566299c058b712b513fa92f | [
"MIT"
] | null | null | null | api/portfolio_api.py | NikolayXHD/tinkoff-api-python | 4a4b71f7af1d752b8566299c058b712b513fa92f | [
"MIT"
] | null | null | null | from __future__ import annotations
from ..api_client import ApiClient
from .. import models
class PortfolioApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def portfolio_currencies_get(self, **kwargs):
... | 31.210526 | 75 | 0.596332 |
98dd0a04dbbddadc483dbe6273676ab806fed36e | 2,907 | py | Python | OriginalRetroZoom/logger.py | letmaik/InnovationChallenge2021 | 4c32b450bcdd941ac32354bf20d426736b3bcbda | [
"MIT"
] | null | null | null | OriginalRetroZoom/logger.py | letmaik/InnovationChallenge2021 | 4c32b450bcdd941ac32354bf20d426736b3bcbda | [
"MIT"
] | null | null | null | OriginalRetroZoom/logger.py | letmaik/InnovationChallenge2021 | 4c32b450bcdd941ac32354bf20d426736b3bcbda | [
"MIT"
] | 1 | 2021-03-07T12:30:34.000Z | 2021-03-07T12:30:34.000Z | import datetime
import json
import os
import time
import math
ISO_8601 = '%Y-%m-%d %H:%M:%S.%f'
class Logger:
def __init__(self, limt=.25):
self.time_data = {'Daily_limt': limt*60, 'Start_Date_Time': None,
'End_Date_Time': None, 'Time_Spent': 0}
self.emotion_data = {
... | 36.797468 | 86 | 0.585139 |
378764d87f4d3e638f2ba2cd0d389a8e1d5bd3d6 | 2,172 | py | Python | docs/tutorials/v/symplot.py | seshasaibehara/multishifter | a2f533d22886973ae0bb85201e36c5e691c627fc | [
"MIT"
] | 19 | 2019-01-31T21:38:01.000Z | 2021-11-23T09:47:17.000Z | docs/tutorials/v/symplot.py | seshasaibehara/multishifter | a2f533d22886973ae0bb85201e36c5e691c627fc | [
"MIT"
] | 2 | 2019-07-27T01:38:04.000Z | 2020-12-04T02:54:58.000Z | docs/tutorials/v/symplot.py | seshasaibehara/multishifter | a2f533d22886973ae0bb85201e36c5e691c627fc | [
"MIT"
] | 3 | 2020-10-17T23:06:01.000Z | 2022-01-18T14:31:44.000Z | import json
import os
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
font = {'family' : 'normal',
'size' : 16}
matplotlib.rc('font', **font)
def load_record(record_file):
with open(record_file) as f:
records = json.load(f)
return records
def write_... | 26.487805 | 88 | 0.669429 |
37bd5421e615732f0a48dbc5432fed39c925cff3 | 10,298 | py | Python | bdssnmpadaptor/mapping_modules/fwdd_global_interface_physical_statistics.py | NidoriNet/bdsSnmpAdaptor | 0b3be71fe31dd05f1a049114a0782190bae5ee48 | [
"BSD-2-Clause"
] | 1 | 2019-07-09T12:33:29.000Z | 2019-07-09T12:33:29.000Z | bdssnmpadaptor/mapping_modules/fwdd_global_interface_physical_statistics.py | NidoriNet/bdsSnmpAdaptor | 0b3be71fe31dd05f1a049114a0782190bae5ee48 | [
"BSD-2-Clause"
] | 27 | 2019-03-14T21:50:56.000Z | 2019-07-09T13:38:29.000Z | bdssnmpadaptor/mapping_modules/fwdd_global_interface_physical_statistics.py | NidoriNet/bdsSnmpAdaptor | 0b3be71fe31dd05f1a049114a0782190bae5ee48 | [
"BSD-2-Clause"
] | 1 | 2019-07-09T12:28:08.000Z | 2019-07-09T12:28:08.000Z | # -*- coding: future_fstrings -*-
#
# This file is part of bdsSnmpAdaptor software.
#
# Copyright (C) 2017-2019, RtBrick Inc
# License: BSD License 2.0
#
import binascii
import struct
import time
from bdssnmpadaptor import if_tools
HEX_STRING_LAMBDA = lambda x: int(x, 16)
LELL_LAMBDA = lambda x: int(
struct.Stru... | 46.179372 | 84 | 0.667508 |
8fc0af0e3ca210af1ea8f2653767df4817cc2d04 | 13,899 | py | Python | nnabla_rl/model_trainers/policy/trpo_policy_trainer.py | sony/nnabla-rl | 6a9a91ac5363b8611e0c9f736590729952a8d460 | [
"Apache-2.0"
] | 75 | 2021-06-14T02:35:19.000Z | 2022-03-23T04:30:24.000Z | nnabla_rl/model_trainers/policy/trpo_policy_trainer.py | sony/nnabla-rl | 6a9a91ac5363b8611e0c9f736590729952a8d460 | [
"Apache-2.0"
] | 2 | 2021-12-17T08:46:54.000Z | 2022-03-15T02:04:53.000Z | nnabla_rl/model_trainers/policy/trpo_policy_trainer.py | sony/nnabla-rl | 6a9a91ac5363b8611e0c9f736590729952a8d460 | [
"Apache-2.0"
] | 3 | 2021-06-15T13:32:57.000Z | 2022-03-25T16:53:14.000Z | # Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 46.48495 | 113 | 0.711706 |
b4289aa0f12e1bb4d0b95ba9002649583ed6bd68 | 751 | py | Python | src/my_rshine/urls.py | zainab66/rshine-django | af02f26a4ad3a578db126ea7ae5bc45f288da302 | [
"bzip2-1.0.6"
] | null | null | null | src/my_rshine/urls.py | zainab66/rshine-django | af02f26a4ad3a578db126ea7ae5bc45f288da302 | [
"bzip2-1.0.6"
] | null | null | null | src/my_rshine/urls.py | zainab66/rshine-django | af02f26a4ad3a578db126ea7ae5bc45f288da302 | [
"bzip2-1.0.6"
] | null | null | null | """my_rshine URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 34.136364 | 77 | 0.70972 |
1d8b87a25bcffa02a596aae5b84439715c00f584 | 4,701 | py | Python | SVM/svm.py | Sh-Zh-7/AI-Term-Project | b0b396a2673721b943f05ae562af480bce4edf2e | [
"MIT"
] | 1 | 2021-12-06T09:12:06.000Z | 2021-12-06T09:12:06.000Z | SVM/svm.py | Sh-Zh-7/hands-on-digits-recognizer | b0b396a2673721b943f05ae562af480bce4edf2e | [
"MIT"
] | null | null | null | SVM/svm.py | Sh-Zh-7/hands-on-digits-recognizer | b0b396a2673721b943f05ae562af480bce4edf2e | [
"MIT"
] | null | null | null | from svmlib import *
from os import listdir
# Convert matrix to vector
def Img2Vector(filename):
# Return matrix
ret_val = np.zeros((1, 1024))
# Read file's content
file = open(filename)
content = file.readlines()
for i in range(32):
line = content[i]
for j in range(32):
... | 34.566176 | 114 | 0.616677 |
e78c32a0fdb34d8a128914f74f085e064add3058 | 3,397 | py | Python | vmraid/patches/v4_1/file_manager_fix.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | vmraid/patches/v4_1/file_manager_fix.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | vmraid/patches/v4_1/file_manager_fix.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, VMRaid Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import vmraid
import os
from vmraid.core.doctype.file.file import get_content_hash, get_file_name
from vmraid.utils import get_files_path, get_site_path
# The fi... | 33.303922 | 108 | 0.723874 |
d8aadb78183785051a07792b02c758b4895ee861 | 380 | py | Python | tests/test_openmc_integration.py | open-radiation-sources/parametric-plasma-source | f72ed2d5929fa88e45a4124289355955947f6ba0 | [
"MIT"
] | 6 | 2020-11-26T11:54:15.000Z | 2022-03-31T14:52:52.000Z | tests/test_openmc_integration.py | open-radiation-sources/parametric-plasma-source | f72ed2d5929fa88e45a4124289355955947f6ba0 | [
"MIT"
] | 27 | 2020-10-21T08:30:02.000Z | 2022-01-14T22:17:10.000Z | tests/test_openmc_integration.py | open-radiation-sources/parametric-plasma-source | f72ed2d5929fa88e45a4124289355955947f6ba0 | [
"MIT"
] | 3 | 2020-10-21T08:07:54.000Z | 2020-11-10T13:40:58.000Z | """Test sampling via OpenMC."""
import pytest
from parametric_plasma_source import sample_source_openmc
pytest.importorskip("openmc")
class TestOpenMCIntegration:
def test_openmc_integration(self, plasma_source):
out = sample_source_openmc(plasma_source)
assert out.stderr is None
assert... | 25.333333 | 73 | 0.755263 |
c7307dd4449e4a46386287c92da608e2421fce4f | 693 | py | Python | lib/inputstreamhelper/unicodes.py | tmihai20/script.module.inputstreamhelper | 25171444b48d85a1559ea5d2a8337f5ae8e66836 | [
"MIT"
] | null | null | null | lib/inputstreamhelper/unicodes.py | tmihai20/script.module.inputstreamhelper | 25171444b48d85a1559ea5d2a8337f5ae8e66836 | [
"MIT"
] | null | null | null | lib/inputstreamhelper/unicodes.py | tmihai20/script.module.inputstreamhelper | 25171444b48d85a1559ea5d2a8337f5ae8e66836 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MIT License (see LICENSE.txt or https://opensource.org/licenses/MIT)
"""Implements Unicode Helper functions"""
from __future__ import absolute_import, division, unicode_literals
def to_unicode(text, encoding='utf-8', errors='strict'):
"""Force text to unicode"""
if isinstance(text, b... | 34.65 | 135 | 0.704185 |
93da49526ae89f6c8eb4a0d7258d43ebf444fc45 | 3,356 | py | Python | spikey/snn/input/rbf.py | SpikeyCNS/spikey | 03a49073491974eff01bc017fd8eadb822e13f0d | [
"MIT"
] | 4 | 2021-02-25T20:53:41.000Z | 2022-01-18T15:27:07.000Z | spikey/snn/input/rbf.py | SpikeyCNS/spikey | 03a49073491974eff01bc017fd8eadb822e13f0d | [
"MIT"
] | 5 | 2021-03-06T05:35:10.000Z | 2021-03-31T09:27:57.000Z | spikey/snn/input/rbf.py | SpikeyCNS/spikey | 03a49073491974eff01bc017fd8eadb822e13f0d | [
"MIT"
] | null | null | null | """
Network input dynamics.
"""
import numpy as np
from spikey.snn.input.template import Input
class RBF(Input):
"""
Radial basis function neurons to simulate place cells.
Parameters
----------
kwargs: dict
Dictionary with values for each key in NECESSARY_KEYS.
Examples
--------... | 26.634921 | 83 | 0.480036 |
5a39b9c92f988a32ee04e23f11eb844e44ef822d | 4,427 | py | Python | vistrails/core/data_structures/bijectivedict.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 83 | 2015-01-05T14:50:50.000Z | 2021-09-17T19:45:26.000Z | vistrails/core/data_structures/bijectivedict.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 254 | 2015-01-02T20:39:19.000Z | 2018-11-28T17:16:44.000Z | vistrails/core/data_structures/bijectivedict.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 40 | 2015-04-17T16:46:36.000Z | 2021-09-28T22:43:24.000Z | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | 34.317829 | 79 | 0.607635 |
ad4e19e3cf59e1d124f90db050e14c4ee92cb1f4 | 2,206 | py | Python | mods/sky/satellites.py | healeycodes/pi | 7288186c8529b2192eda0da8e1699c59702cb230 | [
"MIT"
] | 26 | 2021-05-09T17:11:16.000Z | 2021-12-05T20:49:49.000Z | mods/sky/satellites.py | healeycodes/pi | 7288186c8529b2192eda0da8e1699c59702cb230 | [
"MIT"
] | null | null | null | mods/sky/satellites.py | healeycodes/pi | 7288186c8529b2192eda0da8e1699c59702cb230 | [
"MIT"
] | 1 | 2021-06-25T12:51:03.000Z | 2021-06-25T12:51:03.000Z | from server.db import get_db, FORMAT_STRING as F
from datetime import datetime
from dataclasses import dataclass
# https://en.wikipedia.org/wiki/List_of_GPS_satellites
PRN_DESCRIPTIONS = {
"13": "USA-132",
"20": "USA-150",
"28": "USA-151",
"16": "USA-166",
"21": "USA-168",
"22": "USA-175",
... | 25.952941 | 108 | 0.547144 |
1894f3f128bb8c15c8cf4789dd1245a09df01275 | 165 | py | Python | vrft/__init__.py | emersonboeira/pyvrft | d61d2789169435600833111a9fb0ad5573e26922 | [
"MIT"
] | 8 | 2019-09-08T17:22:03.000Z | 2021-07-02T09:05:28.000Z | vrft/__init__.py | ElsevierSoftwareX/SOFTX_2019_285 | f731541b2d6b6270c7987b08ee6c90d662a53a4c | [
"MIT"
] | null | null | null | vrft/__init__.py | ElsevierSoftwareX/SOFTX_2019_285 | f731541b2d6b6270c7987b08ee6c90d662a53a4c | [
"MIT"
] | 2 | 2019-09-08T17:38:50.000Z | 2019-12-13T15:41:50.000Z | from vrft.control import design
from vrft.control import filter
from vrft.invfunc import stbinv
from vrft.invfunc import mtf2ss
from vrft.csvfunc import datafromcsv
| 27.5 | 36 | 0.848485 |
43a547f1594bc523a4375a4e06759250ea5a9725 | 2,021 | py | Python | tests/test_utils.py | kruupos/http_monitor | a56bec016db68f1a76835aff6b8f57975715c28e | [
"MIT"
] | null | null | null | tests/test_utils.py | kruupos/http_monitor | a56bec016db68f1a76835aff6b8f57975715c28e | [
"MIT"
] | 7 | 2018-10-15T14:15:26.000Z | 2018-10-17T18:08:42.000Z | tests/test_utils.py | kruupos/sniwi | a56bec016db68f1a76835aff6b8f57975715c28e | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Test utils functions
"""
import pytest
from collections import defaultdict
from sniwi.utils import top_three, get_section
class TestUtils(object):
"""
Test utils functions
"""
@pytest.mark.parametrize('in_dict,out_list,explanation', [
(
{'max': 20, 'a... | 28.871429 | 92 | 0.503711 |
e324343fbbccca7322d0749b008bb5bcb6b0d790 | 89 | py | Python | junn/io/__init__.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | junn/io/__init__.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | junn/io/__init__.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | """Input/output module."""
REGION_BACKGROUND = 0
REGION_FOREGROUND = 1
REGION_BORDER = 2
| 17.8 | 26 | 0.752809 |
d1be58d3479ac89b721c20c6a65233650de205a1 | 1,163 | py | Python | meiduo_mall/meiduo_mall/apps/oauth/migrations/0001_initial.py | TCYhupo/MeiduoMall | ac810a2c95058cc052057722088a209363940331 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/oauth/migrations/0001_initial.py | TCYhupo/MeiduoMall | ac810a2c95058cc052057722088a209363940331 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/oauth/migrations/0001_initial.py | TCYhupo/MeiduoMall | ac810a2c95058cc052057722088a209363940331 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2020-07-30 04:01
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 35.242424 | 137 | 0.614789 |
ae1f68b61b69ae6b1bf484600b3be4cc8bbd235c | 7,322 | py | Python | 基础教程/A2-神经网络基本原理/第6步 - 模型部署/src/ch13-ModelInference/ONNXConverter/transfer.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 11,094 | 2019-05-07T02:48:50.000Z | 2022-03-31T08:49:42.000Z | 基础教程/A2-神经网络基本原理/第6步 - 模型部署/src/ch13-ModelInference/ONNXConverter/transfer.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 157 | 2019-05-13T15:07:19.000Z | 2022-03-23T08:52:32.000Z | 基础教程/A2-神经网络基本原理/第6步 - 模型部署/src/ch13-ModelInference/ONNXConverter/transfer.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 2,412 | 2019-05-07T02:55:15.000Z | 2022-03-30T06:56:52.000Z | import onnx
from onnx import helper, numpy_helper
from onnx import AttributeProto, TensorProto, GraphProto
import argparse
import json
import numpy as np
# 将numpy生成的model转换为onnx格式
def ModelTransfer(model_path, output_path):
# 读取模型文件,该模型文件存储各层类型和名称,以及参数存储位置
with open(model_path, "r") as f:
model_d... | 32.39823 | 128 | 0.452745 |
21be8b0bda40ef6ccea3620e777ae999b40e191d | 3,129 | py | Python | tests/wallet/rl_wallet/test_rl_wallet.py | greenberrycoin/gbch-blockchain | d99843d720c6e7bd7baaf8bb4639a46dbb56caed | [
"Apache-2.0"
] | null | null | null | tests/wallet/rl_wallet/test_rl_wallet.py | greenberrycoin/gbch-blockchain | d99843d720c6e7bd7baaf8bb4639a46dbb56caed | [
"Apache-2.0"
] | null | null | null | tests/wallet/rl_wallet/test_rl_wallet.py | greenberrycoin/gbch-blockchain | d99843d720c6e7bd7baaf8bb4639a46dbb56caed | [
"Apache-2.0"
] | null | null | null | import asyncio
import pytest
from greenberry.simulator.simulator_protocol import FarmNewBlockProtocol
from greenberry.types.peer_info import PeerInfo
from greenberry.util.ints import uint16, uint64
from greenberry.wallet.rl_wallet.rl_wallet import RLWallet
from tests.setup_nodes import self_hostname, setup_simulators... | 36.383721 | 105 | 0.713966 |
b6c9a6915780711ba21586b65cbcc0bd8e1f5976 | 1,469 | py | Python | src/pl_data/CustomDataLoader.py | mikcnt/dlai-project | 56fa0d1e682d07cd89cb011400b0a4ef92ec9265 | [
"MIT"
] | 3 | 2021-09-09T20:23:35.000Z | 2022-01-23T22:29:49.000Z | src/pl_data/CustomDataLoader.py | mikcnt/dlai-project | 56fa0d1e682d07cd89cb011400b0a4ef92ec9265 | [
"MIT"
] | null | null | null | src/pl_data/CustomDataLoader.py | mikcnt/dlai-project | 56fa0d1e682d07cd89cb011400b0a4ef92ec9265 | [
"MIT"
] | null | null | null | import torch
from torch.utils.data import RandomSampler
class CustomDataLoader(object):
def __init__(self, dataset, batch_size, shuffle=False, drop_last=False):
self.dataset = dataset
self.batch_size = batch_size
self.drop_last = drop_last
if shuffle:
self.sampler = Ran... | 34.97619 | 76 | 0.504425 |
ad2ee5906fa89b01bcaa0b8a3d299b7c25238456 | 663 | py | Python | manas_apps/users/tests/test_drf_urls.py | pymandes/manas_apps | dfe5ff1e21d92953360dcfbee9b6070269458027 | [
"MIT"
] | null | null | null | manas_apps/users/tests/test_drf_urls.py | pymandes/manas_apps | dfe5ff1e21d92953360dcfbee9b6070269458027 | [
"MIT"
] | null | null | null | manas_apps/users/tests/test_drf_urls.py | pymandes/manas_apps | dfe5ff1e21d92953360dcfbee9b6070269458027 | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from manas_apps.users.models import User
pytestmark = pytest.mark.django_db
def test_user_detail(user: User):
assert (
reverse("api:user-detail", kwargs={"username": user.username})
== f"/api/users/{user.username}/"
)
assert resolve(... | 26.52 | 81 | 0.669683 |
364af6c64613560c0b831324ce1f94fcd3d3c4eb | 657 | py | Python | src/libs/core/options/config.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | src/libs/core/options/config.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | src/libs/core/options/config.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "29/10/17 20:42"
#: Options functions which may be registered
OPTION_CLASS_FUNCTIONS_TO_RE... | 38.647059 | 62 | 0.491629 |
f53ab95ba18eaa86602280e8281bc1cef1559de4 | 1,981 | py | Python | yasql/apps/sqlorders/admin.py | Fanduzi/YaSQL | bc6366a9b1c1e9ed84fd24ea2b4a21f8f99d0af5 | [
"Apache-2.0"
] | 443 | 2018-02-08T02:53:48.000Z | 2020-10-13T10:01:55.000Z | yasql/apps/sqlorders/admin.py | Fanduzi/YaSQL | bc6366a9b1c1e9ed84fd24ea2b4a21f8f99d0af5 | [
"Apache-2.0"
] | 27 | 2018-03-06T03:50:07.000Z | 2020-08-18T08:09:49.000Z | yasql/apps/sqlorders/admin.py | Fanduzi/YaSQL | bc6366a9b1c1e9ed84fd24ea2b4a21f8f99d0af5 | [
"Apache-2.0"
] | 148 | 2018-03-15T06:07:25.000Z | 2020-08-17T14:58:45.000Z | from django.contrib import admin
# Register your models here.
from sqlorders import models
@admin.register(models.DbConfig)
class DbConfigAdmin(admin.ModelAdmin):
list_display = ('host', 'port', 'character', 'env', 'use_type', 'rds_type', 'rds_category', 'comment')
list_display_links = ('host',)
list_fil... | 38.096154 | 114 | 0.67895 |
ea30832746c18d7113145f8404d88b79e5b7389f | 16,155 | py | Python | 4-Lastnosti Fourirjeve Analize-zapiskiWV/ukazi.py | LoremasterLH/MatlabToPython | bdfd827d7fc143332e3945fc980e915c6324eb6c | [
"MIT"
] | 2 | 2018-11-05T12:55:42.000Z | 2018-11-20T11:00:43.000Z | 4-Lastnosti Fourirjeve Analize-zapiskiWV/ukazi.py | LoremasterLH/MatlabToPython | bdfd827d7fc143332e3945fc980e915c6324eb6c | [
"MIT"
] | null | null | null | 4-Lastnosti Fourirjeve Analize-zapiskiWV/ukazi.py | LoremasterLH/MatlabToPython | bdfd827d7fc143332e3945fc980e915c6324eb6c | [
"MIT"
] | 1 | 2018-11-20T13:15:09.000Z | 2018-11-20T13:15:09.000Z | # Author: Martin Konečnik
# Contact: martin.konecnik@gmail.com
# Licenced under MIT
# 4- Lastnosti Fourirjeve Analize
# Potrebna ročna inštalacija knjižnice pytftb (najlažje z git): https://github.com/scikit-signal/pytftb
import numpy as np
from scipy.signal import convolve2d as conv2
from scipy.signal.windows import ... | 33.516598 | 163 | 0.640111 |
71a398e1f760812592a4ecc5f7fd42bc9da70272 | 20,183 | py | Python | envoy/tests/test_parser.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | 1 | 2021-01-28T01:45:37.000Z | 2021-01-28T01:45:37.000Z | envoy/tests/test_parser.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | 3 | 2021-01-27T04:56:40.000Z | 2021-02-26T06:29:22.000Z | envoy/tests/test_parser.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T13:35:17.000Z | 2019-12-23T13:35:17.000Z | import pytest
from datadog_checks.envoy.errors import UnknownMetric, UnknownTags
from datadog_checks.envoy.metrics import METRIC_PREFIX, METRICS
from datadog_checks.envoy.parser import parse_histogram, parse_metric
def test_unknown_metric():
with pytest.raises(UnknownMetric):
parse_metric('foo.bar')
de... | 34.092905 | 103 | 0.635337 |
09f0149d61be7a0492986a2458d82fc40c56f1c6 | 3,966 | py | Python | volume-count.py | mJace/scope-volume-count | ba61e744dfe1246fafa623b836863101b4f535a6 | [
"Apache-2.0"
] | 6 | 2016-12-15T20:11:50.000Z | 2020-12-22T06:57:00.000Z | volume-count.py | mJace/scope-volume-count | ba61e744dfe1246fafa623b836863101b4f535a6 | [
"Apache-2.0"
] | 3 | 2018-02-22T09:20:20.000Z | 2019-04-30T21:09:37.000Z | volume-count.py | mJace/scope-volume-count | ba61e744dfe1246fafa623b836863101b4f535a6 | [
"Apache-2.0"
] | 12 | 2017-05-27T07:12:51.000Z | 2021-06-02T05:05:59.000Z | #!/usr/bin/env python
from docker import Client
import BaseHTTPServer
import SocketServer
import datetime
import errno
import json
import os
import signal
import socket
import threading
import time
import urllib2
PLUGIN_ID="volume-count"
PLUGIN_UNIX_SOCK="/var/run/scope/plugins/" + PLUGIN_ID + ".sock"
DOCKER_SOCK="un... | 28.328571 | 87 | 0.56001 |
67c2c764983b053629a7401a57cad505a5f628db | 3,868 | py | Python | Streamlit/models/model.py | Tanmay000009/WeCare4u-1 | bfd3c98a99558bdb21ef678a09992d373861e30f | [
"MIT"
] | null | null | null | Streamlit/models/model.py | Tanmay000009/WeCare4u-1 | bfd3c98a99558bdb21ef678a09992d373861e30f | [
"MIT"
] | null | null | null | Streamlit/models/model.py | Tanmay000009/WeCare4u-1 | bfd3c98a99558bdb21ef678a09992d373861e30f | [
"MIT"
] | 5 | 2021-03-28T03:30:54.000Z | 2022-02-25T10:26:33.000Z | import pandas as pandas
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
import pickle
from sklearn.linear_model import SGDRegressor
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
def data_loader(fil... | 42.043478 | 156 | 0.719752 |
7fcae525a0afc533286efc8b54ec61e2aba24255 | 1,321 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/subsets.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/subsets.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/subsets.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n * 2^n)
# Space: O(1)
class Solution(object):
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
nums.sort()
result = [[]]
for i in xrange(len(nums)):
size = len(result)
for j in xrange(size):
... | 22.016667 | 92 | 0.4595 |
dde8e9ea0c613204fbe8128eb3cb921b53fb1ad7 | 373 | py | Python | blog/migrations/0026_image_dislikes.py | lorrainekamanda/awwardsdjango | e8827f93bcef1fa7a3926690d4eaf8b4bddca86f | [
"MIT"
] | null | null | null | blog/migrations/0026_image_dislikes.py | lorrainekamanda/awwardsdjango | e8827f93bcef1fa7a3926690d4eaf8b4bddca86f | [
"MIT"
] | 8 | 2021-03-19T04:46:04.000Z | 2021-09-22T19:11:11.000Z | blog/migrations/0026_image_dislikes.py | lorrainekamanda/awwardsdjango | e8827f93bcef1fa7a3926690d4eaf8b4bddca86f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-02 06:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0025_preference'),
]
operations = [
migrations.AddField(
model_name='image',
name='dislikes',
fi... | 19.631579 | 49 | 0.58445 |
5a3d0f55c83b42fa77bbab10cbc54deb1984a93a | 1,105 | py | Python | src/combustion/points/__init__.py | TidalPaladin/combustion | 69b9a2b9baf90b81ed9098b4f0391f5c15efaee7 | [
"Apache-2.0"
] | 3 | 2020-07-09T22:18:19.000Z | 2021-11-08T03:47:19.000Z | src/combustion/points/__init__.py | TidalPaladin/combustion | 69b9a2b9baf90b81ed9098b4f0391f5c15efaee7 | [
"Apache-2.0"
] | 15 | 2020-06-12T21:48:59.000Z | 2022-02-05T18:41:50.000Z | src/combustion/points/__init__.py | TidalPaladin/combustion | 69b9a2b9baf90b81ed9098b4f0391f5c15efaee7 | [
"Apache-2.0"
] | 1 | 2021-02-15T20:06:16.000Z | 2021-02-15T20:06:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Tuple
from torch import Tensor
from .crop import CenterCrop, center_crop
from .transforms import RandomRotate, Rotate, center, random_rotate, rotate
# torch-scatter doesn't install correctly unless combustion[points] is installed after combustion
try... | 27.625 | 118 | 0.717647 |
a801305f175ac582fe740886439647c74d685455 | 4,335 | py | Python | tests/utils_tests/test_feedgenerator.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 1 | 2019-03-14T03:06:49.000Z | 2019-03-14T03:06:49.000Z | tests/utils_tests/test_feedgenerator.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | null | null | null | tests/utils_tests/test_feedgenerator.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils import tzinfo
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
"""
Test... | 35.826446 | 143 | 0.62699 |
2adb6bbcef00d71779348d1cf1da67edc221fdd3 | 379 | py | Python | customer/migrations/0002_alter_customer_mobile.py | Ravi903132/Event | f75a6397de3ed1af1132fc9fb814b96bbf4fdd86 | [
"MIT"
] | null | null | null | customer/migrations/0002_alter_customer_mobile.py | Ravi903132/Event | f75a6397de3ed1af1132fc9fb814b96bbf4fdd86 | [
"MIT"
] | null | null | null | customer/migrations/0002_alter_customer_mobile.py | Ravi903132/Event | f75a6397de3ed1af1132fc9fb814b96bbf4fdd86 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2022-04-10 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='customer',
name='mobile',
... | 19.947368 | 50 | 0.591029 |
754c595a41b5fd45ec05f6d4c981ab780c9b01b0 | 576 | py | Python | drf_mapped_choice/fields.py | claytondaley/drf-mapped-choice | d228df6c004de93069536e49ce1afb52b09fcca2 | [
"Apache-2.0"
] | null | null | null | drf_mapped_choice/fields.py | claytondaley/drf-mapped-choice | d228df6c004de93069536e49ce1afb52b09fcca2 | [
"Apache-2.0"
] | null | null | null | drf_mapped_choice/fields.py | claytondaley/drf-mapped-choice | d228df6c004de93069536e49ce1afb52b09fcca2 | [
"Apache-2.0"
] | null | null | null | from rest_framework import fields, serializers
class MappedChoiceField(fields.ChoiceField):
@serializers.ChoiceField.choices.setter
def choices(self, choices):
self.grouped_choices = fields.to_choices_dict(choices)
self._choices = fields.flatten_choices_dict(self.grouped_choices)
self... | 33.882353 | 80 | 0.692708 |
568a1ddf9caffe5cfda7ae49f315aede5c8a70ac | 681 | py | Python | mainapp/migrations/0014_auto_20181020_1101.py | ploggingdev/hackerschat | f6d881e7bed0e634e9db6e788befa990ac581bbd | [
"MIT"
] | 3 | 2018-01-24T09:42:22.000Z | 2018-09-28T18:52:01.000Z | mainapp/migrations/0014_auto_20181020_1101.py | ploggingdev/hackerschat | f6d881e7bed0e634e9db6e788befa990ac581bbd | [
"MIT"
] | 6 | 2020-02-11T22:02:02.000Z | 2022-02-11T03:39:46.000Z | mainapp/migrations/0014_auto_20181020_1101.py | ploggingdev/hackerschat | f6d881e7bed0e634e9db6e788befa990ac581bbd | [
"MIT"
] | 3 | 2018-02-03T16:35:54.000Z | 2019-04-09T16:10:20.000Z | # Generated by Django 2.1.2 on 2018-10-20 11:01
from django.db import migrations
def set_room_position_value(apps, schema_editor):
Topic = apps.get_model('mainapp', 'Topic')
Room = apps.get_model('mainapp', 'Room')
for topic in Topic.objects.all():
if Room.objects.filter(name="off-topic", topic=t... | 28.375 | 75 | 0.660793 |
c174bbf8c701f6dab10a1cd948f7dba3c0274801 | 527 | py | Python | pro1/users/migrations/0002_auto_20181103_0240.py | BhanuPrakashNani/StudentPortal | 689f12e693c01b5f78e8acee7e77b390434ae047 | [
"MIT"
] | 9 | 2018-12-03T12:51:25.000Z | 2018-12-19T23:43:07.000Z | pro1/users/migrations/0002_auto_20181103_0240.py | BhanuPrakashNani/StudentPortal | 689f12e693c01b5f78e8acee7e77b390434ae047 | [
"MIT"
] | 97 | 2018-11-17T18:34:18.000Z | 2018-12-29T15:34:50.000Z | pro1/users/migrations/0002_auto_20181103_0240.py | itsvrushabh/StudentPortal | e10f2aa7b8da021ae8a285160f64695ad5bc7a72 | [
"MIT"
] | 34 | 2018-12-01T16:30:09.000Z | 2019-01-09T16:51:04.000Z | # Generated by Django 2.1.3 on 2018-11-02 21:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='profile',
name='bio',
),
migra... | 20.269231 | 47 | 0.533207 |
9bd29bf276326c7e8039b0a80b6a48ebed1a1c6a | 2,770 | py | Python | examples/Website_Copy/run_meta_descript.py | paigebranam/Halldon_ | 1f02878e39e818055f86b8db570f30ae280948dc | [
"MIT"
] | null | null | null | examples/Website_Copy/run_meta_descript.py | paigebranam/Halldon_ | 1f02878e39e818055f86b8db570f30ae280948dc | [
"MIT"
] | null | null | null | examples/Website_Copy/run_meta_descript.py | paigebranam/Halldon_ | 1f02878e39e818055f86b8db570f30ae280948dc | [
"MIT"
] | null | null | null | ##updated api path, engine, top p, updated top p, temp, and tokens.
##Runs as expected
##must enter product and a descript.
import os
import sys
API_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
sys.path.append(API_PATH)
from api import GPT, Example, UIConfig
# Construct GPT object... | 41.969697 | 144 | 0.746209 |
d26dcbb764f9ac5c9eeaacbd34759c186bcc8cca | 3,983 | py | Python | app/run.py | dibakart4/Disaster-Response-Pipeline | 82022e11f891e9b6f0dff7f5b88cc3c6aa54dbac | [
"MIT"
] | 9 | 2020-07-27T16:37:38.000Z | 2022-02-21T22:16:38.000Z | app/run.py | nkreimold/udacity-disaster-response-pipeline | 6aaa971f274bbd4bed992516b438ad4607faf0ca | [
"MIT"
] | null | null | null | app/run.py | nkreimold/udacity-disaster-response-pipeline | 6aaa971f274bbd4bed992516b438ad4607faf0ca | [
"MIT"
] | 50 | 2020-05-12T18:14:32.000Z | 2022-02-28T21:27:31.000Z | import json
import plotly
import pandas as pd
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk import pos_tag, word_tokenize
import nltk
from sklearn.base import BaseEstimator, TransformerMixin
from flask import Flask
from flask import render_template, request,... | 27.095238 | 77 | 0.581471 |
65359c5bdc4947753ef44532eaeee51e9c7f6ba5 | 8,315 | py | Python | main.py | jimgoo/pytorch-a2c-ppo-acktr | c6e12ecc113bed6607f00ddaec8e416ee5900454 | [
"MIT"
] | null | null | null | main.py | jimgoo/pytorch-a2c-ppo-acktr | c6e12ecc113bed6607f00ddaec8e416ee5900454 | [
"MIT"
] | null | null | null | main.py | jimgoo/pytorch-a2c-ppo-acktr | c6e12ecc113bed6607f00ddaec8e416ee5900454 | [
"MIT"
] | null | null | null | import copy
import glob
import os
import time
from collections import deque
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from a2c_ppo_acktr import algo
from a2c_ppo_acktr.arguments import get_args
from a2c_ppo_acktr.envs import make_vec_e... | 38.317972 | 152 | 0.584967 |
cad4ab4a1d072f518237d50e751c099ea4e862f7 | 2,824 | py | Python | trackpoint-speedup.py | omakoto/key-remapper | 6baf0cfdc87411c0cab1df69c303b8ad50acd406 | [
"MIT"
] | null | null | null | trackpoint-speedup.py | omakoto/key-remapper | 6baf0cfdc87411c0cab1df69c303b8ad50acd406 | [
"MIT"
] | null | null | null | trackpoint-speedup.py | omakoto/key-remapper | 6baf0cfdc87411c0cab1df69c303b8ad50acd406 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
#
# Remapper for https://www.amazon.com/gp/product/B00RM75NL0
#
import math
import os
import sys
import evdev
from evdev import ecodes, InputEvent
import key_remapper
NAME = "Trackpoint Spped-up"
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
ICON = os.path.join(SCRIPT_PATH, 'res/trackp... | 32.090909 | 109 | 0.600921 |
f21d144c4b637aea62a9a8ed26a70ea9225ac40e | 835 | py | Python | python/mxnet/ndarray/contrib.py | saurabh3949/mxnet | e25074a469b45f2cbde68e2a0c8963daea93b66b | [
"Apache-2.0"
] | 4 | 2017-11-17T07:28:09.000Z | 2019-07-23T06:24:16.000Z | python/mxnet/ndarray/contrib.py | saurabh3949/mxnet | e25074a469b45f2cbde68e2a0c8963daea93b66b | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/contrib.py | saurabh3949/mxnet | e25074a469b45f2cbde68e2a0c8963daea93b66b | [
"Apache-2.0"
] | 2 | 2019-06-12T12:40:20.000Z | 2020-11-03T14:33:14.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.75 | 62 | 0.764072 |
3e469b5475bf01cbe44a4457a03d3239140e5b4c | 3,623 | py | Python | core/platform/taskqueue/cloud_taskqueue_services.py | jlau323/oppia | 37438a2c9bf7e66892fb9a6a93a1fe4ca7a82691 | [
"Apache-2.0"
] | 2 | 2021-04-08T01:06:08.000Z | 2021-06-02T08:20:13.000Z | core/platform/taskqueue/cloud_taskqueue_services.py | jlau323/oppia | 37438a2c9bf7e66892fb9a6a93a1fe4ca7a82691 | [
"Apache-2.0"
] | null | null | null | core/platform/taskqueue/cloud_taskqueue_services.py | jlau323/oppia | 37438a2c9bf7e66892fb9a6a93a1fe4ca7a82691 | [
"Apache-2.0"
] | 1 | 2020-12-11T06:56:31.000Z | 2020-12-11T06:56:31.000Z | # coding: utf-8
#
# Copyright 2020 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... | 36.23 | 79 | 0.686448 |
bb7b0cf6cb2c9c63741d8759262e92b543d7fb6b | 6,247 | py | Python | sample_imageinpainting_HiFill/GPU_CPU/HiFill_inpainting.py | Ehsan-Yaghoubi/You-Look-So-Different-Haven-t-I-Seen-You-a-Long-Time-Ago | 40cf189dd81f1b6048befadd1de895d8494c4635 | [
"MIT"
] | 1 | 2022-03-14T10:58:32.000Z | 2022-03-14T10:58:32.000Z | sample_imageinpainting_HiFill/GPU_CPU/HiFill_inpainting.py | Ehsan-Yaghoubi/You-Look-So-Different-Haven-t-I-Seen-You-a-Long-Time-Ago | 40cf189dd81f1b6048befadd1de895d8494c4635 | [
"MIT"
] | 1 | 2021-11-10T04:19:40.000Z | 2021-11-15T13:56:41.000Z | sample_imageinpainting_HiFill/GPU_CPU/HiFill_inpainting.py | Ehsan-Yaghoubi/You-Look-So-Different-Haven-t-I-Seen-You-a-Long-Time-Ago | 40cf189dd81f1b6048befadd1de895d8494c4635 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import tensorflow as tf
import glob
import argparse
import os
INPUT_SIZE = 512 # input image size for Generator
ATTENTION_SIZE = 32 # size of contextual attention
def sort(str_lst):
return [s for s in sorted(str_lst)]
# reconstruct residual from patches
def reconstruct_residual_f... | 38.325153 | 184 | 0.707059 |
5d7508d3b8628ae0b60757014857e6df5510f433 | 18,760 | py | Python | orttraining/orttraining/test/python/orttraining_test_ortmodule_bert_classifier.py | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 6,036 | 2019-05-07T06:03:57.000Z | 2022-03-31T17:59:54.000Z | orttraining/orttraining/test/python/orttraining_test_ortmodule_bert_classifier.py | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 5,730 | 2019-05-06T23:04:55.000Z | 2022-03-31T23:55:56.000Z | orttraining/orttraining/test/python/orttraining_test_ortmodule_bert_classifier.py | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 1,566 | 2019-05-07T01:30:07.000Z | 2022-03-31T17:06:50.000Z | import logging
import argparse
import torch
import wget
import os
import pandas as pd
import zipfile
from transformers import BertTokenizer, AutoConfig
from sklearn.model_selection import train_test_split
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from transformers import B... | 43.126437 | 164 | 0.644989 |
f43a9d893dcbc26036af6cc32f8507449ee4d374 | 10,994 | py | Python | tests/grid_test.py | fancompute/simphox | 917673cc3ef8fb54fcbbaaa93b8efdc09a8e3614 | [
"MIT"
] | 6 | 2021-08-31T16:20:33.000Z | 2021-12-27T18:04:52.000Z | tests/grid_test.py | fancompute/simphox | 917673cc3ef8fb54fcbbaaa93b8efdc09a8e3614 | [
"MIT"
] | 1 | 2021-08-29T21:09:30.000Z | 2021-08-29T21:17:47.000Z | tests/grid_test.py | fancompute/simphox | 917673cc3ef8fb54fcbbaaa93b8efdc09a8e3614 | [
"MIT"
] | null | null | null | import pytest
from typing import List, Tuple, Union, Optional
from simphox.typing import Shape, Size, Size2, Size3
from simphox.utils import TEST_ZERO, TEST_ONE, Box
from simphox.grid import Grid, YeeGrid
import numpy as np
@pytest.mark.parametrize(
"size, spacing, eps, expected_cell_sizes",
[
((2.5... | 38.575439 | 120 | 0.444151 |
4cd5566913e33ae0eff9977dd7eb3de158fee757 | 146 | py | Python | pymetricks/build/lib/py_admetricks/__init__.py | carlangastr/marketing-science-projects | 760b3c3e9fd9198805407f69a1f74e82d2446d1f | [
"MIT"
] | 2 | 2021-07-03T06:55:39.000Z | 2021-11-27T00:44:34.000Z | pymetricks/py_admetricks/__init__.py | carlangastr/marketing-science-projects | 760b3c3e9fd9198805407f69a1f74e82d2446d1f | [
"MIT"
] | 2 | 2021-06-09T21:00:01.000Z | 2021-06-10T03:53:20.000Z | pymetricks/py_admetricks/__init__.py | carlangastr/marketing-science-projects | 760b3c3e9fd9198805407f69a1f74e82d2446d1f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 10 00:36:16 2021
@author: Carlos Trujillo
"""
from py_admetricks.pymetricks import admetricks_api | 18.25 | 51 | 0.712329 |
abc0447e718114b9530f786a26f1c8573082e887 | 4,758 | py | Python | homeassistant/components/brother/sensor.py | ccatterina/core | 36789cfc310f270bf343676eb94d123e5d0dfa83 | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | homeassistant/components/brother/sensor.py | SicAriuSx83/core | 162c39258e68ae42fe4e1560ae91ed54f5662409 | [
"Apache-2.0"
] | 45 | 2020-10-15T06:47:06.000Z | 2022-03-31T06:26:16.000Z | homeassistant/components/brother/sensor.py | SicAriuSx83/core | 162c39258e68ae42fe4e1560ae91ed54f5662409 | [
"Apache-2.0"
] | 2 | 2020-11-17T09:19:47.000Z | 2020-12-16T03:56:09.000Z | """Support for the Brother service."""
from datetime import timedelta
import logging
from homeassistant.const import DEVICE_CLASS_TIMESTAMP
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util.dt import utcnow
from .const import (
ATTR_BLACK_DRUM_COUNTER,
ATTR_BLACK_D... | 32.589041 | 93 | 0.688104 |
bb1a98d4453974ec78bc83d6c7624d9e8f287710 | 1,428 | py | Python | eth/vm/execution_context.py | vovyl/py-evm | dc9c03bfee31aecd100c953e8777988d8b296bd8 | [
"MIT"
] | 1 | 2019-09-14T13:32:40.000Z | 2019-09-14T13:32:40.000Z | eth/vm/execution_context.py | vovyl/py-evm | dc9c03bfee31aecd100c953e8777988d8b296bd8 | [
"MIT"
] | null | null | null | eth/vm/execution_context.py | vovyl/py-evm | dc9c03bfee31aecd100c953e8777988d8b296bd8 | [
"MIT"
] | null | null | null | from typing import (
Iterable,
)
from eth_typing import (
Address,
Hash32,
)
from eth._utils.generator import CachedIterable
class ExecutionContext:
_coinbase = None
_timestamp = None
_number = None
_difficulty = None
_gas_limit = None
_prev_hashes = None
_chain_id = None
... | 21.313433 | 55 | 0.611345 |
0e626ae11bde8621e3dd7d10ba26311655be381c | 1,201 | py | Python | tests/test_of_types.py | hongquan/Defity | 9cfefb88ea3215b369e018b4f60a278ddd2927a6 | [
"Apache-2.0"
] | 12 | 2021-08-29T09:05:26.000Z | 2022-03-11T17:53:50.000Z | tests/test_of_types.py | hongquan/Defity | 9cfefb88ea3215b369e018b4f60a278ddd2927a6 | [
"Apache-2.0"
] | 1 | 2021-12-24T16:10:32.000Z | 2021-12-30T03:18:04.000Z | tests/test_of_types.py | hongquan/Defity | 9cfefb88ea3215b369e018b4f60a278ddd2927a6 | [
"Apache-2.0"
] | 3 | 2021-09-27T19:59:35.000Z | 2022-01-27T03:10:16.000Z | from pathlib import Path
import defity
DATA = Path(__file__).parent / 'data'
def test_single_type():
filepath = DATA / 'image.png'
mime = 'image/png'
matched = defity.is_file_of_type(filepath, mime)
assert matched
def test_not_match_single_type():
filepath = DATA / 'image.png'
mime = 'ima... | 24.02 | 67 | 0.685262 |
4f9be20f9f34a8d415f253c49d9993023d82309b | 6,621 | py | Python | helpers/emulator.py | Aayush9029/Kenobi-Server | 84581116eef3bbb15f28b2d03f49ed3deefff9c2 | [
"MIT"
] | 11 | 2021-11-21T20:06:21.000Z | 2021-12-05T13:44:30.000Z | helpers/emulator.py | Aayush9029/Kenobi-Server | 84581116eef3bbb15f28b2d03f49ed3deefff9c2 | [
"MIT"
] | 3 | 2021-11-22T00:55:37.000Z | 2021-11-27T17:39:19.000Z | helpers/emulator.py | Aayush9029/Kenobi-Server | 84581116eef3bbb15f28b2d03f49ed3deefff9c2 | [
"MIT"
] | 2 | 2021-11-21T23:44:39.000Z | 2021-11-23T03:17:33.000Z | """
File containing class which represents the emulator.
Controlling media, open apps and links, playing audio, etc is done here.
"""
import webbrowser
from subprocess import run
from os import system
from playsound import playsound
from pynput.keyboard import Controller, Key
from .operating_system import OperatingSy... | 30.232877 | 129 | 0.544027 |
5958b2ea202c2451244208607f683309d07ef65f | 4,303 | py | Python | examples/Arctic_HYCOM/get_hycom_GLBa0.08_ssh_2014.py | bilgetutak/pyroms | 3b0550f26f4ac181b7812e14a7167cd1ca0797f0 | [
"BSD-3-Clause"
] | 75 | 2016-04-05T07:15:57.000Z | 2022-03-04T22:49:54.000Z | examples/Arctic_HYCOM/get_hycom_GLBa0.08_ssh_2014.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 27 | 2017-02-26T04:27:49.000Z | 2021-12-01T17:26:56.000Z | examples/Arctic_HYCOM/get_hycom_GLBa0.08_ssh_2014.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 56 | 2016-05-11T06:19:14.000Z | 2022-03-22T19:04:17.000Z | import matplotlib
matplotlib.use('Agg')
import numpy as np
import netCDF4
from datetime import datetime
import pyroms
import pyroms_toolbox
import sys
def create_HYCOM_file(name, time, lon, lat, var):
#create netCDF file
nc = netCDF4.Dataset(name, 'w', format='NETCDF3_64BIT')
nc.Author = sys._getframe(... | 32.847328 | 126 | 0.64885 |
a1322c45f8087db6b1ecd39e7cf33fb7c84b02e9 | 2,410 | py | Python | Server/swaggerUI/swagger_server/test/test_default_controller.py | heartcase/ECE4564F17T6 | 98a3c548c1787b74ed50004451a82635fb3e05fe | [
"MIT"
] | null | null | null | Server/swaggerUI/swagger_server/test/test_default_controller.py | heartcase/ECE4564F17T6 | 98a3c548c1787b74ed50004451a82635fb3e05fe | [
"MIT"
] | null | null | null | Server/swaggerUI/swagger_server/test/test_default_controller.py | heartcase/ECE4564F17T6 | 98a3c548c1787b74ed50004451a82635fb3e05fe | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.parking_spot import ParkingSpot # noqa: E501
from swagger_server.models.user import User # noqa: E501
from swagger_server.test import BaseTestCase
class TestDefaultController(BaseTestC... | 29.753086 | 77 | 0.582158 |
9157d222e9d6b3748a014e0f588d53af04f67ef9 | 33,881 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2021-09-07T18:35:49.000Z | 2021-09-07T18:35:49.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 54.735057 | 265 | 0.692748 |
a174d0199a56f641d0688f5f1278588f810a6c68 | 4,824 | py | Python | tests/test_cli.py | ablack-jpl/scrub | 46739b4a82eab7c37e7f02cf9d537c3a58d40e01 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | ablack-jpl/scrub | 46739b4a82eab7c37e7f02cf9d537c3a58d40e01 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | ablack-jpl/scrub | 46739b4a82eab7c37e7f02cf9d537c3a58d40e01 | [
"Apache-2.0"
] | null | null | null | import os
import re
import sys
import glob
import traceback
from scrub import scrub_cli
from tests import helpers
from tests import asserts
# Make the log directory if necessary
if not os.path.exists(helpers.log_dir):
os.mkdir(helpers.log_dir)
def test_scrubme_cli(capsys):
# Initialize variables
test_lo... | 31.122581 | 115 | 0.68408 |
221e7b36fd17c5f1a32ac08968f8acd2079b63bc | 1,655 | py | Python | scripts/wall_trace.py | nzhoo/pimouse_run_corridor | f742aee835ab14eb2f8ff903c5ce2607cc586259 | [
"BSD-3-Clause"
] | null | null | null | scripts/wall_trace.py | nzhoo/pimouse_run_corridor | f742aee835ab14eb2f8ff903c5ce2607cc586259 | [
"BSD-3-Clause"
] | null | null | null | scripts/wall_trace.py | nzhoo/pimouse_run_corridor | f742aee835ab14eb2f8ff903c5ce2607cc586259 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#encoding: utf-8
import rospy,copy,math
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.msg import LightSensorValues
class WallTrace():
def __init__(self):
self.cmd_vel = rospy.Publisher('/cmd_vel',Twist,queue_size=1)
se... | 32.45098 | 88 | 0.587915 |
7218cd2b93eafe7e2382dac12100014412e4e400 | 458 | py | Python | widget_jsmol/tests/test_nbextension_path.py | osscar-org/widget-jsmol | c9fc8e5b878780efe95bee4843c70b0fefa36078 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T05:11:42.000Z | 2020-05-21T05:11:42.000Z | widget_jsmol/tests/test_nbextension_path.py | osscar-org/widget-jsmol | c9fc8e5b878780efe95bee4843c70b0fefa36078 | [
"BSD-3-Clause"
] | 1 | 2020-10-19T18:26:03.000Z | 2020-10-19T18:26:03.000Z | widget_jsmol/tests/test_nbextension_path.py | osscar-org/widget-jsmol | c9fc8e5b878780efe95bee4843c70b0fefa36078 | [
"BSD-3-Clause"
] | 1 | 2022-03-01T02:52:55.000Z | 2022-03-01T02:52:55.000Z | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Dou Du.
# Distributed under the terms of the Modified BSD License.
def test_nbextension_path():
# Check that magic function can be imported from package root:
from widget_jsmol import _jupyter_nbextension_paths
# Ensure that it can be called without i... | 28.625 | 66 | 0.724891 |
b7926f13417870d2f7e2f0c90b1f6ccdda236759 | 187 | py | Python | setup.py | CyanideCN/vanadis | ebd2373fb55d5913eb1384ab434e083fe714ecab | [
"MIT"
] | 1 | 2019-12-01T11:31:23.000Z | 2019-12-01T11:31:23.000Z | setup.py | CyanideCN/vanadis | ebd2373fb55d5913eb1384ab434e083fe714ecab | [
"MIT"
] | null | null | null | setup.py | CyanideCN/vanadis | ebd2373fb55d5913eb1384ab434e083fe714ecab | [
"MIT"
] | 2 | 2019-09-24T00:46:24.000Z | 2019-12-01T11:31:24.000Z | from setuptools import setup, find_packages
setup(name='vanadis',
version='0.0.2',
packages=find_packages(),
install_requires='matplotlib',
license='MIT Licence') | 26.714286 | 43 | 0.684492 |
2c9001c23c76a086a48cee8f5ef2e0a91995030a | 199 | py | Python | restart.py | DimmyBandeira/jarvis | d2561b24f301651969ca0495951161cdb43df8aa | [
"MIT"
] | 59 | 2020-09-08T17:42:09.000Z | 2022-03-09T07:28:25.000Z | restart.py | DimmyBandeira/jarvis | d2561b24f301651969ca0495951161cdb43df8aa | [
"MIT"
] | 20 | 2020-10-26T16:10:43.000Z | 2022-03-23T17:38:38.000Z | restart.py | DimmyBandeira/jarvis | d2561b24f301651969ca0495951161cdb43df8aa | [
"MIT"
] | 20 | 2020-10-18T00:43:25.000Z | 2022-03-20T21:04:22.000Z | """This is a basic query to start Jarvis after 5 seconds triggered by the ``restart()`` function in main module."""
from os import system
from time import sleep
sleep(5)
system('python3 jarvis.py')
| 28.428571 | 115 | 0.743719 |
77cdf2a70b4e6e8b5b28e3dad1049e1907b315db | 215 | py | Python | control-flow/src/file-exception.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | 1 | 2019-01-02T15:04:08.000Z | 2019-01-02T15:04:08.000Z | control-flow/src/file-exception.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | null | null | null | control-flow/src/file-exception.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | null | null | null | try:
with open(r'/tmp/iris.csv') as file:
content = file.read()
print(content)
except FileNotFoundError:
print('File does not exist')
except PermissionError:
print('Permission denied')
| 19.545455 | 40 | 0.655814 |
dc297ee719270019083fee317a0dcc01fe630e6e | 554 | py | Python | python/echo_worker.py | lizhenghn123/Gearman_Examples | 953aedbf250a4b9286d6fb46cfef9414a7d08807 | [
"MIT"
] | null | null | null | python/echo_worker.py | lizhenghn123/Gearman_Examples | 953aedbf250a4b9286d6fb46cfef9414a7d08807 | [
"MIT"
] | null | null | null | python/echo_worker.py | lizhenghn123/Gearman_Examples | 953aedbf250a4b9286d6fb46cfef9414a7d08807 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.6
# coding=utf-8
import os
import gearman
import math
class MyGearmanWorker(gearman.GearmanWorker):
def on_job_execute(self, current_job):
print "Job started"
print "===================\n"
return super(MyGearmanWorker, self).on_job_execute(current_job)
def task_call... | 24.086957 | 71 | 0.685921 |
4ee74593408425c267cc90fec7569bdc90bcf4a6 | 1,059 | py | Python | telerembash/_logging.py | kpe/telerembash | 139fa21584e6cdaa4e84cec4193779d7d3d39a96 | [
"MIT"
] | 2 | 2021-04-25T16:47:13.000Z | 2021-12-09T15:38:34.000Z | telerembash/_logging.py | thomasbiege/telerembash | 4c8bc061d6cffff4d0e43389602ced4749dac092 | [
"MIT"
] | 1 | 2021-09-10T07:35:13.000Z | 2021-09-10T07:35:13.000Z | telerembash/_logging.py | thomasbiege/telerembash | 4c8bc061d6cffff4d0e43389602ced4749dac092 | [
"MIT"
] | 1 | 2021-04-25T16:47:17.000Z | 2021-04-25T16:47:17.000Z | # coding=utf-8
#
# created by kpe on 16.10.2020 at 10:04 PM
#
from __future__ import division, absolute_import, print_function
import os
import sys
import yaml
import logging
import logging.config
import coloredlogs
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'):
... | 29.416667 | 103 | 0.655335 |
5f8ea8bd41274e0d4a8ef4c8d147050eb04b21d5 | 3,120 | py | Python | python_nlp_explorations_chatbot_keywords_extraction/article_4_miscellaneous_examples_nlp_spacy/07_spacy_linguistic_features.py | bflaven/BlogArticlesExamples | 5df2dfc26170ffbbade78ba136bf3172391e3b2a | [
"MIT"
] | 5 | 2018-05-03T08:16:02.000Z | 2021-09-04T03:44:24.000Z | python_nlp_explorations_chatbot_keywords_extraction/article_4_miscellaneous_examples_nlp_spacy/07_spacy_linguistic_features.py | bflaven/BlogArticlesExamples | 5df2dfc26170ffbbade78ba136bf3172391e3b2a | [
"MIT"
] | 1 | 2022-01-28T19:27:19.000Z | 2022-01-28T19:27:19.000Z | python_nlp_explorations_chatbot_keywords_extraction/article_4_miscellaneous_examples_nlp_spacy/07_spacy_linguistic_features.py | bflaven/BlogArticlesExamples | 5df2dfc26170ffbbade78ba136bf3172391e3b2a | [
"MIT"
] | 2 | 2020-09-10T13:33:27.000Z | 2022-02-09T11:07:38.000Z | #!/usr/bin/env python
# coding: utf8
"""A simple example of extracting relations between phrases and entities using
spaCy's named entity recognizer and the dependency parse. Here, we extract
money and currency values (entities labelled as MONEY) and then check the
dependency tree to find the noun phrase they are refe... | 31.836735 | 167 | 0.676603 |
e88ca749abd81b2de57fa4b96308c146f80f4e92 | 9,380 | py | Python | tests/h/routes_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | null | null | null | tests/h/routes_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | null | null | null | tests/h/routes_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | null | null | null | from unittest.mock import Mock, call
from h.routes import includeme
def test_includeme():
config = Mock(spec_set=["add_route"])
includeme(config)
# This may look like a ridiculous test, but the cost of keeping it
# up-to-date is hopefully pretty low (run the tests with -vv, copy the new
# expec... | 37.822581 | 89 | 0.533795 |
8dc7b47753335506dde6901e358f411cf814187b | 172 | py | Python | integration/setup.py | frusdelion/rancher-community-catalog | 3a43943607adad91348149755f828166b3c1b88b | [
"Apache-2.0"
] | 413 | 2016-02-03T09:07:41.000Z | 2021-11-08T08:39:49.000Z | integration/setup.py | frusdelion/rancher-community-catalog | 3a43943607adad91348149755f828166b3c1b88b | [
"Apache-2.0"
] | 620 | 2016-02-01T04:13:12.000Z | 2020-10-20T19:25:16.000Z | integration/setup.py | frusdelion/rancher-community-catalog | 3a43943607adad91348149755f828166b3c1b88b | [
"Apache-2.0"
] | 1,079 | 2016-01-30T19:28:34.000Z | 2022-03-10T12:54:15.000Z | from distutils.core import setup
setup(
name='Rancher Catalog YAML Integration Tests',
version='0.1',
packages=[
'core',
],
license='ASL 2.0',
)
| 15.636364 | 50 | 0.604651 |
2386b3b360730d3b6564d595c1fbc0defedbcbad | 3,840 | py | Python | RecoHI/HiTracking/python/hiMultiTrackSelector_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | RecoHI/HiTracking/python/hiMultiTrackSelector_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | RecoHI/HiTracking/python/hiMultiTrackSelector_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
#loose
hiLooseMTS = cms.PSet(
preFilterName=cms.string(''),
name= cms.string('hiTrkLoose'),
# vertex selection
vtxNumber = cms.int32(-1),
vertexCut = cms.string(''),
#untracked bool copyTrajectories = true // when doing retracking before
copyTraject... | 41.73913 | 101 | 0.586458 |
54c15459166aa3dbc5379a75a719d5f4006202f4 | 74,507 | py | Python | scripts/checkimages.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | null | null | null | scripts/checkimages.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | null | null | null | scripts/checkimages.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to check recently uploaded files.
This script checks if a file description is present and if there are other
problems in the image's description.
This script will have to be configured for each language. Please submit
translations as addition to the Pywikibot frame... | 42.697421 | 79 | 0.547479 |
d65eadee8493053f1dab6eb56c346784004f8bbf | 2,451 | py | Python | post/views.py | sasada033/blog | 46d00e1605fa77b36a6a4d0d5644e717176b47ba | [
"MIT"
] | 1 | 2020-06-12T06:53:07.000Z | 2020-06-12T06:53:07.000Z | post/views.py | sasada033/blog | 46d00e1605fa77b36a6a4d0d5644e717176b47ba | [
"MIT"
] | 13 | 2020-06-07T06:21:51.000Z | 2022-01-13T02:55:09.000Z | post/views.py | sasada033/blog | 46d00e1605fa77b36a6a4d0d5644e717176b47ba | [
"MIT"
] | null | null | null | import logging
from django.views import generic
from django.contrib import messages
from django.db.models import Q
from django.urls import reverse_lazy
from django.shortcuts import get_object_or_404
from .models import Post
from .forms import PostSearchForm, InquiryForm
from taggit.models import Tag
logger = logging.... | 31.025316 | 100 | 0.662995 |
8b4682e403201f5c51b0ed5c90de520a4a07e1f1 | 4,339 | py | Python | python/Xls2Xml.py | XiaoyueCai/Localizable.strings2Excel | c9664ba43aa1e6e374f33f31e5de52ddebca991e | [
"MIT"
] | null | null | null | python/Xls2Xml.py | XiaoyueCai/Localizable.strings2Excel | c9664ba43aa1e6e374f33f31e5de52ddebca991e | [
"MIT"
] | null | null | null | python/Xls2Xml.py | XiaoyueCai/Localizable.strings2Excel | c9664ba43aa1e6e374f33f31e5de52ddebca991e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import os
import re
import time
from optparse import OptionParser
from Log import Log
from XlsFileUtil import XlsFileUtil
from XmlFileUtil import XmlFileUtil
def addParser():
parser = OptionParser()
parser.add_option("-f", "--fileDir",
help="Xls files directory.... | 32.62406 | 140 | 0.552892 |
38cad524d55bc1531a67f4a22f97b21665fc67d5 | 5,544 | py | Python | noxfile.py | mlanser/sciLab-displayMod | acc77c17d9bb389dea96f35b140595d7fc033548 | [
"MIT"
] | null | null | null | noxfile.py | mlanser/sciLab-displayMod | acc77c17d9bb389dea96f35b140595d7fc033548 | [
"MIT"
] | null | null | null | noxfile.py | mlanser/sciLab-displayMod | acc77c17d9bb389dea96f35b140595d7fc033548 | [
"MIT"
] | null | null | null | """Nox sessions."""
import shutil
import sys
from pathlib import Path
from textwrap import dedent
import nox
try:
from nox_poetry import Session
from nox_poetry import session
except ImportError:
message = f"""\
Nox failed to import the 'nox-poetry' package.
Please install it using the following ... | 28.430769 | 87 | 0.619228 |
567b5d227a54d00399e15385d95794514f9579bc | 26,765 | py | Python | streamdeckfs/entities/key.py | twidi/streamdeckify | 5795b0610f950aab67543f47e2e5d20e99fc88d7 | [
"MIT"
] | 9 | 2021-07-29T18:35:28.000Z | 2022-01-25T10:10:22.000Z | streamdeckfs/entities/key.py | twidi/streamdeckify | 5795b0610f950aab67543f47e2e5d20e99fc88d7 | [
"MIT"
] | 31 | 2021-05-25T15:33:08.000Z | 2021-06-06T19:16:12.000Z | streamdeckfs/entities/key.py | twidi/streamdeckify | 5795b0610f950aab67543f47e2e5d20e99fc88d7 | [
"MIT"
] | 1 | 2022-02-16T05:27:41.000Z | 2022-02-16T05:27:41.000Z | #
# Copyright (C) 2021 Stephane "Twidi" Angel <s.angel@twidi.com>
#
# This file is part of StreamDeckFS
# (see https://github.com/twidi/streamdeckfs).
#
# License: MIT, see https://opensource.org/licenses/MIT
#
import logging
import re
from dataclasses import dataclass
from fnmatch import fnmatch
from itertools import ... | 39.072993 | 141 | 0.574332 |
16cf628e3781ff3fa86b8de8d9b610d269fa90b5 | 8,307 | py | Python | test/lexical_state_machine/test_lexical_state_machine.py | BloggerBust/bbpyp | 078f940dd38bc3ee7c5adcfb2555c2843a4ca57b | [
"Apache-2.0"
] | null | null | null | test/lexical_state_machine/test_lexical_state_machine.py | BloggerBust/bbpyp | 078f940dd38bc3ee7c5adcfb2555c2843a4ca57b | [
"Apache-2.0"
] | null | null | null | test/lexical_state_machine/test_lexical_state_machine.py | BloggerBust/bbpyp | 078f940dd38bc3ee7c5adcfb2555c2843a4ca57b | [
"Apache-2.0"
] | null | null | null | import unittest
from mock import Mock, PropertyMock, patch, sentinel, DEFAULT, call
from bbpyp.test.mock_helpers import set_property_mock
from bbpyp.lexical_state_machine.lexical_state_machine import LexicalStateMachine
from bbpyp.lexical_state_machine.model.lexical_state import LexicalState
@patch('test.TestContext... | 58.914894 | 324 | 0.722282 |
73ff21476b9023c60d54dff226aaa591cc453f5b | 5,221 | py | Python | caterva/ndarray.py | DimitriPapadopoulos/python-caterva | f2162c2cdaea8a818ad948afee1555db3747e3a3 | [
"BSD-3-Clause"
] | 17 | 2019-09-07T09:58:41.000Z | 2021-06-09T21:18:41.000Z | caterva/ndarray.py | DimitriPapadopoulos/python-caterva | f2162c2cdaea8a818ad948afee1555db3747e3a3 | [
"BSD-3-Clause"
] | 23 | 2019-07-04T10:11:54.000Z | 2021-06-04T08:34:42.000Z | caterva/ndarray.py | DimitriPapadopoulos/python-caterva | f2162c2cdaea8a818ad948afee1555db3747e3a3 | [
"BSD-3-Clause"
] | 2 | 2020-06-21T17:56:24.000Z | 2021-05-16T07:35:15.000Z | #######################################################################
# Copyright (C) 2019-present, Blosc Development team <blosc@blosc.org>
# All rights reserved.
#
# This source code is licensed under a BSD-style license (found in the
# LICENSE file in the root directory of this source tree)
#######################... | 31.263473 | 99 | 0.5656 |
e81de2ed32dbef026e6b194d968137e164f4ca44 | 15,042 | py | Python | venv/lib/python3.5/site-packages/gi/_propertyhelper.py | joseluis8906/fancychat | c67bec8c0273f77c9070bb2b7e23421a7ca5bc11 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/gi/_propertyhelper.py | joseluis8906/fancychat | c67bec8c0273f77c9070bb2b7e23421a7ca5bc11 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/gi/_propertyhelper.py | joseluis8906/fancychat | c67bec8c0273f77c9070bb2b7e23421a7ca5bc11 | [
"MIT"
] | null | null | null | # -*- Mode: Python; py-indent-offset: 4 -*-
# pygobject - Python bindings for the GObject library
# Copyright (C) 2007 Johan Dahlin
#
# gi/_propertyhelper.py: GObject property wrapper/helper
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
... | 35.14486 | 96 | 0.597859 |
0c50b5c1f51ffdb4d7586461298f4fea9f509634 | 17,658 | py | Python | pde/tools/parameters.py | deephog/py-pde | 2b9cf5ecf90d33f484b6f2fb61437199ca66b25c | [
"MIT"
] | null | null | null | pde/tools/parameters.py | deephog/py-pde | 2b9cf5ecf90d33f484b6f2fb61437199ca66b25c | [
"MIT"
] | null | null | null | pde/tools/parameters.py | deephog/py-pde | 2b9cf5ecf90d33f484b6f2fb61437199ca66b25c | [
"MIT"
] | null | null | null | """
Infrastructure for managing classes with parameters
One aim is to allow easy management of inheritance of parameters.
.. autosummary::
:nosignatures:
Parameter
DeprecatedParameter
HideParameter
Parameterized
get_all_parameters
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
import... | 34.897233 | 88 | 0.572149 |
347754d497902fb242721ed3e43644b5dbecf4a6 | 9,979 | py | Python | fcmaes/moretry.py | dietmarwo/fast-cma-es | 7952d2b70dc76d8f9d3bc326fd19f98fd93e9ff6 | [
"MIT"
] | 20 | 2020-05-28T10:23:11.000Z | 2022-03-22T08:09:58.000Z | fcmaes/moretry.py | dietmarwo/fast-cma-es | 7952d2b70dc76d8f9d3bc326fd19f98fd93e9ff6 | [
"MIT"
] | 11 | 2020-03-04T15:16:41.000Z | 2022-03-27T07:14:19.000Z | fcmaes/moretry.py | dietmarwo/fast-cma-es | 7952d2b70dc76d8f9d3bc326fd19f98fd93e9ff6 | [
"MIT"
] | 12 | 2020-02-19T12:26:40.000Z | 2022-03-26T11:22:13.000Z | # Copyright (c) Dietmar Wolz.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory.
# parallel optimization retry of a multi-objective problem.
import numpy as np
import math, sys, time, warnings
import multiprocessing as mp
from multiprocessing import Process
from ... | 41.406639 | 101 | 0.592043 |
e62c051300ab5907b6d140ea8c68be502670cbc5 | 7,537 | py | Python | tests/strategies/test_dp.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | null | null | null | tests/strategies/test_dp.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | 1 | 2022-03-18T21:56:53.000Z | 2022-03-18T21:56:53.000Z | tests/strategies/test_dp.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.535565 | 114 | 0.687939 |
dd5c7ea49b8e7a2ef7991055f8c4c01679600e91 | 455 | py | Python | Day 3/IntegerToBinary.py | RajShashwat/100daysofcode | d4642ad6278a40a21d74312e9b06495b1edef05a | [
"MIT"
] | null | null | null | Day 3/IntegerToBinary.py | RajShashwat/100daysofcode | d4642ad6278a40a21d74312e9b06495b1edef05a | [
"MIT"
] | null | null | null | Day 3/IntegerToBinary.py | RajShashwat/100daysofcode | d4642ad6278a40a21d74312e9b06495b1edef05a | [
"MIT"
] | null | null | null | #imported the Stack.py
from Stack import Stack
def intToBinary(num: int) -> str :
stack = Stack()
while num > 0:
remender = num % 2
stack.push(remender)
num = num // 2
binary = ""
while not stack.is_empty():
binary += str(stack.pop())
return binary
num = int(inp... | 18.958333 | 36 | 0.586813 |
a61507712d07f15dfaeb8ca9f5d8ec7e1e4ccfeb | 14,325 | py | Python | train_frcnn.py | ravali27/Keras-FasterRCNN | e0847e18a85c988ae8baaba50ea40a2a7c05c855 | [
"MIT"
] | null | null | null | train_frcnn.py | ravali27/Keras-FasterRCNN | e0847e18a85c988ae8baaba50ea40a2a7c05c855 | [
"MIT"
] | null | null | null | train_frcnn.py | ravali27/Keras-FasterRCNN | e0847e18a85c988ae8baaba50ea40a2a7c05c855 | [
"MIT"
] | null | null | null | from __future__ import division
import random
import pprint
import sys
import time
import numpy as np
from optparse import OptionParser
import pickle
import os
import tensorflow as tf
import keras
from keras import backend as K
from keras.optimizers import Adam, SGD, RMSprop
from keras.layers import Input
from keras.m... | 41.642442 | 199 | 0.690611 |
fa14e5ef62e6da799e5bef557d699888a40e77e6 | 4,584 | py | Python | lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py | bytesnake/Enzyme | 247606c279920d476645d2e319e574bf8be10fc9 | [
"Apache-2.0"
] | null | null | null | lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py | bytesnake/Enzyme | 247606c279920d476645d2e319e574bf8be10fc9 | [
"Apache-2.0"
] | null | null | null | lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py | bytesnake/Enzyme | 247606c279920d476645d2e319e574bf8be10fc9 | [
"Apache-2.0"
] | null | null | null | """Test that conflicting symbols in different shared libraries work correctly"""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestConflictingSymbols(TestBase):
myd... | 36.967742 | 80 | 0.620201 |
b1e1c2b4ba7965f21d25517589d23a459edcd8a8 | 3,859 | py | Python | frontend/widgets/node.py | ludica-squamata/BehaviourTreeEditor_v2 | 65ca608f7086cd2b4f0cc1eab7b714959b312b94 | [
"MIT"
] | null | null | null | frontend/widgets/node.py | ludica-squamata/BehaviourTreeEditor_v2 | 65ca608f7086cd2b4f0cc1eab7b714959b312b94 | [
"MIT"
] | null | null | null | frontend/widgets/node.py | ludica-squamata/BehaviourTreeEditor_v2 | 65ca608f7086cd2b4f0cc1eab7b714959b312b94 | [
"MIT"
] | null | null | null | from frontend.globals import WidgetHandler, Renderer, COLOR_UNSELECTED, COLOR_SELECTED
from pygame import Surface, font, transform, draw
from backend.eventhandler import EventHandler
from .connection import toggle_connection
from .basewidget import BaseWidget
class Node(BaseWidget):
idx = 0
order = '... | 31.373984 | 94 | 0.590827 |
3e60cf91952eee452c477da793a6e6b27a34f7bd | 2,748 | py | Python | configs/common/SimpleOpts.py | caihuayi/gem5 | 96fce476785a834f102ae69a895e661cf08e47cd | [
"BSD-3-Clause"
] | 16 | 2020-09-24T00:17:36.000Z | 2021-08-12T06:11:52.000Z | configs/common/SimpleOpts.py | caihuayi/gem5 | 96fce476785a834f102ae69a895e661cf08e47cd | [
"BSD-3-Clause"
] | 5 | 2021-01-27T23:09:06.000Z | 2022-01-07T03:19:39.000Z | configs/common/SimpleOpts.py | caihuayi/gem5 | 96fce476785a834f102ae69a895e661cf08e47cd | [
"BSD-3-Clause"
] | 15 | 2020-11-18T00:15:28.000Z | 2021-12-12T03:18:34.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Jason Power
# 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 con... | 36.64 | 76 | 0.760189 |
23f0b77bdc63ebba6d3670cbc0e1250eea5d4698 | 22,418 | py | Python | multiresolution_mesh_creator/src/create_multiresolution_meshes.py | davidackerman/multiresolution-mesh-creator | 1875e52b57804e982c47b9f58a0572f50e778c73 | [
"BSD-3-Clause"
] | 5 | 2021-12-17T16:23:47.000Z | 2022-03-12T20:03:28.000Z | multiresolution_mesh_creator/src/create_multiresolution_meshes.py | janelia-cosem/multiresolution-mesh-creator | c5818da25b79debd08e5e9eb84641eea22eef715 | [
"BSD-3-Clause"
] | 1 | 2021-12-13T04:50:14.000Z | 2021-12-14T08:10:29.000Z | multiresolution_mesh_creator/src/create_multiresolution_meshes.py | janelia-cosem/multiresolution-mesh-creator | c5818da25b79debd08e5e9eb84641eea22eef715 | [
"BSD-3-Clause"
] | 1 | 2021-10-15T23:20:00.000Z | 2021-10-15T23:20:00.000Z | from contextlib import ExitStack
import trimesh
from trimesh.intersections import slice_faces_plane
import numpy as np
from dvidutils import encode_faces_to_custom_drc_bytes
import time
import os
from os import listdir
from os.path import isfile, join, splitext
import dask
from dask.distributed import worker_client
imp... | 41.133945 | 121 | 0.59256 |
430f743823c77420ff9e66b2a6190a4b3916b2b1 | 1,768 | py | Python | src/268.missing-number.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | src/268.missing-number.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | src/268.missing-number.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=268 lang=python3
#
# [268] Missing Number
#
# https://leetcode.com/problems/missing-number/description/
#
# algorithms
# Easy (56.30%)
# Likes: 3474
# Dislikes: 2608
# Total Accepted: 734K
# Total Submissions: 1.3M
# Testcase Example: '[3,0,1]'
#
# Given an array nums containing n distinc... | 21.301205 | 79 | 0.63914 |
4ca6c3515a4273028b5ccfde5ecb027929e5d187 | 1,860 | py | Python | training/src/tests/tests/python/dilated_conv1d.py | steelONIONknight/bolt | 9bd3d08f2abb14435ca3ad0179889e48fa7e9b47 | [
"MIT"
] | null | null | null | training/src/tests/tests/python/dilated_conv1d.py | steelONIONknight/bolt | 9bd3d08f2abb14435ca3ad0179889e48fa7e9b47 | [
"MIT"
] | null | null | null | training/src/tests/tests/python/dilated_conv1d.py | steelONIONknight/bolt | 9bd3d08f2abb14435ca3ad0179889e48fa7e9b47 | [
"MIT"
] | null | null | null | # Copyright (C) 2022. Huawei Technologies Co., Ltd. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the rights to use, co... | 47.692308 | 148 | 0.755376 |
6484882d65bbd26a52f9173df79f028d8389b98f | 28,681 | py | Python | sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py | jiasli/azure-sdk-for-python | f700299c45cea44064d5156f2bfe3664284f6da4 | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py | jiasli/azure-sdk-for-python | f700299c45cea44064d5156f2bfe3664284f6da4 | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py | jiasli/azure-sdk-for-python | f700299c45cea44064d5156f2bfe3664284f6da4 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import fu... | 47.801667 | 126 | 0.648722 |
6e233b0e730a0d9929043bc47c80b739792f65f8 | 5,140 | py | Python | services/document-manager/backend/app/docman/resources/import_now_submission_documents_job.py | bcgov/mds | 6c427a66a5edb4196222607291adef8fd6677038 | [
"Apache-2.0"
] | 25 | 2018-07-09T19:04:37.000Z | 2022-03-15T17:27:10.000Z | services/document-manager/backend/app/docman/resources/import_now_submission_documents_job.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 983 | 2018-04-25T20:08:07.000Z | 2022-03-31T21:45:20.000Z | services/document-manager/backend/app/docman/resources/import_now_submission_documents_job.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 58 | 2018-05-15T22:35:50.000Z | 2021-11-29T19:40:52.000Z | from flask import current_app, make_response, jsonify, request
from flask_restplus import Resource, reqparse
from werkzeug.exceptions import BadRequest
from sqlalchemy import and_
import json
from app.extensions import api
from app.docman.models.import_now_submission_documents_job import ImportNowSubmissionDocumentsJo... | 48.490566 | 169 | 0.711479 |
5c768bbc8c9b36992c0a58af9b526310e5336b23 | 5,211 | py | Python | openet/disalexi/lc_properties.py | hgbzzw/openet-disalexi-beta | efc581b08613ee2d1cb653b04c079d4610d51174 | [
"Apache-2.0"
] | 3 | 2019-11-07T14:58:42.000Z | 2022-01-05T07:54:27.000Z | openet/disalexi/lc_properties.py | hgbzzw/openet-disalexi-beta | efc581b08613ee2d1cb653b04c079d4610d51174 | [
"Apache-2.0"
] | null | null | null | openet/disalexi/lc_properties.py | hgbzzw/openet-disalexi-beta | efc581b08613ee2d1cb653b04c079d4610d51174 | [
"Apache-2.0"
] | 2 | 2020-01-14T08:32:30.000Z | 2022-01-11T00:47:13.000Z | remaps = {
'NLCD': {
'aleafv': {
11: 0.82, 12: 0.82, 21: 0.84, 22: 0.84, 23: 0.84, 24: 0.84,
31: 0.82, 32: 0.82, 41: 0.86, 42: 0.89, 43: 0.87,
51: 0.83, 52: 0.83, 71: 0.82, 72: 0.82, 73: 0.82, 74: 0.82,
81: 0.82, 82: 0.83, 90: 0.85, 91: 0.85, 92: 0.85, 93: 0.8... | 53.721649 | 72 | 0.399731 |
a8f932ac7e695566475e28c606c638edaad1a40c | 1,185 | py | Python | Scrape Wikipedia using speech recognition.py | AnshikaY/awesomeScripts | 94b1a5a57e9a117150e1beadd8a7a71d4d237ad4 | [
"MIT"
] | null | null | null | Scrape Wikipedia using speech recognition.py | AnshikaY/awesomeScripts | 94b1a5a57e9a117150e1beadd8a7a71d4d237ad4 | [
"MIT"
] | null | null | null | Scrape Wikipedia using speech recognition.py | AnshikaY/awesomeScripts | 94b1a5a57e9a117150e1beadd8a7a71d4d237ad4 | [
"MIT"
] | null | null | null | import pyttsx3
import speech_recognition as SR
import wikipedia
import sys
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# for voice in voices:
# print(voice.id)
# select voice among the available options
engine.setProperty('voice', voices[1].id)
def speak(audio):
engine.say(audio)
... | 24.6875 | 71 | 0.623629 |
705c7aa3cfe6fce5869177f54108a6cce0fedea8 | 5,728 | py | Python | database/db_models.py | Huynhhung0/origin-website | dee1fc4f5f048e3e17d64e551522c739a7953364 | [
"MIT"
] | 1 | 2020-05-21T04:44:45.000Z | 2020-05-21T04:44:45.000Z | database/db_models.py | Huynhhung0/origin-website | dee1fc4f5f048e3e17d64e551522c739a7953364 | [
"MIT"
] | null | null | null | database/db_models.py | Huynhhung0/origin-website | dee1fc4f5f048e3e17d64e551522c739a7953364 | [
"MIT"
] | null | null | null |
from decimal import *
from sqlalchemy import event
from sqlalchemy.orm import deferred
from sqlalchemy.orm import relationship
from sqlalchemy.dialects.postgresql import JSONB
from database import db, db_common
class EmailList(db.Model):
__tablename__ = 'email_list'
email = db.Column(db.String(255), prima... | 35.57764 | 96 | 0.686278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.