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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56ac4791a32afebeb97eb938e327d27458ed9749 | 18,551 | py | Python | pokecli.py | n4nicolascage/Pokemon-Go-Ubuntu-Bot | 7ec0c79e6d84e62f96733af528ef199f0cd6f181 | [
"MIT"
] | 2 | 2018-11-27T06:02:24.000Z | 2019-12-31T19:10:32.000Z | pokecli.py | n4nicolascage/Pokemon-Go-Ubuntu-Bot | 7ec0c79e6d84e62f96733af528ef199f0cd6f181 | [
"MIT"
] | 1 | 2018-10-28T04:50:46.000Z | 2018-10-28T04:50:46.000Z | pokecli.py | n4nicolascage/Pokemon-Go-Ubuntu-Bot | 7ec0c79e6d84e62f96733af528ef199f0cd6f181 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import codecs
import json
import logging
import os
import ssl
import sys
import time
import signal
from datetime import timedelta
from getpass import getpass
from pgoapi.exceptions import NotLoggedInException, ServerSideRequestThrottlingException, ServerBu... | 31.23064 | 204 | 0.580184 |
edbf092c66e243ebd944dd01eb37fd3583156395 | 2,837 | py | Python | ace/system/database/caching.py | ace-ecosystem/ace2-core | a0de6b90f7437a98b1ee6ebcc693fa14f4b13c53 | [
"Apache-2.0"
] | null | null | null | ace/system/database/caching.py | ace-ecosystem/ace2-core | a0de6b90f7437a98b1ee6ebcc693fa14f4b13c53 | [
"Apache-2.0"
] | 11 | 2020-12-30T03:13:09.000Z | 2021-05-02T14:09:32.000Z | ace/system/database/caching.py | ace-ecosystem/ace2-core | a0de6b90f7437a98b1ee6ebcc693fa14f4b13c53 | [
"Apache-2.0"
] | 1 | 2022-03-16T20:44:16.000Z | 2022-03-16T20:44:16.000Z | # vim: ts=4:sw=4:et:cc=120
import datetime
from dataclasses import dataclass
from typing import Union, Optional
import ace
from ace.analysis import AnalysisModuleType
from ace.system.base import CachingBaseInterface
from ace.system.database.schema import AnalysisResultCache
from ace.system.requests import AnalysisR... | 37.328947 | 120 | 0.65386 |
bed2143bd1469981280a79489bd05a6dd2bce224 | 852 | py | Python | 2019-09-26-backtrader-backtesting-trading-strategies/backtrader-dma-strategy.py | georgehaan/analyzingalpha | f1f821e8d74d64addf410bfd205cb089ddf5517e | [
"Unlicense"
] | 277 | 2020-01-27T07:12:44.000Z | 2022-03-28T01:10:40.000Z | 2019-09-26-backtrader-backtesting-trading-strategies/backtrader-dma-strategy.py | georgehaan/analyzingalpha | f1f821e8d74d64addf410bfd205cb089ddf5517e | [
"Unlicense"
] | 14 | 2020-03-14T09:52:19.000Z | 2022-03-12T00:53:17.000Z | 2019-09-26-backtrader-backtesting-trading-strategies/backtrader-dma-strategy.py | georgehaan/analyzingalpha | f1f821e8d74d64addf410bfd205cb089ddf5517e | [
"Unlicense"
] | 132 | 2019-10-18T21:27:07.000Z | 2022-02-28T10:08:58.000Z | from datetime import datetime
import backtrader as bt
class SmaCross(bt.SignalStrategy):
def __init__(self):
sma1, sma2 = bt.ind.SMA(period=10), bt.ind.SMA(period=20)
crossover = bt.ind.CrossOver(sma1, sma2)
self.signal_add(bt.SIGNAL_LONG, crossover)
if __name__ == '__main__':
cerebro... | 34.08 | 71 | 0.63615 |
da83cc2c7a1984829858c1117eb801d115559dd9 | 1,141 | py | Python | apps/newsmag/migrations/0001_initial.py | gurnitha/2022-django4-news-mangazine | 1ea698f1eb90fec7da1a45254bb1166cf4431669 | [
"Unlicense"
] | null | null | null | apps/newsmag/migrations/0001_initial.py | gurnitha/2022-django4-news-mangazine | 1ea698f1eb90fec7da1a45254bb1166cf4431669 | [
"Unlicense"
] | null | null | null | apps/newsmag/migrations/0001_initial.py | gurnitha/2022-django4-news-mangazine | 1ea698f1eb90fec7da1a45254bb1166cf4431669 | [
"Unlicense"
] | null | null | null | # Generated by Django 4.0 on 2022-01-30 06:59
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 34.575758 | 135 | 0.567923 |
989b80183ca5e34846167fadcbb9874435edb3e8 | 2,231 | py | Python | app/gui/window/AboutWindow.py | williamo1099/Automated-Document-Clusterer | f6531a0b67cbb1bb0ab31c4f50be0a4919cbbd72 | [
"MIT"
] | null | null | null | app/gui/window/AboutWindow.py | williamo1099/Automated-Document-Clusterer | f6531a0b67cbb1bb0ab31c4f50be0a4919cbbd72 | [
"MIT"
] | null | null | null | app/gui/window/AboutWindow.py | williamo1099/Automated-Document-Clusterer | f6531a0b67cbb1bb0ab31c4f50be0a4919cbbd72 | [
"MIT"
] | null | null | null |
import tkinter as tk
class AboutWindow:
def __init__(self, gui):
"""
The constructor for AboutWindow class.
Parameters
----------
gui : gui
The main gui.
clusterer : Clusterer
The clusterer which did the clustering process.
Ret... | 34.859375 | 110 | 0.593904 |
b17ed96172187052885c0cb3a381b048668440cb | 1,815 | py | Python | jdcloud_sdk/services/starshield/apis/ModifyInstanceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/starshield/apis/ModifyInstanceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/starshield/apis/ModifyInstanceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 27.923077 | 80 | 0.664463 |
e070a48ceb4317732560a31a6d0b6f115658d13e | 444 | py | Python | hb.py | ekeyser/filamnt-seller-timer | 7fb58744a9cf90e75a13d5fcc31d88308af52f34 | [
"Apache-2.0"
] | null | null | null | hb.py | ekeyser/filamnt-seller-timer | 7fb58744a9cf90e75a13d5fcc31d88308af52f34 | [
"Apache-2.0"
] | null | null | null | hb.py | ekeyser/filamnt-seller-timer | 7fb58744a9cf90e75a13d5fcc31d88308af52f34 | [
"Apache-2.0"
] | null | null | null | import time
import requests
starttime = time.time()
interval = 5.0
sellerid = "00000001"
while True:
# print "tick"
currtime = time.time()
try:
url = "http://hb.filamnt.io/00000002/" + currtime
# files = {'payload.json': open('payload.json', 'rb')}
response = requests.get(url)
... | 20.181818 | 62 | 0.603604 |
791464b886f75ccc6d28d1da4733ba6e4b8cb1a4 | 961 | py | Python | src/pylero/change.py | leelavg/pylero | f9c6517682cb30d8c99b9574ffb6a53a7494d33a | [
"MIT"
] | 23 | 2020-07-22T07:38:41.000Z | 2022-03-28T11:54:56.000Z | src/pylero/change.py | leelavg/pylero | f9c6517682cb30d8c99b9574ffb6a53a7494d33a | [
"MIT"
] | 45 | 2021-02-09T16:37:16.000Z | 2022-03-31T20:39:05.000Z | src/pylero/change.py | leelavg/pylero | f9c6517682cb30d8c99b9574ffb6a53a7494d33a | [
"MIT"
] | 26 | 2020-07-22T09:15:31.000Z | 2022-03-29T07:30:01.000Z | # -*- coding: utf8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pylero.base_polarion import BasePolarion
class Change(BasePolarion):
"""Object to handle the Polarion WSDL tns3:Change class
Attrib... | 29.121212 | 59 | 0.556712 |
f038f61c57e76ca66a953420ed1205d88b1713f1 | 3,341 | py | Python | setup.py | rossburton/Kconfiglib | 424d0d38e7be15c52fae761a0a98028c4e13212d | [
"ISC"
] | null | null | null | setup.py | rossburton/Kconfiglib | 424d0d38e7be15c52fae761a0a98028c4e13212d | [
"ISC"
] | null | null | null | setup.py | rossburton/Kconfiglib | 424d0d38e7be15c52fae761a0a98028c4e13212d | [
"ISC"
] | null | null | null | import io
import os
import setuptools
setuptools.setup(
name="kconfiglib",
# MAJOR.MINOR.PATCH, per http://semver.org
version="13.7.1",
description="A flexible Python Kconfig implementation",
# Make sure that README.rst decodes on Python 3 in environments that use
# the C locale (which impli... | 34.443299 | 83 | 0.600419 |
5692c42b68ffce678fbb6cafb8cc487f17bdb73a | 1,180 | py | Python | Ninja/Leetcode/237_Delete_Node_in_a_Linked_List.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/Leetcode/237_Delete_Node_in_a_Linked_List.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/Leetcode/237_Delete_Node_in_a_Linked_List.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | """
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.
Given linked list -- head = [4,5,1,9], which looks like following:
Example 1:
Input: head = [4,5,1,9], node = 5
Output: [4,1,9]
Explanation: You are given the second node with value 5, the linked list sho... | 28.780488 | 127 | 0.669492 |
9f67833622b4fa7d7f6f94670deba175dc0eb5be | 564 | py | Python | backend/supplies/migrations/0003_auto_20190514_1956.py | r-kaminski/innovativeproject-inventory-of-supplies | b3352cb6432ec2e7c5b83b648231808eabf56734 | [
"MIT"
] | 1 | 2019-05-05T17:50:37.000Z | 2019-05-05T17:50:37.000Z | backend/supplies/migrations/0003_auto_20190514_1956.py | r-kaminski/innovativeproject-inventory-of-supplies | b3352cb6432ec2e7c5b83b648231808eabf56734 | [
"MIT"
] | 117 | 2019-03-05T20:34:55.000Z | 2022-03-11T23:45:54.000Z | backend/supplies/migrations/0003_auto_20190514_1956.py | r-kaminski/innovativeproject-inventory-of-supplies | b3352cb6432ec2e7c5b83b648231808eabf56734 | [
"MIT"
] | 5 | 2019-08-04T15:36:43.000Z | 2021-06-16T20:49:49.000Z | # Generated by Django 2.1.7 on 2019-05-14 19:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('supplies', '0002_auto_20190323_1401'),
]
operations = [
migrations.AddField(
model_name='supply',
name='last_time_sc... | 23.5 | 58 | 0.586879 |
bd58cd2bb6a7ca7701d3360926634fd85f0c4710 | 9,251 | py | Python | hyperion/torch/narchs/resnet_factory.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | 14 | 2021-12-19T04:24:15.000Z | 2022-03-18T03:24:04.000Z | hyperion/torch/narchs/resnet_factory.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | null | null | null | hyperion/torch/narchs/resnet_factory.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | 5 | 2021-12-14T20:41:27.000Z | 2022-02-24T14:18:11.000Z | """
Copyright 2019 Johns Hopkins University (Author: Jesus Villalba)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
from jsonargparse import ArgumentParser, ActionParser
from .resnet import *
resnet_dict = {
"resnet18": ResNet18,
"resnet34": ResNet34,
"resnet50": ResNet50,
"resnet101... | 29.461783 | 99 | 0.577451 |
a83cf9a60c2d66ddd2568f66bb8cc90322cbdf3c | 3,899 | py | Python | km_api/know_me/tests/management/commands/test_updatelegacyusers.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 4 | 2017-08-03T00:46:31.000Z | 2018-11-06T03:32:32.000Z | km_api/know_me/tests/management/commands/test_updatelegacyusers.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 526 | 2017-06-27T18:13:59.000Z | 2021-06-10T18:00:21.000Z | km_api/know_me/tests/management/commands/test_updatelegacyusers.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 1 | 2017-07-10T19:46:27.000Z | 2017-07-10T19:46:27.000Z | from unittest import mock
from know_me import models
from know_me.management.commands.updatelegacyusers import Command
def test_find_legacy_users_match_email(email_factory, legacy_user_factory):
"""
If the email address of a legacy user matches a verified email, the
Know Me user corresponding to the owne... | 29.097015 | 95 | 0.751731 |
1a095e18e9f14499fdcef3462ed0f6715f0bf788 | 410 | py | Python | tests/test_article.py | kangangi/newsIP | c8890bfa6aa3e31353501e4de4e6f3ec83e52119 | [
"MIT"
] | 1 | 2020-05-14T12:36:54.000Z | 2020-05-14T12:36:54.000Z | tests/test_article.py | kangangi/newsIP | c8890bfa6aa3e31353501e4de4e6f3ec83e52119 | [
"MIT"
] | null | null | null | tests/test_article.py | kangangi/newsIP | c8890bfa6aa3e31353501e4de4e6f3ec83e52119 | [
"MIT"
] | null | null | null | import unittest
from app.models import Article
class ArticleTest(unittest.TestCase):
'''
Test class to test the behaviour of the Article class
'''
def setUp(self):
'''
Set-up method that runs before any test
'''
self.new_article = Article("Corona virus","imageurl","James Doe", "Date", "siteUr... | 22.777778 | 88 | 0.697561 |
3611cc6202d8731a76654d6c0e072ea82ea27d45 | 1,265 | py | Python | tests/test_transform.py | ncdulo/word_tools | b3a9043bfb5fa1c14fd2494b9bae3f125dbbecc5 | [
"MIT"
] | 3 | 2020-03-15T23:24:48.000Z | 2020-04-23T17:50:17.000Z | tests/test_transform.py | ncdulo/word_tools | b3a9043bfb5fa1c14fd2494b9bae3f125dbbecc5 | [
"MIT"
] | 12 | 2020-03-26T00:55:52.000Z | 2021-12-13T20:36:17.000Z | tests/test_transform.py | ncdulo/word_tools | b3a9043bfb5fa1c14fd2494b9bae3f125dbbecc5 | [
"MIT"
] | null | null | null | import word_tools
import pytest
def test_stoopid_output():
'''
Assert stupid provides the proper output
'''
known_values = (
('python', 'PyThOn'),
('word tools', 'WoRd tOoLs'),
('programming', 'PrOgRaMmInG'),
('try some longer output', 'TrY SoMe lOnGeR ... | 28.75 | 71 | 0.517787 |
9d5e3981fa40078c131281e0a29ac13a6ccb1626 | 3,129 | py | Python | datasets/covid_tweets_japanese/covid_tweets_japanese.py | borisdayma/datasets | ab6d9759b8b15c0109947159ff1cb6cb3486fdb8 | [
"Apache-2.0"
] | 1 | 2021-09-08T03:44:50.000Z | 2021-09-08T03:44:50.000Z | datasets/covid_tweets_japanese/covid_tweets_japanese.py | borisdayma/datasets | ab6d9759b8b15c0109947159ff1cb6cb3486fdb8 | [
"Apache-2.0"
] | null | null | null | datasets/covid_tweets_japanese/covid_tweets_japanese.py | borisdayma/datasets | ab6d9759b8b15c0109947159ff1cb6cb3486fdb8 | [
"Apache-2.0"
] | 1 | 2021-07-19T09:10:47.000Z | 2021-07-19T09:10:47.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 34.01087 | 146 | 0.649089 |
8cc2ca9452e1c84a3eb55047811649415b7efa6f | 318 | py | Python | Week01/Problem03/asedler_03.py | nkruyer/SkillsWorkshop2018 | 2201255ff63eca111635789267d0600a95854c38 | [
"BSD-3-Clause"
] | 1 | 2020-04-18T03:30:46.000Z | 2020-04-18T03:30:46.000Z | Week01/Problem03/asedler_03.py | nkruyer/SkillsWorkshop2018 | 2201255ff63eca111635789267d0600a95854c38 | [
"BSD-3-Clause"
] | 21 | 2018-07-12T19:12:23.000Z | 2018-08-10T13:52:45.000Z | Week01/Problem03/asedler_03.py | nkruyer/SkillsWorkshop2018 | 2201255ff63eca111635789267d0600a95854c38 | [
"BSD-3-Clause"
] | 60 | 2018-05-08T16:59:20.000Z | 2018-08-01T14:28:28.000Z | """
This script implements a solution to Project Euler Problem 03
by finding the largest prime factor of 600851475143.
@author Andrew Sedler
"""
# Assign the number to be factored
x = 600851475143
# Start with the smallest prime
i = 2
while i*i <= x:
if x % i:
i+=1
else:
x //= i
print(x)
| 15.142857 | 61 | 0.650943 |
abc98dad1762d02590b193cbf09c31751ba10077 | 1,249 | py | Python | plotsearch/signals.py | City-of-Helsinki/mvj | 6f786047805a968317ecc37b38c2262ada2c3805 | [
"MIT"
] | 1 | 2021-01-12T08:14:10.000Z | 2021-01-12T08:14:10.000Z | plotsearch/signals.py | City-of-Helsinki/mvj | 6f786047805a968317ecc37b38c2262ada2c3805 | [
"MIT"
] | 249 | 2017-04-18T14:00:13.000Z | 2022-03-30T12:18:03.000Z | plotsearch/signals.py | City-of-Helsinki/mvj | 6f786047805a968317ecc37b38c2262ada2c3805 | [
"MIT"
] | 7 | 2017-04-18T08:43:54.000Z | 2021-07-28T07:29:30.000Z | from django.db.models.signals import post_delete, pre_save
from django.dispatch import receiver
from plotsearch.models import PlotSearch, PlotSearchTarget
@receiver(pre_save, sender=PlotSearchTarget)
def prepare_plan_unit_on_plot_search_target_save(sender, instance, **kwargs):
plan_unit = instance.plan_unit
... | 29.046512 | 83 | 0.706165 |
4eee4b17a20b7d0824edd7d0abac65377a19acb9 | 4,901 | py | Python | Collect/CMRSET/DataAccess.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | 3 | 2021-01-26T11:21:31.000Z | 2021-12-31T21:28:18.000Z | Collect/CMRSET/DataAccess.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | null | null | null | Collect/CMRSET/DataAccess.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | 4 | 2019-01-02T06:45:55.000Z | 2021-06-30T11:51:38.000Z | # -*- coding: utf-8 -*-
"""
Authors: Tim Hessels
Module: Collect/CMRSET
Restrictions:
The data and this python file may not be distributed to others without
permission of the WA+ team due data restriction of the CMRSET developers.
Description:
This script collects CMRSET data from the UNESCO-IHE FTP server. The data ... | 35.258993 | 163 | 0.677005 |
2f28c12a9f013e1d28c52d1b8a59904c0bf15b19 | 7,580 | py | Python | main.py | Nyashiki/Minishogi-Agent-Evaluator | 4b6aa18e3fe716c74c3da66e1fc71cee1363efdc | [
"MIT"
] | null | null | null | main.py | Nyashiki/Minishogi-Agent-Evaluator | 4b6aa18e3fe716c74c3da66e1fc71cee1363efdc | [
"MIT"
] | null | null | null | main.py | Nyashiki/Minishogi-Agent-Evaluator | 4b6aa18e3fe716c74c3da66e1fc71cee1363efdc | [
"MIT"
] | null | null | null | import datetime
import minishogilib
from optparse import OptionParser
import queue
import simplejson as json
import subprocess
import threading
import time
class Engine():
def __init__(self, name=None, command=None, cwd=None, verbose=False, usi_option={}, timelimit={}):
self.name = name
self.verbo... | 29.609375 | 121 | 0.564908 |
6b7510ab8faa28f23302dd08f8c697cb18ef2a2e | 1,408 | py | Python | aws_secrets/cli/decrypt.py | lucasvieirasilva/aws-ssm-secrets-cli | 861779099dd5a77c7166d69cad90bba5a1145001 | [
"MIT"
] | 4 | 2021-05-18T16:11:26.000Z | 2022-01-10T14:23:11.000Z | aws_secrets/cli/decrypt.py | lucasvieirasilva/aws-ssm-secrets-cli | 861779099dd5a77c7166d69cad90bba5a1145001 | [
"MIT"
] | 45 | 2020-09-14T08:57:53.000Z | 2021-09-16T16:13:58.000Z | aws_secrets/cli/decrypt.py | lucasvieirasilva/aws-ssm-secrets-cli | 861779099dd5a77c7166d69cad90bba5a1145001 | [
"MIT"
] | null | null | null | from typing import Optional
import click
from click.core import Context
import yaml
from aws_secrets.config.config_reader import ConfigReader
from aws_secrets.helpers.catch_exceptions import catch_exceptions
from aws_secrets.miscellaneous import session
@click.command(name='decrypt', help='Decrypt a configuration fi... | 31.288889 | 68 | 0.685369 |
d1e35468812dfeba245515055cc9981eeb5b168b | 313 | py | Python | test.py | QBitor/Neuromorphic_AE_Tools | b20f5f931e82888dfc4eebd7b19b2746d142d4bb | [
"MIT"
] | 4 | 2019-02-19T14:19:14.000Z | 2019-07-29T02:46:47.000Z | test.py | ndouard/Neuromorphic_AE_Tools | b20f5f931e82888dfc4eebd7b19b2746d142d4bb | [
"MIT"
] | null | null | null | test.py | ndouard/Neuromorphic_AE_Tools | b20f5f931e82888dfc4eebd7b19b2746d142d4bb | [
"MIT"
] | 2 | 2018-03-05T22:52:53.000Z | 2018-09-13T21:47:00.000Z | x_indexes = [i for i, j in enumerate(xaddr)] if j == myxaddr]
y_indexes = [i for i, j in enumerate(yaddr)] if j == myyaddr]
print('x_indexes: ' + str(x_indexes))
print('y_indexes:' +str(y_indexes))
# keep common indexes
common = [i for i, j in zip(x_indexes, y_indexes) if i == j]
print('common: ' + str(common))
| 39.125 | 61 | 0.670927 |
a62c679d19db841495e73d17ac6d41bea44d1414 | 966 | py | Python | 03/python/overlap.py | trcooke/adventofcode-2018 | 6eb2eb04463618432b626ce60c74d0e6406c69a0 | [
"MIT"
] | null | null | null | 03/python/overlap.py | trcooke/adventofcode-2018 | 6eb2eb04463618432b626ce60c74d0e6406c69a0 | [
"MIT"
] | null | null | null | 03/python/overlap.py | trcooke/adventofcode-2018 | 6eb2eb04463618432b626ce60c74d0e6406c69a0 | [
"MIT"
] | null | null | null | from sets import Set
file = open("input")
squares = Set([])
multis = Set([])
lines = []
for line in file:
lines.append(line)
[name, coords] = line.split('@')
[start, size] = coords.split(':')
[x,y] = map(lambda x: int(x), start.strip().split(','))
[w,h] = map(lambda x: int(x), size.strip().split('... | 24.769231 | 59 | 0.496894 |
f7f662a748abd590e79f1e821572b895eee43074 | 1,072 | py | Python | code/utils/functions/smooth.py | berkeley-stat159/project-alpha | 330d025c4eda94d390a82e86deecb791086c9dbf | [
"BSD-3-Clause"
] | 4 | 2015-10-30T23:08:32.000Z | 2021-06-24T03:44:02.000Z | code/utils/functions/smooth.py | berkeley-stat159/project-alpha | 330d025c4eda94d390a82e86deecb791086c9dbf | [
"BSD-3-Clause"
] | 179 | 2015-10-25T15:59:56.000Z | 2017-10-31T02:40:24.000Z | code/utils/functions/smooth.py | berkeley-stat159/project-alpha | 330d025c4eda94d390a82e86deecb791086c9dbf | [
"BSD-3-Clause"
] | 11 | 2015-10-20T19:15:10.000Z | 2019-02-23T19:33:03.000Z | from __future__ import absolute_import, division, print_function
import numpy as np
import scipy.ndimage
from scipy.ndimage.filters import gaussian_filter
def smoothvoxels(data_4d, fwhm, time):
"""
Return a 'smoothed' version of data_4d.
Parameters
----------
data_4d : numpy array of 4 dimensions... | 28.972973 | 78 | 0.697761 |
5eba86ebabcaa6efd8099373892fb9964231f14e | 12,596 | py | Python | pybind/slxos/v16r_1_00b/mac_group/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/mac_group/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/mac_group/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 76.804878 | 1,205 | 0.728088 |
db9433a09501495b63db8a7391acf47c6ddf6638 | 68,105 | py | Python | regular_webscrapper/venv/lib/python3.5/site-packages/arrow/locales.py | ds-suyog/SpyderBot | 361e160d964f5c5f1abf579b99895cfe8d3b0483 | [
"MIT"
] | null | null | null | regular_webscrapper/venv/lib/python3.5/site-packages/arrow/locales.py | ds-suyog/SpyderBot | 361e160d964f5c5f1abf579b99895cfe8d3b0483 | [
"MIT"
] | null | null | null | regular_webscrapper/venv/lib/python3.5/site-packages/arrow/locales.py | ds-suyog/SpyderBot | 361e160d964f5c5f1abf579b99895cfe8d3b0483 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import inspect
import sys
from math import trunc
def get_locale(name):
'''Returns an appropriate :class:`Locale <arrow.locales.Locale>`
corresponding to an inpute locale name.
:param name: the name of ... | 30.472036 | 163 | 0.463197 |
9bed90d650f7b045eb05c8be393104baf3a7a4f2 | 6,525 | py | Python | projects/api/TasksApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | projects/api/TasksApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | projects/api/TasksApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | #$Id$
from projects.util.ZohoHttpClient import ZohoHttpClient
from projects.api.Api import Api
from projects.parser.TasksParser import TasksParser
base_url = Api().base_url
zoho_http_client = ZohoHttpClient()
parser = TasksParser()
class TasksApi:
"""TasksApi class is used to
1.Get all tasks in the given p... | 29.659091 | 136 | 0.598008 |
30fdb3c2d1518c903af7b44580f6fe6c485015e7 | 4,506 | py | Python | tests/visitors/test_translations.py | webstar-commit/django-boilerplate | 3ac57bf990826d6a90386643452d05a7313e301e | [
"MIT"
] | 128 | 2020-05-10T13:17:52.000Z | 2022-03-31T23:54:50.000Z | tests/visitors/test_translations.py | webstar-commit/django-boilerplate | 3ac57bf990826d6a90386643452d05a7313e301e | [
"MIT"
] | 477 | 2020-05-07T16:00:05.000Z | 2022-03-29T15:42:20.000Z | tests/visitors/test_translations.py | webstar-commit/django-boilerplate | 3ac57bf990826d6a90386643452d05a7313e301e | [
"MIT"
] | 14 | 2020-05-10T14:21:40.000Z | 2021-11-30T23:25:50.000Z | from django_codemod.visitors import (
UGetTextLazyTransformer,
UGetTextNoopTransformer,
UGetTextTransformer,
UNGetTextLazyTransformer,
UNGetTextTransformer,
)
from tests.visitors.base import BaseVisitorTest
class TestUGetTextTransformer(BaseVisitorTest):
transformer = UGetTextTransformer
... | 27.644172 | 68 | 0.605415 |
3839c8a3019dc366e36d01d90c7ee805deb3df46 | 5,092 | py | Python | eight_puzzle.py | Alessandro297/aima-python | eec54426f4d2a0f138d9925e46e19122ac8f59e4 | [
"MIT"
] | null | null | null | eight_puzzle.py | Alessandro297/aima-python | eec54426f4d2a0f138d9925e46e19122ac8f59e4 | [
"MIT"
] | null | null | null | eight_puzzle.py | Alessandro297/aima-python | eec54426f4d2a0f138d9925e46e19122ac8f59e4 | [
"MIT"
] | null | null | null | import os.path
import random
import time
from functools import partial
from tkinter import *
from search import astar_search, EightPuzzle
#sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
root = Tk()
state = [1, 2, 3, 4, 5, 6, 7, 8, 0]
puzzle = EightPuzzle(tuple(state))
solution = None
b = [None] * 9... | 33.5 | 117 | 0.603103 |
3a244ee7ce79b53c8f3de5d3d73556cdf7cea406 | 1,814 | py | Python | src/test/parser/template/nodes/test_thatstar.py | hiitsme123/python | e08309fe61fd5ed88cfb39e9f402613dd7e39269 | [
"MIT"
] | 5 | 2017-02-03T07:38:45.000Z | 2022-01-06T11:29:29.000Z | src/test/parser/template/nodes/test_thatstar.py | hiitsme123/python | e08309fe61fd5ed88cfb39e9f402613dd7e39269 | [
"MIT"
] | 8 | 2017-02-03T06:59:03.000Z | 2017-04-28T14:23:46.000Z | src/test/parser/template/nodes/test_thatstar.py | hiitsme123/python | e08309fe61fd5ed88cfb39e9f402613dd7e39269 | [
"MIT"
] | 8 | 2017-02-02T15:12:12.000Z | 2017-04-02T13:35:03.000Z | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.thatstar import TemplateThatStarNode
from test.parser.template.base import TemplateTestsBaseClass
class TemplateThatStarNodeTests(TemplateTestsBaseClass):
def test_node(self):
... | 32.392857 | 93 | 0.671444 |
610ce61fd7cbfb7d1f20f9cea53b1e851b35d620 | 566 | py | Python | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_10/operations/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_10/operations/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_10/operations/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 40.428571 | 94 | 0.570671 |
25d4f61cd7a81b58783070cdc239a4b7e835a621 | 875 | py | Python | server/architext/verbs/master_mode.py | JimenaAndrea/architext | fb49624f7301902a357815af0ca5d320cfc6ddb6 | [
"MIT"
] | 3 | 2020-08-02T07:14:25.000Z | 2021-04-25T12:22:53.000Z | server/architext/verbs/master_mode.py | JimenaAndrea/architext | fb49624f7301902a357815af0ca5d320cfc6ddb6 | [
"MIT"
] | 130 | 2020-07-15T12:09:30.000Z | 2021-05-27T15:02:01.000Z | server/architext/verbs/master_mode.py | JimenaAndrea/architext | fb49624f7301902a357815af0ca5d320cfc6ddb6 | [
"MIT"
] | 1 | 2021-06-10T15:51:49.000Z | 2021-06-10T15:51:49.000Z | from . import verb
import textwrap
class MasterMode(verb.Verb):
"""Lets players enter and leave master mode"""
command = _('mastermode')
permissions = verb.PRIVILEGED
def process(self, message):
if self.session.user.master_mode:
self.session.user.leave_master_mode()
se... | 33.653846 | 97 | 0.558857 |
8c15d04bbaf79f0995023e38c0c5342768dba7b9 | 27,589 | py | Python | tests/milvus_python_test/entity/test_get_entity_by_id.py | ismailocal/milvus | f09147ae0c858f695a949adb2c079f48743355f3 | [
"Apache-2.0"
] | 3 | 2020-03-13T10:10:08.000Z | 2022-01-30T07:12:36.000Z | tests/milvus_python_test/entity/test_get_entity_by_id.py | mppmys/milvus | 8605a7f12276c4a9b3b2772535c9575b199bb101 | [
"Apache-2.0"
] | null | null | null | tests/milvus_python_test/entity/test_get_entity_by_id.py | mppmys/milvus | 8605a7f12276c4a9b3b2772535c9575b199bb101 | [
"Apache-2.0"
] | 1 | 2020-10-26T12:00:39.000Z | 2020-10-26T12:00:39.000Z | import time
import random
import pdb
import copy
import logging
from multiprocessing import Pool, Process
import concurrent.futures
from threading import current_thread
import pytest
from utils import *
from constants import *
default_single_query = {
"bool": {
"must": [
{"vector": {
... | 41.362819 | 124 | 0.623981 |
35ed1c26fb00b39429bb4bdfaa08a42aa7543af9 | 539 | py | Python | backend/apps/banking/migrations/0002_auto_20200126_1558.py | jaliste/mi_coop | 66be4328117c39026d85a3d6cc9b8635bde49077 | [
"MIT"
] | 54 | 2019-08-11T03:39:22.000Z | 2022-01-06T02:16:33.000Z | backend/apps/banking/migrations/0002_auto_20200126_1558.py | jaliste/mi_coop | 66be4328117c39026d85a3d6cc9b8635bde49077 | [
"MIT"
] | 11 | 2020-02-12T01:17:38.000Z | 2021-05-10T06:22:22.000Z | backend/apps/banking/migrations/0002_auto_20200126_1558.py | jaliste/mi_coop | 66be4328117c39026d85a3d6cc9b8635bde49077 | [
"MIT"
] | 20 | 2019-09-07T20:04:08.000Z | 2021-12-05T04:43:20.000Z | # Generated by Django 2.2 on 2020-01-26 15:58
import django.core.files.storage
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("banking", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="statementfile",
... | 23.434783 | 87 | 0.588126 |
5ffd5dfff09b9af25914e8ce1d0fb8f8aa1a99df | 10,021 | py | Python | example/tutorial_cifar10.py | IAmSuyogJadhav/tensorlayer | b9115e027f8a47f5b8c3c92ade30603560c5e987 | [
"Apache-2.0"
] | 1 | 2021-09-10T09:27:31.000Z | 2021-09-10T09:27:31.000Z | example/tutorial_cifar10.py | IAmSuyogJadhav/tensorlayer | b9115e027f8a47f5b8c3c92ade30603560c5e987 | [
"Apache-2.0"
] | null | null | null | example/tutorial_cifar10.py | IAmSuyogJadhav/tensorlayer | b9115e027f8a47f5b8c3c92ade30603560c5e987 | [
"Apache-2.0"
] | 1 | 2018-08-12T20:06:21.000Z | 2018-08-12T20:06:21.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
# tl.prepro for data augmentation
import time
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
sess = tf.InteractiveSession()
X_train, y_train, X_test, y_test = tl.files.load_cifar10_dataset(shape=(-1, 32, 32, 3), plota... | 51.654639 | 159 | 0.607824 |
c087a1d6f2859780d543f7a3897c08d7bf62c6d6 | 6,177 | py | Python | geocamTiePoint/optimize.py | finleyexp/georef_geocamtiepoint | 5a3b55db9ca84c139498f5a1b9cf7f30f7f7736b | [
"NASA-1.3"
] | 1 | 2019-04-18T11:32:20.000Z | 2019-04-18T11:32:20.000Z | geocamTiePoint/optimize.py | finleyexp/georef_geocamtiepoint | 5a3b55db9ca84c139498f5a1b9cf7f30f7f7736b | [
"NASA-1.3"
] | null | null | null | geocamTiePoint/optimize.py | finleyexp/georef_geocamtiepoint | 5a3b55db9ca84c139498f5a1b9cf7f30f7f7736b | [
"NASA-1.3"
] | 6 | 2017-07-16T04:17:32.000Z | 2019-11-12T20:30:00.000Z | #__BEGIN_LICENSE__
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The GeoRef platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in complianc... | 29.136792 | 84 | 0.617452 |
6b768d9076c9ef55cbe153f7038a932156df5a04 | 110 | py | Python | include/tclap-1.4.0-rc1/tests/test18.py | SpaceKatt/cpp-cli-poc | 02ffefea2fc6e999fa2b27d08a8b3be6830b1b97 | [
"BSL-1.0"
] | 62 | 2021-09-21T18:58:02.000Z | 2022-03-07T02:17:43.000Z | third_party/tclap-1.4.0-rc1/tests/test18.py | Vertexwahn/FlatlandRT | 37d09fde38b25eff5f802200b43628efbd1e3198 | [
"Apache-2.0"
] | null | null | null | third_party/tclap-1.4.0-rc1/tests/test18.py | Vertexwahn/FlatlandRT | 37d09fde38b25eff5f802200b43628efbd1e3198 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import simple_test
simple_test.test("test4", ["-Bs", "--Bs", "asdf", ], expect_fail=True)
| 18.333333 | 70 | 0.654545 |
9531fd317b04c67424c301abcf4dbac16d7b5301 | 2,503 | py | Python | env/lib/python3.7/site-packages/tqdm/_version.py | sushanthsamala/digit-recognizer | ba3f43e48858cf208029730f5a0fba98c3dbfa24 | [
"Apache-2.0"
] | 16 | 2020-09-20T22:32:54.000Z | 2021-04-02T17:14:25.000Z | env/lib/python3.7/site-packages/tqdm/_version.py | sushanthsamala/digit-recognizer | ba3f43e48858cf208029730f5a0fba98c3dbfa24 | [
"Apache-2.0"
] | 3 | 2020-09-30T11:41:49.000Z | 2021-12-19T23:27:19.000Z | env/lib/python3.7/site-packages/tqdm/_version.py | sushanthsamala/digit-recognizer | ba3f43e48858cf208029730f5a0fba98c3dbfa24 | [
"Apache-2.0"
] | 3 | 2021-09-12T07:36:43.000Z | 2021-10-11T22:19:48.000Z | # Definition of the version number
import os
from io import open as io_open
__all__ = ["__version__"]
# major, minor, patch, -extra
version_info = 4, 51, 0
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
# auto -extra based on commit hash (if not tagged as release)
scriptdir = os.path.... | 39.730159 | 75 | 0.495406 |
e73afad35e1f69dedb739ed6ce0432d505209920 | 1,614 | py | Python | noggin/tests/unit/translations/test_translations.py | pypingou/noggin | 94a4822bec88b1ef7650a89592eb737310f057e7 | [
"MIT"
] | null | null | null | noggin/tests/unit/translations/test_translations.py | pypingou/noggin | 94a4822bec88b1ef7650a89592eb737310f057e7 | [
"MIT"
] | null | null | null | noggin/tests/unit/translations/test_translations.py | pypingou/noggin | 94a4822bec88b1ef7650a89592eb737310f057e7 | [
"MIT"
] | null | null | null | import os
import pytest
from babel.messages.frontend import compile_catalog
from bs4 import BeautifulSoup
import noggin
from noggin.tests.unit.utilities import assert_redirects_with_flash
@pytest.fixture
def compile_catalogs():
cmd = compile_catalog()
cmd.directory = os.path.abspath(os.path.join(noggin.__pa... | 32.938776 | 92 | 0.698265 |
431322fc4ded1832b09ce41b1470defd22cc8d55 | 17,241 | py | Python | stix2/test/test_pattern_equivalence.py | khdesai/cti-python-stix2 | 20a9bb316c43b7d9faaab686db8d51e5c89416da | [
"BSD-3-Clause"
] | null | null | null | stix2/test/test_pattern_equivalence.py | khdesai/cti-python-stix2 | 20a9bb316c43b7d9faaab686db8d51e5c89416da | [
"BSD-3-Clause"
] | null | null | null | stix2/test/test_pattern_equivalence.py | khdesai/cti-python-stix2 | 20a9bb316c43b7d9faaab686db8d51e5c89416da | [
"BSD-3-Clause"
] | null | null | null | import pytest
from stix2.equivalence.pattern import (
equivalent_patterns, find_equivalent_patterns,
)
# # # #
# # Observation expression equivalence tests # #
# # # #
@pytest.mark.parametrize(
"patt1, patt2", [
(
... | 27.151181 | 139 | 0.414477 |
6e15395c27aec6ef71d677afedae78dcfeb6ef9a | 3,924 | py | Python | autosar/element.py | Amineahd/autosar | 9d59828cbbbb412245e55bf3ad72cdaba6366d7b | [
"MIT"
] | 2 | 2020-01-08T07:42:08.000Z | 2022-03-07T07:37:55.000Z | autosar/element.py | Amineahd/autosar | 9d59828cbbbb412245e55bf3ad72cdaba6366d7b | [
"MIT"
] | null | null | null | autosar/element.py | Amineahd/autosar | 9d59828cbbbb412245e55bf3ad72cdaba6366d7b | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ElementTree
import autosar.base
class Element(object):
def __init__(self, name, parent=None, adminData=None):
if isinstance(adminData, dict):
adminDataObj=autosar.base.createAdminData(adminData)
else:
adminDataObj = adminData
if (adminData... | 37.730769 | 161 | 0.615953 |
dcc0452685e6dca331ad6b6039e5d4f25010ddf7 | 478 | py | Python | src/data/json_serializer.py | fabianWrede/tournament-manager | 9b53aeee08df4b829c7ee39e484d9c12b9676557 | [
"Apache-2.0"
] | 3 | 2018-06-08T00:51:50.000Z | 2019-05-05T12:18:20.000Z | src/data/json_serializer.py | fabianWrede/tournament-manager | 9b53aeee08df4b829c7ee39e484d9c12b9676557 | [
"Apache-2.0"
] | null | null | null | src/data/json_serializer.py | fabianWrede/tournament-manager | 9b53aeee08df4b829c7ee39e484d9c12b9676557 | [
"Apache-2.0"
] | 1 | 2018-11-22T23:30:31.000Z | 2018-11-22T23:30:31.000Z | import json
import sys
from data.model import BaseData, Tournament, Team, Round, Game
class DataJSONEncoder(json.JSONEncoder):
# pylint: disable=E0202
def default(self, obj):
if isinstance(obj, BaseData):
return obj.encode_json()
return json.JSONEncoder.default(self, obj)
def de... | 23.9 | 62 | 0.67364 |
2ea51638c6a4fbc0f873493a723e9f7d5e9e51d1 | 3,701 | py | Python | HW1/cross_validator.py | dompuiu/PROEA-821-005-Spring-2018 | cde4a09a3a60b37a332895a524a7a3f63343e601 | [
"MIT"
] | null | null | null | HW1/cross_validator.py | dompuiu/PROEA-821-005-Spring-2018 | cde4a09a3a60b37a332895a524a7a3f63343e601 | [
"MIT"
] | null | null | null | HW1/cross_validator.py | dompuiu/PROEA-821-005-Spring-2018 | cde4a09a3a60b37a332895a524a7a3f63343e601 | [
"MIT"
] | null | null | null | from decision_tree import DecisionTree
from data_set_features_enricher import DataSetFeaturesEnricher
from data_set_loader import DataSetLoader
from data_set_classifier import DataSetClassifier
from classifier import Classifier
from tree_pruner import TreePruner
import statistics
class CrossValidator:
depths = [1,... | 38.154639 | 109 | 0.691165 |
a331fe72d2dc2d7c3f9dbf36fe908608bd8c4642 | 7,988 | py | Python | pcdet/models/roi_heads/pointrcnn_head.py | sourcery-ai-bot/PV_ENcoNet | 24f2cde258caf6a3fa82f2e1579de833727aac11 | [
"Apache-2.0"
] | 4 | 2021-02-18T10:22:11.000Z | 2021-12-31T06:11:04.000Z | pcdet/models/roi_heads/pointrcnn_head.py | sourcery-ai-bot/PV_ENcoNet | 24f2cde258caf6a3fa82f2e1579de833727aac11 | [
"Apache-2.0"
] | 3 | 2021-03-01T10:14:08.000Z | 2022-01-05T09:19:44.000Z | pcdet/models/roi_heads/pointrcnn_head.py | sourcery-ai-bot/PV_ENcoNet | 24f2cde258caf6a3fa82f2e1579de833727aac11 | [
"Apache-2.0"
] | 4 | 2021-02-21T06:14:08.000Z | 2021-05-06T07:04:56.000Z | import torch
import torch.nn as nn
from ...ops.pointnet2.pointnet2_batch import pointnet2_modules
from ...ops.roipoint_pool3d import roipoint_pool3d_utils
from ...utils import common_utils
from .roi_head_template import RoIHeadTemplate
class PointRCNNHead(RoIHeadTemplate):
def __init__(self, input_channels, mode... | 42.716578 | 116 | 0.618302 |
6da911f714e85b0cdf13bc238319439c0f7107bf | 2,548 | py | Python | app/editor/item_list_widget.py | zerorock1312/lt-maker-master | 82f733683f9dba763a5de8567c41fd7cbcfb0173 | [
"MIT"
] | null | null | null | app/editor/item_list_widget.py | zerorock1312/lt-maker-master | 82f733683f9dba763a5de8567c41fd7cbcfb0173 | [
"MIT"
] | null | null | null | app/editor/item_list_widget.py | zerorock1312/lt-maker-master | 82f733683f9dba763a5de8567c41fd7cbcfb0173 | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel, QHBoxLayout, QPushButton
from PyQt5.QtCore import Qt, pyqtSignal
from app.data.database import DB
from app.extensions.custom_gui import QHLine
from app.editor.multi_combo_box_list import MultiComboBoxListWithCheckbox
from app.editor.item_editor.item_model impo... | 31.85 | 82 | 0.671507 |
ebdf0c62c85d5a7c8b0bc838661de001e5cf25f2 | 886 | py | Python | isi_sdk_8_1_0/test/test_cluster_statfs.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/test/test_cluster_statfs.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/test/test_cluster_statfs.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... | 21.609756 | 83 | 0.699774 |
7f023394260527373bc160c429da42f754c58acf | 53,301 | py | Python | postprocess/fig12_analyze_proto.py | ampmap-cmu/AmpMap | 5f2d1e3fb9863315041d37a0727a829fce06c515 | [
"BSD-3-Clause-Clear"
] | 4 | 2021-03-29T03:48:14.000Z | 2021-09-24T10:18:15.000Z | postprocess/fig12_analyze_proto.py | ampmap-cmu/AmpMap | 5f2d1e3fb9863315041d37a0727a829fce06c515 | [
"BSD-3-Clause-Clear"
] | null | null | null | postprocess/fig12_analyze_proto.py | ampmap-cmu/AmpMap | 5f2d1e3fb9863315041d37a0727a829fce06c515 | [
"BSD-3-Clause-Clear"
] | null | null | null | import numpy as np
import pandas as pd
import ntpath
import glob,json,os,sys,time
import pandas as pd
#from sklearn.neighbors import KernelDensity
import matplotlib
#matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
#import matplotlib.pyplot as plt
# from sys import platform as sys_pf
# if sys_pf == 'darwin'... | 33.798985 | 204 | 0.608356 |
294880eec0d6288754031ac663a1d12d9e864038 | 11,753 | py | Python | haas/plugins/result_handler.py | pzahemszky/haas | d124292862b82813d6e22788a5ca477d2e248936 | [
"BSD-3-Clause"
] | null | null | null | haas/plugins/result_handler.py | pzahemszky/haas | d124292862b82813d6e22788a5ca477d2e248936 | [
"BSD-3-Clause"
] | null | null | null | haas/plugins/result_handler.py | pzahemszky/haas | d124292862b82813d6e22788a5ca477d2e248936 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
import statistics
import sys
import time
... | 33.014045 | 79 | 0.612439 |
c91a0eee44e2300d2dba2fff3a178302ca5c6149 | 1,864 | py | Python | src/windows10_system_auditor.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | 1 | 2019-11-19T00:14:03.000Z | 2019-11-19T00:14:03.000Z | src/windows10_system_auditor.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | null | null | null | src/windows10_system_auditor.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | 1 | 2017-10-03T03:21:27.000Z | 2017-10-03T03:21:27.000Z |
from windows10_system_logger import Windows10SystemLogger
from windows10_winrm_auditor import Windows10WinRMAuditor
from windows10_tmp_sys_auditor import Windows10TmpSysAuditor
from winreg_comparator import WinRegComparator
import platform
if platform.system() == "Windows":
from _winreg import *
... | 26.253521 | 76 | 0.619099 |
6869a9b3ee65ca999f5ffe57e06eed4a361d3ec6 | 1,681 | py | Python | fnet.py | onlyrico/fnet-google-pytorch | 30e687c794089e7f6eef11fdd94a8c8a3bf26c32 | [
"MIT"
] | 4 | 2021-05-18T03:13:13.000Z | 2021-05-27T22:21:51.000Z | fnet.py | onlyrico/fnet-google-pytorch | 30e687c794089e7f6eef11fdd94a8c8a3bf26c32 | [
"MIT"
] | 1 | 2021-07-15T06:20:40.000Z | 2021-07-15T06:21:23.000Z | fnet.py | onlyrico/fnet-google-pytorch | 30e687c794089e7f6eef11fdd94a8c8a3bf26c32 | [
"MIT"
] | 5 | 2021-05-18T03:13:15.000Z | 2021-10-01T21:36:18.000Z | import torch
import torch.nn as nn
class FeedForward(nn.Module):
def __init__(self, dhidden):
super().__init__()
self.dense_1 = nn.Linear(dhidden, 4*dhidden) #d_feedforward is 4*d_model
self.dense_2 = nn.Linear(4*dhidden, dhidden)
self.gelu = nn.GELU()
self.dropout ... | 23.676056 | 113 | 0.572278 |
59849002d1174339057169e7294519819552b0ea | 3,729 | py | Python | paaws/resources/userdata.py | gkope/paaws | 819408bda7a0303543ac8ba38107722f7f0dbbe8 | [
"Apache-2.0"
] | 1 | 2021-02-09T16:40:19.000Z | 2021-02-09T16:40:19.000Z | paaws/resources/userdata.py | gkope/paaws | 819408bda7a0303543ac8ba38107722f7f0dbbe8 | [
"Apache-2.0"
] | null | null | null | paaws/resources/userdata.py | gkope/paaws | 819408bda7a0303543ac8ba38107722f7f0dbbe8 | [
"Apache-2.0"
] | 5 | 2018-09-12T15:00:03.000Z | 2021-02-09T16:46:34.000Z | # -*- coding: utf-8 -*-
from boto import s3
class Userdata(object):
bucket_name = "<BUCKET-NAME>"
s3keycheck = "<S3-CHECK-KEY>"
s3host = "https://%s.s3.amazonaws.com" % bucket_name
domain = "<DOMAIN>t"
chef_install = "curl -sL http://opscode.com/chef/install.sh | bash"
get_bootstrap = "curl -s... | 34.850467 | 150 | 0.632073 |
5869fc1d13b2fb7869c66161082fe27edf20d19d | 4,600 | py | Python | baseline_model/logic.py | BlockScience/filecoin-baseline-incentives | 8f86a6c03ec5c7b7e2c5b5d31371df1d69ef6dc0 | [
"MIT"
] | null | null | null | baseline_model/logic.py | BlockScience/filecoin-baseline-incentives | 8f86a6c03ec5c7b7e2c5b5d31371df1d69ef6dc0 | [
"MIT"
] | null | null | null | baseline_model/logic.py | BlockScience/filecoin-baseline-incentives | 8f86a6c03ec5c7b7e2c5b5d31371df1d69ef6dc0 | [
"MIT"
] | 2 | 2022-02-14T15:50:41.000Z | 2022-02-23T16:50:50.000Z | from cadCAD_tools.types import Signal, VariableUpdate
from baseline_model.params import YEAR
from baseline_model.types import BaselineModelParams, BaselineModelState, Reward, Year
# ## Time Tracking
def p_evolve_time(params: BaselineModelParams,
_2,
_3,
_4) -> Si... | 34.586466 | 86 | 0.648913 |
15ff5bf48f128b3c8bd548883cdad590d26dac04 | 11,087 | py | Python | utils.py | shivam13juna/seq2seq_spelling_correction | 56952e087e8b304388fc7b7db921e0e9295a1c71 | [
"MIT"
] | 1 | 2020-07-19T11:37:09.000Z | 2020-07-19T11:37:09.000Z | utils.py | shivam13juna/seq2seq_spelling_correction | 56952e087e8b304388fc7b7db921e0e9295a1c71 | [
"MIT"
] | null | null | null | utils.py | shivam13juna/seq2seq_spelling_correction | 56952e087e8b304388fc7b7db921e0e9295a1c71 | [
"MIT"
] | null | null | null | import re
import os
import unidecode
import numpy as np
from keras.models import Model, load_model
from keras.layers import Input
from model import truncated_acc, truncated_loss
np.random.seed(1234)
SOS = '\t' # start of sequence.
EOS = '*' # end of sequence.
CHARS = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP... | 38.363322 | 75 | 0.633986 |
a9335b500890fdfa5bb56d85afbba0eea68113e3 | 63 | py | Python | fulmo/modules/pooling/__init__.py | jexio/fulmo | daa4bd4f1cf3b8bd785a9024a413db9a0238f10c | [
"MIT"
] | null | null | null | fulmo/modules/pooling/__init__.py | jexio/fulmo | daa4bd4f1cf3b8bd785a9024a413db9a0238f10c | [
"MIT"
] | 80 | 2021-07-13T12:58:25.000Z | 2022-03-24T03:17:08.000Z | fulmo/modules/pooling/__init__.py | jexio/fulmo | daa4bd4f1cf3b8bd785a9024a413db9a0238f10c | [
"MIT"
] | null | null | null | # flake8: noqa
from .base import Flatten, SelectAdaptivePool2d
| 21 | 47 | 0.809524 |
4434483b0d2d73b9368f7e1d50110264ad9a28c7 | 3,504 | py | Python | macgraph/cell/query.py | Octavian-ai/mac-graph | 3ef978e8a6f79f2dcc46783d34f01934aabf7f19 | [
"Unlicense"
] | 116 | 2018-07-11T13:19:56.000Z | 2021-07-26T17:22:44.000Z | macgraph/cell/query.py | Octavian-ai/mac-graph | 3ef978e8a6f79f2dcc46783d34f01934aabf7f19 | [
"Unlicense"
] | 1 | 2019-02-11T02:25:02.000Z | 2019-02-11T17:05:19.000Z | macgraph/cell/query.py | Octavian-ai/mac-graph | 3ef978e8a6f79f2dcc46783d34f01934aabf7f19 | [
"Unlicense"
] | 21 | 2018-10-11T23:03:22.000Z | 2021-07-14T22:42:08.000Z |
import tensorflow as tf
from ..attention import *
from .types import *
def generate_token_index_query(context:CellContext, name:str):
with tf.name_scope(name):
with tf.variable_scope(name):
taps = {}
master_signal = context.in_iter_id
token_index_signal, attn = attention_by_index(context.in_question_tok... | 38.505495 | 156 | 0.682078 |
aee31603081ec7c8b7b8efe2492d58647bc145db | 288 | py | Python | neuromaps/tests/test_parcellate.py | VinceBaz/neuromaps | 6758b53e127d1563fa06eb26bc5f08a4e24ae7e7 | [
"BSD-3-Clause"
] | null | null | null | neuromaps/tests/test_parcellate.py | VinceBaz/neuromaps | 6758b53e127d1563fa06eb26bc5f08a4e24ae7e7 | [
"BSD-3-Clause"
] | null | null | null | neuromaps/tests/test_parcellate.py | VinceBaz/neuromaps | 6758b53e127d1563fa06eb26bc5f08a4e24ae7e7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
For testing neuromaps.parcellate functionality
"""
import pytest
@pytest.mark.xfail
def test__gifti_to_array():
assert False
@pytest.mark.xfail
def test__array_to_gifti():
assert False
@pytest.mark.xfail
def test_Parcellater():
assert False
| 13.090909 | 46 | 0.71875 |
bb2d737124b37926ba291630e931a4225cc144e7 | 6,717 | py | Python | framework/sessions/__init__.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | framework/sessions/__init__.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | framework/sessions/__init__.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime as dt
import httplib as http
import urllib
import urlparse
from django.utils import timezone
from django.db.models import Q
from django.apps import apps
import bson.objectid
import itsdangerous
from flask import request
import furl
from weakref import WeakKeyDictionary
from werk... | 36.704918 | 158 | 0.682745 |
8fd065cbdb11ace747dff8770776bd499bdd58d6 | 33,996 | py | Python | cat/plots.py | elcortegano/Comparative-Annotation-Toolkit | c4fc3ceddee883af2b0acd772b25e987b1bf2667 | [
"Apache-2.0"
] | 109 | 2016-12-12T07:18:40.000Z | 2022-03-18T02:07:35.000Z | cat/plots.py | elcortegano/Comparative-Annotation-Toolkit | c4fc3ceddee883af2b0acd772b25e987b1bf2667 | [
"Apache-2.0"
] | 192 | 2016-10-26T22:09:07.000Z | 2021-11-24T00:11:33.000Z | cat/plots.py | elcortegano/Comparative-Annotation-Toolkit | c4fc3ceddee883af2b0acd772b25e987b1bf2667 | [
"Apache-2.0"
] | 44 | 2016-12-06T04:03:19.000Z | 2022-03-12T08:59:32.000Z | """
Generate all plots for the pipeline. For biotype specific plots, all plots are generated as a multi page PDF. There
is a plot for each biotype on its own, and one for the combined results.
"""
import json
import luigi
import matplotlib
import logging
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.use('Agg')
im... | 49.198263 | 121 | 0.639928 |
181d12a54fe8698f2ff11257e6e8aa9760d71353 | 391,656 | py | Python | languages/it.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | languages/it.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | languages/it.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '\\ " update\\ " è un\' espressione facoltativa come " field1=\'newvalue\'". Non è possibile aggiornare o eliminare i risultati di una JOIN',
'# of International Staff': '# di Pe... | 62.946962 | 939 | 0.757124 |
eb91c65bbe1cf233f3844f7cdb1f3e2103442629 | 28,059 | py | Python | test/unit/common/middleware/test_tempurl.py | CiscoSystems/swift | d5067017f0509129d8d3e41aeff5d7c2a634643e | [
"Apache-2.0"
] | null | null | null | test/unit/common/middleware/test_tempurl.py | CiscoSystems/swift | d5067017f0509129d8d3e41aeff5d7c2a634643e | [
"Apache-2.0"
] | null | null | null | test/unit/common/middleware/test_tempurl.py | CiscoSystems/swift | d5067017f0509129d8d3e41aeff5d7c2a634643e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2011 OpenStack, 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 to in wr... | 42.772866 | 79 | 0.585588 |
19af5a8a438176b7590d16742d09826ba4c2129f | 12,844 | py | Python | recipe_scrapers/__init__.py | Niceta-Nduku/recipe-scrapers | 98c0f835fa1a18f4c7c4cd4f696cb6fdfd726427 | [
"MIT"
] | null | null | null | recipe_scrapers/__init__.py | Niceta-Nduku/recipe-scrapers | 98c0f835fa1a18f4c7c4cd4f696cb6fdfd726427 | [
"MIT"
] | null | null | null | recipe_scrapers/__init__.py | Niceta-Nduku/recipe-scrapers | 98c0f835fa1a18f4c7c4cd4f696cb6fdfd726427 | [
"MIT"
] | null | null | null | from ._exceptions import NoSchemaFoundInWildMode, WebsiteNotImplementedError
from ._factory import SchemaScraperFactory
from ._utils import get_host_name
from .abril import Abril
from .acouplecooks import ACoupleCooks
from .afghankitchenrecipes import AfghanKitchenRecipes
from .allrecipes import AllRecipes
from .alltom... | 37.665689 | 77 | 0.783868 |
ecc310cc42be235180d5bd084d95d214f0c2a4ed | 1,600 | py | Python | pycorrector/conv_seq2seq/config.py | Sueying/pycorrector | d4c8dbee7d055cd410d56bd1b52f0780ec8d1983 | [
"Apache-2.0"
] | 2 | 2020-09-21T01:59:48.000Z | 2020-09-21T02:16:15.000Z | pycorrector/conv_seq2seq/config.py | Sueying/pycorrector | d4c8dbee7d055cd410d56bd1b52f0780ec8d1983 | [
"Apache-2.0"
] | null | null | null | pycorrector/conv_seq2seq/config.py | Sueying/pycorrector | d4c8dbee7d055cd410d56bd1b52f0780ec8d1983 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: XuMing(xuming624@qq.com)
# Brief: Use CGED corpus
import os
pwd_path = os.path.abspath(os.path.dirname(__file__))
# Training data path.
# toy chinese corpus
raw_train_paths = [
os.path.join(pwd_path, '../data/cn/CGED/CGED18_HSK_TrainingSet.xml'),
os.path.join(pwd_path, '../da... | 30.769231 | 80 | 0.73375 |
f66bfa3d7bf558306a628eb63d8b33489b1fac81 | 408 | py | Python | beancount_gmail/uk_paypal_email/common_re.py | kubauk/beancount-import-gmail | cf462d0dfb774d26c21a633bd460a0dfb1b2476b | [
"MIT"
] | 1 | 2022-01-10T01:52:21.000Z | 2022-01-10T01:52:21.000Z | beancount_gmail/uk_paypal_email/common_re.py | kubauk/beancount-import-gmail | cf462d0dfb774d26c21a633bd460a0dfb1b2476b | [
"MIT"
] | 1 | 2022-01-13T22:00:18.000Z | 2022-01-13T23:03:49.000Z | beancount_gmail/uk_paypal_email/common_re.py | kubauk/beancount-import-gmail | cf462d0dfb774d26c21a633bd460a0dfb1b2476b | [
"MIT"
] | 1 | 2022-01-13T21:42:20.000Z | 2022-01-13T21:42:20.000Z | import re
DONATION_DETAILS_RE: str = re.compile(r"Donation amount:(?P<Donation>£\d+\.\d\d [A-Z]{3}) +"
r"Total:(?P<Total>£\d+\.\d\d [A-Z]{3}) +"
r"Purpose:(?P<Purpose>[ \S]+\S) +"
r"Contributor:")
UUID_PA... | 45.333333 | 94 | 0.401961 |
05611796644dab073b8a5875eb67dbd2ccb9ed20 | 358 | py | Python | onnx2pytorch/operations/div.py | Piteryo/onnx2pytorch | c25b3a5289ee7073d644d280a112c15382b7f690 | [
"Apache-2.0"
] | null | null | null | onnx2pytorch/operations/div.py | Piteryo/onnx2pytorch | c25b3a5289ee7073d644d280a112c15382b7f690 | [
"Apache-2.0"
] | null | null | null | onnx2pytorch/operations/div.py | Piteryo/onnx2pytorch | c25b3a5289ee7073d644d280a112c15382b7f690 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
class Div(nn.Module):
def forward(self, input, other):
res_type = torch.result_type(input, other)
if not res_type.is_floating_point:
return torch.div(input, other, rounding_mode='floor')
true_quotient = torch.true_divide(input, other)
r... | 27.538462 | 65 | 0.664804 |
7b247f8a7727f74c47814e90990b04186a7f5eb9 | 984 | py | Python | zeeguu_api/api/system_languages.py | TWEApol/Zeeguu-API | 832f1cb2d0950bd879af72d9e606783698d78b57 | [
"MIT"
] | null | null | null | zeeguu_api/api/system_languages.py | TWEApol/Zeeguu-API | 832f1cb2d0950bd879af72d9e606783698d78b57 | [
"MIT"
] | null | null | null | zeeguu_api/api/system_languages.py | TWEApol/Zeeguu-API | 832f1cb2d0950bd879af72d9e606783698d78b57 | [
"MIT"
] | null | null | null | import json
from . import api
from .utils.route_wrappers import cross_domain
from zeeguu.model import Language
@api.route("/available_languages", methods=["GET"])
@cross_domain
def available_languages():
"""
:return: jason with language codes for the
supported languages.
e.g. ["en", "fr", "de", "it",... | 26.594595 | 92 | 0.686992 |
46ead359c5f0999858651daf79e50053a08dd03a | 4,957 | py | Python | solutions/PE420.py | KerimovEmil/ProjectEuler | bc9cb682181c1ac7889ee57c36d32beae7b441a8 | [
"MIT"
] | 1 | 2022-01-22T19:48:44.000Z | 2022-01-22T19:48:44.000Z | solutions/PE420.py | KerimovEmil/ProjectEuler | bc9cb682181c1ac7889ee57c36d32beae7b441a8 | [
"MIT"
] | null | null | null | solutions/PE420.py | KerimovEmil/ProjectEuler | bc9cb682181c1ac7889ee57c36d32beae7b441a8 | [
"MIT"
] | null | null | null | """
PROBLEM
A positive integer matrix is a matrix whose elements are all positive integers.
Some positive integer matrices can be expressed as a square of a positive integer matrix in two different ways.
Here is an example:
(40, 12 ; 48,40)=(2, 3 ; 12, 2)^2=(6, 1 ; 4,6)^2
We define F(N) as the number of the 2x2 posit... | 37.55303 | 118 | 0.519467 |
fe204a3d826f11a8b63c6906fc19cdda608b861f | 3,939 | py | Python | tests/dev/test_set_matrix.py | jinzhang21/mlflow | e926be917795fd945ea347e02cf31214008d3f1e | [
"Apache-2.0"
] | 10,351 | 2018-07-31T02:52:49.000Z | 2022-03-31T23:33:13.000Z | tests/dev/test_set_matrix.py | jinzhang21/mlflow | e926be917795fd945ea347e02cf31214008d3f1e | [
"Apache-2.0"
] | 3,733 | 2018-07-31T01:38:51.000Z | 2022-03-31T23:56:25.000Z | tests/dev/test_set_matrix.py | jinzhang21/mlflow | e926be917795fd945ea347e02cf31214008d3f1e | [
"Apache-2.0"
] | 2,596 | 2018-07-31T06:38:39.000Z | 2022-03-31T23:56:32.000Z | import json
import re
from unittest import mock
import tempfile
from contextlib import contextmanager
import functools
from pathlib import Path
import pytest
from dev.set_matrix import generate_matrix
class MockResponse:
def __init__(self, body):
self.body = body
def read(self):
return json... | 29.395522 | 93 | 0.619447 |
074e0845025063878ec90065a4b1f4aa1d26dad6 | 1,343 | py | Python | setup.py | zachzager/specter-desktop | a960ad01a5d3acc4f47983970ab78dd87751a492 | [
"MIT"
] | 1 | 2020-12-11T23:19:25.000Z | 2020-12-11T23:19:25.000Z | setup.py | zachzager/specter-desktop | a960ad01a5d3acc4f47983970ab78dd87751a492 | [
"MIT"
] | 1 | 2021-01-20T10:30:11.000Z | 2021-01-20T15:09:48.000Z | setup.py | zachzager/specter-desktop | a960ad01a5d3acc4f47983970ab78dd87751a492 | [
"MIT"
] | 1 | 2022-02-19T03:01:47.000Z | 2022-02-19T03:01:47.000Z | from glob import glob
from setuptools import find_namespace_packages, setup
with open("requirements.txt") as f:
install_reqs = f.read().strip().split("\n")
# Filter out comments/hashes
reqs = []
for req in install_reqs:
if req.startswith("#") or req.startswith(" --hash="):
continue
reqs.appen... | 31.97619 | 91 | 0.678332 |
6e86487bb7c4c67dcc4bb353cb6a6f8e30a2b5e1 | 1,011 | py | Python | forms/migrations/0039_auto_20200120_1536.py | CodeForAfrica/gmmp | d7ffe2dac16bd57e81bb3555ddea9df1fe7e9ebf | [
"Apache-2.0"
] | 4 | 2020-01-05T09:14:19.000Z | 2022-02-17T03:22:09.000Z | forms/migrations/0039_auto_20200120_1536.py | CodeForAfrica/gmmp | d7ffe2dac16bd57e81bb3555ddea9df1fe7e9ebf | [
"Apache-2.0"
] | 68 | 2019-12-23T02:19:55.000Z | 2021-04-23T06:13:36.000Z | forms/migrations/0039_auto_20200120_1536.py | CodeForAfrica/gmmp | d7ffe2dac16bd57e81bb3555ddea9df1fe7e9ebf | [
"Apache-2.0"
] | 2 | 2020-11-07T12:23:21.000Z | 2021-11-07T18:21:31.000Z | # Generated by Django 2.2.9 on 2020-01-20 15:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forms', '0038_auto_20200115_0622'),
]
operations = [
migrations.AlterField(
model_name='radioperson',
name='special_... | 34.862069 | 146 | 0.573689 |
4f4521d43917b3bcf132bb8fcea9dd989c6ab87f | 7,932 | py | Python | tests/model_tests/test_protocols.py | comerford/nsot | 941b11f84f5c0d210f638654a6ed34a5610af22a | [
"Apache-2.0"
] | 387 | 2015-01-08T01:41:45.000Z | 2022-03-15T09:46:32.000Z | tests/model_tests/test_protocols.py | jathanism/nsot | 9369c86189a64c682e28fd5663762e4d3205b058 | [
"Apache-2.0"
] | 215 | 2015-01-08T19:23:10.000Z | 2021-04-10T16:59:58.000Z | tests/model_tests/test_protocols.py | jathanism/nsot | 9369c86189a64c682e28fd5663762e4d3205b058 | [
"Apache-2.0"
] | 81 | 2015-01-08T19:48:34.000Z | 2021-09-28T09:20:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
import pytest
from nsot import exc, models
from .fixtures import circuit, site
import six
# Allow everything in there to access the DB
pytestmark = pytest.mark.django_db
@pytest.fixture
def asn_attribute(site):
... | 29.707865 | 79 | 0.611195 |
53ac542bbf9f1d8b21f371521e04c9c93a9ca781 | 87 | py | Python | enthought/enable/drag_resize.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/enable/drag_resize.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/enable/drag_resize.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from enable.drag_resize import *
| 21.75 | 38 | 0.83908 |
1d77e968150608bc9793402c0aeaf2bcac4e5e7e | 601 | py | Python | tests/test_utils.py | zsiciarz/django-pgallery | 8dee38433645d2f45b3957520e61a72cd652534b | [
"MIT"
] | 20 | 2015-01-15T02:59:23.000Z | 2022-02-03T14:49:21.000Z | tests/test_utils.py | zsiciarz/django-pgallery | 8dee38433645d2f45b3957520e61a72cd652534b | [
"MIT"
] | 18 | 2015-10-04T06:14:52.000Z | 2022-03-11T23:17:08.000Z | tests/test_utils.py | zsiciarz/django-pgallery | 8dee38433645d2f45b3957520e61a72cd652534b | [
"MIT"
] | 13 | 2015-07-12T20:24:03.000Z | 2020-11-27T22:44:19.000Z | import unittest
from pgallery.models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "abc\x00d"
self.assertEqual... | 27.318182 | 69 | 0.627288 |
6255045949fc8dc992371f34a5f244ff35457d14 | 7,836 | py | Python | imctoolkit/spatial_single_cell_data.py | BodenmillerGroup/imctoolkit | bf87b8f75e6f32f88b913eb709f3f7541e209159 | [
"MIT"
] | 1 | 2021-06-15T16:42:14.000Z | 2021-06-15T16:42:14.000Z | imctoolkit/spatial_single_cell_data.py | BodenmillerGroup/imctoolkit | bf87b8f75e6f32f88b913eb709f3f7541e209159 | [
"MIT"
] | 5 | 2021-03-15T11:22:06.000Z | 2021-06-04T09:45:54.000Z | imctoolkit/spatial_single_cell_data.py | BodenmillerGroup/imctoolkit | bf87b8f75e6f32f88b913eb709f3f7541e209159 | [
"MIT"
] | 1 | 2021-04-16T16:27:47.000Z | 2021-04-16T16:27:47.000Z | import numpy as np
import pandas as pd
import xarray as xr
from abc import ABC, abstractmethod
from pathlib import Path
from scipy.spatial import distance
from typing import Optional, Sequence, Union
from imctoolkit import utils
try:
import anndata
except:
anndata = None
try:
import fcswrite
except:
... | 47.490909 | 120 | 0.67343 |
894ae47cabe74c3dad4e35e24d641767dfe3e74d | 2,337 | py | Python | app/sceneseg_tester.py | StarRealMan/StarNet | 5fd36b4a545a494eb4dc6d309469696b5d2f8abb | [
"MIT"
] | 2 | 2020-12-02T14:16:26.000Z | 2020-12-02T14:20:15.000Z | app/sceneseg_tester.py | StarRealMan/StarNet | 5fd36b4a545a494eb4dc6d309469696b5d2f8abb | [
"MIT"
] | null | null | null | app/sceneseg_tester.py | StarRealMan/StarNet | 5fd36b4a545a494eb4dc6d309469696b5d2f8abb | [
"MIT"
] | 1 | 2020-12-02T15:04:40.000Z | 2020-12-02T15:04:40.000Z | import sys
sys.path.append("..")
import os
import torch
import argparse
from app import dataloader
from model import StarNet
from app import visualizer
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, default='../data/Stanford3dDataset_v1.2_Aligned_Version', help='')
parser.add_argument('... | 40.293103 | 111 | 0.676936 |
9f26fa5878777d3302383646ad581056f429841a | 2,507 | py | Python | youtube_dl/extractor/cultureunplugged.py | LyleH/youtube-dl | 7564b09ef5c09454908f78cb91c3bd2d6daacac5 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/cultureunplugged.py | LyleH/youtube-dl | 7564b09ef5c09454908f78cb91c3bd2d6daacac5 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/cultureunplugged.py | LyleH/youtube-dl | 7564b09ef5c09454908f78cb91c3bd2d6daacac5 | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
int_or_none,
HEADRequest,
)
class CultureUnpluggedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cultureunplugged\.com/documentary/watch-online/play/(?P<id>\d+)(?:/(?P<display_id>[... | 35.309859 | 129 | 0.58556 |
b608c2cb98f338f88a106b4a262a9e752d82505c | 1,935 | py | Python | scripts/games/NumberGuess.py | Qazaroth/pget-list | 054de6d60e195505aebd728a30c261353bd6cc5e | [
"MIT"
] | null | null | null | scripts/games/NumberGuess.py | Qazaroth/pget-list | 054de6d60e195505aebd728a30c261353bd6cc5e | [
"MIT"
] | null | null | null | scripts/games/NumberGuess.py | Qazaroth/pget-list | 054de6d60e195505aebd728a30c261353bd6cc5e | [
"MIT"
] | null | null | null | import random
#Source: https://pastebin.com/qFd2ynMN
# Setup game variabels
randomNumber = random.randint(1,100)
print(randomNumber)
gameRunning = True
numbersGuessed = []
tries = 0
# Game startup
print("Hello, and welcome to this simple console game.")
playerName = input("What is your name? ")
print("Hello, " + ... | 28.043478 | 78 | 0.594832 |
575fd97c9ff9f76154d9b0252038554f7baf9e51 | 3,135 | py | Python | lib/modules/powershell/management/honeyhash.py | lex0tanl/Empire | c8217e87cf333797eb363b782f769cc4b2f64b0b | [
"BSD-3-Clause"
] | 3 | 2018-01-05T03:59:44.000Z | 2020-02-11T03:25:46.000Z | lib/modules/powershell/management/honeyhash.py | gcxtx/Empire | dfb049ed48165eff2a8c1fe41941d0fbfa42df31 | [
"BSD-3-Clause"
] | null | null | null | lib/modules/powershell/management/honeyhash.py | gcxtx/Empire | dfb049ed48165eff2a8c1fe41941d0fbfa42df31 | [
"BSD-3-Clause"
] | 3 | 2017-11-27T07:29:34.000Z | 2018-09-23T06:27:05.000Z | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'New-HoneyHash',
'Author': ['@mattifestation'],
'Description': ('Inject artificial credentials into LSASS.'),
'Background' : False,
'... | 32.65625 | 102 | 0.500797 |
8afd74d053105eb30a29fd2ffbe4e59d9c238354 | 2,887 | py | Python | dprofiling/backends/db.py | TAMUArch/django-profiling | 092bfc397abd36d5f1e95e3ce4e4815ad36d0c60 | [
"Apache-2.0"
] | null | null | null | dprofiling/backends/db.py | TAMUArch/django-profiling | 092bfc397abd36d5f1e95e3ce4e4815ad36d0c60 | [
"Apache-2.0"
] | null | null | null | dprofiling/backends/db.py | TAMUArch/django-profiling | 092bfc397abd36d5f1e95e3ce4e4815ad36d0c60 | [
"Apache-2.0"
] | null | null | null | from logging import getLogger
from os import unlink, fdopen
from pstats import Stats
from tempfile import mkstemp
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.files import File
from dprofiling.models import Session, Profile
log = getLogger('dprofil... | 34.369048 | 82 | 0.55213 |
5372fa7f067abd53bffb4e5d4c17f9ef731df8c5 | 3,655 | py | Python | lektor/pagination.py | maikelwever/lektor | 83a2ba58eb964e2c7b8ae258aead456677d267a6 | [
"BSD-3-Clause"
] | 1 | 2020-06-19T05:58:50.000Z | 2020-06-19T05:58:50.000Z | lektor/pagination.py | maikelwever/lektor | 83a2ba58eb964e2c7b8ae258aead456677d267a6 | [
"BSD-3-Clause"
] | 79 | 2019-02-11T14:08:06.000Z | 2019-02-18T14:58:01.000Z | lektor/pagination.py | slarse/lektor | 3d82277a04d2e40fdc8b7dce451c9201c5362c9c | [
"BSD-3-Clause"
] | 1 | 2019-07-30T03:20:23.000Z | 2019-07-30T03:20:23.000Z | from math import ceil
from lektor._compat import range_type
class Pagination(object):
def __init__(self, record, pagination_config):
#: the pagination config
self.config = pagination_config
#: the current page's record
self.current = record
#: the current page number (1 i... | 32.633929 | 79 | 0.532695 |
09a1fdf8b0ab6b172f60ab62b85d4e273c048905 | 797 | py | Python | sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 41.947368 | 90 | 0.662484 |
6bc478ee35149cc182bc955eea15153f5d4f80d9 | 31 | py | Python | btd6_memory_info/generated/Assets/Scripts/Models/Towers/Behaviors/SlowBloonsZoneModel/slow_bloons_zone_model.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Models/Towers/Behaviors/SlowBloonsZoneModel/slow_bloons_zone_model.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Models/Towers/Behaviors/SlowBloonsZoneModel/slow_bloons_zone_model.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class SlowBloonsZoneModel: pass | 31 | 31 | 0.903226 |
1a3305ee37985617a33e7786a21adb820337f58f | 1,817 | py | Python | test_autofit/non_linear/paths/test_paths.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | null | null | null | test_autofit/non_linear/paths/test_paths.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | null | null | null | test_autofit/non_linear/paths/test_paths.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | null | null | null | import os
import pickle
from pathlib import Path
import pytest
import autofit as af
from autoconf.conf import output_path_for_test
from autofit.non_linear.paths.null import NullPaths
def test_null_paths():
search = af.DynestyStatic()
assert isinstance(
search.paths,
NullPaths
)
class ... | 20.41573 | 54 | 0.656577 |
570ef5390a7f912be5233b8203048b67ea17c9c9 | 2,326 | py | Python | tests/characterization/ini-parse-test.py | imgulyas/elm-ini-parser | ef6c04d889aef354d52c70d02561a04705614a0a | [
"MIT"
] | 3 | 2019-02-27T20:35:42.000Z | 2019-03-03T06:24:05.000Z | tests/characterization/ini-parse-test.py | imgulyas/elm-ini-parser | ef6c04d889aef354d52c70d02561a04705614a0a | [
"MIT"
] | null | null | null | tests/characterization/ini-parse-test.py | imgulyas/elm-ini-parser | ef6c04d889aef354d52c70d02561a04705614a0a | [
"MIT"
] | 1 | 2019-03-04T14:42:20.000Z | 2019-03-04T14:42:20.000Z | #!/usr/bin/env python
import configparser
INI_FILE = """
[Simple Values]
key=value
spaces in keys=allowed
spaces in values=allowed as well
spaces around the delimiter = obviously
you can also use : to delimit keys from values
[All Values Are Strings]
values like this: 1000000
or this: 3.14159265359
are they treated ... | 41.535714 | 936 | 0.698624 |
3d2565e1fc418b1702ac2d4962313c6135d75533 | 76,678 | py | Python | data_parsing_code/parse_verb_html.py | WaelMohammedAbed/Natural-Language-Generation-for-the-Arabic-Language | 49de1df243e3458e33d1a6439a00b18500d16f05 | [
"MIT"
] | 2 | 2021-06-02T16:43:16.000Z | 2021-08-18T18:29:26.000Z | data_parsing_code/parse_verb_html.py | WaelMohammedAbed/Natural-Language-Generation-for-the-Arabic-Language | 49de1df243e3458e33d1a6439a00b18500d16f05 | [
"MIT"
] | null | null | null | data_parsing_code/parse_verb_html.py | WaelMohammedAbed/Natural-Language-Generation-for-the-Arabic-Language | 49de1df243e3458e33d1a6439a00b18500d16f05 | [
"MIT"
] | null | null | null |
import codecs
import pandas as pd
import numpy as np
import mysql.connector as MySQL
import re
arabic_diacritics = re.compile("""
ّ | # Tashdid
َ | # Fatha
ً | # Tanwin Fath
ُ | # Damma
... | 78.483112 | 240 | 0.627951 |
a9f0008bb83caafe11488327ed0b5e9ad852e2b0 | 10,713 | py | Python | src/lib/models/networks/resnet_fpn_dcn.py | CaptainEven/FairMOTVehicle | 1d9033bcab9723cc5be3d5d94a5ac3712e8e143e | [
"MIT"
] | 152 | 2020-06-11T08:27:32.000Z | 2022-03-26T16:35:55.000Z | src/lib/models/networks/resnet_fpn_dcn.py | christw16/FairMOTVehicle | 1d9033bcab9723cc5be3d5d94a5ac3712e8e143e | [
"MIT"
] | 24 | 2020-06-11T14:57:41.000Z | 2022-03-19T10:07:42.000Z | src/lib/models/networks/resnet_fpn_dcn.py | christw16/FairMOTVehicle | 1d9033bcab9723cc5be3d5d94a5ac3712e8e143e | [
"MIT"
] | 29 | 2020-06-11T09:42:22.000Z | 2022-01-28T22:32:12.000Z | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Dequan Wang and Xingyi Zhou
# ------------------------------------------------------------------------------
from __f... | 34.009524 | 107 | 0.570895 |
bd9e798e73229b0651b2defd245e64baf1ce1c56 | 17,697 | py | Python | fieldkit/test/test_mesh.py | djz332/fieldkit | 3c242c2026e80100cdd6b2114d72a61122381fcd | [
"BSD-3-Clause"
] | null | null | null | fieldkit/test/test_mesh.py | djz332/fieldkit | 3c242c2026e80100cdd6b2114d72a61122381fcd | [
"BSD-3-Clause"
] | 3 | 2020-04-25T21:39:48.000Z | 2020-12-14T23:12:14.000Z | fieldkit/test/test_mesh.py | djz332/fieldkit | 3c242c2026e80100cdd6b2114d72a61122381fcd | [
"BSD-3-Clause"
] | 1 | 2020-03-17T22:00:42.000Z | 2020-03-17T22:00:42.000Z | """ Unit tests for mesh-related data structures.
"""
import unittest
import numpy as np
import fieldkit
class MeshTest(unittest.TestCase):
""" Test cases for :py:class:`~fieldkit.mesh.Mesh`
"""
def test_cube(self):
""" Test mesh formation in simple cube.
"""
mesh = fieldkit.Mesh().... | 43.375 | 121 | 0.595073 |
c052dddc6e4aac67a2bc48928308b8e618989a17 | 3,726 | py | Python | brax/experimental/biggym/tasks.py | bharadwaj1098/brax | 3108a0535b9b59725c97ef35732ed0378c0fd5cc | [
"Apache-2.0"
] | 1,162 | 2021-06-03T20:15:05.000Z | 2022-03-31T19:53:06.000Z | brax/experimental/biggym/tasks.py | bharadwaj1098/brax | 3108a0535b9b59725c97ef35732ed0378c0fd5cc | [
"Apache-2.0"
] | 160 | 2021-06-05T02:32:39.000Z | 2022-03-31T11:39:58.000Z | brax/experimental/biggym/tasks.py | bharadwaj1098/brax | 3108a0535b9b59725c97ef35732ed0378c0fd5cc | [
"Apache-2.0"
] | 117 | 2021-06-04T17:18:21.000Z | 2022-03-30T18:04:48.000Z | # Copyright 2021 The Brax 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 agreed to in wri... | 32.4 | 79 | 0.6562 |
b01d3cbd4c1522598097c3d1996d5375878df602 | 6,889 | py | Python | hotel/migrations/0001_initial.py | Hotel-online/hotel-serveAntes | 725615fd823206e8abcbcef926d149003593b5cc | [
"MIT"
] | null | null | null | hotel/migrations/0001_initial.py | Hotel-online/hotel-serveAntes | 725615fd823206e8abcbcef926d149003593b5cc | [
"MIT"
] | null | null | null | hotel/migrations/0001_initial.py | Hotel-online/hotel-serveAntes | 725615fd823206e8abcbcef926d149003593b5cc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-20 19:25
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 42.006098 | 136 | 0.55262 |
e7d96123833e0ae04a468c31d8773af8d24fe625 | 400 | py | Python | tradgram/caseFiles/migrations/0006_casefile_file_pdf.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | tradgram/caseFiles/migrations/0006_casefile_file_pdf.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | 4 | 2020-06-05T20:21:46.000Z | 2021-09-08T00:57:42.000Z | tradgram/caseFiles/migrations/0006_casefile_file_pdf.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.8 on 2019-03-19 14:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('caseFiles', '0005_auto_20181201_2249'),
]
operations = [
migrations.AddField(
model_name='casefile',
name='file_pdf'... | 21.052632 | 60 | 0.6 |
689400d9f951fba52b9248602fe2ab4b65aefa57 | 5,974 | py | Python | code/enemy.py | leggettc18/zelda-style-rpg | 4f4114f263801ab09eb6b71d9fd77a80ddce727a | [
"MIT"
] | null | null | null | code/enemy.py | leggettc18/zelda-style-rpg | 4f4114f263801ab09eb6b71d9fd77a80ddce727a | [
"MIT"
] | null | null | null | code/enemy.py | leggettc18/zelda-style-rpg | 4f4114f263801ab09eb6b71d9fd77a80ddce727a | [
"MIT"
] | null | null | null | """Module for enemy classes and functions"""
import pygame
from support import import_folder
# pylint:disable=wildcard-import,unused-wildcard-import
from settings import *
from entity import Entity
class Enemy(Entity):
"""Class for managing enemy data"""
def __init__(self, monster_name, pos, groups, obstacle... | 36.650307 | 89 | 0.621861 |
6112e88b94c541870d7f30b68fc2d7b3cdb2020e | 788 | py | Python | setup.py | gilsho/kryptonite | d20a15e4fd28cb880180b827099168dd87eb0291 | [
"MIT"
] | 1 | 2019-10-13T10:06:49.000Z | 2019-10-13T10:06:49.000Z | setup.py | gilsho/kryptonite | d20a15e4fd28cb880180b827099168dd87eb0291 | [
"MIT"
] | 7 | 2015-01-21T18:51:24.000Z | 2017-02-09T23:08:39.000Z | setup.py | gilsho/kryptonite | d20a15e4fd28cb880180b827099168dd87eb0291 | [
"MIT"
] | 2 | 2015-04-26T20:03:50.000Z | 2020-11-20T09:54:06.000Z | #!/usr/bin/env python
from distutils.core import setup
setup(
name='kryptonite',
packages=['kryptonite'],
license='MIT',
version='0.1.4',
description='Cryptography for humans',
long_description='',
author='Gil Shotan',
author_email='gil@gilshotan.com',
url='https://github.com/gilsh... | 30.307692 | 70 | 0.639594 |
9f20e558656d89436cbca89a4288f12d70044358 | 2,498 | py | Python | easybk/tasks/pack_task.py | ljskr/server_backup_script | 69838a079edb4f4f3a04d38f3fe685679d542179 | [
"Apache-2.0"
] | null | null | null | easybk/tasks/pack_task.py | ljskr/server_backup_script | 69838a079edb4f4f3a04d38f3fe685679d542179 | [
"Apache-2.0"
] | null | null | null | easybk/tasks/pack_task.py | ljskr/server_backup_script | 69838a079edb4f4f3a04d38f3fe685679d542179 | [
"Apache-2.0"
] | null | null | null | """
Author: liujun (ljskryj@163.com)
Date: 2018-07-10
"""
import datetime
import logging
import os
from .task import Task
from ..encipher_manager import EncipherManager
class PackTask(Task):
"""
打包备份任务
参数:
name 任务名
output_dir 本地备份路径
tar_run_dir tar 命令运行路径
backup_list... | 27.755556 | 88 | 0.563651 |
8bcf3fd2ebfd75f548c2cc3b3b54d26a01070446 | 5,933 | py | Python | tests/functional/tests/security/test_secure_erase.py | mahsaama/MRUPolicyInOpenCAS | bb97122f31dd64f2fb7d2be47057cf0721d109ab | [
"BSD-3-Clause-Clear"
] | 3 | 2021-07-29T08:39:03.000Z | 2022-02-25T10:00:36.000Z | tests/functional/tests/security/test_secure_erase.py | josehu07/ocf-mf | 3e54f9a1de24ec7f44869e7f2c5a6883321d32bd | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/functional/tests/security/test_secure_erase.py | josehu07/ocf-mf | 3e54f9a1de24ec7f44869e7f2c5a6883321d32bd | [
"BSD-3-Clause-Clear"
] | null | null | null | #
# Copyright(c) 2019-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import pytest
from ctypes import c_int
from pyocf.types.cache import Cache, CacheMode
from pyocf.types.core import Core
from pyocf.types.volume import Volume
from pyocf.utils import Size as S
from pyocf.types.data import Data... | 27.467593 | 88 | 0.647396 |
db876442ef7432376fa8a1a6cb2f29394de2b9ab | 6,301 | py | Python | numba/roc/tests/hsapy/test_math.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | numba/roc/tests/hsapy/test_math.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 108 | 2020-08-17T22:38:26.000Z | 2021-12-06T09:44:14.000Z | numba/roc/tests/hsapy/test_math.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import numpy as np
import math
import unittest
from numba import roc
from numba.core import utils
class TestMath(unittest.TestCase):
def _get_tol(self, math_fn, ty):
"""gets the tolerance for functions when the input is of type 'ty'"""
low_res = {
(math.gamma, np.float64): 1e-14,
... | 34.812155 | 77 | 0.487224 |
9068d53f23848f8d2c013b01a2e5e860942f9ba0 | 169 | py | Python | app/handlers.py | jeffyboh/flask-rest | c750043c75d049bfe9eee4db01301de30b8c1c1b | [
"MIT"
] | 1 | 2019-02-06T00:11:53.000Z | 2019-02-06T00:11:53.000Z | app/handlers.py | jeffyboh/flask-rest | c750043c75d049bfe9eee4db01301de30b8c1c1b | [
"MIT"
] | null | null | null | app/handlers.py | jeffyboh/flask-rest | c750043c75d049bfe9eee4db01301de30b8c1c1b | [
"MIT"
] | null | null | null | from app import app
from flask import jsonify, make_response
@app.errorhandler(404)
def not_found(error):
return make_response(jsonify({'error': 'Not found'}), 404) | 28.166667 | 62 | 0.757396 |
0c4894b0ec5bd2493f6ae3a79e03fa257f594ba3 | 32,370 | py | Python | python/ccxt/async_support/tidex.py | OliverNChalk/ccxt | fcf55e88f3523d2969f905cbed3b4deec1433a5e | [
"MIT"
] | 26 | 2018-12-10T07:16:35.000Z | 2022-03-15T03:15:54.000Z | python/ccxt/async_support/tidex.py | OliverNChalk/ccxt | fcf55e88f3523d2969f905cbed3b4deec1433a5e | [
"MIT"
] | 4 | 2020-09-07T14:47:15.000Z | 2021-05-10T17:47:05.000Z | python/ccxt/async_support/tidex.py | OliverNChalk/ccxt | fcf55e88f3523d2969f905cbed3b4deec1433a5e | [
"MIT"
] | 13 | 2019-03-13T14:54:30.000Z | 2021-10-14T10:11:49.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 41.393862 | 248 | 0.509669 |
7ecd7e237534952f0e153fe931bd73982252d413 | 56,501 | py | Python | vnpy/trader/uiBasicWidget.py | riverdarda/vnpy.-msincense | 4f39ef3269082581171f3d0d6f046224266a8d21 | [
"MIT"
] | 3 | 2020-08-14T00:06:32.000Z | 2021-11-22T00:50:02.000Z | vnpy/trader/uiBasicWidget.py | riverdarda/vnpy.-msincense | 4f39ef3269082581171f3d0d6f046224266a8d21 | [
"MIT"
] | null | null | null | vnpy/trader/uiBasicWidget.py | riverdarda/vnpy.-msincense | 4f39ef3269082581171f3d0d6f046224266a8d21 | [
"MIT"
] | 3 | 2020-03-07T12:45:00.000Z | 2021-02-14T03:10:38.000Z | # encoding: UTF-8
import json
import csv
import os,sys
import platform
from collections import OrderedDict
import traceback
from vnpy.trader.vtEvent import *
from vnpy.trader.vtFunction import *
from vnpy.trader.vtGateway import *
from vnpy.trader.vtText import text as vtText
from vnpy.trader.uiQt import QtWidgets, Q... | 36.95291 | 130 | 0.524929 |
a44e274ed12a1ce543a30d1b6a0647ca7b14e23d | 4,483 | py | Python | appnode.py | VickenM/Subotai | 607381ce41ea450bca094a5dc8990649dbaa0390 | [
"BSD-3-Clause"
] | 3 | 2021-09-04T20:59:04.000Z | 2021-12-08T14:36:29.000Z | appnode.py | VickenM/Subotai | 607381ce41ea450bca094a5dc8990649dbaa0390 | [
"BSD-3-Clause"
] | 14 | 2021-08-25T16:51:20.000Z | 2021-10-16T04:48:34.000Z | appnode.py | VickenM/Subotai | 607381ce41ea450bca094a5dc8990649dbaa0390 | [
"BSD-3-Clause"
] | null | null | null | import pywerlines.pyweritems
import eventnodes.params
import eventnodes.signal
import register
import uuid
from PySide2 import QtCore
class Plug(pywerlines.pyweritems.PywerPlug):
@classmethod
def from_param(cls, param_obj):
path = pywerlines.pyweritems.PywerPlug.ELLIPSE
plug = cls(type=param... | 31.131944 | 93 | 0.64845 |
f92915a4474c636fb23ee209bc0a8b0878710ea4 | 7,538 | py | Python | analysis/general/analyze_table.py | cmu-db/cmdbac | 1f981e6f110728e51ba4ffdb90ff2d4ce091057a | [
"Apache-2.0"
] | 31 | 2016-04-07T04:54:29.000Z | 2021-11-30T02:30:57.000Z | analysis/general/analyze_table.py | cmu-db/db-webcrawler | 1f981e6f110728e51ba4ffdb90ff2d4ce091057a | [
"Apache-2.0"
] | 22 | 2015-12-19T14:49:18.000Z | 2021-09-07T23:48:24.000Z | analysis/general/analyze_table.py | cmu-db/dbac | 1f981e6f110728e51ba4ffdb90ff2d4ce091057a | [
"Apache-2.0"
] | 7 | 2016-05-13T01:02:01.000Z | 2019-10-06T16:52:54.000Z | #!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "core"))
import re
import csv
from utils import dump_all_... | 45.963415 | 132 | 0.608782 |
0e56838c740e1efd9dfb0974452d098dfbe8abb3 | 14,090 | py | Python | traffic_intersection/prepare/collision_check.py | tungminhphan/street_intersection | 8c10548ce9c1939f5ca01efddf207f0bda77773a | [
"BSD-3-Clause"
] | 11 | 2018-07-13T05:02:04.000Z | 2021-06-11T14:13:50.000Z | traffic_intersection/prepare/collision_check.py | tungminhphan/street_intersection | 8c10548ce9c1939f5ca01efddf207f0bda77773a | [
"BSD-3-Clause"
] | 4 | 2021-03-19T16:07:22.000Z | 2022-03-12T00:54:32.000Z | traffic_intersection/prepare/collision_check.py | tungminhphan/street_intersection | 8c10548ce9c1939f5ca01efddf207f0bda77773a | [
"BSD-3-Clause"
] | 7 | 2018-07-29T21:54:00.000Z | 2021-01-04T22:23:07.000Z | # Collision Detection Cars and Pedestrians
# Anhminh Nguyen, Tung M. Phan
# July 10, 2018
import os, sys
sys.path.append("..")
from math import cos, sin
from components.pedestrian import Pedestrian
from components.car import KinematicCar, DynamicCar
import assumes.params as params
import numpy as np
# input center co... | 45.895765 | 202 | 0.669269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.