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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5d671b6cfdd5a84ba3385e6804f82c5ea26e4f67 | 2,508 | py | Python | tests/modules/__init__.py | MrFishFinger/powerline | 361534bafecf836e100eaff257c93eb4805f48db | [
"MIT"
] | 11,435 | 2015-01-01T03:32:34.000Z | 2022-03-31T20:39:05.000Z | tests/modules/__init__.py | ritiek/powerline | 82c1373ba0b424c57e8c12cb5f6f1a7ee3829c27 | [
"MIT"
] | 879 | 2015-01-02T11:59:30.000Z | 2022-03-24T09:52:17.000Z | tests/modules/__init__.py | ritiek/powerline | 82c1373ba0b424c57e8c12cb5f6f1a7ee3829c27 | [
"MIT"
] | 1,044 | 2015-01-05T22:37:53.000Z | 2022-03-17T19:43:16.000Z | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import os
if sys.version_info < (2, 7):
from unittest2 import TestCase as _TestCase # NOQA
from unittest2 import main as _main # NOQA
from unittest2.case import SkipTest # NOQA
else:
fr... | 26.125 | 84 | 0.729665 |
72afd52d05745d0eb1236e7b57a1f563daedf1d0 | 183 | py | Python | python/Password_Generator/Password-Generator.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | python/Password_Generator/Password-Generator.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | python/Password_Generator/Password-Generator.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import random
s = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
passlen = 8
p = "".join(random.sample(s,passlen))
print(p)
| 14.076923 | 79 | 0.677596 |
6f3d52fd72efbe70b75c196df99818cf9ea1880f | 7,221 | py | Python | src/collectors/elasticsearch/test/testelasticsearch.py | gitarzysta/Diamond | 77895749acd09c5dc5c2aee7759533b7b155edcf | [
"MIT"
] | 6 | 2015-04-13T21:24:24.000Z | 2020-05-11T07:43:05.000Z | src/collectors/elasticsearch/test/testelasticsearch.py | gitarzysta/Diamond | 77895749acd09c5dc5c2aee7759533b7b155edcf | [
"MIT"
] | 3 | 2015-09-11T16:29:54.000Z | 2016-05-18T15:31:54.000Z | src/collectors/elasticsearch/test/testelasticsearch.py | gitarzysta/Diamond | 77895749acd09c5dc5c2aee7759533b7b155edcf | [
"MIT"
] | 13 | 2015-01-11T12:10:45.000Z | 2021-01-27T10:55:02.000Z | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from elasticsearch ... | 38.409574 | 90 | 0.59784 |
0057dd4a81e318d024b85b130525022f3496d634 | 8,740 | py | Python | main.py | uniyalvipin/twitter-giveaway-bot | 233c8f01e4b0419e06716ba8111b3f0d55ce58a9 | [
"MIT"
] | null | null | null | main.py | uniyalvipin/twitter-giveaway-bot | 233c8f01e4b0419e06716ba8111b3f0d55ce58a9 | [
"MIT"
] | null | null | null | main.py | uniyalvipin/twitter-giveaway-bot | 233c8f01e4b0419e06716ba8111b3f0d55ce58a9 | [
"MIT"
] | null | null | null | import config
import twitter
import time
import random
print("Remember you can change the settings in config.py!\n")
# All variables related to the Twitter API
twitter_api = twitter.Api(consumer_key=config.twitter_credentials["consumer_key"],
consumer_secret=config.twitter_credentials["cons... | 51.111111 | 143 | 0.560069 |
ce1e3a6ca7ac4c5fc57fac674b5ee58a9db439e4 | 3,938 | py | Python | src/cogs/games.py | yuriel-v/NoFuture.py | 82f66c24a15f93e2aad7762b348e94dd6d93207d | [
"MIT"
] | null | null | null | src/cogs/games.py | yuriel-v/NoFuture.py | 82f66c24a15f93e2aad7762b348e94dd6d93207d | [
"MIT"
] | null | null | null | src/cogs/games.py | yuriel-v/NoFuture.py | 82f66c24a15f93e2aad7762b348e94dd6d93207d | [
"MIT"
] | null | null | null | import requests
from discord.colour import Colour
from discord.embeds import Embed
from discord.ext import commands
from random import randint
class Games(commands.Cog):
def __init__(self, bot, id):
self.cog_id = id
self.bot = bot
@commands.command('rps')
async def rock_pap... | 36.803738 | 109 | 0.492636 |
75f0378133554486cccfd2c5bb6a20c6f3e2d5a5 | 2,799 | py | Python | alipay/aop/api/domain/BoxOrderStatusInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/BoxOrderStatusInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/BoxOrderStatusInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class BoxOrderStatusInfo(object):
def __init__(self):
self._data = None
self._ext_info = None
self._gmt_modified = None
self._item_id = None
self._latest_status ... | 27.712871 | 77 | 0.573419 |
6158fe4e7a0f7aee092c02c38691ad572146a3d9 | 1,421 | py | Python | KnowledgeMapping/SpiderExp/1-Code/law_site/reg.py | nickliqian/ralph_doc_to_chinese | be120ce2bb94a8e8395630218985f5e51ae087d9 | [
"MIT"
] | 8 | 2018-05-22T01:11:33.000Z | 2020-03-19T01:44:55.000Z | KnowledgeMapping/SpiderExp/1-Code/law_site/reg.py | yangliangguang/keep_learning | 47ab39c726cb28713ad22bf4cf39d6b146715910 | [
"MIT"
] | null | null | null | KnowledgeMapping/SpiderExp/1-Code/law_site/reg.py | yangliangguang/keep_learning | 47ab39c726cb28713ad22bf4cf39d6b146715910 | [
"MIT"
] | 3 | 2018-07-25T09:31:53.000Z | 2019-09-14T14:05:31.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests
import time
from lxml import etree
# 登陆注册页获得cookie和csrf value
sess = requests.Session()
url = "http://openlaw.cn/register.jsp"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 ... | 30.234043 | 136 | 0.674877 |
f848d751d5f896583a0f4a7f2452480672c5199d | 6,675 | py | Python | baselines/deepq/replay_buffer.py | dreamersnme/future | 87462ea1ef2dfd056e26ede85448af160df7d2ac | [
"MIT"
] | 11 | 2021-02-23T17:15:21.000Z | 2021-09-08T21:31:57.000Z | baselines/deepq/replay_buffer.py | dreamersnme/future | 87462ea1ef2dfd056e26ede85448af160df7d2ac | [
"MIT"
] | 5 | 2019-07-02T03:11:00.000Z | 2020-07-27T17:32:41.000Z | baselines/deepq/replay_buffer.py | dreamersnme/future | 87462ea1ef2dfd056e26ede85448af160df7d2ac | [
"MIT"
] | 6 | 2019-06-03T23:03:40.000Z | 2021-03-09T06:51:28.000Z | import numpy as np
import random
from baselines.common.segment_tree import SumSegmentTree, MinSegmentTree
class ReplayBuffer(object):
def __init__(self, size):
"""Create Replay buffer.
Parameters
----------
size: int
Max number of transitions to store in the buffer. W... | 34.230769 | 192 | 0.595206 |
97b4aef7e5ac7446e70ad3781be51000fcc5b676 | 1,409 | py | Python | scripts/check_headers.py | drivendataorg/PlanetaryComputerExamples | dc6122144ad5263db77e0bfdb555d585f8d18472 | [
"MIT"
] | 112 | 2021-04-15T19:58:38.000Z | 2022-03-30T18:00:31.000Z | scripts/check_headers.py | drivendataorg/PlanetaryComputerExamples | dc6122144ad5263db77e0bfdb555d585f8d18472 | [
"MIT"
] | 61 | 2021-04-19T13:55:30.000Z | 2022-03-31T23:52:48.000Z | scripts/check_headers.py | drivendataorg/PlanetaryComputerExamples | dc6122144ad5263db77e0bfdb555d585f8d18472 | [
"MIT"
] | 54 | 2021-04-19T20:37:46.000Z | 2022-03-28T19:47:09.000Z | #!/usr/local/bin/python3
import re
import nbformat
import rich
import sys
xpr = re.compile("^#", re.MULTILINE)
single_header = re.compile("^# ", re.MULTILINE)
double_header = re.compile("^## ", re.MULTILINE)
def main():
errors = False
for filename in sys.argv[1:]:
doc = nbformat.read(filename, nbfor... | 28.18 | 82 | 0.51313 |
1a5155bd82fb2fb85a5117acd1f270e6f2f5b424 | 667 | py | Python | sourcecode/19/blog/Account/urls.py | ydong08/PythonCode | 268f538608917565cdfc8eadbd04101606314c97 | [
"MIT"
] | null | null | null | sourcecode/19/blog/Account/urls.py | ydong08/PythonCode | 268f538608917565cdfc8eadbd04101606314c97 | [
"MIT"
] | null | null | null | sourcecode/19/blog/Account/urls.py | ydong08/PythonCode | 268f538608917565cdfc8eadbd04101606314c97 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
#from django.contrib import admin
#admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^blog/', include('blog.foo.urls')),
(r'^$', 'Account.views.index'),
(r'^test/$', 'Account.views.test'),
(r... | 29 | 76 | 0.65967 |
e031529626e471a4bc415f2fec6f85c596c42b36 | 2,300 | py | Python | common/migrations/0001_initial.py | CMPUT404-Organisation-Not-Found/SocialDistribution | c1c88af3086dac13c0da32094b5c843dbacae620 | [
"Apache-2.0"
] | null | null | null | common/migrations/0001_initial.py | CMPUT404-Organisation-Not-Found/SocialDistribution | c1c88af3086dac13c0da32094b5c843dbacae620 | [
"Apache-2.0"
] | null | null | null | common/migrations/0001_initial.py | CMPUT404-Organisation-Not-Found/SocialDistribution | c1c88af3086dac13c0da32094b5c843dbacae620 | [
"Apache-2.0"
] | 1 | 2022-03-21T22:14:36.000Z | 2022-03-21T22:14:36.000Z | # Generated by Django 3.1.6 on 2022-03-28 19:14
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
def create_connection_nodes(apps, schema_editor):
"""
Create some connection nodes
"""
ConnectionNode = apps.... | 35.9375 | 89 | 0.552174 |
1816c5278dc40201caf8be8b24cc93b03d2560cd | 4,500 | py | Python | benchmark/startQiskit_QC2793.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2793.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2793.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=43
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 35.714286 | 165 | 0.657111 |
184db6737735baf71273ee4fddd86ab4b265293e | 1,166 | py | Python | Webpage/utils/history.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/utils/history.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/utils/history.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | import datetime
from blog.models import blogPost
from web.models import infoPage
from jollen.models import nachricht_historie
'''
delete history older than one Month and if there are more than 7 from Models
Models: blogPost -> blogPostHistory
infoPage -> infoPageHistory
'''
def deleteOlderHistory():
... | 34.294118 | 76 | 0.627787 |
9b8ce8b64116cfa3557d61a0d7aff604f2af51fa | 4,579 | py | Python | chameleon/legacy/skfeature/function/sparse_learning_based/ls_l21.py | diviyat/chameleon | 12c212ef3ecaab73e6b2a4ae378b25495926ad75 | [
"MIT"
] | 2 | 2021-10-21T23:09:00.000Z | 2021-12-14T07:55:43.000Z | chameleon/legacy/skfeature/function/sparse_learning_based/ls_l21.py | diviyat/chameleon | 12c212ef3ecaab73e6b2a4ae378b25495926ad75 | [
"MIT"
] | null | null | null | chameleon/legacy/skfeature/function/sparse_learning_based/ls_l21.py | diviyat/chameleon | 12c212ef3ecaab73e6b2a4ae378b25495926ad75 | [
"MIT"
] | null | null | null | import math
import numpy as np
from numpy import linalg as LA
from chameleon.legacy.skfeature.utility.sparse_learning import euclidean_projection, calculate_l21_norm
def proximal_gradient_descent(X, Y, z, **kwargs):
"""
This function implements supervised sparse feature selection via l2,1 norm, i.e.,
min_... | 30.526667 | 118 | 0.585499 |
8cbf8bc17ce886777f43f9ae14100dad61fe7121 | 829 | py | Python | projectq/libs/revkit/__init__.py | kevin-teddy/ProjectQ | 22828daca975cebed92f946ba2625f295cfa70e9 | [
"Apache-2.0"
] | 3 | 2021-11-08T11:46:42.000Z | 2021-12-27T10:13:38.000Z | projectq/libs/revkit/__init__.py | kevin-teddy/ProjectQ | 22828daca975cebed92f946ba2625f295cfa70e9 | [
"Apache-2.0"
] | 2 | 2021-11-09T14:57:09.000Z | 2022-01-12T12:35:58.000Z | projectq/libs/revkit/__init__.py | kevin-teddy/ProjectQ | 22828daca975cebed92f946ba2625f295cfa70e9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... | 39.47619 | 76 | 0.752714 |
d33a47163b7f1321db04545f33a3057fcdf42205 | 2,060 | py | Python | app/waterNet/testModel.py/lstmTest.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | null | null | null | app/waterNet/testModel.py/lstmTest.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | null | null | null | app/waterNet/testModel.py/lstmTest.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | 2 | 2021-04-04T02:45:59.000Z | 2022-03-19T09:41:39.000Z | import numpy as np
import matplotlib.pyplot as plt
from hydroDL.data import dbBasin
import torch
import importlib
from hydroDL.model import waterNet, crit
from hydroDL.model import rnn
# test case
siteNo = '07241550'
df = dbBasin.readSiteTS(siteNo, ['pr', 'runoff', 'pet'])
P = df['pr'].values
Q = df['runoff'].values
E... | 26.075949 | 62 | 0.624272 |
c6863641e662b48855f8c2220ba76c9591572361 | 704 | py | Python | filter/model/models.py | phamgianglam/filter_api | 90dd5326b7881922ee06d873391225ad1dc59c2b | [
"MIT"
] | null | null | null | filter/model/models.py | phamgianglam/filter_api | 90dd5326b7881922ee06d873391225ad1dc59c2b | [
"MIT"
] | null | null | null | filter/model/models.py | phamgianglam/filter_api | 90dd5326b7881922ee06d873391225ad1dc59c2b | [
"MIT"
] | null | null | null | from uuid import UUID, uuid4
from datetime import datetime
from sqlalchemy.sql.sqltypes import DateTime, String, ARRAY
from datetime import datetime
from sqlalchemy import Column
from sqlalchemy.dialects.postgresql import UUID as sqlUUID
from sqlalchemy.orm import declarative_base
BaseModel = declarative_base()
cla... | 29.333333 | 68 | 0.737216 |
0a83e4d146e0eb0e037d1105be79e595dcc1679f | 22,058 | py | Python | python/services/compute/beta/forwarding_rule.py | GoogleCloudPlatform/declarative-resource-client-library | ef28ca390518a8266cfe5a5e0d5abb8f45f5c7d2 | [
"Apache-2.0"
] | 16 | 2021-01-08T19:35:22.000Z | 2022-03-23T16:23:49.000Z | python/services/compute/beta/forwarding_rule.py | GoogleCloudPlatform/declarative-resource-client-library | ef28ca390518a8266cfe5a5e0d5abb8f45f5c7d2 | [
"Apache-2.0"
] | 1 | 2021-01-13T04:59:56.000Z | 2021-01-13T04:59:56.000Z | python/services/compute/beta/forwarding_rule.py | GoogleCloudPlatform/declarative-resource-client-library | ef28ca390518a8266cfe5a5e0d5abb8f45f5c7d2 | [
"Apache-2.0"
] | 11 | 2021-03-18T11:27:28.000Z | 2022-03-12T06:49:14.000Z | # Copyright 2021 Google LLC. 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 o... | 39.672662 | 104 | 0.686916 |
28763fcf0e62fe20f2a9d2c701f4e53a952e51d5 | 2,089 | py | Python | src/api/silly_routes.py | devsetgo/test-api | 2a84bbacbf5cd043b2227e74332e8518927a8238 | [
"MIT"
] | 9 | 2019-05-22T08:46:01.000Z | 2021-12-10T06:44:56.000Z | src/api/silly_routes.py | devsetgo/test-api | 2a84bbacbf5cd043b2227e74332e8518927a8238 | [
"MIT"
] | 285 | 2019-09-03T00:52:39.000Z | 2022-02-13T02:13:59.000Z | src/api/silly_routes.py | devsetgo/test-api | 2a84bbacbf5cd043b2227e74332e8518927a8238 | [
"MIT"
] | 4 | 2019-09-19T18:14:09.000Z | 2020-12-15T18:35:07.000Z | # -*- coding: utf-8 -*-
import asyncio
import time
from fastapi import APIRouter, Query
from loguru import logger
from core.gen_user import user_test_info
router = APIRouter()
@router.get("/make-one", tags=["silly users"])
async def make_user(
delay: int = Query(
None,
title="silly users",
... | 24.290698 | 85 | 0.582575 |
ad85b7b320d363c545680e484451343b7f67cde5 | 1,308 | py | Python | matplotlib/gallery_python/user_interfaces/embedding_in_tk_sgskip.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | matplotlib/gallery_python/user_interfaces/embedding_in_tk_sgskip.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | matplotlib/gallery_python/user_interfaces/embedding_in_tk_sgskip.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | """
===============
Embedding in Tk
===============
"""
import tkinter
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg, NavigationToolbar2Tk)
# Implement the default Matplotlib key bindings.
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Figure
import nump... | 26.16 | 77 | 0.738532 |
65f96e71851b5cb22cab06304936f4a60ea7d698 | 1,873 | py | Python | scripts/test_rpn_3d.py | abhi1kumar/M3D-RPN | cf79ec95ad84b3548c57af90aedd59da3ad4af5b | [
"MIT"
] | 4 | 2020-11-23T14:49:53.000Z | 2021-01-11T15:49:54.000Z | scripts/test_rpn_3d.py | abhi1kumar/M3D-RPN | cf79ec95ad84b3548c57af90aedd59da3ad4af5b | [
"MIT"
] | null | null | null | scripts/test_rpn_3d.py | abhi1kumar/M3D-RPN | cf79ec95ad84b3548c57af90aedd59da3ad4af5b | [
"MIT"
] | null | null | null | # -----------------------------------------
# python modules
# -----------------------------------------
from importlib import import_module
from easydict import EasyDict as edict
import torch.backends.cudnn as cudnn
import sys
import numpy as np
import os
# stop python from writing so much bytecode
sys.dont_write_byt... | 26.757143 | 83 | 0.580886 |
6561c23a78bc7be056c60dd277626545ce9ad81d | 2,655 | py | Python | ros/meka_ik/meka_ik.py | ahoarau/m3meka | 237739f0266ce60aaa3013b0d2b22fc07b6374c4 | [
"MIT"
] | 1 | 2015-06-19T12:14:18.000Z | 2015-06-19T12:14:18.000Z | ros/meka_ik/meka_ik.py | semeyerz/m3meka | 6e5d6b73ad3ebdd8429497923e601eae65d8b2fe | [
"MIT"
] | null | null | null | ros/meka_ik/meka_ik.py | semeyerz/m3meka | 6e5d6b73ad3ebdd8429497923e601eae65d8b2fe | [
"MIT"
] | 2 | 2015-11-27T09:25:54.000Z | 2021-08-16T16:29:22.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
#M3 -- Meka Robotics Robot Components
#Copyright (C) 2010 Meka Robotics
#Author: edsinger@mekabot.com (Aaron Edsinger)
#M3 is free software: you can redistribute it and/or modify
#it under the terms of the GNU Lesser General Public License as published by
#the Free Software... | 29.175824 | 113 | 0.739736 |
f2bc5de1ae68e18eb87443301b3a9d8eae7178f6 | 199 | py | Python | udacity-datastructure-algos/misc/factorial/factorial.py | AdrianLl/misc-tutorials | ef5659f2f279d8c00da3c61dbf245ac12157ce72 | [
"MIT"
] | null | null | null | udacity-datastructure-algos/misc/factorial/factorial.py | AdrianLl/misc-tutorials | ef5659f2f279d8c00da3c61dbf245ac12157ce72 | [
"MIT"
] | null | null | null | udacity-datastructure-algos/misc/factorial/factorial.py | AdrianLl/misc-tutorials | ef5659f2f279d8c00da3c61dbf245ac12157ce72 | [
"MIT"
] | null | null | null | def factorial_calc(number):
number_sum = number
if number == 0:
return 1
while number > 1:
number_sum = number_sum*(number - 1)
number-= 1
return number_sum | 18.090909 | 44 | 0.58794 |
19cee836592aab72cf241dae2f5d20980e19b196 | 401 | py | Python | HackerRank/BasicDataTypes/FindingPercentage.py | OAPJ/Python | 2fdf9c161f962cd912f2393ff72aed823b4241cb | [
"Apache-2.0"
] | null | null | null | HackerRank/BasicDataTypes/FindingPercentage.py | OAPJ/Python | 2fdf9c161f962cd912f2393ff72aed823b4241cb | [
"Apache-2.0"
] | null | null | null | HackerRank/BasicDataTypes/FindingPercentage.py | OAPJ/Python | 2fdf9c161f962cd912f2393ff72aed823b4241cb | [
"Apache-2.0"
] | null | null | null | if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
suma_calificaciones = student_marks[query_name][0] + student_marks[query_name][1]+... | 36.454545 | 115 | 0.63591 |
3b588bc2a728cdfdbb5dcfa37fd45eecf0e01944 | 1,506 | py | Python | diffuseTools/scripts/adjust_template.py | fermiPy/diffuseTools | 8a32b62b98486e1f35b6362cf5739c45da344b6d | [
"BSD-3-Clause"
] | null | null | null | diffuseTools/scripts/adjust_template.py | fermiPy/diffuseTools | 8a32b62b98486e1f35b6362cf5739c45da344b6d | [
"BSD-3-Clause"
] | null | null | null | diffuseTools/scripts/adjust_template.py | fermiPy/diffuseTools | 8a32b62b98486e1f35b6362cf5739c45da344b6d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
"""
Adjust a template by multiplying it by a set of scale parametrs
"""
import numpy as np
from fermipy import utils
from gammapy.maps import Map
from scipy.interpolate import interp1d
def make_interpolator(yamlfile):
scale = utils.load_yaml(yamlfile)
emids = (np.array(scale['E_min'... | 27.888889 | 104 | 0.676627 |
48856e2bf20e9910df1fad453a50cef0744adbd8 | 8,833 | py | Python | tests/test_json.py | xnuinside/gino | 6421cf7cafe980c070f7fc0075e7127b337276eb | [
"BSD-3-Clause"
] | 1 | 2020-04-30T00:58:36.000Z | 2020-04-30T00:58:36.000Z | tests/test_json.py | xnuinside/gino | 6421cf7cafe980c070f7fc0075e7127b337276eb | [
"BSD-3-Clause"
] | null | null | null | tests/test_json.py | xnuinside/gino | 6421cf7cafe980c070f7fc0075e7127b337276eb | [
"BSD-3-Clause"
] | null | null | null | import pytest
from datetime import datetime, timedelta
from gino.exceptions import UnknownJSONPropertyError
from .models import db, User, UserType
pytestmark = pytest.mark.asyncio
async def test_in_memory():
u = User()
assert u.age == 18
u.age += 10
assert u.age == 28
assert u.balance == 0
... | 31.102113 | 88 | 0.617457 |
96b3bf1b0caf15f3aafcd5ea00e032332f4a5208 | 1,829 | py | Python | 11_python-data-science-toolbox-(part-2)/2-list-comprehensions-and-generators/04_nested-list-comprehensions.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 5 | 2021-02-03T14:36:58.000Z | 2022-01-01T10:29:26.000Z | 11_python-data-science-toolbox-(part-2)/2-list-comprehensions-and-generators/04_nested-list-comprehensions.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | null | null | null | 11_python-data-science-toolbox-(part-2)/2-list-comprehensions-and-generators/04_nested-list-comprehensions.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 3 | 2021-02-08T00:31:16.000Z | 2022-03-17T13:52:32.000Z | '''
04 - Nested list comprehensions
Great! At this point, you have a good grasp of the basic syntax of list comprehensions.
Let's push your code-writing skills a little further. In this exercise, you will be writing
a list comprehension within another list comprehension, or nested list comprehensions. It
sounds a litt... | 39.76087 | 96 | 0.72772 |
0c8ba1fc72a7595fde985bf24496f363397b31b8 | 7,583 | py | Python | cheshire3/server.py | cheshire3/cheshire3 | 306348831ec110229c78a7c5f0f2026a0f394d2c | [
"Python-2.0",
"Unlicense"
] | 3 | 2015-08-02T09:03:28.000Z | 2017-12-06T09:26:14.000Z | cheshire3/server.py | cheshire3/cheshire3 | 306348831ec110229c78a7c5f0f2026a0f394d2c | [
"Python-2.0",
"Unlicense"
] | 5 | 2015-08-17T01:16:35.000Z | 2015-09-16T21:51:27.000Z | cheshire3/server.py | cheshire3/cheshire3 | 306348831ec110229c78a7c5f0f2026a0f394d2c | [
"Python-2.0",
"Unlicense"
] | 6 | 2015-05-17T15:32:20.000Z | 2020-04-22T08:43:16.000Z |
from __future__ import with_statement
import os
from urlparse import urlsplit
from lxml import etree
from lxml.builder import ElementMaker
from cheshire3.baseObjects import Server
from cheshire3.bootstrap import BSLxmlParser, BootstrapDocument
from cheshire3.configParser import C3Object
from cheshire3.exceptions i... | 39.087629 | 79 | 0.55875 |
af38be177288ce21e10541e76300e716e58fc4e8 | 15,943 | py | Python | integration/test_flow_integration.py | katyakats/storey | 74473d72b2104267c7695890e847baf94a854050 | [
"Apache-2.0"
] | null | null | null | integration/test_flow_integration.py | katyakats/storey | 74473d72b2104267c7695890e847baf94a854050 | [
"Apache-2.0"
] | null | null | null | integration/test_flow_integration.py | katyakats/storey | 74473d72b2104267c7695890e847baf94a854050 | [
"Apache-2.0"
] | null | null | null | import asyncio
import base64
import json
import time
from _datetime import datetime, timedelta
import aiohttp
import pandas as pd
import v3io
import v3io.aio.dataplane
import v3io_frames as frames
from storey import Filter, JoinWithV3IOTable, SendToHttp, Map, Reduce, Source, HttpRequest, build_flow, \
WriteToV3IO... | 40.879487 | 129 | 0.632252 |
93d02397517b14885c286e5d317b3651b17ad7bb | 7,326 | py | Python | rcsb/utils/seq/InterProProvider.py | rcsb/py-rcsb_utils_seq | af47cd3ccd02317276e443d50acb62631d79c74a | [
"Apache-2.0"
] | null | null | null | rcsb/utils/seq/InterProProvider.py | rcsb/py-rcsb_utils_seq | af47cd3ccd02317276e443d50acb62631d79c74a | [
"Apache-2.0"
] | null | null | null | rcsb/utils/seq/InterProProvider.py | rcsb/py-rcsb_utils_seq | af47cd3ccd02317276e443d50acb62631d79c74a | [
"Apache-2.0"
] | 4 | 2020-12-03T17:28:48.000Z | 2022-03-27T18:02:02.000Z | ##
# File: InterProProvider.py
# Date: 18-Feb-2020
#
##
import logging
import os
import sys
from rcsb.utils.io.FileUtil import FileUtil
from rcsb.utils.io.MarshalUtil import MarshalUtil
logger = logging.getLogger(__name__)
class InterProProvider(object):
"""Manage mappings of InterPro identifiers to desc... | 38.15625 | 181 | 0.581218 |
50d404277b0e68ad5adcee383931739dfe1e1d09 | 2,853 | py | Python | userbot/modules/antiflood.py | kikoyaja69/PocongUserbot | 21fbd648349dd5cf4e2adabedb384a0c77226671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2021-12-25T06:23:41.000Z | 2022-03-25T23:12:37.000Z | userbot/modules/antiflood.py | kikoyaja69/PocongUserbot | 21fbd648349dd5cf4e2adabedb384a0c77226671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/antiflood.py | kikoyaja69/PocongUserbot | 21fbd648349dd5cf4e2adabedb384a0c77226671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 51 | 2022-01-09T11:19:37.000Z | 2022-03-30T17:15:02.000Z | import asyncio
from telethon.tl.functions.channels import EditBannedRequest
from telethon.tl.types import ChatBannedRights
import userbot.modules.sql_helper.antiflood_sql as sql
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP, bot
from userbot.events import poci_cmd, register
from userbot.utils.to... | 32.05618 | 163 | 0.643183 |
8c61dc829bbd9668a2ab91485c00fb4dd077975e | 2,320 | py | Python | setup.py | THS-on/keylime | bb904fc98d9674832e630542d211e71102873b4d | [
"Apache-2.0"
] | 192 | 2019-05-08T14:43:50.000Z | 2022-03-28T20:21:28.000Z | setup.py | THS-on/keylime | bb904fc98d9674832e630542d211e71102873b4d | [
"Apache-2.0"
] | 694 | 2019-04-18T14:08:36.000Z | 2022-03-31T13:55:37.000Z | setup.py | THS-on/keylime | bb904fc98d9674832e630542d211e71102873b4d | [
"Apache-2.0"
] | 97 | 2019-04-17T19:04:00.000Z | 2022-03-20T18:19:28.000Z | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import setuptools
with open('README.md', encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name='keylime',
description=(
'TPM-based key bootstrapping and system '
'integ... | 40 | 93 | 0.650431 |
a1df622a70fe1ddb8e53b4e5aa40270dbc65e009 | 26,674 | py | Python | test/functional/test_runner.py | guapcrypto/Guapcoin | 58a8d35593036cb8455683045d3d5e52dbc23793 | [
"MIT"
] | 13 | 2019-08-13T19:32:50.000Z | 2022-03-03T19:41:54.000Z | test/functional/test_runner.py | guapcrypto/Guapcoin | 58a8d35593036cb8455683045d3d5e52dbc23793 | [
"MIT"
] | 12 | 2020-02-02T17:48:50.000Z | 2022-03-10T21:27:20.000Z | test/functional/test_runner.py | guapcrypto/Guapcoin | 58a8d35593036cb8455683045d3d5e52dbc23793 | [
"MIT"
] | 13 | 2019-08-02T21:03:28.000Z | 2021-06-09T05:10:22.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... | 42.006299 | 195 | 0.599235 |
66c910da739077d9440ef0236c0c9c2c515f2cc3 | 46,383 | py | Python | topaz/objects/stringobject.py | ruby-compiler-survey/topaz | bf4a56adbe03ae9ab4984729c733fcbc64a164c4 | [
"BSD-3-Clause"
] | 241 | 2015-01-02T18:49:09.000Z | 2022-03-15T15:08:45.000Z | topaz/objects/stringobject.py | ruby-compiler-survey/topaz | bf4a56adbe03ae9ab4984729c733fcbc64a164c4 | [
"BSD-3-Clause"
] | 16 | 2015-05-04T21:31:08.000Z | 2020-06-04T22:49:36.000Z | topaz/objects/stringobject.py | ruby-compiler-survey/topaz | bf4a56adbe03ae9ab4984729c733fcbc64a164c4 | [
"BSD-3-Clause"
] | 24 | 2015-02-15T05:35:11.000Z | 2022-03-22T13:29:04.000Z | import copy
import string
import math
from rpython.rlib import jit
from rpython.rlib.objectmodel import newlist_hint, compute_hash
from rpython.rlib.rarithmetic import intmask, ovfcheck
from rpython.rlib.rbigint import rbigint
from rpython.rlib.rerased import new_static_erasing_pair
from rpython.rlib.rsre import rsre_... | 34.614179 | 110 | 0.550805 |
099cb035b28aea237d414294f289b58f95c5ff44 | 352 | py | Python | terrascript/heroku/d.py | hugovk/python-terrascript | 08fe185904a70246822f5cfbdc9e64e9769ec494 | [
"BSD-2-Clause"
] | 4 | 2022-02-07T21:08:14.000Z | 2022-03-03T04:41:28.000Z | terrascript/heroku/d.py | hugovk/python-terrascript | 08fe185904a70246822f5cfbdc9e64e9769ec494 | [
"BSD-2-Clause"
] | null | null | null | terrascript/heroku/d.py | hugovk/python-terrascript | 08fe185904a70246822f5cfbdc9e64e9769ec494 | [
"BSD-2-Clause"
] | 2 | 2022-02-06T01:49:42.000Z | 2022-02-08T14:15:00.000Z | # terrascript/heroku/d.py
import terrascript
class heroku_addon(terrascript.Data):
pass
class heroku_app(terrascript.Data):
pass
class heroku_pipeline(terrascript.Data):
pass
class heroku_space(terrascript.Data):
pass
class heroku_space_peering_info(terrascript.Data):
pass
class heroku_t... | 13.037037 | 50 | 0.755682 |
3cae48e5cb1bb41c372a66dd2b730f9cfe5fc420 | 1,421 | py | Python | examples/test_example.py | ajsilveira/openmoltools | 695dd65abef8b3e56e4bed2df899b3db64f550aa | [
"MIT"
] | 47 | 2015-06-17T16:40:19.000Z | 2021-11-24T08:58:19.000Z | examples/test_example.py | ajsilveira/openmoltools | 695dd65abef8b3e56e4bed2df899b3db64f550aa | [
"MIT"
] | 179 | 2015-04-29T21:02:10.000Z | 2021-07-28T17:30:26.000Z | examples/test_example.py | ajsilveira/openmoltools | 695dd65abef8b3e56e4bed2df899b3db64f550aa | [
"MIT"
] | 28 | 2015-05-04T17:24:14.000Z | 2021-09-23T14:09:48.000Z | import simtk.unit as u
from simtk.openmm import app
import simtk.openmm as mm
from openmoltools import gafftools, system_checker
ligand_name = "sustiva"
ligand_path = "./chemicals/%s/" % ligand_name
temperature = 300 * u.kelvin
friction = 0.3 / u.picosecond
timestep = 0.1 * u.femtosecond
prmtop = app.AmberPrmtopFile... | 37.394737 | 123 | 0.793103 |
6bfd4a548f997d2f977b8dfbea0ecc8b10743c91 | 19,271 | py | Python | content/test/gpu/gpu_tests/gpu_process_integration_test.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | content/test/gpu/gpu_tests/gpu_process_integration_test.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | content/test/gpu/gpu_tests/gpu_process_integration_test.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2017 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.
import os
import sys
from gpu_tests import gpu_integration_test
from gpu_tests import gpu_process_expectations
from gpu_tests import path_util
data_path = ... | 41.354077 | 80 | 0.709408 |
914755c7228a66c7308751af9650b914192d90e3 | 3,815 | py | Python | installer/core/terraform/resources/aws/cloudwatch.py | jonico/pacbot | ecb94fb987147098bc5b359772fad264619b3099 | [
"Apache-2.0"
] | 1,165 | 2018-10-05T19:07:34.000Z | 2022-03-28T19:34:27.000Z | installer/core/terraform/resources/aws/cloudwatch.py | jonico/pacbot | ecb94fb987147098bc5b359772fad264619b3099 | [
"Apache-2.0"
] | 334 | 2018-10-10T14:00:41.000Z | 2022-03-19T16:32:08.000Z | installer/core/terraform/resources/aws/cloudwatch.py | jtimberlake/pacbot | 5a25dc15882324583860630e773af2e2647dd5fa | [
"Apache-2.0"
] | 268 | 2018-10-05T19:53:25.000Z | 2022-03-31T07:39:47.000Z | from core.terraform.resources import TerraformResource
from core.config import Settings
from core.providers.aws.boto3 import cloudwatch_log
from core.providers.aws.boto3 import cloudwatch_event
class CloudWatchEventRuleResource(TerraformResource):
"""
Base resource class for Terraform AWS Cloudwatch event rul... | 34.0625 | 80 | 0.646658 |
b9d7185a59aacc3e5b992536f4593e0178bd9449 | 1,866 | py | Python | asyncsteampy/models.py | SomeSpecialOne/asyncsteampy | 57b22c76746e9e4785e5d86877e53b8efebfe2e0 | [
"MIT"
] | 1 | 2022-02-20T01:16:41.000Z | 2022-02-20T01:16:41.000Z | asyncsteampy/models.py | SomeSpecialOne/asyncsteampy | 57b22c76746e9e4785e5d86877e53b8efebfe2e0 | [
"MIT"
] | 1 | 2022-03-14T17:24:16.000Z | 2022-03-14T17:24:16.000Z | asyncsteampy/models.py | somespecialone/asyncsteampy | 57b22c76746e9e4785e5d86877e53b8efebfe2e0 | [
"MIT"
] | null | null | null | import enum
from collections import namedtuple
class GameOptions:
_predefined_options = namedtuple("_predefined_options", ["app_id", "context_id"])
STEAM = _predefined_options("753", "6")
DOTA2 = _predefined_options("570", "2")
CS = _predefined_options("730", "2")
CSGO = CS
TF2 = _predefined_... | 25.916667 | 85 | 0.646838 |
f1ae5337c7f456f483eb761780beff4e3e7003e5 | 4,251 | py | Python | simsg/loader_utils.py | DaShi-Git/simsg | 31df608cd04facb2b8b546cc6f53d84716117bdf | [
"Apache-2.0"
] | 58 | 2020-05-29T09:26:32.000Z | 2022-02-28T02:26:04.000Z | simsg/loader_utils.py | DaShi-Git/simsg | 31df608cd04facb2b8b546cc6f53d84716117bdf | [
"Apache-2.0"
] | 12 | 2020-06-05T11:24:55.000Z | 2022-01-07T23:45:30.000Z | simsg/loader_utils.py | DaShi-Git/simsg | 31df608cd04facb2b8b546cc6f53d84716117bdf | [
"Apache-2.0"
] | 14 | 2020-06-02T16:04:20.000Z | 2022-01-03T21:00:01.000Z | from simsg.data.vg import SceneGraphNoPairsDataset, collate_fn_nopairs
from simsg.data.clevr import SceneGraphWithPairsDataset, collate_fn_withpairs
import json
from torch.utils.data import DataLoader
def build_clevr_supervised_train_dsets(args):
print("building fully supervised %s dataset" % args.dataset)
with ... | 30.804348 | 85 | 0.731122 |
0ed4d6a450bd2c0e775a9f4805fb0f7589485dcf | 724 | py | Python | mtp_api/apps/disbursement/constants.py | ministryofjustice/mtp-api | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | [
"MIT"
] | 5 | 2016-01-05T12:21:35.000Z | 2020-10-28T17:06:02.000Z | mtp_api/apps/disbursement/constants.py | ministryofjustice/mtp-api | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | [
"MIT"
] | 209 | 2015-06-12T09:39:41.000Z | 2022-03-21T16:01:19.000Z | mtp_api/apps/disbursement/constants.py | ministryofjustice/mtp-api | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | [
"MIT"
] | 1 | 2021-04-11T06:19:23.000Z | 2021-04-11T06:19:23.000Z | from django.utils.translation import gettext_lazy as _
from extended_choices import Choices
LOG_ACTIONS = Choices(
('CREATED', 'created', _('Created')),
('EDITED', 'edited', _('Edited')),
('REJECTED', 'rejected', _('Rejected')),
('CONFIRMED', 'confirmed', _('Confirmed')),
('SENT', 'sent', _('Sent'... | 27.846154 | 59 | 0.61326 |
5f2bac257fda9dafccf18c7b4b32b828dd4cf447 | 1,291 | py | Python | models/fgr.py | rajahaseeb147/PCD_Registration_PointNet | 551d81e75022a8a1f91ef9c7669c55c4467276b6 | [
"MIT"
] | null | null | null | models/fgr.py | rajahaseeb147/PCD_Registration_PointNet | 551d81e75022a8a1f91ef9c7669c55c4467276b6 | [
"MIT"
] | null | null | null | models/fgr.py | rajahaseeb147/PCD_Registration_PointNet | 551d81e75022a8a1f91ef9c7669c55c4467276b6 | [
"MIT"
] | null | null | null | import copy
import open3d as o3d
def fpfh(pcd, normals):
pcd.normals = o3d.utility.Vector3dVector(normals)
pcd_fpfh = o3d.registration.compute_fpfh_feature(
pcd,
o3d.geometry.KDTreeSearchParamHybrid(radius=0.3, max_nn=64))
return pcd_fpfh
def execute_fast_global_registration(source, targ... | 37.970588 | 79 | 0.655306 |
c9ff5112c9e5140ac4bd70e95bb26f32001f9600 | 676 | py | Python | documents/urls.py | mdavoodi/konkourse-python | 50f2904e7bbb31f00c4dd66fb55cd644ea3c4eee | [
"MIT"
] | 4 | 2015-06-23T22:17:50.000Z | 2019-01-17T21:32:02.000Z | documents/urls.py | mdavoodi/konkourse-python | 50f2904e7bbb31f00c4dd66fb55cd644ea3c4eee | [
"MIT"
] | null | null | null | documents/urls.py | mdavoodi/konkourse-python | 50f2904e7bbb31f00c4dd66fb55cd644ea3c4eee | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
# All urls are subject to change once the course identification system is up.
urlpatterns = patterns('',
url(r'^documents/$', 'documents.views.documents'),
url(r'^documents/filter/(?P<course_id>\w+)/$', 'documents.views.documents'... | 56.333333 | 99 | 0.551775 |
4a2c1082004110358c7348baa3b9f94de6d5fd1c | 367 | py | Python | modules/dbnd/src/dbnd/_core/utils/fast_pickle.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | modules/dbnd/src/dbnd/_core/utils/fast_pickle.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | modules/dbnd/src/dbnd/_core/utils/fast_pickle.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | from six.moves import cPickle as pickle
import dbnd._vendor.cloudpickle as cloudpickle
# noinspection PyBroadException
def dumps(o):
try:
return pickle.dumps(o, pickle.HIGHEST_PROTOCOL)
except Exception:
return cloudpickle.dumps(o)
# noinspection PyBroadException
def loads(o):
"""Unpick... | 20.388889 | 55 | 0.72752 |
497fabf4dae4e8505e783b355d403025ab5fa708 | 15,398 | py | Python | backend/database/objects.py | binury/DistributedReplays | c09d7e41b9c9e57586beb03f26fa4eee59aecf15 | [
"Apache-2.0"
] | null | null | null | backend/database/objects.py | binury/DistributedReplays | c09d7e41b9c9e57586beb03f26fa4eee59aecf15 | [
"Apache-2.0"
] | null | null | null | backend/database/objects.py | binury/DistributedReplays | c09d7e41b9c9e57586beb03f26fa4eee59aecf15 | [
"Apache-2.0"
] | null | null | null | # ORM objects
import datetime
import enum
import uuid
from sqlalchemy import Column, Integer, String, Boolean, Float, ForeignKey, DateTime, Enum, UniqueConstraint, \
ForeignKeyConstraint, JSON, Index, func, Sequence
from sqlalchemy.dialects import postgresql
from sqlalchemy.ext.declarative import declarative_base
... | 32.012474 | 114 | 0.687882 |
fe96c0c1bea4a8f20cb0fdb5461aa47b65ee6b29 | 3,700 | py | Python | nanogds/base/shape.py | nanophysics/nanoGDS | 606ca36bafb4ff844b70cfe46520e62df35edc6f | [
"MIT"
] | 1 | 2020-09-15T15:27:13.000Z | 2020-09-15T15:27:13.000Z | nanogds/base/shape.py | nanophysics/nanoGDS | 606ca36bafb4ff844b70cfe46520e62df35edc6f | [
"MIT"
] | null | null | null | nanogds/base/shape.py | nanophysics/nanoGDS | 606ca36bafb4ff844b70cfe46520e62df35edc6f | [
"MIT"
] | null | null | null | import gdspy
import numpy as np
from copy import deepcopy
from .reference import Reference
class Shape:
def __init__(self):
self._reference = Reference()
self._shapes = {}
self.add_reference("ORIGIN", (0, 0))
self._draw()
def translate(self, dx, dy):
for shape in self... | 31.355932 | 86 | 0.587568 |
cbd037f94d39bd6df2aaa84bc641451c82316984 | 7,802 | py | Python | amazon_py/main2_no_tiles.py | thimabru1010/Satelite-Amazonia-Images-Segmentation | 1f15262587a1df72a8bc0fc5f586136fa9e5a9bc | [
"MIT"
] | 1 | 2021-02-01T18:35:01.000Z | 2021-02-01T18:35:01.000Z | amazon_py/main2_no_tiles.py | thimabru1010/Satelite-Amazonia-Images-Segmentation | 1f15262587a1df72a8bc0fc5f586136fa9e5a9bc | [
"MIT"
] | null | null | null | amazon_py/main2_no_tiles.py | thimabru1010/Satelite-Amazonia-Images-Segmentation | 1f15262587a1df72a8bc0fc5f586136fa9e5a9bc | [
"MIT"
] | null | null | null | #import utils
import time
from utils import np, plt, load_tiff_image, load_SAR_image, compute_metrics, data_augmentation, unet, normalization, \
RGB_image, extract_patches, patch_tiles, bal_aug_patches, extrac_patch2, test_FCN, pred_recostruction, \
weighted_categorical_crossentropy, mask_no_considered, tf, Adam, predi... | 36.801887 | 192 | 0.767624 |
4867f629621c55cdd375ba52f1c4cc23e02fa517 | 262 | py | Python | oscomp/src/oscomp/getppid_test.py | wei-huan/MyOS | 0592dd73fd9768a9a69975f7d18c758999195774 | [
"MIT"
] | 2 | 2022-02-21T08:37:46.000Z | 2022-03-03T06:01:47.000Z | oscomp/src/oscomp/getppid_test.py | wei-huan/MyOS | 0592dd73fd9768a9a69975f7d18c758999195774 | [
"MIT"
] | null | null | null | oscomp/src/oscomp/getppid_test.py | wei-huan/MyOS | 0592dd73fd9768a9a69975f7d18c758999195774 | [
"MIT"
] | null | null | null | from test_base import TestBase
import re
class getppid_test(TestBase):
def __init__(self):
super().__init__("getppid", 2)
def test(self, data):
self.assert_ge(len(data), 1)
self.assert_in(" getppid success. ppid : ", data[0])
| 21.833333 | 61 | 0.641221 |
d009729e50a6030bdd37abe2359e4fbf0dd8f061 | 1,410 | py | Python | api/handler.py | valferreiraalv/rossmann_sales_predict | bf9cacd8581110f1907bd1ddb0b043b9c2bc8821 | [
"MIT"
] | null | null | null | api/handler.py | valferreiraalv/rossmann_sales_predict | bf9cacd8581110f1907bd1ddb0b043b9c2bc8821 | [
"MIT"
] | null | null | null | api/handler.py | valferreiraalv/rossmann_sales_predict | bf9cacd8581110f1907bd1ddb0b043b9c2bc8821 | [
"MIT"
] | null | null | null | import pickle
import pandas as pd
from flask import Flask, request, Response
from rossmann.Rossmann import Rossmann
#loading model
model = pickle.load( open( r'C:/Users/ferki/repos/ds_em_producao/model/model_rossmann.pkl', 'rb' ) )
# initialize API
app = Flask( __... | 32.045455 | 101 | 0.563121 |
cef92cb1232e045a35103bc2e6caac3f5a8a06bf | 22,879 | py | Python | alibi/explainers/ale.py | enricorotundo/alibi | 8302fbfe05764ef5ff60f14b471381a6c6c072a3 | [
"ECL-2.0",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | alibi/explainers/ale.py | enricorotundo/alibi | 8302fbfe05764ef5ff60f14b471381a6c6c072a3 | [
"ECL-2.0",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | alibi/explainers/ale.py | enricorotundo/alibi | 8302fbfe05764ef5ff60f14b471381a6c6c072a3 | [
"ECL-2.0",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | import copy
import math
import numpy as np
import pandas as pd
from itertools import count
from functools import partial
from typing import Callable, List, Optional, Tuple, Union, TYPE_CHECKING, no_type_check
import sys
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions imp... | 37.323002 | 115 | 0.627956 |
cdaa7c878833b2bb0b37845fc2f27a007027459c | 6,535 | py | Python | src/evergreen/task.py | jimoleary/evergreen.py | 32c3a9c5ac42e32f6b7c6ee816fcad5f043def7b | [
"Apache-2.0"
] | null | null | null | src/evergreen/task.py | jimoleary/evergreen.py | 32c3a9c5ac42e32f6b7c6ee816fcad5f043def7b | [
"Apache-2.0"
] | null | null | null | src/evergreen/task.py | jimoleary/evergreen.py | 32c3a9c5ac42e32f6b7c6ee816fcad5f043def7b | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
"""Task representation of evergreen."""
from __future__ import absolute_import
from evergreen.base import _BaseEvergreenObject, evg_attrib, evg_datetime_attrib
EVG_SUCCESS_STATUS = 'success'
EVG_SYSTEM_FAILURE_STATUS = 'system'
EVG_UNDISPATCHED_STATUS = 'undispatched'
_EVG_DATE_FIELDS_IN_TA... | 31.418269 | 91 | 0.651721 |
a084cc8675675b92ea1d5f155d47ff1c3e3ed4d8 | 6,961 | py | Python | extractor/spider.py | nzsakib/frontendmasters | 45179da43f059f76ae66995412d837671f214142 | [
"MIT"
] | 1 | 2020-08-12T19:09:04.000Z | 2020-08-12T19:09:04.000Z | extractor/spider.py | nzsakib/frontendmasters | 45179da43f059f76ae66995412d837671f214142 | [
"MIT"
] | 1 | 2020-05-11T16:07:49.000Z | 2020-05-22T09:12:58.000Z | extractor/spider.py | nzsakib/frontendmasters | 45179da43f059f76ae66995412d837671f214142 | [
"MIT"
] | 1 | 2022-02-08T15:12:05.000Z | 2022-02-08T15:12:05.000Z | from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from urllib.request import urlopen
from .helper import *
from selenium.webdriver.firefox.options import Options
impor... | 34.631841 | 107 | 0.586985 |
0b18861c6f4339a1ca04dfd8300878200d15cac5 | 498 | py | Python | visual_data/app/utils.py | SaidLopez/django_start | 2932d4433b022a729b2afaaf13baf678aafc4b0a | [
"MIT"
] | null | null | null | visual_data/app/utils.py | SaidLopez/django_start | 2932d4433b022a729b2afaaf13baf678aafc4b0a | [
"MIT"
] | null | null | null | visual_data/app/utils.py | SaidLopez/django_start | 2932d4433b022a729b2afaaf13baf678aafc4b0a | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import base64
from io import BytesIO
def get_graph():
buffer = BytesIO()
plt.savefig(buffer, format='png')
buffer.seek(0)
image_png = buffer.getvalue()
graph = base64.b64encode(image_png)
graph = graph.decode('utf-8')
buffer.close()
return graph
def get_... | 19.92 | 39 | 0.654618 |
400e10822dc37be9b318eea15f5714a7d018a8df | 1,905 | py | Python | api/blueprints.py | frekkr-ingahaim/flask-api-otrs-tutorial | 6e2396824d0b3744dbe8a467fe645768223b75b7 | [
"MIT"
] | null | null | null | api/blueprints.py | frekkr-ingahaim/flask-api-otrs-tutorial | 6e2396824d0b3744dbe8a467fe645768223b75b7 | [
"MIT"
] | null | null | null | api/blueprints.py | frekkr-ingahaim/flask-api-otrs-tutorial | 6e2396824d0b3744dbe8a467fe645768223b75b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Create the Blueprints for the api routes.
We use a factory function to create the Blueprints and add those to
a global variable all_blueprints
"""
from flask import Blueprint
from flask import abort, render_template
import logging
log = logging.getLogger()
def _factory(partial_module_str... | 28.863636 | 100 | 0.724409 |
b6b77dd916ad98d2c15bd5f79e1f59d9cfde9f0d | 2,219 | py | Python | ncc-event-listener.py | tbearma1/ncc | 76317ae7ad0fb07534e9df6089789b8bf83524b2 | [
"Apache-2.0"
] | 62 | 2017-01-15T10:29:44.000Z | 2022-03-12T07:25:42.000Z | ncc-event-listener.py | tbearma1/ncc | 76317ae7ad0fb07534e9df6089789b8bf83524b2 | [
"Apache-2.0"
] | 22 | 2017-01-13T09:54:44.000Z | 2018-07-23T23:41:24.000Z | ncc-event-listener.py | tbearma1/ncc | 76317ae7ad0fb07534e9df6089789b8bf83524b2 | [
"Apache-2.0"
] | 29 | 2017-01-10T11:15:18.000Z | 2021-05-14T04:23:39.000Z | #!/usr/bin/env python
#
# Copyright (c) 2018 Cisco and/or its affiliates
#
import sys
from argparse import ArgumentParser
from ncclient import manager
from lxml import etree
import logging
import time
import datetime
from ncclient.transport.session import SessionListener
if __name__ == '__main__':
parser = Argume... | 33.119403 | 101 | 0.585849 |
f53eadf0f5f7ebe4ec9057ac78a5383972ba638f | 2,039 | py | Python | users/forms.py | jhurtadojerves/platzigram | 4329351cbe71835f4f3ff6247518c45a48a26b3d | [
"MIT"
] | null | null | null | users/forms.py | jhurtadojerves/platzigram | 4329351cbe71835f4f3ff6247518c45a48a26b3d | [
"MIT"
] | null | null | null | users/forms.py | jhurtadojerves/platzigram | 4329351cbe71835f4f3ff6247518c45a48a26b3d | [
"MIT"
] | null | null | null | """User forms"""
# Django
from django import forms
# Models
from django.contrib.auth.models import User
from users.models import Profile, Following
class SignupForm(forms.Form):
"""Sign up form."""
username = forms.CharField(min_length=4, max_length=50)
password = forms.CharField(
max_length=7... | 26.480519 | 72 | 0.654733 |
76ce5137c6981e5be069cdbd94fb5ccf939aee27 | 4,456 | py | Python | keras_to_numpy.py | prashantramnani/nn_likelihoods | 94e7a1d8fdf8c4e635eeaa66a7e941aa6b226f41 | [
"MIT"
] | 2 | 2019-08-19T15:48:01.000Z | 2020-03-13T12:47:23.000Z | keras_to_numpy.py | prashantramnani/nn_likelihoods | 94e7a1d8fdf8c4e635eeaa66a7e941aa6b226f41 | [
"MIT"
] | null | null | null | keras_to_numpy.py | prashantramnani/nn_likelihoods | 94e7a1d8fdf8c4e635eeaa66a7e941aa6b226f41 | [
"MIT"
] | 6 | 2019-06-13T04:46:51.000Z | 2021-01-27T18:26:59.000Z | # Load packages
#import tensorflow as tf
#from tensorflow import keras
import numpy as np
import pickle
# Activations
def relu(x):
return np.maximum(0, x)
def linear(x):
return x
def sigmoid(x):
return 1 / (1 + np.exp(- x))
# def tanh(x):
# return (2 / (1 + np.exp(- 2 * x))) - 1
# Function to ext... | 33.503759 | 97 | 0.492594 |
77706504fb2637660e6ce4de7be59d6ddace7191 | 71 | py | Python | resource_scheduler/__init__.py | simon-andrews/django-resource-scheduler | 073faa101d0d3456f1079ea6e4d17c9f4ddaa019 | [
"MIT"
] | 2 | 2021-02-27T08:55:38.000Z | 2021-04-28T22:12:54.000Z | resource_scheduler/__init__.py | simon-andrews/django-resource-scheduler | 073faa101d0d3456f1079ea6e4d17c9f4ddaa019 | [
"MIT"
] | 1 | 2015-12-28T17:35:02.000Z | 2015-12-28T17:35:29.000Z | resource_scheduler/__init__.py | simon-andrews/django-resource-scheduler | 073faa101d0d3456f1079ea6e4d17c9f4ddaa019 | [
"MIT"
] | 1 | 2020-07-15T13:50:11.000Z | 2020-07-15T13:50:11.000Z | default_app_config = 'resource_scheduler.apps.ResourceSchedulerConfig'
| 35.5 | 70 | 0.887324 |
e0a1d2aa67138cc2057809b64393b90291735505 | 33,576 | py | Python | flink-python/pyflink/datastream/tests/test_connectors.py | hnrainll/flink | 6b04a50ae2182d4cdd8e44ea9a16171d1d2394ce | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/datastream/tests/test_connectors.py | hnrainll/flink | 6b04a50ae2182d4cdd8e44ea9a16171d1d2394ce | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/datastream/tests/test_connectors.py | hnrainll/flink | 6b04a50ae2182d4cdd8e44ea9a16171d1d2394ce | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 48.450216 | 100 | 0.658655 |
9116d8b4daab574e0a94a99b7d6658f59fd5b9f0 | 2,797 | py | Python | S13/deployment/ETESR/handler.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | null | null | null | S13/deployment/ETESR/handler.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | 9 | 2021-06-08T22:18:08.000Z | 2022-03-12T00:46:43.000Z | S13/deployment/ETESR/handler.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | 1 | 2020-10-12T17:13:35.000Z | 2020-10-12T17:13:35.000Z | try:
import unzip_requirements
except ImportError:
pass
import os
import io
import json
import base64
import boto3
import sys
from requests_toolbelt.multipart import decoder
from model import srtotext
S3_BUCKET = os.environ['S3_BUCKET'] if 'S3_BUCKET' in os.environ else 'pankaj90382-dnn'
MODEL_PATH = os.env... | 28.252525 | 87 | 0.580265 |
7532dc0cf14315bb235906f5286ca6b041201c65 | 6,249 | py | Python | ckan/model/resource.py | gg2/ckan | d61a533cc330b6050f4957573f58ec912695ed0a | [
"BSD-3-Clause"
] | 1 | 2022-03-24T04:47:38.000Z | 2022-03-24T04:47:38.000Z | ckan/model/resource.py | gg2/ckan | d61a533cc330b6050f4957573f58ec912695ed0a | [
"BSD-3-Clause"
] | 1 | 2021-09-22T12:53:39.000Z | 2021-09-22T12:53:39.000Z | ckan/model/resource.py | gg2/ckan | d61a533cc330b6050f4957573f58ec912695ed0a | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from collections import OrderedDict
from sqlalchemy.ext.orderinglist import ordering_list
from sqlalchemy import orm
from ckan.common import config
from sqlalchemy import types, func, Column, Table, ForeignKey
from ckan.model import (
meta,
core,
types as _types,
ex... | 33.239362 | 83 | 0.637222 |
7e64ae48ac254601efaa8d9ccc990b90c8128faa | 436 | py | Python | src/birthday/urls.py | hijal/event-management-system | 92fa74035bec846e3448bf210bb5d5088bbf639e | [
"bzip2-1.0.6"
] | 3 | 2021-09-27T00:45:42.000Z | 2021-09-28T16:42:05.000Z | src/birthday/urls.py | hijal/event-management-system | 92fa74035bec846e3448bf210bb5d5088bbf639e | [
"bzip2-1.0.6"
] | null | null | null | src/birthday/urls.py | hijal/event-management-system | 92fa74035bec846e3448bf210bb5d5088bbf639e | [
"bzip2-1.0.6"
] | null | null | null | from django.urls import path
from .views import (
selection,
eventtype,
guest_number,
select_date,
selection_detail
)
urlpatterns = [
path('select/', selection, name = 'select'),
path('types/', eventtype, name = 'eventtype'),
path('guests/', guest_number, name =... | 27.25 | 55 | 0.598624 |
934196fa433b2fc268c93bdd66d28635519a5f87 | 653 | py | Python | thefuck/rules/git_rm_staged.py | RogueScholar/thefuck-termux | cc33d5fa0077b2b2323b8a62f3478ff8efef3fba | [
"MIT"
] | null | null | null | thefuck/rules/git_rm_staged.py | RogueScholar/thefuck-termux | cc33d5fa0077b2b2323b8a62f3478ff8efef3fba | [
"MIT"
] | null | null | null | thefuck/rules/git_rm_staged.py | RogueScholar/thefuck-termux | cc33d5fa0077b2b2323b8a62f3478ff8efef3fba | [
"MIT"
] | null | null | null | from thefuck.specific.git import git_support
@git_support
def match(command):
return (" rm " in command.script
and "error: the following file has changes staged in the index" in
command.output
and "use --cached to keep the file, or -f to force removal" in
command.ou... | 29.681818 | 78 | 0.669219 |
fc163917f0b9ecdc7edddac19d06b8d2d916af38 | 4,090 | py | Python | dpipe/layout/base.py | neuro-ml/deep_pipe | fa559630c20548105884151e973dc40c88531891 | [
"MIT"
] | 38 | 2017-09-08T04:51:17.000Z | 2022-03-29T17:34:22.000Z | dpipe/layout/base.py | neuro-ml/deep_pipe | fa559630c20548105884151e973dc40c88531891 | [
"MIT"
] | 41 | 2017-09-29T22:06:21.000Z | 2021-12-03T09:31:57.000Z | dpipe/layout/base.py | neuro-ml/deep_pipe | fa559630c20548105884151e973dc40c88531891 | [
"MIT"
] | 12 | 2017-09-08T04:40:39.000Z | 2021-01-19T19:19:37.000Z | import contextlib
import os
from abc import ABC, abstractmethod
from argparse import ArgumentParser
from pathlib import Path
from typing import Sequence, Iterable
import lazycon
from ..io import save, PathLike, load
class Layout(ABC):
@abstractmethod
def build(self, *args, **kwargs):
"""Build a new ... | 32.72 | 113 | 0.610024 |
3e016257f412f78989270fda24dcf46c39687e39 | 335,457 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 ... | 42.538296 | 348 | 0.668327 |
63ed83f070dbadd6a9dbcf033d88e9593da73942 | 5,547 | py | Python | birgitta/recipetest/coverage/report.py | telia-oss/birgitta | e4d27465f54a1d4789741e19e15aec726149a735 | [
"MIT"
] | 8 | 2019-11-25T16:39:33.000Z | 2022-03-31T12:48:54.000Z | birgitta/recipetest/coverage/report.py | telia-oss/birgitta | e4d27465f54a1d4789741e19e15aec726149a735 | [
"MIT"
] | 218 | 2019-09-09T11:11:59.000Z | 2022-03-08T05:16:40.000Z | birgitta/recipetest/coverage/report.py | telia-oss/birgitta | e4d27465f54a1d4789741e19e15aec726149a735 | [
"MIT"
] | 4 | 2020-07-21T15:33:40.000Z | 2021-12-22T11:32:45.000Z | """Evaluate coverage of all transformations in notebook,
ensuring that all of them have handled at least one record, to
promote test coverage of all logic.
"""
import json
import os
import pytest
from birgitta import context
from birgitta import timing
__all__ = [
'log_transform',
'collect',
'cov_report_... | 32.629412 | 74 | 0.671354 |
d4c50cd7f61afcf348315e69ef9d4afd88e12794 | 16,925 | py | Python | adanet/core/testing_utils.py | etarakci-hvl/adanet | 712bc8efbcce4684cc81108ad916a735cddb4de2 | [
"Apache-2.0"
] | 1 | 2020-11-08T17:03:52.000Z | 2020-11-08T17:03:52.000Z | adanet/core/testing_utils.py | etarakci-hvl/adanet | 712bc8efbcce4684cc81108ad916a735cddb4de2 | [
"Apache-2.0"
] | null | null | null | adanet/core/testing_utils.py | etarakci-hvl/adanet | 712bc8efbcce4684cc81108ad916a735cddb4de2 | [
"Apache-2.0"
] | null | null | null | """Test utilities for AdaNet single graph implementation.
Copyright 2018 The AdaNet 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
https://www.apache.org/license... | 34.400407 | 138 | 0.682954 |
3d3e04ba4f357143776c5e77220144c044bcc097 | 435 | py | Python | nerodia/elements/table_section.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 83 | 2017-11-20T08:41:09.000Z | 2022-02-09T21:01:47.000Z | nerodia/elements/table_section.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 28 | 2017-11-21T02:25:03.000Z | 2021-04-15T15:26:30.000Z | nerodia/elements/table_section.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 14 | 2017-11-29T06:44:12.000Z | 2021-09-06T04:53:44.000Z | import six
from .html_elements import HTMLElement
from ..meta_elements import MetaHTMLElement
from ..row_container import RowContainer
@six.add_metaclass(MetaHTMLElement)
class TableSection(RowContainer, HTMLElement):
def __getitem__(self, idx):
"""
Returns row of this table with given index
... | 24.166667 | 50 | 0.703448 |
f8746bc5acbabf945a18329718ffd08683aa62e1 | 116 | py | Python | blog/admin.py | Suraj317github/django-blog | fe6f26ee4d0ce521789eb226fabc0c1529bf47ab | [
"MIT"
] | null | null | null | blog/admin.py | Suraj317github/django-blog | fe6f26ee4d0ce521789eb226fabc0c1529bf47ab | [
"MIT"
] | 1 | 2021-10-17T20:27:11.000Z | 2021-10-17T20:27:11.000Z | blog/admin.py | Suraj317github/django-blog | fe6f26ee4d0ce521789eb226fabc0c1529bf47ab | [
"MIT"
] | 1 | 2021-10-30T04:40:48.000Z | 2021-10-30T04:40:48.000Z | from django.contrib import admin
# Register your models here.
from .models import Post
admin.site.register(Post)
| 14.5 | 32 | 0.784483 |
153c64e39572660684d051fba0814d32a6fa29a5 | 61 | py | Python | projects/api/monitorings/__init__.py | platiagro/projects | 00da234b35003bb0ecc2d22a997e08737ceda044 | [
"Apache-2.0"
] | 6 | 2019-09-16T13:07:20.000Z | 2021-06-02T19:02:05.000Z | projects/api/monitorings/__init__.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | 325 | 2019-09-20T20:06:00.000Z | 2022-03-30T15:05:49.000Z | projects/api/monitorings/__init__.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | 17 | 2019-08-02T16:55:47.000Z | 2021-06-26T19:13:35.000Z | from .monitorings import router
__all__ = [
"router",
]
| 10.166667 | 31 | 0.655738 |
bcb48f703ec7680671bff2852efdbcc04dac70de | 1,651 | py | Python | coffee_machine.py | IshanIqbal1401/virtual_coffee_machine | c1d304666cbdd3ea42a9fd55fc324baa66479089 | [
"MIT"
] | null | null | null | coffee_machine.py | IshanIqbal1401/virtual_coffee_machine | c1d304666cbdd3ea42a9fd55fc324baa66479089 | [
"MIT"
] | null | null | null | coffee_machine.py | IshanIqbal1401/virtual_coffee_machine | c1d304666cbdd3ea42a9fd55fc324baa66479089 | [
"MIT"
] | null | null | null | from coffee_machine_data import MENU,resources
def insert_coins():
print('Pls insert Coins! ')
quarters=float(input('how many quarters?: $'))
dimes=float(input('how many dimes?: $'))
nickels=float(input('how many nickles?:$'))
pennies=float(input('how many pennies?:$'))
return 0.25*quarte... | 30.018182 | 99 | 0.619019 |
7bdaa98ddd05fb7b7be7704c293ed0dbf969e153 | 2,827 | py | Python | swingers/sauth/backends.py | jawaidm/pbs | 87f5c535c976d6a5eccbfbbf2073589b6e366d04 | [
"Apache-2.0"
] | null | null | null | swingers/sauth/backends.py | jawaidm/pbs | 87f5c535c976d6a5eccbfbbf2073589b6e366d04 | [
"Apache-2.0"
] | 12 | 2019-10-22T23:16:38.000Z | 2022-03-11T23:17:45.000Z | swingers/sauth/backends.py | jawaidm/pbs | 87f5c535c976d6a5eccbfbbf2073589b6e366d04 | [
"Apache-2.0"
] | 5 | 2019-12-19T06:18:42.000Z | 2022-01-07T01:16:18.000Z | from django.contrib.auth import get_user_model
from django_auth_ldap.backend import LDAPBackend
from django_browserid.auth import BrowserIDBackend
from guardian.backends import ObjectPermissionBackend
User = get_user_model()
class PersonaBackend(BrowserIDBackend):
def filter_users_by_email(self, email):
... | 36.24359 | 82 | 0.585073 |
61900910e87830e42b3f911f1e81b173e28703bd | 6,633 | py | Python | flexlab/models/chiller_fmu_1a/emulated_chiller.py | rongxinyin/HIL-Sim | 7a24ad7b11e11d26978f2b575b705cecbafef7e5 | [
"MIT"
] | null | null | null | flexlab/models/chiller_fmu_1a/emulated_chiller.py | rongxinyin/HIL-Sim | 7a24ad7b11e11d26978f2b575b705cecbafef7e5 | [
"MIT"
] | 4 | 2022-01-20T21:11:01.000Z | 2022-03-31T00:18:49.000Z | flexlab/models/chiller_fmu_1a/emulated_chiller.py | rongxinyin/HIL-Sim | 7a24ad7b11e11d26978f2b575b705cecbafef7e5 | [
"MIT"
] | null | null | null | from pyfmi import load_fmu
import yaml
import numpy as np
import asyncio
from flask import Flask, jsonify
import threading
from flexlab.db_layer import db_interface
import datetime
import pytz
import pandas as pd
class Emulated_Chiller:
def __init__(self, config_file='flexlab/models/chiller_fmu_1a/chiller_config... | 42.248408 | 193 | 0.630182 |
5c8ff1efc07de8aad3b0dc0fc6ad1de9695aa90a | 5,823 | py | Python | bart/cli.py | gulsmyigit/unifiedqa | b8617507c5e61a5c314855685d36fead3d7538b8 | [
"Apache-2.0"
] | 255 | 2020-05-05T02:16:06.000Z | 2022-03-30T14:46:06.000Z | bart/cli.py | pop2pop3/unifiedqa | 56dac6ad8faa35edc249f2dc59f0d2c9b3892793 | [
"Apache-2.0"
] | 39 | 2020-06-03T02:49:52.000Z | 2022-03-30T16:43:44.000Z | bart/cli.py | pop2pop3/unifiedqa | 56dac6ad8faa35edc249f2dc59f0d2c9b3892793 | [
"Apache-2.0"
] | 36 | 2020-05-10T05:50:18.000Z | 2022-03-12T03:09:12.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. 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/LICENS... | 43.455224 | 104 | 0.659797 |
f1d4dc184d6b6da1c24a775c90cc09ae713fbf82 | 106 | py | Python | 12-tensorflow/hello_world.py | smddzcy/learning-new-technologies | cf3645ff649f6dfe89c77e90ceaf089b66da2482 | [
"MIT"
] | 3 | 2017-02-22T08:45:53.000Z | 2017-04-29T13:40:23.000Z | 12-tensorflow/hello_world.py | smddzcy/learning-new-technologies | cf3645ff649f6dfe89c77e90ceaf089b66da2482 | [
"MIT"
] | null | null | null | 12-tensorflow/hello_world.py | smddzcy/learning-new-technologies | cf3645ff649f6dfe89c77e90ceaf089b66da2482 | [
"MIT"
] | null | null | null | import tensorflow as tf
hello = tf.constant("Hello, World!")
sess = tf.Session()
print(sess.run(hello))
| 15.142857 | 36 | 0.707547 |
45809432e975be10e7a83772722683b22325af61 | 18,822 | py | Python | examples/compressible_example.py | eljoelopez/simscale-python-sdk | 189f1337b2ab40feed123111ddead0cdecf83c93 | [
"MIT"
] | 1 | 2022-01-03T08:59:39.000Z | 2022-01-03T08:59:39.000Z | examples/compressible_example.py | eljoelopez/simscale-python-sdk | 189f1337b2ab40feed123111ddead0cdecf83c93 | [
"MIT"
] | null | null | null | examples/compressible_example.py | eljoelopez/simscale-python-sdk | 189f1337b2ab40feed123111ddead0cdecf83c93 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import time
import zipfile
import isodate
import urllib3
from simscale_sdk import Compressible, FluidModel, FluidInitialConditions, \
AdvancedConcepts, TopologicalReference, FluidResultControls, AreaAverageResultControl, ScotchDecomposeAlgorithm, \
FluidNumerics, Rela... | 43.772093 | 122 | 0.726862 |
8962e24703e0f4a3d8ccdf07323c91a1ccdd76dc | 494 | py | Python | pina/meta.py | s274001/PINA | beb33f0da20581338c46f0c525775904b35a1130 | [
"MIT"
] | 4 | 2022-02-16T14:52:55.000Z | 2022-03-17T13:31:42.000Z | pina/meta.py | s274001/PINA | beb33f0da20581338c46f0c525775904b35a1130 | [
"MIT"
] | 3 | 2022-02-17T08:57:42.000Z | 2022-03-28T08:41:53.000Z | pina/meta.py | s274001/PINA | beb33f0da20581338c46f0c525775904b35a1130 | [
"MIT"
] | 7 | 2022-02-13T14:35:00.000Z | 2022-03-28T08:51:11.000Z | __all__ = [
'__project__',
'__title__',
'__author__',
'__copyright__',
'__license__',
'__version__',
'__mail__',
'__maintainer__',
'__status__']
__project__ = 'PINA'
__title__ = "pina"
__author__ = "Nicola Demo, Maria Strazzullo"
__copyright__ = "Copyright 2021-2021, PINA contributo... | 21.478261 | 56 | 0.680162 |
9e8688dc35822595bf83fe43587791a8550d6b6e | 1,663 | py | Python | tests/core/configuration/test_eth1_app_config_object.py | gsalgado/trinity | e35154226ffae471e625547027368e664ec5e422 | [
"MIT"
] | 1 | 2021-04-07T07:33:28.000Z | 2021-04-07T07:33:28.000Z | tests/core/configuration/test_eth1_app_config_object.py | gsalgado/trinity | e35154226ffae471e625547027368e664ec5e422 | [
"MIT"
] | null | null | null | tests/core/configuration/test_eth1_app_config_object.py | gsalgado/trinity | e35154226ffae471e625547027368e664ec5e422 | [
"MIT"
] | null | null | null | import pytest
from trinity.config import (
Eth1AppConfig,
Eth1DbMode,
TrinityConfig,
)
from trinity.nodes.full import (
FullNode,
)
from trinity.nodes.light import (
LightNode,
)
@pytest.mark.parametrize(
"app_identifier, sync_mode, expected_db_path, expected_db_name",
(
("eth1", ... | 31.377358 | 118 | 0.665063 |
80397a2d12a7244c8a741c0a7d0dfefc3156238d | 7,681 | py | Python | src/dirbs/schema_migrators/v71_upgrade.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | src/dirbs/schema_migrators/v71_upgrade.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | src/dirbs/schema_migrators/v71_upgrade.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | 3 | 2019-10-24T11:40:06.000Z | 2022-02-24T07:34:00.000Z | """
DIRBS DB schema migration script (v70 -> v71).
Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are me... | 61.943548 | 120 | 0.550579 |
c72ab511fe3e8090b36bf6ceaf69d1f74fe32953 | 4,371 | py | Python | sdk/python/pulumi_google_native/firebasedatabase/v1beta/get_instance.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/firebasedatabase/v1beta/get_instance.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/firebasedatabase/v1beta/get_instance.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # 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
__... | 34.968 | 157 | 0.638984 |
3ee4737e7a38027dfb5624293ffe796e2b0023e5 | 3,429 | py | Python | buildnis/doc/source/conf.py | Release-Candidate/Buildnis | f22cb6a1caa3256a2e14aba5e7e8a3b21ad51226 | [
"MIT"
] | null | null | null | buildnis/doc/source/conf.py | Release-Candidate/Buildnis | f22cb6a1caa3256a2e14aba5e7e8a3b21ad51226 | [
"MIT"
] | 4 | 2021-03-08T16:19:43.000Z | 2021-03-08T16:51:17.000Z | buildnis/doc/source/conf.py | Release-Candidate/Buildnis | f22cb6a1caa3256a2e14aba5e7e8a3b21ad51226 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 30.891892 | 79 | 0.690289 |
9803879294bb24e7b11ff05d389e8235dcdb8d17 | 17,128 | py | Python | bindings/python/cntk/core.py | StillKeepTry/CNTK | 356eb21f8edcaf5d8e0510367ff01c6092062ec6 | [
"RSA-MD"
] | null | null | null | bindings/python/cntk/core.py | StillKeepTry/CNTK | 356eb21f8edcaf5d8e0510367ff01c6092062ec6 | [
"RSA-MD"
] | null | null | null | bindings/python/cntk/core.py | StillKeepTry/CNTK | 356eb21f8edcaf5d8e0510367ff01c6092062ec6 | [
"RSA-MD"
] | 1 | 2018-12-28T14:03:59.000Z | 2018-12-28T14:03:59.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import warnings
import numbers
import numpy as np
from scipy import sparse
from . i... | 39.465438 | 123 | 0.567667 |
6b43d1ad7e5009e1ce7625554ae0a37e5f48c151 | 622 | py | Python | leetcode/insert_search/searchInsert.py | lowks/levelup | 805e48cbf33d48616f55ef1b3740bb15b548054d | [
"MIT"
] | null | null | null | leetcode/insert_search/searchInsert.py | lowks/levelup | 805e48cbf33d48616f55ef1b3740bb15b548054d | [
"MIT"
] | 39 | 2018-04-15T12:36:36.000Z | 2018-09-16T15:31:50.000Z | leetcode/insert_search/searchInsert.py | lowks/levelup | 805e48cbf33d48616f55ef1b3740bb15b548054d | [
"MIT"
] | null | null | null | import unittest
def searchInsert(nums, target):
try:
return nums.index(target)
except ValueError:
for i,v in enumerate(nums):
try:
if (target > v) and (target < nums[i+1]):
return i + 1
elif (target < v):
return 0
except IndexError:
return len(nums)
class TestSearchInsert(unittest.... | 18.848485 | 47 | 0.652733 |
64210a10c65fa16d1dcd005d00d5842b214da557 | 2,380 | py | Python | gif_pipeline/tasks/task.py | SpangleLabs/gif_pipeline | 0ce4fb1aefcc1a11a3e3a0f920f37d4187982972 | [
"MIT"
] | 1 | 2022-01-27T13:26:35.000Z | 2022-01-27T13:26:35.000Z | gif_pipeline/tasks/task.py | SpangleLabs/gif_pipeline | 0ce4fb1aefcc1a11a3e3a0f920f37d4187982972 | [
"MIT"
] | 1 | 2022-03-12T01:04:11.000Z | 2022-03-12T01:04:11.000Z | gif_pipeline/tasks/task.py | SpangleLabs/gif_pipeline | 0ce4fb1aefcc1a11a3e3a0f920f37d4187982972 | [
"MIT"
] | null | null | null | import asyncio
import logging
from abc import ABC, abstractmethod
from asyncio import StreamReader
from asyncio.subprocess import Process
from typing import TypeVar, Generic, Optional, Tuple
T = TypeVar('T')
logger = logging.getLogger(__name__)
DEFAULT_TIMEOUT = 5 * 60
CLOSE_TIMEOUT = 10
class TaskException(Exceptio... | 30.909091 | 112 | 0.641597 |
f8733545af196680a5a069e73d477bc53de56268 | 1,671 | py | Python | xlsxwriter/test/comparison/test_chart_gradient08.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_gradient08.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_gradient08.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 26.109375 | 79 | 0.558348 |
33b9ba30fe5e19f36ce5a41d4a8ea8e8ca9ee332 | 2,646 | py | Python | 6_ObjectOriented/dunder_methods.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 6_ObjectOriented/dunder_methods.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 6_ObjectOriented/dunder_methods.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | from math import sqrt
from functools import total_ordering
@total_ordering # Decorator fügt __lt__ hinzu
class Vector2D:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
# Call Methode -> Bsp.: Keras funktionale API (zum Updaten von Objekten)
def __call__(self):
print("Calling the _... | 21.867769 | 96 | 0.575208 |
f618b93dc03ace31ae6e93ba9ca0806203cf4a66 | 889 | py | Python | src/rekognition_online_action_detection/models/transformer/position_encoding.py | amazon-research/long-short-term-transformer | a425be4b52ab68fddd85c91d26571e4cdfe8379a | [
"Apache-2.0"
] | 52 | 2021-11-19T01:35:10.000Z | 2022-03-24T11:48:10.000Z | src/rekognition_online_action_detection/models/transformer/position_encoding.py | amazon-research/long-short-term-transformer | a425be4b52ab68fddd85c91d26571e4cdfe8379a | [
"Apache-2.0"
] | 9 | 2021-11-24T18:50:13.000Z | 2022-03-10T05:13:53.000Z | src/rekognition_online_action_detection/models/transformer/position_encoding.py | amazon-research/long-short-term-transformer | a425be4b52ab68fddd85c91d26571e4cdfe8379a | [
"Apache-2.0"
] | 8 | 2022-01-15T08:01:33.000Z | 2022-03-20T22:08:29.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import math
import torch
import torch.nn as nn
class PositionalEncoding(nn.Module):
def __init__(self, d_model, dropout=0.1, max_len=5000):
super(PositionalEncoding, self).__init__()
self... | 31.75 | 98 | 0.640045 |
9da6f816639598eb0a1ca67bc33d6e77d3ed361e | 2,755 | py | Python | scripts/milestone_1.py | ironmanyu/serving_fluids | 8f1106fb6f880be14237724b6b03c17e299b721f | [
"MIT"
] | null | null | null | scripts/milestone_1.py | ironmanyu/serving_fluids | 8f1106fb6f880be14237724b6b03c17e299b721f | [
"MIT"
] | null | null | null | scripts/milestone_1.py | ironmanyu/serving_fluids | 8f1106fb6f880be14237724b6b03c17e299b721f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import fetch_api
from fetch_api import Arm, Base, Gripper, Head, Torso, ArmJoints
import math
import ros
import threading
from moveit_python import PlanningSceneInterface, MoveGroupInterface
# my nodes
import pick, stow, place
def clear_planning_scene(PSI):
# clears all of t... | 27.828283 | 99 | 0.710708 |
6cf07ef7733df4e8d32fa972d25317eca2a955e0 | 3,191 | py | Python | scripts/addons/animation_nodes/sockets/interpolation.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 2 | 2020-04-16T22:12:40.000Z | 2022-01-22T17:18:45.000Z | scripts/addons/animation_nodes/sockets/interpolation.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | null | null | null | scripts/addons/animation_nodes/sockets/interpolation.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 2 | 2019-05-16T04:01:09.000Z | 2020-08-25T11:42:26.000Z | import bpy
from bpy.props import *
from .. events import propertyChanged
from .. data_structures import Interpolation
from .. algorithms.interpolations import getInterpolationPreset, PyInterpolation, Linear
from .. base_types import AnimationNodeSocket, PythonListSocket
categoryItems = [
("LINEAR", "Linear", "", "... | 36.678161 | 88 | 0.632404 |
5d82221a2318decb8afa09ae7b606d1e6302dd7f | 2,012 | py | Python | symposion/speakers/migrations/0001_initial.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 154 | 2015-01-17T02:29:24.000Z | 2022-03-20T20:37:24.000Z | symposion/speakers/migrations/0001_initial.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 316 | 2015-01-10T04:01:50.000Z | 2020-09-30T20:18:08.000Z | symposion/speakers/migrations/0001_initial.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 89 | 2015-01-10T05:25:21.000Z | 2022-02-27T03:28:59.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
m... | 54.378378 | 365 | 0.64662 |
261ed798e9184a082be45774c96c157841420413 | 8,179 | py | Python | main.py | kuri65536/leveldb-ui-quart | d877f3d49ad0a4e1a2bc8de9dfe0f6630e7f18c5 | [
"MIT"
] | 1 | 2020-05-02T15:59:39.000Z | 2020-05-02T15:59:39.000Z | main.py | kuri65536/leveldb-ui-quart | d877f3d49ad0a4e1a2bc8de9dfe0f6630e7f18c5 | [
"MIT"
] | 1 | 2018-03-19T21:21:37.000Z | 2018-03-19T21:23:14.000Z | main.py | kuri65536/leveldb-ui-quart | d877f3d49ad0a4e1a2bc8de9dfe0f6630e7f18c5 | [
"MIT"
] | 1 | 2019-02-28T17:03:48.000Z | 2019-02-28T17:03:48.000Z | # Copyright (c) 2018, Shimoda <kuri65536 at hotmail dot com>
#
# 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/.
#
from typing import (Any, AsyncGenerator, Dict,
... | 27.082781 | 77 | 0.541753 |
79d01de2d918fc8256add3975335999a9dc91b50 | 288 | py | Python | Practice/Beginner/Find Remainder/PYTHON/find-remainder.py | avantikat/codechef-1 | 11e678a05ad339e799bb876606297dff979e9e03 | [
"MIT"
] | 2 | 2021-01-19T05:48:45.000Z | 2021-01-20T11:58:39.000Z | Practice/Beginner/Find Remainder/PYTHON/find-remainder.py | avantikat/codechef-1 | 11e678a05ad339e799bb876606297dff979e9e03 | [
"MIT"
] | null | null | null | Practice/Beginner/Find Remainder/PYTHON/find-remainder.py | avantikat/codechef-1 | 11e678a05ad339e799bb876606297dff979e9e03 | [
"MIT"
] | 3 | 2021-01-21T06:58:27.000Z | 2021-02-09T13:20:29.000Z | """
AUTHOR - Atharva Deshpande
GITHUB - https://github.com/AtharvaD11
QUESTION LINK - https://www.codechef.com/problems/FLOW002
"""
***********************************************************
for _ in range(int(input())):
a,b = map(int,input().split())
print(a%b)
| 26.181818 | 62 | 0.493056 |
3b5e4fb885c53e3dab8f0832da984fc831a1ccca | 22,206 | py | Python | map.py | yhf2022/APAN | b4dd9a5585f42cccefe01e9525cdc8c59727bdf2 | [
"MIT"
] | null | null | null | map.py | yhf2022/APAN | b4dd9a5585f42cccefe01e9525cdc8c59727bdf2 | [
"MIT"
] | null | null | null | map.py | yhf2022/APAN | b4dd9a5585f42cccefe01e9525cdc8c59727bdf2 | [
"MIT"
] | null | null | null | import glob
import json
import os
import shutil
import sys
import argparse
import numpy as np
MINOVERLAP = 0.5
parser = argparse.ArgumentParser()
parser.add_argument('-na', '--no-animation', help="no animation is shown.", action="store_true")
parser.add_argument('-np', '--no-plot', help="no plot is shown.", action="s... | 42.056818 | 142 | 0.518734 |
0e1ada8bf019c0f92d8a38744b0287981e80e9d2 | 25,673 | py | Python | canopy/openapi_asyncio/api_client.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | null | null | null | canopy/openapi_asyncio/api_client.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | 1 | 2022-01-31T10:18:08.000Z | 2022-01-31T10:18:08.000Z | canopy/openapi_asyncio/api_client.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Canopy.Api
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import atexit
import... | 39.496923 | 124 | 0.551708 |
38e61f23be00dda003cf3f6f1e25535dfcd1b312 | 214 | py | Python | journyy.py | Enigmage/Journyy | 866704dd633a681dac021252311bb759c99a7852 | [
"BSD-2-Clause"
] | null | null | null | journyy.py | Enigmage/Journyy | 866704dd633a681dac021252311bb759c99a7852 | [
"BSD-2-Clause"
] | null | null | null | journyy.py | Enigmage/Journyy | 866704dd633a681dac021252311bb759c99a7852 | [
"BSD-2-Clause"
] | null | null | null | from app import app, db
from app.models import User, Content
@app.shell_context_processor
def make_context():
return {'db':db, 'User':User, 'Content':Content}
if __name__=='__main__':
app.run(debug=True)
| 21.4 | 52 | 0.719626 |
7c9f901d83ed5ac5f06ece27308ebec4e638477d | 202 | py | Python | sarimuson/users/tests/test_models.py | jrbenriquez/sarimuson2 | cdaedb130bd7b3ef065e4503228cc1610ae43fda | [
"MIT"
] | null | null | null | sarimuson/users/tests/test_models.py | jrbenriquez/sarimuson2 | cdaedb130bd7b3ef065e4503228cc1610ae43fda | [
"MIT"
] | null | null | null | sarimuson/users/tests/test_models.py | jrbenriquez/sarimuson2 | cdaedb130bd7b3ef065e4503228cc1610ae43fda | [
"MIT"
] | null | null | null | import pytest
from sarimuson.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 20.2 | 64 | 0.772277 |
4f0a7339b4abb1b96d1b9e1b66b733fb4c2bf883 | 1,461 | py | Python | lib/fbuild/builders/c/openmp.py | felix-lang/fbuild | 9595fbfd6d3ceece31fda2f96c35d4a241f0129b | [
"PSF-2.0",
"BSD-2-Clause"
] | 40 | 2015-02-07T00:44:12.000Z | 2021-04-02T13:41:08.000Z | lib/fbuild/builders/c/openmp.py | dmerejkowsky/fbuild | be0bf901eed1f66c33897fbd4b147e0433e8cc72 | [
"BSD-2-Clause"
] | 30 | 2015-02-06T17:45:15.000Z | 2019-01-10T16:34:29.000Z | lib/fbuild/builders/c/openmp.py | dmerejkowsky/fbuild | be0bf901eed1f66c33897fbd4b147e0433e8cc72 | [
"BSD-2-Clause"
] | 3 | 2015-09-03T06:38:02.000Z | 2019-10-24T14:26:57.000Z | import fbuild.db
from fbuild.builders.c import MissingHeader
from fbuild.record import Record
# -----------------------------------------------------------------------------
@fbuild.db.caches
def config_omp_h(ctx, builder):
if not builder.check_header_exists('omp.h'):
raise MissingHeader('omp.h')
cod... | 27.566038 | 79 | 0.506502 |
fe32fc09af33cb47de6aba608b39bed79d584d38 | 7,861 | py | Python | gym_electric_motor/envs/gym_dcm/shunt_dc_motor_env/cont_cc_shunt_dc_env.py | RaviPandey33/gym-electric-motor-1 | 999e18dceed709decf43d646fb29dc7602b9a89c | [
"MIT"
] | null | null | null | gym_electric_motor/envs/gym_dcm/shunt_dc_motor_env/cont_cc_shunt_dc_env.py | RaviPandey33/gym-electric-motor-1 | 999e18dceed709decf43d646fb29dc7602b9a89c | [
"MIT"
] | null | null | null | gym_electric_motor/envs/gym_dcm/shunt_dc_motor_env/cont_cc_shunt_dc_env.py | RaviPandey33/gym-electric-motor-1 | 999e18dceed709decf43d646fb29dc7602b9a89c | [
"MIT"
] | null | null | null | from gym_electric_motor.core import ElectricMotorEnvironment, ReferenceGenerator, RewardFunction, \
ElectricMotorVisualization
from gym_electric_motor.physical_systems.physical_systems import DcMotorSystem
from gym_electric_motor.visualization import MotorDashboard
from gym_electric_motor.reference_generators impor... | 52.406667 | 118 | 0.644702 |
775eeb63c1f9556bdebee00f0ee6f85d2e9683cd | 6,879 | py | Python | doc/source/notebooks/theory/upper_bound.pct.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | doc/source/notebooks/theory/upper_bound.pct.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | doc/source/notebooks/theory/upper_bound.pct.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,.pct.py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
... | 36.396825 | 543 | 0.719291 |
3b4f84b790cc878bd79a907d3f8471ff82a458b0 | 1,582 | py | Python | setup.py | ww19960229/PaddleX | 39294c303eca678d9664187ca188ad6b8a5eccc7 | [
"Apache-2.0"
] | 2 | 2020-09-21T11:57:23.000Z | 2020-09-21T11:57:25.000Z | setup.py | ww19960229/PaddleX | 39294c303eca678d9664187ca188ad6b8a5eccc7 | [
"Apache-2.0"
] | null | null | null | setup.py | ww19960229/PaddleX | 39294c303eca678d9664187ca188ad6b8a5eccc7 | [
"Apache-2.0"
] | null | null | null | # 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 applic... | 36.790698 | 79 | 0.702276 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.