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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4d014c40a741be997af0b27dac58c60e95f4bc4a | 5,539 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 49.900901 | 209 | 0.692724 |
0a58effa481f098a540f23a2040b5c2ffcf08aba | 4,291 | py | Python | homeassistant/components/roomba/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2021-11-22T22:37:43.000Z | 2022-03-17T00:55:28.000Z | homeassistant/components/roomba/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 25 | 2021-11-24T06:24:10.000Z | 2022-03-31T06:23:06.000Z | homeassistant/components/roomba/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """The roomba component."""
import asyncio
import logging
import async_timeout
from roombapy import RoombaConnectionError, RoombaFactory
from homeassistant import exceptions
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_DELAY,
CONF_HOST,
CONF_NAME,
CONF_PA... | 30.65 | 87 | 0.695875 |
ffe27740365a711d837d971ddb7768cb9db0a542 | 17,520 | py | Python | lingvo/tasks/asr/frontend.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/asr/frontend.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/asr/frontend.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# 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
#
... | 37.758621 | 80 | 0.689612 |
5e0569092e60e3bafd57c4c728e3b494e24f8edb | 1,388 | py | Python | fixture/session.py | Dimans10/Autotest_traning | 9dbd8646a845fc743396cb78681b0aca111077f4 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | Dimans10/Autotest_traning | 9dbd8646a845fc743396cb78681b0aca111077f4 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | Dimans10/Autotest_traning | 9dbd8646a845fc743396cb78681b0aca111077f4 | [
"Apache-2.0"
] | null | null | null |
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys... | 29.531915 | 77 | 0.600865 |
5678a9cc27ca37fe7bd4af711d29aac99f718aad | 71 | py | Python | Chapter 05/Chap05_Example5.42.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 05/Chap05_Example5.42.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 05/Chap05_Example5.42.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | #games module
from Kabaddi import defender
defender.name_defender()
| 17.75 | 29 | 0.802817 |
282307ad25d854b6b6c0e8d7929d46d3bf30bbea | 1,029 | py | Python | blueking_api/urls.py | ganlvtech/blueking-django-startup-project | 042aa36b0757c0d3929d88bc23534f54963d333e | [
"MIT"
] | 1 | 2018-11-22T21:13:25.000Z | 2018-11-22T21:13:25.000Z | blueking_api/urls.py | ganlvtech/blueking-django-startup-project | 042aa36b0757c0d3929d88bc23534f54963d333e | [
"MIT"
] | null | null | null | blueking_api/urls.py | ganlvtech/blueking-django-startup-project | 042aa36b0757c0d3929d88bc23534f54963d333e | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^permission_test/', views.permission_test, name='permission_test'),
url(r'^get_app_access_token/$', views.get_app_access_token, name='get_app_access_token'),
url(r'^get_user_access_token/$... | 54.157895 | 108 | 0.737609 |
43712f1330778894c23c8558d6868bb7003ee373 | 1,068 | py | Python | examples/hddmcp.py | markito3/hddm | 887b72c0d27869696e243d277c37fcf2fabd2207 | [
"Apache-2.0"
] | null | null | null | examples/hddmcp.py | markito3/hddm | 887b72c0d27869696e243d277c37fcf2fabd2207 | [
"Apache-2.0"
] | 2 | 2021-04-04T04:06:25.000Z | 2021-10-18T00:59:12.000Z | examples/hddmcp.py | markito3/hddm | 887b72c0d27869696e243d277c37fcf2fabd2207 | [
"Apache-2.0"
] | 2 | 2021-04-14T20:58:51.000Z | 2021-04-14T21:13:58.000Z | #!/bin/env python
#
# hddmcp.py - python alternative to the old hddmcp, multithreaded.
#
# author: richard.t.jones at uconn.edu
# version: march 23, 2018
import threading
import hddm_s
import sys
def usage():
print "Usage: hddmcp.py [-n #threads] <file1.hddm> <file2.hddm> ... <outfile.hddm>"
sys.exit(1)
def co... | 20.941176 | 86 | 0.626404 |
49928382b9f0968592c953c45ebc0fd0b5307b95 | 473 | py | Python | project/apps/core/views.py | abdesslem/drf | e6010a771dc31a5f5ce7f5f0720302bd84a25a5f | [
"MIT"
] | null | null | null | project/apps/core/views.py | abdesslem/drf | e6010a771dc31a5f5ce7f5f0720302bd84a25a5f | [
"MIT"
] | null | null | null | project/apps/core/views.py | abdesslem/drf | e6010a771dc31a5f5ce7f5f0720302bd84a25a5f | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from .models import University, Student
from .serializers import UniversitySerializer, StudentSerializer
# ViewSets define the view behavior.
class StudentViewSet(viewsets.ModelViewSet):
queryset = Student.objects.all()
serializer_class = StudentSerializer
# ViewSets defin... | 31.533333 | 64 | 0.811839 |
e4ce7a9b1cb89d935dc4de3e9f981a631d014696 | 42,277 | py | Python | koalixcrm/crm/migrations/0003_auto_20171009_1949.py | Cataldir/koalixcrm | 87d125379845d6ab990c19500d63cbed4051040a | [
"BSD-3-Clause"
] | 290 | 2015-01-11T03:01:05.000Z | 2019-12-17T03:56:17.000Z | koalixcrm/crm/migrations/0003_auto_20171009_1949.py | Cataldir/koalixcrm | 87d125379845d6ab990c19500d63cbed4051040a | [
"BSD-3-Clause"
] | 178 | 2016-02-26T14:41:49.000Z | 2019-12-29T08:34:21.000Z | koalixcrm/crm/migrations/0003_auto_20171009_1949.py | Cataldir/koalixcrm | 87d125379845d6ab990c19500d63cbed4051040a | [
"BSD-3-Clause"
] | 124 | 2015-02-28T20:56:37.000Z | 2019-12-13T18:15:35.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-09 19:49
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('crm', '0002_auto_20170927_... | 54.692109 | 5,863 | 0.60721 |
f6091ab0704798a46eeae817671b3cd48beb2926 | 6,927 | py | Python | sdk/python/pulumi_azure_native/securityinsights/v20210301preview/get_incident_relation.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/securityinsights/v20210301preview/get_incident_relation.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/securityinsights/v20210301preview/get_incident_relation.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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, overload
from ... import _utilities
fro... | 38.483333 | 197 | 0.670564 |
8b51637a8cb5a75c5fbb87193caff0f623f202e6 | 3,165 | py | Python | ginga/util/wcsmod/__init__.py | finagle29/ginga | 161952a4016d3f014003db3d09dd78c61be85cb7 | [
"BSD-3-Clause"
] | null | null | null | ginga/util/wcsmod/__init__.py | finagle29/ginga | 161952a4016d3f014003db3d09dd78c61be85cb7 | [
"BSD-3-Clause"
] | null | null | null | ginga/util/wcsmod/__init__.py | finagle29/ginga | 161952a4016d3f014003db3d09dd78c61be85cb7 | [
"BSD-3-Clause"
] | null | null | null | #
# wcsmod -- module wrapper for WCS calculations.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
We are fortunate to have several possible choices for a python WCS package
compatible with Ginga: astlib, kapteyn, starlink and astropy.
kapteyn and astr... | 26.157025 | 77 | 0.685308 |
74ec1cf50568e21a728f034a4769adc74510092d | 1,459 | py | Python | TimeSeries/sarima.py | lauramurphy12/MachineLearningProjects | c6ea2c2644815de480c72728dd2e0b6a380be2ea | [
"CC0-1.0"
] | null | null | null | TimeSeries/sarima.py | lauramurphy12/MachineLearningProjects | c6ea2c2644815de480c72728dd2e0b6a380be2ea | [
"CC0-1.0"
] | null | null | null | TimeSeries/sarima.py | lauramurphy12/MachineLearningProjects | c6ea2c2644815de480c72728dd2e0b6a380be2ea | [
"CC0-1.0"
] | null | null | null | import itertools
from statsmodels.tsa.statespace.sarimax import SARIMAX
import pandas as pd
import forecasting
import warnings
import numpy as np
from sklearn.metrics import mean_squared_error, mean_absolute_error
from math import sqrt
def sarima_model(train, test, trend_order, seasonal_order, forecast_period):
model... | 42.911765 | 196 | 0.793009 |
0284e99cf49e7c16b07e773ffd6af23feeedcc77 | 1,430 | py | Python | streams/transform_data.py | BogdanFloris/detecting-and-addressing-change | b11082ebd0fc421eca31c5ba82ddb52446fa56f5 | [
"MIT"
] | 2 | 2020-01-24T15:50:47.000Z | 2021-04-16T21:21:25.000Z | streams/transform_data.py | BogdanFloris/detecting-and-addressing-change | b11082ebd0fc421eca31c5ba82ddb52446fa56f5 | [
"MIT"
] | null | null | null | streams/transform_data.py | BogdanFloris/detecting-and-addressing-change | b11082ebd0fc421eca31c5ba82ddb52446fa56f5 | [
"MIT"
] | null | null | null | """
Transforms a dataset using a transformer and saves it
"""
import os
import torch
from pathlib import Path
from tqdm import tqdm
from streams.loaders import load_wos
from constants.transformers import TransformerModel, Transformer
SAVE_DIR = os.path.join(Path(__file__).parents[1], "assets/datasets")
def transfor... | 29.183673 | 86 | 0.681119 |
c79a6bcea0d5b63123fa418bf0c7c0d279f8de7e | 897 | py | Python | Live/main.py | Pawel095/PJ_Pygame_Prezentacja | f6ace78c2df504a262eac6b1ae46d458939dd0c0 | [
"MIT"
] | null | null | null | Live/main.py | Pawel095/PJ_Pygame_Prezentacja | f6ace78c2df504a262eac6b1ae46d458939dd0c0 | [
"MIT"
] | null | null | null | Live/main.py | Pawel095/PJ_Pygame_Prezentacja | f6ace78c2df504a262eac6b1ae46d458939dd0c0 | [
"MIT"
] | null | null | null | import pygame
import global_vars
import events
import loader
import sprites.enemy
from sprites.Player import Player
from sprites.enemy import Controller
import sprites.bullet as bullets
from sprites.background import Background
pygame.init()
loader.load()
pygame.display.set_mode(global_vars.SCREEN_SIZE)
pygame.displ... | 17.94 | 48 | 0.714604 |
3dbd1501558382b66d980fa06d53e2a6b2e20175 | 1,864 | py | Python | sovrin/test/upgrade/test_pool_upgrade_lower_version.py | sovrin-foundation/old-sovrin | d4e705054b7252c62fea00114060035c6eb314a4 | [
"Apache-2.0"
] | 3 | 2017-07-19T14:26:31.000Z | 2020-05-16T16:09:37.000Z | sovrin/test/upgrade/test_pool_upgrade_lower_version.py | sovrin-foundation/old-sovrin | d4e705054b7252c62fea00114060035c6eb314a4 | [
"Apache-2.0"
] | null | null | null | sovrin/test/upgrade/test_pool_upgrade_lower_version.py | sovrin-foundation/old-sovrin | d4e705054b7252c62fea00114060035c6eb314a4 | [
"Apache-2.0"
] | 3 | 2017-10-28T08:19:00.000Z | 2021-06-06T10:48:55.000Z | from copy import deepcopy
import pytest
from plenum.common.eventually import eventually
from plenum.common.txn import VERSION, NAME
from plenum.common.util import randomString
from sovrin.common.txn import SHA256, ACTION, CANCEL
from sovrin.test.upgrade.helper import bumpVersion, checkUpgradeScheduled, \
ensureUp... | 39.659574 | 78 | 0.684549 |
e47968452cbbbe2ff2138411716de565c75d2d32 | 138 | py | Python | accounts/urls.py | haTrang061299/blog_project | 5afc17b97c43aa300280dd97106562bf58b60e58 | [
"MIT"
] | null | null | null | accounts/urls.py | haTrang061299/blog_project | 5afc17b97c43aa300280dd97106562bf58b60e58 | [
"MIT"
] | null | null | null | accounts/urls.py | haTrang061299/blog_project | 5afc17b97c43aa300280dd97106562bf58b60e58 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import SignUpView
urlpatterns = [
path('signup/', SignUpView.as_view(), name='signup'),
]
| 15.333333 | 57 | 0.702899 |
9a78dffd0818d53bb16bb0d715c9ed860b41d225 | 2,498 | py | Python | pfl/core/client.py | huyifan233/PFL | 136bdaea6e62ff4ff0f585bf9b061598806ce1b8 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:22:14.000Z | 2022-03-30T07:22:14.000Z | pfl/core/client.py | wuchaozju/PFL | 39d6d24088714cd38ca8007ede0dfc98a48955ad | [
"Apache-2.0"
] | null | null | null | pfl/core/client.py | wuchaozju/PFL | 39d6d24088714cd38ca8007ede0dfc98a48955ad | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 GalaxyLearning 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 appli... | 34.219178 | 101 | 0.67494 |
5ec201bc901122c29ef9cda8bb077625050297ce | 1,357 | py | Python | stage_check/stage_check/OutputLogs.py | 128technology/stage_check | 2c9cdc491bafbcc6ed1a308093fe606dfd37da67 | [
"MIT"
] | 2 | 2020-05-26T15:13:47.000Z | 2021-04-29T18:14:21.000Z | stage_check/stage_check/OutputLogs.py | 128technology/stage_check | 2c9cdc491bafbcc6ed1a308093fe606dfd37da67 | [
"MIT"
] | null | null | null | stage_check/stage_check/OutputLogs.py | 128technology/stage_check | 2c9cdc491bafbcc6ed1a308093fe606dfd37da67 | [
"MIT"
] | null | null | null | """
"""
try:
from stage_check import Output
except ImportError:
import Output
class Base(Output.Base):
def __init__(self):
super().__init__()
self.__full_name = 'OutputLogs.Base'
self.status = Output.Status.OK
def proc_pattern_matched(self,
params,
... | 20.253731 | 56 | 0.506264 |
8b7c1067a6be9679c356aa2e1505886751f2b875 | 7,079 | py | Python | research/cv/CascadeRCNN/src/CascadeRcnn/roi_align_1.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/CascadeRCNN/src/CascadeRcnn/roi_align_1.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/CascadeRCNN/src/CascadeRcnn/roi_align_1.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.110497 | 109 | 0.617178 |
cfc1359a4ea2cc557cc1bb339ed87a6b8d1bc820 | 2,547 | py | Python | Utilities/ReleaseScripts/python/commentSkipper/cppCommentSkipper.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 1 | 2019-03-09T19:47:49.000Z | 2019-03-09T19:47:49.000Z | Utilities/ReleaseScripts/python/commentSkipper/cppCommentSkipper.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | Utilities/ReleaseScripts/python/commentSkipper/cppCommentSkipper.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 1 | 2019-04-03T19:23:27.000Z | 2019-04-03T19:23:27.000Z | __author__="Aurelija"
__date__ ="$2010-07-13 12.17.20$"
import string
def filterFiles(fileList):
files = []
for file in fileList:
files.append((file, filterFile(file)))
return files
def filterFile(file): #ifstream& input)
lines = open(file).readlines()
commentStage = False
for i in... | 39.796875 | 133 | 0.444837 |
1da5366997b5b05f8fb23296f4b0f72da44934e6 | 40 | py | Python | simple/management/commands/parse_government_bill_pdf/__init__.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 7 | 2015-03-05T11:14:23.000Z | 2017-02-11T18:06:25.000Z | simple/management/commands/parse_government_bill_pdf/__init__.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 7 | 2020-02-12T01:09:15.000Z | 2022-03-11T23:25:12.000Z | simple/management/commands/parse_government_bill_pdf/__init__.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 11 | 2015-02-21T09:45:06.000Z | 2021-05-05T06:01:24.000Z | from parse_government_bill_pdf import *
| 20 | 39 | 0.875 |
8f62d0a066663cb66be97dd4ed4dda3b7ee31a0f | 1,986 | py | Python | info_state.py | ProgrammingIncluded/PyAN | b5628891c2f0f7b4deb97d92c7b6ab1163a13b54 | [
"MIT"
] | null | null | null | info_state.py | ProgrammingIncluded/PyAN | b5628891c2f0f7b4deb97d92c7b6ab1163a13b54 | [
"MIT"
] | null | null | null | info_state.py | ProgrammingIncluded/PyAN | b5628891c2f0f7b4deb97d92c7b6ab1163a13b54 | [
"MIT"
] | null | null | null | ############################################
# Project: PyAN
# File: info_state.py
# By: ProgrammingIncluded
# Website: ProgrammingIncluded.com
# Desc: File to hold info state that
# displays song information.
############################################
import chat_state as cs
import connect as cnt
import comma... | 29.205882 | 111 | 0.602216 |
042d003827bdef5764e71d1de38b4638eedfd623 | 9,202 | py | Python | src/einsteinpy/integrators/fantasy.py | iamhardikat11/einsteinpy | 7bf0ca0020b273e616b6e7c19aed7a5e13925444 | [
"MIT"
] | 485 | 2019-02-04T09:15:22.000Z | 2022-03-19T13:50:17.000Z | src/einsteinpy/integrators/fantasy.py | iamhardikat11/einsteinpy | 7bf0ca0020b273e616b6e7c19aed7a5e13925444 | [
"MIT"
] | 570 | 2019-02-02T10:57:27.000Z | 2022-02-26T16:37:05.000Z | src/einsteinpy/integrators/fantasy.py | iamhardikat11/einsteinpy | 7bf0ca0020b273e616b6e7c19aed7a5e13925444 | [
"MIT"
] | 250 | 2019-01-30T14:14:14.000Z | 2022-02-28T21:18:18.000Z | import warnings
import numpy as np
from .utils import _Z, _flow_A, _flow_B, _flow_mixed
class GeodesicIntegrator:
"""
Geodesic Integrator, based on [1]_.
This module uses Forward Mode Automatic Differentiation
to calculate metric derivatives to machine precision
leading to stable sim... | 31.406143 | 100 | 0.480548 |
629f2aa8c250c5429b92f9b163e66ccfeed5d657 | 10,397 | py | Python | koku/reporting/models.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | 2 | 2022-01-12T03:42:39.000Z | 2022-01-12T03:42:40.000Z | koku/reporting/models.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | null | null | null | koku/reporting/models.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | 1 | 2021-07-21T09:33:59.000Z | 2021-07-21T09:33:59.000Z | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Models for cost entry tables."""
# flake8: noqa
from reporting.partition.models import PartitionedTable
from reporting.provider.all.openshift.models import OCPAllComputeSummary
from reporting.provider.all.openshift.models import OCPAllCostLineIt... | 47.474886 | 93 | 0.864576 |
696f429ae60040e78d3a38bfc8fda8b41117b048 | 316 | py | Python | constants.py | StevePirateX/recurring-chores | a682ac8b9d9bc050e6f4c19941524999b1d5951f | [
"MIT"
] | null | null | null | constants.py | StevePirateX/recurring-chores | a682ac8b9d9bc050e6f4c19941524999b1d5951f | [
"MIT"
] | null | null | null | constants.py | StevePirateX/recurring-chores | a682ac8b9d9bc050e6f4c19941524999b1d5951f | [
"MIT"
] | null | null | null | VERSION = "0.3"
PRINT_INPUT_CHORE_LIST = False
TEST_MODE = False
TEST_ITERATIONS = 10000
# Default values for config import
CHORE_LIST_CSV_NAME = "chore_list.csv"
NUM_CHORES = 1
# Default CSV File
CSV_HEADERS = "Chore,Frequency (every x days),Description"
CSV_DEFAULT_ROW = "Demo Chore, 7, Demo chore description"
| 24.307692 | 58 | 0.778481 |
43f11f15a49bd36c2028ac01e96f9ab77af58c94 | 3,221 | py | Python | tests/workflow_tests/test_storage.py | acidburn0zzz/cloudify-manager | ee2224c52347f7461a95976179ab61aee74a49dd | [
"Apache-2.0"
] | 1 | 2015-11-03T14:27:11.000Z | 2015-11-03T14:27:11.000Z | tests/workflow_tests/test_storage.py | acidburn0zzz/cloudify-manager | ee2224c52347f7461a95976179ab61aee74a49dd | [
"Apache-2.0"
] | 2 | 2021-03-20T05:33:19.000Z | 2021-03-26T00:38:21.000Z | tests/workflow_tests/test_storage.py | acidburn0zzz/cloudify-manager | ee2224c52347f7461a95976179ab61aee74a49dd | [
"Apache-2.0"
] | 1 | 2019-10-29T06:15:31.000Z | 2019-10-29T06:15:31.000Z | ########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... | 42.381579 | 79 | 0.65104 |
99db158c01249c0f524e1c952f392023bb0633d8 | 4,095 | py | Python | scrapy/resolver.py | gaelleboy/scrapy | ed95f41ce5e75404442a8f96bddeec382df56d34 | [
"BSD-3-Clause"
] | null | null | null | scrapy/resolver.py | gaelleboy/scrapy | ed95f41ce5e75404442a8f96bddeec382df56d34 | [
"BSD-3-Clause"
] | null | null | null | scrapy/resolver.py | gaelleboy/scrapy | ed95f41ce5e75404442a8f96bddeec382df56d34 | [
"BSD-3-Clause"
] | null | null | null | from twisted.internet import defer
from twisted.internet.base import ThreadedResolver
from twisted.internet.interfaces import IHostResolution, IHostnameResolver, IResolutionReceiver, IResolverSimple
from zope.interface.declarations import implementer, provider
from scrapy.utils.datatypes import LocalCache
# TODO: ca... | 32.5 | 112 | 0.676679 |
2cf841133d613f2bb6b9eb042542be8d77b2c2c4 | 3,512 | py | Python | nr.fs/src/nr/fs/_tempfile.py | NiklasRosenstein/nr-python | dc5b31ae5773ea4522a6f35112792dde9e872bef | [
"MIT"
] | 3 | 2018-11-20T22:19:35.000Z | 2020-10-31T09:23:53.000Z | nr.fs/src/nr/fs/_tempfile.py | NiklasRosenstein/python-nr | dc5b31ae5773ea4522a6f35112792dde9e872bef | [
"MIT"
] | 3 | 2021-08-09T00:14:26.000Z | 2021-08-09T00:28:27.000Z | nr.fs/src/nr/fs/_tempfile.py | NiklasRosenstein/nr-python | dc5b31ae5773ea4522a6f35112792dde9e872bef | [
"MIT"
] | 3 | 2019-03-22T06:15:17.000Z | 2020-10-31T09:23:53.000Z | # -*- coding: utf8 -*-
# Copyright (c) 2019 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, mo... | 26.014815 | 83 | 0.692198 |
e7342a67a3b97193b26edf0bf0b927a1975fdfcb | 248 | py | Python | dice_classes.py | Winter259/easy-dice-roll | b5eba26932946ab3b2ebe0fdbaeaca74e55d40ad | [
"MIT"
] | null | null | null | dice_classes.py | Winter259/easy-dice-roll | b5eba26932946ab3b2ebe0fdbaeaca74e55d40ad | [
"MIT"
] | null | null | null | dice_classes.py | Winter259/easy-dice-roll | b5eba26932946ab3b2ebe0fdbaeaca74e55d40ad | [
"MIT"
] | null | null | null | __author__ = 'Simon'
from dice_fnc import *
class Dice(object):
def __init__(self):
self.type = choose_dice_type()
def change_type(self):
self.type = choose_dice_type()
def roll_this_dice(self):
roll_dice(self) | 22.545455 | 38 | 0.657258 |
2c2272295b0c1c49d9672f2ff0655ac38d4dbcdb | 3,460 | py | Python | code.py | AbhishekKumarRoy/olympics-data-analysis | e5c97f90a96d7bd392c2b2a4ac4f6b9c122236ea | [
"MIT"
] | null | null | null | code.py | AbhishekKumarRoy/olympics-data-analysis | e5c97f90a96d7bd392c2b2a4ac4f6b9c122236ea | [
"MIT"
] | null | null | null | code.py | AbhishekKumarRoy/olympics-data-analysis | e5c97f90a96d7bd392c2b2a4ac4f6b9c122236ea | [
"MIT"
] | null | null | null | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file is stored in the variable path
#Code starts here
# Data Loading (Step 1)
data = pd.read_csv(path)
data.rename(columns = {"Total": "Total_Medals"}, inplace = True)
data.head(10)
# Summe... | 27.460317 | 107 | 0.732948 |
19b7ec977847d5372f44ee37118ba4d4284922d3 | 640 | py | Python | tests/xlfunctions_vs_excel/irr_test.py | ckp95/xlcalculator | 8f3f04a2a0a2ecb12c3d5837a5b13519137ae427 | [
"MIT"
] | 54 | 2020-04-26T09:18:29.000Z | 2022-03-30T08:47:45.000Z | tests/xlfunctions_vs_excel/irr_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 41 | 2020-05-04T04:12:36.000Z | 2022-01-31T02:41:05.000Z | tests/xlfunctions_vs_excel/irr_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 21 | 2020-05-21T20:49:23.000Z | 2022-02-20T14:15:56.000Z | from .. import testing
class IRRTest(testing.FunctionalTestCase):
filename = "IRR.xlsx"
def test_evaluation_A1(self):
self.assertAlmostEqual(
self.evaluator.get_cell_value('Sheet1!A1'),
self.evaluator.evaluate('Sheet1!A1')
)
def test_evaluation_B1(self):
s... | 26.666667 | 55 | 0.623438 |
334392537e3668a6ce009c931757759827158118 | 9,741 | py | Python | pennylane/gradients/__init__.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | 1 | 2022-01-21T15:20:20.000Z | 2022-01-21T15:20:20.000Z | pennylane/gradients/__init__.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | null | null | null | pennylane/gradients/__init__.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | 31.833333 | 94 | 0.700339 |
013eb778840cf462632b6d8a22936cae9ac822c8 | 1,682 | py | Python | pygame_menu/examples/other/widget_positioning.py | dcartman/pygame-menu | 52a823b9121aadd6893fb878150d613ab516fcac | [
"MIT"
] | null | null | null | pygame_menu/examples/other/widget_positioning.py | dcartman/pygame-menu | 52a823b9121aadd6893fb878150d613ab516fcac | [
"MIT"
] | null | null | null | pygame_menu/examples/other/widget_positioning.py | dcartman/pygame-menu | 52a823b9121aadd6893fb878150d613ab516fcac | [
"MIT"
] | null | null | null | """
pygame-menu
https://github.com/ppizarror/pygame-menu
EXAMPLE - WIDGET POSITIONING
Test widget positioning example.
"""
import pygame_menu
from pygame_menu.examples import create_example_window
# Create the surface
surface = create_example_window('Example - Widget Positioning', (640, 480))
# Create a custom them... | 21.844156 | 114 | 0.693817 |
e13f86275ac53900079f33d7b42eae045c7e908c | 31,190 | py | Python | analysis.py | aschelle/Thing2Vec | 7b5d68cf47109b8d67eba492f8f119672721e4e1 | [
"MIT"
] | null | null | null | analysis.py | aschelle/Thing2Vec | 7b5d68cf47109b8d67eba492f8f119672721e4e1 | [
"MIT"
] | null | null | null | analysis.py | aschelle/Thing2Vec | 7b5d68cf47109b8d67eba492f8f119672721e4e1 | [
"MIT"
] | null | null | null | import wordvectors.physicaldata.tools as tools
import wordvectors.physicaldata.creation as creation
import wordvectors.thing2vec as t2v
from enum import Enum
import numpy as np
import collections
import random
class Question_Mode (Enum):
"""
Specifies how the answer given by the neural net is inter... | 48.058552 | 191 | 0.629144 |
c86f0e98b79cc7e0aa44bfbbc6897f10181c5c30 | 6,781 | py | Python | src/models/GravNet.py | InProgress18/GNN_code | 339a0773b85d2e65e198446f54c15a48ad125674 | [
"BSD-3-Clause"
] | null | null | null | src/models/GravNet.py | InProgress18/GNN_code | 339a0773b85d2e65e198446f54c15a48ad125674 | [
"BSD-3-Clause"
] | 1 | 2022-02-11T19:15:55.000Z | 2022-02-11T19:15:55.000Z | src/models/GravNet.py | InProgress18/GNN_code | 339a0773b85d2e65e198446f54c15a48ad125674 | [
"BSD-3-Clause"
] | 2 | 2020-07-27T22:44:29.000Z | 2021-01-22T05:21:18.000Z | # torch geometric implementation of network introduced in arXiv:1902.07987
import torch
import torch.nn as nn
import numpy as np
# this network has two outputs with different numbers of features
# the two outputs are called "spatial" and "learned" based on usage in GravNet
class DoubleOutputNetwork(nn.Module):
de... | 40.849398 | 152 | 0.645038 |
4bcafa6a3c037cba9fc6f3d39372e879ed27b198 | 21,229 | py | Python | curator/interfaces/vnv_components_interface.py | juanlucruz/tng-vnv-curator | 0ce5ff79cae406e64ce257fa746ecc3590e17e7d | [
"Apache-2.0"
] | 1 | 2022-03-04T16:02:22.000Z | 2022-03-04T16:02:22.000Z | curator/interfaces/vnv_components_interface.py | juanlucruz/tng-vnv-curator | 0ce5ff79cae406e64ce257fa746ecc3590e17e7d | [
"Apache-2.0"
] | 15 | 2019-03-05T22:22:25.000Z | 2019-12-12T13:52:46.000Z | curator/interfaces/vnv_components_interface.py | juanlucruz/tng-vnv-curator | 0ce5ff79cae406e64ce257fa746ecc3590e17e7d | [
"Apache-2.0"
] | 2 | 2019-02-18T13:20:48.000Z | 2019-03-05T21:27:10.000Z | # Copyright (c) 2019 5GTANGO
# ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.532588 | 122 | 0.56875 |
fb13b3eceb65208514d8d90465afdd7d8e44c9c9 | 935 | py | Python | task_inventory/order_31_to_60/order_33_different_charts.py | flyingSprite/spinelle | 57834368abb5fb4eb73a8fb29226a30014254e40 | [
"MIT"
] | 1 | 2016-07-22T01:58:53.000Z | 2016-07-22T01:58:53.000Z | task_inventory/order_31_to_60/order_33_different_charts.py | flyingSprite/spinelle | 57834368abb5fb4eb73a8fb29226a30014254e40 | [
"MIT"
] | 5 | 2016-07-26T02:02:47.000Z | 2018-05-16T08:08:42.000Z | task_inventory/order_31_to_60/order_33_different_charts.py | flyingSprite/spinelle | 57834368abb5fb4eb73a8fb29226a30014254e40 | [
"MIT"
] | null | null | null |
# plot a sine wave from 0 to 4pi
import pylab as lib
class DifferentCharts(object):
@staticmethod
def draw_sin_chart():
x_values = lib.arange(0.0, lib.math.pi * 4, 0.01)
y_values = lib.sin(x_values)
lib.plot(x_values, y_values, linewidth=1.0)
lib.xlabel('x')
lib.ylab... | 23.974359 | 57 | 0.589305 |
05e0952bf4c50b9107fdeb10263b6b9e068932c9 | 2,433 | py | Python | Jun_14.py | keiraaaaa/Leetcode | 90bf174f5613c79119aec58a1f0d1d2c1c3496bb | [
"MIT"
] | null | null | null | Jun_14.py | keiraaaaa/Leetcode | 90bf174f5613c79119aec58a1f0d1d2c1c3496bb | [
"MIT"
] | null | null | null | Jun_14.py | keiraaaaa/Leetcode | 90bf174f5613c79119aec58a1f0d1d2c1c3496bb | [
"MIT"
] | null | null | null | '''
############################
# 142. Linked List Cycle II
############################
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def detectCycle(self, head):
"""
:type head: ListNo... | 22.321101 | 81 | 0.491985 |
48d78d82fd9441b33703a650065438cfabaa4b9b | 4,101 | py | Python | configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/atrw/res152_atrw_256x256.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/atrw/res152_atrw_256x256.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/atrw/res152_atrw_256x256.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/atrw.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... | 28.089041 | 79 | 0.61863 |
d78a78e190bd7b35bc01af17c5af134bb59f332d | 4,085 | py | Python | extractor/network/ResNet34.py | Mingqi-Yuan/ConvolutionBox | 446fa8eeac7852fee3fcd0b4391fdcb82ce25552 | [
"MIT"
] | 13 | 2019-03-28T02:15:56.000Z | 2020-03-09T11:26:56.000Z | extractor/network/ResNet34.py | Mingqi-Yuan/ConvolutionBox | 446fa8eeac7852fee3fcd0b4391fdcb82ce25552 | [
"MIT"
] | null | null | null | extractor/network/ResNet34.py | Mingqi-Yuan/ConvolutionBox | 446fa8eeac7852fee3fcd0b4391fdcb82ce25552 | [
"MIT"
] | 3 | 2019-04-02T02:57:11.000Z | 2020-05-04T04:59:26.000Z | """
MIT License
Copyright (c) 2019 Mingqi Yuan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, d... | 40.04902 | 120 | 0.701591 |
1e67d5a86a0361bf479204dab1b08bb67eb94217 | 7,308 | py | Python | test/python/pulse/test_cmd_def.py | diego-plan9/qiskit-terra | a4120d70bd631ad2add228fdb1f86706bc5f2339 | [
"Apache-2.0"
] | 1 | 2018-05-29T03:58:03.000Z | 2018-05-29T03:58:03.000Z | test/python/pulse/test_cmd_def.py | diego-plan9/qiskit-terra | a4120d70bd631ad2add228fdb1f86706bc5f2339 | [
"Apache-2.0"
] | 3 | 2018-11-13T17:33:37.000Z | 2018-12-03T09:35:00.000Z | test/python/pulse/test_cmd_def.py | diego-plan9/qiskit-terra | a4120d70bd631ad2add228fdb1f86706bc5f2339 | [
"Apache-2.0"
] | 2 | 2017-12-03T15:48:14.000Z | 2018-03-11T13:08:03.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 38.87234 | 98 | 0.6211 |
95e27a45ad193d012d8b4fea3c7658abd0698045 | 273 | py | Python | graystruct/tests/__init__.py | kondalrao/graystruct | dc068b69c35fa625664982d6b044547c4a82e134 | [
"BSD-3-Clause"
] | 3 | 2015-08-14T08:12:24.000Z | 2018-06-15T09:52:34.000Z | graystruct/tests/__init__.py | kondalrao/graystruct | dc068b69c35fa625664982d6b044547c4a82e134 | [
"BSD-3-Clause"
] | 2 | 2015-03-01T21:42:26.000Z | 2015-03-01T21:56:16.000Z | graystruct/tests/__init__.py | kondalrao/graystruct | dc068b69c35fa625664982d6b044547c4a82e134 | [
"BSD-3-Clause"
] | 2 | 2019-05-09T21:38:19.000Z | 2019-11-24T20:47:41.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Simon Jagoe and Enthought Ltd
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import
| 34.125 | 69 | 0.750916 |
969b037978a813623d884e203c360c428e57b08f | 331 | py | Python | CodeSignal/Arcade/The_Core/Level_07_Book_Market/055_Find_Email_Domain.py | Zubieta/CPP | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 8 | 2017-03-02T07:56:45.000Z | 2021-08-07T20:20:19.000Z | CodeSignal/Arcade/The_Core/Level_07_Book_Market/055_Find_Email_Domain.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | null | null | null | CodeSignal/Arcade/The_Core/Level_07_Book_Market/055_Find_Email_Domain.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 1 | 2021-08-07T20:20:20.000Z | 2021-08-07T20:20:20.000Z | # https://app.codesignal.com/arcade/code-arcade/book-market/TXFLopNcCNbJLQivP
def findEmailDomain(address):
# Find the domain of a given email address, be careful
# with @ signs previous to the actual one, the address
# may not be valid but we still want the domain!
parts = address.split("@")
return... | 41.375 | 77 | 0.716012 |
71d5460ea4a4105ba87772bbe94df08ade0aed0a | 287 | py | Python | enterprise_course_api/users/apps.py | Wetrain/mmu-course-api | b304a5a26459c8fecdba4c5b10bfdf93a4b2ac54 | [
"MIT"
] | null | null | null | enterprise_course_api/users/apps.py | Wetrain/mmu-course-api | b304a5a26459c8fecdba4c5b10bfdf93a4b2ac54 | [
"MIT"
] | null | null | null | enterprise_course_api/users/apps.py | Wetrain/mmu-course-api | b304a5a26459c8fecdba4c5b10bfdf93a4b2ac54 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'enterprise_course_api.users'
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
pass
| 20.5 | 40 | 0.61324 |
8e87737751c12ec3b09caa575521e5cafab4c0f0 | 991 | py | Python | data/train/python/8e87737751c12ec3b09caa575521e5cafab4c0f0setup_controllers.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/8e87737751c12ec3b09caa575521e5cafab4c0f0setup_controllers.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/8e87737751c12ec3b09caa575521e5cafab4c0f0setup_controllers.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | #! /usr/bin/env python
import os, roslib, time
roslib.load_manifest('openrave_actionlib')
roslib.load_manifest('pr2_controller_manager')
import rospy, sys
import rosparam
import yaml
from pr2_controller_manager import pr2_controller_manager_interface
from pr2_mechanism_msgs.msg import MechanismStatistics
from pr2_mech... | 41.291667 | 122 | 0.860747 |
f179c830e41c62afcfce6bf18e1c6486b1d3813c | 7,016 | py | Python | bot/src/tests/yellowbot/storage/_test_datastorestorageservice.py | rainbowbreeze/yellowbutler | 1dac7d312fce78127cac45f17da526c6a66be36a | [
"Apache-2.0"
] | null | null | null | bot/src/tests/yellowbot/storage/_test_datastorestorageservice.py | rainbowbreeze/yellowbutler | 1dac7d312fce78127cac45f17da526c6a66be36a | [
"Apache-2.0"
] | null | null | null | bot/src/tests/yellowbot/storage/_test_datastorestorageservice.py | rainbowbreeze/yellowbutler | 1dac7d312fce78127cac45f17da526c6a66be36a | [
"Apache-2.0"
] | null | null | null | """Test Firestore in Datastore more storage service
"""
from typing import Any, Dict
from unittest import TestCase
import os
import datetime
from yellowbot.storage.datastorestorageservice import DatastoreStorageService, BaseEntity
class DummyEntity(BaseEntity):
"""Entity to store information during this test
... | 39.863636 | 107 | 0.687286 |
4b7c99422eab207e3c74c8468e14e0431940461b | 424 | py | Python | importer/tests/test_cc_egov.py | cyroxx/meine-stadt-transparent | d5a3f03a29a1bb97ce50ac5257d8bbd5208d9218 | [
"MIT"
] | null | null | null | importer/tests/test_cc_egov.py | cyroxx/meine-stadt-transparent | d5a3f03a29a1bb97ce50ac5257d8bbd5208d9218 | [
"MIT"
] | null | null | null | importer/tests/test_cc_egov.py | cyroxx/meine-stadt-transparent | d5a3f03a29a1bb97ce50ac5257d8bbd5208d9218 | [
"MIT"
] | null | null | null | import logging
from importer.loader import CCEgovLoader
from importer.tests.utils import spurious_500
logger = logging.getLogger(__name__)
def test_spurious_500(caplog):
spurious_500(CCEgovLoader)
assert caplog.messages == [
"Got an 500 for a CC e-gov request, retrying: 500 Server Error: "
"... | 28.266667 | 106 | 0.733491 |
0a988914165f88a2f87a8ac731581677d575c24b | 16,296 | py | Python | det3d/core/sampler/sample_ops.py | reinforcementdriving/CIA-SSD | f7b4a9ed4a2b852845303efc6c972125438817a6 | [
"Apache-2.0"
] | 382 | 2020-12-05T06:46:28.000Z | 2022-03-29T17:40:58.000Z | det3d/core/sampler/sample_ops.py | reinforcementdriving/CIA-SSD | f7b4a9ed4a2b852845303efc6c972125438817a6 | [
"Apache-2.0"
] | 28 | 2020-12-08T07:50:57.000Z | 2022-03-20T03:54:43.000Z | det3d/core/sampler/sample_ops.py | reinforcementdriving/CIA-SSD | f7b4a9ed4a2b852845303efc6c972125438817a6 | [
"Apache-2.0"
] | 57 | 2020-12-10T02:19:03.000Z | 2022-03-19T09:49:38.000Z | import copy
import pathlib
import pickle
import time
from functools import partial, reduce
import numpy as np
from det3d.core.bbox import box_np_ops
from det3d.core.sampler import preprocess as prep
from det3d.utils.check import shape_mergeable
class DataBaseSamplerV2:
def __init__(
self,
db_info... | 45.016575 | 150 | 0.548908 |
ad413a69f52cdb2848f81da89ad1884177903cc9 | 3,839 | py | Python | services/core-api/app/api/incidents/response_models.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 1 | 2021-09-17T20:41:45.000Z | 2021-09-17T20:41:45.000Z | services/core-api/app/api/incidents/response_models.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | null | null | null | services/core-api/app/api/incidents/response_models.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | null | null | null | from app.extensions import api
from flask_restplus import fields
MINE_INCIDENT_CATEGORY_MODEL = api.model(
'Mine Incident Category', {
'mine_incident_category_code': fields.String,
'description': fields.String,
'display_order': fields.Integer,
'active_ind': fields.Boolean
})
MI... | 39.173469 | 90 | 0.70956 |
b09d5473bb0f3be24e685a8e3541256dabe53694 | 71 | py | Python | chapter-supplement/Ex_01.py | yuetsin/CS-902 | ae945f55944830ed3c6e4d71cfff2798cdf571ac | [
"MIT"
] | 1 | 2019-05-16T11:00:40.000Z | 2019-05-16T11:00:40.000Z | chapter-supplement/Ex_01.py | yuetsin/CS-902 | ae945f55944830ed3c6e4d71cfff2798cdf571ac | [
"MIT"
] | null | null | null | chapter-supplement/Ex_01.py | yuetsin/CS-902 | ae945f55944830ed3c6e4d71cfff2798cdf571ac | [
"MIT"
] | null | null | null | # Exercise 1
print raw_input("Please input a string... >>>")[::-1]
| 17.75 | 54 | 0.591549 |
1f50c6dc528b445d374d1861814ac6679546b769 | 690 | py | Python | sarikasama/0008/0008.py | saurabh896/python-1 | f8d3aedf4c0fe6e24dfa3269ea7e642c9f7dd9b7 | [
"MIT"
] | 3,976 | 2015-01-01T15:49:39.000Z | 2022-03-31T03:47:56.000Z | sarikasama/0008/0008.py | dwh65416396/python | 1a7e3edd1cd3422cc0eaa55471a0b42e004a9a1a | [
"MIT"
] | 97 | 2015-01-11T02:59:46.000Z | 2022-03-16T14:01:56.000Z | sarikasama/0008/0008.py | dwh65416396/python | 1a7e3edd1cd3422cc0eaa55471a0b42e004a9a1a | [
"MIT"
] | 3,533 | 2015-01-01T06:19:30.000Z | 2022-03-28T13:14:54.000Z | #!/usr/bin/env pyhton3
#get the text in a html file
import re, urllib.request
def get_text(url):
content = url.read()
try:
content = content.decode('utf-8')
except:
content = content.decode('gbk')
content = re.sub(r'<script.+?</script>', '', content, flags = re.DOTALL)
content = r... | 25.555556 | 76 | 0.575362 |
0ab0328f0c909ba6cebd7e2ba10d5894d9ecbd75 | 7,204 | py | Python | tests/test_jsondict.py | ac-optimus/signac | 43a5519531cc8cc44199c9251d0fd4e6208b5bdb | [
"BSD-3-Clause"
] | 1 | 2020-12-28T18:00:24.000Z | 2020-12-28T18:00:24.000Z | tests/test_jsondict.py | ac-optimus/signac | 43a5519531cc8cc44199c9251d0fd4e6208b5bdb | [
"BSD-3-Clause"
] | 81 | 2020-12-28T20:23:57.000Z | 2022-03-01T06:03:40.000Z | tests/test_jsondict.py | admdev8/signac | d639e682ca7ebaff781d68621a2d86cc26de04b9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
import os
import pytest
import uuid
from tempfile import TemporaryDirectory
from signac.core.jsondict import JSONDict
from signac.errors import InvalidKeyError
from signac.e... | 26.880597 | 91 | 0.551083 |
bab7dd50b346050ad2a124737006d382bbb602e7 | 152 | py | Python | 4_loop/1_Zweierreihe.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 4_loop/1_Zweierreihe.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 4_loop/1_Zweierreihe.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Zweierreihe
Wie kannst du die Zweierreihe bis 10 auf der Konsole ausgeben?
"""
for i in range(1, 11):
print(i, 'Element:')
print(2*i)
| 13.818182 | 62 | 0.631579 |
14d6a86ad7cc650979e3962389fbb01b31890997 | 2,066 | py | Python | xd/build/core/data/namespace.py | XD-embedded/xd-build-core | 357e4d78d35456d6906aa30151ddc989781227ab | [
"MIT"
] | 1 | 2020-11-27T23:34:53.000Z | 2020-11-27T23:34:53.000Z | xd/build/core/data/namespace.py | XD-embedded/xd-build-core | 357e4d78d35456d6906aa30151ddc989781227ab | [
"MIT"
] | 6 | 2015-10-30T12:22:56.000Z | 2016-08-25T09:38:48.000Z | xd/build/core/data/namespace.py | XD-embedded/xd-build-core | 357e4d78d35456d6906aa30151ddc989781227ab | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
from .var import *
from .expr import *
from .wrap import *
__all__ = ['Namespace', 'MultiBinding']
class MultiBinding(Exception):
'''Variable binding to multiple names not allowed.
For setting one (named) variable to reference th... | 26.831169 | 78 | 0.60455 |
1f2d722aca0fccb6ad64a2cf053ec83c4b707fc9 | 8,903 | py | Python | python-package/xgboost/training.py | saurav111/xgboost | a13a3d1552610df734566df9a4e283560eef8981 | [
"Apache-2.0"
] | null | null | null | python-package/xgboost/training.py | saurav111/xgboost | a13a3d1552610df734566df9a4e283560eef8981 | [
"Apache-2.0"
] | null | null | null | python-package/xgboost/training.py | saurav111/xgboost | a13a3d1552610df734566df9a4e283560eef8981 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# pylint: disable=too-many-locals, too-many-arguments, invalid-name
"""Training Library containing training routines."""
from __future__ import absolute_import
import sys
import re
import numpy as np
from .core import Booster, STRING_TYPES
def train(params, dtrain, num_boost_round=10, evals=(), obj=No... | 35.189723 | 94 | 0.585196 |
fb31fbda193654d2e07af5a01959069a1a8349b6 | 2,340 | py | Python | tests/base/test_sampling_method.py | ajrox090/VaRA-Tool-Suite | 1550d36a4049e0615afb0bacfb96b1d506a29c98 | [
"BSD-2-Clause"
] | 8 | 2019-10-30T08:07:44.000Z | 2020-11-13T08:02:36.000Z | tests/base/test_sampling_method.py | ajrox090/VaRA-Tool-Suite | 1550d36a4049e0615afb0bacfb96b1d506a29c98 | [
"BSD-2-Clause"
] | 342 | 2019-02-14T15:53:31.000Z | 2020-11-03T18:11:27.000Z | tests/base/test_sampling_method.py | ajrox090/VaRA-Tool-Suite | 1550d36a4049e0615afb0bacfb96b1d506a29c98 | [
"BSD-2-Clause"
] | 5 | 2021-04-28T17:05:16.000Z | 2022-03-31T23:11:22.000Z | """Test module for sampling method tests."""
import typing as tp
import unittest
from varats.base.sampling_method import (
NormalSamplingMethod,
SamplingMethodBase,
UniformSamplingMethod,
)
class TestSamplingMethodBase(unittest.TestCase):
"""Test if SamplingMethodBase is working."""
def test_re... | 33.428571 | 81 | 0.663248 |
a08627aad093200c27139eefc568235c5fac2b3c | 33,944 | py | Python | fbgemm_gpu/bench/split_table_batched_embeddings_benchmark.py | caogao/FBGEMM | ffc2e1a91e2ae283bccb6448b5e6020d871af7cc | [
"BSD-3-Clause"
] | null | null | null | fbgemm_gpu/bench/split_table_batched_embeddings_benchmark.py | caogao/FBGEMM | ffc2e1a91e2ae283bccb6448b5e6020d871af7cc | [
"BSD-3-Clause"
] | null | null | null | fbgemm_gpu/bench/split_table_batched_embeddings_benchmark.py | caogao/FBGEMM | ffc2e1a91e2ae283bccb6448b5e6020d871af7cc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import time
from typing import Callable, Dict, List, Optional, Tuple
import... | 32.451243 | 182 | 0.593802 |
2b6fbb2b88349e82aaf5ffc1cdf1bf2bd30bc470 | 1,421 | py | Python | scikit-learn/tree_dtc.py | kingreatwill/penter | 2d027fd2ae639ac45149659a410042fe76b9dab0 | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | scikit-learn/tree_dtc.py | kingreatwill/penter | 2d027fd2ae639ac45149659a410042fe76b9dab0 | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | scikit-learn/tree_dtc.py | kingreatwill/penter | 2d027fd2ae639ac45149659a410042fe76b9dab0 | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | import graphviz
from sklearn import tree, datasets
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
wine = datasets.load_wine()
Xtrain, Xtest, Ytrain, Ytest = train_test_split(wine.data,wine.target,test_size=0.3)
clf = tree.DecisionTreeClassifier(criterion="entropy"
... | 32.295455 | 105 | 0.513723 |
cc7ec806a6713a9a141c960a59d187fa76bb3400 | 6,984 | py | Python | scripts/test/run_test_suite.py | zys-contrib/devtools-frontend | 49ae10d02a40b48418788461bb50a19927f7b06a | [
"BSD-3-Clause"
] | null | null | null | scripts/test/run_test_suite.py | zys-contrib/devtools-frontend | 49ae10d02a40b48418788461bb50a19927f7b06a | [
"BSD-3-Clause"
] | null | null | null | scripts/test/run_test_suite.py | zys-contrib/devtools-frontend | 49ae10d02a40b48418788461bb50a19927f7b06a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env vpython3
#
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Run tests on a pinned version of chrome.
DEPRECATED: please use run_test_suite.js instead.
"""
import argparse
import os
impor... | 31.890411 | 170 | 0.610968 |
93ccc3c024e0ecb51443c1fc27e96d6281c10516 | 18,358 | py | Python | gdal/swig/python/osgeo/gdal_array.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | gdal/swig/python/osgeo/gdal_array.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | gdal/swig/python/osgeo/gdal_array.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (... | 37.773663 | 130 | 0.638087 |
5146692ca1929874c44fdf7a95bb18c5cabb70f2 | 115 | py | Python | turbopy/__version__.py | AOstenfeld/turbopy | dc58f6482bd99385574a229739a32bcf3fb18fb2 | [
"CC0-1.0"
] | 12 | 2020-06-01T14:01:50.000Z | 2021-11-29T01:09:55.000Z | turbopy/__version__.py | AOstenfeld/turbopy | dc58f6482bd99385574a229739a32bcf3fb18fb2 | [
"CC0-1.0"
] | 143 | 2020-05-30T13:18:34.000Z | 2021-08-25T13:27:10.000Z | turbopy/__version__.py | AOstenfeld/turbopy | dc58f6482bd99385574a229739a32bcf3fb18fb2 | [
"CC0-1.0"
] | 34 | 2020-05-30T12:06:02.000Z | 2021-07-23T14:22:37.000Z | """Define a version number for turboPy"""
VERSION = ('2020', '10', '14')
__version__ = '.'.join(map(str, VERSION))
| 28.75 | 41 | 0.634783 |
015622962824126bfdda5307d81c61cbe7cbc909 | 6,228 | py | Python | LogAnalysis/flowprocess.py | WenPeiyu/LianjiaSpider | 9d4fd31df0120c756fbbd625b66f2fee4fe17891 | [
"MIT"
] | null | null | null | LogAnalysis/flowprocess.py | WenPeiyu/LianjiaSpider | 9d4fd31df0120c756fbbd625b66f2fee4fe17891 | [
"MIT"
] | null | null | null | LogAnalysis/flowprocess.py | WenPeiyu/LianjiaSpider | 9d4fd31df0120c756fbbd625b66f2fee4fe17891 | [
"MIT"
] | null | null | null | import re
import pandas as pd
import pickle
from log import logger
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
class LogFlow:
"""
日志编码流
"""
def __init__(self, filepath):
"""
初始化对象
:param filepath: 欲处理的日志文件地址
"""
self.filepath = filepath
... | 34.40884 | 119 | 0.514451 |
7a51766bba3a8d47f51c606f8453e79c7e0d727f | 363 | py | Python | src/gym_rotors/envs/bebop_reach_position.py | prateeksamaiya/mythesis_copy | 67334fe0e206d8cc9625d8356a7035baa3cdc9b8 | [
"MIT"
] | null | null | null | src/gym_rotors/envs/bebop_reach_position.py | prateeksamaiya/mythesis_copy | 67334fe0e206d8cc9625d8356a7035baa3cdc9b8 | [
"MIT"
] | null | null | null | src/gym_rotors/envs/bebop_reach_position.py | prateeksamaiya/mythesis_copy | 67334fe0e206d8cc9625d8356a7035baa3cdc9b8 | [
"MIT"
] | 1 | 2019-06-03T17:16:23.000Z | 2019-06-03T17:16:23.000Z | from gym import utils
from gym_rotors.envs import bebop_env
class BebopReachPositionEnv(bebop_env.BebopEnv, utils.EzPickle):
def __init__(self, reward_type='sparse'):
bebop_env.BebopEnv.__init__(self, launchfile='bebop_reach_position.launch',
init_drone_pos=[0,0,0.5],n_actions=3,reward_type=reward_... | 45.375 | 83 | 0.768595 |
d7d3528a8e7dbefb75c561a8bb704dd1e009675a | 20,129 | py | Python | CondCore/Utilities/python/CondDBFW/querying.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 13 | 2015-11-30T15:49:45.000Z | 2022-02-08T16:11:30.000Z | CondCore/Utilities/python/CondDBFW/querying.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 640 | 2015-02-11T18:55:47.000Z | 2022-03-31T14:12:23.000Z | CondCore/Utilities/python/CondDBFW/querying.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 51 | 2015-08-11T21:01:40.000Z | 2022-03-30T07:31:34.000Z | """
connection class translates either a connection string for sqlite, oracle of frontier into a connection object.
Also sets up ORM with SQLAlchemy.
connection class can also take a pre-constructed engine - useful for web services.
"""
from __future__ import print_function
from __future__ import absolute_import
im... | 43.854031 | 154 | 0.57986 |
06f10e10522621bb75568c8c8f8cbbd37e2a177d | 1,702 | py | Python | lib/surface/bigtable/clusters/describe.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/bigtable/clusters/describe.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/bigtable/clusters/describe.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 34.04 | 79 | 0.750294 |
7b1cd0efcdf27e33841a290beeb721c9e29ae060 | 1,792 | py | Python | python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_over_height.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_over_height.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_over_height.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-09-24T11:23:36.000Z | 2021-09-24T11:23:36.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 32.581818 | 87 | 0.743304 |
6c3749bda6728cc42982627bb7dd8b124ef77461 | 494 | py | Python | donkeycar/__init__.py | MonikaFJ/donkeycar | 1cf227027951da476865b3f69e26ea749a8c0eec | [
"MIT"
] | 1 | 2022-01-03T13:09:42.000Z | 2022-01-03T13:09:42.000Z | donkeycar/__init__.py | JAHOON-JOO/donkeycar | e545c09d314ede51303657ad6d4c931c85307d09 | [
"MIT"
] | null | null | null | donkeycar/__init__.py | JAHOON-JOO/donkeycar | e545c09d314ede51303657ad6d4c931c85307d09 | [
"MIT"
] | null | null | null | __version__ = '4.0.1-dev'
print('using donkey v{} ...'.format(__version__))
import sys
if sys.version_info.major < 3:
msg = 'Donkey Requires Python 3.6 or greater. You are using {}'.format(sys.version)
raise ValueError(msg)
# The default recursion limits in CPython are too small.
sys.setrecursionlimit(10**5... | 23.52381 | 87 | 0.740891 |
89a9fc996c5d067f7663eed86064c33c03d2eec9 | 5,196 | py | Python | src/preprocess.py | devanshb26/i3d_keras | 511637275b90ff711d14233af23453ddb0070547 | [
"MIT"
] | null | null | null | src/preprocess.py | devanshb26/i3d_keras | 511637275b90ff711d14233af23453ddb0070547 | [
"MIT"
] | null | null | null | src/preprocess.py | devanshb26/i3d_keras | 511637275b90ff711d14233af23453ddb0070547 | [
"MIT"
] | null | null | null | import cv2
import os
import numpy as np
import argparse
SMALLEST_DIM = 256
IMAGE_CROP_SIZE = 224
FRAME_RATE = 25
# sample frames at 25 frames per second
def sample_video(video_path, path_output):
# for filename in os.listdir(video_path):
if video_path.endswith((".mp4", ".avi")):
# filename = video_pa... | 31.682927 | 122 | 0.665897 |
fd50c99d9d3035881f68d702db3207b9d33ec8e9 | 88 | py | Python | ex024.py | victorccard/RepoPython | 30e602c671b889cfcc7726cd2d7c90d647001fac | [
"MIT"
] | null | null | null | ex024.py | victorccard/RepoPython | 30e602c671b889cfcc7726cd2d7c90d647001fac | [
"MIT"
] | null | null | null | ex024.py | victorccard/RepoPython | 30e602c671b889cfcc7726cd2d7c90d647001fac | [
"MIT"
] | null | null | null | cid = str(input('Em que cidade você nasceu?')).strip()
print(cid[:5].upper() == 'SANTO') | 44 | 54 | 0.636364 |
81c4cc3ff9bf05df6f8faf2f0c2264a4d43e5cd5 | 24,576 | py | Python | test/functional/p2p_sendheaders.py | redecoinproject/redecoin | 9a27f0d4976fcc719a04218e0779fdc54d2dbaf2 | [
"MIT"
] | 2 | 2022-03-21T15:08:57.000Z | 2022-03-26T17:22:27.000Z | test/functional/p2p_sendheaders.py | redecoinproject/redecoin | 9a27f0d4976fcc719a04218e0779fdc54d2dbaf2 | [
"MIT"
] | null | null | null | test/functional/p2p_sendheaders.py | redecoinproject/redecoin | 9a27f0d4976fcc719a04218e0779fdc54d2dbaf2 | [
"MIT"
] | 1 | 2022-03-09T08:32:17.000Z | 2022-03-09T08:32:17.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test behavior of headers messages to announce blo... | 44.281081 | 193 | 0.636108 |
b2630593eb70dcc16f9fcc35bb50c6e989fb3c07 | 11,517 | py | Python | convert-log.py | perotom/nfc-nci-communication-parser | 058a4afd2d2167011343beac6401cd062370ed02 | [
"MIT"
] | null | null | null | convert-log.py | perotom/nfc-nci-communication-parser | 058a4afd2d2167011343beac6401cd062370ed02 | [
"MIT"
] | null | null | null | convert-log.py | perotom/nfc-nci-communication-parser | 058a4afd2d2167011343beac6401cd062370ed02 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from argparse import ArgumentParser
def parse(line):
bytes = bytearray.fromhex(line)
mt = (bytes[0] & 0b11100000) >> 5
if mt == 0:
file1.write(" MT: Data packet\n")
parseDataPacket(mt, bytes)
if mt == 1:
file1.write(" MT: Control packet - CMD\n")
par... | 32.08078 | 308 | 0.541547 |
558e2fb6e75d5162dd7b22c1783e3d5e0db52437 | 740,065 | py | Python | xml_rc.py | youufis/visioninfer | 45ce4c8ed47751d329c8eb3fb97fc686119cdca3 | [
"MIT"
] | null | null | null | xml_rc.py | youufis/visioninfer | 45ce4c8ed47751d329c8eb3fb97fc686119cdca3 | [
"MIT"
] | null | null | null | xml_rc.py | youufis/visioninfer | 45ce4c8ed47751d329c8eb3fb97fc686119cdca3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x01\x5b\x51\
\xff\
\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x02\x01\x00\x48\x00\
... | 66.73866 | 130 | 0.716357 |
bddb1013f49a89c0d62c0f9f5af54cb609725fcd | 463 | py | Python | data/scripts/templates/object/mobile/shared_dressed_rebel_corporal_bothan_male_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_dressed_rebel_corporal_bothan_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_dressed_rebel_corporal_bothan_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_rebel_corporal_bothan_male_01.iff"
result.attribute_te... | 27.235294 | 83 | 0.740821 |
4be7b74974234e2aa19099b4602f8e83c3d7bd1b | 148 | py | Python | metaci/plan/apps.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 48 | 2018-10-24T14:52:06.000Z | 2022-03-25T21:14:50.000Z | metaci/plan/apps.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 2,034 | 2018-10-31T20:59:16.000Z | 2022-03-22T21:38:03.000Z | metaci/plan/apps.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 27 | 2018-12-24T18:16:23.000Z | 2021-12-15T17:57:27.000Z | from django.apps import AppConfig
class PlanConfig(AppConfig):
name = "metaci.plan"
def ready(self):
import metaci.plan.handlers
| 16.444444 | 35 | 0.695946 |
a077c5bbafc42837839088c4e006809dd0c7ef5c | 1,547 | py | Python | examples/Grafana-Demo-FOREX-master/backgroundForex.py | ambitus/containers | 72b8eee2de8e484739cc45be0c2c50d7cabd6d0c | [
"Apache-2.0"
] | 4 | 2019-10-17T20:51:32.000Z | 2021-03-05T17:45:44.000Z | examples/Grafana-Demo-FOREX-master/backgroundForex.py | ambitus/containers | 72b8eee2de8e484739cc45be0c2c50d7cabd6d0c | [
"Apache-2.0"
] | 6 | 2020-07-14T14:25:13.000Z | 2021-02-20T10:19:32.000Z | examples/Grafana-Demo-FOREX-master/backgroundForex.py | ambitus/containers | 72b8eee2de8e484739cc45be0c2c50d7cabd6d0c | [
"Apache-2.0"
] | 6 | 2020-03-12T08:39:48.000Z | 2020-10-09T18:08:44.000Z | #Copyright Contributors to the Ambitus Project.
#
#SPDX-License-Identifier: Apache-2.0
import requests, json, os, logging, time
from elasticsearch import Elasticsearch
es = Elasticsearch([{'host': '### YOUR APPLIANCE URL HERE ###', 'port': '9200'}])
es.indices.create(index='forex')
mapping={
"pr... | 34.377778 | 82 | 0.529412 |
61087215ab6a3283110e64b32c880db99b1143cd | 3,191 | py | Python | examples/three_link_arm_block_pushing/run_3link_arm_pushing_2d.py | pangtao22/quasistatic_simulator | 7c6f99cc7237dd922f6eb0b54c580303e86b5223 | [
"MIT"
] | 5 | 2021-07-15T03:58:55.000Z | 2021-12-23T17:26:16.000Z | examples/three_link_arm_block_pushing/run_3link_arm_pushing_2d.py | pangtao22/quasistatic_simulator | 7c6f99cc7237dd922f6eb0b54c580303e86b5223 | [
"MIT"
] | 5 | 2021-08-16T22:27:54.000Z | 2022-02-07T18:06:07.000Z | examples/three_link_arm_block_pushing/run_3link_arm_pushing_2d.py | pangtao22/quasistatic_simulator | 7c6f99cc7237dd922f6eb0b54c580303e86b5223 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from examples.log_comparison import *
from examples.setup_simulations import shift_q_traj_to_start_at_minus_h
from examples.three_link_arm_block_pushing.utils import *
# box initial state.
q_u0 = np.array([1.7, 0.5, 0])
q0_dict_str = {robot_name: qa_knots[0], box_name: q_u0}
def calc_... | 37.541176 | 78 | 0.678784 |
ceb88de38c7114e4ca531c211fc0289fa522bc58 | 412 | py | Python | coding/learn_re/demo_datetime.py | yatao91/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | 3 | 2021-05-25T16:58:52.000Z | 2022-02-05T09:37:17.000Z | coding/learn_re/demo_datetime.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | coding/learn_re/demo_datetime.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
def time_re(start_time, stop_time):
if not re.match('^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}$', start_time) \
or not re.match('^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}$', stop_time):
print('error')
if __name__ == '__main__':
start_time = '20... | 27.466667 | 90 | 0.546117 |
a0130ae029719485e9d06466f2ea9412543a3d7b | 1,035 | py | Python | wagtail/tests/snippets/migrations/0005_multisectionrichtextsnippet_richtextsection.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/tests/snippets/migrations/0005_multisectionrichtextsnippet_richtextsection.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/tests/snippets/migrations/0005_multisectionrichtextsnippet_richtextsection.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | # -*- coding: utf-8 -*-
from django.db import migrations, models
import wagtail.core.fields
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('snippetstests', '0004_fileuploadsnippet'),
]
operations = [
migrations.CreateModel(
name='MultiSect... | 32.34375 | 160 | 0.590338 |
7e6e76b66630962810c81ee341a64f3a07e56c33 | 11,870 | py | Python | tests/unit/test_simulator_interface.py | nordicneurolab/vunit | c69c99512d7cebe915f77653b473853b495886d2 | [
"Artistic-2.0"
] | 3 | 2021-03-09T15:01:40.000Z | 2022-02-05T12:11:55.000Z | tests/unit/test_simulator_interface.py | noasic/vunit | 4d65f1283ede458f8941910cd40787edb7a9271c | [
"Artistic-2.0",
"Apache-2.0"
] | 4 | 2022-02-04T08:24:33.000Z | 2022-03-14T17:06:48.000Z | tests/unit/test_simulator_interface.py | noasic/vunit | 4d65f1283ede458f8941910cd40787edb7a9271c | [
"Artistic-2.0",
"Apache-2.0"
] | 4 | 2020-03-25T16:49:30.000Z | 2022-02-01T11:18:12.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2020, Lars Asplund lars.anders.asplund@gmail.com
"""
Test the SimulatorInterface class
"""
impor... | 33.817664 | 88 | 0.614659 |
dcd031dfc281dd4f019c626bd991843f8dd077b5 | 6,579 | py | Python | tests/python/pants_test/backend/jvm/tasks/test_consolidate_classpath.py | mcguigan/pants | e085d45669b72d0c51ab8a54602306fc76e07256 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_consolidate_classpath.py | mcguigan/pants | e085d45669b72d0c51ab8a54602306fc76e07256 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_consolidate_classpath.py | mcguigan/pants | e085d45669b72d0c51ab8a54602306fc76e07256 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import re
from typing import List
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.... | 48.375 | 100 | 0.595379 |
22f466e60dba83cc00b9204221d9b903bef636c8 | 2,307 | py | Python | __main__.py | christopherkopic/PictureToBytes | 95b93876bffdc4337056c5dcba6fc0c9322f6826 | [
"MIT"
] | null | null | null | __main__.py | christopherkopic/PictureToBytes | 95b93876bffdc4337056c5dcba6fc0c9322f6826 | [
"MIT"
] | null | null | null | __main__.py | christopherkopic/PictureToBytes | 95b93876bffdc4337056c5dcba6fc0c9322f6826 | [
"MIT"
] | null | null | null | from PIL import Image
from pathlib import Path
from itertools import zip_longest
import os
file_txt = "Icons.h"
def writeImg(file, pixels, sizeX, sizeY, name):
file.write("const unsigned int {0}_X = {1};\n".format(name, sizeX))
file.write("const unsigned int {0}_Y = {1};\n".format(name, sizeY))
file.writ... | 26.517241 | 80 | 0.577807 |
ed831c5f5160a0095dff4fd636c4e000f7349572 | 1,450 | py | Python | app/core/tests/test_models.py | datilp/recipe-app-api | c62e3c3429b10b354b741d491d90b8297b393a95 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | datilp/recipe-app-api | c62e3c3429b10b354b741d491d90b8297b393a95 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | datilp/recipe-app-api | c62e3c3429b10b354b741d491d90b8297b393a95 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
''' we use get_user_model instead of importing the user model directly
later on if we change the user model by using get_user_model we only
have to change the configuration
'''
class ModelTest(TestCase):
def test_create_user_... | 33.72093 | 72 | 0.668966 |
6c459df916356d23b053d07735ab3e0d79116975 | 6,843 | py | Python | exstracs/exstracs_prediction.py | bnanita/trafficapi | ba22faa609ce0f79b3791dca2c403591a26ee2e2 | [
"MIT"
] | null | null | null | exstracs/exstracs_prediction.py | bnanita/trafficapi | ba22faa609ce0f79b3791dca2c403591a26ee2e2 | [
"MIT"
] | null | null | null | exstracs/exstracs_prediction.py | bnanita/trafficapi | ba22faa609ce0f79b3791dca2c403591a26ee2e2 | [
"MIT"
] | null | null | null | """
Name: ExSTraCS_Prediction.py
Authors: Ryan Urbanowicz - Written at Dartmouth College, Hanover, NH, USA
Contact: ryan.j.urbanowicz@darmouth.edu
Created: April 25, 2014
Modified: August 25,2014
Description: Based on a given match set, this module uses a voting scheme to select the phenotype pred... | 56.090164 | 160 | 0.531346 |
807b0dc333f181bc98a2221cd5970c74e0c71fef | 46,938 | py | Python | droidlet/tools/hitl/vision_retrain/vision_annotation_jobs.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | 73 | 2021-09-14T19:24:45.000Z | 2022-03-27T06:43:26.000Z | droidlet/tools/hitl/vision_retrain/vision_annotation_jobs.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | 268 | 2021-09-14T22:40:23.000Z | 2022-03-31T23:01:54.000Z | droidlet/tools/hitl/vision_retrain/vision_annotation_jobs.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | 20 | 2021-09-14T19:24:47.000Z | 2022-03-30T19:03:44.000Z | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import logging
import os
import signal
import subprocess
import time
import csv
import yaml
import json
import copy
import boto3
from droidlet.tools.hitl.data_generator import DataGenerator
from mephisto.abstractions.databases.local_database import LocalMephist... | 32.892782 | 123 | 0.229729 |
7ed0b6e3a765c75a6f2595e28e43b8f25bbf87ee | 9,141 | py | Python | lib/models/dran_att.py | hongrui16/naic2020_B | 9321bdd19e7d2d47ac9c711eb8437cd364e25f44 | [
"MIT"
] | null | null | null | lib/models/dran_att.py | hongrui16/naic2020_B | 9321bdd19e7d2d47ac9c711eb8437cd364e25f44 | [
"MIT"
] | null | null | null | lib/models/dran_att.py | hongrui16/naic2020_B | 9321bdd19e7d2d47ac9c711eb8437cd364e25f44 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import math
# from network.utils import BNReLU
from torch.nn.functional import upsample
from torch.nn import Module, Sequential, Conv2d, ReLU,Ada... | 40.991031 | 122 | 0.565146 |
95e7ca09954789b9c13b23e600b2407359792321 | 18,340 | py | Python | nbgrader/apps/dbapp.py | aliniknejad/nbgrader | 124095e48a840ac2af6e3178eab7ed32089f3cd2 | [
"BSD-3-Clause"
] | 1 | 2019-10-02T11:06:32.000Z | 2019-10-02T11:06:32.000Z | nbgrader/apps/dbapp.py | aliniknejad/nbgrader | 124095e48a840ac2af6e3178eab7ed32089f3cd2 | [
"BSD-3-Clause"
] | 4 | 2019-03-02T11:49:46.000Z | 2020-09-07T10:17:52.000Z | nbgrader/apps/dbapp.py | aliniknejad/nbgrader | 124095e48a840ac2af6e3178eab7ed32089f3cd2 | [
"BSD-3-Clause"
] | 2 | 2019-05-31T08:53:48.000Z | 2019-05-31T09:42:26.000Z | #!/usr/bin/env python
# coding: utf-8
import csv
import os
import sys
import shutil
from textwrap import dedent
from traitlets import default, Unicode, Bool, List
from datetime import datetime
from . import NbGrader
from ..api import Gradebook, MissingEntry, Student, Assignment
from ..exchange import ExchangeList
fr... | 32.006981 | 136 | 0.604198 |
80040f2f694d2daa705c586a68289f3df217d4b4 | 5,055 | py | Python | fsdet/utils/video_visualizer.py | gist-ailab/FSCE | 94ba3f4737d5e40af795db49b8c6914526c912b6 | [
"Apache-2.0"
] | 189 | 2021-03-13T11:42:42.000Z | 2022-03-31T13:11:52.000Z | fsdet/utils/video_visualizer.py | gist-ailab/FSCE | 94ba3f4737d5e40af795db49b8c6914526c912b6 | [
"Apache-2.0"
] | 56 | 2021-03-18T12:02:28.000Z | 2022-03-24T15:12:57.000Z | fsdet/utils/video_visualizer.py | gist-ailab/FSCE | 94ba3f4737d5e40af795db49b8c6914526c912b6 | [
"Apache-2.0"
] | 35 | 2021-03-15T08:40:19.000Z | 2022-03-17T07:56:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import numpy as np
import pycocotools.mask as mask_util
from fsdet.utils.visualizer import (
ColorMode,
Visualizer,
_create_text_labels,
)
from .colormap import random_color
class _DetectedInstance:
"""
Used to store data abo... | 35.34965 | 96 | 0.610089 |
7fad70f14ffd581db93dce8c488d7dc965890fdf | 4,242 | py | Python | tests/plugins/test_check_and_set_platforms.py | sosiouxme/atomic-reactor | 91414bb8ffd988321cfa7120167636757e265a39 | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_check_and_set_platforms.py | sosiouxme/atomic-reactor | 91414bb8ffd988321cfa7120167636757e265a39 | [
"BSD-3-Clause"
] | 1 | 2018-04-25T12:42:14.000Z | 2018-04-29T20:31:00.000Z | tests/plugins/test_check_and_set_platforms.py | sosiouxme/atomic-reactor | 91414bb8ffd988321cfa7120167636757e265a39 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import os
import yaml
from atomic_reactor.constants import PLUGIN_CHECK_AND_SET_PLATFORMS_KEY, REPO_... | 32.136364 | 94 | 0.680575 |
891191b0261f777adf969c477a11318a4085ef21 | 9,278 | py | Python | plugins/_Post_Process/_XAI/lime_batch.py | sony/nnc-plugin | 579cc51ec2c85fcae058f1aaf1f6036f71734dbb | [
"Apache-2.0"
] | 7 | 2021-09-04T13:10:07.000Z | 2022-03-21T08:51:45.000Z | plugins/_Post_Process/_XAI/lime_batch.py | sony/nnc-plugin | 579cc51ec2c85fcae058f1aaf1f6036f71734dbb | [
"Apache-2.0"
] | 1 | 2021-11-15T04:39:34.000Z | 2021-11-19T08:09:42.000Z | plugins/_Post_Process/_XAI/lime_batch.py | sony/nnc-plugin | 579cc51ec2c85fcae058f1aaf1f6036f71734dbb | [
"Apache-2.0"
] | 1 | 2022-03-25T16:52:05.000Z | 2022-03-25T16:52:05.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 ... | 38.338843 | 138 | 0.599698 |
0c3b314c8b04b8723984900fd30ff605ddb9cfd3 | 11,489 | py | Python | torch/optim/swa_utils.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | null | null | null | torch/optim/swa_utils.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | null | null | null | torch/optim/swa_utils.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | null | null | null | import torch
import math
from torch.nn import Module
from copy import deepcopy
from torch.optim.lr_scheduler import _LRScheduler
class AveragedModel(Module):
r"""Implements averaged model for Stochastic Weight Averaging (SWA).
Stochastic Weight Averaging was proposed in `Averaging Weights Leads to
Wider ... | 42.869403 | 98 | 0.618679 |
ed3372dfa30a1ee787d7ab1752a449c5ca00f91d | 1,444 | py | Python | tcfcli/common/tcsam/glob.py | alfredhuang211/scfcli | f5e086ff4fcee8d645682e85cd1486b28a224d08 | [
"Apache-2.0"
] | 14 | 2019-03-01T09:47:36.000Z | 2019-11-28T01:58:54.000Z | tcfcli/common/tcsam/glob.py | alfredhuang211/scfcli | f5e086ff4fcee8d645682e85cd1486b28a224d08 | [
"Apache-2.0"
] | 8 | 2019-03-12T10:22:53.000Z | 2020-08-20T08:15:51.000Z | tcfcli/common/tcsam/glob.py | alfredhuang211/scfcli | f5e086ff4fcee8d645682e85cd1486b28a224d08 | [
"Apache-2.0"
] | 7 | 2019-03-01T09:47:52.000Z | 2020-06-13T12:14:48.000Z | from .tcsam_macro import TcSamMacro as macro
glob_schema = {
"$schema": "http://json-schema.org/draft-07/schema/global#",
"$id": "tcsam.global",
"type": "object",
"properties": {
macro.Function: {
"type": "object",
"properties": {
macro.CodeUri: {"type": ... | 38 | 81 | 0.40651 |
10b579dbf103e2daf42142c2b9771cf9d4e45861 | 3,040 | py | Python | python/pyspark/sql/tests/test_utils.py | neilagupta/spark | 1c61d90777204077fcd475fa6e0eb035122d532f | [
"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-10-14T06:18:00.000Z | 2021-10-14T06:18:00.000Z | python/pyspark/sql/tests/test_utils.py | Talador12/spark | 838a9d9398d2faf8885c9a84fd8f1d589f3c5539 | [
"Apache-2.0"
] | null | null | null | python/pyspark/sql/tests/test_utils.py | Talador12/spark | 838a9d9398d2faf8885c9a84fd8f1d589f3c5539 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# 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 ... | 43.428571 | 97 | 0.700658 |
c3ee03475f1f518cd523c5e34a2560d3ba093344 | 24,825 | py | Python | usr/lib/python2.7/dist-packages/rosdep2/sources_list.py | Roboy/roboy_controlled_node_fpga | dbba4eff19ed04469a6196ba368cea231cad539d | [
"BSD-3-Clause"
] | 2 | 2018-12-11T16:35:20.000Z | 2019-01-23T16:42:17.000Z | usr/lib/python2.7/dist-packages/rosdep2/sources_list.py | Roboy/roboy_managing_node_fpga | 64ffe5aec2f2c98a051bb1a881849c195b8d052c | [
"BSD-3-Clause"
] | 1 | 2018-12-28T21:11:50.000Z | 2018-12-28T21:11:50.000Z | usr/lib/python2.7/dist-packages/rosdep2/sources_list.py | Roboy/roboy_managing_node_fpga | 64ffe5aec2f2c98a051bb1a881849c195b8d052c | [
"BSD-3-Clause"
] | 3 | 2018-01-21T17:53:17.000Z | 2021-09-08T10:22:05.000Z | # Copyright (c) 2012, Willow Garage, Inc.
# 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 cond... | 36.887073 | 121 | 0.664491 |
1b8a3f63d514903ea341d282532c429c06620e1e | 3,395 | py | Python | dmb/modeling/stereo/cost_processors/utils/cost_norm.py | jiaw-z/DenseMatchingBenchmark | 177c56ca1952f54d28e6073afa2c16981113a2af | [
"MIT"
] | 160 | 2019-11-16T13:59:21.000Z | 2022-03-28T07:52:59.000Z | dmb/modeling/stereo/cost_processors/utils/cost_norm.py | jiaw-z/DenseMatchingBenchmark | 177c56ca1952f54d28e6073afa2c16981113a2af | [
"MIT"
] | 22 | 2019-11-22T02:14:18.000Z | 2022-01-24T10:16:14.000Z | dmb/modeling/stereo/cost_processors/utils/cost_norm.py | jiaw-z/DenseMatchingBenchmark | 177c56ca1952f54d28e6073afa2c16981113a2af | [
"MIT"
] | 38 | 2019-12-27T14:01:01.000Z | 2022-03-12T11:40:11.000Z | import torch
import torch.nn as nn
eps = 1e-5
class _CostVolumeNorm(nn.Module):
"""
Normalize Cost Volume
Args:
dim (int): which dim to apply normalization operation, default dim is for the cost dim.
affine (bool): whether the parameters are learnable, default is True
... | 33.613861 | 99 | 0.622091 |
a5c8eb063f0c1ee701686daf770c8e676474c6e9 | 368 | py | Python | app/app/tests.py | ppleventis/recipe-app-api | 6ba3004540a136f22429adb42283f154a1b447c3 | [
"MIT"
] | null | null | null | app/app/tests.py | ppleventis/recipe-app-api | 6ba3004540a136f22429adb42283f154a1b447c3 | [
"MIT"
] | null | null | null | app/app/tests.py | ppleventis/recipe-app-api | 6ba3004540a136f22429adb42283f154a1b447c3 | [
"MIT"
] | null | null | null | from django.test import TestCase
from app.calc import add, subtract
class calcTests(TestCase):
def test_add_numbers(self):
"""Test that two numbers are added together"""
self.assertEqual(add(3, 8), 11)
def test_subtract_numbers(self):
"""Test that values are subtracted and returned"... | 24.533333 | 58 | 0.679348 |
f377b6fcda8590183f8bbbb2f56c90398b47b627 | 8,535 | py | Python | var/spack/repos/builtin/packages/py-horovod/package.py | genric/spack | e35a99e5d6da729f197954802d697d75e02aefe0 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/py-horovod/package.py | BlueBrain/spack | 047fa4b21b90abfd227dd70a77689bb473cd1a57 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/py-horovod/package.py | genric/spack | e35a99e5d6da729f197954802d697d75e02aefe0 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2019 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)
class PyHorovod(PythonPackage, CudaPackage):
"""Horovod is a distributed deep learning training framework for
Ten... | 48.771429 | 107 | 0.607264 |
8afd6bc097e9f19cf40204df2731a62a61475884 | 3,504 | py | Python | airflow/contrib/sensors/bash_sensor.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 15 | 2017-04-06T09:01:50.000Z | 2021-10-02T13:54:31.000Z | airflow/contrib/sensors/bash_sensor.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 26 | 2019-08-05T13:44:11.000Z | 2022-03-30T10:06:18.000Z | airflow/contrib/sensors/bash_sensor.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 21 | 2017-08-20T03:01:05.000Z | 2021-09-07T06:47:51.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 38.505495 | 82 | 0.642409 |
0c0f7ac9a8193aa57d2942234da43ed0cb651bce | 948 | py | Python | statssite/home/www-data/stats/stats.py | tigran-a/ACDCStats | 45daaba3149535face316e6c6e117409ae2f9cbf | [
"Apache-2.0"
] | null | null | null | statssite/home/www-data/stats/stats.py | tigran-a/ACDCStats | 45daaba3149535face316e6c6e117409ae2f9cbf | [
"Apache-2.0"
] | null | null | null | statssite/home/www-data/stats/stats.py | tigran-a/ACDCStats | 45daaba3149535face316e6c6e117409ae2f9cbf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
(c) Copyright 2015 Tigran Avanesov, SnT, University of Luxembourg
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/LICEN... | 30.580645 | 75 | 0.748945 |
dd21a974c05172c9ba3cce52ff49f8ea3d160c6d | 2,393 | py | Python | app/storage/dynamodb_api.py | ONSdigital/census-survey-runner | 9f8cd3d664db5c5b49d348bdf48c58d1a3492aab | [
"MIT"
] | null | null | null | app/storage/dynamodb_api.py | ONSdigital/census-survey-runner | 9f8cd3d664db5c5b49d348bdf48c58d1a3492aab | [
"MIT"
] | 3 | 2018-10-10T08:19:07.000Z | 2018-10-29T11:43:08.000Z | app/storage/dynamodb_api.py | ONSdigital/census-survey-runner | 9f8cd3d664db5c5b49d348bdf48c58d1a3492aab | [
"MIT"
] | 1 | 2021-04-11T08:04:22.000Z | 2021-04-11T08:04:22.000Z | from botocore.exceptions import ClientError
from flask import current_app
from app.data_model import app_models
from app.storage.errors import ItemAlreadyExistsError
TABLE_CONFIG = {
app_models.SubmittedResponse: {
'key_field': 'tx_id',
'table_name_key': 'EQ_SUBMITTED_RESPONSES_TABLE_NAME',
... | 29.54321 | 107 | 0.67781 |
f9d355acd71860e07be80e51cd42d1446caf66da | 2,304 | py | Python | setup.py | rfk/playitagainsam | 75833222438638b7d7860032a928a6575c48e0b5 | [
"MIT"
] | 113 | 2015-01-09T05:41:43.000Z | 2021-07-18T19:34:26.000Z | setup.py | rfk/playitagainsam | 75833222438638b7d7860032a928a6575c48e0b5 | [
"MIT"
] | 14 | 2015-02-11T20:24:34.000Z | 2022-01-03T10:34:59.000Z | setup.py | rfk/playitagainsam | 75833222438638b7d7860032a928a6575c48e0b5 | [
"MIT"
] | 8 | 2015-02-11T19:26:32.000Z | 2019-08-29T06:55:40.000Z | #
# This is the setuptools script for "playitagainsam".
# Originally developed by Ryan Kelly, 2012.
#
# This script is placed in the public domain.
#
import os
import sys
setup_kwds = {}
# Use setuptools is available, so we have `python setup.py test`.
# We also need it for 2to3 integration on python3.
# Otherw... | 28.444444 | 70 | 0.674479 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.