hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64789b6a51b1d54a4ee3a12794a72d10385cae4e | 5,608 | py | Python | VIonLDA/lda_main.py | JunwenHuang1996/VIonLDA | 6b496a8b13d2177a3ec3ff6ab7f521df3d4f3e6c | [
"MIT"
] | 5 | 2020-10-27T11:10:25.000Z | 2021-11-18T12:34:29.000Z | VIonLDA/lda_main.py | JunwenHuang1996/VIonLDA | 6b496a8b13d2177a3ec3ff6ab7f521df3d4f3e6c | [
"MIT"
] | null | null | null | VIonLDA/lda_main.py | JunwenHuang1996/VIonLDA | 6b496a8b13d2177a3ec3ff6ab7f521df3d4f3e6c | [
"MIT"
] | 2 | 2020-12-04T12:46:28.000Z | 2021-02-05T10:17:05.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import numpy as np
from scipy.special import digamma, polygamma
def simulation_data(M=500,k=10,V=1000,xi=40,max_iter=100,gamma_shape=2,gamma_scale=1):
"""Simulation the data according to LDA process. Return a list
of N_d*V matrix(one-hot-coding) with length M.
--... | 31.505618 | 120 | 0.561698 |
3df22f3407235dd838801d5aa26182d41200c49d | 219 | py | Python | examples/matplotlib/mpl_plot_khat.py | aseyboldt/arviz | 1fb40ff442f5ba4b8d11ceeaef27e6c339eb1685 | [
"Apache-2.0"
] | null | null | null | examples/matplotlib/mpl_plot_khat.py | aseyboldt/arviz | 1fb40ff442f5ba4b8d11ceeaef27e6c339eb1685 | [
"Apache-2.0"
] | null | null | null | examples/matplotlib/mpl_plot_khat.py | aseyboldt/arviz | 1fb40ff442f5ba4b8d11ceeaef27e6c339eb1685 | [
"Apache-2.0"
] | null | null | null | """
Pareto Shape Plot
=================
_thumb: .7, .5
"""
import arviz as az
az.style.use("arviz-darkgrid")
idata = az.load_arviz_data("radon")
loo = az.loo(idata, pointwise=True)
az.plot_khat(loo, show_bins=True)
| 14.6 | 35 | 0.643836 |
cee89e60e3e0e1bdb38c978e1f166d88d1c83d78 | 1,724 | py | Python | app/api/models.py | rasyidf/SCIPTA | f812d93ad27b13a469352638c2c95092495312be | [
"MIT"
] | null | null | null | app/api/models.py | rasyidf/SCIPTA | f812d93ad27b13a469352638c2c95092495312be | [
"MIT"
] | null | null | null | app/api/models.py | rasyidf/SCIPTA | f812d93ad27b13a469352638c2c95092495312be | [
"MIT"
] | null | null | null |
from sqlalchemy import Binary, Column, Integer, String
from app import db, login_manager
from json import JSONEncoder, JSONDecoder
class Input(db.Model):
"""
Input Class
"""
__tablename__ = 'inputs'
id = Column(Integer, primary_key=True)
text = Column(String, unique=True)
desc = Column... | 21.02439 | 75 | 0.613109 |
4884ee5267fd03617f8338983ac06bc20b74466f | 1,477 | py | Python | cms/utils/reversion_hacks.py | jrutila/django-cms | 798889104fcda59e82941986eadf46d4f08147f2 | [
"BSD-3-Clause"
] | 2 | 2018-05-17T02:49:49.000Z | 2019-08-20T02:07:44.000Z | cms/utils/reversion_hacks.py | jrutila/django-cms | 798889104fcda59e82941986eadf46d4f08147f2 | [
"BSD-3-Clause"
] | 9 | 2015-06-25T10:31:12.000Z | 2022-03-12T00:41:22.000Z | cms/utils/reversion_hacks.py | jrutila/django-cms | 798889104fcda59e82941986eadf46d4f08147f2 | [
"BSD-3-Clause"
] | 1 | 2017-08-22T07:00:30.000Z | 2017-08-22T07:00:30.000Z | # -*- coding: utf-8 -*-
from django.db import models
import reversion
from reversion.revisions import RegistrationError, VersionAdapter
def register_draft_only(model_class, fields, follow, format):
"""
version of the reversion register function that only registers drafts and
ignores public models
"""
... | 38.868421 | 81 | 0.725796 |
8790eee3f14343b4063202bc86f7b950ab67f3cf | 1,450 | py | Python | gnn_model/utils/eval_helper.py | zxqlxy/GNN-FakeNews | adf1540fee7ac944a76e8ff2766288d07b6973ed | [
"Apache-2.0"
] | null | null | null | gnn_model/utils/eval_helper.py | zxqlxy/GNN-FakeNews | adf1540fee7ac944a76e8ff2766288d07b6973ed | [
"Apache-2.0"
] | null | null | null | gnn_model/utils/eval_helper.py | zxqlxy/GNN-FakeNews | adf1540fee7ac944a76e8ff2766288d07b6973ed | [
"Apache-2.0"
] | null | null | null | from sklearn.metrics import f1_score, accuracy_score, recall_score, precision_score, roc_auc_score, average_precision_score
"""
Utility functions for evaluating the model performance
"""
def eval_deep(log, loader):
"""
Evaluating the classification performance given mini-batch data
"""
# get the empirical bat... | 33.72093 | 123 | 0.728276 |
7cad904706e28e2978c2c84cbef9897fcb57b137 | 14,139 | py | Python | mesonbuild/wrap/wrap.py | qtcreator-meson-plugin/meson | 37ffff0aeddaf1f7a92076559484b9a6bce8c455 | [
"Apache-2.0"
] | null | null | null | mesonbuild/wrap/wrap.py | qtcreator-meson-plugin/meson | 37ffff0aeddaf1f7a92076559484b9a6bce8c455 | [
"Apache-2.0"
] | null | null | null | mesonbuild/wrap/wrap.py | qtcreator-meson-plugin/meson | 37ffff0aeddaf1f7a92076559484b9a6bce8c455 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to ... | 39.940678 | 116 | 0.586604 |
4d46461c835a684e600265d1e7df21e11eeeb439 | 2,621 | py | Python | plataforma/gravedad/main.py | Jofemago/Computaci-n-Grafica | 2a46b530035600b9f0418ba4d6bc2558aa0f1687 | [
"MIT"
] | null | null | null | plataforma/gravedad/main.py | Jofemago/Computaci-n-Grafica | 2a46b530035600b9f0418ba4d6bc2558aa0f1687 | [
"MIT"
] | null | null | null | plataforma/gravedad/main.py | Jofemago/Computaci-n-Grafica | 2a46b530035600b9f0418ba4d6bc2558aa0f1687 | [
"MIT"
] | null | null | null | import pygame
import random
from player import *
from configuraciones import *
if __name__ =='__main__':
pygame.init()
pantalla=pygame.display.set_mode([ANCHO, ALTO])
pygame.display.flip()
jugadores = pygame.sprite.Group()
general = pygame.sprite.Group()
plataformas = pygame.sprite.Group()
... | 23.827273 | 118 | 0.53987 |
4dd71026c8de7eb67eda3f649934f4e5ac6b6120 | 974 | py | Python | alipay/aop/api/domain/ZhimaMerchantActivityParticipationQueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/ZhimaMerchantActivityParticipationQueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/ZhimaMerchantActivityParticipationQueryModel.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.constant.ParamConstants import *
class ZhimaMerchantActivityParticipationQueryModel(object):
def __init__(self):
self._contract_no = None
@property
def contract_no(self):
return self._contract_no... | 23.756098 | 73 | 0.626283 |
6033e8dfdfd5a95a9db35a5069f641d3a4d57b0f | 1,814 | py | Python | setup.py | nakarinh14/django-haystack | b6dd72e6b5c97b782f5436b7bb4e8227ba6e3b06 | [
"BSD-3-Clause"
] | 2,021 | 2015-02-06T07:45:08.000Z | 2022-03-30T12:26:39.000Z | setup.py | nakarinh14/django-haystack | b6dd72e6b5c97b782f5436b7bb4e8227ba6e3b06 | [
"BSD-3-Clause"
] | 787 | 2015-02-03T20:06:04.000Z | 2022-03-30T09:00:38.000Z | setup.py | nakarinh14/django-haystack | b6dd72e6b5c97b782f5436b7bb4e8227ba6e3b06 | [
"BSD-3-Clause"
] | 878 | 2015-02-04T15:29:50.000Z | 2022-03-28T16:51:44.000Z | #!/usr/bin/env python
from setuptools import setup
install_requires = ["Django>=2.2"]
tests_require = [
"pysolr>=3.7.0",
"whoosh>=2.5.4,<3.0",
"python-dateutil",
"geopy==2.0.0",
"nose",
"coverage",
"requests",
]
setup(
name="django-haystack",
use_scm_version=True,
description=... | 29.258065 | 78 | 0.589305 |
07bbe2b1aa9fb904fa03aafaef516ff019879db1 | 2,111 | py | Python | TUNIBrain/University_API_requests.py | woroko/TUNIBot | e53dd66b11c732e2524a5022026156990fc9702a | [
"MIT"
] | null | null | null | TUNIBrain/University_API_requests.py | woroko/TUNIBot | e53dd66b11c732e2524a5022026156990fc9702a | [
"MIT"
] | null | null | null | TUNIBrain/University_API_requests.py | woroko/TUNIBot | e53dd66b11c732e2524a5022026156990fc9702a | [
"MIT"
] | null | null | null | import requests, time
#Loads University API-data and saves it into json and xml files.
def save_API_data():
#Is there a delay between API calls or not
delay = False
#Implementation of study modules
#URL and API-key for the request
url = 'https://opendata.uta.fi:8443/apiman-gateway/UTA/opintojaksot/1.0... | 35.183333 | 78 | 0.676457 |
14e4a74960ab843341a997a72f1c67c4cadaa841 | 836 | py | Python | src/tiling/bin/getHighestResolution.py | WoutDavid/ST-nextflow-pipeline | 8de3da218ec4f10f183e1163fe782c19fd8dd841 | [
"MIT"
] | null | null | null | src/tiling/bin/getHighestResolution.py | WoutDavid/ST-nextflow-pipeline | 8de3da218ec4f10f183e1163fe782c19fd8dd841 | [
"MIT"
] | null | null | null | src/tiling/bin/getHighestResolution.py | WoutDavid/ST-nextflow-pipeline | 8de3da218ec4f10f183e1163fe782c19fd8dd841 | [
"MIT"
] | null | null | null | # importing the module
import os
import cv2
import sys
import glob
from PIL import Image
# important for giant tiff files, otherwise PIL thinks it's malware
Image.MAX_IMAGE_PIXELS = None
def getResolution(filepath):
"""Prints the resolution of the given image.
Parameters
----------
fi... | 22.594595 | 81 | 0.62799 |
f32a33b96bff28c10bc0adf7cb7b9d0cc75a90bf | 2,082 | py | Python | src/Recorder.py | EduardoPagotto/PyMoveDetect | 5d592e66fcbb1937dc38fd364a0187f154284e31 | [
"MIT"
] | null | null | null | src/Recorder.py | EduardoPagotto/PyMoveDetect | 5d592e66fcbb1937dc38fd364a0187f154284e31 | [
"MIT"
] | null | null | null | src/Recorder.py | EduardoPagotto/PyMoveDetect | 5d592e66fcbb1937dc38fd364a0187f154284e31 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
Created on 20180326
Update on 20180326
@author: Eduardo Pagotto
'''
#pylint: disable=C0301
#pylint: disable=C0103
#pylint: disable=W0703
import logging
import cv2
class Recorder(object):
'''
Classe de gravador de video
'''
def __init__(self, file_name, fps, dim, codec):
... | 29.323944 | 167 | 0.6244 |
143af51b94235d4c0e42e90a3817e801e7e2a7e5 | 36,684 | py | Python | nova/tests/unit/compute/test_compute_utils.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/compute/test_compute_utils.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/compute/test_compute_utils.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | 43.259434 | 79 | 0.616018 |
da1d0a96e77873844bb729768aa22bde6caaf3de | 4,243 | py | Python | pliers/datasets/text.py | nickduran/pliers | 9b10b27e70c3fbb7647eb1c70e031f55d824f3f6 | [
"BSD-3-Clause"
] | 229 | 2016-12-22T22:55:20.000Z | 2020-07-13T19:04:46.000Z | pliers/datasets/text.py | nickduran/pliers | 9b10b27e70c3fbb7647eb1c70e031f55d824f3f6 | [
"BSD-3-Clause"
] | 294 | 2016-12-23T00:23:25.000Z | 2020-07-17T19:44:37.000Z | pliers/datasets/text.py | nickduran/pliers | 9b10b27e70c3fbb7647eb1c70e031f55d824f3f6 | [
"BSD-3-Clause"
] | 61 | 2017-01-10T00:53:26.000Z | 2020-04-27T16:25:53.000Z | ''' Functionality for loading and manipulating text datasets. '''
import zipfile
import json
import os
import tempfile
import io
import requests
import pandas as pd
def _load_datasets():
path = os.path.abspath(__file__)
path = os.path.join(os.path.dirname(path), 'dictionaries.json')
dicts = json.load(ope... | 37.883929 | 80 | 0.649069 |
dee2f85aa194a484089844c2e113316fb1a07b37 | 824 | py | Python | sparse_operation_kit/sparse_operation_kit/tf/keras/mixed_precision/__init__.py | x-y-z/HugeCTR | 17bf942215df60827ece9dc015af5191ef9219b7 | [
"Apache-2.0"
] | 130 | 2021-10-11T11:55:28.000Z | 2022-03-31T21:53:07.000Z | sparse_operation_kit/sparse_operation_kit/tf/keras/mixed_precision/__init__.py | Teora/HugeCTR | c55a63401ad350669ccfcd374aefd7a5fc879ca2 | [
"Apache-2.0"
] | 72 | 2021-10-09T04:59:09.000Z | 2022-03-31T11:27:54.000Z | sparse_operation_kit/sparse_operation_kit/tf/keras/mixed_precision/__init__.py | Teora/HugeCTR | c55a63401ad350669ccfcd374aefd7a5fc879ca2 | [
"Apache-2.0"
] | 29 | 2021-11-03T22:35:01.000Z | 2022-03-30T13:11:59.000Z | """
Copyright (c) 2021, NVIDIA CORPORATION.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | 37.454545 | 73 | 0.764563 |
f8a20e88371f86053b7153fb367b1cc1c3625f6d | 879 | py | Python | python_scraper/python_scraper/spiders/w3school.py | VladimirsHisamutdinovs/python-scraper | 5d58e4ea47333e5276c8d16a12ea75995ec031b5 | [
"Apache-2.0"
] | null | null | null | python_scraper/python_scraper/spiders/w3school.py | VladimirsHisamutdinovs/python-scraper | 5d58e4ea47333e5276c8d16a12ea75995ec031b5 | [
"Apache-2.0"
] | null | null | null | python_scraper/python_scraper/spiders/w3school.py | VladimirsHisamutdinovs/python-scraper | 5d58e4ea47333e5276c8d16a12ea75995ec031b5 | [
"Apache-2.0"
] | null | null | null | import scrapy
class W3schoolSpider(scrapy.Spider):
name = 'w3school'
allowed_domains = ['www.w3schools.com']
start_urls = ['http://www.w3schools.com/python/']
def parse(self, response):
for link in response.css('div.w3-sidebar a::attr(href)'):
yield response.follow(link.get(), cal... | 38.217391 | 75 | 0.571104 |
50161e1c286eefe904d9f58a9ddaa4d27af5c082 | 9,976 | py | Python | procshape/dualcontour/qef.py | tcdude/procshape | 75a96453edeeb2c61c1eec0b9c8823cedbfd37b7 | [
"MIT"
] | 6 | 2019-02-22T23:55:57.000Z | 2021-06-18T17:28:22.000Z | procshape/dualcontour/qef.py | tcdude/procshape | 75a96453edeeb2c61c1eec0b9c8823cedbfd37b7 | [
"MIT"
] | 6 | 2018-12-21T18:14:26.000Z | 2019-01-03T13:20:58.000Z | procshape/dualcontour/qef.py | tcdude/procshape | 75a96453edeeb2c61c1eec0b9c8823cedbfd37b7 | [
"MIT"
] | null | null | null | import numpy
import numpy.linalg
from procshape.dualcontour.constants import BIAS
from procshape.dualcontour.constants import BIAS_STRENGTH
from procshape.dualcontour.constants import BOUNDARY
from procshape.dualcontour.constants import CLIP
from .utils2d import V2
from .utils3d import V3
class QEF:
"""Represent... | 40.552846 | 116 | 0.564655 |
8989c9aad00329d7d290d93cae9749acd0313b17 | 4,749 | py | Python | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 43.172727 | 133 | 0.656138 |
69eb7018935aa98388bee8948deb649791c62320 | 642 | py | Python | main/aio/mysql.py | chaosannals/trial-python | 740b91fa4b1b1b9839b7524515995a6d417612ca | [
"MIT"
] | null | null | null | main/aio/mysql.py | chaosannals/trial-python | 740b91fa4b1b1b9839b7524515995a6d417612ca | [
"MIT"
] | 8 | 2020-12-26T07:48:15.000Z | 2022-03-12T00:25:14.000Z | main/aio/mysql.py | chaosannals/trial-python | 740b91fa4b1b1b9839b7524515995a6d417612ca | [
"MIT"
] | null | null | null | import asyncio
import aiomysql
async def fetchall(sql, loop):
async with aiomysql.create_pool(
host='127.0.0.1',
port=3306,
user='root',
password='root',
db='trial',
loop=loop
) as pool:
async with pool.acquire() as conn:
async with conn.curs... | 22.137931 | 52 | 0.568536 |
ad9379e07f797c2bcaf2ab40d7b2cab8ae16ae0b | 469 | py | Python | setup.py | StowasserH/PiBackup | 708e84d3ffcd35840ce92ec9bfa0ec29d9e69796 | [
"MIT"
] | null | null | null | setup.py | StowasserH/PiBackup | 708e84d3ffcd35840ce92ec9bfa0ec29d9e69796 | [
"MIT"
] | null | null | null | setup.py | StowasserH/PiBackup | 708e84d3ffcd35840ce92ec9bfa0ec29d9e69796 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='pibackup',
version='0.0.1',
description='Create easily a backup solution for your RaspbianPi',
license='MIT',
author='Harald Stowasser',
author_email='lcars@stowasser.tv',
packages=['pibackup'],
keywords=['backup','raspbian','pi'],
url='http... | 27.588235 | 70 | 0.63113 |
1845320ae66738b9ac7ba939ebb5ba94f7f952bd | 14,935 | py | Python | QRSDetectorOffline.py | popobaboya/qrs_detector | ac638581ee061dc9e37b6fa89c77f566b9e16bc9 | [
"MIT"
] | null | null | null | QRSDetectorOffline.py | popobaboya/qrs_detector | ac638581ee061dc9e37b6fa89c77f566b9e16bc9 | [
"MIT"
] | null | null | null | QRSDetectorOffline.py | popobaboya/qrs_detector | ac638581ee061dc9e37b6fa89c77f566b9e16bc9 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from time import gmtime, strftime
from scipy.signal import butter, lfilter
# path 설정
LOG_DIR = "logs/"
PLOT_DIR = "plots/"
#모듈의 클래스
class QRSDetectorOffline(object):
# 설명 및 라이센스
"""
Python Offline ECG QRS Detector based on the Pan-Tomkins algorithm... | 46.52648 | 472 | 0.659391 |
1d527e20a5b5ca62405759d3f991265fb2883b19 | 1,891 | py | Python | examples/ex04_xcel/test/ChecksumXcelFL_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | examples/ex04_xcel/test/ChecksumXcelFL_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | examples/ex04_xcel/test/ChecksumXcelFL_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | """
==========================================================================
ChecksumXcelFL_test.py
==========================================================================
Tests for the functional level checksum accelerator.
Author : Yanghui Ou
Date : June 14, 2019
"""
from examples.ex02_cksum.test.ChecksumCL_t... | 31.516667 | 82 | 0.47964 |
1ad84254e287bf2cfd178aa8d5f058f0895e91d7 | 16,806 | py | Python | graphql_compiler/tests/test_post_processing.py | kensho-technologies/graphql-compiler | 4318443b7b2512a059f3616112bfc40bbf8eec06 | [
"Apache-2.0"
] | 521 | 2017-07-18T23:56:25.000Z | 2022-03-25T16:39:06.000Z | graphql_compiler/tests/test_post_processing.py | kensho-technologies/graphql-compiler | 4318443b7b2512a059f3616112bfc40bbf8eec06 | [
"Apache-2.0"
] | 740 | 2017-07-19T01:52:42.000Z | 2021-09-30T11:15:00.000Z | graphql_compiler/tests/test_post_processing.py | kensho-technologies/graphql-compiler | 4318443b7b2512a059f3616112bfc40bbf8eec06 | [
"Apache-2.0"
] | 56 | 2017-07-18T23:56:14.000Z | 2021-10-30T08:08:56.000Z | # Copyright 2019-present Kensho Technologies, LLC.
import datetime
from unittest import TestCase
from graphql import GraphQLBoolean, GraphQLFloat, GraphQLID, GraphQLInt, GraphQLList, GraphQLString
from ..compiler.compiler_frontend import OutputMetadata
from ..post_processing.sql_post_processing import post_process_ms... | 30.556364 | 99 | 0.499464 |
663ceeece16a088b079ccd055359298e03ab5eb8 | 32,110 | py | Python | airflow/models/mappedoperator.py | PApostol/airflow | 882535a8a2699af7d1d079ecebd8c31aa7fbaba9 | [
"Apache-2.0"
] | 1 | 2020-01-03T12:13:27.000Z | 2020-01-03T12:13:27.000Z | airflow/models/mappedoperator.py | PApostol/airflow | 882535a8a2699af7d1d079ecebd8c31aa7fbaba9 | [
"Apache-2.0"
] | 1 | 2022-03-08T16:17:19.000Z | 2022-03-08T17:22:52.000Z | airflow/models/mappedoperator.py | PApostol/airflow | 882535a8a2699af7d1d079ecebd8c31aa7fbaba9 | [
"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 file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 38.59375 | 110 | 0.653348 |
072688e3c77eb588671a0b65a0cbdc9e38f17317 | 2,805 | py | Python | psycopg2-master/tests/test_errors.py | HabeshaQueen/Gallery-App | 17f7932e0db95a4750bcccf2302efc2c4cdbca4a | [
"Unlicense"
] | null | null | null | psycopg2-master/tests/test_errors.py | HabeshaQueen/Gallery-App | 17f7932e0db95a4750bcccf2302efc2c4cdbca4a | [
"Unlicense"
] | null | null | null | psycopg2-master/tests/test_errors.py | HabeshaQueen/Gallery-App | 17f7932e0db95a4750bcccf2302efc2c4cdbca4a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# test_errors.py - unit test for psycopg2.errors module
#
# Copyright (C) 2018-2019 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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... | 32.241379 | 73 | 0.693405 |
969d6c0b076d9cdf31bcab33716f343689b8a377 | 2,248 | py | Python | otcextensions/tests/unit/sdk/dcs/v1/test_backup.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 10 | 2018-03-03T17:59:59.000Z | 2020-01-08T10:03:00.000Z | otcextensions/tests/unit/sdk/dcs/v1/test_backup.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 208 | 2020-02-10T08:27:46.000Z | 2022-03-29T15:24:21.000Z | otcextensions/tests/unit/sdk/dcs/v1/test_backup.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 15 | 2020-04-01T20:45:54.000Z | 2022-03-23T12:45:43.000Z | # 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
# distributed under t... | 36.852459 | 77 | 0.695285 |
af98a47e76236dcf3e36869ce5b56df97dfc3b00 | 146 | py | Python | question3.py | XavierBecerra/block3_py_questionnaire | 16b927b9843aaae16330fe2b90f5499b733dc5a3 | [
"Unlicense"
] | null | null | null | question3.py | XavierBecerra/block3_py_questionnaire | 16b927b9843aaae16330fe2b90f5499b733dc5a3 | [
"Unlicense"
] | null | null | null | question3.py | XavierBecerra/block3_py_questionnaire | 16b927b9843aaae16330fe2b90f5499b733dc5a3 | [
"Unlicense"
] | null | null | null | import os
# QUESTION 3
def parse_files(dir, file_type):
file_list = [x for x in os.listdir(dir) if x.endswith(file_type)]
return file_list | 29.2 | 69 | 0.726027 |
17cad2c6f6febb69f075263daf915a7dccc39d05 | 364 | py | Python | qvapay/v1/models/paid_by.py | jorgeajimenezl/qvapay-python | e3fa24ae1be858c65f6816af3d74dabba572e7f0 | [
"MIT"
] | null | null | null | qvapay/v1/models/paid_by.py | jorgeajimenezl/qvapay-python | e3fa24ae1be858c65f6816af3d74dabba572e7f0 | [
"MIT"
] | null | null | null | qvapay/v1/models/paid_by.py | jorgeajimenezl/qvapay-python | e3fa24ae1be858c65f6816af3d74dabba572e7f0 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Any
@dataclass
class PaidBy:
username: str
name: str
logo: str
def __post_init__(self):
self.username = str(self.username)
self.name = str(self.name)
self.logo = str(self.logo)
@staticmethod
def from_json(json: Any)... | 19.157895 | 42 | 0.637363 |
d543960e7a8b1cbe696d64200cfb94399d0df411 | 1,500 | py | Python | climetlab/decorators/__init__.py | rragrawal/climetlab | 3859f5cb05c15edcddb0f528d4c6dbc67fb09bb4 | [
"Apache-2.0"
] | 1 | 2021-10-02T12:30:12.000Z | 2021-10-02T12:30:12.000Z | climetlab/decorators/__init__.py | rragrawal/climetlab | 3859f5cb05c15edcddb0f528d4c6dbc67fb09bb4 | [
"Apache-2.0"
] | null | null | null | climetlab/decorators/__init__.py | rragrawal/climetlab | 3859f5cb05c15edcddb0f528d4c6dbc67fb09bb4 | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2021 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... | 27.272727 | 78 | 0.564667 |
d7d65645651f5c9c59e6c9fc64cbd7f7f0e06482 | 41 | py | Python | src/sage/rings/finite_rings/__init__.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/sage/rings/finite_rings/__init__.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/rings/finite_rings/__init__.py | dimpase/sage | 468f23815ade42a2192b0a9cd378de8fdc594dcd | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | # initialization file for finite fields.
| 20.5 | 40 | 0.804878 |
3602b2c0dd62c599e05bc402c0f20a2025e279fd | 46 | py | Python | test/circle.py | Jahongir2007/pymetry | 02c8e82a188700b4213fd4a70aa66a3b5e9843b8 | [
"MIT"
] | 1 | 2021-04-04T11:38:42.000Z | 2021-04-04T11:38:42.000Z | test/circle.py | Jahongir2007/pymetry | 02c8e82a188700b4213fd4a70aa66a3b5e9843b8 | [
"MIT"
] | null | null | null | test/circle.py | Jahongir2007/pymetry | 02c8e82a188700b4213fd4a70aa66a3b5e9843b8 | [
"MIT"
] | null | null | null | import pymetry
pymetry.circle(60, "brown", 4)
| 15.333333 | 30 | 0.73913 |
a196f3f8dab408c325cd580451198664308bd16f | 3,290 | py | Python | cryton/lib/util/constants.py | slashsec-edu/cryton-core | 30931c276cf1ed239b50cdb96d5711468d361eea | [
"MIT"
] | null | null | null | cryton/lib/util/constants.py | slashsec-edu/cryton-core | 30931c276cf1ed239b50cdb96d5711468d361eea | [
"MIT"
] | null | null | null | cryton/lib/util/constants.py | slashsec-edu/cryton-core | 30931c276cf1ed239b50cdb96d5711468d361eea | [
"MIT"
] | null | null | null | # results
RESULT_OK = 'OK'
RESULT_FAIL = 'FAIL'
RESULT_EXCEPTION = 'EXCEPTION'
RESULT_UNKNOWN = 'UNKNOWN'
RESULT_TERMINATED = 'TERMINATED'
# return codes
CODE_OK = 0
CODE_FAIL = -1
CODE_EXCEPTION = -2
CODE_TERMINATED = -3
# types
RETURN_CODE = 'return_code'
RETURN_VALUE = 'return_value'
STATE = 'state'
RESULT = 'resu... | 25.114504 | 87 | 0.782675 |
66ea5e244a519e1419a88424b50d1d8866a59528 | 7,980 | py | Python | hsv_merge.py | cmarmo/SpaceBlender | 1f60afd83e98dda3f1daf993aaf3ab0dc9910959 | [
"Unlicense"
] | 11 | 2015-10-21T22:43:47.000Z | 2021-06-16T19:26:34.000Z | hsv_merge.py | jlaura/SpaceBlender-1 | 3df6113c026969685c368f73270da883bb603ed2 | [
"Unlicense"
] | 3 | 2015-10-23T01:01:20.000Z | 2018-06-04T20:21:48.000Z | hsv_merge.py | jlaura/SpaceBlender-1 | 3df6113c026969685c368f73270da883bb603ed2 | [
"Unlicense"
] | 13 | 2015-01-27T14:25:55.000Z | 2022-02-23T01:12:59.000Z | #******************************************************************************
# $Id$
#
# Project: GDAL Python Interface
# Purpose: Script to merge greyscale as intensity into an RGB(A) image, for
# instance to apply hillshading to a dem colour relief.
# Author: Frank Warmerdam, warmerdam@pob... | 33.813559 | 86 | 0.607393 |
cca65e3c8b17e6c669347e607aabfb681c1eb307 | 2,560 | py | Python | heuristicFunction.py | AsharFatmi/VeRyPy | 9498682fd90ca35da8e1fe4c1eff458000d50d95 | [
"MIT"
] | null | null | null | heuristicFunction.py | AsharFatmi/VeRyPy | 9498682fd90ca35da8e1fe4c1eff458000d50d95 | [
"MIT"
] | null | null | null | heuristicFunction.py | AsharFatmi/VeRyPy | 9498682fd90ca35da8e1fe4c1eff458000d50d95 | [
"MIT"
] | null | null | null | import json
from classic_heuristics.gillet_miller_sweep import gillet_miller_init
from util import sol2routes
import numpy
from loader import Loader
from flask import jsonify
from kafkaService import kafkaService
__author__ = "Ashar Fatmi"
__maintainer__ = "Ashar Fatmi"
__email__ = "asharfatmi.fatmi@gmail.com"
__statu... | 32 | 129 | 0.649219 |
4edd691ba48266c270eb2aa1ec938d276d0aa779 | 523 | py | Python | string/11.py | domingos2587/Python-ativedade | 2b963a16c4b1669d1829d666794163909430f92f | [
"Unlicense"
] | null | null | null | string/11.py | domingos2587/Python-ativedade | 2b963a16c4b1669d1829d666794163909430f92f | [
"Unlicense"
] | null | null | null | string/11.py | domingos2587/Python-ativedade | 2b963a16c4b1669d1829d666794163909430f92f | [
"Unlicense"
] | null | null | null | palavra=input("Digite a palavra chave: ").upper()
palavra_chave=[]
forca=[]
for i in palavra:
palavra_chave.append(i)
for i in range(0,len(palavra_chave)):
forca.append("_")
acertou=False
while acertou==False:
letra=input("digte um litra: ").upper()
for i in range (0,len(palavra_chave)):
... | 24.904762 | 51 | 0.585086 |
ddeaf60d7edd9d9f05fa7e51983b45de01849bb2 | 5,649 | py | Python | src/apps/devices/cubelib/rgbemulator.py | ajintom/music_sync | 0d7bc302502d28e4be4f0a0be1fc9bafb706f651 | [
"MIT"
] | null | null | null | src/apps/devices/cubelib/rgbemulator.py | ajintom/music_sync | 0d7bc302502d28e4be4f0a0be1fc9bafb706f651 | [
"MIT"
] | null | null | null | src/apps/devices/cubelib/rgbemulator.py | ajintom/music_sync | 0d7bc302502d28e4be4f0a0be1fc9bafb706f651 | [
"MIT"
] | null | null | null | #!/bin/env python
#using the wireframe module downloaded from http://www.petercollingridge.co.uk/
#TODO:
# Convert to RGB emulator.
import rgbwireframe as wireframe
import pygame
from pygame import display
from pygame.draw import *
import time
import numpy
key_to_function = {
pygame.K_LEFT: (lambda x: x.transl... | 33.035088 | 254 | 0.597451 |
e3629282988342f1ab58d975d726826815b8877a | 716 | py | Python | salaryzenaggr/utils/abstracts.py | Frostman/SalaryZenAggregator | 672629d42582ee80ed360dcb44f1767680703e79 | [
"Apache-2.0"
] | null | null | null | salaryzenaggr/utils/abstracts.py | Frostman/SalaryZenAggregator | 672629d42582ee80ed360dcb44f1767680703e79 | [
"Apache-2.0"
] | null | null | null | salaryzenaggr/utils/abstracts.py | Frostman/SalaryZenAggregator | 672629d42582ee80ed360dcb44f1767680703e79 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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, softw... | 26.518519 | 75 | 0.743017 |
d217b217d058867253b955de780be26dfc7f047e | 12,555 | py | Python | release/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py | vic3t3chn0/Bforartists | 7c54a60dd7aa568e20ae7e3778dfef993b61b7b5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-01-18T22:13:24.000Z | 2020-01-18T22:13:24.000Z | release/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py | vic3t3chn0/Bforartists | 7c54a60dd7aa568e20ae7e3778dfef993b61b7b5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py | vic3t3chn0/Bforartists | 7c54a60dd7aa568e20ae7e3778dfef993b61b7b5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright 2018-2019 The glTF-Blender-IO authors.
#
# 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 ... | 44.839286 | 170 | 0.62732 |
dc01115151a1a39c8130ec61abcdc5695565f13e | 5,619 | py | Python | env/Lib/site-packages/azure/storage/blob/models.py | Ammar12/simplebanking | 6080d638b2e98bfcf96d782703e1dce25aebfcbc | [
"MIT"
] | null | null | null | env/Lib/site-packages/azure/storage/blob/models.py | Ammar12/simplebanking | 6080d638b2e98bfcf96d782703e1dce25aebfcbc | [
"MIT"
] | null | null | null | env/Lib/site-packages/azure/storage/blob/models.py | Ammar12/simplebanking | 6080d638b2e98bfcf96d782703e1dce25aebfcbc | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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://w... | 25.084821 | 76 | 0.59281 |
9e659bcd47234cd52fe5a7daa54241926efa476f | 1,351 | py | Python | drf_jsonpatch/patchs/serialiazers.py | yoann9344/drf_jsonpatch | 5000bb05bce539a4089f8f5cd8ecec6ef6ea05ae | [
"MIT"
] | null | null | null | drf_jsonpatch/patchs/serialiazers.py | yoann9344/drf_jsonpatch | 5000bb05bce539a4089f8f5cd8ecec6ef6ea05ae | [
"MIT"
] | null | null | null | drf_jsonpatch/patchs/serialiazers.py | yoann9344/drf_jsonpatch | 5000bb05bce539a4089f8f5cd8ecec6ef6ea05ae | [
"MIT"
] | null | null | null | import ast
import rest_framework.serializers as module_to_patch
from drf_jsonpatch.patcher import Patcher
from drf_jsonpatch.nodes.serialiazers import (
import_jsonpatch,
import_apply_json_patch,
if_apply_jsonpatch,
)
patch = Patcher(module_to_patch)
# ---- import jsonpatch ----
# added between django... | 25.980769 | 76 | 0.746114 |
d79ef7761fb7c7c0a8db5fbdb2ec6ecf4aabd136 | 29,001 | py | Python | runtime/python/Lib/site-packages/numpy/random/tests/test_smoke.py | hwaipy/InteractionFreeNode | 88642b68430f57b028fd0f276a5709f89279e30d | [
"MIT"
] | 1 | 2022-01-08T12:30:44.000Z | 2022-01-08T12:30:44.000Z | runtime/python/Lib/site-packages/numpy/random/tests/test_smoke.py | hwaipy/InteractionFreeNode | 88642b68430f57b028fd0f276a5709f89279e30d | [
"MIT"
] | null | null | null | runtime/python/Lib/site-packages/numpy/random/tests/test_smoke.py | hwaipy/InteractionFreeNode | 88642b68430f57b028fd0f276a5709f89279e30d | [
"MIT"
] | null | null | null | import pickle
from functools import partial
import numpy as np
import pytest
from numpy.testing import assert_equal, assert_, assert_array_equal
from numpy.random import (Generator, MT19937, PCG64, PCG64DXSM, Philox, SFC64)
@pytest.fixture(scope='module',
params=(np.bool_, np.int8, np.int16, ... | 35.410256 | 79 | 0.57598 |
03c0d45886820214ef75d5b906d5d09917107816 | 5,772 | py | Python | GAN/example_run_output.py | maxwerhahn/Multi-pass-GAN | 9d5e86889c3c62bab3d217f76762a68f871db835 | [
"Apache-2.0"
] | 13 | 2019-09-02T09:21:30.000Z | 2022-01-15T21:18:17.000Z | GAN/example_run_output.py | maxwerhahn/Multi-pass-GAN | 9d5e86889c3c62bab3d217f76762a68f871db835 | [
"Apache-2.0"
] | null | null | null | GAN/example_run_output.py | maxwerhahn/Multi-pass-GAN | 9d5e86889c3c62bab3d217f76762a68f871db835 | [
"Apache-2.0"
] | 3 | 2019-10-22T10:21:51.000Z | 2020-10-26T12:48:59.000Z | import os
# 4x multi pass
if 0:
## first nn: test 4
os.system('python multipassGAN-4x.py randSeed 174213111 upRes 4 startIndex 0 out 1 pretrain 0 pretrainDisc 0 tileSize 64 trainingIterations 60000 lambda 5.0 lambda2 0.00001 discRuns 2 genRuns 2 alwaysSave 1 fromSim 1005 toSim 1005 outputInterval 200 genTestImg 1 dr... | 80.166667 | 914 | 0.776334 |
edc5db68170f36611298519f15b7d8b8dd3b2e5e | 3,920 | py | Python | douyin-bot.py | cleverchao/Douyin-Bot | 6a6d04c9a7518fab4fdc594bce5189d456062a46 | [
"MIT"
] | null | null | null | douyin-bot.py | cleverchao/Douyin-Bot | 6a6d04c9a7518fab4fdc594bce5189d456062a46 | [
"MIT"
] | null | null | null | douyin-bot.py | cleverchao/Douyin-Bot | 6a6d04c9a7518fab4fdc594bce5189d456062a46 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import random
import time
from PIL import Image
if sys.version_info.major != 3:
print('Please run under Python3')
exit(1)
try:
from common import debug, config, screenshot, UnicodeStreamFilter
from common.auto_adb import auto_adb
from common import apiutil
fr... | 22.4 | 101 | 0.535459 |
dce971f51efe39249edeec01807fb81466c3d2b1 | 70 | py | Python | master-node-docker/sentinel/helpers/__init__.py | 14avengers/sentinel | 825768d2242ad28896c41684bc08e8527cdf2f30 | [
"MIT"
] | null | null | null | master-node-docker/sentinel/helpers/__init__.py | 14avengers/sentinel | 825768d2242ad28896c41684bc08e8527cdf2f30 | [
"MIT"
] | null | null | null | master-node-docker/sentinel/helpers/__init__.py | 14avengers/sentinel | 825768d2242ad28896c41684bc08e8527cdf2f30 | [
"MIT"
] | null | null | null | # coding=utf-8
from .eth import eth_helper
from .tokens import tokens
| 17.5 | 27 | 0.785714 |
6dba42e40ffeb9ce1f1a95c617e20add1f449568 | 1,590 | py | Python | launchers/local/xrd.py | DunstanBecht/lpa-workspace | 316db41fed08f856c376e7f8e2ff92f2af5ecf7d | [
"CC0-1.0"
] | null | null | null | launchers/local/xrd.py | DunstanBecht/lpa-workspace | 316db41fed08f856c376e7f8e2ff92f2af5ecf7d | [
"CC0-1.0"
] | null | null | null | launchers/local/xrd.py | DunstanBecht/lpa-workspace | 316db41fed08f856c376e7f8e2ff92f2af5ecf7d | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
Run the X-ray diffraction simulations.
"""
import numpy as np
import os
import time
from lpa.xrd import run, code
def steps(impdir, impstm):
"""Return the number of Fourier coefficients to generate."""
pth = os.path.join(impdir, impstm)
if os.path.isdir(pth):
... | 26.065574 | 75 | 0.545912 |
7c399ee3f2b88d55562d48cc0eb8e347f8794df2 | 553 | py | Python | analysis_engine/write_to_file.py | virdesai/stock-analysis-engine | 0ca501277c632150717ca499121a34f8f8c71ccb | [
"Apache-2.0"
] | 819 | 2018-09-16T20:33:11.000Z | 2022-03-30T21:18:23.000Z | analysis_engine/write_to_file.py | gvpathi/stock-analysis-engine | 0ca501277c632150717ca499121a34f8f8c71ccb | [
"Apache-2.0"
] | 14 | 2018-09-16T20:52:25.000Z | 2020-09-06T12:36:36.000Z | analysis_engine/write_to_file.py | gvpathi/stock-analysis-engine | 0ca501277c632150717ca499121a34f8f8c71ccb | [
"Apache-2.0"
] | 226 | 2018-09-16T20:04:32.000Z | 2022-03-31T01:41:14.000Z | """
Helper for writing to a file - used by unittests
"""
import os
import json
def write_to_file(
output_file,
data):
"""write_to_file
write ``data`` to the ``output_file`` file
:param output_file: path to file
:param data: string contents for ``output_file``
"""
use_str = d... | 19.068966 | 52 | 0.631103 |
6a8ece8125324e2c75fb52deeccc53562e49cc8b | 3,503 | py | Python | src/rosdep2/platforms/gem.py | suddrey-qut/rosdep | be780c45312b562f461fd7d2f06232e4e66df1aa | [
"BSD-3-Clause"
] | 46 | 2015-01-28T07:18:26.000Z | 2022-03-22T09:54:20.000Z | src/rosdep2/platforms/gem.py | tianbot/rosdep | 24c8c76a8cb99b08285192013a165f30af0f5232 | [
"BSD-3-Clause"
] | 491 | 2015-01-06T00:36:20.000Z | 2022-03-30T11:44:28.000Z | src/rosdep2/platforms/gem.py | tianbot/rosdep | 24c8c76a8cb99b08285192013a165f30af0f5232 | [
"BSD-3-Clause"
] | 141 | 2015-01-14T04:10:36.000Z | 2022-02-20T00:17:33.000Z | # Copyright (c) 2009, Willow Garage, Inc.
# Copyright (c) 2012, Intermodalics, BVBA.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above ... | 36.489583 | 95 | 0.715387 |
2db44be20cd2dfcce30c05be1c90fc64849e728b | 4,091 | py | Python | setup.py | simonbray/duck | 6af5c75942eb1d368337addc7e74fabcfb2452aa | [
"Apache-2.0"
] | null | null | null | setup.py | simonbray/duck | 6af5c75942eb1d368337addc7e74fabcfb2452aa | [
"Apache-2.0"
] | null | null | null | setup.py | simonbray/duck | 6af5c75942eb1d368337addc7e74fabcfb2452aa | [
"Apache-2.0"
] | 3 | 2020-12-10T12:16:34.000Z | 2020-12-10T12:44:24.000Z |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.rst"), encoding="utf-8") as ... | 43.521277 | 94 | 0.668296 |
3e1bdcf56f8ce7b4f7350fcb31a0afc0988a41fe | 5,443 | py | Python | records_mover/db/postgres/sqlalchemy_postgres_copy.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 36 | 2020-03-17T11:56:51.000Z | 2022-01-19T16:03:32.000Z | records_mover/db/postgres/sqlalchemy_postgres_copy.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 60 | 2020-03-02T23:13:29.000Z | 2021-05-19T15:05:42.000Z | records_mover/db/postgres/sqlalchemy_postgres_copy.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 4 | 2020-08-11T13:17:37.000Z | 2021-11-05T21:11:52.000Z | # This file is vendored from
# https://raw.githubusercontent.com/jmcarp/sqlalchemy-postgres-copy/01ef522e8e46a6961e227069d465b0cb93e42383/postgres_copy/__init__.py
#
# See https://github.com/jmcarp/sqlalchemy-postgres-copy/pull/14 to
# address the issue on why we had to vendor it instead of creating a
# transitive dpee... | 35.344156 | 134 | 0.684916 |
7ed5903b53ac190dd81c2145b367158267e859ba | 15,693 | py | Python | examples/acados_python/pmsm_example/main.py | mindThomas/acados | 90d75386cad9f2b16115cce04685e90934c0f7d8 | [
"BSD-2-Clause"
] | 1 | 2021-06-29T05:02:24.000Z | 2021-06-29T05:02:24.000Z | examples/acados_python/pmsm_example/main.py | krepa098/acados | f4c6311f7a0cf3736afa7e3b40fac7e53e4324cb | [
"BSD-2-Clause"
] | 7 | 2018-02-23T17:00:52.000Z | 2018-12-11T13:52:24.000Z | examples/acados_python/pmsm_example/main.py | krepa098/acados | f4c6311f7a0cf3736afa7e3b40fac7e53e4324cb | [
"BSD-2-Clause"
] | 1 | 2021-03-04T05:00:20.000Z | 2021-03-04T05:00:20.000Z | from acados_template import *
import numpy as nmp
from ctypes import *
import matplotlib
import matplotlib.pyplot as plt
import scipy.linalg
CODE_GEN = 1
COMPILE = 1
FORMULATION = 1 # Tracking MPC
# ===================
# 0 for hexagon (no terminalset)
... | 26.37479 | 111 | 0.576881 |
2dadc136167bc5fb473c074d732960f5e0a0cae7 | 1,044 | py | Python | script/copy_firmware.py | jinjorge/gravitymon | 8d51c5ad128169caea65a1741be31418df6c31fd | [
"MIT"
] | null | null | null | script/copy_firmware.py | jinjorge/gravitymon | 8d51c5ad128169caea65a1741be31418df6c31fd | [
"MIT"
] | null | null | null | script/copy_firmware.py | jinjorge/gravitymon | 8d51c5ad128169caea65a1741be31418df6c31fd | [
"MIT"
] | null | null | null | Import("env")
import shutil
def get_build_flag_value(flag_name):
build_flags = env.ParseFlags(env['BUILD_FLAGS'])
flags_with_value_list = [build_flag for build_flag in build_flags.get('CPPDEFINES') if type(build_flag) == list]
defines = {k: v for (k, v) in flags_with_value_list}
return defines.get(flag... | 36 | 116 | 0.639847 |
7aaf6ebca72a904663840643fdf5a297965753d6 | 7,828 | py | Python | fhir/resources/researchsubject.py | chgl/fhir.resources | 35b22314642640c0b25960ab5b2855e7c51749ef | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/researchsubject.py | chgl/fhir.resources | 35b22314642640c0b25960ab5b2855e7c51749ef | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/researchsubject.py | chgl/fhir.resources | 35b22314642640c0b25960ab5b2855e7c51749ef | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/ResearchSubject
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import typing
from pydantic import Field, root_validator
from pydantic.error_wrappers import ErrorWrapper, ValidationError
from py... | 37.634615 | 93 | 0.598109 |
24392425fd18faeea999a1d7e49c9800903930a1 | 24,574 | py | Python | src/djmarinara/djmarinara.py | maseca/djmarinara | 04b018f4df193e867e5e74c226ced25a5e510a73 | [
"Unlicense"
] | null | null | null | src/djmarinara/djmarinara.py | maseca/djmarinara | 04b018f4df193e867e5e74c226ced25a5e510a73 | [
"Unlicense"
] | null | null | null | src/djmarinara/djmarinara.py | maseca/djmarinara | 04b018f4df193e867e5e74c226ced25a5e510a73 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""Automatically pre-renders a queue of videos for live streaming.
djmarinara does the following:
1) Polls a URL to obtain a list of URLs of songs.
2) Chooses a song URL at random.
3) Generates a video from the song, with visualizer output and song text (ID3 tags, etc.)
4) Manages playlist files ... | 46.018727 | 448 | 0.514365 |
c1f4dedf9f67765a4b4783bd91c970f6d27c1a72 | 249 | py | Python | L3/prac4.py | Gaurav3099/Python | bd53dab7692dd60e719285a29d3f2f22c6073702 | [
"MIT"
] | null | null | null | L3/prac4.py | Gaurav3099/Python | bd53dab7692dd60e719285a29d3f2f22c6073702 | [
"MIT"
] | null | null | null | L3/prac4.py | Gaurav3099/Python | bd53dab7692dd60e719285a29d3f2f22c6073702 | [
"MIT"
] | null | null | null | #WAPP to check wheather two string are anagram
s1=input("enter first string ")
s2=input("enter second string ")
st1=sorted(s1)
st2=sorted(s2)
print(st1)
print(st2)
if(st1 == st2):
print("yes they are anagram")
else:
print("they are not") | 22.636364 | 47 | 0.690763 |
1d6529166c7db2537afc5b04a5e7154f65b02ba9 | 1,968 | py | Python | 2_evaluative_feedback/optimistic_initial_values.py | agaitanis/reinforcement_learning | fca31b584c6ffc090abefd6ef59fe3da7c44841f | [
"MIT"
] | 3 | 2019-02-07T14:37:02.000Z | 2019-11-09T06:34:34.000Z | 2_evaluative_feedback/optimistic_initial_values.py | agaitanis/reinforcement_learning | fca31b584c6ffc090abefd6ef59fe3da7c44841f | [
"MIT"
] | null | null | null | 2_evaluative_feedback/optimistic_initial_values.py | agaitanis/reinforcement_learning | fca31b584c6ffc090abefd6ef59fe3da7c44841f | [
"MIT"
] | 1 | 2019-11-09T06:45:26.000Z | 2019-11-09T06:45:26.000Z | '''
Reinforcement Learning by Sutton and Barto
2. Evaluative Feedback
2.7 Optimistic Initial Values
'''
import numpy as np
import matplotlib.pyplot as plt
class Agent(object):
def __init__(self, n, eps, Q0, alpha):
self.n = n
self.eps = eps
self.alpha = alpha
self.Q = np.full(n, Q0... | 26.24 | 68 | 0.563516 |
111c5b1286557d763ca839da55f51c94bf2a3d62 | 3,064 | py | Python | h2o-py/tests/testdir_pipeline/pyunit_scale_pca_rf.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_pipeline/pyunit_scale_pca_rf.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_pipeline/pyunit_scale_pca_rf.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def scale_pca_rf_pipe():
from h2o.transforms.preprocessing import H2OScaler
from h2o.transforms.decomposition import H2OPCA
from h2o.estimators.random_forest import H2ORandomForestEstimator
from sklearn.pipeline import Pipeline
... | 40.315789 | 144 | 0.725522 |
0c4eb2b1333a0df3db3411a2cfc7fb66ec60fcf7 | 3,311 | py | Python | app/app/settings.py | NixNotCastey/recepie-app-api | 1fe77f17162e23f59c69de3dc6b1dccd99ac6eaf | [
"MIT"
] | null | null | null | app/app/settings.py | NixNotCastey/recepie-app-api | 1fe77f17162e23f59c69de3dc6b1dccd99ac6eaf | [
"MIT"
] | null | null | null | app/app/settings.py | NixNotCastey/recepie-app-api | 1fe77f17162e23f59c69de3dc6b1dccd99ac6eaf | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Bui... | 25.666667 | 91 | 0.687708 |
6cc9a87a5bff948d560ea04b4258a6c2022ae849 | 769 | py | Python | http.server/do_POST/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | http.server/do_POST/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | http.server/do_POST/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z |
# date: 2019.04.14
# https://stackoverflow.com/questions/55672653/python-http-server-not-responding-on-post-and-get-requests/55672850#55672850
import http.server
import socketserver
class MyHandler(http.server.BaseHTTPRequestHandler):
def do_POST(self):
print("POST received")
#TODO: get POST data
... | 26.517241 | 123 | 0.690507 |
418c46306db508797785169f7844a147acb3f2cf | 5,107 | py | Python | memory/free.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 7 | 2022-01-15T02:53:53.000Z | 2022-02-17T00:51:32.000Z | memory/free.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 8 | 2022-01-16T02:45:24.000Z | 2022-03-21T02:08:27.000Z | memory/free.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 5 | 2022-01-15T02:53:38.000Z | 2022-01-19T17:42:10.000Z | from memory.space import BANK_SIZE, Free
# https://www.ff6hacking.com/wiki/doku.php?id=ff3:ff3us:doc:asm:rom_map
# https://www.ff6hacking.com/wiki/doku.php?id=ff3:ff3us:doc:asm:rom_map:unused_space
spaces = [
(0x00d613, 0x00df9f),
(0x00ec20, 0x00ee9f),
(0x00fcab, 0x00fcff),
(0x00ff18, 0x00ffaf),
(0... | 41.520325 | 107 | 0.686313 |
acef856fb849232455eee5e4fc38c84906d20090 | 902 | py | Python | darts/__init__.py | muliliao/darts | 2b5f5c3aa81c6962f4d0d2ba5f280d42f5dc5eb0 | [
"Apache-2.0"
] | null | null | null | darts/__init__.py | muliliao/darts | 2b5f5c3aa81c6962f4d0d2ba5f280d42f5dc5eb0 | [
"Apache-2.0"
] | null | null | null | darts/__init__.py | muliliao/darts | 2b5f5c3aa81c6962f4d0d2ba5f280d42f5dc5eb0 | [
"Apache-2.0"
] | null | null | null | """
darts
-----
"""
from .timeseries import TimeSeries
import matplotlib as mpl
from matplotlib import cycler
__version__ = '0.9.0'
colors = cycler(color=['black', '003DFD', 'b512b8', '11a9ba', '0d780f', 'f77f07', 'ba0f0f'])
u8plots_mplstyle = {
'font.family' : 'sans serif',
'axes.edgecolor' : 'black',
... | 22.55 | 92 | 0.613082 |
fa0f1f90351ca5defea3d1bab162502514c10429 | 7,408 | py | Python | vulnerabilities/importers/istio.py | imnitishng/vulnerablecode | a3e98c29b0905a055976d1ef3a78cec4e4e01ded | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/istio.py | imnitishng/vulnerablecode | a3e98c29b0905a055976d1ef3a78cec4e4e01ded | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/istio.py | imnitishng/vulnerablecode | a3e98c29b0905a055976d1ef3a78cec4e4e01ded | [
"Apache-2.0"
] | null | null | null | # Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in compliance ... | 37.04 | 93 | 0.608126 |
5ec135e4fda373aedd09733305022b6f30139925 | 6,859 | py | Python | Text/TextQualityWatchdog/Watchdog/Util/TikaExtract.py | iii-PaulCridland/azure-search-power-skills | bbc5848c32b3bd6f2c8942693d854563e0cee708 | [
"MIT"
] | 128 | 2019-06-12T19:24:34.000Z | 2022-03-08T18:39:40.000Z | Text/TextQualityWatchdog/Watchdog/Util/TikaExtract.py | iii-PaulCridland/azure-search-power-skills | bbc5848c32b3bd6f2c8942693d854563e0cee708 | [
"MIT"
] | 47 | 2019-07-15T22:04:23.000Z | 2022-03-04T18:35:57.000Z | Text/TextQualityWatchdog/Watchdog/Util/TikaExtract.py | iii-PaulCridland/azure-search-power-skills | bbc5848c32b3bd6f2c8942693d854563e0cee708 | [
"MIT"
] | 99 | 2019-06-28T20:56:21.000Z | 2022-03-30T17:17:24.000Z | ###
# This script is used to crawl a source directory for unstructured files (PDFs, PPTs, etc.),
# send requests to the Tika server, and save the extracted text files in a destination directory.
# Currently, non-English files are filtered out.
#
# Please note that the original use case for this helper script was to ext... | 37.075676 | 107 | 0.677941 |
080550a94610d2a8e28ea905a60a2aab01302df1 | 1,366 | py | Python | mianjing/google/family_tree.py | RENHANFEI/LintCode | d572dee248ba4c2a95b52cd737d76c7297f4e7b4 | [
"CNRI-Python"
] | null | null | null | mianjing/google/family_tree.py | RENHANFEI/LintCode | d572dee248ba4c2a95b52cd737d76c7297f4e7b4 | [
"CNRI-Python"
] | null | null | null | mianjing/google/family_tree.py | RENHANFEI/LintCode | d572dee248ba4c2a95b52cd737d76c7297f4e7b4 | [
"CNRI-Python"
] | null | null | null | class Node(object):
def __init__(self, name, alive=True):
self.name = name
self.alive = alive
self.children = []
class FamilyTree(object):
def __init__(self):
self.root = Node(name='root', alive=False)
self.nodes_hash = {'root':self.root}
self.succession = []
... | 25.296296 | 50 | 0.596633 |
22e57ce7625d588daa28361344c4869d255fe0d8 | 1,107 | py | Python | geni-lib/samples/ps103.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | geni-lib/samples/ps103.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | geni-lib/samples/ps103.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | # Copyright (c) 2016 Barnstormer Softworks, Ltd.
# 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/.
import geni.rspec.pg as PG
DISK_IMAGE = "urn:publicid:IDN+instageni.... | 38.172414 | 128 | 0.700994 |
932d89fd7611518436db59af4160b2fb99512b1e | 37,763 | py | Python | tests/minimal/parent/test_parent.py | InscriptaLabs/BioCantor | e0b240480e229c28d3e12ba629d80ae2e397fa8f | [
"MIT"
] | 19 | 2021-04-20T04:11:30.000Z | 2021-10-11T14:48:57.000Z | tests/minimal/parent/test_parent.py | InscriptaLabs/BioCantor | e0b240480e229c28d3e12ba629d80ae2e397fa8f | [
"MIT"
] | 1 | 2021-08-10T23:13:38.000Z | 2021-08-11T18:45:45.000Z | tests/minimal/parent/test_parent.py | InscriptaLabs/BioCantor | e0b240480e229c28d3e12ba629d80ae2e397fa8f | [
"MIT"
] | 2 | 2021-08-02T08:14:35.000Z | 2021-09-15T19:30:38.000Z | import pytest
from inscripta.biocantor.exc import (
NoSuchAncestorException,
InvalidStrandException,
InvalidPositionException,
NullParentException,
MismatchedParentException,
ParentException,
LocationException,
)
from inscripta.biocantor.location.location_impl import (
SingleInterval,
... | 35.424953 | 119 | 0.425178 |
5a71de8d1117ac2e152147f3a1add63508833c15 | 1,543 | py | Python | tests/list_importer.py | mar10/fabulist | 4491129fb10f517741f970cde535391d82830394 | [
"MIT"
] | 10 | 2017-08-06T18:08:00.000Z | 2022-03-14T03:44:15.000Z | tests/list_importer.py | mar10/fabulist | 4491129fb10f517741f970cde535391d82830394 | [
"MIT"
] | 5 | 2021-02-10T02:32:22.000Z | 2021-04-01T16:26:32.000Z | tests/list_importer.py | mar10/fabulist | 4491129fb10f517741f970cde535391d82830394 | [
"MIT"
] | 1 | 2020-09-12T01:14:47.000Z | 2020-09-12T01:14:47.000Z | """
Import a plain text file, add tags to the existing words or add new words altogether.
"""
import os
from fabulist import Fabulist
def merge_word_list_for_tag(src_path, dest_path=None, create_new_entries=False):
if dest_path is None:
dest_path = src_path + ".out"
fab = Fabulist()
fab.load()
... | 32.145833 | 87 | 0.570966 |
bbd7026a013cbe77536707d29054cdd449205961 | 908 | py | Python | CrossData/API/genre_data.py | fga-eps-mds/2018.2-Grupo5 | 66a2bc72430d89f2c68b4d776f94e547d1ecfb3d | [
"MIT"
] | null | null | null | CrossData/API/genre_data.py | fga-eps-mds/2018.2-Grupo5 | 66a2bc72430d89f2c68b4d776f94e547d1ecfb3d | [
"MIT"
] | null | null | null | CrossData/API/genre_data.py | fga-eps-mds/2018.2-Grupo5 | 66a2bc72430d89f2c68b4d776f94e547d1ecfb3d | [
"MIT"
] | null | null | null | import requests
from rest_framework.response import Response
from rest_framework.views import APIView
from CrossData.API.models import *
from CrossData.API.serializers import *
from operator import itemgetter
class GetGenreColors(APIView):
def get(self, request, format=None):
genre_name = request.GET.get(... | 31.310345 | 77 | 0.682819 |
4355dc88b3510a211087b4df4c5f74a1570e4640 | 4,059 | py | Python | sdk/python/pulumi_azure_nextgen/insights/latest/__init__.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/insights/latest/__init__.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/insights/latest/__init__.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.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! ***
# Export this package's modules as members:
from ._enums import *
from .action_group import *
from .activity_log_alert import *
from .alert_rule import... | 44.604396 | 97 | 0.69968 |
c5d777d79b32404296414a2b9f211a442736cd32 | 6,384 | py | Python | tests/test_feedforward.py | bmcmenamin/model_wrangler | c5471cc106d475c50bf26791b913f2d556a1de0a | [
"MIT"
] | null | null | null | tests/test_feedforward.py | bmcmenamin/model_wrangler | c5471cc106d475c50bf26791b913f2d556a1de0a | [
"MIT"
] | null | null | null | tests/test_feedforward.py | bmcmenamin/model_wrangler | c5471cc106d475c50bf26791b913f2d556a1de0a | [
"MIT"
] | 1 | 2018-01-23T23:26:15.000Z | 2018-01-23T23:26:15.000Z | """End to end testing on feedforward models"""
# pylint: disable=C0103
# pylint: disable=C0325
# pylint: disable=E1101
import numpy as np
from scipy.stats import zscore
from model_wrangler.model_wrangler import ModelWrangler
from model_wrangler.dataset_managers import DatasetManager
from model_wrangler.model.loss... | 27.756522 | 95 | 0.551848 |
3e51b0819e1faaf44c79281f80669916df507dd9 | 30,740 | py | Python | gym_electric_motor/core.py | 54hanxiucao/gym-electric-motor | 911432388b00675e8a93f4a7937fdc575f106f22 | [
"MIT"
] | 1 | 2021-03-29T07:47:32.000Z | 2021-03-29T07:47:32.000Z | gym_electric_motor/core.py | 54hanxiucao/gym-electric-motor | 911432388b00675e8a93f4a7937fdc575f106f22 | [
"MIT"
] | null | null | null | gym_electric_motor/core.py | 54hanxiucao/gym-electric-motor | 911432388b00675e8a93f4a7937fdc575f106f22 | [
"MIT"
] | null | null | null | """
On the core level the electric motor environment and the interface to its submodules are defined. By using these
interfaces further reference generators, reward functions, visualizations or physical models can be implemented.
Each ElectricMotorEnvironment contains the five following modules:
* PhysicalSyste... | 42.873082 | 121 | 0.653058 |
d31da80c1185f44f1d6e96eb57c1e4960be56338 | 3,540 | py | Python | dev_nbs/course/lesson3-camvid.py | huangyingw/fastai_fastai | 68ff76a21b2f70f44fb91885abcb73c1c213ec1a | [
"Apache-2.0"
] | 1 | 2022-02-06T22:11:10.000Z | 2022-02-06T22:11:10.000Z | dev_nbs/course/lesson3-camvid.py | huangyingw/fastai_fastai | 68ff76a21b2f70f44fb91885abcb73c1c213ec1a | [
"Apache-2.0"
] | null | null | null | dev_nbs/course/lesson3-camvid.py | huangyingw/fastai_fastai | 68ff76a21b2f70f44fb91885abcb73c1c213ec1a | [
"Apache-2.0"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,py
# split_at_heading: true
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# ... | 19.344262 | 127 | 0.661017 |
d5833c429c70301abe44bc893aa7a1ecb4c26ecb | 3,865 | py | Python | commandment/dep/__init__.py | sreyemnayr/commandment | addfe4bad7abd501fd0fa6facde783dc6fe730d4 | [
"MIT"
] | null | null | null | commandment/dep/__init__.py | sreyemnayr/commandment | addfe4bad7abd501fd0fa6facde783dc6fe730d4 | [
"MIT"
] | null | null | null | commandment/dep/__init__.py | sreyemnayr/commandment | addfe4bad7abd501fd0fa6facde783dc6fe730d4 | [
"MIT"
] | null | null | null | from typing import Set, Dict
from enum import Enum
class SetupAssistantStep(Enum):
"""This enumeration contains all possible steps of Setup Assistant that can be skipped.
See Also:
- `DEP Web Services: Define Profile <https://developer.apple.com/library/content/documentation/Miscellaneous/Reference... | 36.809524 | 250 | 0.684347 |
cd6d97942c078406e019dd1545889dbfd9b99381 | 13,368 | py | Python | pynamodb/expressions/operand.py | jovana/PynamoDB | e5e2ff3aa0856ee08f39dd2591d3a5b0a038bf66 | [
"MIT"
] | null | null | null | pynamodb/expressions/operand.py | jovana/PynamoDB | e5e2ff3aa0856ee08f39dd2591d3a5b0a038bf66 | [
"MIT"
] | null | null | null | pynamodb/expressions/operand.py | jovana/PynamoDB | e5e2ff3aa0856ee08f39dd2591d3a5b0a038bf66 | [
"MIT"
] | null | null | null | from typing import Any, Dict, List, Optional, Union
from typing import TYPE_CHECKING
from pynamodb.constants import (
ATTRIBUTE_TYPES, BINARY_SET, LIST, MAP, NUMBER, NUMBER_SET, STRING, STRING_SET
)
from pynamodb.expressions.condition import (
BeginsWith, Between, Comparison, Contains, Exists, In, IsType, NotE... | 38.860465 | 120 | 0.671828 |
d939e0a21f19ad9edb9875a51196540f696fddad | 1,834 | py | Python | manim/mobject/frame.py | philschatz/manim | e3359a571d9a02a08979b3e037ddada3e874eb7c | [
"MIT"
] | 2 | 2021-08-22T14:51:53.000Z | 2021-10-17T16:01:24.000Z | manim/mobject/frame.py | philschatz/manim | e3359a571d9a02a08979b3e037ddada3e874eb7c | [
"MIT"
] | 3 | 2021-04-28T14:44:39.000Z | 2021-04-28T15:32:43.000Z | manim/mobject/frame.py | philschatz/manim | e3359a571d9a02a08979b3e037ddada3e874eb7c | [
"MIT"
] | 1 | 2021-08-23T06:57:07.000Z | 2021-08-23T06:57:07.000Z | """Special rectangles."""
__all__ = [
"ScreenRectangle",
"FullScreenRectangle",
"FullScreenFadeRectangle",
"PictureInPictureFrame",
]
from .. import config
from ..constants import *
from ..mobject.geometry import Rectangle
from ..utils.color import BLACK
class ScreenRectangle(Rectangle):
def __... | 26.2 | 86 | 0.663032 |
b6b40d2323fa7e1e54397b12b8df141a427f8af0 | 1,077 | py | Python | day_13/test_transparent_origami.py | jandolezal/advent-of-code-2021 | 9bd6ce3f1379bf23f84e436abe6b45629428f990 | [
"MIT"
] | null | null | null | day_13/test_transparent_origami.py | jandolezal/advent-of-code-2021 | 9bd6ce3f1379bf23f84e436abe6b45629428f990 | [
"MIT"
] | null | null | null | day_13/test_transparent_origami.py | jandolezal/advent-of-code-2021 | 9bd6ce3f1379bf23f84e436abe6b45629428f990 | [
"MIT"
] | null | null | null | import unittest
from day_13.transparent_origami import load_input, split, part1
class TestTransparentOrigami(unittest.TestCase):
def test_loading_input(self):
dots, instructions = load_input('day_13/test_input.txt')
assert len(dots) == 18
assert dots[0] == (3,0)
assert dots[-... | 28.342105 | 64 | 0.626741 |
bd927a45f9eb640578ce229ad7f919e316b9069b | 10,683 | py | Python | handson/probe.py | jtonello/ceph-auto-aws | 433d6519af93ff4fc2312ce80e0125e8bc9264dd | [
"BSD-3-Clause"
] | 26 | 2016-04-03T07:41:34.000Z | 2021-12-01T19:45:54.000Z | handson/probe.py | jtonello/ceph-auto-aws | 433d6519af93ff4fc2312ce80e0125e8bc9264dd | [
"BSD-3-Clause"
] | 35 | 2016-03-31T16:37:51.000Z | 2018-02-12T09:52:56.000Z | handson/probe.py | jtonello/ceph-auto-aws | 433d6519af93ff4fc2312ce80e0125e8bc9264dd | [
"BSD-3-Clause"
] | 9 | 2016-09-19T09:04:07.000Z | 2022-03-29T08:31:01.000Z | #
# Copyright (c) 2016, SUSE LLC All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | 29.348901 | 79 | 0.574745 |
150dac56474fe30d514ee6c7eb34db6071dcad95 | 1,504 | py | Python | some_bandits/bandits/egreedy.py | EGAlberts/some_bandits | 99ee49e74c85ede2d941932396245c441a4b7e9b | [
"MIT"
] | null | null | null | some_bandits/bandits/egreedy.py | EGAlberts/some_bandits | 99ee49e74c85ede2d941932396245c441a4b7e9b | [
"MIT"
] | null | null | null | some_bandits/bandits/egreedy.py | EGAlberts/some_bandits | 99ee49e74c85ede2d941932396245c441a4b7e9b | [
"MIT"
] | 1 | 2022-03-23T03:40:11.000Z | 2022-03-23T03:40:11.000Z |
import numpy as np
import time
from some_bandits.utilities import calculate_utility, convert_conf
from some_bandits.bandit_options import bandit_args
from some_bandits.bandits.Bandit import Bandit
DECAY_RATE = 1
REWARD = 0
ACTION = 1
class egreedy(Bandit):
def __init__(self, formula):
super().__init__("e... | 25.491525 | 90 | 0.652261 |
65694ae205c78c66aa4cc7cd9779a35cb8efae2b | 1,061 | py | Python | pyrpc/views.py | louisliv/pyrpc | dfce14b20c0ee06b941e8af98f3605963fe9630e | [
"BSD-3-Clause"
] | null | null | null | pyrpc/views.py | louisliv/pyrpc | dfce14b20c0ee06b941e8af98f3605963fe9630e | [
"BSD-3-Clause"
] | null | null | null | pyrpc/views.py | louisliv/pyrpc | dfce14b20c0ee06b941e8af98f3605963fe9630e | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets,status
from rest_framework.response import Response
from pyrpc.serializers import (MethodSerializer,
ErrorSerializer, ResultSerializer)
from pyrpc.store import store
from pyrpc.utils import (INVALID_REQUEST,
INVALID_PARAMS, METHOD_NOT_FOUN... | 31.205882 | 62 | 0.683318 |
6c733e0e1a8e904c51c1d352f03548a3b23d3ffa | 1,072 | bzl | Python | google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl | joezqren/google-cloud-cpp | 325d312b0a21569f3c57515aec7d91f3540d3b48 | [
"Apache-2.0"
] | 299 | 2019-01-31T12:17:56.000Z | 2022-03-30T15:46:15.000Z | google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl | joezqren/google-cloud-cpp | 325d312b0a21569f3c57515aec7d91f3540d3b48 | [
"Apache-2.0"
] | 6,560 | 2019-01-29T03:15:15.000Z | 2022-03-31T23:58:48.000Z | google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl | joezqren/google-cloud-cpp | 325d312b0a21569f3c57515aec7d91f3540d3b48 | [
"Apache-2.0"
] | 253 | 2019-02-07T01:18:13.000Z | 2022-03-30T17:21:10.000Z | # Copyright 2019 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.965517 | 92 | 0.770522 |
27c827bc21bddf119d6b5cb1027c6c99a6596caf | 1,876 | py | Python | demo.py | Nadia2Imtiaz/ML_Algo | bf40761318422710c1f00a5daa56e58ab300335e | [
"MIT"
] | 296 | 2017-01-18T22:49:03.000Z | 2022-03-29T09:52:33.000Z | demo.py | Nadia2Imtiaz/ML_Algo | bf40761318422710c1f00a5daa56e58ab300335e | [
"MIT"
] | 15 | 2017-01-30T14:30:33.000Z | 2021-01-02T11:10:14.000Z | demo.py | Nadia2Imtiaz/ML_Algo | bf40761318422710c1f00a5daa56e58ab300335e | [
"MIT"
] | 670 | 2017-01-18T19:42:04.000Z | 2022-03-18T23:21:18.000Z | #The optimal values of m and b can be actually calculated with way less effort than doing a linear regression.
#this is just to demonstrate gradient descent
from numpy import *
# y = mx + b
# m is slope, b is y-intercept
def compute_error_for_line_given_points(b, m, points):
totalError = 0
for i in range(0, ... | 38.285714 | 166 | 0.652985 |
13153ab17b9722ff57567decdc3f238ba39266b0 | 3,657 | py | Python | FileShare/settings.py | vsc-squared/handballAttendance | 70806b598dfdab610120c87f80561f42a2301798 | [
"MIT"
] | null | null | null | FileShare/settings.py | vsc-squared/handballAttendance | 70806b598dfdab610120c87f80561f42a2301798 | [
"MIT"
] | null | null | null | FileShare/settings.py | vsc-squared/handballAttendance | 70806b598dfdab610120c87f80561f42a2301798 | [
"MIT"
] | null | null | null | """
Django settings for FileShare project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | 26.121429 | 91 | 0.686628 |
6e857ca07407b9a842299105f0a39c03ec14b53e | 4,058 | py | Python | django/contrib/gis/gdal/feature.py | rajeshkumarkarra/django | 1a85b07bddbf43da00311bdbb3ef5519a3165dc6 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2018-11-28T17:54:55.000Z | 2018-11-28T17:54:55.000Z | django/contrib/gis/gdal/feature.py | rajeshkumarkarra/django | 1a85b07bddbf43da00311bdbb3ef5519a3165dc6 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/gdal/feature.py | rajeshkumarkarra/django | 1a85b07bddbf43da00311bdbb3ef5519a3165dc6 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2021-11-30T07:43:44.000Z | 2021-11-30T07:43:44.000Z | from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
fro... | 33.53719 | 84 | 0.635535 |
7f8dc67d585101b5b8e1bb738d00fbeb7fa08007 | 452 | py | Python | Capitulo_02/exercise2_6.py | thiagosouzalink/my_codes-exercices-book-curso_intensivo_de_python | 841aa855a7450ad3d0ba65393ba0b6debcd6a770 | [
"MIT"
] | null | null | null | Capitulo_02/exercise2_6.py | thiagosouzalink/my_codes-exercices-book-curso_intensivo_de_python | 841aa855a7450ad3d0ba65393ba0b6debcd6a770 | [
"MIT"
] | null | null | null | Capitulo_02/exercise2_6.py | thiagosouzalink/my_codes-exercices-book-curso_intensivo_de_python | 841aa855a7450ad3d0ba65393ba0b6debcd6a770 | [
"MIT"
] | null | null | null | """
2.6 – Citação famosa 2: Repita o Exercício 2.5, porém, desta vez, armazene o nome da pessoa famosa em uma variável chamada famous_person. Em seguida, componha sua mensagem e armazene-a em uma nova variável chamada message. Exiba sua mensagem.
"""
famous_person = "René Descartes"
message = "As paixões são todas boa... | 56.5 | 242 | 0.761062 |
ccaccc6ecad5d3002102f2e2ccace6172a7081ad | 19,356 | py | Python | rftokenizer/flair_pos_tagger.py | amir-zeldes/RFTokenizer | 8f02cb0cdc20b3c6519d7258ba27f0fd324e38c4 | [
"Apache-2.0"
] | 17 | 2019-02-03T09:39:00.000Z | 2021-04-06T02:29:01.000Z | rftokenizer/flair_pos_tagger.py | amir-zeldes/RFTokenizer | 8f02cb0cdc20b3c6519d7258ba27f0fd324e38c4 | [
"Apache-2.0"
] | null | null | null | rftokenizer/flair_pos_tagger.py | amir-zeldes/RFTokenizer | 8f02cb0cdc20b3c6519d7258ba27f0fd324e38c4 | [
"Apache-2.0"
] | 4 | 2019-02-02T23:16:44.000Z | 2021-04-11T20:31:18.000Z | """
flair_pos_tagger.py
This module trains flair sequence labelers to predict POS and deprel for OTHER modules.
"""
from argparse import ArgumentParser
from flair.data import Corpus, Sentence
from flair.datasets import ColumnCorpus
from flair.embeddings import OneHotEmbeddings, TransformerWordEmbeddings, StackedEmbe... | 43.013333 | 141 | 0.477113 |
453f7cfe90206b1d728a77171802fa03dae21f72 | 365 | py | Python | States/statetest.py | Slainlight/Pyglet-Game-Template | 957aede8221e6d8677ad719ed12a4be0ecc04366 | [
"MIT"
] | null | null | null | States/statetest.py | Slainlight/Pyglet-Game-Template | 957aede8221e6d8677ad719ed12a4be0ecc04366 | [
"MIT"
] | null | null | null | States/statetest.py | Slainlight/Pyglet-Game-Template | 957aede8221e6d8677ad719ed12a4be0ecc04366 | [
"MIT"
] | null | null | null | import pyglet
import parent
from var import window
import var
#Rainbow test
quad = pyglet.graphics.vertex_list(4,
('v2i', (0, 0, var.wWidth, 0, var.wWidth, var.wHeight, 0, var.wHeight)),
('c3B', (0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 0)))
def graphics():
quad.draw(pyglet.gl.GL_QUADS)
... | 19.210526 | 78 | 0.594521 |
769edcf1f91be7eb796bcf95d32044577650e6fe | 13,122 | py | Python | code/geometry.py | xiaolongw1223/GEOL6396-computational-EM | fa2195d7067448a04d3e15853d7c605fc233b0f1 | [
"MIT"
] | 1 | 2022-02-03T12:56:57.000Z | 2022-02-03T12:56:57.000Z | code/geometry.py | xiaolongw1223/GEOL6396-computational-EM | fa2195d7067448a04d3e15853d7c605fc233b0f1 | [
"MIT"
] | null | null | null | code/geometry.py | xiaolongw1223/GEOL6396-computational-EM | fa2195d7067448a04d3e15853d7c605fc233b0f1 | [
"MIT"
] | 1 | 2020-12-19T23:27:05.000Z | 2020-12-19T23:27:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 26 16:38:53 2019
@author: Xiaolong Wei
"""
import numpy as np
import scipy.sparse as sp
import time
from tools import sav, sdiff, speye, kron3
norm = np.linalg.norm
# =============================================================================
#... | 23.224779 | 110 | 0.51547 |
7f260d2b9a5ab89cf86a921e429df92b4d79045b | 2,352 | py | Python | settings/config.py | Torniojaws/vortech-backend | f775a97eeae089fa720088d86fe92d40bc5d65bc | [
"MIT"
] | null | null | null | settings/config.py | Torniojaws/vortech-backend | f775a97eeae089fa720088d86fe92d40bc5d65bc | [
"MIT"
] | 93 | 2017-09-01T22:24:10.000Z | 2021-12-22T14:07:06.000Z | settings/config.py | Torniojaws/vortech-backend | f775a97eeae089fa720088d86fe92d40bc5d65bc | [
"MIT"
] | null | null | null | from os.path import abspath, dirname, join
import configparser
# All the configs are in secret.cfg that must be created in prod server when deploying
CURRENT_DIR = abspath(dirname(__file__))
configfile = configparser.ConfigParser()
configpath = abspath(join(CURRENT_DIR, "secret.cfg"))
with open(configpath, "r")... | 32.219178 | 92 | 0.655187 |
aa92b77c41fd09f90f16b4cdf6b8169dd2a96e85 | 261 | py | Python | 1.py | tavaresdu/PythonNetworkOS-Assessment | dd713fca815ff0dbe836ed8952b45923a68e479d | [
"MIT"
] | null | null | null | 1.py | tavaresdu/PythonNetworkOS-Assessment | dd713fca815ff0dbe836ed8952b45923a68e479d | [
"MIT"
] | null | null | null | 1.py | tavaresdu/PythonNetworkOS-Assessment | dd713fca815ff0dbe836ed8952b45923a68e479d | [
"MIT"
] | null | null | null | import psutil
for p in psutil.process_iter():
try:
print(str(p.pid), '-', p.name(), "|",
'CPU', str(p.cpu_percent(interval=0.2))+'%', "|",
'Mem', str(p.memory_percent())+'%')
except psutil.NoSuchProcess:
pass
| 29 | 63 | 0.51341 |
bcf5968f6ba32657ea20b62751ec3c306730b0e6 | 1,104 | py | Python | dynamic_programming/edit_distance.py | bharathikannann/Python-Data-Structures-and-Algorithms | 61aca26940e486a00cd293fae36c1391b7ef3864 | [
"MIT"
] | 3 | 2021-08-23T21:40:01.000Z | 2022-02-24T10:55:25.000Z | dynamic_programming/edit_distance.py | bharathikannann/Python-Data-Structures-and-Algorithms | 61aca26940e486a00cd293fae36c1391b7ef3864 | [
"MIT"
] | null | null | null | dynamic_programming/edit_distance.py | bharathikannann/Python-Data-Structures-and-Algorithms | 61aca26940e486a00cd293fae36c1391b7ef3864 | [
"MIT"
] | null | null | null | # Number of edit distance required to change one string to another
def edit_distance(s1, s2):
m = len(s1)
n = len(s2)
dp = [[None] * (n + 1) for i in range(m + 1)]
for row in range(m + 1):
for col in range(n + 1):
if row == 0:
dp[row][col] = col
elif col =... | 35.612903 | 99 | 0.42663 |
d852a9e005f1e8aa94d14175b655193a8fca327a | 13,820 | py | Python | v1.0.0.test/toontown/minigame/TwoDEnemy.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v1.0.0.test/toontown/minigame/TwoDEnemy.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v1.0.0.test/toontown/minigame/TwoDEnemy.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from panda3d.core import *
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.DirectObject import DirectObject
from direct.showbase import PythonUtil
from direct.interval.IntervalGlobal import *
from toontown.minigame import ToonBlitzGlobals
from toontown.toonbase import ToontownGlobals
from toonto... | 49.71223 | 384 | 0.646527 |
1ab4afc8cafcd2de70fee8cc9a290895fe6c4d6c | 325 | py | Python | backend/api/migrations/0009_remove_course_members.py | a-mazalov/django-vuejs | 0aa0cd0c9d23d0019df32fd44fe93754e1260ce1 | [
"MIT"
] | null | null | null | backend/api/migrations/0009_remove_course_members.py | a-mazalov/django-vuejs | 0aa0cd0c9d23d0019df32fd44fe93754e1260ce1 | [
"MIT"
] | null | null | null | backend/api/migrations/0009_remove_course_members.py | a-mazalov/django-vuejs | 0aa0cd0c9d23d0019df32fd44fe93754e1260ce1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-11-14 10:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0008_auto_20191114_1154'),
]
operations = [
migrations.RemoveField(
model_name='course',
name='members',
),
... | 18.055556 | 47 | 0.587692 |
0adbd149af6eef8bd17d642f93f83f42b7e29c93 | 146 | py | Python | tests/s_testwrite2.py | SeattleTestbed/repy_v1 | f40a02e2e398b1ec67fede84b41a264ae7356d2c | [
"MIT"
] | 1 | 2021-08-18T05:58:17.000Z | 2021-08-18T05:58:17.000Z | tests/s_testwrite2.py | SeattleTestbed/repy_v1 | f40a02e2e398b1ec67fede84b41a264ae7356d2c | [
"MIT"
] | 3 | 2015-11-17T21:01:03.000Z | 2016-07-14T09:08:04.000Z | tests/s_testwrite2.py | SeattleTestbed/repy_v1 | f40a02e2e398b1ec67fede84b41a264ae7356d2c | [
"MIT"
] | 5 | 2015-07-02T13:29:23.000Z | 2021-09-25T07:48:30.000Z | fo = file("junk_test.out",'w')
print >> fo, "foo"
fo.close()
fo = file("junk_test.out",'r')
data = fo.read()
fo.close()
print "foo"==data.strip()
| 18.25 | 30 | 0.609589 |
cba8635a4220e30e984fb8e151561cfea52bcd2e | 2,442 | py | Python | scripts/question_answering/squad/preprocessing.py | roemmele/answerquest | b1b6b7f7aff7d8180fcab736f73f704577caac91 | [
"MIT"
] | 17 | 2021-03-08T03:34:44.000Z | 2022-01-17T03:52:47.000Z | scripts/question_answering/squad/preprocessing.py | roemmele/answerquest | b1b6b7f7aff7d8180fcab736f73f704577caac91 | [
"MIT"
] | 4 | 2021-05-16T20:32:02.000Z | 2021-09-01T07:31:56.000Z | scripts/question_answering/squad/preprocessing.py | roemmele/answerquest | b1b6b7f7aff7d8180fcab736f73f704577caac91 | [
"MIT"
] | 3 | 2020-02-01T00:21:01.000Z | 2021-07-25T15:58:30.000Z | import json
import argparse
import pickle
class Paragraph:
def __init__(self, id, string):
self.id = id
self.string = string
class Question:
def __init__(self, string):
self.string = string
self.answer_paragraph_id = -1
self.answer = ""
self.answer_offset = -1... | 35.911765 | 102 | 0.591319 |
33b3ecf44d07ffb61eba859405dc54103d7c8d7c | 1,108 | py | Python | perceptron.py | ShaheAnsar/ML | 213633388b597b06cecdd572c54524a6f2384a7f | [
"MIT"
] | null | null | null | perceptron.py | ShaheAnsar/ML | 213633388b597b06cecdd572c54524a6f2384a7f | [
"MIT"
] | null | null | null | perceptron.py | ShaheAnsar/ML | 213633388b597b06cecdd572c54524a6f2384a7f | [
"MIT"
] | null | null | null | import numpy as np
class Perceptron:
def __init__(self, N, learn_rate = 0.1):
self.W = np.random.randn(N + 1)/np.sqrt(N)
self.lr = learn_rate
def stepn(self, x):
r = x
r[r > 0] = 1.0
r[r < 0] = 0.0
return r
def step(self, x):
return 1 if x > 0 else 0... | 26.380952 | 58 | 0.48917 |
31cc3f122f11d9def2660beaad999267f12a3b73 | 147,286 | py | Python | container/google/cloud/container_v1beta1/gapic/cluster_manager_client.py | conwaychriscosmo/google-cloud-python | 8e7b7f8a5f4bb04d13f4d88ec3848f017faf834a | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | container/google/cloud/container_v1beta1/gapic/cluster_manager_client.py | conwaychriscosmo/google-cloud-python | 8e7b7f8a5f4bb04d13f4d88ec3848f017faf834a | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | container/google/cloud/container_v1beta1/gapic/cluster_manager_client.py | conwaychriscosmo/google-cloud-python | 8e7b7f8a5f4bb04d13f4d88ec3848f017faf834a | [
"Apache-2.0"
] | 2 | 2019-07-18T00:05:31.000Z | 2019-11-27T14:17:22.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 43.2431 | 167 | 0.589364 |
f8f4ef1303ff1fa92d2b67a941e0634f6f322df2 | 9,429 | py | Python | flatpak_indexer/json_model.py | owtaylor/flatpak-indexer | 6d4227677d2ff1a60735ecbaa10b241336f4b55b | [
"MIT"
] | 6 | 2021-03-29T09:01:51.000Z | 2021-11-29T15:28:13.000Z | flatpak_indexer/json_model.py | owtaylor/flatpak-indexer | 6d4227677d2ff1a60735ecbaa10b241336f4b55b | [
"MIT"
] | 4 | 2020-09-14T15:55:11.000Z | 2022-01-06T15:56:26.000Z | flatpak_indexer/json_model.py | owtaylor/flatpak-indexer | 6d4227677d2ff1a60735ecbaa10b241336f4b55b | [
"MIT"
] | 1 | 2021-08-30T10:17:16.000Z | 2021-08-30T10:17:16.000Z | #!/usr/bin/python
from datetime import datetime
import json
from typing import Any, Dict
from .utils import format_date, parse_date, resolve_type
class Field:
"""
Similar to the way that dataclasses.field works, assigning an instance of this
to a model class field provides extra information beyond what ... | 28.230539 | 97 | 0.611836 |
1232a467796586e61c84dd7ba9ad9609a4b03fe3 | 3,755 | py | Python | SaveImageToAVIEx.py | sjtu-automatic-maritime-system/PengZhenghao | c063294d44ea9be972114b2c144dab3d9a2de863 | [
"MIT"
] | 1 | 2019-04-16T09:07:26.000Z | 2019-04-16T09:07:26.000Z | SaveImageToAVIEx.py | sjtu-automatic-maritime-system/PengZhenghao | c063294d44ea9be972114b2c144dab3d9a2de863 | [
"MIT"
] | null | null | null | SaveImageToAVIEx.py | sjtu-automatic-maritime-system/PengZhenghao | c063294d44ea9be972114b2c144dab3d9a2de863 | [
"MIT"
] | null | null | null | # =============================================================================
# Copyright (c) 2001-2018 FLIR Systems, Inc. All Rights Reserved.
#
# This software is the confidential and proprietary information of FLIR
# Integrated Imaging Solutions, Inc. ("Confidential Information"). You
# shall not disclose suc... | 35.093458 | 104 | 0.636751 |
60e64fb0599b3927ceed4ebf5759c2a476b462b2 | 536 | py | Python | Django_Rest_Framework/api/pagination.py | Drack112/Treina-Web-Django | 555ecce1c351769240eefd4340b63e547f3bd2a9 | [
"MIT"
] | null | null | null | Django_Rest_Framework/api/pagination.py | Drack112/Treina-Web-Django | 555ecce1c351769240eefd4340b63e547f3bd2a9 | [
"MIT"
] | null | null | null | Django_Rest_Framework/api/pagination.py | Drack112/Treina-Web-Django | 555ecce1c351769240eefd4340b63e547f3bd2a9 | [
"MIT"
] | null | null | null | from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
class PaginacaoCustomizada(PageNumberPagination):
page_size = 3
page_size_query_param = "tamanho_pagina"
max_page_size = 5
def get_paginated_response(self, data):
return Response(
... | 26.8 | 58 | 0.580224 |
37537fe7dc76b18abc5867079d04b14995c32399 | 716 | py | Python | 08_buzzer/eg_08_03_buzzer_raw.py | byrobot-python/e_drone_examples | fca3ef69f45299f0e80df52ac303e2a1388b2b61 | [
"MIT"
] | null | null | null | 08_buzzer/eg_08_03_buzzer_raw.py | byrobot-python/e_drone_examples | fca3ef69f45299f0e80df52ac303e2a1388b2b61 | [
"MIT"
] | null | null | null | 08_buzzer/eg_08_03_buzzer_raw.py | byrobot-python/e_drone_examples | fca3ef69f45299f0e80df52ac303e2a1388b2b61 | [
"MIT"
] | null | null | null | from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
header = Header()
header.data_type = DataType.BUZZER
header.length = Buzzer.get_size()
header.from_ = DeviceType.BASE
h... | 18.358974 | 45 | 0.568436 |
d7ddda5b082f53af410f1e44e4db9ebf764b7afe | 2,159 | py | Python | cogs/cog_bot.py | karstenpedersen/z-bot | 83ca6c5141142d98d63bb6e620cc7a13d0a38e1b | [
"MIT"
] | null | null | null | cogs/cog_bot.py | karstenpedersen/z-bot | 83ca6c5141142d98d63bb6e620cc7a13d0a38e1b | [
"MIT"
] | null | null | null | cogs/cog_bot.py | karstenpedersen/z-bot | 83ca6c5141142d98d63bb6e620cc7a13d0a38e1b | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands, slash
from replit import db
class CogBot(commands.Cog):
def __init__(self, client):
self.client = client
@self.client.slash_group()
async def bot(ctx: slash.Context):
"""Bot commands."""
print('Options:', ctx.options... | 40.735849 | 131 | 0.509032 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.