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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a1aa30d3ae4ab2cc760c49678cc9092fba7d4f66 | 2,593 | py | Python | presqt/targets/curate_nd/tests/views/resource/test_resource_collection.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 3 | 2019-01-29T19:45:25.000Z | 2020-12-01T18:24:51.000Z | presqt/targets/curate_nd/tests/views/resource/test_resource_collection.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 419 | 2018-09-13T23:11:15.000Z | 2021-09-22T17:49:00.000Z | presqt/targets/curate_nd/tests/views/resource/test_resource_collection.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 2 | 2020-04-10T08:19:41.000Z | 2021-01-04T15:29:42.000Z | import os
from django.test import SimpleTestCase
from rest_framework.reverse import reverse
from rest_framework.test import APIClient
from unittest import skip
class TestResourceCollection(SimpleTestCase):
"""
Test the 'api_v1/targets/curate_nd/resources' endpoint's GET method.
Testing Curate ND integra... | 40.515625 | 94 | 0.650983 |
22eb7ec04ddb186908f6b340cba141e70d46f969 | 712 | py | Python | dev_6/authapp/forms.py | EvgenDEP1/dev-6 | bf01ece91a0bb0efd6be99661c0cc2c59162b1c6 | [
"Apache-2.0"
] | null | null | null | dev_6/authapp/forms.py | EvgenDEP1/dev-6 | bf01ece91a0bb0efd6be99661c0cc2c59162b1c6 | [
"Apache-2.0"
] | null | null | null | dev_6/authapp/forms.py | EvgenDEP1/dev-6 | bf01ece91a0bb0efd6be99661c0cc2c59162b1c6 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth.models import User
class LoginForm(AuthenticationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for name, item in self.fields.items():
item.widget.attrs['c... | 32.363636 | 74 | 0.639045 |
e7e918ab05d28d9b33aea7fc56f2f3f5d91c1e0c | 35,827 | py | Python | test/test_tag_matcher.py | pi-sjp/behave-parallel | 35e745828f9fd6c796a8980104a277a0028070cb | [
"BSD-2-Clause"
] | 5 | 2019-01-15T18:49:16.000Z | 2020-02-21T20:24:39.000Z | test/test_tag_matcher.py | pi-sjp/behave-parallel | 35e745828f9fd6c796a8980104a277a0028070cb | [
"BSD-2-Clause"
] | 6 | 2019-04-26T19:34:34.000Z | 2020-06-03T21:49:13.000Z | test/test_tag_matcher.py | pi-sjp/behave-parallel | 35e745828f9fd6c796a8980104a277a0028070cb | [
"BSD-2-Clause"
] | 9 | 2019-04-23T19:43:41.000Z | 2020-05-12T09:17:27.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from behave.tag_matcher import *
from mock import Mock
from unittest import TestCase
import warnings
# -- REQUIRES: pytest
# import pytest
class Traits4ActiveTagMatcher(object):
TagMatcher = ActiveTagMatcher
value_provider = {
"foo": "ali... | 49.078082 | 110 | 0.643481 |
fd1783e09806177acb953da3225526f493e20ec4 | 111,659 | py | Python | test/sql/test_types.py | thereisnosun/sqlalchemy | 94aed8b17d21da9a20be4b092f6a60b12f60b761 | [
"MIT"
] | 1 | 2020-12-09T21:56:16.000Z | 2020-12-09T21:56:16.000Z | test/sql/test_types.py | thereisnosun/sqlalchemy | 94aed8b17d21da9a20be4b092f6a60b12f60b761 | [
"MIT"
] | null | null | null | test/sql/test_types.py | thereisnosun/sqlalchemy | 94aed8b17d21da9a20be4b092f6a60b12f60b761 | [
"MIT"
] | 1 | 2020-12-04T14:51:39.000Z | 2020-12-04T14:51:39.000Z | # coding: utf-8
import datetime
import decimal
import importlib
import operator
import os
import sqlalchemy as sa
from sqlalchemy import and_
from sqlalchemy import ARRAY
from sqlalchemy import BigInteger
from sqlalchemy import bindparam
from sqlalchemy import BLOB
from sqlalchemy import BOOLEAN
from sqlalchemy import... | 32.058283 | 79 | 0.569323 |
d4954cce3c233d04d31a4854308e7f241f8f39c6 | 5,993 | py | Python | qa/rpc-tests/prioritise_transaction.py | realcaesar/skicoinBeta | a35cbfda4f70cfa41daa3e80fba95d737ef64449 | [
"MIT"
] | null | null | null | qa/rpc-tests/prioritise_transaction.py | realcaesar/skicoinBeta | a35cbfda4f70cfa41daa3e80fba95d737ef64449 | [
"MIT"
] | null | null | null | qa/rpc-tests/prioritise_transaction.py | realcaesar/skicoinBeta | a35cbfda4f70cfa41daa3e80fba95d737ef64449 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PrioritiseTransaction code
#
from test_framework.test_framework import SkicoinTestFramework
from tes... | 41.618056 | 128 | 0.646755 |
fbf4e74f60f2629eb8be8cca26802045f43e39e8 | 5,648 | py | Python | smartshark/forms.py | benjaminLedel/serverSHARK | 97decc03ba7bde8ad9c5f55d446d21ed5a26709c | [
"Apache-2.0"
] | 1 | 2019-11-09T21:18:05.000Z | 2019-11-09T21:18:05.000Z | smartshark/forms.py | ArtyMandy/serverSHARK | 7d3ce83c2bf310aeea7832dedbdaccd44ae7b1df | [
"Apache-2.0"
] | 34 | 2017-09-28T12:38:15.000Z | 2022-01-21T06:59:01.000Z | smartshark/forms.py | midasdev711/serverSHARK-backend | 989f242c5454aaf913734cdb5779e90408be74cb | [
"Apache-2.0"
] | 8 | 2018-05-23T12:46:45.000Z | 2021-12-04T09:23:48.000Z | from difflib import SequenceMatcher
from django.forms import HiddenInput
from django.shortcuts import get_object_or_404
from form_utils.forms import BetterForm
from server.base import SUBSTITUTIONS
from .datacollection.pluginmanagementinterface import PluginManagementInterface
from .models import Plugin, Argument, Ex... | 45.918699 | 182 | 0.651204 |
803ad3e702c20f4509af84f34ed355d63bfa6362 | 543 | py | Python | E002.py | mariomtzjr/asyncio | 1908107e93393ab6ac9f909bc245f694ab353443 | [
"MIT"
] | null | null | null | E002.py | mariomtzjr/asyncio | 1908107e93393ab6ac9f909bc245f694ab353443 | [
"MIT"
] | null | null | null | E002.py | mariomtzjr/asyncio | 1908107e93393ab6ac9f909bc245f694ab353443 | [
"MIT"
] | null | null | null | # Importamos asyncio
import asyncio
# definimos la función
async def show_seconds():
while True:
for i in range(60):
print(i, 's')
await asyncio.sleep(1)
async def show_minute():
for i in range(1, 10):
await asyncio.sleep(60)
print(i, 'minuto')
loop = asyncio... | 18.724138 | 62 | 0.640884 |
55c85c1ea5be64b7eaee9892897130d22c786d9d | 10,444 | py | Python | tensorflow/bert-tf2/gpu_movie_reviews.py | Phaeton-lang/baselines | 472c248047fbb55b5fa0e620758047b7f0a1d041 | [
"MIT"
] | null | null | null | tensorflow/bert-tf2/gpu_movie_reviews.py | Phaeton-lang/baselines | 472c248047fbb55b5fa0e620758047b7f0a1d041 | [
"MIT"
] | null | null | null | tensorflow/bert-tf2/gpu_movie_reviews.py | Phaeton-lang/baselines | 472c248047fbb55b5fa0e620758047b7f0a1d041 | [
"MIT"
] | null | null | null | import math
import datetime
from tqdm import tqdm
import pandas as pd
import numpy as np
import tensorflow as tf
import bert
from bert import BertModelLayer
from bert.loader import StockBertConfig, map_stock_config_to_params, load_stock_weights
from bert.tokenization.bert_tokenization import FullTokenizer
## Load Da... | 40.48062 | 152 | 0.654538 |
a8aad70072f7f0b12fb0db2bc660917ba7be0b75 | 3,077 | py | Python | mayan/apps/cabinets/urls.py | wan1869/dushuhu | 934dd178e67140cffc6b9203e793fdf8bbc73a54 | [
"Apache-2.0"
] | null | null | null | mayan/apps/cabinets/urls.py | wan1869/dushuhu | 934dd178e67140cffc6b9203e793fdf8bbc73a54 | [
"Apache-2.0"
] | null | null | null | mayan/apps/cabinets/urls.py | wan1869/dushuhu | 934dd178e67140cffc6b9203e793fdf8bbc73a54 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from .api_views import (
APIDocumentCabinetListView, APICabinetDocumentListView,
APICabinetDocumentView, APICabinetListView, APICabinetView
)
from .views import (
DocumentAddToCabinetView, DocumentCabinetListView,
DocumentRemoveFromCabinetView, CabinetChildAddView, Cabi... | 31.080808 | 95 | 0.646409 |
ecb31c956ce5573dd85394d8430de0e2919c03ba | 10,835 | py | Python | hpcc/2020-07-24--competition-evo-arch/gen-comp-exp-phase1.py | amlalejini/Aagos | bb82da3a177fe467a912c9f44f516b445b4eba3b | [
"MIT"
] | null | null | null | hpcc/2020-07-24--competition-evo-arch/gen-comp-exp-phase1.py | amlalejini/Aagos | bb82da3a177fe467a912c9f44f516b445b4eba3b | [
"MIT"
] | null | null | null | hpcc/2020-07-24--competition-evo-arch/gen-comp-exp-phase1.py | amlalejini/Aagos | bb82da3a177fe467a912c9f44f516b445b4eba3b | [
"MIT"
] | null | null | null | '''
Generate slurm job submission script for 2020-05-18 -- environmental change rate experiment.
See 2020-05-18--env-chg-sweep/README.md for more details.
'''
import argparse, os, sys, errno, subprocess, csv
seed_offset = 970000
default_num_replicates = 100
job_time_request = "00:20:00"
job_memory_request = "2G"
job... | 38.151408 | 142 | 0.642547 |
dc8d1deddb26172a724deaf51a0403302554d9f2 | 8,550 | py | Python | tensorflow/python/keras/integration_test.py | rickyzhang82/tensorflow | 397fdb37bc923f1f56d0224617cfd1b1dfd76d99 | [
"Apache-2.0"
] | 3 | 2021-01-19T20:24:09.000Z | 2021-01-19T21:40:05.000Z | tensorflow/python/keras/integration_test.py | rickyzhang82/tensorflow | 397fdb37bc923f1f56d0224617cfd1b1dfd76d99 | [
"Apache-2.0"
] | 1 | 2019-07-27T16:45:02.000Z | 2019-07-27T16:45:02.000Z | tensorflow/python/keras/integration_test.py | rickyzhang82/tensorflow | 397fdb37bc923f1f56d0224617cfd1b1dfd76d99 | [
"Apache-2.0"
] | 2 | 2018-12-20T17:53:37.000Z | 2018-12-27T18:49:13.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.326733 | 80 | 0.665146 |
32a9fe7827bd8b2600e34ec80f2ecda3c3239d45 | 3,008 | py | Python | universal_landmark_detection/model/datasets/hand.py | MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection | 23ec0b921e6c15d040f36650fd862059745edc33 | [
"MIT"
] | 9 | 2021-12-17T06:43:58.000Z | 2022-03-23T13:42:05.000Z | universal_landmark_detection/model/datasets/hand.py | MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection | 23ec0b921e6c15d040f36650fd862059745edc33 | [
"MIT"
] | 3 | 2022-01-01T08:41:29.000Z | 2022-03-29T18:23:40.000Z | universal_landmark_detection/model/datasets/hand.py | MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection | 23ec0b921e6c15d040f36650fd862059745edc33 | [
"MIT"
] | 3 | 2022-01-04T04:21:43.000Z | 2022-02-08T08:59:16.000Z | import os
from PIL import Image
import numpy as np
import pandas as pd
import torch
import torch.utils.data as data
from ..utils import gaussianHeatmap, transformer
class Hand(data.Dataset):
def __init__(self, prefix, phase, transform_params=dict(), sigma=10, num_landmark=19, size=[1000, 1400],use_background_c... | 34.181818 | 138 | 0.591423 |
394b73f1c5425012fe96e683ac6789140f861614 | 6,222 | py | Python | tests/test_users.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | null | null | null | tests/test_users.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | 1 | 2016-02-18T18:55:29.000Z | 2016-02-18T18:55:29.000Z | tests/test_users.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | null | null | null | from urllib import urlencode
import pytest
from tornado.httpclient import HTTPError
from fixtures import fe_app as app
from fixtures import standard_graph, graph, users, groups, session, permissions # noqa
from grouper.constants import USER_ADMIN
from grouper.models.user_token import UserToken
from grouper.user_met... | 39.630573 | 98 | 0.687239 |
cd3465a60f6867e2c73f83b2dc2f84913000174a | 4,800 | py | Python | satori/tests/test_utils.py | mgeisler/satori | dea382bae1cd043189589c0f7d4c20b4b6725ab5 | [
"Apache-2.0"
] | 1 | 2015-01-18T19:56:28.000Z | 2015-01-18T19:56:28.000Z | satori/tests/test_utils.py | samstav/satori | 239fa1e3c7aac78599145c670576f0ac76a41a89 | [
"Apache-2.0"
] | null | null | null | satori/tests/test_utils.py | samstav/satori | 239fa1e3c7aac78599145c670576f0ac76a41a89 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 36.363636 | 78 | 0.634583 |
be08c4d857c93ce32a9059bd93ff1c2e44b33cb2 | 4,664 | py | Python | arknights_mower/ocr/ocrspace.py | yuanyan3060/arknights-mower | 599b96e02590a435dc50bdef450b45c851654c4f | [
"MIT"
] | 1 | 2021-09-11T04:11:15.000Z | 2021-09-11T04:11:15.000Z | arknights_mower/ocr/ocrspace.py | yuanyan3060/arknights-mower | 599b96e02590a435dc50bdef450b45c851654c4f | [
"MIT"
] | null | null | null | arknights_mower/ocr/ocrspace.py | yuanyan3060/arknights-mower | 599b96e02590a435dc50bdef450b45c851654c4f | [
"MIT"
] | null | null | null | import traceback
import cv2
import numpy
import base64
import requests
from .utils import fix
from ..utils.log import logger
from ..utils.recognize import RecognizeError
class Language:
Arabic = 'ara'
Bulgarian = 'bul'
Chinese_Simplified = 'chs'
Chinese_Traditional = 'cht'
Croatian = 'hrv'
Da... | 28.790123 | 86 | 0.504503 |
9c43e57c69a8dde6e1723760c856ba762bdba52f | 138 | py | Python | class2/e1c_test_my_func.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | 2 | 2017-05-11T12:05:15.000Z | 2021-07-15T18:13:19.000Z | class2/e1c_test_my_func.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | null | null | null | class2/e1c_test_my_func.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | 1 | 2017-05-11T12:05:18.000Z | 2017-05-11T12:05:18.000Z | #!/usr/bin/env python
## This script imports my_func function from e1c_my_func.py module
import e1c_my_func
print e1c_my_func.hello_func
| 23 | 66 | 0.818841 |
1c1b133b5ebe6d5e32e17d6537d02dfc87301d52 | 111,932 | py | Python | src/sentry/south_migrations/0308_auto__add_versiondsymfile__add_unique_versiondsymfile_dsym_file_versio.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 2 | 2019-03-04T12:45:54.000Z | 2019-03-04T12:45:55.000Z | src/sentry/south_migrations/0308_auto__add_versiondsymfile__add_unique_versiondsymfile_dsym_file_versio.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | src/sentry/south_migrations/0308_auto__add_versiondsymfile__add_unique_versiondsymfile_dsym_file_versio.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'VersionDSymFile'
db.create_table(
'sentry_vers... | 37.01455 | 100 | 0.405496 |
720fd9ee5cae6400f85316ea774854b4d0d8884b | 436 | py | Python | Backend/events/models.py | afrlv1/TestWorkEvents | d023ce3ecadcead99134e5be536c7610d2b05970 | [
"MIT"
] | null | null | null | Backend/events/models.py | afrlv1/TestWorkEvents | d023ce3ecadcead99134e5be536c7610d2b05970 | [
"MIT"
] | null | null | null | Backend/events/models.py | afrlv1/TestWorkEvents | d023ce3ecadcead99134e5be536c7610d2b05970 | [
"MIT"
] | null | null | null | from django.db import models
class Event(models.Model):
day_event = models.DateField(u'Day of the event', help_text=u'Day of the event')
title = models.CharField(u'Title', max_length=255, help_text=u'Title', blank=True, null=True)
body = models.TextField(u'Textual Event', help_text=u'Textual Event', blank... | 36.333333 | 97 | 0.711009 |
92759cd2bf8ac797b3fa4f368027c9f7ffaaac48 | 1,634 | py | Python | tests/src/SI/MAP/click_on_anydistrict_and_download_csv.py | sreenivas8084/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | null | null | null | tests/src/SI/MAP/click_on_anydistrict_and_download_csv.py | sreenivas8084/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | 2 | 2022-02-01T00:55:12.000Z | 2022-03-29T22:29:09.000Z | tests/src/SI/MAP/click_on_anydistrict_and_download_csv.py | SreenivasNimmagadda/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | null | null | null | import csv
import os
import re
import time
from Data.parameters import Data
from filenames import file_extention
from get_dir import pwd
from reuse_func import GetData
class download_icon():
def __init__(self,driver):
self.driver = driver
def test_donwload(self):
self.p =GetData()
c... | 32.039216 | 115 | 0.589351 |
538d5202942d2613aada1adbaf6f6ebe94a23521 | 197,163 | py | Python | python/mxnet/ndarray/numpy/_op.py | guanxinq/incubator-mxnet | 634f95e2431ec107f0e5182a60db27e3a7dd9545 | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/numpy/_op.py | guanxinq/incubator-mxnet | 634f95e2431ec107f0e5182a60db27e3a7dd9545 | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/numpy/_op.py | guanxinq/incubator-mxnet | 634f95e2431ec107f0e5182a60db27e3a7dd9545 | [
"Apache-2.0"
] | 1 | 2019-02-26T19:25:11.000Z | 2019-02-26T19:25:11.000Z | # pylint: disable=C0302
# 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
# "... | 33.60542 | 132 | 0.60842 |
9c42b290a3ac94594cd5da54fc0574651f40662f | 1,265 | py | Python | discoreg/registrations/views/webhook.py | PyGotham/discoreg | 43bffe1febdf326cbc71f549e1609bcb46258041 | [
"Apache-2.0"
] | null | null | null | discoreg/registrations/views/webhook.py | PyGotham/discoreg | 43bffe1febdf326cbc71f549e1609bcb46258041 | [
"Apache-2.0"
] | null | null | null | discoreg/registrations/views/webhook.py | PyGotham/discoreg | 43bffe1febdf326cbc71f549e1609bcb46258041 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from ..models import DiscordRole, EmailRole, Registration
logger = logging.getLogger(__name__)
REGIST... | 30.119048 | 88 | 0.762055 |
d61b3c7be5973a8b9535904f17cfe785a7cf955d | 3,142 | py | Python | setup.py | fakegit/python-pinyin | a421a83127ee55cba09ecabbf63d0c1bfb3a3aea | [
"MIT"
] | 1 | 2021-12-07T05:58:32.000Z | 2021-12-07T05:58:32.000Z | setup.py | yaffils/python-pinyin | a421a83127ee55cba09ecabbf63d0c1bfb3a3aea | [
"MIT"
] | null | null | null | setup.py | yaffils/python-pinyin | a421a83127ee55cba09ecabbf63d0c1bfb3a3aea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from codecs import open
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
current_dir = os.path.dirname(os.path.realpath(__file__))
packages = [
'pypinyin',
'pypinyin.contrib',
'pypin... | 30.504854 | 71 | 0.612031 |
82d5725797e20c223df0582ad44ccf350b29f7ec | 1,244 | py | Python | lab12/createIndices.py | xehoth/CS110P | 120cc8a4ffc97ae75ddeb8b28708641be1672af3 | [
"MIT"
] | null | null | null | lab12/createIndices.py | xehoth/CS110P | 120cc8a4ffc97ae75ddeb8b28708641be1672af3 | [
"MIT"
] | null | null | null | lab12/createIndices.py | xehoth/CS110P | 120cc8a4ffc97ae75ddeb8b28708641be1672af3 | [
"MIT"
] | null | null | null | import sys
import re
from pyspark import SparkContext,SparkConf
def flatMapFunc(document):
"""
document[0] is the document ID (distinct for each document)
document[1] is a string of all text in that document
You will need to modify this code.
"""
documentID = document[0]
words = re.findal... | 26.468085 | 117 | 0.614952 |
606aaa2ff87b1a4b9cd6f99cde611ed630c470cc | 4,029 | py | Python | alipay/aop/api/request/AlipayInsSceneApplicationQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayInsSceneApplicationQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayInsSceneApplicationQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayInsSceneApplicationQueryModel import AlipayInsSceneApplicationQueryModel
class AlipayInsSceneApplicationQueryReq... | 27.786207 | 166 | 0.647803 |
f6447d99dd5bb61c645da6197780d8ee59bef3bb | 891 | py | Python | bare_locks/pywin32/win32file.py | psarka/bare-locks | 6c04d8209621585f6581170f12534f8c24fa604e | [
"MIT"
] | null | null | null | bare_locks/pywin32/win32file.py | psarka/bare-locks | 6c04d8209621585f6581170f12534f8c24fa604e | [
"MIT"
] | null | null | null | bare_locks/pywin32/win32file.py | psarka/bare-locks | 6c04d8209621585f6581170f12534f8c24fa604e | [
"MIT"
] | null | null | null | from ctypes import POINTER
from ctypes import pointer
from ctypes import WinDLL
from ctypes.wintypes import BOOL
from ctypes.wintypes import DWORD
from ctypes.wintypes import HANDLE
from bare_locks.pywin32.pywintypes import OVERLAPPED
kernel32 = WinDLL('kernel32', use_last_error=True)
_ = pointer
# Refer: https://do... | 22.275 | 89 | 0.763187 |
b6e4170872dc33f549152d2f62bab2cd1878ca00 | 6,067 | py | Python | tests/test.py | TakashiAihara/docker-selenium-arm64 | 467e189edd40eeaf31320a981fe2f24d28b1e786 | [
"RSA-MD",
"Apache-1.1"
] | null | null | null | tests/test.py | TakashiAihara/docker-selenium-arm64 | 467e189edd40eeaf31320a981fe2f24d28b1e786 | [
"RSA-MD",
"Apache-1.1"
] | null | null | null | tests/test.py | TakashiAihara/docker-selenium-arm64 | 467e189edd40eeaf31320a981fe2f24d28b1e786 | [
"RSA-MD",
"Apache-1.1"
] | null | null | null | import os
import docker
import unittest
import logging
import sys
import random
from docker.errors import NotFound
# LOGGING #
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logger = logging.getLogger(__name__)
# Docker Client
client = docker.from_env()
NAMESP... | 30.034653 | 127 | 0.623702 |
45bedfbf3d37c6c45e8e12cb72e9678ba10a9596 | 17,393 | py | Python | tests/providers/gcp/google_kubernetes_engine_test.py | jovial/PerfKitBenchmarker | ec0b44f3462cedf7e15e4d67263659afaa136162 | [
"Apache-2.0"
] | null | null | null | tests/providers/gcp/google_kubernetes_engine_test.py | jovial/PerfKitBenchmarker | ec0b44f3462cedf7e15e4d67263659afaa136162 | [
"Apache-2.0"
] | null | null | null | tests/providers/gcp/google_kubernetes_engine_test.py | jovial/PerfKitBenchmarker | ec0b44f3462cedf7e15e4d67263659afaa136162 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 PerfKitBenchmarker 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... | 38.737194 | 186 | 0.685793 |
ba77555db065a93329bd62fc627f3d25112a835d | 490 | py | Python | src/helper.py | ypinzon/ClinicalTrialsWGETL | 4edd6b6868915ab8e3408f6e8f6e625dd3003d40 | [
"Apache-2.0"
] | null | null | null | src/helper.py | ypinzon/ClinicalTrialsWGETL | 4edd6b6868915ab8e3408f6e8f6e625dd3003d40 | [
"Apache-2.0"
] | null | null | null | src/helper.py | ypinzon/ClinicalTrialsWGETL | 4edd6b6868915ab8e3408f6e8f6e625dd3003d40 | [
"Apache-2.0"
] | null | null | null | import os
def get_fnames(path):
list_of_fnames = []
for dirname, dirs, files in os.walk(path, topdown=True):
for fname in files:
if fname.endswith('.csv'):
list_of_fnames.append((os.path.join(dirname, fname), fname))
return list_of_fnames
def run_script(spark, scriptn... | 25.789474 | 76 | 0.618367 |
fdd78c5e43ef9789ae9bb05559ab277223f084d2 | 278 | py | Python | autodriver/src/autodriver/serialcomm/params.py | rel1c/robocar | 6e83391b84873781c839cfc57a9fc1a49f641dbb | [
"MIT"
] | null | null | null | autodriver/src/autodriver/serialcomm/params.py | rel1c/robocar | 6e83391b84873781c839cfc57a9fc1a49f641dbb | [
"MIT"
] | null | null | null | autodriver/src/autodriver/serialcomm/params.py | rel1c/robocar | 6e83391b84873781c839cfc57a9fc1a49f641dbb | [
"MIT"
] | null | null | null | # File: params.py
# Desc: A collection of predefined constants governing control for the car.
# Copyright (c) 2020 Adam Peterson
SERIAL_PATH = '/dev/ttyACM0'
BAUD_RATE = 9600
STEERING_MID = 90
STEERING_MIN = 65
STEERING_MAX = 115
MOTOR_MAX = 255
MOTOR_MIN = 25
DEBUG = True
| 17.375 | 75 | 0.748201 |
be08191ae114ecdab075b2e379585375feb12a6c | 18,822 | py | Python | buildscripts/tests/resmokelib/powercycle/test_remote_operations.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | buildscripts/tests/resmokelib/powercycle/test_remote_operations.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | buildscripts/tests/resmokelib/powercycle/test_remote_operations.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Unit test for buildscripts/remote_operations.py.
Note - Tests require sshd to be enabled on localhost with paswordless login
and can fail otherwise."""
import os
import shutil
import tempfile
import time
import unittest
from buildscripts.resmokelib.powercycle.lib import remote_operati... | 43.070938 | 99 | 0.660769 |
8fca4f48c08246213c34d8d4508c87622d4ff97d | 665 | py | Python | manage.py | bitbloxhub/shorttalk | 5adb79ddda2d32077e5a5b666df2f084aa883c2c | [
"0BSD"
] | null | null | null | manage.py | bitbloxhub/shorttalk | 5adb79ddda2d32077e5a5b666df2f084aa883c2c | [
"0BSD"
] | null | null | null | manage.py | bitbloxhub/shorttalk | 5adb79ddda2d32077e5a5b666df2f084aa883c2c | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shorttalk.settings')
try:
from django.core.management import execute_from_command_line
except Im... | 28.913043 | 73 | 0.679699 |
e880f2c3ae1ab86c40ae7211041248107061808e | 13,308 | py | Python | cassiopeia/core/common.py | mikaeldui/cassiopeia | fb22e0dd2c71ae5e14c046379e49c8a44215e79d | [
"MIT"
] | null | null | null | cassiopeia/core/common.py | mikaeldui/cassiopeia | fb22e0dd2c71ae5e14c046379e49c8a44215e79d | [
"MIT"
] | null | null | null | cassiopeia/core/common.py | mikaeldui/cassiopeia | fb22e0dd2c71ae5e14c046379e49c8a44215e79d | [
"MIT"
] | null | null | null | from abc import abstractmethod, abstractclassmethod
import types
from typing import Mapping, Set, Union, Optional, Type, Generator
import functools
import logging
from enum import Enum
import arrow
import datetime
import inspect
from merakicommons.ghost import Ghost, ghost_load_on as _ghost_load_on
from merakicommons.... | 36.163043 | 144 | 0.592876 |
06be20eddfdbb8f127ad0de90c3d9e742d293f5a | 2,275 | py | Python | extensions/music.py | ggoncalopereira/JBB.py | e66419466cc6d35e134cceb8c8ad48102556658b | [
"MIT"
] | null | null | null | extensions/music.py | ggoncalopereira/JBB.py | e66419466cc6d35e134cceb8c8ad48102556658b | [
"MIT"
] | null | null | null | extensions/music.py | ggoncalopereira/JBB.py | e66419466cc6d35e134cceb8c8ad48102556658b | [
"MIT"
] | 1 | 2020-12-10T23:08:52.000Z | 2020-12-10T23:08:52.000Z | import discord
from discord.ext import commands
import json
import subprocess
class Music(commands.Cog):
"""Play all great classics"""
def __init__(self, bot):
self.bot = bot
@commands.command(name='play',
description="play a given music",
brief="play a ... | 39.224138 | 119 | 0.565714 |
e983c856f1a3e6159aed10233248b08b33f282c9 | 3,678 | py | Python | moveit_planners/pilz_industrial_motion_planner/test/unit_tests/launch/common_parameters.py | corycrean/moveit2 | 86a24a494264045883119c41a02188735f025f40 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T17:09:31.000Z | 2021-12-15T17:09:31.000Z | moveit_planners/pilz_industrial_motion_planner/test/unit_tests/launch/common_parameters.py | corycrean/moveit2 | 86a24a494264045883119c41a02188735f025f40 | [
"BSD-3-Clause"
] | 2 | 2021-08-24T15:45:42.000Z | 2021-09-21T15:29:18.000Z | moveit_planners/pilz_industrial_motion_planner/test/unit_tests/launch/common_parameters.py | corycrean/moveit2 | 86a24a494264045883119c41a02188735f025f40 | [
"BSD-3-Clause"
] | null | null | null | from ament_index_python.packages import get_package_share_directory
import xacro
import yaml
import os
# TODO(henningkayser): Switch to ParameterBuilder once #591 is merged
# from moveit_configs_utils import MoveItConfigsBuilder
# from parameter_builder import ParameterBuilder
def _load_file(package_name, file_path)... | 33.436364 | 93 | 0.71615 |
a44467d56fed39f2693f5f9bc4859eada0839769 | 179 | py | Python | python_data_utils/spark/ml/__init__.py | surajiyer/python-data-utils | d6e9bf81204a01545a3edb165c5724eb24f37c18 | [
"MIT"
] | 4 | 2019-01-06T00:09:21.000Z | 2022-01-28T06:03:13.000Z | python_data_utils/spark/ml/__init__.py | surajiyer/python-data-utils | d6e9bf81204a01545a3edb165c5724eb24f37c18 | [
"MIT"
] | null | null | null | python_data_utils/spark/ml/__init__.py | surajiyer/python-data-utils | d6e9bf81204a01545a3edb165c5724eb24f37c18 | [
"MIT"
] | null | null | null | from .base import (
BaseCVModel,
BinaryClassCVModel,
RegressionCVModel
)
from .randomforest import RandomForestBinaryModel
from .lightgbm import LightGBMRegressorModel | 25.571429 | 49 | 0.810056 |
4a6a9225598aba55db4d996e3e02ff7d085cfe9d | 460 | py | Python | test/test_files.py | USGS-EROS/lcmap-merlin | 692568e7e8e0bbb236e6e801b90abde8be8a05ea | [
"Unlicense"
] | null | null | null | test/test_files.py | USGS-EROS/lcmap-merlin | 692568e7e8e0bbb236e6e801b90abde8be8a05ea | [
"Unlicense"
] | null | null | null | test/test_files.py | USGS-EROS/lcmap-merlin | 692568e7e8e0bbb236e6e801b90abde8be8a05ea | [
"Unlicense"
] | 3 | 2018-05-08T14:51:56.000Z | 2018-07-12T19:07:34.000Z | """ Functions for working with files in python """
from merlin import files
def test_read():
assert 1 > 0
def test_readb():
assert 1 > 0
def test_readlines():
assert 1 > 0
def test_readlinesb():
assert 1 > 0
def test_write():
assert 1 > 0
def test_writeb():
assert 1 > 0
def test_ap... | 10.697674 | 50 | 0.61087 |
59350eb7609b0c43250cb8cfdc0232cd4451af13 | 21,529 | py | Python | pygr/blast.py | ctb/pygr | a3a3e68073834c20ddbdb27ed746baf8c73fef0a | [
"BSD-3-Clause"
] | 2 | 2015-03-07T13:20:50.000Z | 2015-11-04T12:01:21.000Z | pygr/blast.py | ctb/pygr | a3a3e68073834c20ddbdb27ed746baf8c73fef0a | [
"BSD-3-Clause"
] | null | null | null | pygr/blast.py | ctb/pygr | a3a3e68073834c20ddbdb27ed746baf8c73fef0a | [
"BSD-3-Clause"
] | null | null | null | import os, tempfile, glob
import classutil, logger
from sequtil import *
from parse_blast import BlastHitParser
from seqdb import write_fasta, read_fasta
from nlmsa_utils import CoordsGroupStart, CoordsGroupEnd, CoordsToIntervals,\
EmptySlice
from annotation import AnnotationDB, TranslationAnnot, TranslationAnnotS... | 43.230924 | 82 | 0.623949 |
4f0de58c40a4b91b6f6013a638fbd03ccbc84774 | 1,500 | py | Python | tests/notebook_test_case.py | tanjie123/hello-ltr | fe1ad1989e1bb17dfc8d1c09931480becf59766e | [
"Apache-2.0"
] | 109 | 2019-04-18T01:24:29.000Z | 2022-03-12T17:37:30.000Z | tests/notebook_test_case.py | tanjie123/hello-ltr | fe1ad1989e1bb17dfc8d1c09931480becf59766e | [
"Apache-2.0"
] | 63 | 2019-04-14T01:01:24.000Z | 2022-03-03T20:48:41.000Z | tests/notebook_test_case.py | tanjie123/hello-ltr | fe1ad1989e1bb17dfc8d1c09931480becf59766e | [
"Apache-2.0"
] | 41 | 2019-04-22T15:22:41.000Z | 2022-02-26T00:03:02.000Z | import unittest
from nb_test_config import NotebookTestConfig
import runner
class NotebooksTestCase(unittest.TestCase):
SAVE_NB_PATH='tests/last_run.ipynb'
def test_paths(self):
return []
def ignored_nbs(self):
return []
def nbs_to_run(self):
class IncludeAll:
de... | 32.608696 | 107 | 0.546 |
8613fb0bc33f835f10a0a0a27c6012db681f7213 | 13,992 | py | Python | suncasa/eovsa/eovsa_pltQlookMovie.py | wyq24/suncasa | e6ed6d8b9bd2186c4af6d0354d03af5fff9aef7a | [
"BSD-2-Clause"
] | 7 | 2019-05-21T22:24:07.000Z | 2021-02-25T20:20:24.000Z | suncasa/eovsa/eovsa_pltQlookMovie.py | wulinhui1/suncasa-src | 1f94aaabaf6a3911fa532648ec6676a221553436 | [
"BSD-2-Clause"
] | 26 | 2016-11-09T17:11:45.000Z | 2021-08-20T13:41:50.000Z | suncasa/eovsa/eovsa_pltQlookMovie.py | wulinhui1/suncasa-src | 1f94aaabaf6a3911fa532648ec6676a221553436 | [
"BSD-2-Clause"
] | 17 | 2016-10-27T18:35:46.000Z | 2021-08-03T05:33:57.000Z | import os
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from sunpy import map as smap
import sunpy.cm.cm as cm_smap
import astropy.units as u
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.colorbar as colorbar
import matplotlib.patches as patches
from datetime import time... | 39.637394 | 135 | 0.555818 |
01be757a4344251fc381361c794559ad62bf2173 | 905 | py | Python | Processor/EQ/spectrogram.py | yuzhouhe2000/video-conference-enhancer | 46aa130c0b7f02db5055c8d15877c8287c2276c7 | [
"Apache-2.0"
] | 3 | 2021-07-15T12:02:25.000Z | 2022-02-17T09:15:49.000Z | Processor/EQ/spectrogram.py | yuzhouhe2000/video-conference-enhancer | 46aa130c0b7f02db5055c8d15877c8287c2276c7 | [
"Apache-2.0"
] | 1 | 2021-08-28T09:58:35.000Z | 2021-09-04T15:07:17.000Z | Processor/EQ/spectrogram.py | yuzhouhe2000/video-conference-enhancer | 46aa130c0b7f02db5055c8d15877c8287c2276c7 | [
"Apache-2.0"
] | 2 | 2021-08-28T09:48:10.000Z | 2021-09-22T06:51:23.000Z | import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
from scipy.io import wavfile
from pydub import AudioSegment
#ASSUME THERE IS ALREADY A FILE IN MONO FORMAT NAMED test_mono.wav
yMax = (int)(input("Enter maximum frequency value to visualize: "))
sample_rate, samples = wavfile.read('Testing_F... | 31.206897 | 74 | 0.779006 |
228486a2b0a33131f0408dee5594b7794c427153 | 16,589 | py | Python | framework/Samplers/Stratified.py | mattdon/raven | b5b4a9fc96cec37ca5fb3757c45653eec66522f1 | [
"Apache-2.0"
] | null | null | null | framework/Samplers/Stratified.py | mattdon/raven | b5b4a9fc96cec37ca5fb3757c45653eec66522f1 | [
"Apache-2.0"
] | null | null | null | framework/Samplers/Stratified.py | mattdon/raven | b5b4a9fc96cec37ca5fb3757c45653eec66522f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... | 61.440741 | 250 | 0.681717 |
15cbcfe3f4ba3ac800ce569905caf7f61c2dd8ee | 756 | py | Python | docs/examples/compute/oneandone/create_load_balancer.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | null | null | null | docs/examples/compute/oneandone/create_load_balancer.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T12:29:13.000Z | 2021-12-06T12:29:13.000Z | docs/examples/compute/oneandone/create_load_balancer.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2019-08-05T10:12:02.000Z | 2019-08-05T10:12:02.000Z | import os
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.ONEANDONE)
drv = cls(key=os.environ.get("ONEANDONE_TOKEN"))
rules = [
{"protocol": "TCP", "port_balancer": 80, "port_server": 80, "source": "0.0.0.0"},
{
"protocol": "TCP"... | 22.909091 | 85 | 0.628307 |
632d04049aa1751a38a2fd403067443d750971fe | 1,249 | py | Python | test.py | ranok92/deepirl | 88c7e76986243cf0b988d8d7dc0eef6b58e07864 | [
"MIT"
] | 2 | 2019-01-04T22:03:15.000Z | 2019-04-03T00:16:11.000Z | test.py | ranok92/deepirl | 88c7e76986243cf0b988d8d7dc0eef6b58e07864 | [
"MIT"
] | null | null | null | test.py | ranok92/deepirl | 88c7e76986243cf0b988d8d7dc0eef6b58e07864 | [
"MIT"
] | null | null | null | from debugtools import getperStateReward
from irlmethods.deep_maxent import RewardNet
import utils
from utils import to_oh
import itertools
import pdb
from envs.gridworld_clockless import GridWorldClockless as GridWorld
import numpy as np
import torch
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu... | 24.98 | 73 | 0.719776 |
fd9d1e5710d38b28a4f94fe0e37a3b89736291ba | 31,932 | py | Python | ifermi/surface.py | whzhangg/IFermi | 511c69acd1e5ac849f073d435210a25a603d5bcb | [
"MIT"
] | 32 | 2021-03-02T14:51:46.000Z | 2022-03-18T18:56:48.000Z | ifermi/surface.py | skphy/IFermi | 41a7a942e30723dcbe0e7eb2d51cc9ff5921d3ee | [
"MIT"
] | 24 | 2021-03-04T00:09:06.000Z | 2022-03-29T09:59:38.000Z | ifermi/surface.py | skphy/IFermi | 41a7a942e30723dcbe0e7eb2d51cc9ff5921d3ee | [
"MIT"
] | 17 | 2021-03-06T08:55:59.000Z | 2022-02-03T15:15:58.000Z | """Tools to generate isosurfaces and Fermi surfaces."""
import warnings
from copy import deepcopy
from dataclasses import dataclass
from typing import Collection, Dict, List, Optional, Tuple, Union
import numpy as np
from monty.dev import requires
from monty.json import MSONable, jsanitize
from pymatgen.core.structur... | 37.26021 | 95 | 0.634755 |
277d998d5b5f38401334468053b0215094f5f89a | 18,857 | py | Python | oauth2app/migrations/0001_initial.py | mliu7/django-oauth2app | 4daa587fa43b9fd1480180b827973e1bb7081adf | [
"MIT"
] | null | null | null | oauth2app/migrations/0001_initial.py | mliu7/django-oauth2app | 4daa587fa43b9fd1480180b827973e1bb7081adf | [
"MIT"
] | null | null | null | oauth2app/migrations/0001_initial.py | mliu7/django-oauth2app | 4daa587fa43b9fd1480180b827973e1bb7081adf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Client'
db.create_table('oauth2app_client', (
('id', self.gf('django.db.models.f... | 78.570833 | 191 | 0.609641 |
c1ef13eb122d46411ee941ae1aeb9ba2d31dcb43 | 1,862 | py | Python | indy_client/test/scripts/test_reset_client.py | sergeykupryushin/indy-node | 3162c5750e99af3512218d5843ba065c7d0f07db | [
"Apache-2.0"
] | 1 | 2018-07-05T19:34:29.000Z | 2018-07-05T19:34:29.000Z | indy_client/test/scripts/test_reset_client.py | sergeykupryushin/indy-node | 3162c5750e99af3512218d5843ba065c7d0f07db | [
"Apache-2.0"
] | null | null | null | indy_client/test/scripts/test_reset_client.py | sergeykupryushin/indy-node | 3162c5750e99af3512218d5843ba065c7d0f07db | [
"Apache-2.0"
] | 1 | 2021-06-06T15:48:30.000Z | 2021-06-06T15:48:30.000Z | import os
from plenum.common.util import randomString
from indy_client.script_helper import performIndyBaseDirCleanup, \
keepFilesInClientReset
from indy_client.test.cli.conftest import aliceCLI, CliBuilder, cliTempLogger
def createRandomDirsAndFiles(baseDir):
dirsCreated = []
filesCreated = []
def ... | 31.033333 | 83 | 0.669173 |
aec1315448224cf27c9887db6eb3fb57d0c08448 | 492 | py | Python | tests/cpp/backends/llvm/cpu_aot.py | weiyunfei/taichi | 52a7cd8325672bc160e5540e54064c960c78256d | [
"MIT"
] | 1 | 2020-11-10T07:17:01.000Z | 2020-11-10T07:17:01.000Z | tests/cpp/backends/llvm/cpu_aot.py | weiyunfei/taichi | 52a7cd8325672bc160e5540e54064c960c78256d | [
"MIT"
] | null | null | null | tests/cpp/backends/llvm/cpu_aot.py | weiyunfei/taichi | 52a7cd8325672bc160e5540e54064c960c78256d | [
"MIT"
] | null | null | null | import os
import taichi as ti
def compile_aot():
ti.init(arch=ti.x64)
@ti.kernel
def run(base: int, arr: ti.types.ndarray()):
for i in arr:
arr[i] = base + i
arr = ti.ndarray(int, shape=16)
run(42, arr)
assert "TAICHI_AOT_FOLDER_PATH" in os.environ.keys()
dir_name =... | 18.923077 | 56 | 0.617886 |
879ba0445d40151145886fdb6a71ee0acd014b41 | 2,202 | py | Python | tests/test_style.py | Acribbs/trnamapper | db35e2eeec856d5e8f8a33d6fcb437c69f926ee6 | [
"MIT"
] | 1 | 2020-10-15T05:54:49.000Z | 2020-10-15T05:54:49.000Z | tests/test_style.py | Acribbs/trnamapper | db35e2eeec856d5e8f8a33d6fcb437c69f926ee6 | [
"MIT"
] | 16 | 2019-06-07T09:28:55.000Z | 2020-03-16T08:17:44.000Z | tests/test_style.py | Acribbs/trnamapper | db35e2eeec856d5e8f8a33d6fcb437c69f926ee6 | [
"MIT"
] | 2 | 2019-06-07T09:21:33.000Z | 2021-02-18T14:50:55.000Z | '''test_style - test coding style of CGAT code
==============================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
This script runs pep8 on all code in this repository.
This script is best run within nosetests::
nosetests tests/test_style.py
'''
imp... | 26.53012 | 75 | 0.549955 |
339ef444b83e8cf51330d13a853096c682ff319c | 534,731 | py | Python | AppKit/_metadata.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | AppKit/_metadata.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | AppKit/_metadata.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # This file is generated by objective.metadata
#
# Last update: Sun Dec 3 10:52:51 2017
import objc, sys
if sys.maxsize > 2 ** 32:
def sel32or64(a, b): return b
else:
def sel32or64(a, b): return a
if sys.byteorder == 'little':
def littleOrBig(a, b): return a
else:
def littleOrBig(a, b): return b
mis... | 162.236347 | 52,520 | 0.67534 |
be6c2ea60ae296724425cc76b9dd32e523369860 | 5,257 | py | Python | pynautobot/core/api.py | Thetacz/pynautobot | 4e1033eb952d7eb3fbc699be8e103f594a174cd7 | [
"Apache-2.0"
] | 10 | 2021-02-24T23:52:09.000Z | 2022-03-03T18:28:39.000Z | pynautobot/core/api.py | Thetacz/pynautobot | 4e1033eb952d7eb3fbc699be8e103f594a174cd7 | [
"Apache-2.0"
] | 23 | 2021-03-01T17:33:23.000Z | 2022-03-22T14:02:39.000Z | pynautobot/core/api.py | Thetacz/pynautobot | 4e1033eb952d7eb3fbc699be8e103f594a174cd7 | [
"Apache-2.0"
] | 9 | 2021-02-25T04:36:44.000Z | 2021-11-30T01:29:02.000Z | """
(c) 2017 DigitalOcean
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribut... | 33.062893 | 108 | 0.584364 |
27a154c840a3b2a7d4b50b3cff11e2433d4637f4 | 2,832 | py | Python | handler.py | stijm/j2lsnek | b7a2779bd812ef9c7477e44058b2d033e04d7b1b | [
"MIT"
] | null | null | null | handler.py | stijm/j2lsnek | b7a2779bd812ef9c7477e44058b2d033e04d7b1b | [
"MIT"
] | null | null | null | handler.py | stijm/j2lsnek | b7a2779bd812ef9c7477e44058b2d033e04d7b1b | [
"MIT"
] | null | null | null | import abc
import enum
import time
from jj2.protocol import TCP
from jj2.snek import config
from jj2.snek.utils import query
class Port(enum.IntEnum):
BINARY_LIST = 10053
SERVER_NET = 10056
REMOTE_ADMIN = SSL = 10059
class PortHandler(metaclass=abc.ABCMeta):
"""
Generic data handler: receives d... | 27.764706 | 115 | 0.61476 |
7fb849ca980c614ef0d0f6cd6cd0562dbb79ae66 | 12,350 | py | Python | defender/lib/cli.py | dfrtz/project-defender | 18635da511af03b5adb7f2cf6332be6127ed10f9 | [
"Apache-2.0"
] | null | null | null | defender/lib/cli.py | dfrtz/project-defender | 18635da511af03b5adb7f2cf6332be6127ed10f9 | [
"Apache-2.0"
] | null | null | null | defender/lib/cli.py | dfrtz/project-defender | 18635da511af03b5adb7f2cf6332be6127ed10f9 | [
"Apache-2.0"
] | null | null | null | """Shell access for primary application."""
import argparse
import getpass
from defender.lib import shells
from defender.lib.secure import AuthTable
class HostShell(shells.BaseShell):
"""An interactive shell class to control frontend and backend services for primary application.
All parser comm... | 41.722973 | 138 | 0.608016 |
32c46635de967ea39a6fba3227e432b344d6b152 | 917 | py | Python | tests/protein/test_protein_sequence.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | tests/protein/test_protein_sequence.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | tests/protein/test_protein_sequence.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
import pandas as pd
import atom3d.datasets as da
import atom3d.protein.sequence as seq
def test_find_similar():
# TODO: write test for seq.find_similar()
pass
@pytest.mark.network
def test_get_pdb_clusters_and_find_cluster_members():
id_level = 0.3
clusterings = seq.... | 26.970588 | 62 | 0.720829 |
7106bc05fa353999350ac1bb50f295fae3965fb9 | 7,699 | py | Python | pyfiscal/generate.py | erickcasita/pyfiscal | a1c1a95027fe28401006f13643e49a7a9ee6087f | [
"MIT"
] | 3 | 2020-03-23T18:45:42.000Z | 2020-03-23T22:19:39.000Z | pyfiscal/generate.py | erickcasita/pyfiscal | a1c1a95027fe28401006f13643e49a7a9ee6087f | [
"MIT"
] | null | null | null | pyfiscal/generate.py | erickcasita/pyfiscal | a1c1a95027fe28401006f13643e49a7a9ee6087f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unicodedata
from .base import BaseGenerator
class GenerateRFC(BaseGenerator):
key_value = 'rfc'
DATA_REQUIRED = ('complete_name', 'last_name', 'mother_last_name', 'birth_date')
partial_data = None
def __init__(self, **kwargs):
self.complete_name = kwargs.get('complete_name')
se... | 28.409594 | 104 | 0.627484 |
5a07165701a0df64f817dd17e723898a14a560cf | 930 | py | Python | days/01-03-datetimes/code/pomidor_timer.py | VladimirLind/100daysofcode-with-python-course | fb33fe552a38ea7f23cffe82a4d7184786661ee5 | [
"MIT"
] | null | null | null | days/01-03-datetimes/code/pomidor_timer.py | VladimirLind/100daysofcode-with-python-course | fb33fe552a38ea7f23cffe82a4d7184786661ee5 | [
"MIT"
] | null | null | null | days/01-03-datetimes/code/pomidor_timer.py | VladimirLind/100daysofcode-with-python-course | fb33fe552a38ea7f23cffe82a4d7184786661ee5 | [
"MIT"
] | null | null | null | import click
import datetime
@click.command()
@click.option('--work', prompt="Time to work", type=float, help='Time to work in minutes')
@click.option('--relax', prompt="Time to relax", type=float, help='Time to relax in minutes')
@click.option('--cycle', prompt="Number of cycles", type=int, help='Number of iterations... | 31 | 104 | 0.617204 |
5532c6eedbf459f78c3b068113d8522f1fb43074 | 3,491 | py | Python | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/keystone_update_identity_provider_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/keystone_update_identity_provider_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/keystone_update_identity_provider_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class KeystoneUpdateIdentityProviderRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
... | 25.859259 | 88 | 0.561444 |
c8160f2e3786e7111c1b41931d9b1ca6ec566c3d | 705 | py | Python | aim/ext/exception_resistant.py | rubenaprikyan/aim | 039ccb29ec7d14ebc384d671d8a96c54fb4d15e4 | [
"Apache-2.0"
] | null | null | null | aim/ext/exception_resistant.py | rubenaprikyan/aim | 039ccb29ec7d14ebc384d671d8a96c54fb4d15e4 | [
"Apache-2.0"
] | null | null | null | aim/ext/exception_resistant.py | rubenaprikyan/aim | 039ccb29ec7d14ebc384d671d8a96c54fb4d15e4 | [
"Apache-2.0"
] | null | null | null | from functools import wraps
def exception_resistant(func):
num_fails = 0
max_fails = 6
@wraps(func)
def wrapper(*args, **kwargs):
nonlocal num_fails
func_name = func.__name__
try:
return func(*args, **kwargs)
except Exception as e:
num_fails += ... | 30.652174 | 110 | 0.560284 |
f423102f402dab38586c476ce77af24a0c85ea71 | 527 | py | Python | env/Lib/site-packages/pangocffi/convert.py | kodelaben/manimce | fef4f1bd748d1cc8c1ade73e7561d4235dc253ca | [
"MIT"
] | 1 | 2021-06-01T19:10:23.000Z | 2021-06-01T19:10:23.000Z | env/Lib/site-packages/pangocffi/convert.py | kodelaben/manimce | fef4f1bd748d1cc8c1ade73e7561d4235dc253ca | [
"MIT"
] | null | null | null | env/Lib/site-packages/pangocffi/convert.py | kodelaben/manimce | fef4f1bd748d1cc8c1ade73e7561d4235dc253ca | [
"MIT"
] | null | null | null | from . import pango
def units_to_double(i: int) -> float:
"""
Converts a number in Pango units to floating-point: divides it by
``PANGO_SCALE``.
:param i:
value in Pango units
"""
return pango.pango_units_to_double(i)
def units_from_double(d: float) -> int:
"""
Converts a fl... | 21.958333 | 69 | 0.656546 |
064b43b70108974cbbed095677493e3f107933f1 | 6,063 | py | Python | Lib/test/test_unicode_file.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | 1 | 2020-10-25T16:33:22.000Z | 2020-10-25T16:33:22.000Z | Lib/test/test_unicode_file.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | Lib/test/test_unicode_file.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | # Test some Unicode file name semantics
# We don't test many operations on files other than
# that their names can be used with Unicode characters.
import os, glob, time, shutil
import sys
import unicodedata
import unittest
from test.support import run_unittest
from test.support.os_helper import (rmtree, chan... | 42.104167 | 93 | 0.640442 |
9567bde113f0edc93bc9de92ce172ce0c8c261a3 | 379 | py | Python | Tweet_Media.py | wolfdale/T-Bot | ceb4e6becf276592bf36f068dba59134e14bb4f0 | [
"MIT"
] | null | null | null | Tweet_Media.py | wolfdale/T-Bot | ceb4e6becf276592bf36f068dba59134e14bb4f0 | [
"MIT"
] | null | null | null | Tweet_Media.py | wolfdale/T-Bot | ceb4e6becf276592bf36f068dba59134e14bb4f0 | [
"MIT"
] | null | null | null | import tweepy
import os
import sys
ckey= ' '
csecret= ' '
atoken=' '
asecret= ' '
auth = tweepy.OAuthHandler(ckey,csecret) #Authenticating with twitter
auth.set_access_token(atoken,asecret) #Access tokens
api = tweepy.API(auth) #Performing Auth
filename = os.path.abspath(sys.argv[1])
status = sys.argv[2]
print "P... | 21.055556 | 69 | 0.74934 |
22344229a0d369d629b26db64d1ead7698d6e87f | 123 | py | Python | kiqpo/core/jsLib/alert.py | bionic-py/Bionic | a54c85107a6a2aa9a9563b6b3e1f9bb64d63faa4 | [
"MIT"
] | 9 | 2021-10-31T03:38:16.000Z | 2021-12-17T00:03:36.000Z | kiqpo/core/jsLib/alert.py | bionic-py/Bionic | a54c85107a6a2aa9a9563b6b3e1f9bb64d63faa4 | [
"MIT"
] | 12 | 2021-11-11T14:18:09.000Z | 2021-12-03T14:00:25.000Z | kiqpo/core/jsLib/alert.py | kiqpo/kiqpo | a54c85107a6a2aa9a9563b6b3e1f9bb64d63faa4 | [
"MIT"
] | 3 | 2022-03-03T18:30:53.000Z | 2022-03-09T13:29:39.000Z | def alert(data, js=False):
if js == False:
return f'alert("{data}")'
else:
return f'alert({data})'
| 20.5 | 33 | 0.520325 |
e7e9c2003137a4a187efa31452aafa0566a7a9f3 | 6,109 | py | Python | opennem/workers/aggregates.py | willhac/opennem | c8fbcd60e06898e1eeb2dad89548c4ece1b9a319 | [
"MIT"
] | null | null | null | opennem/workers/aggregates.py | willhac/opennem | c8fbcd60e06898e1eeb2dad89548c4ece1b9a319 | [
"MIT"
] | null | null | null | opennem/workers/aggregates.py | willhac/opennem | c8fbcd60e06898e1eeb2dad89548c4ece1b9a319 | [
"MIT"
] | null | null | null | import logging
import os
from datetime import datetime, timedelta
from textwrap import dedent
from typing import Tuple
from opennem.api.stats.controllers import get_scada_range
from opennem.api.stats.schema import ScadaDateRange
from opennem.db import get_database_engine
from opennem.schema.network import NetworkNEM, ... | 32.668449 | 119 | 0.656081 |
ef58cb1926421ad0fd33e4bc239f84058e0cac33 | 2,183 | py | Python | examples/python/geometry/triangle_mesh_sampling.py | amoran-symbio/Open3D | ae7e44e0dcef11a5df763819d47dec8c5bd5294b | [
"MIT"
] | 1,455 | 2021-07-27T19:44:50.000Z | 2022-03-31T19:39:21.000Z | examples/python/geometry/triangle_mesh_sampling.py | amoran-symbio/Open3D | ae7e44e0dcef11a5df763819d47dec8c5bd5294b | [
"MIT"
] | 1,439 | 2021-07-27T16:02:52.000Z | 2022-03-31T22:29:05.000Z | examples/python/geometry/triangle_mesh_sampling.py | amoran-symbio/Open3D | ae7e44e0dcef11a5df763819d47dec8c5bd5294b | [
"MIT"
] | 339 | 2021-07-28T03:07:28.000Z | 2022-03-31T13:38:00.000Z | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... | 43.66 | 79 | 0.662391 |
f3b992f1379d7a705fc296f3814507e03b5d94bb | 316 | py | Python | other-problems/filetest.py | KristianMariyanov/PythonPlayground | c9a50e2cf95012af1a020eeeb9be2a419d748661 | [
"MIT"
] | null | null | null | other-problems/filetest.py | KristianMariyanov/PythonPlayground | c9a50e2cf95012af1a020eeeb9be2a419d748661 | [
"MIT"
] | null | null | null | other-problems/filetest.py | KristianMariyanov/PythonPlayground | c9a50e2cf95012af1a020eeeb9be2a419d748661 | [
"MIT"
] | null | null | null | """ Read and print an integer series """
import sys
def read_series(filename):
with open(filename, mode='rt', encoding='utf-8') as f:
return [int(line.strip()) for line in f]
def main(filename):
series = read_series(filename)
print(series)
if __name__ == '__main__':
main(sys.argv[1])
| 17.555556 | 58 | 0.64557 |
23d77c15c25d6ca74a5733bcf0d6434f8974d193 | 6,685 | py | Python | _python/Call_Thread.py | CoCl-Jerry/Flashlapse_RELEASE | 09a4dbe4bf99908ee09e161dc6dda4f15b012f83 | [
"MIT"
] | null | null | null | _python/Call_Thread.py | CoCl-Jerry/Flashlapse_RELEASE | 09a4dbe4bf99908ee09e161dc6dda4f15b012f83 | [
"MIT"
] | null | null | null | _python/Call_Thread.py | CoCl-Jerry/Flashlapse_RELEASE | 09a4dbe4bf99908ee09e161dc6dda4f15b012f83 | [
"MIT"
] | null | null | null | import Settings
import Functions
import UI_Update
import Threads
def start_motion_preset(self):
if not Settings.motionPreset_running:
try:
Settings.gravitropism_wait = self.gravitropism_spinBox.value()
Settings.rotateAmount = self.rotateAmount_spinBox.value()
Settings.r... | 32.294686 | 86 | 0.636051 |
3985785d84137c8706901916250401ed3c848ef4 | 3,408 | py | Python | neptune/internal/common/models/parameter_value_converter.py | jiji-online/neptune-cli | 50cf680a80d141497f9331ab7cdaee49fcb90b0c | [
"Apache-2.0"
] | null | null | null | neptune/internal/common/models/parameter_value_converter.py | jiji-online/neptune-cli | 50cf680a80d141497f9331ab7cdaee49fcb90b0c | [
"Apache-2.0"
] | null | null | null | neptune/internal/common/models/parameter_value_converter.py | jiji-online/neptune-cli | 50cf680a80d141497f9331ab7cdaee49fcb90b0c | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2016, deepsense.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 35.5 | 89 | 0.678404 |
3f72556bbd7d1fad0caee277284974b7e00cf497 | 5,312 | py | Python | bin/atlas_traceroute.py | USC-NSL/ripe-atlas | 9c512b0660923779031ec62909bc13bccace5890 | [
"MIT"
] | 4 | 2015-09-17T18:22:36.000Z | 2016-03-11T21:00:57.000Z | bin/atlas_traceroute.py | USC-NSL/ripe-atlas | 9c512b0660923779031ec62909bc13bccace5890 | [
"MIT"
] | null | null | null | bin/atlas_traceroute.py | USC-NSL/ripe-atlas | 9c512b0660923779031ec62909bc13bccace5890 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import traceback
import os
import time
import socket
from atlas import measure_baseclass
from measure_baseclass import MeasurementBase
from measure_baseclass import load_input, readkey, process_response
from measure_baseclass import SLEEP_TIME
class Traceroute(MeasurementBase):
def __... | 39.058824 | 114 | 0.57436 |
951a372fea35b485b9d340004105a21136fef4bc | 65 | py | Python | redata/models/__init__.py | guicalare/redata | 1cc04398eef984428fae4bedd9da98f06aae87ec | [
"MIT"
] | null | null | null | redata/models/__init__.py | guicalare/redata | 1cc04398eef984428fae4bedd9da98f06aae87ec | [
"MIT"
] | null | null | null | redata/models/__init__.py | guicalare/redata | 1cc04398eef984428fae4bedd9da98f06aae87ec | [
"MIT"
] | null | null | null | from .metrics import *
from .table import *
from .alerts import * | 21.666667 | 22 | 0.738462 |
673189574f97fcf4c5f8957e28dc07d30133709d | 11,413 | py | Python | telloCV.py | dronefreak/dji-tello-collision-avoidance-pydnet | d4d33059dab9bc4a81fadb42b503d6e9a1cecdf8 | [
"MIT"
] | 23 | 2019-05-02T16:19:46.000Z | 2022-03-30T08:05:56.000Z | dji-tello-collision-avoidance-pydnet/telloCV.py | driver005/tello | fdb67fa4c4c24f6b9dbaacdc22b8f0681b677b7f | [
"Apache-2.0"
] | 2 | 2019-08-25T08:34:22.000Z | 2021-02-17T04:09:22.000Z | dji-tello-collision-avoidance-pydnet/telloCV.py | driver005/tello | fdb67fa4c4c24f6b9dbaacdc22b8f0681b677b7f | [
"Apache-2.0"
] | 13 | 2019-07-18T11:30:58.000Z | 2021-10-31T11:17:50.000Z | """
tellotracker:
Allows manual operation of the drone and demo tracking mode.
Requires mplayer to record/save video.
Controls:
- tab to lift off
- WASD to move the drone
- space/shift to ascend/descent slowly
- Q/E to yaw slowly
- arrow keys to ascend, descend, or yaw quickly
- backspace to land, or P to palm-land
-... | 35.554517 | 113 | 0.563655 |
0c78fff3f1194561cf83cf422c4c19713cc4ca0f | 1,601 | py | Python | src/foremast/elb/splay_health.py | gitter-badger/foremast | 33530438ba5893a1d5cf822a63e03d7ab49dfcd7 | [
"Apache-2.0"
] | null | null | null | src/foremast/elb/splay_health.py | gitter-badger/foremast | 33530438ba5893a1d5cf822a63e03d7ab49dfcd7 | [
"Apache-2.0"
] | null | null | null | src/foremast/elb/splay_health.py | gitter-badger/foremast | 33530438ba5893a1d5cf822a63e03d7ab49dfcd7 | [
"Apache-2.0"
] | null | null | null | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# 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... | 30.788462 | 76 | 0.643973 |
bd970fc9958293f978f3953137ea955da037b959 | 1,965 | py | Python | files/tag-ec2.py | rb-org/tfm-aws-lambda | b56f38e683c36c2be160df71ffc08719982e1e66 | [
"MIT"
] | null | null | null | files/tag-ec2.py | rb-org/tfm-aws-lambda | b56f38e683c36c2be160df71ffc08719982e1e66 | [
"MIT"
] | null | null | null | files/tag-ec2.py | rb-org/tfm-aws-lambda | b56f38e683c36c2be160df71ffc08719982e1e66 | [
"MIT"
] | null | null | null | import boto3
import os
# import json
# from datetime import datetime
from botocore.exceptions import ClientError
client = boto3.client('ec2')
ec2 = boto3.resource('ec2')
region = os.environ['REGION']
resource_ids = []
def lambda_handler(event, context):
try:
# print(event)
# Create EC2
... | 29.328358 | 80 | 0.453944 |
4c3d2a864a7fc638d8cc7054a10ede916e9caabb | 3,062 | py | Python | SDK/Examples/Python/Lib3MF_Example.py | alexanderoster/lib3mf | 30d5c2e0e8ed7febb5c10a84dc2db9d53fee6d05 | [
"BSD-2-Clause"
] | 171 | 2015-04-30T21:54:02.000Z | 2022-03-13T13:33:59.000Z | SDK/Examples/Python/Lib3MF_Example.py | alexanderoster/lib3mf | 30d5c2e0e8ed7febb5c10a84dc2db9d53fee6d05 | [
"BSD-2-Clause"
] | 190 | 2015-07-21T22:15:54.000Z | 2022-03-30T15:48:37.000Z | SDK/Examples/Python/Lib3MF_Example.py | alexanderoster/lib3mf | 30d5c2e0e8ed7febb5c10a84dc2db9d53fee6d05 | [
"BSD-2-Clause"
] | 80 | 2015-04-30T22:15:54.000Z | 2022-03-09T12:38:49.000Z | '''++
Copyright (C) 2019 3MF Consortium (Original Author)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditi... | 33.648352 | 108 | 0.763227 |
028fac412fc61833760bad32181587779712d2da | 6,420 | py | Python | pyleecan/Classes/DXFImport.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | 2 | 2019-06-08T15:04:39.000Z | 2020-09-07T13:32:22.000Z | pyleecan/Classes/DXFImport.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/DXFImport.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Simulation/DXFImport.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/DXFImport
"""
from os import linesep
from logging import getLo... | 32.1 | 129 | 0.61028 |
67b888dd52899c05f771ac65893a43390b1a0eec | 1,810 | py | Python | mt/base/functional.py | inteplus/mtbase | b211f25110f95be8b78be3e44feb1c16789c13b8 | [
"MIT"
] | null | null | null | mt/base/functional.py | inteplus/mtbase | b211f25110f95be8b78be3e44feb1c16789c13b8 | [
"MIT"
] | null | null | null | mt/base/functional.py | inteplus/mtbase | b211f25110f95be8b78be3e44feb1c16789c13b8 | [
"MIT"
] | null | null | null | '''Utitilites related to composing funcions.'''
__all__ = ['on_list', 'join_funcs', 'iterator_as_generator']
def on_list(func):
'''Turns a function that operates on each element at a time into a function that operates on a colletion of elements at a time. Can be used as a decorator.
Parameters
--------... | 29.672131 | 159 | 0.628177 |
0f831147437faad6fa88edb7049ef2d1d3c92e87 | 2,122 | py | Python | ds-sdk-mini/DeepSecurity/IntrusionPrevention.py | zachwhaley/thus | 22b006c4ea110fbdc09a79c38e49e79ba04bb4d4 | [
"MIT"
] | 24 | 2020-09-10T18:34:04.000Z | 2022-02-09T01:52:20.000Z | ds-sdk-mini/DeepSecurity/IntrusionPrevention.py | zachwhaley/thus | 22b006c4ea110fbdc09a79c38e49e79ba04bb4d4 | [
"MIT"
] | 5 | 2020-09-11T17:22:08.000Z | 2021-09-08T15:51:58.000Z | ds-sdk-mini/DeepSecurity/IntrusionPrevention.py | zachwhaley/thus | 22b006c4ea110fbdc09a79c38e49e79ba04bb4d4 | [
"MIT"
] | 6 | 2020-09-10T20:03:00.000Z | 2021-06-25T07:33:21.000Z | # Copyright (c) 2020. Brendan Johnson. All Rights Reserved.
#import connect
#import config
class IntrusionPrevention:
def __init__(self, config, connection):
self._config=config
self._connection = connection
## Application Types
def listTypes(self):
return self._connection.get(url=... | 58.944444 | 171 | 0.768615 |
91b5dc72e5f80a12991b89d62f564525112b912d | 1,063 | py | Python | migrations/versions/e604a3970f2b_initial_migration.py | samwel-chege/Pitches | 06e8ad720e123958b64d8fef24a6eea3bee22715 | [
"MIT"
] | null | null | null | migrations/versions/e604a3970f2b_initial_migration.py | samwel-chege/Pitches | 06e8ad720e123958b64d8fef24a6eea3bee22715 | [
"MIT"
] | null | null | null | migrations/versions/e604a3970f2b_initial_migration.py | samwel-chege/Pitches | 06e8ad720e123958b64d8fef24a6eea3bee22715 | [
"MIT"
] | null | null | null | """Initial Migration
Revision ID: e604a3970f2b
Revises:
Create Date: 2021-08-17 14:39:49.259942
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e604a3970f2b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... | 25.926829 | 65 | 0.668862 |
0e76e138188ee7432bfa0a8c0f3816a23608d503 | 56,475 | py | Python | src/sage/combinat/set_partition.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/set_partition.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/set_partition.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | r"""
Set Partitions
AUTHORS:
- Mike Hansen
- MuPAD-Combinat developers (for algorithms and design inspiration).
- Travis Scrimshaw (2013-02-28): Removed ``CombinatorialClass`` and added
entry point through :class:`SetPartition`.
"""
#*****************************************************************************
# ... | 31.515067 | 148 | 0.504807 |
daeeef092777560da767e254a741b2192a0df3fb | 1,481 | py | Python | 2019-04-15/sqrt.py | williamsirotkin/archive | 8c909e232ee979df9ba0c0c0384f2e4770b37cf7 | [
"Unlicense"
] | 2 | 2018-10-16T03:17:53.000Z | 2018-10-16T17:49:10.000Z | 2019-04-15/sqrt.py | williamsirotkin/archive | 8c909e232ee979df9ba0c0c0384f2e4770b37cf7 | [
"Unlicense"
] | null | null | null | 2019-04-15/sqrt.py | williamsirotkin/archive | 8c909e232ee979df9ba0c0c0384f2e4770b37cf7 | [
"Unlicense"
] | null | null | null | def sqrt(n, accuracy=0.001):
'''Compute the square root of `n`.
The value of `n` must be between 0 and 16,777,216 (i.e. 2^24).
This function implements a naive binary search. There are MUCH better
algorithms, though most require a math background through Calc 2.
See the Wikipedia page:
<https... | 30.854167 | 81 | 0.603646 |
2ac79377f8ef8c66f279e8c68c44c8bd61d87dbb | 462 | py | Python | mmpose/datasets/datasets/bottom_up/__init__.py | nightfuryyy/mmpose | 910d9e31dd9d46e3329be1b7567e6309d70ab64c | [
"Apache-2.0"
] | 1,775 | 2020-07-10T01:20:01.000Z | 2022-03-31T16:31:50.000Z | mmpose/datasets/datasets/bottom_up/__init__.py | KHB1698/mmpose | 93c3a742c540dfb4ca515ad545cef705a07d90b4 | [
"Apache-2.0"
] | 1,021 | 2020-07-11T11:40:24.000Z | 2022-03-31T14:32:26.000Z | mmpose/datasets/datasets/bottom_up/__init__.py | KHB1698/mmpose | 93c3a742c540dfb4ca515ad545cef705a07d90b4 | [
"Apache-2.0"
] | 477 | 2020-07-11T11:27:51.000Z | 2022-03-31T09:42:25.000Z | # Copyright (c) OpenMMLab. All rights reserved.
from .bottom_up_aic import BottomUpAicDataset
from .bottom_up_coco import BottomUpCocoDataset
from .bottom_up_coco_wholebody import BottomUpCocoWholeBodyDataset
from .bottom_up_crowdpose import BottomUpCrowdPoseDataset
from .bottom_up_mhp import BottomUpMhpDataset
__all_... | 38.5 | 76 | 0.844156 |
5b0eb8c5dd22d1e86d4fa6ea57e9ac9a9108c3dd | 1,177 | py | Python | Udemy/reversed.py | WSantos79/estudosPyCharm | dc75dd897574adf08f59fed70d556bb4f50dfe88 | [
"MIT"
] | null | null | null | Udemy/reversed.py | WSantos79/estudosPyCharm | dc75dd897574adf08f59fed70d556bb4f50dfe88 | [
"MIT"
] | null | null | null | Udemy/reversed.py | WSantos79/estudosPyCharm | dc75dd897574adf08f59fed70d556bb4f50dfe88 | [
"MIT"
] | null | null | null | """
Reversed
OBS: Não confunda com a função reverse() que estudamos nas listas.
A função reverse() só funciona em listas.
Já a função reversed() funciona com qualquer iteravel.
Sua função é inverter o iterável.
A função reversed() retorna um iterável chamado List Reverse Iterator
"""
lista = [1, 2, 3, 4, 5]
res ... | 21.017857 | 86 | 0.712829 |
c1b52e0dd99c0384abe55afa60e758a9044be965 | 477 | py | Python | data/scripts/templates/object/tangible/mission/quest_item/shared_noren_krast_q2_needed.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/mission/quest_item/shared_noren_krast_q2_needed.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/mission/quest_item/shared_noren_krast_q2_needed.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 = Tangible()
result.template = "object/tangible/mission/quest_item/shared_noren_krast_q2_needed.iff"
result.attribu... | 28.058824 | 88 | 0.742138 |
71f11973c32e49a31f901dcc71a554c7c99e34d0 | 4,089 | py | Python | CheckCooldown/CheckCooldown_StreamlabsParameter.py | EinWesen/slchatbotscripts | 0e6fed2b319fe6a5fd20814109800f6891cefa95 | [
"MIT"
] | null | null | null | CheckCooldown/CheckCooldown_StreamlabsParameter.py | EinWesen/slchatbotscripts | 0e6fed2b319fe6a5fd20814109800f6891cefa95 | [
"MIT"
] | null | null | null | CheckCooldown/CheckCooldown_StreamlabsParameter.py | EinWesen/slchatbotscripts | 0e6fed2b319fe6a5fd20814109800f6891cefa95 | [
"MIT"
] | null | null | null | #---------------------------
# Import Libraries
#---------------------------
import clr
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
#---------------------------
# [Required] Script Information
#---------------------------
ScriptName = "CoolDownParameter"
Website = "https://... | 41.30303 | 134 | 0.658352 |
332b343cf9915cd47280b2c76ca85cfd669ed7f6 | 27,991 | py | Python | labour/models/signup.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | labour/models/signup.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | labour/models/signup.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from collections import OrderedDict
from django.conf import settings
from django.db import models
from django.db.models import Sum
from django.db.models.functions import Coalesce
from django.utils.translation import ugettext_lazy as _
from six import text_type
from core.csv_export import CsvExportMixin
from core.uti... | 33.362336 | 111 | 0.648744 |
2ef4a3879d651fbd77fd4cef505bcbc8065dab4a | 3,063 | py | Python | simple_CNN.py | XiangyuDing/Tensorflow-learning | 233d7ef4ae61b333c3fb6ff0dcc8bcf31de9a359 | [
"MIT"
] | null | null | null | simple_CNN.py | XiangyuDing/Tensorflow-learning | 233d7ef4ae61b333c3fb6ff0dcc8bcf31de9a359 | [
"MIT"
] | null | null | null | simple_CNN.py | XiangyuDing/Tensorflow-learning | 233d7ef4ae61b333c3fb6ff0dcc8bcf31de9a359 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
# number 1 to 10 data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def compute_accuarcy(v_xs, v_ys):
global prediction
y_pre = sess.run(prediction, feed_dict={xs:v_xs, keep_prob: 1})
correct_prediction = tf.... | 39.779221 | 95 | 0.669931 |
52782195c923043fe2fdb557651e1476e368cfd8 | 71,551 | py | Python | import_export_batches/views_admin.py | mattare2/WeVoteServer | c12f1a4a64a94a3b22f97c9582ed1058749326d5 | [
"MIT"
] | null | null | null | import_export_batches/views_admin.py | mattare2/WeVoteServer | c12f1a4a64a94a3b22f97c9582ed1058749326d5 | [
"MIT"
] | null | null | null | import_export_batches/views_admin.py | mattare2/WeVoteServer | c12f1a4a64a94a3b22f97c9582ed1058749326d5 | [
"MIT"
] | null | null | null | # import_export_batches/views_admin.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import BatchDescription, BatchHeader, BatchHeaderMap, BatchManager, BatchRow, BatchSet, \
CONTEST_OFFICE, ELECTED_OFFICE, IMPORT_BALLOT_ITEM, \
BATCH_IMPORT_KEYS_ACCEPTED_FOR_CANDIDATES, BATCH_IMPO... | 50.246489 | 120 | 0.652583 |
6114223291b33e16fb09186a92983ad362b82254 | 13,862 | py | Python | bin/single_node_perf_run.py | garyli1019/impala | ea0e1def6160d596082b01365fcbbb6e24afb21d | [
"Apache-2.0"
] | null | null | null | bin/single_node_perf_run.py | garyli1019/impala | ea0e1def6160d596082b01365fcbbb6e24afb21d | [
"Apache-2.0"
] | 1 | 2022-03-29T21:58:11.000Z | 2022-03-29T21:58:11.000Z | bin/single_node_perf_run.py | garyli1019/impala | ea0e1def6160d596082b01365fcbbb6e24afb21d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env impala-python
#
# 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 (... | 39.719198 | 90 | 0.683523 |
efbdd60f7e7df707454e54362451b8083eb75b85 | 1,855 | py | Python | database_connections/SAP_HANA/hana_ml_connection.py | ant358/ML_tools | 9e0d562e12d7253d68dd8081967de9e300b84eda | [
"MIT"
] | null | null | null | database_connections/SAP_HANA/hana_ml_connection.py | ant358/ML_tools | 9e0d562e12d7253d68dd8081967de9e300b84eda | [
"MIT"
] | null | null | null | database_connections/SAP_HANA/hana_ml_connection.py | ant358/ML_tools | 9e0d562e12d7253d68dd8081967de9e300b84eda | [
"MIT"
] | null | null | null |
# Connect to the SAP Datawarehouse and upload some tables from our local db
import pandas as pd
import hana_ml.dataframe as dataframe
import sqlalchemy as sq
# Import the Connection details
import Parameters as p
# connect to local data
engine = sq.create_engine('sqlite:///../data/local.db')
# connect to HANA
conn =... | 30.409836 | 75 | 0.689488 |
6769efd6b2ee19441eb5cf34b87ac11f35ccc720 | 255 | py | Python | proj/migrations/0005_merge_0003_merge_20220131_1826_0004_photo.py | StarrFnl/CS_django_2122 | 441adb6df7fba17ccde72f9cf0b7803f8aa2621b | [
"MIT"
] | null | null | null | proj/migrations/0005_merge_0003_merge_20220131_1826_0004_photo.py | StarrFnl/CS_django_2122 | 441adb6df7fba17ccde72f9cf0b7803f8aa2621b | [
"MIT"
] | 1 | 2022-01-26T08:54:44.000Z | 2022-01-26T08:54:44.000Z | proj/migrations/0005_merge_0003_merge_20220131_1826_0004_photo.py | StarrFnl/CS_django_2122 | 441adb6df7fba17ccde72f9cf0b7803f8aa2621b | [
"MIT"
] | 3 | 2022-01-20T14:55:02.000Z | 2022-01-26T11:16:35.000Z | # Generated by Django 4.0.2 on 2022-02-07 10:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('proj', '0003_merge_20220131_1826'),
('proj', '0004_photo'),
]
operations = [
]
| 17 | 47 | 0.623529 |
85d0b710b11f59abe099ce066bddcb259859ce54 | 4,041 | py | Python | visualisation.py | Rubin-ga/pandemics | 653275ad938d908d191edeb3c362c77b0c968e71 | [
"BSD-2-Clause"
] | null | null | null | visualisation.py | Rubin-ga/pandemics | 653275ad938d908d191edeb3c362c77b0c968e71 | [
"BSD-2-Clause"
] | null | null | null | visualisation.py | Rubin-ga/pandemics | 653275ad938d908d191edeb3c362c77b0c968e71 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import matplotlib
import matplotlib.pyplot as plt
from IPython import display
import numpy as np
import copy
# Prepares axis for a grid visualisation
def visualisation_setup(ax, model, title=None):
ax.set_title(title)
ax.set_ylim(-0.5, model.grid.height-0.5)
ax.set_xl... | 38.485714 | 104 | 0.690176 |
467a1430a761d9e8d7e184058bf6979799f6eb5a | 2,823 | py | Python | test/test_inline_object1.py | bsneade/statuspageio-python | 30526a2984251885381e781b12b5070d46063537 | [
"Apache-2.0"
] | 2 | 2020-03-02T20:32:32.000Z | 2020-05-20T16:54:58.000Z | test/test_inline_object1.py | bsneade/statuspageio-python | 30526a2984251885381e781b12b5070d46063537 | [
"Apache-2.0"
] | null | null | null | test/test_inline_object1.py | bsneade/statuspageio-python | 30526a2984251885381e781b12b5070d46063537 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Statuspage API
# Code of Conduct Please don't abuse the API, and please report all feature requests and issues to https://help.statuspage.io/help/contact-us-30 # Rate Limiting Each API token is limited to 1 request / second as measured on a 60 second rolling window. To get this limit incr... | 70.575 | 2,064 | 0.722281 |
f11e2eec27115cb3b26f998073c80da97c2caf32 | 194 | py | Python | Voice Robot.py | iJARG/Voice-Robot | 2317162e9f3208e704ffd44fe1b0b534a8015746 | [
"Apache-2.0"
] | null | null | null | Voice Robot.py | iJARG/Voice-Robot | 2317162e9f3208e704ffd44fe1b0b534a8015746 | [
"Apache-2.0"
] | null | null | null | Voice Robot.py | iJARG/Voice-Robot | 2317162e9f3208e704ffd44fe1b0b534a8015746 | [
"Apache-2.0"
] | null | null | null | from gtts import gTTS
import os
mytext = 'write here'
language = 'es'
myobj = gTTS(text=mytext, lang=language, slow=False)
myobj.save("audio.mp3")
os.system("mpg321 audio.mp3") | 14.923077 | 53 | 0.670103 |
445699713379ac81fd254c6e788cd692789163da | 2,533 | py | Python | tests/executors/crafters/image/test_crop.py | phamtrancsek12/jina | efa339fd7e19760d9033b51e54a1b5eca60f1c5f | [
"Apache-2.0"
] | 2 | 2021-06-18T11:55:15.000Z | 2021-08-30T20:15:46.000Z | tests/executors/crafters/image/test_crop.py | phamtrancsek12/jina | efa339fd7e19760d9033b51e54a1b5eca60f1c5f | [
"Apache-2.0"
] | null | null | null | tests/executors/crafters/image/test_crop.py | phamtrancsek12/jina | efa339fd7e19760d9033b51e54a1b5eca60f1c5f | [
"Apache-2.0"
] | null | null | null | import unittest
import numpy as np
from jina.executors.crafters.image.crop import ImageCropper, CenterImageCropper, RandomImageCropper, FiveImageCropper, \
SlidingWindowImageCropper
from tests.executors.crafters.image import JinaImageTestCase
class MyTestCase(JinaImageTestCase):
def test_crop(self):
... | 37.25 | 120 | 0.664824 |
15c651981487e8ff83598eac39f7579e427b7788 | 4,101 | py | Python | scraping.py | daniel89mk/Mission-to-Mars | 1fe91f9ed08e1c28da0c79b1b7a56c72f0c3449d | [
"MIT"
] | null | null | null | scraping.py | daniel89mk/Mission-to-Mars | 1fe91f9ed08e1c28da0c79b1b7a56c72f0c3449d | [
"MIT"
] | null | null | null | scraping.py | daniel89mk/Mission-to-Mars | 1fe91f9ed08e1c28da0c79b1b7a56c72f0c3449d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Import Splinter and BeautifulSoup
from splinter import Browser
from bs4 import BeautifulSoup as soup
import pandas as pd
import datetime as dt
from webdriver_manager.chrome import ChromeDriverManager
def scrape_all():
# Initiate headless drvier for deployment
executable... | 29.503597 | 86 | 0.663009 |
e2bf37401ec162a83d80d12aa563cb18f319ea4d | 2,564 | py | Python | src/data/bdd100k_drivablearea.py | hezl1592/deeplabv3-_mobilenetv2 | cc3134d54bd84f700531c230353228541a7336f5 | [
"MIT"
] | null | null | null | src/data/bdd100k_drivablearea.py | hezl1592/deeplabv3-_mobilenetv2 | cc3134d54bd84f700531c230353228541a7336f5 | [
"MIT"
] | null | null | null | src/data/bdd100k_drivablearea.py | hezl1592/deeplabv3-_mobilenetv2 | cc3134d54bd84f700531c230353228541a7336f5 | [
"MIT"
] | null | null | null | from functools import partial
import numpy as np
from pathlib import Path
import os
import cv2
import torch
from torch.utils.data import DataLoader, Dataset
class BDD100K_Area_Seg(Dataset):
n_classes = 3
void_classes = []
valid_classes = [0, 1, 2]
class_map = dict(zip(valid_classes, range(n_classes)))... | 36.112676 | 106 | 0.641576 |
605bda600cb2b6485d6487d1cd03550cbb72f9ea | 3,193 | py | Python | terminusdb_client/woql_utils.py | pnijhara/terminusdb-client-python | bdc3480c21a6c1eb123abae1592e6a2b27b046c1 | [
"Apache-2.0"
] | null | null | null | terminusdb_client/woql_utils.py | pnijhara/terminusdb-client-python | bdc3480c21a6c1eb123abae1592e6a2b27b046c1 | [
"Apache-2.0"
] | null | null | null | terminusdb_client/woql_utils.py | pnijhara/terminusdb-client-python | bdc3480c21a6c1eb123abae1592e6a2b27b046c1 | [
"Apache-2.0"
] | null | null | null | import urllib.parse
STANDARD_URLS = {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"xdd": "http://terminusdb.com/schema/xdd#",
"owl": "http://www.w3.org/2002/07/owl#",
"terminus": "http://termi... | 26.38843 | 72 | 0.593799 |
79f97baba816049ba7fa4c7e47c994ee9f7d6a28 | 7,023 | py | Python | Python/GoogleTranslator.py | Avey777/free-google-translate | 12a92cd424c620bd9661abcf962205b212d35906 | [
"MIT"
] | 99 | 2020-04-23T14:24:23.000Z | 2022-03-27T08:17:25.000Z | Python/GoogleTrans2.py | leungBH/free-google-translate | 3d0c1eae8b86c910393a76a73b7b0759a1bb25b1 | [
"MIT"
] | 6 | 2020-09-22T12:02:17.000Z | 2021-09-27T10:52:34.000Z | Python/GoogleTrans2.py | leungBH/free-google-translate | 3d0c1eae8b86c910393a76a73b7b0759a1bb25b1 | [
"MIT"
] | 48 | 2020-05-15T14:59:59.000Z | 2022-03-21T07:36:50.000Z | #! /usr/bin/env python
# -*- coding:utf-8 -*-
# 网友的建议:https://github.com/VictorZhang2014/free-google-translate/issues/6
#
import urllib.parse
import requests
import json
import re
import ssl
import ctypes
ssl._create_default_https_context = ssl._create_unverified_context
class GoogleTrans(object):
def __init__(... | 36.769634 | 204 | 0.427595 |
890cb5da80a7f1c301ca73351f3c8091389e108b | 144 | py | Python | src/keep_awake.py | Neelhtak/notion-heroku | 7a991d520d340ac7055905ebd6e67c3d9532c97d | [
"MIT"
] | 39 | 2019-07-18T20:27:06.000Z | 2022-03-10T03:13:57.000Z | src/keep_awake.py | Neelhtak/notion-heroku | 7a991d520d340ac7055905ebd6e67c3d9532c97d | [
"MIT"
] | 3 | 2019-12-09T21:56:22.000Z | 2019-12-11T02:17:05.000Z | src/keep_awake.py | Neelhtak/notion-heroku | 7a991d520d340ac7055905ebd6e67c3d9532c97d | [
"MIT"
] | 8 | 2019-07-17T03:40:24.000Z | 2021-03-04T14:33:33.000Z | #!/usr/bin/env -S PATH="${PATH}:/usr/local/bin" python3
import requests
def ping():
requests.get('https://notion-heroku.herokuapp.com/')
| 18 | 56 | 0.673611 |
3f9d420bb5e04b42c5071002f4dc7699bf35f32e | 1,800 | py | Python | test.py | brucelightyear/text-summarization-tensorflow | 359191315eb94143b463321426fdea661fdb0284 | [
"MIT"
] | null | null | null | test.py | brucelightyear/text-summarization-tensorflow | 359191315eb94143b463321426fdea661fdb0284 | [
"MIT"
] | null | null | null | test.py | brucelightyear/text-summarization-tensorflow | 359191315eb94143b463321426fdea661fdb0284 | [
"MIT"
] | null | null | null | import tensorflow as tf
import pickle
from model import Model
from utils import build_dict, build_dataset, batch_iter
with open("args.pickle", "rb") as f:
args = pickle.load(f)
print("Loading dictionary...")
word_dict, reversed_dict, article_max_len, summary_max_len = build_dict("valid", args.toy)
print("Loading... | 37.5 | 91 | 0.626111 |
a561ca4e1a2a7048a2690a184049be424842cb64 | 1,363 | py | Python | search_service/proxy/__init__.py | mgorsk1/amundsensearchlibrary | e61bea51b9df26b382ad8d745861ba05bfbadf65 | [
"Apache-2.0"
] | 3 | 2021-02-09T13:52:03.000Z | 2022-02-26T02:36:02.000Z | search_service/proxy/__init__.py | mgorsk1/amundsensearchlibrary | e61bea51b9df26b382ad8d745861ba05bfbadf65 | [
"Apache-2.0"
] | 1 | 2021-02-08T23:21:04.000Z | 2021-02-08T23:21:04.000Z | search_service/proxy/__init__.py | mgorsk1/amundsensearchlibrary | e61bea51b9df26b382ad8d745861ba05bfbadf65 | [
"Apache-2.0"
] | 2 | 2021-02-23T18:23:35.000Z | 2022-03-18T15:12:25.000Z | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from threading import Lock
from flask import current_app
from search_service import config
from search_service.proxy.base import BaseProxy
from werkzeug.utils import import_string
_proxy_client = None
_proxy_client_lock = Lock()... | 29.630435 | 108 | 0.7146 |
3e71109ac878ce791f251495491c42ac225bf98b | 2,099 | py | Python | train/dataloaders/base_loader.py | idearibosome/tf_perceptual_eusr | 2bdd79adcbb7ee55bfc0593879fd5831c9859098 | [
"Apache-2.0"
] | 45 | 2018-09-12T19:15:18.000Z | 2021-06-11T13:12:55.000Z | dataloaders/base_loader.py | idearibosome/tf-sr-attack | 0fed8bc639449dd1556fb6071658b26e64f68783 | [
"Apache-2.0"
] | 6 | 2018-10-29T11:04:35.000Z | 2021-08-24T06:33:36.000Z | dataloaders/base_loader.py | idearibosome/tf-sr-attack | 0fed8bc639449dd1556fb6071658b26e64f68783 | [
"Apache-2.0"
] | 11 | 2018-10-11T05:14:14.000Z | 2021-03-13T16:09:15.000Z | import os
import numpy as np
import tensorflow as tf
FLAGS = tf.flags.FLAGS
def create_loader():
return BaseLoader()
class BaseLoader():
def __init__(self):
pass
def prepare(self):
"""
Prepare the data loader.
"""
raise NotImplementedError
def get_num_images(self):
"""
Get t... | 27.986667 | 92 | 0.679371 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.