hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4f0d8ae46d830b24cfa63aab36f1e2b1e69133 | 44,433 | py | Python | pylayers/simul/simultraj.py | lidiaxp/newPyLayer | 4caa020b0cff1c043a63bf18b71a40aa478b7737 | [
"MIT"
] | 1 | 2021-10-02T01:02:04.000Z | 2021-10-02T01:02:04.000Z | pylayers/simul/simultraj.py | buguen/pylayers | 65dd798c30370ae64edfceaf37bf6c47a92330d2 | [
"MIT"
] | null | null | null | pylayers/simul/simultraj.py | buguen/pylayers | 65dd798c30370ae64edfceaf37bf6c47a92330d2 | [
"MIT"
] | 3 | 2017-12-04T23:18:20.000Z | 2021-02-20T03:42:21.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
"""
Run simulation with full human trajectory
.. currentmodule:: pylayers.simul.simultraj
Simul class
===========
.. autosummary::
:toctree: generated/
Run simulation and data exploitation
------------------------------------
.. autosummary::
:toctree: generat... | 31.246835 | 97 | 0.442464 |
333f09156b00998a66ed6822a29a89de16b2d5e6 | 1,688 | py | Python | ivi/agilent/agilentDSO7034B.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/agilent/agilentDSO7034B.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/agilent/agilentDSO7034B.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | 37.511111 | 86 | 0.755332 |
3cead7a98f2147f10a9ba3dac2ff90eeb53e0262 | 7,947 | py | Python | ckeditor_uploader/views.py | guettli/django-ckeditor | 8473ac661c02a9dcd27063eb81e6b1bccbbd36a7 | [
"BSD-3-Clause"
] | 1 | 2021-05-08T08:40:55.000Z | 2021-05-08T08:40:55.000Z | ckeditor_uploader/views.py | guettli/django-ckeditor | 8473ac661c02a9dcd27063eb81e6b1bccbbd36a7 | [
"BSD-3-Clause"
] | 7 | 2021-03-30T13:52:56.000Z | 2022-03-12T00:38:56.000Z | ckeditor_uploader/views.py | guettli/django-ckeditor | 8473ac661c02a9dcd27063eb81e6b1bccbbd36a7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import inspect
import os
import warnings
from datetime import datetime
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.utils.html import escape
from django.utils.module_loading ... | 34.107296 | 106 | 0.6415 |
362c43bb655db03fdb83f1ba446a168ca9f95c9f | 8,220 | py | Python | sdk/python/pulumi_azure_nextgen/web/v20200601/get_web_app_host_name_binding.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/web/v20200601/get_web_app_host_name_binding.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/web/v20200601/get_web_app_host_name_binding.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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 36.533333 | 263 | 0.64854 |
610438725983c526498b49051353f05ce0081aba | 12,565 | py | Python | src/chisel/Combiner.py | raphael-group/chisel | 817b32e61f3e5e470e79a8cada03c72f94fc94f8 | [
"BSD-3-Clause"
] | 28 | 2019-10-15T16:50:28.000Z | 2022-03-07T08:43:06.000Z | src/chisel/Combiner.py | raphael-group/chisel | 817b32e61f3e5e470e79a8cada03c72f94fc94f8 | [
"BSD-3-Clause"
] | 19 | 2019-11-08T18:46:34.000Z | 2021-04-06T17:44:51.000Z | src/chisel/Combiner.py | raphael-group/chisel | 817b32e61f3e5e470e79a8cada03c72f94fc94f8 | [
"BSD-3-Clause"
] | 6 | 2019-12-02T16:48:21.000Z | 2021-07-26T19:33:44.000Z | #!/usr/bin/env python2.7
import os, sys
import argparse
import bisect
import math
import multiprocessing as mp
from multiprocessing import Lock, Value, Pool
from collections import defaultdict
from collections import Counter
from collections import deque
from functools import reduce
import numpy as np
import scipy.s... | 42.738095 | 221 | 0.574294 |
546c8bae56c95be6f0287231bc2273f0982963a8 | 2,316 | py | Python | cls_python/config_loader.py | amryfitra/cls_python | 06f73624222e7c2d496b20b75f353f284ba2d47e | [
"MIT"
] | null | null | null | cls_python/config_loader.py | amryfitra/cls_python | 06f73624222e7c2d496b20b75f353f284ba2d47e | [
"MIT"
] | null | null | null | cls_python/config_loader.py | amryfitra/cls_python | 06f73624222e7c2d496b20b75f353f284ba2d47e | [
"MIT"
] | null | null | null | __author__ = 'Owner'
import os
from configparser import ConfigParser
from datetime import datetime
def config_assert(config_item):
assert os.path.exists(config_item), "{} file does not exist in cls_config folder".format(config_item)
class ClsConfig(object):
def __init__(self, root_folder):
self.roo... | 36.1875 | 105 | 0.683506 |
e0fcf233cc1c62f8f699d0ab76026a8287f5f216 | 180 | py | Python | color_config.py | c0dejump/CredzCheckr | cac325b50464cf2eb853540be3efdf993c903691 | [
"MIT"
] | null | null | null | color_config.py | c0dejump/CredzCheckr | cac325b50464cf2eb853540be3efdf993c903691 | [
"MIT"
] | null | null | null | color_config.py | c0dejump/CredzCheckr | cac325b50464cf2eb853540be3efdf993c903691 | [
"MIT"
] | 1 | 2021-11-28T18:01:33.000Z | 2021-11-28T18:01:33.000Z | found = "\033[32m|-- \033[0m"
action_found = "\033[32m└──── \033[0m"
not_found = "\033[33m|-- \033[0m"
action_not_found = "\033[33m└──── \033[0m"
INFO = "\033[34m|-- \033[0m"
| 30 | 43 | 0.561111 |
ded571be722f086daebcbefb6e7db209626946fc | 2,074 | py | Python | 07_week/ex7_4_1.py | WoojaeJang/AppliedOptimization-Gurobi | 067e4e5a0391de74f673f935b0ba765b037a4149 | [
"AFL-1.1"
] | null | null | null | 07_week/ex7_4_1.py | WoojaeJang/AppliedOptimization-Gurobi | 067e4e5a0391de74f673f935b0ba765b037a4149 | [
"AFL-1.1"
] | null | null | null | 07_week/ex7_4_1.py | WoojaeJang/AppliedOptimization-Gurobi | 067e4e5a0391de74f673f935b0ba765b037a4149 | [
"AFL-1.1"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 14 12:11:06 2021
@author: woojae-macbook13
"""
from gurobipy import*
try :
m = Model('ex7_4_1')
Z = LinExpr()
X = m.addVars(10, 10, vtype = GRB.BINARY, name= 'X')
S = m.addVars(10, 10, 10, vtype = GRB.BINARY, name =... | 25.925 | 68 | 0.374638 |
db069bf3c9131f93d73ecd6a57f71dd23fe4d5b9 | 2,972 | py | Python | colour/utilities/metrics.py | rift-labs-developer/colour | 15112dbe824aab0f21447e0db4a046a28a06f43a | [
"BSD-3-Clause"
] | 1,380 | 2015-01-10T12:30:33.000Z | 2022-03-30T10:19:57.000Z | colour/utilities/metrics.py | rift-labs-developer/colour | 15112dbe824aab0f21447e0db4a046a28a06f43a | [
"BSD-3-Clause"
] | 638 | 2015-01-02T10:49:05.000Z | 2022-03-29T10:16:22.000Z | colour/utilities/metrics.py | rift-labs-developer/colour | 15112dbe824aab0f21447e0db4a046a28a06f43a | [
"BSD-3-Clause"
] | 250 | 2015-01-21T15:27:19.000Z | 2022-03-30T10:23:58.000Z | # -*- coding: utf-8 -*-
"""
Metrics
=======
Defines various metrics:
- :func:`colour.utilities.metric_mse`
- :func:`colour.utilities.metric_psnr`
References
----------
- :cite:`Wikipedia2003c` : Wikipedia. (2003). Mean squared error. Retrieved
March 5, 2018, from https://en.wikipedia.org/wiki/Mean_squared_... | 27.518519 | 78 | 0.625841 |
2e0fe376973d56b5ff22a5b515124a20c1c86fb3 | 15,947 | py | Python | openfermioncirq/gates/four_qubit_gates_test.py | oscarhiggott/OpenFermion-Cirq | dc7a6b3320c2f671fec444993a60be72ad0b54b8 | [
"Apache-2.0"
] | 1 | 2019-04-02T09:16:33.000Z | 2019-04-02T09:16:33.000Z | openfermioncirq/gates/four_qubit_gates_test.py | bryano/OpenFermion-Cirq | 1d931a8d73eb3300ff402e46f0b2858a283485ef | [
"Apache-2.0"
] | null | null | null | openfermioncirq/gates/four_qubit_gates_test.py | bryano/OpenFermion-Cirq | 1d931a8d73eb3300ff402e46f0b2858a283485ef | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 33.714588 | 80 | 0.520223 |
91a75f3a1b793867f97d8c4eb0e9f5c6e9084e21 | 1,381 | py | Python | cms/signals/apphook.py | devyntk/django-cms | f889a30e94f268394ae9abf32c032239d0a9be55 | [
"BSD-3-Clause"
] | 5,659 | 2015-01-01T02:42:30.000Z | 2020-10-07T02:38:29.000Z | cms/signals/apphook.py | devyntk/django-cms | f889a30e94f268394ae9abf32c032239d0a9be55 | [
"BSD-3-Clause"
] | 3,264 | 2015-01-02T10:11:48.000Z | 2020-10-08T13:15:07.000Z | cms/signals/apphook.py | devyntk/django-cms | f889a30e94f268394ae9abf32c032239d0a9be55 | [
"BSD-3-Clause"
] | 2,132 | 2015-01-01T11:28:21.000Z | 2020-10-06T09:09:11.000Z | import logging
import sys
from django.core.management import color_style
from django.core.signals import request_finished
from django.urls import clear_url_caches
from cms.utils.apphook_reload import mark_urlconf_as_changed
logger = logging.getLogger(__name__)
DISPATCH_UID = 'cms-restart'
def trigger_server_resta... | 27.62 | 80 | 0.712527 |
33b98e568739f0baf281dd9e2a3b4cc1e28de79a | 2,318 | py | Python | anime_downloader/sites/animeflix.py | nulligor/anime-downloader | ea7956f42f292f0416baa71225241b4e457f7098 | [
"Unlicense"
] | 1 | 2020-01-20T21:59:10.000Z | 2020-01-20T21:59:10.000Z | anime_downloader/sites/animeflix.py | nulligor/anime-downloader | ea7956f42f292f0416baa71225241b4e457f7098 | [
"Unlicense"
] | null | null | null | anime_downloader/sites/animeflix.py | nulligor/anime-downloader | ea7956f42f292f0416baa71225241b4e457f7098 | [
"Unlicense"
] | null | null | null | from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
class AnimeFlix(Anime, sitename='animeflix'):
"""
Site :https://animeflix.io/
"""
sitename = 'animeflix'
search_url = 'https://www.animeflix.io/api/search'
... | 39.965517 | 120 | 0.542709 |
d466cae53fcfd255d7331e5ebef5ff49dacaf7e5 | 1,188 | py | Python | photologue/migrations/0010_auto_20160105_1307.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 364 | 2015-01-03T00:06:55.000Z | 2019-03-10T20:00:11.000Z | photologue/migrations/0010_auto_20160105_1307.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 79 | 2015-01-03T03:35:36.000Z | 2019-03-13T20:05:55.000Z | photologue/migrations/0010_auto_20160105_1307.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 135 | 2015-01-09T01:36:11.000Z | 2019-03-12T02:54:59.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-05 13:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photologue', '0009_auto_20160102_0904'),
]
operations = [
migrations.AlterFiel... | 33 | 159 | 0.607744 |
210df301a6027d8b97cc7d77ef786ef3180df153 | 33,153 | py | Python | apps/xgds_subsea_app/importer/eventLogCsvImporter.py | xgds/xgds_subsea | 43b6d97330afacae60989d9bf767fef1d5f3fd5e | [
"Apache-2.0"
] | 2 | 2019-01-08T04:37:10.000Z | 2019-06-17T19:34:34.000Z | apps/xgds_subsea_app/importer/eventLogCsvImporter.py | xgds/xgds_subsea | 43b6d97330afacae60989d9bf767fef1d5f3fd5e | [
"Apache-2.0"
] | null | null | null | apps/xgds_subsea_app/importer/eventLogCsvImporter.py | xgds/xgds_subsea | 43b6d97330afacae60989d9bf767fef1d5f3fd5e | [
"Apache-2.0"
] | null | null | null | # __BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance... | 38.505226 | 120 | 0.562181 |
319be12b9184c25fa448a784c5c58dea56793303 | 4,593 | py | Python | workers.py | big-skim-milk/Quetzal | 806d379fe4815f642e75b0efebf5262d7ab8af8d | [
"MIT"
] | 2 | 2020-03-05T16:22:57.000Z | 2020-03-05T20:32:40.000Z | workers.py | big-skim-milk/Quetzal | 806d379fe4815f642e75b0efebf5262d7ab8af8d | [
"MIT"
] | null | null | null | workers.py | big-skim-milk/Quetzal | 806d379fe4815f642e75b0efebf5262d7ab8af8d | [
"MIT"
] | null | null | null | import sys
from PyQt5 import QtCore
from pathlib import Path
from subprocess import (run, CalledProcessError)
from quetzal import (getProjects, getDirs, writeProjects, writeDirs, loggedIn)
class Updater(QtCore.QRunnable):
def __init__(self, _mode, do_debug=False, override=False):
super(Updater, self).__in... | 32.574468 | 78 | 0.618768 |
112eaab2a35c0e968b5acf8e4ae93ab2320acdfc | 201 | py | Python | creators/utils.py | samuelviveiros/connector | 85f7a93f15ef3d01b648a64422fbfdea0191de76 | [
"MIT"
] | null | null | null | creators/utils.py | samuelviveiros/connector | 85f7a93f15ef3d01b648a64422fbfdea0191de76 | [
"MIT"
] | 13 | 2021-11-23T00:19:34.000Z | 2021-11-29T21:05:57.000Z | creators/utils.py | samuelviveiros/connector | 85f7a93f15ef3d01b648a64422fbfdea0191de76 | [
"MIT"
] | null | null | null | from django.utils.deprecation import MiddlewareMixin
class DisableCSRFMiddleware(MiddlewareMixin):
def process_request(self, request):
setattr(request, '_dont_enforce_csrf_checks', True)
| 28.714286 | 59 | 0.79602 |
6cf8a5f6cb539a1886d52cf968780bcc47896568 | 543 | py | Python | 0401-0500/0491-Increasing Subsequences/0491-Increasing Subsequences.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0401-0500/0491-Increasing Subsequences/0491-Increasing Subsequences.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0401-0500/0491-Increasing Subsequences/0491-Increasing Subsequences.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | class Solution:
def findSubsequences(self, nums: List[int]) -> List[List[int]]:
path = []
result = []
def dfs(start):
if len(path) >= 2:
result.append(path[:])
used = set()
for i in range(start, len(nums)):
if nums[i] not in... | 31.941176 | 77 | 0.41989 |
a57b636cfd3e48e22eee09f67c82044ce44f07c0 | 9,818 | py | Python | kucoin_futures/user/user.py | codewc/kucoin-futures-python-sdk | 327be4873873651ea562c91b2848148387110326 | [
"MIT"
] | 25 | 2020-12-18T05:06:34.000Z | 2022-02-23T10:14:31.000Z | kucoin_futures/user/user.py | codewc/kucoin-futures-python-sdk | 327be4873873651ea562c91b2848148387110326 | [
"MIT"
] | 13 | 2020-12-28T20:57:29.000Z | 2022-03-22T07:21:38.000Z | kucoin_futures/user/user.py | codewc/kucoin-futures-python-sdk | 327be4873873651ea562c91b2848148387110326 | [
"MIT"
] | 18 | 2020-12-01T07:27:56.000Z | 2022-03-24T13:24:49.000Z | from kucoin_futures.base_request.base_request import KucoinFuturesBaseRestApi
class UserData(KucoinFuturesBaseRestApi):
def transfer_kucoin_account(self, amount, bizNo=''):
"""
https://docs.kumex.com/#transfer-funds-to-kucoin-main-account
:param bizNo: (Mandatory) A unique ID generated b... | 38.202335 | 131 | 0.561723 |
38e539bd71a908160d1b3e466b575e548c467f2a | 536 | py | Python | visualisation_tsne.py | YoungGunsHackathon/MyiMatcher | a5238e64d608cab38dd60cf9e1d135efd0b3554e | [
"Unlicense"
] | 1 | 2018-02-17T10:11:09.000Z | 2018-02-17T10:11:09.000Z | visualisation_tsne.py | YoungGunsHackathon/MyiMatcher | a5238e64d608cab38dd60cf9e1d135efd0b3554e | [
"Unlicense"
] | null | null | null | visualisation_tsne.py | YoungGunsHackathon/MyiMatcher | a5238e64d608cab38dd60cf9e1d135efd0b3554e | [
"Unlicense"
] | null | null | null | import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
X = np.load('X.npy')
note = np.load('Y.npy')
X_embedded = TSNE(n_components=2).fit_transform(X)
fig, ax = plt.subplots(figsize=(15,15))
fig.suptitle("t-SNE dimensionality reduction", fontsize=16)
... | 26.8 | 64 | 0.722015 |
aa5f565b136e39b2afc05c3643ab81725b2385e7 | 105,305 | py | Python | cli/polyaxon/client/run.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/client/run.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | 1 | 2022-01-24T11:26:47.000Z | 2022-03-18T23:17:58.000Z | cli/polyaxon/client/run.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 37.608929 | 122 | 0.587645 |
1e08850aa99780ecb4fcb68b63e2766d4803d72e | 4,511 | py | Python | elliot/recommender/latent_factor_models/PMF/probabilistic_matrix_factorization.py | gategill/elliot | 113763ba6d595976e14ead2e3d460d9705cd882e | [
"Apache-2.0"
] | 175 | 2021-03-04T15:46:25.000Z | 2022-03-31T05:56:58.000Z | elliot/recommender/latent_factor_models/PMF/probabilistic_matrix_factorization.py | gategill/elliot | 113763ba6d595976e14ead2e3d460d9705cd882e | [
"Apache-2.0"
] | 15 | 2021-03-06T17:53:56.000Z | 2022-03-24T17:02:07.000Z | elliot/recommender/latent_factor_models/PMF/probabilistic_matrix_factorization.py | gategill/elliot | 113763ba6d595976e14ead2e3d460d9705cd882e | [
"Apache-2.0"
] | 39 | 2021-03-04T15:46:26.000Z | 2022-03-09T15:37:12.000Z | """
Module description:
Mnih, Andriy, and Russ R. Salakhutdinov. "Probabilistic matrix factorization." Advances in neural information processing systems 20 (2007)
"""
__version__ = '0.3.1'
__author__ = 'Vito Walter Anelli, Claudio Pomo'
__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it'
import numpy ... | 36.674797 | 138 | 0.594103 |
5a3b61821d8cd0e7430eb7724a7efeb59aed650a | 2,307 | py | Python | asynet_mask_rcnn/data/datasets/abstract.py | alexisbdr/asynet-mask-rcnn | ba001fb21235251aa111ef7ccddb683852109e6f | [
"MIT"
] | null | null | null | asynet_mask_rcnn/data/datasets/abstract.py | alexisbdr/asynet-mask-rcnn | ba001fb21235251aa111ef7ccddb683852109e6f | [
"MIT"
] | null | null | null | asynet_mask_rcnn/data/datasets/abstract.py | alexisbdr/asynet-mask-rcnn | ba001fb21235251aa111ef7ccddb683852109e6f | [
"MIT"
] | null | null | null | import torch
class AbstractDataset(torch.utils.data.Dataset):
"""
Serves as a common interface to reduce boilerplate and help dataset
customization
A generic Dataset for the asynet_mask_rcnn must have the following
non-trivial fields / methods implemented:
CLASSES - list/tuple:
... | 33.434783 | 80 | 0.641526 |
8182bde90472fdbd6b98159470bde85eeea9d8eb | 6,467 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py | tellarin/Recognizers-Text | ff019a69e9cb64de862c94b08125baaaf832ed25 | [
"MIT"
] | 2 | 2017-08-22T11:21:19.000Z | 2017-09-17T20:06:00.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py | tellarin/Recognizers-Text | ff019a69e9cb64de862c94b08125baaaf832ed25 | [
"MIT"
] | null | null | null | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py | tellarin/Recognizers-Text | ff019a69e9cb64de862c94b08125baaaf832ed25 | [
"MIT"
] | null | null | null | from ..resources import BaseDateTime
class Constants:
WRITTEN_TIME = 'writtentime'
SYS_DATETIME_DATE: str = 'date'
SYS_DATETIME_TIME: str = 'time'
SYS_DATETIME_DATEPERIOD: str = 'daterange'
SYS_DATETIME_DATETIME: str = 'datetime'
SYS_DATETIME_TIMEPERIOD: str = 'timerange'
SYS_DATETIME_DATE... | 28.240175 | 106 | 0.657801 |
656399dcd09dade51c7e13e1d0190b836669261e | 3,290 | py | Python | tests/apps/tethysapp-test_app/tethysapp/test_app/controllers.py | msouff/tethys | 45795d1e6561d5db8fddd838f4d1ae1d91dbb837 | [
"BSD-2-Clause"
] | null | null | null | tests/apps/tethysapp-test_app/tethysapp/test_app/controllers.py | msouff/tethys | 45795d1e6561d5db8fddd838f4d1ae1d91dbb837 | [
"BSD-2-Clause"
] | 1 | 2018-09-20T21:27:14.000Z | 2018-09-20T21:27:14.000Z | tests/apps/tethysapp-test_app/tethysapp/test_app/controllers.py | msouff/tethys | 45795d1e6561d5db8fddd838f4d1ae1d91dbb837 | [
"BSD-2-Clause"
] | null | null | null | from django.shortcuts import render
from tethys_sdk.permissions import login_required
from tethys_sdk.gizmos import Button
from channels.generic.websocket import WebsocketConsumer
import json
from typing import Any
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.layouts... | 26.111111 | 108 | 0.575076 |
ea916b5eb5f041b1eea8beaa130dfb5755582766 | 9,706 | py | Python | vit_keras/vit.py | aiinside/vit-keras | 28815edc5c24492612af726d1b2ca78295128d84 | [
"Apache-2.0"
] | 193 | 2020-11-09T13:13:49.000Z | 2022-03-30T05:40:11.000Z | vit_keras/vit.py | aiinside/vit-keras | 28815edc5c24492612af726d1b2ca78295128d84 | [
"Apache-2.0"
] | 30 | 2020-12-16T14:03:19.000Z | 2022-03-29T18:36:46.000Z | vit_keras/vit.py | aiinside/vit-keras | 28815edc5c24492612af726d1b2ca78295128d84 | [
"Apache-2.0"
] | 40 | 2020-11-10T02:27:12.000Z | 2022-03-29T18:31:32.000Z | import typing
import warnings
import tensorflow as tf
import typing_extensions as tx
from . import layers, utils
ConfigDict = tx.TypedDict(
"ConfigDict",
{
"dropout": float,
"mlp_dim": int,
"num_heads": int,
"num_layers": int,
"hidden_size": int,
},
)
CONFIG_B: Con... | 29.864615 | 112 | 0.630847 |
734ac315ee766e2173f7d6dbb952216752b05199 | 644 | py | Python | src/genie/libs/parser/bigip/get_sys_pfman.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/bigip/get_sys_pfman.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/bigip/get_sys_pfman.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | # Global Imports
import json
from collections import defaultdict
# Metaparser
from genie.metaparser import MetaParser
# =============================================
# Collection for '/mgmt/tm/sys/pfman' resources
# =============================================
class SysPfmanSchema(MetaParser):
schema = {}
c... | 18.941176 | 52 | 0.569876 |
407494161bda5ae73dbcde722097c680946ef83d | 412 | py | Python | H/1665.py | jnoddell/LC | be17ab80e745169a6617788ba82ad2c5b250c0d5 | [
"Apache-2.0"
] | 2 | 2021-01-20T14:31:36.000Z | 2021-01-20T14:32:31.000Z | H/1665.py | jnoddell/LC | be17ab80e745169a6617788ba82ad2c5b250c0d5 | [
"Apache-2.0"
] | null | null | null | H/1665.py | jnoddell/LC | be17ab80e745169a6617788ba82ad2c5b250c0d5 | [
"Apache-2.0"
] | null | null | null | class Solution:
def minimumEffort(self, tasks: List[List[int]]) -> int:
tasks.sort(key = lambda x: x[1] - x[0], reverse = True)
curr, init = 0, 0
for actual, minimum in tasks:
delta = max(0, minimum - curr)
ini... | 22.888889 | 63 | 0.419903 |
18818a5bb3f7b3d986d39c20d158667b65b3adc0 | 6,163 | py | Python | interfaces/cython/cantera/mixmaster/SpeciesFrame.py | MehulDokania/mixmaster | 4233b77de1cbe3fc658d0c01e2d74da166378603 | [
"BSD-3-Clause"
] | 1 | 2021-01-22T19:56:11.000Z | 2021-01-22T19:56:11.000Z | interfaces/cython/cantera/mixmaster/SpeciesFrame.py | MehulDokania/mixmaster | 4233b77de1cbe3fc658d0c01e2d74da166378603 | [
"BSD-3-Clause"
] | 8 | 2017-01-30T15:15:32.000Z | 2020-08-20T15:43:20.000Z | interfaces/cython/cantera/mixmaster/SpeciesFrame.py | MehulDokania/mixmaster | 4233b77de1cbe3fc658d0c01e2d74da166378603 | [
"BSD-3-Clause"
] | 16 | 2017-01-27T14:17:06.000Z | 2021-01-22T19:56:13.000Z | #
# function getElements displays a periodic table, and returns a list of
# the selected elements
#
# This file is part of Cantera. See License.txt in the top-level directory or
# at http://www.cantera.org/license.txt for license and copyright information.
import sys
if sys.version_info[0] == 3:
from tkinter im... | 34.049724 | 199 | 0.495213 |
81074e2ae22536e10ced091f082467dacad56004 | 88 | py | Python | requests_toolbar/__init__.py | yigor/django-debug-toolbar-requests | 46146609e9b63eb80ce0bd5952b380103dc6252d | [
"BSD-3-Clause"
] | null | null | null | requests_toolbar/__init__.py | yigor/django-debug-toolbar-requests | 46146609e9b63eb80ce0bd5952b380103dc6252d | [
"BSD-3-Clause"
] | null | null | null | requests_toolbar/__init__.py | yigor/django-debug-toolbar-requests | 46146609e9b63eb80ce0bd5952b380103dc6252d | [
"BSD-3-Clause"
] | null | null | null | VERSION = (1, 1, 0)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
| 17.6 | 44 | 0.670455 |
faa432d7a515843d4471f9b174253c2e78c36c76 | 269 | py | Python | flask_discord/__init__.py | HyperGH/Flask-Discord | aa10eb0eaf1a7dfc9af6175f79e040309739b32c | [
"MIT"
] | 82 | 2019-05-08T17:01:36.000Z | 2021-01-27T02:17:48.000Z | flask_discord/__init__.py | HyperGH/Flask-Discord | aa10eb0eaf1a7dfc9af6175f79e040309739b32c | [
"MIT"
] | 28 | 2019-12-08T22:21:16.000Z | 2021-01-29T17:17:18.000Z | flask_discord/__init__.py | HyperGH/Flask-Discord | aa10eb0eaf1a7dfc9af6175f79e040309739b32c | [
"MIT"
] | 28 | 2019-07-08T13:36:37.000Z | 2020-12-08T11:21:48.000Z | from .exceptions import *
from .utils import *
from .client import DiscordOAuth2Session
__all__ = [
"DiscordOAuth2Session",
"requires_authorization",
"HttpException",
"RateLimited",
"Unauthorized",
"AccessDenied",
]
__version__ = "0.1.64"
| 14.157895 | 40 | 0.680297 |
760ff274ed499d7b7d4f774af0fcbbefa46b5280 | 27,123 | py | Python | test/test_cells.py | jonancm/viennagrid-python | a56f23ab65cf82b2f06ff546d45c056bb9d326b2 | [
"MIT"
] | null | null | null | test/test_cells.py | jonancm/viennagrid-python | a56f23ab65cf82b2f06ff546d45c056bb9d326b2 | [
"MIT"
] | 1 | 2015-05-13T08:28:52.000Z | 2015-05-13T08:28:52.000Z | test/test_cells.py | jonancm/viennagrid-python | a56f23ab65cf82b2f06ff546d45c056bb9d326b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
if len(sys.argv) > 1:
sys.path.insert(0, sys.argv.pop(1))
import unittest
import viennagrid.wrapper
##################
# LINEAR DOMAINS #
##################
class TestLinearCartesian1D_Cell(unittest.TestCase):
def setUp(self):
# Create domain and add vert... | 37.881285 | 102 | 0.755964 |
62abae3e39f2bd521b5910d047a5426877fd3ae6 | 39,851 | py | Python | GPS/args.py | MarieNyst/GPS | 92d90bf8bd4e461c2063fb61048ff2d764470c17 | [
"BSD-3-Clause"
] | null | null | null | GPS/args.py | MarieNyst/GPS | 92d90bf8bd4e461c2063fb61048ff2d764470c17 | [
"BSD-3-Clause"
] | null | null | null | GPS/args.py | MarieNyst/GPS | 92d90bf8bd4e461c2063fb61048ff2d764470c17 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import argparse
import os
import helper
class ArgumentParser:
"""ArgumentParser
The ArgumentParser can parse command line arguements, scenario file
arguments and global default arguments to initialize the parameters of GPS.
"""
def __init__(self):
self.setup_arguments = {... | 63.863782 | 135 | 0.565783 |
e223c8049dbae1e6737181d2cfd0e89bf71b9763 | 12,773 | py | Python | deps/pmdk/src/tools/pmreorder/memoryoperations.py | kimleeju/xdp_redis | 52eaf9da59e5b9ddb009a7874791cdbe6ce9ba06 | [
"BSD-3-Clause"
] | null | null | null | deps/pmdk/src/tools/pmreorder/memoryoperations.py | kimleeju/xdp_redis | 52eaf9da59e5b9ddb009a7874791cdbe6ce9ba06 | [
"BSD-3-Clause"
] | null | null | null | deps/pmdk/src/tools/pmreorder/memoryoperations.py | kimleeju/xdp_redis | 52eaf9da59e5b9ddb009a7874791cdbe6ce9ba06 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018, Intel Corporation
#
# 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 following di... | 28.963719 | 79 | 0.604243 |
88b33c7c94cbf8e1d49d08961fd9f3ce3cfc6947 | 12,824 | py | Python | Lib/distutils/filelist.py | pharrera/CS008 | d516cf4e2da4f8b6cb8a4d7dc1c823ec6f9d0aa0 | [
"PSF-2.0"
] | null | null | null | Lib/distutils/filelist.py | pharrera/CS008 | d516cf4e2da4f8b6cb8a4d7dc1c823ec6f9d0aa0 | [
"PSF-2.0"
] | null | null | null | Lib/distutils/filelist.py | pharrera/CS008 | d516cf4e2da4f8b6cb8a4d7dc1c823ec6f9d0aa0 | [
"PSF-2.0"
] | 1 | 2021-02-23T21:57:26.000Z | 2021-02-23T21:57:26.000Z | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import os, string, re
import fnmatch
from types import *
from distutils.util import convert_path
from distutils.erro... | 35.821229 | 79 | 0.570805 |
101235270a76e42d28b03b680688ff68d53af937 | 4,179 | py | Python | tests/addr/test_fil_addr.py | 3rdIteration/bip_utils | 84abeff9158618a0ecf9a059c19fd1a3d882e724 | [
"MIT"
] | null | null | null | tests/addr/test_fil_addr.py | 3rdIteration/bip_utils | 84abeff9158618a0ecf9a059c19fd1a3d882e724 | [
"MIT"
] | null | null | null | tests/addr/test_fil_addr.py | 3rdIteration/bip_utils | 84abeff9158618a0ecf9a059c19fd1a3d882e724 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Emanuele Bellocchia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 40.970588 | 104 | 0.731275 |
0d42cc5f1fdf565e5c6b0e5874ba4d30be825dc1 | 868 | py | Python | cli/polyaxon/pkg.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/pkg.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | 1 | 2022-01-24T11:26:47.000Z | 2022-03-18T23:17:58.000Z | cli/polyaxon/pkg.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.72 | 79 | 0.741935 |
ca18cb98ea27fe163ecde4e244097dee3970cd2b | 6,788 | py | Python | pychron/pipeline/nodes/grouping.py | aelamspychron/pychron | ad87c22b0817c739c7823a24585053041ee339d5 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/pipeline/nodes/grouping.py | aelamspychron/pychron | ad87c22b0817c739c7823a24585053041ee339d5 | [
"Apache-2.0"
] | 20 | 2020-09-09T20:58:39.000Z | 2021-10-05T17:48:37.000Z | pychron/pipeline/nodes/grouping.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 32.792271 | 111 | 0.571744 |
439f3f68fa31fd4788ce6851fc55060991e591f6 | 3,030 | py | Python | Data-CSV/ci-square.py | GabrielCiolac/SYSC-4005-Simulation | bd68760aa09b7297a4dbca89f65682e635b79f70 | [
"MIT"
] | null | null | null | Data-CSV/ci-square.py | GabrielCiolac/SYSC-4005-Simulation | bd68760aa09b7297a4dbca89f65682e635b79f70 | [
"MIT"
] | 1 | 2021-03-12T22:53:27.000Z | 2021-07-14T15:32:18.000Z | Data-CSV/ci-square.py | GabrielCiolac/SYSC-4005-Simulation | bd68760aa09b7297a4dbca89f65682e635b79f70 | [
"MIT"
] | null | null | null | from scipy.stats import lognorm
import math
def log_normal(x:float,mu=0,sigma=1):
if(x == 0):
return 0
sigma = math.sqrt(sigma)
a = (math.log(x) - mu)/math.sqrt(2*sigma**2)
p = 0.5 + 0.5*math.erf(a)
return p
def read_csv(fName):
ln = None
with open(fName,'r') as f:
ln = f.r... | 30.3 | 165 | 0.672937 |
cb4bfdc100423a46f09d3e9d807a781eda72d531 | 150 | py | Python | src/dic/ja/raw/create_dic_inappropriate.py | izziiyt/normalizeNumexp | c3e1e92d1dbd115e30667ef9c1ea1df2a6d1792c | [
"BSD-3-Clause"
] | 2 | 2021-02-15T15:58:39.000Z | 2021-04-11T00:29:07.000Z | src/dic/ja/raw/create_dic_inappropriate.py | izziiyt/normalizeNumexp | c3e1e92d1dbd115e30667ef9c1ea1df2a6d1792c | [
"BSD-3-Clause"
] | 5 | 2021-02-17T00:41:20.000Z | 2021-03-12T11:32:07.000Z | resources/dic/ja/raw/create_dic_inappropriate.py | cotogoto/normalizeNumexp | cb9c5cb1f994e898a847439cbfb28ec8687bda5f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
fin = open("inappropriate_strings.txt", "r")
for line in fin.readlines() :
l = line.rstrip()
print "{\"str\":\""+l+"\"}"
| 21.428571 | 44 | 0.553333 |
831bfbec486004ec8edba5eb01c99464fe2bfacf | 100 | py | Python | Modules/regularExpression.py | AsherSeiling/fhide | 647c8447e507f096fe971b8b2fec1201024412e1 | [
"MIT"
] | null | null | null | Modules/regularExpression.py | AsherSeiling/fhide | 647c8447e507f096fe971b8b2fec1201024412e1 | [
"MIT"
] | null | null | null | Modules/regularExpression.py | AsherSeiling/fhide | 647c8447e507f096fe971b8b2fec1201024412e1 | [
"MIT"
] | null | null | null | def regex(ref, char):
passed = True
for i in ref:
if char == i:
passed = False
return passed | 16.666667 | 21 | 0.64 |
69d83d5db84562552c172666d5b9f68fab9033a4 | 1,217 | py | Python | lintcode/Queue/492. Implement Queue by Linked List.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | 23 | 2019-08-02T12:02:47.000Z | 2022-03-09T15:24:16.000Z | lintcode/Queue/492. Implement Queue by Linked List.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | null | null | null | lintcode/Queue/492. Implement Queue by Linked List.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | 21 | 2019-12-22T04:47:32.000Z | 2021-09-12T14:29:35.000Z | """
Implement a Queue by linked list. Support the following basic methods:
1.enqueue(item). Put a new item in the queue.
2.dequeue(). Move the first item out of the queue, return it.
Example 1:
Input:
enqueue(1)
enqueue(2)
enqueue(3)
dequeue() // return 1
enqueue(4)
dequeue() // return 2
Solution:
做一些必要的初始化,在 MyQ... | 20.627119 | 91 | 0.581758 |
7087165c51f0f893dabe8fded09149561fade255 | 1,876 | py | Python | Python/Create_Print/main.py | gb21oc/Projetos_Basicos | b88106b070039372865bf0ec3d0a00d95a41200b | [
"MIT"
] | 3 | 2022-01-03T11:02:47.000Z | 2022-01-10T23:50:12.000Z | Python/Create_Print/main.py | desecsecurity/Projetos_Basicos | b12ecbc637f6fba991ca2995ae479fa41b84131d | [
"MIT"
] | 1 | 2022-03-20T08:03:34.000Z | 2022-03-20T08:03:34.000Z | Python/Create_Print/main.py | desecsecurity/Projetos_Basicos | b12ecbc637f6fba991ca2995ae479fa41b84131d | [
"MIT"
] | 2 | 2022-01-03T11:02:36.000Z | 2022-01-08T22:25:00.000Z | import os
newLine = False
params_keyword = False
def verify_keyword(text, **kwargs):
global newLine, params_keyword
params_keyword = False
if kwargs.get("sep") is not None:
params_keyword = True
text = text.replace(" ", kwargs["sep"])
if kwargs.get("end") is not None:
if "\n" ... | 33.5 | 120 | 0.572495 |
e860a3098af4358d49bcc77ceff5d6d312e12f24 | 2,585 | py | Python | glance/registry/db/migrate_repo/versions/007_add_owner.py | rcbops/glance-buildpackage | 13e52178fb25d6062db6c7fad9df122d279320ab | [
"Apache-2.0"
] | 2 | 2015-09-30T09:43:37.000Z | 2017-06-26T14:36:21.000Z | glance/registry/db/migrate_repo/versions/007_add_owner.py | rcbops/glance-buildpackage | 13e52178fb25d6062db6c7fad9df122d279320ab | [
"Apache-2.0"
] | null | null | null | glance/registry/db/migrate_repo/versions/007_add_owner.py | rcbops/glance-buildpackage | 13e52178fb25d6062db6c7fad9df122d279320ab | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 31.144578 | 78 | 0.675435 |
90776829c807fedcfc373547051e28921a6adb87 | 4,228 | py | Python | tools/third_party/h2/test/test_interacting_stacks.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 2,479 | 2018-05-28T14:51:29.000Z | 2022-03-30T14:41:18.000Z | tools/third_party/h2/test/test_interacting_stacks.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 7,642 | 2018-05-28T09:38:03.000Z | 2022-03-31T20:55:48.000Z | tools/third_party/h2/test/test_interacting_stacks.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 1,303 | 2018-05-29T14:50:02.000Z | 2022-03-30T17:30:42.000Z | # -*- coding: utf-8 -*-
"""
test_interacting_stacks
~~~~~~~~~~~~~~~~~~~~~~~
These tests run two entities, a client and a server, in parallel threads. These
two entities talk to each other, running what amounts to a number of carefully
controlled simulations of real flows.
This is to ensure that the stack as a whole b... | 34.942149 | 79 | 0.599101 |
51798c1fa2680ae00d08a877a2dd2510a5fca7c2 | 2,868 | py | Python | prune/rnn.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | prune/rnn.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | prune/rnn.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
def to_var(x):
if torch.cuda.is_available():
x = x.cuda()
return Variable(x)
def compute_accuracy(rnn, sequence_length, input_size, data_loader):
# Test the Model
correct = 0;
total = 0
for images, labels in data_... | 32.965517 | 82 | 0.63424 |
223f40850da26ad39a281de52b811e6bc2aa4039 | 4,804 | py | Python | plantcv/plantcv/homology/space.py | jgerardhodge/plantcv | 0e20ac55d9ef81e54536f466020eba6e0c70e7fb | [
"MIT"
] | null | null | null | plantcv/plantcv/homology/space.py | jgerardhodge/plantcv | 0e20ac55d9ef81e54536f466020eba6e0c70e7fb | [
"MIT"
] | null | null | null | plantcv/plantcv/homology/space.py | jgerardhodge/plantcv | 0e20ac55d9ef81e54536f466020eba6e0c70e7fb | [
"MIT"
] | null | null | null | # Generate a plm multivariate space for downstream use in homology group assignments
import numpy as np
from plantcv.plantcv import params
def space(cur_plms, include_bound_dist=False, include_centroid_dist=False, include_orient_angles=False):
"""
Generate a plm multivariate space for downstream use in homol... | 50.041667 | 113 | 0.649875 |
63dac9ab8e503447f2547068d58c5215967d3d2c | 39,974 | py | Python | Lib/site-packages/spyder/plugins/plots/widgets/figurebrowser.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | 1 | 2021-06-20T14:52:40.000Z | 2021-06-20T14:52:40.000Z | spyder/plugins/plots/widgets/figurebrowser.py | Pancakerr/spyder | 34a9878bba97f427fbdd7b4a6d77ac0651327565 | [
"MIT"
] | 1 | 2021-04-30T21:16:55.000Z | 2021-04-30T21:16:55.000Z | spyder/plugins/plots/widgets/figurebrowser.py | Pancakerr/spyder | 34a9878bba97f427fbdd7b4a6d77ac0651327565 | [
"MIT"
] | 1 | 2020-06-14T07:03:50.000Z | 2020-06-14T07:03:50.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Figure browser widget
This is the main widget used in the Plots plugin
"""
# Standard library imports
import datetime
import os.path as osp
import sys
# Third ... | 35.532444 | 79 | 0.624756 |
f2148a4e37c9f81a47fc0a3816f323138e2da51c | 1,625 | py | Python | src/socketaddress/test_socketaddress.py | zrthxn/lldb_folly_formatter | f8ed80c0b1bcd7573a7699e48c2f75d869ea7820 | [
"MIT"
] | 1 | 2021-11-13T22:11:29.000Z | 2021-11-13T22:11:29.000Z | src/socketaddress/test_socketaddress.py | zrthxn/lldb_folly_formatter | f8ed80c0b1bcd7573a7699e48c2f75d869ea7820 | [
"MIT"
] | 7 | 2021-10-30T07:53:38.000Z | 2021-11-29T18:22:36.000Z | src/socketaddress/test_socketaddress.py | zrthxn/lldb_folly_formatter | f8ed80c0b1bcd7573a7699e48c2f75d869ea7820 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from common import LLDBTestCase
from os import path
class FollySocketAddress(LLDBTestCase):
def get_formatter_path(self):
curr_dir = path.abspath(path.dirname(path.realpath(__file__)))
return path.join(curr_dir, "socketaddress_formatter.py")
def test_socketaddress(self)... | 36.931818 | 99 | 0.737846 |
ec877f50b19e974f75c4b5f5775358d4c6f0d0ba | 128 | py | Python | autokeras/__init__.py | woj-i/autokeras | aa14b230e8eb04480aebc2be0820bd9b934e2253 | [
"MIT"
] | null | null | null | autokeras/__init__.py | woj-i/autokeras | aa14b230e8eb04480aebc2be0820bd9b934e2253 | [
"MIT"
] | null | null | null | autokeras/__init__.py | woj-i/autokeras | aa14b230e8eb04480aebc2be0820bd9b934e2253 | [
"MIT"
] | null | null | null | from autokeras.image_supervised import ImageClassifier, ImageRegressor
from autokeras.text.text_supervised import TextClassifier | 64 | 70 | 0.90625 |
542ffb125d218186d75ae41c9b8138967ef7a245 | 1,660 | py | Python | src/parsing/world_parser.py | mkRPGDev/mkRPG | 154e5d264dc1cc5fba78980da430e9d7ca0ccc22 | [
"Beerware"
] | 2 | 2016-10-06T10:09:10.000Z | 2016-10-07T14:16:19.000Z | src/parsing/world_parser.py | mkRPGDev/mkRPG | 154e5d264dc1cc5fba78980da430e9d7ca0ccc22 | [
"Beerware"
] | 17 | 2016-12-01T10:10:23.000Z | 2017-01-12T16:41:51.000Z | src/parsing/world_parser.py | mkRPGDev/mkRPG | 154e5d264dc1cc5fba78980da430e9d7ca0ccc22 | [
"Beerware"
] | null | null | null | """
This file parses the current world state. It should contain the necessary items
to load a game, that is to say the current map, the entities...
"""
# -*- coding : utf-8 -*-
from collections import OrderedDict
import parsing.parsing_utils as parsing_utils
def parse_world(world_file):
""" Parses the file descr... | 32.54902 | 79 | 0.614458 |
d0cfd1a34496633ff381b05026481a33c2e3c34c | 3,988 | py | Python | mpfmc/effects/color_dmd.py | arthurlutz/mpf-mc | 6f4aac5d48eb07dd5aa6612985a7567af8577ce2 | [
"MIT"
] | null | null | null | mpfmc/effects/color_dmd.py | arthurlutz/mpf-mc | 6f4aac5d48eb07dd5aa6612985a7567af8577ce2 | [
"MIT"
] | null | null | null | mpfmc/effects/color_dmd.py | arthurlutz/mpf-mc | 6f4aac5d48eb07dd5aa6612985a7567af8577ce2 | [
"MIT"
] | null | null | null | from typing import List
from kivy.properties import NumericProperty, ListProperty, BooleanProperty
from mpfmc.uix.effects import EffectsChain
from mpfmc.effects.dot_filter import DotFilterEffect
from mpfmc.effects.gain import GainEffect
from mpfmc.effects.reduce import ReduceEffect
MYPY = False
if MYPY: # pragma: ... | 29.540741 | 86 | 0.660983 |
f4bb92243c98f39226ce2c94d5b541daf798f153 | 9,584 | py | Python | underworld/function/branching.py | jmansour/underworld2 | 6da9f52268d366ae08533374afebb6f278c04576 | [
"CC-BY-4.0"
] | 1 | 2022-01-28T20:00:12.000Z | 2022-01-28T20:00:12.000Z | underworld/function/branching.py | jmansour/underworld2 | 6da9f52268d366ae08533374afebb6f278c04576 | [
"CC-BY-4.0"
] | null | null | null | underworld/function/branching.py | jmansour/underworld2 | 6da9f52268d366ae08533374afebb6f278c04576 | [
"CC-BY-4.0"
] | null | null | null | ##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~##
## ##
## This file forms part of the Underworld geophysics modelling application. ##
## ... | 41.851528 | 107 | 0.59735 |
89c721e5a2a15034420b3d5b5d957aa8452d1630 | 9,451 | py | Python | models/lib/gpn.py | Maxi-0902/DRAN | c3dbfcbc018446544150dc4e151442d6a9fcd4d9 | [
"MIT"
] | 71 | 2020-07-13T20:18:23.000Z | 2022-03-26T05:02:37.000Z | models/lib/gpn.py | Maxi-0902/DRAN | c3dbfcbc018446544150dc4e151442d6a9fcd4d9 | [
"MIT"
] | 12 | 2020-09-18T07:12:37.000Z | 2022-03-10T18:13:12.000Z | models/lib/gpn.py | Maxi-0902/DRAN | c3dbfcbc018446544150dc4e151442d6a9fcd4d9 | [
"MIT"
] | 9 | 2020-10-08T03:12:11.000Z | 2022-03-11T01:45:07.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
"""
Sub-graph proposal network
"""
class gpn_layer(nn.Module):
def __init__(self, GCN_dim=1024, hid_dim=512, test_LSTM... | 50.811828 | 146 | 0.622474 |
c693ccabb744830494a86fc5e8794b9a96d86cb3 | 2,000 | py | Python | 2020/day03.py | mbcollins2/aoc | b94380fd5e92b4fe9f4af654e7762174c1c6ac91 | [
"MIT"
] | null | null | null | 2020/day03.py | mbcollins2/aoc | b94380fd5e92b4fe9f4af654e7762174c1c6ac91 | [
"MIT"
] | 3 | 2021-12-15T19:12:38.000Z | 2021-12-15T19:14:42.000Z | 2020/day03.py | mbcollins2/aoc | b94380fd5e92b4fe9f4af654e7762174c1c6ac91 | [
"MIT"
] | null | null | null | import numpy as np
from termcolor import colored # type: ignore // ignore warning since this works
class solve_day(object):
with open('inputs/day03.txt', 'r') as f:
data = f.readlines()
def part1(self):
trees = 0
r = 3
for i, d in enumerate(self.data):
# skip fir... | 27.027027 | 155 | 0.4145 |
dad0233c2d48483135e62cad74d5e60758efe78c | 249 | py | Python | torchsupport/data/chem/qm9.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 18 | 2019-05-02T16:32:15.000Z | 2021-04-16T09:33:54.000Z | torchsupport/data/chem/qm9.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 5 | 2019-10-14T13:46:49.000Z | 2021-06-08T11:48:34.000Z | torchsupport/data/chem/qm9.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 12 | 2019-05-12T21:34:24.000Z | 2021-07-15T14:14:16.000Z | import torch
import torch.nn
import torch.nn.functional as func
from torch.utils.data import Dataset
import torchsupport.modules.nodegraph as ng
import torchsupport.data.graph as gdata
class QM9(Dataset):
def __init__(self):
# self.data =
| 19.153846 | 43 | 0.779116 |
d1409481563b79785cbde1a04ee04275bb15c642 | 12,032 | py | Python | asl_data.py | aryan51k/american_sign_language_reconizer | f4f74e6942f268912239945a67d18a6651c1df59 | [
"MIT"
] | null | null | null | asl_data.py | aryan51k/american_sign_language_reconizer | f4f74e6942f268912239945a67d18a6651c1df59 | [
"MIT"
] | null | null | null | asl_data.py | aryan51k/american_sign_language_reconizer | f4f74e6942f268912239945a67d18a6651c1df59 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
class AslDb(object):
""" American Sign Language database drawn from the RWTH-BOSTON-104 frame positional data
This class has been designed to provide a convenient interface for individual word data for students in the Udacity AI Nanodegree Program.
For e... | 40.375839 | 142 | 0.595163 |
cb563114d7e68c6ef5b94347f8ed827d4043b890 | 12,359 | py | Python | bnas/optimize.py | redperiabras/FILIPINEU | 833fd8d44c9d4de94d3433ca810a4a17831343ff | [
"MIT"
] | null | null | null | bnas/optimize.py | redperiabras/FILIPINEU | 833fd8d44c9d4de94d3433ca810a4a17831343ff | [
"MIT"
] | 1 | 2017-10-30T12:02:44.000Z | 2017-10-30T12:02:44.000Z | bnas/optimize.py | redperiabras/FILIPINEU | 833fd8d44c9d4de94d3433ca810a4a17831343ff | [
"MIT"
] | 1 | 2020-11-16T07:56:58.000Z | 2020-11-16T07:56:58.000Z | """Optimization algorithms.
This module provides different algorithms for optimization through (typically)
stochastic mini-batch gradient descent.
"""
import random
from collections import OrderedDict
import pickle
import numpy as np
import theano
from theano import tensor as T
from .fun import function
def itera... | 33.134048 | 80 | 0.572134 |
d07085fc75b4298342fcaaf12a0192451c4ad8e3 | 1,191 | py | Python | lib/aquilon/worker/commands/rebind_client_hostname.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 7 | 2015-07-31T05:57:30.000Z | 2021-09-07T15:18:56.000Z | lib/aquilon/worker/commands/rebind_client_hostname.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 115 | 2015-03-03T13:11:46.000Z | 2021-09-20T12:42:24.000Z | lib/aquilon/worker/commands/rebind_client_hostname.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 13 | 2015-03-03T11:17:59.000Z | 2021-09-09T09:16:41.000Z | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013,2014 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... | 39.7 | 82 | 0.752309 |
dcb81eed57cdd1817ed8c58361db3f5c4f1b2509 | 19,813 | py | Python | ipython_config.py | mrakitin/profile_collection-smi | 1eea45a3b886b2c0daeec715ce94f27da24d0ba3 | [
"BSD-3-Clause"
] | null | null | null | ipython_config.py | mrakitin/profile_collection-smi | 1eea45a3b886b2c0daeec715ce94f27da24d0ba3 | [
"BSD-3-Clause"
] | 13 | 2018-09-25T19:35:08.000Z | 2021-01-15T20:42:26.000Z | ipython_config.py | mrakitin/profile_collection-smi | 1eea45a3b886b2c0daeec715ce94f27da24d0ba3 | [
"BSD-3-Clause"
] | 3 | 2019-09-06T01:40:59.000Z | 2020-07-01T20:27:39.000Z | # Configuration file for ipython.
c = get_config()
#------------------------------------------------------------------------------
# InteractiveShellApp configuration
#------------------------------------------------------------------------------
# A Mixin for applications that start InteractiveShell instances.
#
# ... | 37.033645 | 417 | 0.687427 |
9917c220542583b9c4b21b4402b69a5e06b96be2 | 3,020 | py | Python | src/programy/parser/template/nodes/thatstar.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | src/programy/parser/template/nodes/thatstar.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | src/programy/parser/template/nodes/thatstar.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | """
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... | 45.757576 | 120 | 0.685762 |
6c290c448b9fd6c86a8814954645db280247cccb | 4,000 | py | Python | hanlp/layers/embeddings/char_rnn.py | yatwql/HanLP | 584ce7e5ed1b8f2209e14f32c44a55bb5a822e31 | [
"Apache-2.0"
] | 3 | 2022-03-22T05:47:50.000Z | 2022-03-22T05:47:58.000Z | hanlp/layers/embeddings/char_rnn.py | hushaoyun/HanLP | 967b52404c9d0adbc0cff2699690c127ecfca36e | [
"Apache-2.0"
] | null | null | null | hanlp/layers/embeddings/char_rnn.py | hushaoyun/HanLP | 967b52404c9d0adbc0cff2699690c127ecfca36e | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-06-02 23:49
from typing import Optional, Callable, Union
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence
from hanlp_common.configurable import AutoConfigurable
from hanlp.common.transform import VocabDict, ToChar
from hanlp.co... | 36.363636 | 99 | 0.60525 |
beb276e4b54b33db360b1078b52c202186de9ca7 | 872 | py | Python | Utility/Torch/Policy.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | Utility/Torch/Policy.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | Utility/Torch/Policy.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | """
The purpose of this module is to provide infrastructure for the policy
machinery used to dynamically adjust the model during construction for
optimal results.
* each batch contains a number of experiments
* itemized loss used to help calculate penalty
* model size used to help calculate penalty
* Calculated penal... | 18.166667 | 70 | 0.704128 |
f1c7b7a12750ff4024272ef1f483675231464173 | 563 | py | Python | blog/migrations/0003_auto_20160826_1653.py | clossmans2/my_django_blog | d7e3742390f58d436b95fc98642e2dfade60f8e0 | [
"MIT"
] | null | null | null | blog/migrations/0003_auto_20160826_1653.py | clossmans2/my_django_blog | d7e3742390f58d436b95fc98642e2dfade60f8e0 | [
"MIT"
] | 187 | 2018-08-03T14:43:34.000Z | 2021-07-15T10:23:34.000Z | blog/migrations/0003_auto_20160826_1653.py | clossmans2/my_django_blog | d7e3742390f58d436b95fc98642e2dfade60f8e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-08-26 20:53
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_comment'),
... | 24.478261 | 110 | 0.660746 |
6991b58d4077ed54c2eff517056d53a550325621 | 5,846 | py | Python | tests/Configuration/TemplateConfTests.py | owlfish/pubtal | fb20a0acf2769b2c06012b65bd462f02da12bd1c | [
"BSD-3-Clause"
] | null | null | null | tests/Configuration/TemplateConfTests.py | owlfish/pubtal | fb20a0acf2769b2c06012b65bd462f02da12bd1c | [
"BSD-3-Clause"
] | null | null | null | tests/Configuration/TemplateConfTests.py | owlfish/pubtal | fb20a0acf2769b2c06012b65bd462f02da12bd1c | [
"BSD-3-Clause"
] | null | null | null | """ Unit tests cases.
Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright... | 37.961039 | 147 | 0.715874 |
1cbf2c276f9c5ecd01c2515a4070e0607548978b | 1,216 | py | Python | pyvisdk/do/virtual_lsi_logic_sas_controller.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/virtual_lsi_logic_sas_controller.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/virtual_lsi_logic_sas_controller.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VirtualLsiLogicSASController(vim, *args, **kwargs):
'''VirtualLsiLogicSASController i... | 34.742857 | 124 | 0.626645 |
92e3d9dd0c0a832a501a4198f898a3f9cd317fbf | 11,503 | py | Python | main.py | smalik169/cross-alligned-auto-encoder | c6d6a6dbc7563676d7ba942b95c7f12f3c9a4991 | [
"Apache-2.0"
] | null | null | null | main.py | smalik169/cross-alligned-auto-encoder | c6d6a6dbc7563676d7ba942b95c7f12f3c9a4991 | [
"Apache-2.0"
] | null | null | null | main.py | smalik169/cross-alligned-auto-encoder | c6d6a6dbc7563676d7ba942b95c7f12f3c9a4991 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import time
import torch
import torch.optim as optim
import pprint
import data
import model
#from logger import Logger
parser = argparse.ArgumentParser(
description='Style Transfer from Non-Parallel Text by Cross-Alignment')
parser.add_argument('--data', type=str,
... | 39.12585 | 123 | 0.616622 |
1fe120f013fe49569e93e4e234d80c98bbc77919 | 6,825 | py | Python | clinica/lib/nipype/interfaces/mrtrix/preprocess.py | Raelag0112/clinica | d301b1abfdf4d3b62dc4b329622340795ae51ef8 | [
"MIT"
] | 1 | 2020-06-08T15:27:55.000Z | 2020-06-08T15:27:55.000Z | clinica/lib/nipype/interfaces/mrtrix/preprocess.py | Raelag0112/clinica | d301b1abfdf4d3b62dc4b329622340795ae51ef8 | [
"MIT"
] | null | null | null | clinica/lib/nipype/interfaces/mrtrix/preprocess.py | Raelag0112/clinica | d301b1abfdf4d3b62dc4b329622340795ae51ef8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import absolute_import, division, print_function, unicode_literals
import os.path as op
from nipype.interfaces.base import (
CommandLine,
CommandLineInputSp... | 31.597222 | 315 | 0.601905 |
56a80869e339b05dd87aa4dbe504438878ea10a2 | 764 | py | Python | projects/bees/example.py | robfatland/pythonbytes | 33fcc3e0220210059c0ebd7adb6694ddebdbd82c | [
"MIT"
] | 2 | 2019-10-20T22:08:41.000Z | 2021-12-28T01:12:51.000Z | projects/bees/example.py | robfatland/pythonbytes | 33fcc3e0220210059c0ebd7adb6694ddebdbd82c | [
"MIT"
] | null | null | null | projects/bees/example.py | robfatland/pythonbytes | 33fcc3e0220210059c0ebd7adb6694ddebdbd82c | [
"MIT"
] | 2 | 2019-01-19T18:05:34.000Z | 2019-04-16T22:45:43.000Z | # This section of code: Keep as-is
import requests, numpy as np, matplotlib.pyplot as plt
def bees(x, y, z): return requests.get('https://52t7suregg.execute-api.us-east-1.amazonaws.com/' + \
'default/dronebees?' + 'x=' + str(x) + '&y=' + str(y) + '&z=' + str(z)).text
# Test code. Note: This will occasionally ... | 29.384615 | 100 | 0.671466 |
37dbe9161b7be45bd52d3b4204509409a3779475 | 2,569 | py | Python | machine_learning/test/test_PCA.py | mideaconu/face_recognition | a45150845dbe3039c0dd8be72708ff9ca9588697 | [
"MIT"
] | 1 | 2019-12-04T13:46:50.000Z | 2019-12-04T13:46:50.000Z | machine_learning/test/test_PCA.py | mideaconu/face_recognition | a45150845dbe3039c0dd8be72708ff9ca9588697 | [
"MIT"
] | 1 | 2019-12-04T13:50:43.000Z | 2019-12-05T16:51:20.000Z | machine_learning/test/test_PCA.py | mideaconu/face-recognition | a45150845dbe3039c0dd8be72708ff9ca9588697 | [
"MIT"
] | null | null | null | #
# Author: Mihai-Ionut Deaconu
#
import sys
import unittest
import numpy as np
from machine_learning.decomposition import PCA
rng = np.random.RandomState(42)
data = rng.normal(0, 1, size=(5000, 2))
class PCATest(unittest.TestCase):
def setUp(self):
self.pca = PCA(n_components=3, method="svd", n_overs... | 28.230769 | 80 | 0.653172 |
47f5b9118777918174d2951659cc3bd565145654 | 3,181 | py | Python | chia/types/weight_proof.py | nur-azhar/chia-blockchain | 890da94024b4742bbbb93e47f72113e8344a20b3 | [
"Apache-2.0"
] | 9 | 2022-02-06T13:38:35.000Z | 2022-03-19T15:26:45.000Z | chia/types/weight_proof.py | nur-azhar/chia-blockchain | 890da94024b4742bbbb93e47f72113e8344a20b3 | [
"Apache-2.0"
] | 6 | 2022-02-06T13:48:07.000Z | 2022-03-09T20:04:15.000Z | chia/types/weight_proof.py | neurosis69/chia-blockchain | d346ef89f1e1aa9eec1e06f1ef93862c097f6bd7 | [
"Apache-2.0"
] | 1 | 2022-03-15T08:44:30.000Z | 2022-03-15T08:44:30.000Z | from dataclasses import dataclass
from typing import List, Optional
from chia.types.blockchain_format.proof_of_space import ProofOfSpace
from chia.types.blockchain_format.reward_chain_block import RewardChainBlock
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.vdf import... | 30.883495 | 95 | 0.735303 |
3fa258eba111056d8233c3bdd96c8eddf70d3161 | 17,323 | py | Python | odoo/base-addons/point_of_sale/tests/test_pos_products_with_tax.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/point_of_sale/tests/test_pos_products_with_tax.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/point_of_sale/tests/test_pos_products_with_tax.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSProductsWithTax(TestPoSCommon):
""" Test normal configuration PoS selling products with tax
"""
def setUp(self):
super(TestPoSProductsWithTax, self).setUp()
... | 49.778736 | 155 | 0.539052 |
07a9a54ba45e3191911364f8502194cfe1b61dae | 2,841 | py | Python | src/oci/identity/models/fully_qualified_scope.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/identity/models/fully_qualified_scope.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/identity/models/fully_qualified_scope.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 27.852941 | 245 | 0.629004 |
8c90d11dfd81ece50aa5fd0c41bc750cf168ae70 | 15 | py | Python | src/data_path.py | pawel-rozwoda/lstm-diarization | c900b08996bdd38b2d92182e8a428caa9de62445 | [
"MIT"
] | null | null | null | src/data_path.py | pawel-rozwoda/lstm-diarization | c900b08996bdd38b2d92182e8a428caa9de62445 | [
"MIT"
] | null | null | null | src/data_path.py | pawel-rozwoda/lstm-diarization | c900b08996bdd38b2d92182e8a428caa9de62445 | [
"MIT"
] | null | null | null | DATA_PATH = ''
| 7.5 | 14 | 0.6 |
c37b1715e90f0c5c107bb375c4412e9d4946e949 | 13,996 | py | Python | ivy/functional/ivy/manipulation.py | patrickf949/ivy | aa2929923ab31d952a3d75f1ad2def35635850ae | [
"Apache-2.0"
] | 1 | 2022-03-10T19:36:02.000Z | 2022-03-10T19:36:02.000Z | ivy/functional/ivy/manipulation.py | patrickf949/ivy | aa2929923ab31d952a3d75f1ad2def35635850ae | [
"Apache-2.0"
] | null | null | null | ivy/functional/ivy/manipulation.py | patrickf949/ivy | aa2929923ab31d952a3d75f1ad2def35635850ae | [
"Apache-2.0"
] | null | null | null | # global
from typing import Union, Optional, Tuple, List, Iterable
from numbers import Number
# local
import ivy
from ivy.framework_handler import current_framework as _cur_framework
# Array API Standard #
# -------------------#
def roll(x: Union[ivy.Array, ivy.NativeArray],
shift: Union[int, Tuple[int, ...... | 41.904192 | 738 | 0.641969 |
22d38bf1673dd67749b7096b69a43eb8068bc798 | 260 | py | Python | Practice/Python/Sets/Set_Mutations.py | alexanderbauer89/HackerRank | 0fb6face083b0183692c9251ffe4bb635591393f | [
"MIT"
] | 1 | 2021-11-17T02:47:11.000Z | 2021-11-17T02:47:11.000Z | Practice/Python/Sets/Set_Mutations.py | alexanderbauer89/HackerRank | 0fb6face083b0183692c9251ffe4bb635591393f | [
"MIT"
] | null | null | null | Practice/Python/Sets/Set_Mutations.py | alexanderbauer89/HackerRank | 0fb6face083b0183692c9251ffe4bb635591393f | [
"MIT"
] | null | null | null | if __name__ == '__main__':
n, base_set = input(), set(map(int, input().split()))
for _ in range(int(input())):
operation = input().split()
getattr(base_set, operation[0])(set(map(int, input().split())))
print(sum(base_set))
| 37.142857 | 71 | 0.573077 |
ebceb0f81056f10ab08e2502bd43d8adbbd87985 | 18,330 | py | Python | main/1d/inverse_1d.py | QiuhongAnnaWei/PINNs | 5276b625f75ff613cdcc0133d9737a5f55b8a5eb | [
"MIT"
] | 1 | 2020-12-28T06:11:29.000Z | 2020-12-28T06:11:29.000Z | main/1d/inverse_1d.py | QiuhongAnnaWei/PINNs | 5276b625f75ff613cdcc0133d9737a5f55b8a5eb | [
"MIT"
] | null | null | null | main/1d/inverse_1d.py | QiuhongAnnaWei/PINNs | 5276b625f75ff613cdcc0133d9737a5f55b8a5eb | [
"MIT"
] | null | null | null | # Inverse: given observed data of u(t, x) -> model/pde parameters λ
import time, sys, os, json
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.mplot3d import Axes3D
# from plotting import newfig, savefig
# from mpl_toolkits.axes_grid1 ... | 47.120823 | 176 | 0.612057 |
23f0c28547ba808fa79b036b9801cda07a785440 | 4,814 | py | Python | rxbp/multicast/observer/flatconcatnobackpressureobserver.py | MichaelSchneeberger/rx_backpressure | 16173827498bf1bbee3344933cb9efbfd19699f5 | [
"Apache-2.0"
] | 24 | 2018-11-22T21:04:49.000Z | 2021-11-08T11:18:09.000Z | rxbp/multicast/observer/flatconcatnobackpressureobserver.py | MichaelSchneeberger/rx_backpressure | 16173827498bf1bbee3344933cb9efbfd19699f5 | [
"Apache-2.0"
] | 1 | 2019-02-06T15:58:46.000Z | 2019-02-12T20:31:50.000Z | rxbp/multicast/observer/flatconcatnobackpressureobserver.py | MichaelSchneeberger/rx_backpressure | 16173827498bf1bbee3344933cb9efbfd19699f5 | [
"Apache-2.0"
] | 1 | 2021-01-26T12:41:37.000Z | 2021-01-26T12:41:37.000Z | import threading
from dataclasses import dataclass
from typing import Callable, Any, List, Optional
from rx.disposable import CompositeDisposable
from rxbp.acknowledgement.continueack import continue_ack
from rxbp.acknowledgement.ack import Ack
from rxbp.acknowledgement.single import Single
from rxbp.acknowledgement.... | 33.2 | 100 | 0.634815 |
1d0d5d5ac42782a1435f47277f50769804a086fc | 1,671 | py | Python | functional-programming/set__dict_comprehensions.py | Ch-sriram/python-advanced-concepts | a041eedbcff683b487d292808fba5fd0a3b9aebd | [
"MIT"
] | null | null | null | functional-programming/set__dict_comprehensions.py | Ch-sriram/python-advanced-concepts | a041eedbcff683b487d292808fba5fd0a3b9aebd | [
"MIT"
] | null | null | null | functional-programming/set__dict_comprehensions.py | Ch-sriram/python-advanced-concepts | a041eedbcff683b487d292808fba5fd0a3b9aebd | [
"MIT"
] | null | null | null | # examples on set and dict comprehensions
# EXAMPLES OF SET COMPREHENSION
# making a set comprehension is actually really easy
# instead of a list, we'll just use a set notation as follows:
my_list = [char for char in 'hello']
my_set = {char for char in 'hello'}
print(my_list)
print(my_set)
my_list1 = [num for num i... | 31.528302 | 144 | 0.64213 |
ea2d125665940271b5d52dd0f7df67ab6257c2da | 14,187 | py | Python | avatar/mapworld/maps.py | potsdam-language-vision-2021/eyebot-1.0 | dd2f618a8357ef16c497d06b8b19ab38d628645a | [
"MIT"
] | null | null | null | avatar/mapworld/maps.py | potsdam-language-vision-2021/eyebot-1.0 | dd2f618a8357ef16c497d06b8b19ab38d628645a | [
"MIT"
] | 46 | 2021-04-30T15:28:40.000Z | 2021-08-21T15:26:34.000Z | avatar/mapworld/maps.py | potsdam-language-vision-2021/eyebot-1.0 | dd2f618a8357ef16c497d06b8b19ab38d628645a | [
"MIT"
] | 1 | 2021-08-07T19:41:12.000Z | 2021-08-07T19:41:12.000Z | # -*- coding: utf-8 -*-
"""Map objects for the map world environment.
AbstractMap encapsulates generation of graph through random walk.
ADEMap is an example of a fully specified map, where nodes in the graph
are adorned with additional information (here: room categories and room
instances [images] from the ADE20k dat... | 42.990909 | 108 | 0.569395 |
b22c83409688bb9616b57667d63aefb941328fc0 | 498 | py | Python | src/vocabulator/words/migrations/0013_auto_20180812_1033.py | sysint64/vocabulator-server-side | 1cbe6253367ca0461be9a88fb9a2cab927170393 | [
"MIT"
] | null | null | null | src/vocabulator/words/migrations/0013_auto_20180812_1033.py | sysint64/vocabulator-server-side | 1cbe6253367ca0461be9a88fb9a2cab927170393 | [
"MIT"
] | null | null | null | src/vocabulator/words/migrations/0013_auto_20180812_1033.py | sysint64/vocabulator-server-side | 1cbe6253367ca0461be9a88fb9a2cab927170393 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-08-12 10:33
from django.db import migrations
def replace_comma_to_semicolon(apps, schema_editor):
Word = apps.get_model('words', 'Word')
for post in Word.objects.all():
post.translation = post.translation.replace(",", ";")
post.save()
class Migration(mig... | 21.652174 | 61 | 0.662651 |
a9ca5636d6ee5e033e0aa253660e42d674fbdb06 | 854 | py | Python | utils/face_parsing.py | oo92/Deep3dPortrait | 809b3c4ab870e7b65b123d7491ab237c862c3b99 | [
"MIT"
] | 278 | 2020-04-24T16:44:40.000Z | 2022-03-24T07:44:33.000Z | utils/face_parsing.py | oo92/Deep3dPortrait | 809b3c4ab870e7b65b123d7491ab237c862c3b99 | [
"MIT"
] | 29 | 2020-05-23T10:15:56.000Z | 2022-03-25T02:04:32.000Z | utils/face_parsing.py | oo92/Deep3dPortrait | 809b3c4ab870e7b65b123d7491ab237c862c3b99 | [
"MIT"
] | 64 | 2020-04-28T08:52:06.000Z | 2022-03-29T01:46:46.000Z | import numpy as np
from scipy.io import loadmat
#######################################################################################
# Auxiliary functions for face segmentation
# for face parsing, please refer to https://arxiv.org/pdf/1906.01342.pdf
##################################################################... | 34.16 | 103 | 0.555035 |
d04744982cdfc820daa0793aa2c480e9691ed68a | 3,504 | py | Python | profiles_api/views.py | Paris157/profiles-rest-api | 83a9374e905d8ffb104b91058d398f2bb1161b04 | [
"MIT"
] | null | null | null | profiles_api/views.py | Paris157/profiles-rest-api | 83a9374e905d8ffb104b91058d398f2bb1161b04 | [
"MIT"
] | null | null | null | profiles_api/views.py | Paris157/profiles-rest-api | 83a9374e905d8ffb104b91058d398f2bb1161b04 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from profiles_api import serializers
from profiles_api import models
from profiles_api import permiss... | 30.736842 | 74 | 0.635274 |
fc3a73a220644e40d18c78c560fc1b9e61198cd9 | 383 | py | Python | blue/wsgi.py | zhy0216/random-read | b54d806a4c2223e3c60dc554c1aacf86e9591028 | [
"MIT"
] | 239 | 2015-04-15T09:14:09.000Z | 2016-06-02T16:45:45.000Z | blue/wsgi.py | zhy0216/OhMyPocket | b54d806a4c2223e3c60dc554c1aacf86e9591028 | [
"MIT"
] | 4 | 2015-05-10T16:03:56.000Z | 2015-07-16T02:34:11.000Z | blue/wsgi.py | zhy0216/random-read | b54d806a4c2223e3c60dc554c1aacf86e9591028 | [
"MIT"
] | 25 | 2015-05-10T13:59:06.000Z | 2016-05-18T02:03:19.000Z | """
WSGI config for blue project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blue.settings")
from django.core.wsgi im... | 25.533333 | 78 | 0.785901 |
dc4e357bf72e101b6c146694f1c14e8d596d817b | 4,041 | py | Python | tests/unit/test_table.py | kangdh/hdmf | 680b68a1bbc9377590862574daea83579a3d52bc | [
"BSD-3-Clause-LBNL"
] | 25 | 2019-03-07T15:33:16.000Z | 2022-02-16T20:03:57.000Z | tests/unit/test_table.py | kangdh/hdmf | 680b68a1bbc9377590862574daea83579a3d52bc | [
"BSD-3-Clause-LBNL"
] | 641 | 2019-02-02T00:31:12.000Z | 2022-03-31T18:16:54.000Z | tests/unit/test_table.py | kangdh/hdmf | 680b68a1bbc9377590862574daea83579a3d52bc | [
"BSD-3-Clause-LBNL"
] | 16 | 2019-02-05T18:21:35.000Z | 2022-02-14T23:37:21.000Z | import pandas as pd
from hdmf.container import Table, Row, RowGetter
from hdmf.testing import TestCase
class TestTable(TestCase):
@classmethod
def get_table_class(cls):
class MyTable(Table):
__defaultname__ = 'my_table'
__columns__ = [
{'name': 'col1', 'type... | 32.328 | 93 | 0.604553 |
8086868b43a512f7a2e7c704862c444c4ca2b3e3 | 1,093 | py | Python | whatsapp-bot-venv/Lib/site-packages/twilio/rest/proxy/__init__.py | RedaMastouri/ConversationalPythonicChatBot | f204276d4b80348d42091b17d1a7d9eea33fb4e0 | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | whatsapp-bot-venv/Lib/site-packages/twilio/rest/proxy/__init__.py | RedaMastouri/ConversationalPythonicChatBot | f204276d4b80348d42091b17d1a7d9eea33fb4e0 | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | bot/lib/python3.7/site-packages/twilio/rest/proxy/__init__.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.domain import Domain
from twilio.rest.proxy.v1 import V1
class Proxy(Domain):
def __init__(self, twilio):
"""
Initialize the Proxy Domain
:returns: Do... | 20.240741 | 56 | 0.536139 |
8ed0a7554d0f046f6e8a1224b2532c149a73aec3 | 5,431 | py | Python | catalog/views.py | byronlin92/django_local_library | 86013bdfbb88bc6a7632cb803ea74c09a0e381e7 | [
"Apache-2.0"
] | null | null | null | catalog/views.py | byronlin92/django_local_library | 86013bdfbb88bc6a7632cb803ea74c09a0e381e7 | [
"Apache-2.0"
] | null | null | null | catalog/views.py | byronlin92/django_local_library | 86013bdfbb88bc6a7632cb803ea74c09a0e381e7 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from .models import Book, Author, BookInstance, Genre
def index(request):
"""
View function for home page of site.
"""
# Generate counts of some of the main objects
num_books=Book.objects.all().count()
num_instances=BookInstance.objects.all().count()
# Av... | 32.716867 | 145 | 0.735776 |
f701ce4be73d3f3af3e6256b3bb71ac213ac3103 | 4,318 | py | Python | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | """Support for Eliot tracing with Dask computations."""
from pyrsistent import PClass, field
from dask import compute, optimize
from dask.core import toposort, get_dependencies
from . import start_action, current_action, Action, Message
class _RunWithEliotContext(PClass):
"""
Run a callable within an Eliot ... | 31.064748 | 79 | 0.629458 |
fed4b5bbf7210e8e778459bea56b43e1cdd88563 | 23,152 | py | Python | airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py | jfmolano/airflow | 58fd1aa23d9c65d4e0e4d60424c56fc7e0b3feb3 | [
"Apache-2.0"
] | null | null | null | airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py | jfmolano/airflow | 58fd1aa23d9c65d4e0e4d60424c56fc7e0b3feb3 | [
"Apache-2.0"
] | null | null | null | airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py | jfmolano/airflow | 58fd1aa23d9c65d4e0e4d60424c56fc7e0b3feb3 | [
"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 u... | 47.152749 | 109 | 0.644134 |
8c8181d260a8982e99301cec6e4a0ecc71eee293 | 17,221 | py | Python | test/box-py/iproto.test.py | artembo/tarantool | 5f0c04820b2429c004fbd28a838e291ca2833ca3 | [
"BSD-2-Clause"
] | 1 | 2022-02-17T06:03:48.000Z | 2022-02-17T06:03:48.000Z | test/box-py/iproto.test.py | artembo/tarantool | 5f0c04820b2429c004fbd28a838e291ca2833ca3 | [
"BSD-2-Clause"
] | null | null | null | test/box-py/iproto.test.py | artembo/tarantool | 5f0c04820b2429c004fbd28a838e291ca2833ca3 | [
"BSD-2-Clause"
] | 2 | 2021-09-07T02:13:20.000Z | 2022-01-29T22:11:35.000Z | from __future__ import print_function
import os
import sys
import struct
import socket
import msgpack
from tarantool.const import *
from tarantool import Connection
from tarantool.request import Request, RequestInsert, RequestSelect, RequestUpdate, RequestUpsert
from tarantool.response import Response
from lib.taranto... | 29.949565 | 97 | 0.657511 |
7b8bdada91bdcc2513115fa11f4b4296ff2f9da7 | 6,415 | py | Python | sympy/testing/benchmarking.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/testing/benchmarking.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/testing/benchmarking.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | """benchmarking through py.test"""
import py
from py.__.test.item import Item
from py.__.test.terminal.terminal import TerminalSession
from math import ceil as _ceil, floor as _floor, log10
import timeit
from inspect import getsource
# from IPython.Magic.magic_timeit
units = ["s", "ms", "us", "ns"]
s... | 28.896396 | 91 | 0.486516 |
78345e0e02cd7245a6e788f41e4952f0df5c08c4 | 939 | py | Python | htmllinklist.py | eyepod101/datagen | 25b13058f641fca1892232b1d968fdd4dbf7d62f | [
"MIT"
] | null | null | null | htmllinklist.py | eyepod101/datagen | 25b13058f641fca1892232b1d968fdd4dbf7d62f | [
"MIT"
] | null | null | null | htmllinklist.py | eyepod101/datagen | 25b13058f641fca1892232b1d968fdd4dbf7d62f | [
"MIT"
] | null | null | null | import os
import re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-id", "--inputdir", required=True, help="Input existing directory that contains all cleaned html files.")
parser.add_argument("-of", "--outputfile", required=True, help="Output a new file that will contain URL links from all cl... | 32.37931 | 144 | 0.644302 |
aef05bd3614d005c520c9fff9c98480184fa61bb | 5,611 | py | Python | model_compression_toolkit/core/keras/graph_substitutions/substitutions/input_scaling.py | reuvenperetz/model_optimization | 40de02d56750ee4cc20e693da63bc2e70b4d20e6 | [
"Apache-2.0"
] | 42 | 2021-10-31T10:17:49.000Z | 2022-03-21T08:51:46.000Z | model_compression_toolkit/core/keras/graph_substitutions/substitutions/input_scaling.py | reuvenperetz/model_optimization | 40de02d56750ee4cc20e693da63bc2e70b4d20e6 | [
"Apache-2.0"
] | 6 | 2021-10-31T15:06:03.000Z | 2022-03-31T10:32:53.000Z | model_compression_toolkit/core/keras/graph_substitutions/substitutions/input_scaling.py | reuvenperetz/model_optimization | 40de02d56750ee4cc20e693da63bc2e70b4d20e6 | [
"Apache-2.0"
] | 18 | 2021-11-01T12:16:43.000Z | 2022-03-25T16:52:37.000Z | # Copyright 2021 Sony Semiconductors Israel, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 41.873134 | 136 | 0.718054 |
32fa2ab7925073c8045c193c57d329dee1348f78 | 79 | py | Python | etest_test/fixtures_test/__init__.py | alunduil/etest | e5f06d7e8c83be369576976f239668545bcbfffd | [
"MIT"
] | 6 | 2015-01-08T13:56:50.000Z | 2018-01-08T00:53:08.000Z | etest_test/fixtures_test/__init__.py | alunduil/etest | e5f06d7e8c83be369576976f239668545bcbfffd | [
"MIT"
] | 64 | 2015-01-01T23:10:07.000Z | 2021-06-12T06:55:31.000Z | etest_test/fixtures_test/__init__.py | alunduil/etest | e5f06d7e8c83be369576976f239668545bcbfffd | [
"MIT"
] | 2 | 2015-05-08T01:32:48.000Z | 2015-05-30T15:38:31.000Z | """Test fixtures."""
import os
FIXTURES_DIRECTORY = os.path.dirname(__file__)
| 15.8 | 46 | 0.746835 |
44aece94cc06a059cc2c3842180813f640a90a10 | 1,009 | py | Python | python/runtime/db_writer/__init__.py | awsl-dbq/sqlflow | 6684ac4b4f26774bd10e437bc52080fdbae5ce49 | [
"Apache-2.0"
] | null | null | null | python/runtime/db_writer/__init__.py | awsl-dbq/sqlflow | 6684ac4b4f26774bd10e437bc52080fdbae5ce49 | [
"Apache-2.0"
] | null | null | null | python/runtime/db_writer/__init__.py | awsl-dbq/sqlflow | 6684ac4b4f26774bd10e437bc52080fdbae5ce49 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SQLFlow Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 42.041667 | 74 | 0.799802 |
a78856847238424ef74cedfd6c601fe5bee0e6af | 8,785 | py | Python | models/vggf.py | IBM/energy-efficient-resilience | 13dfcac143df218abe20ed8d8752a0bd7e5a424b | [
"Apache-2.0"
] | 4 | 2022-03-01T16:57:12.000Z | 2022-03-22T09:22:35.000Z | models/vggf.py | IBM/energy-efficient-resilience | 13dfcac143df218abe20ed8d8752a0bd7e5a424b | [
"Apache-2.0"
] | null | null | null | models/vggf.py | IBM/energy-efficient-resilience | 13dfcac143df218abe20ed8d8752a0bd7e5a424b | [
"Apache-2.0"
] | 2 | 2022-03-04T19:45:14.000Z | 2022-03-23T13:17:27.000Z | # Adapted vgg16 from pytorch repo to include my fault injection operators and for cifar10
import torch
import torch.nn as nn
import sys
sys.path.append('../quantized_ops')
sys.path.append('../faultinjection_ops')
from quantized_ops import zs_quantized_ops
from faultinjection_ops import zs_faultinjection_ops
import pdb... | 45.283505 | 351 | 0.654411 |
91a8e90d2142f54a4339aa8c38d32b467f34e290 | 1,921 | py | Python | converter/path.py | irori/wpfont | 22536d257a953f5edb997368fd58505620f923ed | [
"MIT"
] | 66 | 2018-08-11T04:16:37.000Z | 2022-03-17T06:59:24.000Z | converter/path.py | irori/wpfont | 22536d257a953f5edb997368fd58505620f923ed | [
"MIT"
] | null | null | null | converter/path.py | irori/wpfont | 22536d257a953f5edb997368fd58505620f923ed | [
"MIT"
] | 2 | 2019-11-21T04:54:20.000Z | 2020-02-08T13:12:16.000Z | class PathBuilder:
def __init__(self):
self._segments = dict()
def add_segment(self, p1, p2):
s2 = self._segments.get(p2)
if s2 and p1 in s2:
s2.remove(p1)
if not s2:
del self._segments[p2]
else:
self._segments.setdefault(p1, s... | 28.25 | 69 | 0.434149 |
df3e914cb7103f846e34d87ce4168176a9973aee | 1,398 | py | Python | model/contact.py | BorodinaO/python_training | 637148bc2d0ef9534515939272a0bba2b5874e8d | [
"Apache-2.0"
] | null | null | null | model/contact.py | BorodinaO/python_training | 637148bc2d0ef9534515939272a0bba2b5874e8d | [
"Apache-2.0"
] | null | null | null | model/contact.py | BorodinaO/python_training | 637148bc2d0ef9534515939272a0bba2b5874e8d | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Contact:
def __init__(self, firstname=None, lastname=None, id=None, all_phones_from_home_page=None, home=None,
work=None, mobile=None, phone2=None, email=None, email2=None, email3=None,
all_emails_from_home_page=None, address=None):
self.fir... | 37.783784 | 156 | 0.578684 |
fdae8fe0f01aa5d104c0c6dbc5d4bf4f8dfa98de | 7,766 | py | Python | docs/conf.py | SandeepUpadhyaya/mlflow_main | 5f4d2a7437ea79a56669e52c049ccf71fb1cef8e | [
"MIT"
] | null | null | null | docs/conf.py | SandeepUpadhyaya/mlflow_main | 5f4d2a7437ea79a56669e52c049ccf71fb1cef8e | [
"MIT"
] | null | null | null | docs/conf.py | SandeepUpadhyaya/mlflow_main | 5f4d2a7437ea79a56669e52c049ccf71fb1cef8e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# mlops_main documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values hav... | 31.697959 | 80 | 0.706928 |
9ab8621bc24667c45e8a2f8d3c26512da981298c | 1,073 | py | Python | rgram/contrib/sites/migrations/0003_set_site_domain_and_name.py | dyjung123/rgram | 56223d08b2cd46fe73842ba3b5c817cd6b4e3fe4 | [
"MIT"
] | null | null | null | rgram/contrib/sites/migrations/0003_set_site_domain_and_name.py | dyjung123/rgram | 56223d08b2cd46fe73842ba3b5c817cd6b4e3fe4 | [
"MIT"
] | 7 | 2020-06-05T17:08:40.000Z | 2021-09-07T23:49:22.000Z | rgram/contrib/sites/migrations/0003_set_site_domain_and_name.py | dyjung123/rgram | 56223d08b2cd46fe73842ba3b5c817cd6b4e3fe4 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 24.953488 | 129 | 0.640261 |
91ecd343c0416cd1814985e3b64df5a263621780 | 1,043 | py | Python | grace_dl/tensorflow/compressor/packing.py | aoranwu/grace | 1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e | [
"BSD-2-Clause"
] | 88 | 2020-05-07T15:36:10.000Z | 2022-03-13T06:13:31.000Z | grace_dl/tensorflow/compressor/packing.py | aoranwu/grace | 1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e | [
"BSD-2-Clause"
] | 21 | 2020-05-25T08:37:03.000Z | 2022-03-30T10:08:14.000Z | grace_dl/tensorflow/compressor/packing.py | aoranwu/grace | 1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e | [
"BSD-2-Clause"
] | 33 | 2020-05-07T23:11:39.000Z | 2022-03-25T03:33:49.000Z | import tensorflow as tf
def encode_byte(a):
# input: int32 type tensor with values in range 0,1,2,3 (2'b00,2'b01,2'b10,3'b11)
# output: encoded uint8 type tensor
a = tf.reshape(a, [-1])
pad_size = 4 - tf.mod(tf.size(a), 4)
pad = tf.range(0, pad_size)
a = tf.concat([a, pad], 0)
a_split1, a_... | 34.766667 | 86 | 0.627037 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.