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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dd8d432133ff661f7c88705c713b928319cb35ba | 2,153 | py | Python | couchbase/encryption/crypto_manager.py | couchbase/couchbase-python-client | 99ec055835f5aef0cd07905497b3ab4bb3cbbc32 | [
"Apache-2.0"
] | 189 | 2015-01-07T18:34:31.000Z | 2022-03-21T17:41:56.000Z | couchbase/encryption/crypto_manager.py | couchbase/couchbase-python-client | 99ec055835f5aef0cd07905497b3ab4bb3cbbc32 | [
"Apache-2.0"
] | 24 | 2015-05-19T14:00:16.000Z | 2022-03-16T22:01:30.000Z | couchbase/encryption/crypto_manager.py | couchbase/couchbase-python-client | 99ec055835f5aef0cd07905497b3ab4bb3cbbc32 | [
"Apache-2.0"
] | 60 | 2015-03-10T22:12:50.000Z | 2022-03-07T21:57:40.000Z | from abc import ABC, abstractmethod
from typing import Union
class CryptoManager(ABC):
"""Interface a CryptoManager must implement
"""
_DEFAULT_ENCRYPTER_ALIAS = "__DEFAULT__"
@abstractmethod
def encrypt(
self, # type: CryptoManager
plaintext, # type: Union[str, bytes, bytearr... | 25.939759 | 90 | 0.618672 |
414159c2a0fbf58e7da5814d437c45c6e8d7e09c | 1,911 | py | Python | training/checkpointing.py | chenw23/open_lth | 2ce732fe48abd5a80c10a153c45d397b048e980c | [
"MIT"
] | 509 | 2020-05-07T16:45:46.000Z | 2022-03-28T13:41:36.000Z | training/checkpointing.py | chenw23/open_lth | 2ce732fe48abd5a80c10a153c45d397b048e980c | [
"MIT"
] | 12 | 2020-06-10T10:07:09.000Z | 2022-02-03T01:57:32.000Z | training/checkpointing.py | chenw23/open_lth | 2ce732fe48abd5a80c10a153c45d397b048e980c | [
"MIT"
] | 103 | 2020-05-07T21:40:06.000Z | 2022-03-11T19:07:55.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from foundations import paths
from foundations.step import Step
from platforms.platform import get_platform
from training.metric_... | 42.466667 | 115 | 0.725275 |
5e149e499cb149f1d1d09390271663ec8f9beed3 | 569 | py | Python | api/v2/views/image_tag.py | xuhang57/atmosphere | f53fea2a74ee89ccc8852906799b1d9a7e9178b7 | [
"BSD-3-Clause"
] | null | null | null | api/v2/views/image_tag.py | xuhang57/atmosphere | f53fea2a74ee89ccc8852906799b1d9a7e9178b7 | [
"BSD-3-Clause"
] | null | null | null | api/v2/views/image_tag.py | xuhang57/atmosphere | f53fea2a74ee89ccc8852906799b1d9a7e9178b7 | [
"BSD-3-Clause"
] | null | null | null | from core.models import ApplicationTag as ImageTag
from api.v2.serializers.details import ImageTagSerializer
from api.v2.views.base import AuthModelViewSet
class ImageTagViewSet(AuthModelViewSet):
"""
API endpoint that allows instance tags to be viewed
"""
queryset = ImageTag.objects.all()
seria... | 25.863636 | 74 | 0.725835 |
77859af9a3a1eccb4409f7d07c473816eb412e53 | 18,691 | py | Python | tests/test_bzutil.py | locriandev/elliott | 4f0553b1cb64da15384d3dc87e353211b16ba96a | [
"Apache-2.0"
] | null | null | null | tests/test_bzutil.py | locriandev/elliott | 4f0553b1cb64da15384d3dc87e353211b16ba96a | [
"Apache-2.0"
] | null | null | null | tests/test_bzutil.py | locriandev/elliott | 4f0553b1cb64da15384d3dc87e353211b16ba96a | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timezone
import logging
import unittest
import xmlrpc.client
from flexmock import flexmock
import mock
from elliottlib.bzutil import JIRABugTracker, BugzillaBugTracker
from elliottlib import bzutil, constants
hostname = "bugzilla.redhat.com"
class TestJIRABugTracker(unittest.TestCase)... | 43.772834 | 114 | 0.495479 |
b607bfaecb9d2e76d8a55510fce5ad3933300b45 | 5,373 | py | Python | Day20/Day20-2.py | remonedo/AdventOfCode2019 | 0d4f47ce05d7500fd16058bb28e34c581a902d32 | [
"MIT"
] | null | null | null | Day20/Day20-2.py | remonedo/AdventOfCode2019 | 0d4f47ce05d7500fd16058bb28e34c581a902d32 | [
"MIT"
] | null | null | null | Day20/Day20-2.py | remonedo/AdventOfCode2019 | 0d4f47ce05d7500fd16058bb28e34c581a902d32 | [
"MIT"
] | null | null | null | import operator
import numpy
def mark_portals(area):
width, height = area.shape
portals = {}
for y in range(0, height):
for x in range(0, width):
if area[x, y] is None:
continue
if not ('A' <= area[x, y][0] <= 'Z'):
continue
po... | 30.01676 | 104 | 0.445003 |
bcfb4f4ca1b96990cfb5580bf59b0f5a8e42b273 | 1,237 | py | Python | iwaves/utils/tools.py | mrayson/iwaves | ddb6acc017a22896484fcd4c1058210e6223fde0 | [
"BSD-2-Clause"
] | null | null | null | iwaves/utils/tools.py | mrayson/iwaves | ddb6acc017a22896484fcd4c1058210e6223fde0 | [
"BSD-2-Clause"
] | 3 | 2020-08-31T02:50:39.000Z | 2020-08-31T03:26:33.000Z | iwaves/utils/tools.py | iosonobert/iwaves | 143563bc9075d1e42e486a064f1fefa67ed84702 | [
"BSD-2-Clause"
] | 5 | 2020-08-31T02:04:41.000Z | 2022-02-27T06:38:00.000Z | # Functions for 2D arrays
import numpy as np
import pdb
def grad_z(y, z, axis=0):
"""
Compute the vertical gradient
"z" can be an array same size as y, or vector along the first axis of "y"
Takes the derivative along the dimension specified by axis(=0)
"""
Nz = z.shape[0]
# Reshape the ... | 23.339623 | 77 | 0.503638 |
cf312690a337ef59335bea280df574721cc978c0 | 50,685 | py | Python | bin/Python27/Lib/site-packages/sympy/integrals/integrals.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/sympy/integrals/integrals.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/sympy/integrals/integrals.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | from sympy.core import (Basic, Expr, S, C, Symbol, Wild, Add, sympify, diff,
oo, Tuple, Interval)
from sympy.core.symbol import Dummy
from sympy.core.compatibility import is_sequence
from sympy.integrals.trigonometry import trigintegrate
from sympy.integrals.deltafunctions import deltaintegrate... | 35.921332 | 91 | 0.548525 |
3bd5af70804af8d53afcdcd6b8596262649f5bed | 75,940 | py | Python | holoviews/plotting/plot.py | wuyuanyi135/holoviews | f8e776b15ac3c08d0d8090eb53466aa4130977ee | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/plot.py | wuyuanyi135/holoviews | f8e776b15ac3c08d0d8090eb53466aa4130977ee | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/plot.py | wuyuanyi135/holoviews | f8e776b15ac3c08d0d8090eb53466aa4130977ee | [
"BSD-3-Clause"
] | null | null | null | """
Public API for all plots supported by HoloViews, regardless of
plotting package or backend. Every plotting classes must be a subclass
of this Plot baseclass.
"""
from __future__ import absolute_import
import threading
import uuid
import warnings
from collections import Counter, defaultdict
from functools import p... | 41.271739 | 116 | 0.589505 |
25e409d77bd12d53e11b97177208fe3827a255c3 | 1,680 | py | Python | freebilly/repository/AbstractWorkLogRepository.py | emileten/billy | 3fd0ab381382f7e64c67bc37b4ea2555e6b09822 | [
"MIT"
] | null | null | null | freebilly/repository/AbstractWorkLogRepository.py | emileten/billy | 3fd0ab381382f7e64c67bc37b4ea2555e6b09822 | [
"MIT"
] | 1 | 2022-01-20T02:36:03.000Z | 2022-01-20T02:36:03.000Z | freebilly/repository/AbstractWorkLogRepository.py | emileten/billy | 3fd0ab381382f7e64c67bc37b4ea2555e6b09822 | [
"MIT"
] | null | null | null | import abc
from custom_inherit import DocInheritMeta
from freebilly.domain.AbstractWorkLog import AbstractWorkLog
class AbstractWorkLogRepository(
metaclass=DocInheritMeta(style="numpy", abstract_base_class=True)
):
"""
abstraction for a repository of work logs
"""
@abc.abstractmethod
def ex... | 23.013699 | 113 | 0.567857 |
5267d31d230e0a15c06f732707d662ffa4ffdb1f | 1,233 | py | Python | SiF/SiF/urls.py | karendahlaarhus/TDT4140-programvareutvikling | f966ff3f2286c4875edbb5c77d1f9073a10b56c6 | [
"MIT"
] | null | null | null | SiF/SiF/urls.py | karendahlaarhus/TDT4140-programvareutvikling | f966ff3f2286c4875edbb5c77d1f9073a10b56c6 | [
"MIT"
] | null | null | null | SiF/SiF/urls.py | karendahlaarhus/TDT4140-programvareutvikling | f966ff3f2286c4875edbb5c77d1f9073a10b56c6 | [
"MIT"
] | null | null | null | """SiF URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 38.53125 | 86 | 0.714517 |
3420b939fcca78e99c80ffbff060e73d96ae7bfa | 2,328 | py | Python | sahara/api/middleware/auth_valid.py | mapr/sahara | e08fce3c7e1833b44a47838bbe8de26bb21bff16 | [
"Apache-2.0"
] | 1 | 2022-02-25T19:14:33.000Z | 2022-02-25T19:14:33.000Z | sahara/api/middleware/auth_valid.py | mapr/sahara | e08fce3c7e1833b44a47838bbe8de26bb21bff16 | [
"Apache-2.0"
] | null | null | null | sahara/api/middleware/auth_valid.py | mapr/sahara | e08fce3c7e1833b44a47838bbe8de26bb21bff16 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Mirantis 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 law or agreed to in writ... | 32.788732 | 77 | 0.659364 |
69d6fd5fc5ef1fbf65f84616e5e63a6c10bb8f5b | 1,937 | py | Python | python/test_gilded_rose.py | josppss96/GildedRose-Refactoring-Kata | e07ab1729687df0a5325b3943fceac3dba9f3135 | [
"MIT"
] | 1 | 2021-10-05T08:20:38.000Z | 2021-10-05T08:20:38.000Z | python/test_gilded_rose.py | josppss96/GildedRose-Refactoring-Kata | e07ab1729687df0a5325b3943fceac3dba9f3135 | [
"MIT"
] | null | null | null | python/test_gilded_rose.py | josppss96/GildedRose-Refactoring-Kata | e07ab1729687df0a5325b3943fceac3dba9f3135 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from gilded_rose import Item, GildedRose
class GildedRoseTest(unittest.TestCase):
aged_brie = "Aged Brie"
sulfuras = "Sulfuras, Hand of Ragnaros"
elixir = "Elixir of the Mongoose"
conjured = "Conjured Mana Cake"
passes = "Backstage passes to a TAFKAL80ETC ... | 40.354167 | 102 | 0.645328 |
aa522c7ca249f7059913f88674e39b462925bf44 | 5,290 | py | Python | autoarray/structures/plot/structure_plotters.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 5 | 2019-09-26T02:18:25.000Z | 2021-12-11T16:29:20.000Z | autoarray/structures/plot/structure_plotters.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 3 | 2020-03-30T14:25:57.000Z | 2021-12-21T17:10:55.000Z | autoarray/structures/plot/structure_plotters.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 4 | 2020-03-03T11:35:41.000Z | 2022-01-21T17:37:35.000Z | import numpy as np
from typing import List, Union
from autoarray.plot.abstract_plotters import AbstractPlotter
from autoarray.plot.mat_wrap.visuals import Visuals1D
from autoarray.plot.mat_wrap.visuals import Visuals2D
from autoarray.plot.mat_wrap.include import Include1D
from autoarray.plot.mat_wrap.include im... | 33.910256 | 114 | 0.633459 |
7ca97e0b22cf5ca509f4ef0e74fcb19f855e8354 | 82 | py | Python | fx_findings/reversal_analysis/__init__.py | maxoja/betting-simulator | 812242cec2218ed60aee8819255a4ab0c4ea2263 | [
"MIT"
] | null | null | null | fx_findings/reversal_analysis/__init__.py | maxoja/betting-simulator | 812242cec2218ed60aee8819255a4ab0c4ea2263 | [
"MIT"
] | null | null | null | fx_findings/reversal_analysis/__init__.py | maxoja/betting-simulator | 812242cec2218ed60aee8819255a4ab0c4ea2263 | [
"MIT"
] | null | null | null | # from . import analyse
from .analyse import run
from .wick import run as run_wick | 27.333333 | 33 | 0.780488 |
a6f43eb4d833b4ba679c38ac11f44b548feb7d7a | 3,236 | py | Python | DDPG/utils.py | WoShiDongZhiWu/Reinforcement-learning-Algorithm | 59fdf29e7feb73048b9ddf3b4755b55f0459efcb | [
"Apache-2.0"
] | 1 | 2019-12-23T02:59:13.000Z | 2019-12-23T02:59:13.000Z | DDPG/utils.py | WoShiDongZhiWu/reinforcement-learning-algorithm | 59fdf29e7feb73048b9ddf3b4755b55f0459efcb | [
"Apache-2.0"
] | null | null | null | DDPG/utils.py | WoShiDongZhiWu/reinforcement-learning-algorithm | 59fdf29e7feb73048b9ddf3b4755b55f0459efcb | [
"Apache-2.0"
] | null | null | null | '''
########################################################
# author wudong
# date 20190816
# DDPG算法需要的一些函数:
# Ornstein-Uhlenbeck过程:给确定性行为添加一定的噪声
# DDPG的两套更新算法 hard_update完全更新 soft_uodate 小幅度更新
########################################################
'''
import numpy as np
import torch
import shutil
import torch... | 27.896552 | 100 | 0.594252 |
8d863273bf5fba93d47b6d407c93da0a5a2775cd | 7,047 | py | Python | test/functional/p2p_invalid_tx.py | Neomnf/NEOM | daf60c9ffc3f85d758c114f1e511d246a2fd178d | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_tx.py | Neomnf/NEOM | daf60c9ffc3f85d758c114f1e511d246a2fd178d | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_tx.py | Neomnf/NEOM | daf60c9ffc3f85d758c114f1e511d246a2fd178d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid transactions.
In this test we connect to one node over p2p, and test tx... | 45.464516 | 143 | 0.686108 |
3a0ebd0abe11eae685e3a48c740f3f9a54b4e347 | 1,066 | py | Python | pydarkstar/scrubbing/scrubber.py | Demiurge-DSP/pydarkstar | 47fb57b493aa83740dfebccd84de6957a2992dcc | [
"MIT"
] | null | null | null | pydarkstar/scrubbing/scrubber.py | Demiurge-DSP/pydarkstar | 47fb57b493aa83740dfebccd84de6957a2992dcc | [
"MIT"
] | null | null | null | pydarkstar/scrubbing/scrubber.py | Demiurge-DSP/pydarkstar | 47fb57b493aa83740dfebccd84de6957a2992dcc | [
"MIT"
] | 1 | 2019-05-12T14:28:57.000Z | 2019-05-12T14:28:57.000Z | from ..darkobject import DarkObject
from bs4 import BeautifulSoup
import logging
import time
from urllib.request import urlopen
class Scrubber(DarkObject):
def __init__(self):
super(Scrubber, self).__init__()
def scrub(self):
"""
Get item metadata.
"""
return {}
... | 21.755102 | 83 | 0.525328 |
8bdb8c6bde17d15d2986dc149b62d8d97cea2713 | 2,314 | py | Python | clients/python-flask/generated/openapi_server/models/favorite_impllinks.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 23 | 2017-08-01T12:25:26.000Z | 2022-01-25T03:44:11.000Z | clients/python-flask/generated/openapi_server/models/favorite_impllinks.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 35 | 2017-06-14T03:28:15.000Z | 2022-02-14T10:25:54.000Z | clients/python-flask/generated/openapi_server/models/favorite_impllinks.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 11 | 2017-08-31T19:00:20.000Z | 2021-12-19T12:04:12.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server.models.link import Link # noqa: F401,E501
from openapi_server import util
class FavoriteImpll... | 25.152174 | 96 | 0.60847 |
7baf078e1ca61d0392512e61730bead17d63566b | 8,771 | py | Python | matpyxplot/plt.py | ajayramak/matpyxplot | 874b83f75a7640257d53590783ab702098139406 | [
"Apache-2.0"
] | null | null | null | matpyxplot/plt.py | ajayramak/matpyxplot | 874b83f75a7640257d53590783ab702098139406 | [
"Apache-2.0"
] | null | null | null | matpyxplot/plt.py | ajayramak/matpyxplot | 874b83f75a7640257d53590783ab702098139406 | [
"Apache-2.0"
] | null | null | null | # Ajayrama Kumaraswamy, 6th Jan 2015
import pyx
import subprocess
import math
goldenMean = (1 + math.sqrt(5))/2
class Graph(object):
_colMap = {
'b' : pyx.color.rgb.blue,
'r' : pyx.color.rgb.red,
'g' : pyx.color.rgb.green,
'm' : pyx.color.cmyk.Mage... | 26.104167 | 130 | 0.5061 |
7a9180a12293b0d956cfbb70d398fdb26925f03d | 538 | py | Python | manage.py | AkinWilderman/myPort | 3ddeea04ccffe3ed7b66d6dba2c1f2dc00c9eb6c | [
"Apache-2.0"
] | null | null | null | manage.py | AkinWilderman/myPort | 3ddeea04ccffe3ed7b66d6dba2c1f2dc00c9eb6c | [
"Apache-2.0"
] | null | null | null | manage.py | AkinWilderman/myPort | 3ddeea04ccffe3ed7b66d6dba2c1f2dc00c9eb6c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myPort.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are y... | 33.625 | 73 | 0.685874 |
a02a7361573201e19663b4edd144d99cb4beac53 | 5,235 | py | Python | fhirclient/r4models/documentreference_tests.py | cspears-mitre/CapStatement | 2390566ed75d420e0615e3a0aacb77e8c030fdcc | [
"Apache-2.0"
] | 1 | 2021-12-24T11:14:38.000Z | 2021-12-24T11:14:38.000Z | fhirclient/r4models/documentreference_tests.py | cspears-mitre/CapStatement | 2390566ed75d420e0615e3a0aacb77e8c030fdcc | [
"Apache-2.0"
] | null | null | null | fhirclient/r4models/documentreference_tests.py | cspears-mitre/CapStatement | 2390566ed75d420e0615e3a0aacb77e8c030fdcc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.6.0-bd605d07 on 2018-12-20.
# 2018, SMART Health IT.
import os
import io
import unittest
import json
from . import documentreference
from .fhirdate import FHIRDate
class DocumentReferenceTests(unittest.TestCase):
def instantiate_from(self... | 61.588235 | 135 | 0.701624 |
d3047b6ccbf88110d035b1360384972c67aab91f | 989 | py | Python | examples/plots/plot_cylinder.py | alek5k/pytransform3d | c6fb10b1d17713bd8a2d6becb928c4f6dcf611f9 | [
"BSD-3-Clause"
] | 304 | 2019-01-16T15:14:31.000Z | 2022-03-31T16:14:37.000Z | examples/plots/plot_cylinder.py | alek5k/pytransform3d | c6fb10b1d17713bd8a2d6becb928c4f6dcf611f9 | [
"BSD-3-Clause"
] | 94 | 2018-12-07T14:54:05.000Z | 2022-03-19T22:38:20.000Z | examples/plots/plot_cylinder.py | alek5k/pytransform3d | c6fb10b1d17713bd8a2d6becb928c4f6dcf611f9 | [
"BSD-3-Clause"
] | 37 | 2018-12-09T23:58:40.000Z | 2022-03-16T02:29:53.000Z | """
==========================
Plot Transformed Cylinders
==========================
Plots surfaces of transformed cylindrical shells.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from pytransform3d.transformations import transform_from, plot_transform
from pytransform3d.rotations import ran... | 29.969697 | 77 | 0.70273 |
0a02c30043a23e269bc92f334d103d5ee509fe64 | 6,166 | py | Python | src/main/python/model/elastic_net.py | meowpunch/bobsim-research | 4411ac6eaf5b760611f689b0a9e290546e2f5435 | [
"MIT"
] | 2 | 2020-03-01T17:42:44.000Z | 2020-03-09T06:13:34.000Z | src/main/python/model/elastic_net.py | meowpunch/bobsim-research | 4411ac6eaf5b760611f689b0a9e290546e2f5435 | [
"MIT"
] | 2 | 2020-04-01T16:48:06.000Z | 2020-04-04T11:04:10.000Z | src/main/python/model/elastic_net.py | meowpunch/bobsim-research | 4411ac6eaf5b760611f689b0a9e290546e2f5435 | [
"MIT"
] | null | null | null | import tempfile
import pandas as pd
from joblib import dump
import numpy as np
from sklearn.linear_model import ElasticNet
from sklearn.metrics import make_scorer, mean_squared_error
from sklearn.model_selection import GridSearchCV, TimeSeriesSplit
from analysis.hit_ratio_error import hit_ratio_error
from utils.loggi... | 32.624339 | 89 | 0.631528 |
c9a4a542e62785cc01d93a6597ed6c04cb24e6a3 | 7,763 | py | Python | password_validation/test/test_validators.py | gutyril/django-password-validation | fc721bdb973cafdaca2acc31f370c6ed66290d7b | [
"BSD-3-Clause"
] | 33 | 2015-06-11T02:02:36.000Z | 2018-03-09T12:20:42.000Z | password_validation/test/test_validators.py | gutyril/django-password-validation | fc721bdb973cafdaca2acc31f370c6ed66290d7b | [
"BSD-3-Clause"
] | 2 | 2017-03-23T17:05:03.000Z | 2017-04-25T19:11:33.000Z | password_validation/test/test_validators.py | gutyril/django-password-validation | fc721bdb973cafdaca2acc31f370c6ed66290d7b | [
"BSD-3-Clause"
] | 14 | 2015-06-11T07:11:53.000Z | 2019-12-19T01:22:36.000Z | """This module is backported from Django.
Copied from tests/auth_tests/test_validators.py at commit
9851e54121b3eebd3a7a29de3ed874d82554396b
The only change is to replace `django.contrib.auth.password_validation` with
`password_validation` throughout.
"""
from __future__ import unicode_literals
import os
from djan... | 42.653846 | 110 | 0.716604 |
e3ece2691272aa36d8340643146de96ca7b03277 | 15,127 | py | Python | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.py | kerwinxu/barcodeManager | 175a7a07babc3da460e94c49c463fd8275ec228b | [
"BSD-2-Clause"
] | null | null | null | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.py | kerwinxu/barcodeManager | 175a7a07babc3da460e94c49c463fd8275ec228b | [
"BSD-2-Clause"
] | null | null | null | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.py | kerwinxu/barcodeManager | 175a7a07babc3da460e94c49c463fd8275ec228b | [
"BSD-2-Clause"
] | 1 | 2019-12-24T07:18:01.000Z | 2019-12-24T07:18:01.000Z | """SCons.Scanner
The Scanner package for the SCons software construction utility.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated document... | 36.538647 | 126 | 0.623455 |
f631dcd682255452eedaadece2188cc4f002118b | 955 | py | Python | app/db/__init__.py | Exodo-LS/is219_flask_app | 15a88d1d23aa64519a9e93d1f6cff04c4f68791e | [
"BSD-3-Clause"
] | null | null | null | app/db/__init__.py | Exodo-LS/is219_flask_app | 15a88d1d23aa64519a9e93d1f6cff04c4f68791e | [
"BSD-3-Clause"
] | null | null | null | app/db/__init__.py | Exodo-LS/is219_flask_app | 15a88d1d23aa64519a9e93d1f6cff04c4f68791e | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
from flask import Blueprint, cli
from flask_sqlalchemy import SQLAlchemy
from app import config
db = SQLAlchemy()
database = Blueprint('database', __name__, )
@database.cli.command('create')
def init_db():
db.create_all()
@database.before_app_first_request
def create_db_file_if_does... | 24.487179 | 72 | 0.71623 |
00bd29cd570668e6addce0873b08952e77992564 | 1,968 | py | Python | pythonscript/embedded/godot/hazmat/io.py | ktksgit/godot-python | d50a29203d0744754e59eb9cb13263e907ba7ee3 | [
"CC-BY-3.0"
] | null | null | null | pythonscript/embedded/godot/hazmat/io.py | ktksgit/godot-python | d50a29203d0744754e59eb9cb13263e907ba7ee3 | [
"CC-BY-3.0"
] | null | null | null | pythonscript/embedded/godot/hazmat/io.py | ktksgit/godot-python | d50a29203d0744754e59eb9cb13263e907ba7ee3 | [
"CC-BY-3.0"
] | null | null | null | import sys
import pdb
from io import RawIOBase
from pythonscriptcffi import lib
from godot.hazmat.tools import godot_string_from_pyobj
# TODO: really not optimized implementation...
class GodotIO(RawIOBase):
def __init__(self, godot_func):
self.buffer = ""
self.godot_func = godot_func
def... | 26.594595 | 79 | 0.6875 |
6701ad033865780073c71423f3075642a6dc5e4b | 9,471 | py | Python | mmtfPyspark/utils/mmtfDecoder.py | pwrose/mmtf-pyspark | 2d0d9908bca0cb37e4cd8205b905707ce26d237e | [
"Apache-2.0"
] | null | null | null | mmtfPyspark/utils/mmtfDecoder.py | pwrose/mmtf-pyspark | 2d0d9908bca0cb37e4cd8205b905707ce26d237e | [
"Apache-2.0"
] | null | null | null | mmtfPyspark/utils/mmtfDecoder.py | pwrose/mmtf-pyspark | 2d0d9908bca0cb37e4cd8205b905707ce26d237e | [
"Apache-2.0"
] | null | null | null | '''mmtfDecoder.py
Provides efficient methods to decode mmtf structures
'''
__author__ = "Mars (Shih-Cheng) Huang, Peter W Rose"
__maintainer__ = "Peter W Rose"
__email__ = "pwrose.ucsd@gmail.com"
__version__ = "0.3.7"
__status__ = "experimental"
import numpy as np
from numba import jit
from mmtfPyspark.utils import m... | 31.257426 | 99 | 0.639426 |
956f6a63e6988641a61e334890dcead52a0303b6 | 7,528 | py | Python | xtlib/psm/local_psm_client.py | microsoft/ExperimentTools | ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc | [
"MIT"
] | 5 | 2020-06-13T17:44:51.000Z | 2021-12-21T21:02:36.000Z | xtlib/psm/local_psm_client.py | microsoft/ExperimentTools | ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc | [
"MIT"
] | 9 | 2020-06-11T20:56:52.000Z | 2022-03-12T00:34:45.000Z | xtlib/psm/local_psm_client.py | microsoft/ExperimentTools | ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc | [
"MIT"
] | 7 | 2020-06-13T17:44:54.000Z | 2021-12-21T21:02:52.000Z | #
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
#
# local_psm_client.py: talk to Pool State Mgr running on local machine
import os
import time
import uuid
import psutil
import shutil
from xtlib import utils
from xtlib import pc_utils
from xtlib import constants
from xtlib import file_utils
f... | 32.034043 | 95 | 0.577179 |
46d1ecaa0e8c9579374e4a0186db06f4fdc3535f | 6,978 | py | Python | src/data/CFD/shallow_cfd.py | poly-ai/fluid-surface-estimation | b2e310f38c3cce3c13fbf0b8277ee4eb00755d36 | [
"MIT"
] | 2 | 2022-02-15T21:41:06.000Z | 2022-02-16T04:54:51.000Z | src/data/CFD/shallow_cfd.py | poly-ai/fluid-surface-estimation | b2e310f38c3cce3c13fbf0b8277ee4eb00755d36 | [
"MIT"
] | null | null | null | src/data/CFD/shallow_cfd.py | poly-ai/fluid-surface-estimation | b2e310f38c3cce3c13fbf0b8277ee4eb00755d36 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from .readgri import readgri
from .flux import FluxFunction
import pandas as pd
# USER SPECIFY
#############################################################
LABEL = "fine" # Label for the simulation
SIM_TIME = 1 # The total simulation time (> 500 frames)
# NOTE dt =... | 28.137097 | 103 | 0.475064 |
73131d6c0fa216e136b44772d195a1f6a4700c1d | 20,381 | py | Python | tensorflow/python/autograph/pyct/static_analysis/activity.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2020-10-01T16:52:51.000Z | 2020-10-01T16:52:51.000Z | tensorflow/python/autograph/pyct/static_analysis/activity.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2022-02-10T01:08:48.000Z | 2022-02-10T01:08:48.000Z | tensorflow/python/autograph/pyct/static_analysis/activity.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.568935 | 133 | 0.701487 |
50277c70a08d8a843203bcb716a5bec99cd1b41c | 8,023 | py | Python | docs/conf.py | StabbarN/pytest-services | 753ccdf2c3be8bca4aced50d96be624064b179c5 | [
"MIT"
] | 58 | 2015-03-03T13:36:47.000Z | 2021-11-24T01:00:49.000Z | docs/conf.py | StabbarN/pytest-services | 753ccdf2c3be8bca4aced50d96be624064b179c5 | [
"MIT"
] | 38 | 2015-07-17T09:09:10.000Z | 2020-10-30T12:13:04.000Z | docs/conf.py | StabbarN/pytest-services | 753ccdf2c3be8bca4aced50d96be624064b179c5 | [
"MIT"
] | 13 | 2015-07-20T15:12:15.000Z | 2020-12-24T13:31:30.000Z | """Sphinx config."""
# -*- coding: utf-8 -*-
#
# pytest-services documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 7 21:07:56 2013.
#
# 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
... | 32.350806 | 89 | 0.715568 |
d854ee15a847c6444b207eb0ac579510c247986b | 45,720 | py | Python | lib/handling/gromacs.py | hernanchavezthielemann/GRO2LAM | e60aca80ad441f9b29acd30a6bef4c47d97e5e30 | [
"MIT"
] | 48 | 2018-05-15T04:50:52.000Z | 2022-03-22T09:27:08.000Z | lib/handling/gromacs.py | hernanchavezthielemann/GRO2LAM | e60aca80ad441f9b29acd30a6bef4c47d97e5e30 | [
"MIT"
] | 16 | 2019-01-12T01:41:05.000Z | 2021-01-27T11:38:12.000Z | lib/handling/gromacs.py | hernanchavezthielemann/GRO2LAM | e60aca80ad441f9b29acd30a6bef4c47d97e5e30 | [
"MIT"
] | 17 | 2019-03-11T22:21:42.000Z | 2021-11-11T14:08:12.000Z | #!/usr/bin/python
# By Hernan Chavez Thielemann
__author__ = 'Hernan Chavez Thielemann <hchavezthiele at gmail dot com>'
from lib.misc.warn import wrg_1, wrg_3, pop_err_1, pop_wrg_1
from lib.misc.file import check_file, debugger_file, fileseeker
from lib.misc.geometry import rotate, arcos, raiz
from lib.misc.data ... | 40.175747 | 96 | 0.460739 |
889ab952492ba4f184815b3a41b87a731d344b8c | 545 | py | Python | adv/sinoa.py.means.py | mattkw/dl | 45bfc28ad9ff827045a3734730deb893a2436c09 | [
"Apache-2.0"
] | null | null | null | adv/sinoa.py.means.py | mattkw/dl | 45bfc28ad9ff827045a3734730deb893a2436c09 | [
"Apache-2.0"
] | null | null | null | adv/sinoa.py.means.py | mattkw/dl | 45bfc28ad9ff827045a3734730deb893a2436c09 | [
"Apache-2.0"
] | null | null | null | import adv_test
import adv
from adv import *
def module():
return Sinoa
class Sinoa(adv.Adv):
a1 = ('a',0.13,'hp100')
a3 = ('bt',0.2)
# conf = {}
# import slot
# conf['slots.a'] = slot.a.Bellathorna()+slot.a.RR()
def s1_proc(this, e):
adv.Teambuff('s1_att',0.25/4,15,'att').on()
... | 17.580645 | 55 | 0.519266 |
b6ed225d7138b2b374f78280cdef3d6ce62e5912 | 7,928 | py | Python | app/libs/ldap/ldap_wrapper.py | regg00/docker-xmedius-adsync | 738bdb82d37173c9363d69c8148a95c43043aeba | [
"MIT"
] | null | null | null | app/libs/ldap/ldap_wrapper.py | regg00/docker-xmedius-adsync | 738bdb82d37173c9363d69c8148a95c43043aeba | [
"MIT"
] | null | null | null | app/libs/ldap/ldap_wrapper.py | regg00/docker-xmedius-adsync | 738bdb82d37173c9363d69c8148a95c43043aeba | [
"MIT"
] | null | null | null | #////////////////////////////////////////////////////////////////////////////
# Copyright (c) 2012 Sagemcom Canada Permission to use this work
# for any purpose must be obtained in writing from Sagemcom Canada
# 5252 de Maisonneuve Blvd. West, suite 400, Montreal, Quebec H4A 3S5
#///////////////////////////////////////... | 41.726316 | 146 | 0.626387 |
84e3d2bf75b5344fe1ff8e6e1e921c64c4175720 | 3,548 | py | Python | CSDGAN/pipeline/data/make_image_dataset.py | Atrus619/CSDGAN | 712be213e59b32a79a4970684d726af63616edaf | [
"MIT"
] | 1 | 2019-06-27T12:14:39.000Z | 2019-06-27T12:14:39.000Z | CSDGAN/pipeline/data/make_image_dataset.py | Atrus619/CSDGAN | 712be213e59b32a79a4970684d726af63616edaf | [
"MIT"
] | 21 | 2019-08-06T12:44:14.000Z | 2019-11-03T14:28:46.000Z | CSDGAN/pipeline/data/make_image_dataset.py | Atrus619/Synthetic_Data_GAN_Capstone | 712be213e59b32a79a4970684d726af63616edaf | [
"MIT"
] | 1 | 2020-07-25T13:14:31.000Z | 2020-07-25T13:14:31.000Z | import CSDGAN.utils.constants as cs
import CSDGAN.utils.db as db
import CSDGAN.utils.utils as cu
import CSDGAN.utils.img_data_loading as cuidl
import logging
import os
import pickle as pkl
def make_image_dataset(run_id, username, title, folder, bs, x_dim=None, splits=None):
"""
Requirements of image data set... | 47.306667 | 138 | 0.683484 |
57a92adf3f1913f1a0989e2c1c86089e618d7607 | 276 | py | Python | setup.py | kulia/x4m300-parser | f37451774daf9d35f225e614c09a26d5b25fce86 | [
"MIT"
] | null | null | null | setup.py | kulia/x4m300-parser | f37451774daf9d35f225e614c09a26d5b25fce86 | [
"MIT"
] | null | null | null | setup.py | kulia/x4m300-parser | f37451774daf9d35f225e614c09a26d5b25fce86 | [
"MIT"
] | 1 | 2022-02-28T02:01:16.000Z | 2022-02-28T02:01:16.000Z | #!/usr/bin/env python
from distutils.core import setup
setup(name='x4m300parser',
version='0.1',
description='Parser fro x4m300',
author='Geir Kulia',
author_email='geir@kulia.no',
url='http://kulia.no',
packages=['x4m300parser'],
)
| 21.230769 | 38 | 0.619565 |
0e26fabd7ecd52d8bd4e7b25c0fc56bc0de024b8 | 2,959 | py | Python | scripts/ccpp_prebuild_config_cam_kessler.py | cacraigucar/ccpp-framework | 82d22110e8be81b0f1e4a0fffcd1b2f5ed2a6981 | [
"Apache-2.0"
] | null | null | null | scripts/ccpp_prebuild_config_cam_kessler.py | cacraigucar/ccpp-framework | 82d22110e8be81b0f1e4a0fffcd1b2f5ed2a6981 | [
"Apache-2.0"
] | 3 | 2018-06-12T17:29:28.000Z | 2018-12-13T16:49:00.000Z | scripts/ccpp_prebuild_config_cam_kessler.py | cacraigucar/ccpp-framework | 82d22110e8be81b0f1e4a0fffcd1b2f5ed2a6981 | [
"Apache-2.0"
] | 2 | 2018-06-11T21:12:57.000Z | 2018-09-05T20:37:44.000Z | #!/usr/bin/env python
# CCPP prebuild config for simple CAM physics
###############################################################################
# Definitions #
###############################################################################
# Add a... | 35.22619 | 84 | 0.657655 |
54550ca7492bb9d377b5d91f814976624db34f31 | 4,266 | py | Python | benchmark/startQiskit_noisy2590.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2590.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2590.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=39
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.967213 | 140 | 0.655649 |
0fedff97d57e5819344c4a3cfcd214370c3e5a3c | 52 | py | Python | highcliff/singleton/__init__.py | sermelo/Highcliff-SDK | 255dd12b3402361cba8b1ea7a28c506f32a11dae | [
"Apache-2.0"
] | null | null | null | highcliff/singleton/__init__.py | sermelo/Highcliff-SDK | 255dd12b3402361cba8b1ea7a28c506f32a11dae | [
"Apache-2.0"
] | null | null | null | highcliff/singleton/__init__.py | sermelo/Highcliff-SDK | 255dd12b3402361cba8b1ea7a28c506f32a11dae | [
"Apache-2.0"
] | null | null | null | from highcliff.singleton.singleton import Singleton
| 26 | 51 | 0.884615 |
3aa96fc309764b834cc9e496484839a6718e165d | 1,855 | py | Python | 3_1_classification.py | RyuTake/PythonStudy | 7726f0cdaed2e65134027540d53ba77dc0ffe4cc | [
"MIT"
] | null | null | null | 3_1_classification.py | RyuTake/PythonStudy | 7726f0cdaed2e65134027540d53ba77dc0ffe4cc | [
"MIT"
] | null | null | null | 3_1_classification.py | RyuTake/PythonStudy | 7726f0cdaed2e65134027540d53ba77dc0ffe4cc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 14:35:29 2018
@author: rtake
"""
import matplotlib.pyplot as plt
from sklearn import datasets
import numpy as np
# digitsデータをロード
digits = datasets.load_digits()
# 画像を2行5列に表示
for label, img in zip(digits.target[:10], digits.images[:10]):
plt.subplot(2,5,label+1) ... | 34.351852 | 99 | 0.669542 |
9b582fd92da5a307d8b54e44b80fc4b8d9427898 | 6,339 | py | Python | data/Imagenet.py | dumpmemory/Transformer-Explainability | 1dd5a47caded2613b74058777bf7758597fa92cf | [
"MIT"
] | 894 | 2020-12-17T21:03:31.000Z | 2022-03-31T11:58:31.000Z | data/Imagenet.py | jeonggunlee/Transformer-Explainability | 951e112d24c1a642ceefeb0dd03a607040305383 | [
"MIT"
] | 33 | 2020-12-18T13:23:57.000Z | 2022-03-31T20:51:45.000Z | data/Imagenet.py | jeonggunlee/Transformer-Explainability | 951e112d24c1a642ceefeb0dd03a607040305383 | [
"MIT"
] | 109 | 2020-12-19T01:39:28.000Z | 2022-03-31T09:52:39.000Z | import os
import torch
import torch.utils.data as data
import numpy as np
import cv2
from torchvision.datasets import ImageNet
from PIL import Image, ImageFilter
import h5py
from glob import glob
class ImageNet_blur(ImageNet):
def __getitem__(self, index):
"""
Args:
index (int): Inde... | 31.226601 | 128 | 0.604354 |
cddc7bf1470b37fefbfdde2847d38ce422742507 | 341 | py | Python | flask_app.py | kjflyback/June-work | 73d865d6c19b1734764250f7cb28d80c93b171b4 | [
"Apache-2.0"
] | null | null | null | flask_app.py | kjflyback/June-work | 73d865d6c19b1734764250f7cb28d80c93b171b4 | [
"Apache-2.0"
] | null | null | null | flask_app.py | kjflyback/June-work | 73d865d6c19b1734764250f7cb28d80c93b171b4 | [
"Apache-2.0"
] | null | null | null | import os
from dailywork import app as application
print application.config
basedir = os.path.abspath('')
application.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, "app.db")
application.config['SQLALCHEMY_MIGRATE_REPO'] = os.path.join(basedir, 'db_repository')
application.debug = True
applic... | 37.888889 | 94 | 0.765396 |
d02982384e8d86d71d25e6d868fd0e9d02dc3174 | 3,237 | py | Python | Chapter_5/dictionary_dt.py | alenasf/AutomateTheBoringStuff | 041e56221eb98d9893c24d22497034e6344c0490 | [
"Apache-2.0"
] | null | null | null | Chapter_5/dictionary_dt.py | alenasf/AutomateTheBoringStuff | 041e56221eb98d9893c24d22497034e6344c0490 | [
"Apache-2.0"
] | null | null | null | Chapter_5/dictionary_dt.py | alenasf/AutomateTheBoringStuff | 041e56221eb98d9893c24d22497034e6344c0490 | [
"Apache-2.0"
] | null | null | null | # The Dictionary Data Type
myCat = {'size':'fat', 'color': 'gray', 'disposition': 'loud'}
myCat['size'] # 'fat'
'My cat has ' + myCat['color'] + ' fur.' # 'My cat has gray fur.'
# Dictionaries vs. List
spam = ['cats', 'dogs', 'moose']
bacon = ['dogs', 'moose', 'cats']
spam == bacon # False
eggs = {'name': 'Zophie', ... | 26.975 | 109 | 0.604263 |
90b656f331385aa19d1cd0a85b67cd1dbba2aee2 | 5,121 | py | Python | multivis/utils/transform.py | brettChapman/cimcb_vis | b373ed426b24ece1dcc20febd7c8023921b024d6 | [
"MIT"
] | 1 | 2021-06-27T23:52:40.000Z | 2021-06-27T23:52:40.000Z | multivis/utils/transform.py | brettChapman/cimcb_vis | b373ed426b24ece1dcc20febd7c8023921b024d6 | [
"MIT"
] | null | null | null | multivis/utils/transform.py | brettChapman/cimcb_vis | b373ed426b24ece1dcc20febd7c8023921b024d6 | [
"MIT"
] | 2 | 2021-06-27T23:53:03.000Z | 2021-07-12T12:59:23.000Z | import sys
from .scaler import scaler
from sklearn.preprocessing import OrdinalEncoder
import numpy as np
def transform(data, transform_type, min, max):
"""Scales and transforms data in forward or reverse order based on different transform options
Parameters
----------
data : A 1D numpy a... | 49.240385 | 261 | 0.635618 |
821386fd1f49bd02fa9e355f18f24affabefe91b | 673 | py | Python | Development/Scripts/loadKfoldHistory.py | simonsimon006/tensorflow-wavelets | 21a095bf0048ae2488ca5ae4961d2cbfe94263a9 | [
"MIT"
] | null | null | null | Development/Scripts/loadKfoldHistory.py | simonsimon006/tensorflow-wavelets | 21a095bf0048ae2488ca5ae4961d2cbfe94263a9 | [
"MIT"
] | 1 | 2021-11-11T14:47:43.000Z | 2021-11-11T14:52:51.000Z | Development/Scripts/loadKfoldHistory.py | simonsimon006/tensorflow-wavelets | 21a095bf0048ae2488ca5ae4961d2cbfe94263a9 | [
"MIT"
] | 1 | 2021-11-11T12:18:21.000Z | 2021-11-11T12:18:21.000Z | import os
import pickle
import matplotlib.pyplot as plt
num_folds = 10
history_file_path = r"../{}_trainHistoryCifar10CNN.txt"
fig, ax = plt.subplots(1, 10)
fig.suptitle('Horizontally stacked subplots')
for fold in range(num_folds):
with open(history_file_path.format(fold+1), 'rb') as pickle_file:
histo... | 21.709677 | 69 | 0.687964 |
540d94c46211862f96476b28508dc347db8f8c5a | 3,066 | py | Python | plenum/test/restart/test_restart_to_same_view_with_killed_primary.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | plenum/test/restart/test_restart_to_same_view_with_killed_primary.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | plenum/test/restart/test_restart_to_same_view_with_killed_primary.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | import pytest
from plenum.test import waits
from plenum.test.helper import sdk_send_random_and_check, waitForViewChange, view_change_timeout
from plenum.test.node_request.helper import sdk_ensure_pool_functional
from plenum.test.restart.helper import restart_nodes
from plenum.test.test_node import ensureElectionsDone,... | 43.183099 | 106 | 0.764514 |
0dd6ff80c6258009a79b870e3af647c3de526a1a | 2,275 | py | Python | fastplm/uer/layers/multi_headed_attn.py | autoliuweijie/FastPLM | fc92a0a5c757b8f3bc7f1af32ade5137d705e031 | [
"MIT"
] | 2 | 2021-12-30T12:03:12.000Z | 2022-01-30T10:38:43.000Z | fastplm/uer/layers/multi_headed_attn.py | autoliuweijie/FastPLM | fc92a0a5c757b8f3bc7f1af32ade5137d705e031 | [
"MIT"
] | null | null | null | fastplm/uer/layers/multi_headed_attn.py | autoliuweijie/FastPLM | fc92a0a5c757b8f3bc7f1af32ade5137d705e031 | [
"MIT"
] | null | null | null | # -*- encoding:utf-8 -*-
import math
import torch
import torch.nn as nn
class MultiHeadedAttention(nn.Module):
"""
Each head is a self-attention operation.
self-attention refers to https://arxiv.org/pdf/1706.03762.pdf
"""
def __init__(self, hidden_size, heads_num, dropout):
super(MultiHeade... | 33.955224 | 85 | 0.555165 |
03827a4e99d05eb918f6fa87f3c2a8aded37683d | 705 | py | Python | tools/distrib/python/grpcio_tools/grpc_version.py | happybits/grpc | 669c52b08aeb8503b27fbbd5457e229c2b97fe68 | [
"Apache-2.0"
] | 4 | 2019-09-10T09:48:57.000Z | 2021-08-04T09:38:06.000Z | tools/distrib/python/grpcio_tools/grpc_version.py | happybits/grpc | 669c52b08aeb8503b27fbbd5457e229c2b97fe68 | [
"Apache-2.0"
] | null | null | null | tools/distrib/python/grpcio_tools/grpc_version.py | happybits/grpc | 669c52b08aeb8503b27fbbd5457e229c2b97fe68 | [
"Apache-2.0"
] | 1 | 2019-09-10T09:48:58.000Z | 2019-09-10T09:48:58.000Z | # Copyright 2015 gRPC 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 writing... | 39.166667 | 106 | 0.763121 |
86b4dc0c37fd64d3825fa089cf4d7bedb4b0d2c3 | 2,458 | py | Python | questions/valid-number/Solution.py | achow113/LeetCode | 604d3f25d513df4045e9a3712a5034704a6043a1 | [
"MIT"
] | 141 | 2017-12-12T21:45:53.000Z | 2022-03-25T07:03:39.000Z | questions/valid-number/Solution.py | mithunonline/leetcode-solutions | 604d3f25d513df4045e9a3712a5034704a6043a1 | [
"MIT"
] | 32 | 2015-10-05T14:09:52.000Z | 2021-05-30T10:28:41.000Z | questions/valid-number/Solution.py | mithunonline/leetcode-solutions | 604d3f25d513df4045e9a3712a5034704a6043a1 | [
"MIT"
] | 56 | 2015-09-30T05:23:28.000Z | 2022-03-08T07:57:11.000Z | """
A valid number can be split up into these components (in order):
A decimal number or an integer.
(Optional) An 'e' or 'E', followed by an integer.
A decimal number can be split up into these components (in order):
(Optional) A sign character (either '+' or '-').
One of the following formats:
At least one digi... | 25.604167 | 261 | 0.517901 |
5abf235492964d7b36389cfe246dd09ba03dbb06 | 1,276 | py | Python | rastervision/data/label_source/object_detection_label_source.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 3 | 2020-07-05T04:04:18.000Z | 2021-02-05T16:19:55.000Z | rastervision/data/label_source/object_detection_label_source.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | null | null | null | rastervision/data/label_source/object_detection_label_source.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 1 | 2020-04-27T15:21:53.000Z | 2020-04-27T15:21:53.000Z | import rastervision as rv
from rastervision.data.label import ObjectDetectionLabels
from rastervision.data.label_source import LabelSource
class ObjectDetectionLabelSource(LabelSource):
def __init__(self, vector_source, crs_transformer, class_map, extent):
"""Constructor.
Args:
vector... | 38.666667 | 88 | 0.67163 |
ecc447d40b146e618440e56c1aca1d467d407615 | 256 | py | Python | onetoone/urls.py | x9sheikh/djangoDataBaseRelationships | b80ec61df2eaa31a34b150f5f185966bd90863be | [
"MIT"
] | null | null | null | onetoone/urls.py | x9sheikh/djangoDataBaseRelationships | b80ec61df2eaa31a34b150f5f185966bd90863be | [
"MIT"
] | null | null | null | onetoone/urls.py | x9sheikh/djangoDataBaseRelationships | b80ec61df2eaa31a34b150f5f185966bd90863be | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.contrib import admin
from django.urls import path,include
from . import views
urlpatterns = [
path('', views.onetoone, name='onetoone'),
path('detail/<int:college_id>/', views.detail, name='detail')
]
| 23.272727 | 65 | 0.722656 |
6c6dc74a4aeb1581f2da45b16d59d6e6a174f869 | 2,343 | py | Python | check-confidences-on-noise.py | erwinvanthiel/ASL | 1b8846919f4bcf7bf65881faf254395cb01f8ae3 | [
"MIT"
] | null | null | null | check-confidences-on-noise.py | erwinvanthiel/ASL | 1b8846919f4bcf7bf65881faf254395cb01f8ae3 | [
"MIT"
] | null | null | null | check-confidences-on-noise.py | erwinvanthiel/ASL | 1b8846919f4bcf7bf65881faf254395cb01f8ae3 | [
"MIT"
] | null | null | null | import os
import torch
from src.helper_functions.helper_functions import parse_args
from src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized
from src.models import create_model
import argparse
import matplotlib
import torchvision.transforms as transforms
from pgd import create_targeted_adversarial_... | 37.190476 | 130 | 0.716603 |
6fff59e5f1fa82d9f2759db55fbe3b307364a4e3 | 2,446 | py | Python | cfa_dns/__init__.py | migurski/DNS-Service | e3e2fa2f50fee5fc843b4067f6c227df42dc37f8 | [
"0BSD"
] | 2 | 2015-04-24T17:22:26.000Z | 2015-07-29T22:02:55.000Z | cfa_dns/__init__.py | migurski/DNS-Service | e3e2fa2f50fee5fc843b4067f6c227df42dc37f8 | [
"0BSD"
] | 2 | 2015-04-27T23:00:08.000Z | 2015-05-06T18:02:47.000Z | cfa_dns/__init__.py | migurski/DNS-Service | e3e2fa2f50fee5fc843b4067f6c227df42dc37f8 | [
"0BSD"
] | 4 | 2015-04-25T00:10:39.000Z | 2021-04-16T10:46:08.000Z | from sys import stderr
from csv import DictReader
from urlparse import urlparse
from os.path import dirname, join, basename
from os import environ
from flask import Blueprint, Flask
from .api import format_csv_row, hash_host_records, check_upstream, push_upstream
URL_REDIRECTS = 'URL', 'URL301'
allowed_types = ('A',... | 33.054054 | 97 | 0.636141 |
b73656bc27abac0df545c84c5b062fbdd33f9f53 | 8,522 | py | Python | whoosh/filedb/structfile.py | archatas/whoosh | 61822f611cc24572416c3e7601862e63af083428 | [
"Apache-2.0"
] | 1 | 2017-06-29T07:11:20.000Z | 2017-06-29T07:11:20.000Z | whoosh/filedb/structfile.py | archatas/whoosh | 61822f611cc24572416c3e7601862e63af083428 | [
"Apache-2.0"
] | null | null | null | whoosh/filedb/structfile.py | archatas/whoosh | 61822f611cc24572416c3e7601862e63af083428 | [
"Apache-2.0"
] | 1 | 2020-11-15T14:23:30.000Z | 2020-11-15T14:23:30.000Z | #===============================================================================
# Copyright 2009 Matt Chaput
#
# 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/li... | 33.159533 | 80 | 0.624971 |
0c5b210dda2ccfb9cee17de7bd792e76b30582d3 | 16,927 | py | Python | vylint/vylint.py | sambacha/vylint | a2c6c3d7ce446f0c18e567aa4bf881f8ee2252ef | [
"Apache-2.0"
] | null | null | null | vylint/vylint.py | sambacha/vylint | a2c6c3d7ce446f0c18e567aa4bf881f8ee2252ef | [
"Apache-2.0"
] | null | null | null | vylint/vylint.py | sambacha/vylint | a2c6c3d7ce446f0c18e567aa4bf881f8ee2252ef | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# 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... | 34.265182 | 89 | 0.564601 |
61fbc326ad9fe727bd6ce85614f24da014ab40d8 | 237 | py | Python | Test2/PlaceHolder.py | leejw51/BumblebeeNet | fd9bedbfaad9bb94bcb4f1dc44eec8125bb9c690 | [
"MIT"
] | null | null | null | Test2/PlaceHolder.py | leejw51/BumblebeeNet | fd9bedbfaad9bb94bcb4f1dc44eec8125bb9c690 | [
"MIT"
] | null | null | null | Test2/PlaceHolder.py | leejw51/BumblebeeNet | fd9bedbfaad9bb94bcb4f1dc44eec8125bb9c690 | [
"MIT"
] | null | null | null | import tensorflow as tf
a = tf.placeholder( tf.int32, [3])
b = tf.constant(2)
x2_op = a * b
session = tf.Session()
r1 = session.run(x2_op , feed_dict={ a:[1,2,3]} )
print(r1)
r2 = session.run(x2_op, feed_dict={a:[10,20,10]} )
print(r2)
| 21.545455 | 50 | 0.649789 |
b62c2fdb6f8463c47d88d96fd78314067273e682 | 20,668 | py | Python | tests/samples_tests/smoke_tests/common/samples_common_test_clas.py | kurylo/openvino | 4da0941cd2e8f9829875e60df73d3cd01f820b9c | [
"Apache-2.0"
] | 5 | 2020-04-20T10:05:50.000Z | 2020-04-22T13:08:07.000Z | tests/samples_tests/smoke_tests/common/samples_common_test_clas.py | kurylo/openvino | 4da0941cd2e8f9829875e60df73d3cd01f820b9c | [
"Apache-2.0"
] | 33 | 2021-09-23T04:14:30.000Z | 2022-01-24T13:21:32.000Z | tests/samples_tests/smoke_tests/common/samples_common_test_clas.py | kurylo/openvino | 4da0941cd2e8f9829875e60df73d3cd01f820b9c | [
"Apache-2.0"
] | 11 | 2021-11-09T00:51:40.000Z | 2021-11-10T12:04:16.000Z | """
Copyright (C) 2018-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 45.028322 | 126 | 0.600397 |
6c4c9855cf8c880afddcef1bce1f99cab6fc8dc4 | 40,074 | py | Python | tensorflow/python/framework/tensor_util.py | yage99/tensorflow | c7fa71b32a3635eb25596ae80d007b41007769c4 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/framework/tensor_util.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 88 | 2020-11-24T08:18:10.000Z | 2022-03-25T20:28:30.000Z | tensorflow/python/framework/tensor_util.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.27814 | 115 | 0.703349 |
c8d1d966e0220885215198b13a6094433d5d4b78 | 3,095 | py | Python | submitit/test_helpers.py | bichkd/submitit | 163725c67b79e2b0899ddd95914167fd82668f52 | [
"MIT"
] | null | null | null | submitit/test_helpers.py | bichkd/submitit | 163725c67b79e2b0899ddd95914167fd82668f52 | [
"MIT"
] | null | null | null | submitit/test_helpers.py | bichkd/submitit | 163725c67b79e2b0899ddd95914167fd82668f52 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import os
import time
from pathlib import Path
import pytest
from . import helpers
from .core import utils
def _three_time(x: int) -> in... | 30.643564 | 86 | 0.674637 |
09cf2bf54073c4486cbbbccc5a288769a6ad1368 | 17,456 | py | Python | fs/osfs.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | fs/osfs.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | fs/osfs.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | """Manage the filesystem provided by your OS.
In essence, an `OSFS` is a thin layer over the `io` and `os` modules
of the Python standard library.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import errno
import io
import itertools
import lo... | 35.264646 | 78 | 0.522113 |
1070d84f0e5849f13d21d4317dbe671c16e317aa | 10,473 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/Curve.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/Curve.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/Curve.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class Curve(GeometryObject, IDisposable):
""" A parametric curve. """
def Clone(self):
"""
Clone(self: Curve) -> Curve
Returns a copy of this curve.
Returns: A copy of this curve.
"""
pass
def ComputeDerivatives(self, parameter, normalized):
"""
C... | 22.522581 | 221 | 0.648047 |
0a057124891471c41a4da9668d67def1ebf87a87 | 30,661 | py | Python | venv/lib/python3.8/site-packages/pandas/tests/frame/methods/test_sort_values.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 3 | 2018-04-24T13:31:51.000Z | 2019-07-09T07:31:43.000Z | venv/lib/python3.8/site-packages/pandas/tests/frame/methods/test_sort_values.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 4 | 2019-12-14T16:32:46.000Z | 2022-02-12T00:32:28.000Z | venv/lib/python3.8/site-packages/pandas/tests/frame/methods/test_sort_values.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 5 | 2018-04-24T13:31:56.000Z | 2021-10-21T05:06:23.000Z | import random
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
NaT,
Timestamp,
date_range,
)
import pandas._testing as tm
class TestDataFrameSortValues:
def test_sort_values(self):
frame = DataFrame(
[[1, 1, 2], [3, 1, 0], ... | 34.723669 | 88 | 0.545449 |
8853317691c94c0987ca651dbb64906659c10ead | 1,808 | py | Python | djangobbs/install/models.py | JuanbingTeam/djangobbs | 2d52d83b80758e153b0604e71fb0cef4e6528275 | [
"Apache-2.0"
] | null | null | null | djangobbs/install/models.py | JuanbingTeam/djangobbs | 2d52d83b80758e153b0604e71fb0cef4e6528275 | [
"Apache-2.0"
] | null | null | null | djangobbs/install/models.py | JuanbingTeam/djangobbs | 2d52d83b80758e153b0604e71fb0cef4e6528275 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.utils.translation import ugettext as _T
from cPickle import loads, dumps
# Create your models here.
class ConfigTree(models.Model):
"""用于保存网站配置... | 31.719298 | 94 | 0.545907 |
af278234817cff8810d67db0fd87391fd1b6685b | 1,125 | py | Python | SchemaCollaboration/core/management/commands/create_default_data_package_status.py | kant/schema-collaboration | 9233141dc14aa3dccf41dbdc17c8d25f55e5c640 | [
"MIT"
] | null | null | null | SchemaCollaboration/core/management/commands/create_default_data_package_status.py | kant/schema-collaboration | 9233141dc14aa3dccf41dbdc17c8d25f55e5c640 | [
"MIT"
] | null | null | null | SchemaCollaboration/core/management/commands/create_default_data_package_status.py | kant/schema-collaboration | 9233141dc14aa3dccf41dbdc17c8d25f55e5c640 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from django.db import IntegrityError
from core.models import DatapackageStatus
class Command(BaseCommand):
help = 'Creates default data package status'
def add_arguments(self, parser):
parser.add_argument('--only-if-no-status', action='store_true')... | 33.088235 | 98 | 0.696 |
2a262b6ff2ca0186f75ba4eb7a319d12b9194415 | 990 | py | Python | custom_components/freehands/entity.py | riveccia/homeassistant_freehands | 66ca8f0f0121a269ca7fa85212eef42c15afbdf3 | [
"MIT"
] | null | null | null | custom_components/freehands/entity.py | riveccia/homeassistant_freehands | 66ca8f0f0121a269ca7fa85212eef42c15afbdf3 | [
"MIT"
] | null | null | null | custom_components/freehands/entity.py | riveccia/homeassistant_freehands | 66ca8f0f0121a269ca7fa85212eef42c15afbdf3 | [
"MIT"
] | null | null | null | """FreehandsEntity class"""
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION
from .const import DOMAIN
from .const import NAME
from .const import VERSION
class FreehandsEntity(CoordinatorEntity):
def __init__(self, coordinator, config_entry):
super()._... | 26.756757 | 70 | 0.627273 |
01245a3a72739f3ec80c033e782c308fa155d0d0 | 290 | py | Python | validadores/deposito.py | mayronceccon/olist-python-labs-project | 217188212158ba2401866e06173d762e346ebeee | [
"MIT"
] | null | null | null | validadores/deposito.py | mayronceccon/olist-python-labs-project | 217188212158ba2401866e06173d762e346ebeee | [
"MIT"
] | null | null | null | validadores/deposito.py | mayronceccon/olist-python-labs-project | 217188212158ba2401866e06173d762e346ebeee | [
"MIT"
] | null | null | null | from validadores.regras.valor import Valor as ValidacaoValor
from validadores.regras.valor_negativo import ValorNegativo as ValidacaoValorNegativo
class Deposito():
def __init__(self, valor=0):
ValidacaoValor(valor).is_valid()
ValidacaoValorNegativo(valor).is_valid()
| 32.222222 | 85 | 0.782759 |
e89d380b5f0f91f9495d566b644621ef685f2d17 | 12,768 | py | Python | youtube-8m-ensemble/inference-combine-tfrecords-video.py | wangheda/youtube-8m | 07e54b387ee027cb58b0c14f5eb7c88cfa516d58 | [
"Apache-2.0"
] | 196 | 2017-06-16T12:06:56.000Z | 2022-02-18T10:50:43.000Z | youtube-8m-ensemble/inference-combine-tfrecords-video.py | wangheda/youtube-8m | 07e54b387ee027cb58b0c14f5eb7c88cfa516d58 | [
"Apache-2.0"
] | 5 | 2017-08-04T02:37:34.000Z | 2018-10-27T18:32:38.000Z | youtube-8m-ensemble/inference-combine-tfrecords-video.py | wangheda/youtube-8m | 07e54b387ee027cb58b0c14f5eb7c88cfa516d58 | [
"Apache-2.0"
] | 71 | 2017-06-20T15:04:13.000Z | 2021-10-06T16:43:32.000Z | # Copyright 2016 Google 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 by applicable law or ... | 41.589577 | 181 | 0.703869 |
857e6a644427075b538b72919788fb1210aa4180 | 6,091 | py | Python | tutorial/mnist.py | NumesSanguis/MLTensor | bd5b467f0567254843fd9f7729b65decaa672fed | [
"Apache-2.0"
] | 1 | 2015-12-18T02:25:20.000Z | 2015-12-18T02:25:20.000Z | tutorial/mnist.py | NumesSanguis/MLTensor | bd5b467f0567254843fd9f7729b65decaa672fed | [
"Apache-2.0"
] | null | null | null | tutorial/mnist.py | NumesSanguis/MLTensor | bd5b467f0567254843fd9f7729b65decaa672fed | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google 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 by applicable law or a... | 41.719178 | 80 | 0.692497 |
bf09120ad44c0f7f7c4343e8f93baa8718ab7fc2 | 12,432 | py | Python | python/federatedml/model_selection/k_fold.py | hust-suwb/FATE | 05395603994150c1fd2b2645d3f6df1965382e79 | [
"Apache-2.0"
] | 3,787 | 2019-08-30T04:55:10.000Z | 2022-03-31T23:30:07.000Z | fate/confs-10000/shared_dir/federatedml/model_selection/k_fold.py | Huangxy-Minel/flare | 3c091567bfaedfdf0f0d41b00f3e3d501d572515 | [
"Apache-2.0"
] | 1,439 | 2019-08-29T16:35:52.000Z | 2022-03-31T11:55:31.000Z | fate/confs-10000/shared_dir/federatedml/model_selection/k_fold.py | Huangxy-Minel/flare | 3c091567bfaedfdf0f0d41b00f3e3d501d572515 | [
"Apache-2.0"
] | 1,179 | 2019-08-29T16:18:32.000Z | 2022-03-31T12:55:38.000Z | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 45.372263 | 170 | 0.628218 |
66618bddb5c74af6764f62e6c02559ad2b18829f | 361 | py | Python | zaius/reports/__init__.py | idio/python-zaius-export | 839c2b929d14e9f262d3e1a5b7ca85b7ebf8fcfc | [
"MIT"
] | 3 | 2020-04-24T15:51:39.000Z | 2022-02-15T06:57:07.000Z | zaius/reports/__init__.py | idio/python-zaius-export | 839c2b929d14e9f262d3e1a5b7ca85b7ebf8fcfc | [
"MIT"
] | 2 | 2020-05-06T15:56:09.000Z | 2021-08-11T05:19:12.000Z | zaius/reports/__init__.py | idio/python-zaius-export | 839c2b929d14e9f262d3e1a5b7ca85b7ebf8fcfc | [
"MIT"
] | 4 | 2020-06-17T15:53:36.000Z | 2022-01-05T12:09:14.000Z | # -*- coding: utf-8 -*-
"""Pre-baked reports
Set of reports that can be called from code or executed using
the zaius-export command line utility.
Example:
zaius-export demo
"""
from .spec import ReportSpec
from . import demo
from . import product_attribution
from . import lifecycle_progress
from . import... | 20.055556 | 61 | 0.739612 |
035694a4800aa77af33e58a5cab080189b432140 | 2,942 | py | Python | examples/dataflow-data-generator/data-generator-pipeline/tests/test_fix_record_for_avro.py | mrhungr-github/professional-services | 3163204b24815741e0d4cb6482ae9c4b0b2c2f3c | [
"Apache-2.0"
] | null | null | null | examples/dataflow-data-generator/data-generator-pipeline/tests/test_fix_record_for_avro.py | mrhungr-github/professional-services | 3163204b24815741e0d4cb6482ae9c4b0b2c2f3c | [
"Apache-2.0"
] | null | null | null | examples/dataflow-data-generator/data-generator-pipeline/tests/test_fix_record_for_avro.py | mrhungr-github/professional-services | 3163204b24815741e0d4cb6482ae9c4b0b2c2f3c | [
"Apache-2.0"
] | 1 | 2019-04-19T03:16:20.000Z | 2019-04-19T03:16:20.000Z | # Copyright 2018 Google 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 law or agreed to in wr... | 38.207792 | 82 | 0.546227 |
7f88630b271075ceb79990a1674d7244f51f0858 | 7,826 | py | Python | examples/dmri_group_connectivity_mrtrix.py | sebastientourbier/nipype_lts5 | 3b9718d154443574cc6a5d0bbd76ccf7964e6a45 | [
"BSD-3-Clause"
] | 1 | 2018-09-09T14:47:04.000Z | 2018-09-09T14:47:04.000Z | examples/dmri_group_connectivity_mrtrix.py | MarcCote/nipype | b4014e1d87509f35242f0547f51d2b8962f83cbe | [
"BSD-3-Clause"
] | null | null | null | examples/dmri_group_connectivity_mrtrix.py | MarcCote/nipype | b4014e1d87509f35242f0547f51d2b8962f83cbe | [
"BSD-3-Clause"
] | 1 | 2020-02-19T13:47:05.000Z | 2020-02-19T13:47:05.000Z | """
==================================================
dMRI: Group connectivity - MRtrix, FSL, FreeSurfer
==================================================
Introduction
============
This script, dmri_group_connectivity_mrtrix.py, runs group-based connectivity analysis using
the dmri.mrtrix.connectivity_mapping Nipyp... | 41.850267 | 202 | 0.753131 |
94c686b8061e3bf0f15751e83dfbbf3eac6ae9db | 2,101 | py | Python | tests/test_mock_serial.py | jamesleesaunders/pi-alertme | f8e8ea69ebe353e4aadcc54d89bb4fe1f5b473e5 | [
"MIT"
] | 16 | 2017-04-29T22:20:46.000Z | 2020-07-30T00:33:33.000Z | tests/test_mock_serial.py | jamesleesaunders/pi-alertme | f8e8ea69ebe353e4aadcc54d89bb4fe1f5b473e5 | [
"MIT"
] | 36 | 2017-03-11T07:00:37.000Z | 2018-01-04T08:28:50.000Z | tests/test_mock_serial.py | jamesleesaunders/pyalertme | f8e8ea69ebe353e4aadcc54d89bb4fe1f5b473e5 | [
"MIT"
] | 4 | 2017-10-20T20:49:34.000Z | 2018-11-05T09:57:39.000Z | #! /usr/bin/python
"""
test_mock_serial.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
Tests fake device objects for proper functionality.
"""
import unittest
from mock_serial import Serial
class TestFakeSerialRead(unittest.TestCase):
"""
Fake Serial class should work as intended to emulate re... | 28.780822 | 85 | 0.559257 |
ebdc9181686683e0f9489b2ac626712accfbe0db | 4,580 | py | Python | tensorflow/contrib/cmake/tools/create_def_file.py | AlexxNica/tensorflow | f8dce81aeaff40dc78d398741854ad8766806f91 | [
"Apache-2.0"
] | 1 | 2021-04-20T11:37:41.000Z | 2021-04-20T11:37:41.000Z | tensorflow/contrib/cmake/tools/create_def_file.py | AIroot/tensorflow | 6fecffd7eca64100ce14969a2c3366b89b7cecc2 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/cmake/tools/create_def_file.py | AIroot/tensorflow | 6fecffd7eca64100ce14969a2c3366b89b7cecc2 | [
"Apache-2.0"
] | 1 | 2019-03-16T05:48:07.000Z | 2019-03-16T05:48:07.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.188406 | 80 | 0.680786 |
26dab2dff557058b14411e43a8e48bfad178e601 | 3,382 | py | Python | social_core/exceptions.py | candlerb/social-core | 36f25c4218f17c1c74fbb22881716d3c4bdbd379 | [
"BSD-3-Clause"
] | null | null | null | social_core/exceptions.py | candlerb/social-core | 36f25c4218f17c1c74fbb22881716d3c4bdbd379 | [
"BSD-3-Clause"
] | null | null | null | social_core/exceptions.py | candlerb/social-core | 36f25c4218f17c1c74fbb22881716d3c4bdbd379 | [
"BSD-3-Clause"
] | null | null | null | class SocialAuthBaseException(ValueError):
"""Base class for pipeline exceptions."""
pass
class WrongBackend(SocialAuthBaseException):
def __init__(self, backend_name):
self.backend_name = backend_name
def __str__(self):
return 'Incorrect authentication service "{}"'.format(
... | 28.420168 | 75 | 0.674157 |
44b93f4703e08cba337d6d46d0f3d99fee5cc7e3 | 3,856 | py | Python | grade-display/assemble.py | chrononyan/cs61a-apps | e44b5cf4b305bd5aed7bdd60c3b3b826abcf5a4a | [
"MIT"
] | null | null | null | grade-display/assemble.py | chrononyan/cs61a-apps | e44b5cf4b305bd5aed7bdd60c3b3b826abcf5a4a | [
"MIT"
] | null | null | null | grade-display/assemble.py | chrononyan/cs61a-apps | e44b5cf4b305bd5aed7bdd60c3b3b826abcf5a4a | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import requests
from common.rpc.howamidoing import upload_grades
from common.rpc.auth import read_spreadsheet
ROSTER = "data/roster.csv"
GRADES = "data/okpy_grades.csv"
MT1 = "data/mt1.csv" # midterm scores from Gradescope
MT2 = "data/mt2.csv" # midterm scores from G... | 31.606557 | 88 | 0.600104 |
3fbe2c665a2586a1d5ff1d7238473e9f5db2410c | 4,092 | py | Python | src/tests/worker/run_thread_testing.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | 1 | 2019-06-17T17:01:17.000Z | 2019-06-17T17:01:17.000Z | src/tests/worker/run_thread_testing.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | 7 | 2021-02-08T20:46:15.000Z | 2021-09-08T02:12:59.000Z | src/tests/worker/run_thread_testing.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import threading
from worker.task_status import TaskStatus
from worker.worker_status import WorkerStatus
class RunThread(threading.Thread):
"""The thread executing the template method. Same as run_thread, but with additional asserts for testing"""
def ... | 38.971429 | 111 | 0.632454 |
e672253009bc3ceaf93d402c9d0c10d43153f688 | 18,379 | py | Python | django/db/backends/creation.py | leereilly/django-1 | fe43ad5707d116bb1729bc17a24ca16c90ae040d | [
"BSD-3-Clause"
] | 1 | 2015-11-11T12:20:45.000Z | 2015-11-11T12:20:45.000Z | django/db/backends/creation.py | leereilly/django-1 | fe43ad5707d116bb1729bc17a24ca16c90ae040d | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/creation.py | leereilly/django-1 | fe43ad5707d116bb1729bc17a24ca16c90ae040d | [
"BSD-3-Clause"
] | null | null | null | import sys
import time
from django.conf import settings
from django.db.utils import load_backend
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific differences... | 41.961187 | 84 | 0.585124 |
b77adf6325f5d476ad202f1dc4c4a0cc9386f33a | 199 | py | Python | testing/unit_alignment/problem.py | pj0620/acca-video-series | 1b09548014cc899ded5a8fdd1293f7fc121a98bc | [
"MIT"
] | null | null | null | testing/unit_alignment/problem.py | pj0620/acca-video-series | 1b09548014cc899ded5a8fdd1293f7fc121a98bc | [
"MIT"
] | 3 | 2020-04-16T09:24:48.000Z | 2021-03-27T19:27:48.000Z | testing/unit_alignment/problem.py | pj0620/acca-video-series | 1b09548014cc899ded5a8fdd1293f7fc121a98bc | [
"MIT"
] | 1 | 2020-09-01T05:32:04.000Z | 2020-09-01T05:32:04.000Z | from manimlib.imports import *
class Problem(Scene):
def construct(self):
num = DecimalNumber(
12,
unit="Amps"
)
self.add(num)
self.wait() | 19.9 | 30 | 0.512563 |
b812893e9a01a9ad9423596483c7b233b5e9f770 | 11,432 | py | Python | Pysegreg/segregationMetrics.py | sandrofsousa/Resolution | 70262f08a582850b78fb50f30e23b5f4405d3736 | [
"MIT"
] | null | null | null | Pysegreg/segregationMetrics.py | sandrofsousa/Resolution | 70262f08a582850b78fb50f30e23b5f4405d3736 | [
"MIT"
] | null | null | null | Pysegreg/segregationMetrics.py | sandrofsousa/Resolution | 70262f08a582850b78fb50f30e23b5f4405d3736 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.spatial.distance import cdist
class Segreg(object):
def __init__(self):
self.attributeMatrix = np.matrix([]) # attributes matrix full size - all columns
self.location = [] # x and y coordinates from tract centroid (2D lists)
self.pop = ... | 43.969231 | 120 | 0.598933 |
27ade3a648060d6c9b3e714aa52b27adf78da99b | 10,757 | py | Python | advanced_circuits_algorithms/QPE/utils_qpe.py | wkcwells/amazon-braket-examples | 19a11641d77951e6619d7941cd2488242b18e937 | [
"Apache-2.0"
] | null | null | null | advanced_circuits_algorithms/QPE/utils_qpe.py | wkcwells/amazon-braket-examples | 19a11641d77951e6619d7941cd2488242b18e937 | [
"Apache-2.0"
] | null | null | null | advanced_circuits_algorithms/QPE/utils_qpe.py | wkcwells/amazon-braket-examples | 19a11641d77951e6619d7941cd2488242b18e937 | [
"Apache-2.0"
] | null | null | null | # general imports
import numpy as np
import math
from collections import Counter
from datetime import datetime
import pickle
# AWS imports: Import Braket SDK modules
from braket.circuits import Circuit, circuit
# local imports
from utils_qft import inverse_qft
@circuit.subroutine(register=True)
def controlled_unita... | 36.097315 | 115 | 0.699823 |
803ee16c8fca1d8f736dbf9e3fb9ae10560b016c | 21,865 | py | Python | scripts/generate_fixtures.py | oss-spanish-geoserver/observatory-extension | 6a063ca0eb33043f22e47171fc328aa50a6efc39 | [
"BSD-3-Clause"
] | 6 | 2017-11-08T23:23:07.000Z | 2021-03-05T05:39:23.000Z | scripts/generate_fixtures.py | oss-spanish-geoserver/observatory-extension | 6a063ca0eb33043f22e47171fc328aa50a6efc39 | [
"BSD-3-Clause"
] | 178 | 2016-04-08T19:48:37.000Z | 2020-02-13T14:22:42.000Z | scripts/generate_fixtures.py | oss-spanish-geoserver/observatory-extension | 6a063ca0eb33043f22e47171fc328aa50a6efc39 | [
"BSD-3-Clause"
] | 4 | 2016-05-16T14:47:33.000Z | 2020-08-30T21:39:22.000Z | import os
import psycopg2
import subprocess
PGUSER = os.environ.get('PGUSER', 'postgres')
PGPASSWORD = os.environ.get('PGPASSWORD', '')
PGHOST=os.environ.get('PGHOST', 'localhost')
PGPORT=os.environ.get('PGPORT', '5432')
PGDATABASE=os.environ.get('PGDATABASE', 'postgres')
DB_CONN = psycopg2.connect('postgres://{user}... | 56.792208 | 102 | 0.618248 |
ae47071fd9aeb5211b403be8f2544af1ffc527f6 | 361 | py | Python | examples/servertls_clientauth.py | aheck/reflectrpc | 9602d3b3f06d3d8ee8549788301e43b172a597f6 | [
"MIT"
] | 33 | 2016-06-12T15:25:07.000Z | 2021-11-16T18:53:16.000Z | examples/servertls_clientauth.py | aheck/reflectrpc | 9602d3b3f06d3d8ee8549788301e43b172a597f6 | [
"MIT"
] | null | null | null | examples/servertls_clientauth.py | aheck/reflectrpc | 9602d3b3f06d3d8ee8549788301e43b172a597f6 | [
"MIT"
] | 3 | 2016-10-10T20:50:41.000Z | 2021-05-01T23:51:34.000Z | #!/usr/bin/env python3
import sys
sys.path.append('..')
import reflectrpc
import reflectrpc.twistedserver
import rpcexample
jsonrpc = rpcexample.build_example_rpcservice()
server = reflectrpc.twistedserver.TwistedJsonRpcServer(jsonrpc, 'localhost', 5500)
server.enable_tls('./certs/server.pem')
server.enable_client... | 21.235294 | 82 | 0.792244 |
c498a8aafd679743c368285073716217ee2b6e2f | 13,728 | py | Python | examples/trials/cifar10_grad_match/cords/selectionstrategies/supervisedlearning/craigstrategy.py | savan77/nni | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | [
"MIT"
] | null | null | null | examples/trials/cifar10_grad_match/cords/selectionstrategies/supervisedlearning/craigstrategy.py | savan77/nni | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | [
"MIT"
] | null | null | null | examples/trials/cifar10_grad_match/cords/selectionstrategies/supervisedlearning/craigstrategy.py | savan77/nni | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | [
"MIT"
] | null | null | null | import apricot
import numpy as np
import torch
import torch.nn.functional as F
from scipy.sparse import csr_matrix
from .dataselectionstrategy import DataSelectionStrategy
from torch.utils.data.sampler import SubsetRandomSampler
import math
class CRAIGStrategy(DataSelectionStrategy):
"""
Implementation of CRA... | 43.305994 | 215 | 0.5566 |
ff2e09b16dda166327615c7f9daa693f62d7e713 | 436 | py | Python | examples/rosetta/xyz.py | bennn/PyonR | 16edd14f3950fd5a01f8b0237e023536ef48d17b | [
"MIT"
] | 132 | 2015-01-03T23:22:29.000Z | 2021-11-29T22:17:32.000Z | examples/rosetta/xyz.py | bennn/PyonR | 16edd14f3950fd5a01f8b0237e023536ef48d17b | [
"MIT"
] | 7 | 2015-06-29T18:51:10.000Z | 2019-06-07T13:10:18.000Z | examples/rosetta/xyz.py | bennn/PyonR | 16edd14f3950fd5a01f8b0237e023536ef48d17b | [
"MIT"
] | 15 | 2015-07-14T02:40:21.000Z | 2021-03-10T11:26:31.000Z | #lang python
from '(planet aml/rosetta)' import *
import predicates
class XYZ(object):
x = property(cx)
y = property(cy)
z = property(cz)
rho = property(cyl_rho)
phi = property(cyl_phi)
__add__ = PLUS_c
def __repr__(self):
return "<" + str(cx(self)) + ", " \
... | 19.818182 | 45 | 0.541284 |
8a951559c37e6368051149e0d287f06588d57a6f | 2,590 | py | Python | proxstar/starrs.py | ajnagashima/proxstar | 35c7e95dc95607455c41f0c2b152a8af59c14ef1 | [
"MIT"
] | null | null | null | proxstar/starrs.py | ajnagashima/proxstar | 35c7e95dc95607455c41f0c2b152a8af59c14ef1 | [
"MIT"
] | null | null | null | proxstar/starrs.py | ajnagashima/proxstar | 35c7e95dc95607455c41f0c2b152a8af59c14ef1 | [
"MIT"
] | null | null | null | import psycopg2
def get_next_ip(starrs, range_name):
c = starrs.cursor()
try:
c.execute("BEGIN")
c.callproc("api.initialize", ('root', ))
c.callproc("api.get_address_from_range", (range_name, ))
results = c.fetchall()
c.execute("COMMIT")
finally:
c.close()
... | 26.428571 | 77 | 0.557529 |
4145747d9dd773cf73f2d9dc19ec87c389dd9059 | 29,358 | py | Python | theano/sandbox/cuda/__init__.py | julianser/Theano | 56da8ca8775ce610595a61c3984c160aabd6ec7b | [
"BSD-3-Clause"
] | 4 | 2017-09-10T00:54:17.000Z | 2019-10-22T23:28:09.000Z | theano/sandbox/cuda/__init__.py | julianser/Theano | 56da8ca8775ce610595a61c3984c160aabd6ec7b | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/cuda/__init__.py | julianser/Theano | 56da8ca8775ce610595a61c3984c160aabd6ec7b | [
"BSD-3-Clause"
] | 2 | 2019-08-12T13:45:09.000Z | 2020-08-14T10:13:50.000Z | from __future__ import absolute_import, print_function, division
import atexit
import errno
import logging
import os
import shutil
import stat
import sys
import textwrap
import warnings
import theano
from theano.compat import get_unbound_function
from theano.compile import optdb
from theano.gof import EquilibriumDB, S... | 39.406711 | 115 | 0.591423 |
c723d2ead137ebd366dd498a9332385e75699d74 | 2,490 | py | Python | aiovault/cli.py | johnnoone/aiovault | 03e1bfb6f0404dcf97ce87a98c539027c4e78a37 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T22:37:57.000Z | 2022-01-31T22:37:57.000Z | aiovault/cli.py | johnnoone/aiovault | 03e1bfb6f0404dcf97ce87a98c539027c4e78a37 | [
"BSD-3-Clause"
] | null | null | null | aiovault/cli.py | johnnoone/aiovault | 03e1bfb6f0404dcf97ce87a98c539027c4e78a37 | [
"BSD-3-Clause"
] | null | null | null | import os
import os.path
import re
from collections import namedtuple
from subprocess import Popen, PIPE
PATTERN_KEYS = re.compile('Key \d+: (?P<key>[a-f0-9]+)') # noqa
PATTERN_ROOT = re.compile('Initial Root Token: (?P<token>[a-f0-9-]+)') # noqa
PATTERN_CRITERIAS = re.compile('Vault initialized with (?P<shares>\d+... | 33.648649 | 127 | 0.603614 |
7c668b8b1ecfdacef66a59dd86e127a75b854386 | 20,371 | py | Python | avalanche/evaluation/metrics/forgetting_bwt.py | wutong8023/avalanche | 6fb13545998b9a8c08ad291efd1d1769ec4a5ae8 | [
"MIT"
] | null | null | null | avalanche/evaluation/metrics/forgetting_bwt.py | wutong8023/avalanche | 6fb13545998b9a8c08ad291efd1d1769ec4a5ae8 | [
"MIT"
] | null | null | null | avalanche/evaluation/metrics/forgetting_bwt.py | wutong8023/avalanche | 6fb13545998b9a8c08ad291efd1d1769ec4a5ae8 | [
"MIT"
] | null | null | null | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | 32.909532 | 80 | 0.63129 |
ab367ad170ab2d23eca56a11b6b21b3d535e9387 | 581 | py | Python | beautiful_turtle_pattern.py | Prannov/Python-Projects | dc96756d1a6c2661958c9310e88c3cdaba044d38 | [
"Unlicense"
] | 1 | 2021-10-01T15:50:15.000Z | 2021-10-01T15:50:15.000Z | beautiful_turtle_pattern.py | Prannov/Python-Projects | dc96756d1a6c2661958c9310e88c3cdaba044d38 | [
"Unlicense"
] | 4 | 2021-10-01T14:33:02.000Z | 2021-11-04T11:50:54.000Z | beautiful_turtle_pattern.py | Prannov/Python-Projects | dc96756d1a6c2661958c9310e88c3cdaba044d38 | [
"Unlicense"
] | 14 | 2021-10-01T14:10:02.000Z | 2021-10-29T19:01:20.000Z | import turtle
pen = turtle.Turtle()
# initial length of the square-like shapes
size = 50
# Changing shape of the turtle
pen.shape("turtle")
# Changing Background color
turtle.bgcolor("blue")
# Changing color of the pen
pen.color("yellow")
# Increasing speed of the pen
pen.speed(100)
# Running a loop with 300 iter... | 19.366667 | 46 | 0.690189 |
2e36eeea955543e4b53b2b1bffb68d632754901d | 75 | py | Python | allennlp_models/generation/predictors/__init__.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 402 | 2020-03-11T22:58:35.000Z | 2022-03-29T09:05:27.000Z | allennlp_models/generation/predictors/__init__.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 116 | 2020-03-11T01:26:57.000Z | 2022-03-25T13:03:56.000Z | allennlp_models/generation/predictors/__init__.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 140 | 2020-03-11T00:51:35.000Z | 2022-03-29T09:05:36.000Z | from allennlp_models.generation.predictors.seq2seq import Seq2SeqPredictor
| 37.5 | 74 | 0.906667 |
26a46bdb61d468c5f5dc5a59154afd5bcdd294c6 | 1,672 | py | Python | tests/cli/commands/test_triggerer_command.py | arezamoosavi/airflow | c3c81c3144386d1de535c1c5e777270e727bb69e | [
"Apache-2.0"
] | 2 | 2016-08-23T14:22:15.000Z | 2017-09-28T19:45:26.000Z | tests/cli/commands/test_triggerer_command.py | arezamoosavi/airflow | c3c81c3144386d1de535c1c5e777270e727bb69e | [
"Apache-2.0"
] | 2 | 2019-02-16T19:00:53.000Z | 2019-05-09T23:29:14.000Z | tests/cli/commands/test_triggerer_command.py | arezamoosavi/airflow | c3c81c3144386d1de535c1c5e777270e727bb69e | [
"Apache-2.0"
] | 6 | 2018-04-09T07:46:05.000Z | 2019-07-16T00:13:15.000Z | #
# 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... | 35.574468 | 92 | 0.746411 |
f7a486df643e22eeeb30144f329cc25e01ddddea | 1,742 | py | Python | spark_auto_mapper_fhir/value_sets/consent_scope_codes.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/value_sets/consent_scope_codes.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/consent_scope_codes.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 34.84 | 84 | 0.751435 |
f7e82198f73eb6eea760faf5549e386be4a06f75 | 576 | py | Python | app/modules/categories/categories_views.py | gurgy11/caffeinated | 278d09a88162d12409f0af445797b9790a319528 | [
"MIT"
] | 1 | 2022-02-14T01:02:15.000Z | 2022-02-14T01:02:15.000Z | app/modules/categories/categories_views.py | gurgy11/caffeinated | 278d09a88162d12409f0af445797b9790a319528 | [
"MIT"
] | null | null | null | app/modules/categories/categories_views.py | gurgy11/caffeinated | 278d09a88162d12409f0af445797b9790a319528 | [
"MIT"
] | null | null | null | from flask import Blueprint, redirect, render_template, url_for, session, jsonify, request
from app.lib.authentication import login_required
bp = Blueprint('categories', __name__, url_prefix='/categories')
@bp.route('/')
@bp.route('/index')
@login_required
def index():
return render_template('categories/index.h... | 26.181818 | 90 | 0.717014 |
41165ea7e4c7044b352c1b78a1a2b01c54095e31 | 11,705 | py | Python | autotest/pyscripts/test_ogrinfo_py.py | kammerer/gdal | a981e817543921ddc262f0ea2c137b52dea1e3f2 | [
"MIT"
] | 1 | 2018-12-19T14:08:20.000Z | 2018-12-19T14:08:20.000Z | autotest/pyscripts/test_ogrinfo_py.py | kammerer/gdal | a981e817543921ddc262f0ea2c137b52dea1e3f2 | [
"MIT"
] | null | null | null | autotest/pyscripts/test_ogrinfo_py.py | kammerer/gdal | a981e817543921ddc262f0ea2c137b52dea1e3f2 | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: ogrinfo.py testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
##############################################################################... | 34.83631 | 145 | 0.608543 |
8c1ce8d8b2763651a1c0026262ae06e369c9195d | 3,534 | py | Python | nadlogar/config/settings.py | LenartBucar/nadlogar | 2aba693254d56896419d09e066f91551492f8980 | [
"MIT"
] | null | null | null | nadlogar/config/settings.py | LenartBucar/nadlogar | 2aba693254d56896419d09e066f91551492f8980 | [
"MIT"
] | null | null | null | nadlogar/config/settings.py | LenartBucar/nadlogar | 2aba693254d56896419d09e066f91551492f8980 | [
"MIT"
] | null | null | null | """
Django settings for nadlogar project.
Generated by 'django-admin startproject' using Django 3.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... | 25.42446 | 91 | 0.693548 |
64f3629116fbfe18c3d77532326c2d303acfd114 | 10,061 | py | Python | tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py | Bhaney44/agents | e5fd5b19ba86fbc5980c9f8e173ce959f8b7bb45 | [
"Apache-2.0"
] | 2 | 2021-02-16T14:20:53.000Z | 2021-02-16T16:38:03.000Z | tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py | Bhaney44/agents | e5fd5b19ba86fbc5980c9f8e173ce959f8b7bb45 | [
"Apache-2.0"
] | null | null | null | tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py | Bhaney44/agents | e5fd5b19ba86fbc5980c9f8e173ce959f8b7bb45 | [
"Apache-2.0"
] | 1 | 2020-08-18T13:32:15.000Z | 2020-08-18T13:32:15.000Z | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 40.732794 | 80 | 0.710069 |
8b59574254957a44bb8f953cae6d260eed99c47b | 3,868 | py | Python | src/tasks/scrape_reddit/task.py | xhonino/Youtube-automatic-reddit | 8490b8cb517fd2421a92dc58471e1339aa6ac4fc | [
"MIT"
] | null | null | null | src/tasks/scrape_reddit/task.py | xhonino/Youtube-automatic-reddit | 8490b8cb517fd2421a92dc58471e1339aa6ac4fc | [
"MIT"
] | null | null | null | src/tasks/scrape_reddit/task.py | xhonino/Youtube-automatic-reddit | 8490b8cb517fd2421a92dc58471e1339aa6ac4fc | [
"MIT"
] | null | null | null | import praw
import os
from time import sleep
from praw.models import MoreComments
from src.tasks.scrape_reddit.post import Post, Comment
from src.tasks.scrape_reddit.profanity_filter import filter
client_id = "iosCZqE9n_yFQw"
client_secret = "Eu_vqISa7HWnPpWQmh6xcsDx36w"
reddit = praw.Reddit(client_id=client_id, clie... | 36.490566 | 114 | 0.613754 |
b282f718de53acee0cb5f2a8bd6396f832a4fb37 | 22,565 | py | Python | compose/project.py | VisionSystemsInc/nvidia-docker-plugin-compose | 2de246a4648d0905f6f120efcc792dc45b2639c5 | [
"Apache-2.0"
] | null | null | null | compose/project.py | VisionSystemsInc/nvidia-docker-plugin-compose | 2de246a4648d0905f6f120efcc792dc45b2639c5 | [
"Apache-2.0"
] | null | null | null | compose/project.py | VisionSystemsInc/nvidia-docker-plugin-compose | 2de246a4648d0905f6f120efcc792dc45b2639c5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import logging
import operator
from functools import reduce
import enum
from docker.errors import APIError
from . import parallel
from .config import ConfigurationError
from .config.config import V1
from .config.sort_servi... | 35.202808 | 101 | 0.602792 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.