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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f638a47fc261ba269cd6aeaf1215f099134f09d | 22,742 | py | Python | app/models.py | nonemaw/YeTi | 92a3ba89f5b7fd8b2d5d3f5929ade0bf0b9e5cbe | [
"MIT"
] | 1 | 2017-10-04T12:21:20.000Z | 2017-10-04T12:21:20.000Z | app/models.py | nonemaw/YeTi | 92a3ba89f5b7fd8b2d5d3f5929ade0bf0b9e5cbe | [
"MIT"
] | null | null | null | app/models.py | nonemaw/YeTi | 92a3ba89f5b7fd8b2d5d3f5929ade0bf0b9e5cbe | [
"MIT"
] | null | null | null | import hashlib
from datetime import datetime
from werkzeug.security import generate_password_hash
from flask import current_app, request
from flask_login import UserMixin, AnonymousUserMixin, current_user
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from bson import ObjectId
from app import l... | 32.442225 | 110 | 0.538035 |
7e97164ad37af5d6a4a756996a2d164d752b44d4 | 437 | py | Python | dojo/rules/urls.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,772 | 2018-01-22T23:32:15.000Z | 2022-03-31T14:49:33.000Z | dojo/rules/urls.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 3,461 | 2018-01-20T19:12:28.000Z | 2022-03-31T17:14:39.000Z | dojo/rules/urls.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,173 | 2018-01-23T07:10:23.000Z | 2022-03-31T14:40:43.000Z | from django.conf.urls import url
from dojo.rules import views
urlpatterns = [
url(r'^rules', views.rules, name='rules'),
url(r'^rule/add', views.new_rule, name='Add Rule'),
url(r'^rule/(?P<pid>\d+)/edit$', views.edit_rule,
name='Edit Rule'),
url(r'^rule/(?P<pid>\d+)/add_child', views.add_child,... | 33.615385 | 57 | 0.606407 |
47dbe9513a9ab5d26c191ec7f2cb0c7972c78426 | 92 | py | Python | _2019/src/day_2/__init__.py | JHowell45/advent-of-code | c7bdd3881573f259af2cb826d0c77bbef0b3417e | [
"MIT"
] | null | null | null | _2019/src/day_2/__init__.py | JHowell45/advent-of-code | c7bdd3881573f259af2cb826d0c77bbef0b3417e | [
"MIT"
] | null | null | null | _2019/src/day_2/__init__.py | JHowell45/advent-of-code | c7bdd3881573f259af2cb826d0c77bbef0b3417e | [
"MIT"
] | null | null | null | from .puzzle_1 import day_2_puzzle_1_solution
from .puzzle_2 import day_2_puzzle_2_solution
| 30.666667 | 45 | 0.891304 |
6b5a99cbdcbd9e85cc95d39a8dcb8506132d69d6 | 1,713 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoEGSES_template.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoEGSES_template.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoEGSES_template.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class FCoE_GSES(Base):
__slots__ = ()
_SDM_NAME = 'fCoEGSES'
_SDM_ATT_MAP = {
'FCoE Header': 'fCoEGSES.header.fcoeHeader',
'FC Header': 'fCoEGSES.header.fcHeader',
'FC_CT': 'fCoEGSES.header.fcCT',
... | 32.942308 | 86 | 0.68885 |
0e2e20279ce963054de869e54b4b76e2f73abf4b | 1,578 | py | Python | wlts/config.py | fabianazioti/wlts | e534b3af5e42e715d027af446db79bba6662af5a | [
"MIT"
] | 1 | 2020-02-25T20:02:02.000Z | 2020-02-25T20:02:02.000Z | wlts/config.py | fabianazioti/wlts | e534b3af5e42e715d027af446db79bba6662af5a | [
"MIT"
] | 33 | 2019-12-24T12:58:38.000Z | 2022-03-18T18:03:41.000Z | wlts/config.py | fabianazioti/wlts | e534b3af5e42e715d027af446db79bba6662af5a | [
"MIT"
] | 4 | 2019-10-01T13:16:43.000Z | 2021-02-12T18:10:04.000Z | #
# This file is part of Web Land Trajectory Service.
# Copyright (C) 2019-2020 INPE.
#
# Web Land Trajectory Service is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Brazil Data Cube Configuration."""
import os
from packaging impo... | 23.205882 | 88 | 0.71673 |
96110a00c1b1b99aaa0f0352608a5eec1442b397 | 1,422 | py | Python | payments/migrations/0029_posteroption.py | jakereps/workshops.qiime2.org | 5941e4db8b63c3518db2b85d5c45afbea5781bfc | [
"BSD-3-Clause"
] | null | null | null | payments/migrations/0029_posteroption.py | jakereps/workshops.qiime2.org | 5941e4db8b63c3518db2b85d5c45afbea5781bfc | [
"BSD-3-Clause"
] | null | null | null | payments/migrations/0029_posteroption.py | jakereps/workshops.qiime2.org | 5941e4db8b63c3518db2b85d5c45afbea5781bfc | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 37.421053 | 145 | 0.552039 |
bf48a6f62b8ebf06cc41634a520ba4ac59f6570c | 9,955 | py | Python | mistral/context.py | Abnerzhao/mistral | 55c8d70536c8e9de03376b523e8dfa3c3cf7070f | [
"Apache-2.0"
] | null | null | null | mistral/context.py | Abnerzhao/mistral | 55c8d70536c8e9de03376b523e8dfa3c3cf7070f | [
"Apache-2.0"
] | null | null | null | mistral/context.py | Abnerzhao/mistral | 55c8d70536c8e9de03376b523e8dfa3c3cf7070f | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 - Mirantis, Inc.
# Copyright 2016 - Brocade Communications Systems, 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/LI... | 33.745763 | 79 | 0.641185 |
9a7fa71b251c7907482ed1b5fc772010bb16a349 | 3,861 | py | Python | .history/my_classes/FirstClassFunctions/reducing_functions_20210707182813.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/reducing_functions_20210707182813.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/reducing_functions_20210707182813.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """Reducing Functions in Python
These are functions that recombine an iterable recursively, ending up with a single return value
Also called accumulators, aggregators, or folding functions
Example: Finding the maximum value in an iterable
a0, a1, a2, ...,, aN-1
max(a, b) _> maximum of a and b
result =a0
r... | 25.912752 | 105 | 0.480186 |
1954821f68c7f9c8e058c00408b92bd445e46ac8 | 1,338 | py | Python | test/devvyn/scrape/model/test_course_catalogue.py | devvyn/knowledge-mapper | 441d34db04c8ca8892dade2a64983635e39b728c | [
"MIT"
] | 1 | 2019-11-21T17:48:52.000Z | 2019-11-21T17:48:52.000Z | test/devvyn/scrape/model/test_course_catalogue.py | devvyn/usask-scrape-course-prerequisites | 441d34db04c8ca8892dade2a64983635e39b728c | [
"MIT"
] | 8 | 2019-10-07T05:31:42.000Z | 2019-11-29T01:31:02.000Z | test/devvyn/scrape/model/test_course_catalogue.py | devvyn/knowledge-mapper | 441d34db04c8ca8892dade2a64983635e39b728c | [
"MIT"
] | null | null | null | """
Tests for course dictionary model.
The model must be able to:
- Find official course description online, given only a course code.
- Understand course codes in various formats:
- PSY 120
- PSY-120
- PSY 120.3
- PSY-120.3
- Parse course prerequisite descriptions, producing:
- list of course codes mention... | 27.875 | 68 | 0.650224 |
9030d8d66a1dc015479633488578b970049be6c2 | 156 | py | Python | sender.py | pavlovajane/python-messenger | a6294b5390c764f4b3eb7efca20d0432af82317e | [
"MIT"
] | null | null | null | sender.py | pavlovajane/python-messenger | a6294b5390c764f4b3eb7efca20d0432af82317e | [
"MIT"
] | null | null | null | sender.py | pavlovajane/python-messenger | a6294b5390c764f4b3eb7efca20d0432af82317e | [
"MIT"
] | null | null | null | import requests
while True:
text = input()
requests.post(
'http://127.0.0.1:5000/send',
json={'text': text, 'name': 'admin'}
)
| 17.333333 | 44 | 0.532051 |
d4cea12adc4a39582414a9304cffab96e394688e | 3,880 | py | Python | terraform/cloud-functions/alice-func/index.py | chaos-adept/iot-dipstick | 27a543b6673e8f0f04c2bdf0e31e5f3760f8b45c | [
"Apache-2.0"
] | 2 | 2021-02-19T21:08:36.000Z | 2021-04-02T09:38:10.000Z | terraform/cloud-functions/alice-func/index.py | chaos-adept/iot-dipstick | 27a543b6673e8f0f04c2bdf0e31e5f3760f8b45c | [
"Apache-2.0"
] | 35 | 2021-01-11T06:52:24.000Z | 2021-06-15T06:59:00.000Z | terraform/cloud-functions/alice-func/index.py | chaos-adept/iot-dipstick | 27a543b6673e8f0f04c2bdf0e31e5f3760f8b45c | [
"Apache-2.0"
] | null | null | null | import os
import logging
import datetime as dt
import json
import re
import paho.mqtt.publish as publish
import requests
from functools import reduce
logger = logging.getLogger()
logger.setLevel(logging.INFO)
lightCmdRegexp = re.compile("(свет)|(вкл)|(выкл)")
lightCMDTurnOffRegexp = re.compile("выкл")
weatherForecas... | 30.793651 | 116 | 0.665722 |
1af4fc52d8c571682f8c54383827d508decf1962 | 150 | py | Python | ecom/cart/context_processors.py | archeski/ecom | fb09730146ceb51894cc67fa3411ce4cd1b1b9fb | [
"MIT"
] | null | null | null | ecom/cart/context_processors.py | archeski/ecom | fb09730146ceb51894cc67fa3411ce4cd1b1b9fb | [
"MIT"
] | 6 | 2020-06-05T18:35:05.000Z | 2022-03-11T23:26:37.000Z | ecom/cart/context_processors.py | arturkuchynski/ecom | fb09730146ceb51894cc67fa3411ce4cd1b1b9fb | [
"MIT"
] | null | null | null | from .cart import Cart
def cart(request):
"""
Pass a cart object when use this context processor
"""
return {'cart': Cart(request)}
| 16.666667 | 54 | 0.633333 |
14cfe094fa651ac68911a92906949d51dc340df7 | 24,623 | py | Python | ironic/common/exception.py | markbeierl/ironic | bcf5b37c736bc36abe94489c366fe26f198a7e7a | [
"Apache-2.0"
] | null | null | null | ironic/common/exception.py | markbeierl/ironic | bcf5b37c736bc36abe94489c366fe26f198a7e7a | [
"Apache-2.0"
] | null | null | null | ironic/common/exception.py | markbeierl/ironic | bcf5b37c736bc36abe94489c366fe26f198a7e7a | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 30.398765 | 79 | 0.680055 |
d1caa6c5e37005067a08f162ca6e1b91ee2b2b30 | 2,556 | py | Python | webapp/candysorter/ext/google/cloud/ml/training.py | https-giithub-com/findyoucandy | 869b4a696e7cb2ce11d003b383cced694f0bc5ec | [
"Apache-2.0"
] | null | null | null | webapp/candysorter/ext/google/cloud/ml/training.py | https-giithub-com/findyoucandy | 869b4a696e7cb2ce11d003b383cced694f0bc5ec | [
"Apache-2.0"
] | 3 | 2021-04-07T23:19:04.000Z | 2021-09-23T23:24:22.000Z | webapp/candysorter/ext/google/cloud/ml/training.py | https-giithub-com/findyoucandy | 869b4a696e7cb2ce11d003b383cced694f0bc5ec | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 BrainPad 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... | 35.5 | 82 | 0.622066 |
300b475c0ef21ee4735e1b6a34b4ce504676dea4 | 5,485 | py | Python | examples/rllib/multiagent_exps/multiagent_stabilizing_the_ring.py | remusionita/flow_rl | f26cd13bdcc89c00fe980cd8d7873c88af8e2744 | [
"MIT"
] | 1 | 2020-06-09T14:40:54.000Z | 2020-06-09T14:40:54.000Z | examples/rllib/multiagent_exps/multiagent_stabilizing_the_ring.py | remusionita/flow_rl | f26cd13bdcc89c00fe980cd8d7873c88af8e2744 | [
"MIT"
] | 1 | 2019-12-05T09:04:05.000Z | 2019-12-05T21:23:49.000Z | examples/rllib/multiagent_exps/multiagent_stabilizing_the_ring.py | remusionita/flow_rl | f26cd13bdcc89c00fe980cd8d7873c88af8e2744 | [
"MIT"
] | 3 | 2019-12-07T11:36:21.000Z | 2020-01-04T16:29:57.000Z | """Ring road example.
Creates a set of stabilizing the ring experiments to test if
more agents -> fewer needed batches
"""
import json
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.agents.ppo.ppo_po... | 29.489247 | 77 | 0.668551 |
75e4aab1a5be601e94a90b8ac1c56fa30bd6a5db | 122 | py | Python | surfstat/python/need_not_convert/SurfStatWriteVol1.py | rudimeier/BrainStat | a5ef474ffd70300ecf5fa464fff4a41e71f4b7a1 | [
"BSD-3-Clause"
] | null | null | null | surfstat/python/need_not_convert/SurfStatWriteVol1.py | rudimeier/BrainStat | a5ef474ffd70300ecf5fa464fff4a41e71f4b7a1 | [
"BSD-3-Clause"
] | null | null | null | surfstat/python/need_not_convert/SurfStatWriteVol1.py | rudimeier/BrainStat | a5ef474ffd70300ecf5fa464fff4a41e71f4b7a1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
def py_SurfStatWriteVol(d, Z, T):
sys.exit("Function py_SurfStatWriteVol is not implemented yet")
| 24.4 | 67 | 0.762295 |
c4de5896b377698f9748507b9d91862852ada050 | 702 | py | Python | PytoTests/Tests/python/test_lib.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 701 | 2018-10-22T11:54:09.000Z | 2022-03-31T14:39:30.000Z | PytoTests/Tests/python/test_lib.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 229 | 2018-10-24T09:15:31.000Z | 2021-12-24T16:51:37.000Z | PytoTests/Tests/python/test_lib.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 131 | 2018-11-25T18:33:03.000Z | 2022-03-24T03:18:07.000Z | from pip import main as pip
from console import clear
import sys
import os
import numpy
print(numpy)
tests = sys.argv[1]
if not "PYTEST_INSTALLED" in os.environ:
os.environ["PYTEST_INSTALLED"] = "1"
try:
pip(["install", "pytest"])
pip(["install", "hypothesis"])
except SystemExit:
... | 19.5 | 40 | 0.673789 |
54976ab720038b07f640869441e0a84d7faf23cc | 6,248 | py | Python | manage.py | isabella232/comport | 117123862415261095a917ed7f2037c1f986b474 | [
"BSD-3-Clause"
] | 35 | 2015-11-14T18:32:45.000Z | 2022-01-23T15:15:05.000Z | manage.py | codeforamerica/comport | 117123862415261095a917ed7f2037c1f986b474 | [
"BSD-3-Clause"
] | 119 | 2015-11-20T22:45:34.000Z | 2022-02-10T23:02:36.000Z | manage.py | isabella232/comport | 117123862415261095a917ed7f2037c1f986b474 | [
"BSD-3-Clause"
] | 19 | 2015-11-20T20:41:52.000Z | 2022-01-26T04:12:34.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import datetime
from copy import deepcopy
from dateutil.relativedelta import relativedelta
from random import randint
from flask_script import Manager, Shell, Server, prompt_pass, prompt_bool
from flask_migrate import MigrateCommand, upgrade
from comport.content.d... | 34.711111 | 172 | 0.678777 |
25949c4e0ed933665b8be0577884c8bcd1c8ba74 | 2,327 | py | Python | liualgotrader/fincalcs/vwap.py | ajmal017/LiuAlgoTrader | 85924391c139fdca84d6bd98494385405d3b799f | [
"MIT"
] | 1 | 2020-12-01T02:39:52.000Z | 2020-12-01T02:39:52.000Z | liualgotrader/fincalcs/vwap.py | ajmal017/LiuAlgoTrader | 85924391c139fdca84d6bd98494385405d3b799f | [
"MIT"
] | null | null | null | liualgotrader/fincalcs/vwap.py | ajmal017/LiuAlgoTrader | 85924391c139fdca84d6bd98494385405d3b799f | [
"MIT"
] | null | null | null | from datetime import datetime
import pandas as pd
from pandas import DataFrame as df
from pandas import Timestamp as ts
from tabulate import tabulate
from liualgotrader.common import config
from liualgotrader.common.tlog import tlog
def add_daily_vwap(minute_data: df, debug=False) -> bool:
back_time = ts(config... | 29.455696 | 97 | 0.59089 |
c0cde2eecbce7918e2ea619e2f25f6c89a01fb5f | 664 | py | Python | qlang/tutorial/maxprime/maxprime.py | redshiftkeying/slowflow | 561d2ec9c83a712bad1239a292897e367fc4c97c | [
"MIT"
] | 271 | 2015-09-18T14:14:07.000Z | 2022-02-06T04:21:32.000Z | tutorial/maxprime/maxprime.py | aaple/qlang | dd8656b55eaf19f3813ca4e98f829e67df472c96 | [
"MIT"
] | 3 | 2015-09-20T04:27:06.000Z | 2017-05-28T14:14:40.000Z | tutorial/maxprime/maxprime.py | aaple/qlang | dd8656b55eaf19f3813ca4e98f829e67df472c96 | [
"MIT"
] | 77 | 2015-09-23T14:56:50.000Z | 2022-03-15T02:34:52.000Z | import sys
primes = [2, 3]
n = 1
limit = 9
def isPrime(v):
i = 0
while i < n:
if v % primes[i] == 0:
return False
i += 1
return True
def listPrimes(max):
global n, limit
v = 5
while True:
while v < limit:
if isPrime(v):
primes.append(v)
if v * v >= max:
return
v += 2
v += 2
n +=... | 12.769231 | 32 | 0.567771 |
1e0dcc87ed4a453ffdffef9a4ad32f8da766fd62 | 27,950 | py | Python | Lib/random.py | laomaiweng/cpython | bcd3a1a18d841338f57c39f6a7de8cf14d0c3e03 | [
"PSF-2.0"
] | 2 | 2018-05-23T05:18:49.000Z | 2021-08-01T08:43:23.000Z | Lib/random.py | laomaiweng/cpython | bcd3a1a18d841338f57c39f6a7de8cf14d0c3e03 | [
"PSF-2.0"
] | 1 | 2019-03-19T04:19:09.000Z | 2019-03-19T04:19:09.000Z | Lib/random.py | laomaiweng/cpython | bcd3a1a18d841338f57c39f6a7de8cf14d0c3e03 | [
"PSF-2.0"
] | 1 | 2018-10-16T15:14:17.000Z | 2018-10-16T15:14:17.000Z | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
pick weighted random sample
generate random permutation
distributions on the real line:
---------------------... | 35.025063 | 96 | 0.566655 |
f75d593cc638bc8959e81ee779359c2bb78579de | 682 | py | Python | instaclone/email.py | morrisonGithinji/morris-Instagram | a0145452c8ea05b0d2818989c36aa409c23b3ad2 | [
"MIT"
] | null | null | null | instaclone/email.py | morrisonGithinji/morris-Instagram | a0145452c8ea05b0d2818989c36aa409c23b3ad2 | [
"MIT"
] | null | null | null | instaclone/email.py | morrisonGithinji/morris-Instagram | a0145452c8ea05b0d2818989c36aa409c23b3ad2 | [
"MIT"
] | null | null | null | from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
def send_welcome_email(name,receiver):
# Creating message subject and sender
subject = 'Welcome to Morrisinsta,for allyour Photo uploads and also get to view your friends photos'
sender = 'morrison.githi... | 45.466667 | 105 | 0.771261 |
0275fc10dc6753351261742ac71fc32e76576e11 | 30,028 | py | Python | src/syft/lib/python/__init__.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | src/syft/lib/python/__init__.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | src/syft/lib/python/__init__.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | # stdlib
from typing import Optional
# syft relative
from . import collections
from ...ast import add_classes
from ...ast import add_methods
from ...ast import add_modules
from ...ast.globals import Globals
from ...core.node.abstract.node import AbstractNodeClient
from ..misc.union import UnionGenerator
from .bool imp... | 51.329915 | 84 | 0.610963 |
1fb372f8b978dc1514e999757ceec34d0522893b | 1,508 | py | Python | experiments/ashvin/vae/fixed/pointmass/test.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/fixed/pointmass/test.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/fixed/pointmass/test.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.envs.multitask.point2d import MultitaskImagePoint2DEnv
from rlkit.envs.multitask.pusher2d import FullPusher2DEnv
from rlkit.launchers.arglauncher import run_variants
import rlkit.misc.hyperparameter as hyp
from rlkit.torch.vae.vae_experiment import experiment
if __name__ == "__main__":
# noinspection P... | 27.418182 | 73 | 0.607427 |
d1cb360e9917617ad5c904374b3eb8dd6957d1be | 4,865 | py | Python | personal_blog/books/routes.py | JulianHysi/personal-blog | 42cf296cce7791cca76da5653dd3570deb48849a | [
"MIT"
] | null | null | null | personal_blog/books/routes.py | JulianHysi/personal-blog | 42cf296cce7791cca76da5653dd3570deb48849a | [
"MIT"
] | 3 | 2021-09-08T03:13:42.000Z | 2022-03-12T00:56:51.000Z | personal_blog/books/routes.py | JulianHysi/personal_blog | 42cf296cce7791cca76da5653dd3570deb48849a | [
"MIT"
] | null | null | null | """Module containing route functions for the books blueprint.
---
Functions
---------
add_book(): return http response
the route for adding books
all_books(): return http response
the route for displaying all books
book(book_id): return http response
the route for displaying a single book
update_book(book... | 27.027778 | 79 | 0.646249 |
84de8898171181653bbafd0fe5c756213daefbf9 | 908 | py | Python | var/spack/repos/builtin.mock/packages/printing-package/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin.mock/packages/printing-package/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin.mock/packages/printing-package/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PrintingPackage(Package):
"""This package prints some output from its install meth... | 28.375 | 88 | 0.662996 |
ab4eb60bfc9f45133235346b5a9cbe8cf7091602 | 573 | py | Python | event/eventapp/migrations/0010_auto_20190506_0611.py | easywaytostudy123/eventhandler | 07d36c5e83c49016b50f901455a4088b8548da3c | [
"Apache-2.0"
] | null | null | null | event/eventapp/migrations/0010_auto_20190506_0611.py | easywaytostudy123/eventhandler | 07d36c5e83c49016b50f901455a4088b8548da3c | [
"Apache-2.0"
] | 8 | 2020-02-12T00:25:27.000Z | 2022-02-10T11:21:11.000Z | event/eventapp/migrations/0010_auto_20190506_0611.py | PushpinderSingh21/eventhandler | 4e7aafedf6bb171c9cd3fb6d44d9072e9fa537d6 | [
"Apache-2.0"
] | 1 | 2020-03-04T06:58:05.000Z | 2020-03-04T06:58:05.000Z | # Generated by Django 2.2 on 2019-05-06 06:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eventapp', '0009_auto_20190506_0609'),
]
operations = [
migrations.AlterField(
model_name='createevent',
name='date',
... | 23.875 | 66 | 0.589878 |
eb6fbd224b9abd6354d76e8bb0a6280eebb7ad1f | 701 | py | Python | novaclient/v2/contrib/metadata_extensions.py | dtroyer/python-novaclient | 4c483322fe5454c8ece66cc9c86cbc0702e14368 | [
"Apache-1.1"
] | null | null | null | novaclient/v2/contrib/metadata_extensions.py | dtroyer/python-novaclient | 4c483322fe5454c8ece66cc9c86cbc0702e14368 | [
"Apache-1.1"
] | null | null | null | novaclient/v2/contrib/metadata_extensions.py | dtroyer/python-novaclient | 4c483322fe5454c8ece66cc9c86cbc0702e14368 | [
"Apache-1.1"
] | 1 | 2019-01-11T16:15:52.000Z | 2019-01-11T16:15:52.000Z | # Copyright 2013 Rackspace Hosting
# 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 require... | 35.05 | 78 | 0.738944 |
12655df6ba00c529411bb7a97828de8f3d6e2d34 | 1,530 | py | Python | tests/test_rename_custom_annotations.py | opengenomebrowser/opengenomebrowser-tools | b6ef2340b2fd67a61373d1d8a0f3ef71cc892d1e | [
"MIT"
] | null | null | null | tests/test_rename_custom_annotations.py | opengenomebrowser/opengenomebrowser-tools | b6ef2340b2fd67a61373d1d8a0f3ef71cc892d1e | [
"MIT"
] | null | null | null | tests/test_rename_custom_annotations.py | opengenomebrowser/opengenomebrowser-tools | b6ef2340b2fd67a61373d1d8a0f3ef71cc892d1e | [
"MIT"
] | null | null | null | from unittest import TestCase
import os
from opengenomebrowser_tools.rename_custom_annotations import *
ROOT = os.path.dirname(os.path.dirname(__file__))
TMPFILE = '/tmp/renamed_custom_annotations.KG'
custom_files = [
f'{ROOT}/test-data/prokka-bad/custom_annotations.KG',
]
def cleanup():
if os.path.isfile(... | 34 | 110 | 0.696732 |
2b4df20f0bb072b8c8f72b6e3ebce1e997d800cb | 29,180 | py | Python | codes_src/fairseq/sequence_generator.py | ZhenYangIACAS/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | 50 | 2021-11-15T02:34:43.000Z | 2021-11-18T07:24:46.000Z | codes_src/fairseq/sequence_generator.py | yujun531/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | null | null | null | codes_src/fairseq/sequence_generator.py | yujun531/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | 26 | 2021-11-15T02:35:14.000Z | 2021-11-15T08:25:42.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 math
import torch
from fairseq import search, utils
from fairseq.models import FairseqIncrementalDecoder
class SequenceGenerator(ob... | 43.813814 | 117 | 0.566587 |
ca9b496e1efdce87aedfc759c8eb1eac29adc572 | 407 | py | Python | CommonChecklist/asgi.py | pandeyarjun242/submission | 811fb8ed5854531848aa430c5c998b8e6c463137 | [
"MIT"
] | null | null | null | CommonChecklist/asgi.py | pandeyarjun242/submission | 811fb8ed5854531848aa430c5c998b8e6c463137 | [
"MIT"
] | null | null | null | CommonChecklist/asgi.py | pandeyarjun242/submission | 811fb8ed5854531848aa430c5c998b8e6c463137 | [
"MIT"
] | null | null | null | """
ASGI config for CommonChecklist project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJAN... | 23.941176 | 78 | 0.793612 |
4470afe5bb7e9fc7c1099e2c187baf09a3868362 | 6,203 | py | Python | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/managed_database_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/managed_database_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/managed_database_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 50.024194 | 263 | 0.684991 |
dbf8977714d81f9e4c7ab447488de3c4e10b0795 | 21,146 | py | Python | src/rubrix/client/api.py | leireropl/rubrix | c1e14f79b0284300a27be482f6edcc6d4c9a220d | [
"Apache-2.0"
] | null | null | null | src/rubrix/client/api.py | leireropl/rubrix | c1e14f79b0284300a27be482f6edcc6d4c9a220d | [
"Apache-2.0"
] | null | null | null | src/rubrix/client/api.py | leireropl/rubrix | c1e14f79b0284300a27be482f6edcc6d4c9a220d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 34.552288 | 129 | 0.62338 |
c0b6eb0cba5309a7e98ee50c72f15fd330010a1b | 9,269 | py | Python | hubblestack/audit/service.py | buddwm/hubble | b384ee48556ca144ae6f09dd0b45db29288e5293 | [
"Apache-2.0"
] | 363 | 2017-01-10T22:02:47.000Z | 2022-03-21T10:44:40.000Z | hubblestack/audit/service.py | buddwm/hubble | b384ee48556ca144ae6f09dd0b45db29288e5293 | [
"Apache-2.0"
] | 439 | 2017-01-12T22:39:42.000Z | 2021-10-11T18:43:28.000Z | hubblestack/audit/service.py | buddwm/hubble | b384ee48556ca144ae6f09dd0b45db29288e5293 | [
"Apache-2.0"
] | 138 | 2017-01-05T22:10:59.000Z | 2021-09-01T14:35:00.000Z | # -*- encoding: utf-8 -*-
"""
Module for running service command. Same can be used in both Audit/FDG
Note: Earlier systemctl module is also merged into this module only
Note: Now each module just returns its output (As Data gathering)
For Audit checks, comparison logic is now moved to comparators.
See be... | 31.104027 | 126 | 0.682814 |
7225e39c09496534d23fe8749debd4eeba6a8d36 | 8,256 | py | Python | lib/python3.8/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_switch_controller_sflow.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_switch_controller_sflow.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_switch_controller_sflow.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 31.154717 | 137 | 0.677204 |
43a01f6f2d5a3896a1e37fbcfcf2207d623f989e | 325 | py | Python | reactivestreams/__init__.py | aksalj/rsocket-py | dd9d554621c60965efbaf18caa8a290da1680d53 | [
"MIT"
] | 50 | 2018-08-11T06:51:47.000Z | 2022-03-31T20:22:58.000Z | reactivestreams/__init__.py | linux-china/rsocket-py | 77ab3f826cb78c5e30de6035b818218bca787297 | [
"MIT"
] | 21 | 2017-04-17T21:44:40.000Z | 2022-03-31T09:20:49.000Z | reactivestreams/__init__.py | JIAWea/rsocket-py | c264f60eb1dcb3edff09b220dd049a94ff0771b8 | [
"MIT"
] | 21 | 2017-05-30T20:40:32.000Z | 2022-02-01T22:11:01.000Z | """
ReactiveStreams
~~~~~~~~~~~~~~~
Abstract base class definitions for ReactiveStreams Publisher/Subsciber.
"""
from reactivestreams.publisher import Publisher
from reactivestreams.subscriber import Subscriber
from reactivestreams.subscription import Subscription
def reactivestreams():
return 'reactivestreams-... | 21.666667 | 72 | 0.790769 |
cc2ee40cfc15df0fe44c1ed4549255d296eb785e | 333 | py | Python | cbsdng/schemas/plan.py | mekanix/cbsdng-backend | 0c0058521ffb97b0dd9948a257290c5489ae5216 | [
"BSD-2-Clause"
] | null | null | null | cbsdng/schemas/plan.py | mekanix/cbsdng-backend | 0c0058521ffb97b0dd9948a257290c5489ae5216 | [
"BSD-2-Clause"
] | 5 | 2020-10-19T21:54:55.000Z | 2020-11-20T13:02:49.000Z | cbsdng/schemas/plan.py | mekanix/cbsdng-backend | 0c0058521ffb97b0dd9948a257290c5489ae5216 | [
"BSD-2-Clause"
] | 1 | 2020-10-10T18:00:39.000Z | 2020-10-10T18:00:39.000Z | import sys
from freenit.schemas.base import BaseSchema
from freenit.schemas.paging import PageOutSchema
from marshmallow import fields
class PlanSchema(BaseSchema):
id = fields.Integer(description='ID', dump_only=True)
name = fields.String()
memory = fields.Integer()
PageOutSchema(PlanSchema, sys.module... | 23.785714 | 57 | 0.777778 |
c8638cc73a32ef61ab440922c730244e1f1f7e31 | 3,238 | py | Python | sentry_sdk/integrations/django/templates.py | rik/sentry-python | b72292c3575c0b115bb684f1f374fa333e365a78 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/django/templates.py | rik/sentry-python | b72292c3575c0b115bb684f1f374fa333e365a78 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/django/templates.py | rik/sentry-python | b72292c3575c0b115bb684f1f374fa333e365a78 | [
"BSD-2-Clause"
] | null | null | null | from django.template import TemplateSyntaxError # type: ignore
MYPY = False
if MYPY:
from typing import Any
from typing import Dict
from typing import Optional
try:
# support Django 1.9
from django.template.base import Origin # type: ignore
except ImportError:
# backward compatibility
fr... | 27.675214 | 87 | 0.634033 |
bfe6003c8e6ebe10d36e34c932517c16ee1b6bc0 | 10,907 | py | Python | contrib/testgen/gen_key_io_test_vectors.py | BakedInside/test | c411891206e72c0da9c9f7a69a2183703b71a988 | [
"MIT"
] | null | null | null | contrib/testgen/gen_key_io_test_vectors.py | BakedInside/test | c411891206e72c0da9c9f7a69a2183703b71a988 | [
"MIT"
] | null | null | null | contrib/testgen/gen_key_io_test_vectors.py | BakedInside/test | c411891206e72c0da9c9f7a69a2183703b71a988 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2012-2018 The Beans Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Generate valid and invalid base58/bech32(m) address and private key test vectors.
Usage:
PYTHONPATH... | 40.546468 | 133 | 0.617677 |
9ac885b24f11ca984ce7f56bc3020da12e4a1216 | 1,001 | py | Python | th2_common/schema/strategy/field_extraction/impl/th2_batch_msg_field_extraction.py | ConnectDIY/th2-common-py | 977758a68d6a7db91ee38c36667e90bf663f14ef | [
"Apache-2.0"
] | null | null | null | th2_common/schema/strategy/field_extraction/impl/th2_batch_msg_field_extraction.py | ConnectDIY/th2-common-py | 977758a68d6a7db91ee38c36667e90bf663f14ef | [
"Apache-2.0"
] | 18 | 2020-11-23T12:11:31.000Z | 2022-03-29T06:13:19.000Z | th2_common/schema/strategy/field_extraction/impl/th2_batch_msg_field_extraction.py | ConnectDIY/th2-common-py | 977758a68d6a7db91ee38c36667e90bf663f14ef | [
"Apache-2.0"
] | 1 | 2021-01-20T11:21:57.000Z | 2021-01-20T11:21:57.000Z | # Copyright 2020-2020 Exactpro (Exactpro Systems Limited)
#
# 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... | 38.5 | 119 | 0.782218 |
c5bd2066c894cddcce53af2c38fc0c744f3ab64c | 1,214 | py | Python | elasticsearch/client/monitoring.py | shdkpr2008/elasticsearch-py | 625c834d5b59f943c48c16565fdbc6e77ed8f3c1 | [
"Apache-2.0"
] | 2 | 2020-11-26T06:07:28.000Z | 2021-09-17T01:33:56.000Z | elasticsearch/client/monitoring.py | shdkpr2008/elasticsearch-py | 625c834d5b59f943c48c16565fdbc6e77ed8f3c1 | [
"Apache-2.0"
] | 3 | 2020-11-19T11:43:34.000Z | 2021-04-26T06:37:31.000Z | elasticsearch/client/monitoring.py | shdkpr2008/elasticsearch-py | 625c834d5b59f943c48c16565fdbc6e77ed8f3c1 | [
"Apache-2.0"
] | 2 | 2021-09-17T01:34:09.000Z | 2021-09-18T09:09:02.000Z | from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH, _bulk_body
class MonitoringClient(NamespacedClient):
@query_params("interval", "system_api_version", "system_id")
def bulk(self, body, doc_type=None, params=None, headers=None):
"""
`<https://www.elastic.co/guide/en/e... | 40.466667 | 110 | 0.64827 |
07ca410c7fdd644fa22256b6d2d4232813b5cb73 | 1,255 | py | Python | hoodie/migrations/0004_auto_20181024_0641.py | danalvin/Django-IP4 | 708cfc17ba0165adb9f09b84360c6ac05cefdf76 | [
"MIT"
] | null | null | null | hoodie/migrations/0004_auto_20181024_0641.py | danalvin/Django-IP4 | 708cfc17ba0165adb9f09b84360c6ac05cefdf76 | [
"MIT"
] | null | null | null | hoodie/migrations/0004_auto_20181024_0641.py | danalvin/Django-IP4 | 708cfc17ba0165adb9f09b84360c6ac05cefdf76 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-24 06:41
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 = [
('hoodie', '0003_auto_20181023... | 33.026316 | 158 | 0.626295 |
1665333410518757acffe76a8da76e8fb83dc236 | 7,942 | py | Python | wireguard/wireguard.py | juweeks/wireguard-vpn-cdk | 6f5094b1a7f8b7a88ec16897905e2b11d46de727 | [
"MIT"
] | 1 | 2022-02-27T00:41:32.000Z | 2022-02-27T00:41:32.000Z | wireguard/wireguard.py | juweeks/wireguard-vpn-cdk | 6f5094b1a7f8b7a88ec16897905e2b11d46de727 | [
"MIT"
] | 1 | 2022-02-26T23:23:28.000Z | 2022-02-26T23:25:49.000Z | wireguard/wireguard.py | juweeks/wireguard-vpn-cdk | 6f5094b1a7f8b7a88ec16897905e2b11d46de727 | [
"MIT"
] | 1 | 2022-02-27T00:35:23.000Z | 2022-02-27T00:35:23.000Z | import aws_cdk as cdk
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_iam as iam
from constructs import Construct
class Network(Construct):
"""
- non-instance specific network resources- VPC, Subnets, etc.
- remove default NAT (saves $$$) and will use IGW
"""
def __init__(self, scope: ... | 33.091667 | 114 | 0.561823 |
b95c436717830c0030e8bca48c05e6b5381f4cda | 2,364 | py | Python | reader/things3d.py | klens-codes/MaskFlownet | 1d7e0c33dcd47888f67e86829f835e742980b2ea | [
"MIT"
] | null | null | null | reader/things3d.py | klens-codes/MaskFlownet | 1d7e0c33dcd47888f67e86829f835e742980b2ea | [
"MIT"
] | null | null | null | reader/things3d.py | klens-codes/MaskFlownet | 1d7e0c33dcd47888f67e86829f835e742980b2ea | [
"MIT"
] | null | null | null | import os
import numpy as np
from functools import lru_cache
import struct
# ======== PLEASE MODIFY ========
things3d_root = r'/data2/opticalflow/datasets/FlyingThings/'
def list_data(path = None, sub_type = 'clean'):
if path is None:
path = things3d_root
parts = ('train', ) # 'val')
sub_types = (sub_type,)
#if... | 30.701299 | 138 | 0.664129 |
31548a7d7ea6b7aeedda806380c3c956a6b09e99 | 2,421 | py | Python | tests/common.py | hriener/party-elli | e7636a8045a46cd988a3a05b4b888577afb97708 | [
"MIT"
] | 9 | 2016-04-04T07:13:02.000Z | 2021-11-08T12:15:33.000Z | tests/common.py | hriener/party-elli | e7636a8045a46cd988a3a05b4b888577afb97708 | [
"MIT"
] | 1 | 2020-04-12T18:44:26.000Z | 2020-04-12T18:44:26.000Z | tests/common.py | hriener/party-elli | e7636a8045a46cd988a3a05b4b888577afb97708 | [
"MIT"
] | 2 | 2019-02-25T13:54:55.000Z | 2020-04-07T14:00:36.000Z | import sys
from helpers.main_helper import get_root_dir
from helpers.python_ext import is_empty_str
from helpers.shell import execute_shell
BENCHMARKS_DIR = get_root_dir() + "benchmarks/"
def _get_cmd_result(result, out, err):
output = '-' * 20 + 'DETAILS' + '-' * 20 + '\n' + \
"output:" + out + '... | 36.134328 | 104 | 0.565882 |
a574d52d10f68079194f3787a05e718fd61d5f11 | 158 | py | Python | src/pgtonic/exceptions.py | olirice/pgtonic | a6218a4fcb1bc6eb2f2abb465b32ac8abcd0c7f4 | [
"MIT"
] | null | null | null | src/pgtonic/exceptions.py | olirice/pgtonic | a6218a4fcb1bc6eb2f2abb465b32ac8abcd0c7f4 | [
"MIT"
] | null | null | null | src/pgtonic/exceptions.py | olirice/pgtonic | a6218a4fcb1bc6eb2f2abb465b32ac8abcd0c7f4 | [
"MIT"
] | null | null | null | class PGTonicException(Exception):
pass
class LexFailureException(PGTonicException):
pass
class ParseFailureException(PGTonicException):
pass
| 14.363636 | 46 | 0.78481 |
fffddcd1aac2534ab8fa6082a2b13a807be5eee1 | 155 | py | Python | cowait/worker/__init__.py | ProgHaj/cowait | e95c30faab8caf8b0413de4e1784529a3a06475d | [
"Apache-2.0"
] | 51 | 2020-06-04T06:08:14.000Z | 2022-03-28T06:59:53.000Z | cowait/worker/__init__.py | ProgHaj/cowait | e95c30faab8caf8b0413de4e1784529a3a06475d | [
"Apache-2.0"
] | 121 | 2020-06-01T12:09:32.000Z | 2022-03-31T20:47:57.000Z | cowait/worker/__init__.py | ProgHaj/cowait | e95c30faab8caf8b0413de4e1784529a3a06475d | [
"Apache-2.0"
] | 6 | 2020-06-11T16:05:20.000Z | 2022-03-23T06:30:17.000Z | # flake8: noqa: F401
from .executor import execute
from .loader import load_task_class
from .env import env_get_cluster_provider, env_get_task_definition
| 25.833333 | 66 | 0.83871 |
8f94a99ec231e3bca8486b3fb2578924371d260d | 33 | py | Python | packages/amplify-e2e-tests/layerdata/python/testfunc.py | rosmu/amplify-cli | 8dc238083c74e4eac6c3e96c31490f071cd1cb28 | [
"Apache-2.0"
] | 6 | 2021-03-19T00:19:29.000Z | 2021-11-08T09:46:12.000Z | packages/amplify-e2e-tests/layerdata/python/testfunc.py | rosmu/amplify-cli | 8dc238083c74e4eac6c3e96c31490f071cd1cb28 | [
"Apache-2.0"
] | 1 | 2020-06-08T11:59:37.000Z | 2020-06-08T11:59:37.000Z | packages/amplify-e2e-tests/layerdata/python/testfunc.py | rosmu/amplify-cli | 8dc238083c74e4eac6c3e96c31490f071cd1cb28 | [
"Apache-2.0"
] | 3 | 2020-07-17T01:14:56.000Z | 2021-03-29T09:04:24.000Z | testString = "Hello from Lambda!" | 33 | 33 | 0.757576 |
f01064dee03840624481a0989b1e39f32b05de4e | 53,314 | py | Python | mefamo/custom/face_geometry.py | jobutsu/MeFaMo | 20c747225d8f4fcf05b5e0fe247363cc10e0a642 | [
"MIT"
] | 96 | 2022-03-21T21:57:00.000Z | 2022-03-31T07:05:37.000Z | mefamo/custom/face_geometry.py | jobutsu/MeFaMo | 20c747225d8f4fcf05b5e0fe247363cc10e0a642 | [
"MIT"
] | 1 | 2022-03-29T17:42:09.000Z | 2022-03-29T18:05:06.000Z | mefamo/custom/face_geometry.py | jobutsu/MeFaMo | 20c747225d8f4fcf05b5e0fe247363cc10e0a642 | [
"MIT"
] | 18 | 2022-03-22T08:40:10.000Z | 2022-03-31T10:22:00.000Z | # Many parts taken from the cpp implementation from github.com/google/mediapipe
#
# Copyright 2020 The MediaPipe 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.a... | 19.900709 | 116 | 0.448738 |
b22225c076f9bafbbae48c8ab5b2631ee50e3c5c | 33,969 | py | Python | CacheMgr.py | SimiCode/Grail-Web-Browser | 16b86d3215068d334eacf6153b71a748eed53d3d | [
"CNRI-Jython"
] | 6 | 2019-06-17T06:13:01.000Z | 2021-08-22T02:13:36.000Z | CacheMgr.py | SimiCode/Grail-Web-Browser | 16b86d3215068d334eacf6153b71a748eed53d3d | [
"CNRI-Jython"
] | null | null | null | CacheMgr.py | SimiCode/Grail-Web-Browser | 16b86d3215068d334eacf6153b71a748eed53d3d | [
"CNRI-Jython"
] | 2 | 2016-08-18T12:14:44.000Z | 2019-12-06T17:20:21.000Z | from Cache import SharedItem, SharedAPI
from Assert import Assert
import urlparse
import string
import os
import time
import ht_time
import grailutil
import mimetypes
import regex
META, DATA, DONE = 'META', 'DATA', 'DONE' # Three stages
CacheMiss = 'Cache Miss'
CacheEmpty = 'Cache Empty'
CacheReadFailed = 'Cache Item... | 33.666006 | 79 | 0.553828 |
801439c04ecdaab5fe6022f168eede9a56e8b556 | 482 | py | Python | 8. dicionarios/verifica_primos.py | andrebrito16/python-academy | 544516048c0a2f8cea42ef0f252b9c40e8f5b141 | [
"MIT"
] | 1 | 2021-08-19T19:40:14.000Z | 2021-08-19T19:40:14.000Z | 8. dicionarios/verifica_primos.py | andrebrito16/python-academy | 544516048c0a2f8cea42ef0f252b9c40e8f5b141 | [
"MIT"
] | null | null | null | 8. dicionarios/verifica_primos.py | andrebrito16/python-academy | 544516048c0a2f8cea42ef0f252b9c40e8f5b141 | [
"MIT"
] | null | null | null | def eh_primo(n):
if n == 1 or n == 0 or n < 0:
return False
if n == 2:
return True
if n % 2 == 0:
return False
c = 3
while c < n:
print(c)
if n % c == 0:
return False
else:
c += 2
return True
def verifica_primos(numero... | 17.851852 | 33 | 0.435685 |
82b48fc050c036887bd280fb9833cfab9992734b | 6,269 | py | Python | conf.py | ReinhardFrie/peer | ccf43e96fe973a3ebfce4425c10595a470ffe349 | [
"MIT"
] | null | null | null | conf.py | ReinhardFrie/peer | ccf43e96fe973a3ebfce4425c10595a470ffe349 | [
"MIT"
] | null | null | null | conf.py | ReinhardFrie/peer | ccf43e96fe973a3ebfce4425c10595a470ffe349 | [
"MIT"
] | 1 | 2019-09-17T15:18:21.000Z | 2019-09-17T15:18:21.000Z | # -*- coding: utf-8 -*-
#
# Nutanix Labs documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 27 12:18:41 2017.
#
# 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.
... | 32.314433 | 79 | 0.689584 |
37f077bd7f59d90f626a33917cb7ef39ff8384bb | 8,622 | py | Python | StyleGAN/dnnlib/tflib/optimizer.py | yubin1219/GAN | 8345095f9816e548c968492efbe92b427b0e06a3 | [
"MIT"
] | null | null | null | StyleGAN/dnnlib/tflib/optimizer.py | yubin1219/GAN | 8345095f9816e548c968492efbe92b427b0e06a3 | [
"MIT"
] | null | null | null | StyleGAN/dnnlib/tflib/optimizer.py | yubin1219/GAN | 8345095f9816e548c968492efbe92b427b0e06a3 | [
"MIT"
] | 1 | 2021-09-17T01:28:50.000Z | 2021-09-17T01:28:50.000Z | import numpy as np
import tensorflow as tf
from collections import OrderedDict
from typing import List, Union
from . import autosummary
from . import tfutil
from .. import util
from .tfutil import TfExpression, TfExpressionEx
try:
from tensorflow.python.ops import nccl_ops
except:
import tensorflow.contrib.ncc... | 46.858696 | 164 | 0.591858 |
2cd1919488faa846571713365a73c4804f871646 | 3,861 | py | Python | proto/atdd-tutorial-berlin-2010/src/vacalc/employeestore.py | gdw2/robot-framework | f25068edf1502e76ba8664d4b5ed1aebe0ee2434 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | proto/atdd-tutorial-berlin-2010/src/vacalc/employeestore.py | gdw2/robot-framework | f25068edf1502e76ba8664d4b5ed1aebe0ee2434 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | proto/atdd-tutorial-berlin-2010/src/vacalc/employeestore.py | gdw2/robot-framework | f25068edf1502e76ba8664d4b5ed1aebe0ee2434 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from __future__ import with_statement
import os
import csv
import datetime
class VacalcError(RuntimeError): pass
class EmployeeStore(object):
def __init__(self, db_file):
self._db_file = db_file
if self._db_file and os.path.isfile(self._db_file):
self._employees = self._read_employ... | 31.390244 | 80 | 0.618752 |
0675a30f01abd52a6947113345a581005c7f6dbe | 6,497 | py | Python | src/proto/cppcookie.py | ago1024/xpp | 4ede24d7901e93e51c9e2a56dc7fdfb3054e50be | [
"MIT"
] | null | null | null | src/proto/cppcookie.py | ago1024/xpp | 4ede24d7901e93e51c9e2a56dc7fdfb3054e50be | [
"MIT"
] | null | null | null | src/proto/cppcookie.py | ago1024/xpp | 4ede24d7901e93e51c9e2a56dc7fdfb3054e50be | [
"MIT"
] | null | null | null | from builtins import object
from utils import _n, _ext, _n_item, get_namespace
_templates = {}
_templates['void_cookie_function'] = \
'''\
%s\
void
%s_checked(Connection && c%s)
{%s\
xpp::generic::check<Connection, xpp::%s::error::dispatcher>(
std::forward<Connection>(c),
%s_checked(std::forward<Connect... | 31.848039 | 96 | 0.548407 |
c67f47903560bd407f4bc2784d86fd93bc35b290 | 501 | py | Python | code/chapter_10/listing_10_10.py | guinslym/python_earth_science_book | f4dd0115dbbce140c6713989f630a71238daa72c | [
"MIT"
] | 80 | 2021-04-19T10:03:57.000Z | 2022-03-30T15:34:47.000Z | code/chapter_10/listing_10_10.py | guinslym/python_earth_science_book | f4dd0115dbbce140c6713989f630a71238daa72c | [
"MIT"
] | null | null | null | code/chapter_10/listing_10_10.py | guinslym/python_earth_science_book | f4dd0115dbbce140c6713989f630a71238daa72c | [
"MIT"
] | 23 | 2021-04-25T03:50:07.000Z | 2022-03-22T03:06:19.000Z | import sympy as sym
a, b, sigma_a, sigma_b = sym.symbols("a b sigma_a sigma_b")
def symbolic_error_prop(func, val_a, val_sigma_a, val_b=0, val_sigma_b=0):
z = sym.lambdify([a,b],func, 'numpy')
sigma_z = sym.lambdify([a, b, sigma_a, sigma_b], sym.sqrt((sym.diff(func, a)**2 * sigma_a**2)+(sym.diff(func, b)... | 41.75 | 144 | 0.668663 |
1f837102ae63bf2d309af5b200492cc680a7fadb | 758 | py | Python | answers/x_2_5.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | answers/x_2_5.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | 1 | 2021-11-13T08:03:04.000Z | 2021-11-13T08:03:04.000Z | answers/x_2_5.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | # x_2_5
#
# 関数内で定義された変数や関数の引数はそのプロック内でのみ参照できる「ローカル変数」となり「locals()」関数でその内容を確認できます
# 「a」「b」「c」「d」がそれぞれどんな値となるかを予想してください
def sample(name):
food = 'オムライス'
print(locals())
sample('田中')
def full_name_a(first_name, last_name):
a = locals()
print(a) # => {'first_name': '山田', 'last_name': '太郎'}
def full_... | 16.12766 | 70 | 0.630607 |
de4922c5014efcfa2e8fdbb78f043f5439e6f55b | 650 | py | Python | var/spack/repos/builtin/packages/py-binaryornot/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-binaryornot/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-binaryornot/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyBinaryornot(PythonPackage):
"""Ultra-lightweight pure Python package to check if a file ... | 32.5 | 95 | 0.735385 |
a5fe6c43d4d24aaa0fe5fc54541045d0ea727fb3 | 814 | py | Python | gitClone.py | michaele77/CS231N-pytorch | cf19d34a62f3ce69cc3192f6c6f25729e1aab5f1 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T00:40:04.000Z | 2020-05-21T00:40:04.000Z | gitClone.py | michaele77/CS231N-pytorch | cf19d34a62f3ce69cc3192f6c6f25729e1aab5f1 | [
"BSD-3-Clause"
] | null | null | null | gitClone.py | michaele77/CS231N-pytorch | cf19d34a62f3ce69cc3192f6c6f25729e1aab5f1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 23 22:16:38 2020
@author: ershov
"""
#Imports
import shutil
import os
import matplotlib.pyplot as plt
import random
import subprocess
dirList = os.listdir()
dirLen = len(dirList)
print('Directory length is: ' + str(dirLen))
if not dirLen > 5:
... | 22 | 78 | 0.646192 |
3d61611c505d2ec73a6414ea9572cf41badabf5b | 499 | py | Python | tests/restserver/polls/models.py | danicarrion/pyrestcli | 319a0d9574f47a2ff23cbce197bf412f5000d6fa | [
"MIT"
] | 5 | 2018-03-13T13:29:12.000Z | 2021-02-12T11:34:59.000Z | tests/restserver/polls/models.py | danicarrion/pyrestcli | 319a0d9574f47a2ff23cbce197bf412f5000d6fa | [
"MIT"
] | 21 | 2016-09-04T20:16:07.000Z | 2021-06-10T19:30:44.000Z | tests/restserver/polls/models.py | danicarrion/pyrestcli | 319a0d9574f47a2ff23cbce197bf412f5000d6fa | [
"MIT"
] | 5 | 2017-03-17T19:51:47.000Z | 2021-03-18T07:40:12.000Z | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASC... | 26.263158 | 92 | 0.733467 |
3fd0da84f4e428087630fc4ccd48f938cf7a1f35 | 102 | py | Python | django-demo/src/for_django_2-0/myproject/myapp/urls.py | tamilmaran-7/samples | ba52f06fa7bcf3da88d833eba677624ee253999a | [
"Apache-2.0"
] | 1 | 2022-03-15T07:20:59.000Z | 2022-03-15T07:20:59.000Z | django-demo/src/for_django_2-0/myproject/myapp/urls.py | tamilmaran-7/samples | ba52f06fa7bcf3da88d833eba677624ee253999a | [
"Apache-2.0"
] | null | null | null | django-demo/src/for_django_2-0/myproject/myapp/urls.py | tamilmaran-7/samples | ba52f06fa7bcf3da88d833eba677624ee253999a | [
"Apache-2.0"
] | 4 | 2022-02-07T06:42:32.000Z | 2022-03-17T07:30:10.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.list, name='list')
] | 17 | 34 | 0.696078 |
65d6d4aba07197836dec099f892f7810dd3029ee | 86 | py | Python | app/domain/exceptions.py | c-w/appinsights-on-premises | 511ebf7b2ea0bdacb81b6a3bc40ca45ea912af0e | [
"MIT"
] | 9 | 2019-08-27T13:15:49.000Z | 2021-03-23T13:27:40.000Z | app/domain/exceptions.py | CatalystCode/appinsights-on-premises | 511ebf7b2ea0bdacb81b6a3bc40ca45ea912af0e | [
"MIT"
] | 1 | 2019-07-25T18:06:19.000Z | 2020-04-29T16:40:41.000Z | app/domain/exceptions.py | c-w/appinsights-on-premises | 511ebf7b2ea0bdacb81b6a3bc40ca45ea912af0e | [
"MIT"
] | 1 | 2019-02-05T21:36:22.000Z | 2019-02-05T21:36:22.000Z | class UnknownClient(Exception):
pass
class DuplicateClient(Exception):
pass
| 12.285714 | 33 | 0.744186 |
87d213129fd156d266000d166191c75177b8ca66 | 180 | py | Python | dbsavior/__init__.py | pengfei99/K8sCronJobPostgresBackup | 2dd7bc3c7820752ef63e04d555dcb36b2518e3c0 | [
"Apache-2.0"
] | null | null | null | dbsavior/__init__.py | pengfei99/K8sCronJobPostgresBackup | 2dd7bc3c7820752ef63e04d555dcb36b2518e3c0 | [
"Apache-2.0"
] | null | null | null | dbsavior/__init__.py | pengfei99/K8sCronJobPostgresBackup | 2dd7bc3c7820752ef63e04d555dcb36b2518e3c0 | [
"Apache-2.0"
] | null | null | null | __version__ = '0.1.0'
# Set default logging handler to avoid "No handler found" warnings.
import logging
logging.getLogger('db_backup_restore').addHandler(logging.NullHandler())
| 25.714286 | 72 | 0.783333 |
28336e696bbd53e4f6bb20c0b370d830112fc7c4 | 56,747 | py | Python | src/network-manager/azext_network_manager/custom.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | null | null | null | src/network-manager/azext_network_manager/custom.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/network-manager/azext_network_manager/custom.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 48.962036 | 119 | 0.495938 |
14889bcb476954e7d14379f76a47622447c41f12 | 449 | py | Python | glocaltokens/utils/types.py | samapriya/glocaltokens | 989dcec7f0b68da41bf8e4de29c63a20525964d7 | [
"MIT"
] | null | null | null | glocaltokens/utils/types.py | samapriya/glocaltokens | 989dcec7f0b68da41bf8e4de29c63a20525964d7 | [
"MIT"
] | null | null | null | glocaltokens/utils/types.py | samapriya/glocaltokens | 989dcec7f0b68da41bf8e4de29c63a20525964d7 | [
"MIT"
] | null | null | null | def is_numeric(variable) -> bool:
"""Checks if a variable is numeric"""
return is_integer(variable) or is_float(variable)
def is_integer(variable):
"""Checks if a variable is an integer value"""
return type(variable) == int
def is_float(variable):
"""Checks if a variable is a floating point valu... | 23.631579 | 56 | 0.681514 |
dcfc4249b685f8d00cb5db85845f691a3f1e6126 | 1,656 | py | Python | test/functional/feature_blocksdir.py | BlackHatCoin/BlackHatWallet | 0f19b0ffafbf80ca97448f6ec243fb61218fd2c6 | [
"MIT"
] | 5 | 2021-05-01T18:24:06.000Z | 2022-01-12T22:05:16.000Z | test/functional/feature_blocksdir.py | BlackHatCoin/BlackHatWallet | 0f19b0ffafbf80ca97448f6ec243fb61218fd2c6 | [
"MIT"
] | null | null | null | test/functional/feature_blocksdir.py | BlackHatCoin/BlackHatWallet | 0f19b0ffafbf80ca97448f6ec243fb61218fd2c6 | [
"MIT"
] | 2 | 2021-05-02T01:48:22.000Z | 2022-02-23T21:44:07.000Z | #!/usr/bin/env python3
# Copyright (c) 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 the blocksdir option."""
import os
import shutil
from test_framework.test_framework import BlackHatTe... | 43.578947 | 115 | 0.693841 |
fae88690028930509b0ff873ec8c96c4a4e10cd4 | 2,440 | py | Python | codewriter.py | 42ip/animatedStickersDB | 861162907e67a4deae54c92c47f97fbaef7fd6ee | [
"MIT"
] | 4 | 2021-09-17T06:36:35.000Z | 2021-10-30T08:07:47.000Z | codewriter.py | 42ip/animatedStickersDB | 861162907e67a4deae54c92c47f97fbaef7fd6ee | [
"MIT"
] | null | null | null | codewriter.py | 42ip/animatedStickersDB | 861162907e67a4deae54c92c47f97fbaef7fd6ee | [
"MIT"
] | 3 | 2021-09-18T15:34:58.000Z | 2022-02-13T18:27:53.000Z | # DEPRECIATED
# loop to add emojis to the .json file.
import json,sys,os
d = dict()
# The custom code will appear on the output.txt file. just copy and paste into the place
with open(sys.path[0] + '/stickers.json', 'r+') as openfile:
# Reading from json file
json_object = json.load(openfile)
d = json_object... | 34.366197 | 212 | 0.562295 |
3e57b7c5ebab9146913ac69009664acd049ec3e6 | 3,784 | py | Python | MuPythonLibrary/TPM/Tpm2Stream.py | matthewfcarlson/mu_pip_python_library | 659538b80fd5c060e053e14a828d9d41161682a1 | [
"BSD-2-Clause"
] | 8 | 2019-10-05T09:06:39.000Z | 2022-03-11T10:45:12.000Z | MuPythonLibrary/TPM/Tpm2Stream.py | matthewfcarlson/mu_pip_python_library | 659538b80fd5c060e053e14a828d9d41161682a1 | [
"BSD-2-Clause"
] | 3 | 2018-12-14T21:14:17.000Z | 2019-04-18T20:26:55.000Z | MuPythonLibrary/TPM/Tpm2Stream.py | matthewfcarlson/mu_pip_python_library | 659538b80fd5c060e053e14a828d9d41161682a1 | [
"BSD-2-Clause"
] | 8 | 2019-05-10T19:18:39.000Z | 2022-03-11T10:45:09.000Z | # @file Tpm2Stream.py
# This file contains utility classes to help marshal and unmarshal data to/from the TPM.
#
##
# Copyright (c) 2017, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | 33.785714 | 102 | 0.686839 |
0b30d226460ed8ef2b4bb8579974c11c798bafa3 | 9,406 | py | Python | game_map/cellular_automata.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | game_map/cellular_automata.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | game_map/cellular_automata.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | import arcade
import random
import math
from functools import wraps
import time
from constants import *
def stop_watch(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
elapsed_time = time.time() - start
print(f"{func.__name__}... | 30.738562 | 112 | 0.520625 |
45fb289da7e440d74d682b50cbe5f6281a25523c | 2,275 | py | Python | tools/sentencesplit.py | UCLA-BD2K/BRAT | 675e81bfcb1b504678a32d70a560c44ee5bfff1d | [
"CC-BY-3.0"
] | 20 | 2015-01-26T01:39:44.000Z | 2020-05-30T19:04:14.000Z | tools/sentencesplit.py | UCLA-BD2K/BRAT | 675e81bfcb1b504678a32d70a560c44ee5bfff1d | [
"CC-BY-3.0"
] | 7 | 2020-06-18T15:21:48.000Z | 2022-03-02T05:02:45.000Z | tools/sentencesplit.py | UCLA-BD2K/BRAT | 675e81bfcb1b504678a32d70a560c44ee5bfff1d | [
"CC-BY-3.0"
] | 13 | 2015-01-26T01:39:45.000Z | 2022-03-09T16:45:09.000Z | #!/usr/bin/env python
'''
Basic sentence splitter using brat segmentation to add newlines to
input text at likely sentence boundaries.
'''
import sys
from os.path import join as path_join
from os.path import dirname
# Assuming this script is found in the brat tools/ directory ...
from sys import path as sys_path
sys... | 29.934211 | 139 | 0.632088 |
37091d7c1519a80fa780d38185774d3d1f1229c6 | 196 | py | Python | gym_grid_driving_ray/__init__.py | thefatbandit/multi-agent-driving | 0f5787672b2e8d4aa5ac0f88003a46ab3c1a0fb2 | [
"MIT"
] | null | null | null | gym_grid_driving_ray/__init__.py | thefatbandit/multi-agent-driving | 0f5787672b2e8d4aa5ac0f88003a46ab3c1a0fb2 | [
"MIT"
] | null | null | null | gym_grid_driving_ray/__init__.py | thefatbandit/multi-agent-driving | 0f5787672b2e8d4aa5ac0f88003a46ab3c1a0fb2 | [
"MIT"
] | null | null | null | import logging
from gym.envs.registration import register
logger = logging.getLogger(__name__)
register(
id='GridDriving-ray-v0',
entry_point='gym_grid_driving_ray.envs:GridDrivingEnv'
) | 21.777778 | 58 | 0.790816 |
2ef28f2f31edc647e8f11ed01e0053773398ebb7 | 81 | py | Python | src/sage/tests/french_book/__init__.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/sage/geometry/riemannian_manifolds/__init__.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/geometry/riemannian_manifolds/__init__.py | dimpase/sage | 468f23815ade42a2192b0a9cd378de8fdc594dcd | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | # This comment is here so the file is non-empty (so Mercurial will check it in).
| 40.5 | 80 | 0.740741 |
e5943201a2d5341fee99c319274a355207960ef3 | 527 | py | Python | app.py | AbstractMonkey/flask_test | 84a983c204234f471420a5041c28400c1193f762 | [
"MIT"
] | null | null | null | app.py | AbstractMonkey/flask_test | 84a983c204234f471420a5041c28400c1193f762 | [
"MIT"
] | null | null | null | app.py | AbstractMonkey/flask_test | 84a983c204234f471420a5041c28400c1193f762 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
@app.route('/weather')
def weather():
w = 78
w -= 10
if w > 65 and w < 90:
data = {"message": "It's nice outside"}
elif w > 45 and w < 66:
data = {"message": "It's o... | 20.269231 | 73 | 0.58444 |
0b866120ca665569c0528f33e690c8ff1c85c15a | 6,810 | py | Python | env/lib/python3.8/site-packages/social_core/backends/azuread_b2c.py | Vee245/dukapepedj | 8525166b38c8f74dc8d62a2fdf1905c32793efcd | [
"MIT"
] | null | null | null | env/lib/python3.8/site-packages/social_core/backends/azuread_b2c.py | Vee245/dukapepedj | 8525166b38c8f74dc8d62a2fdf1905c32793efcd | [
"MIT"
] | null | null | null | env/lib/python3.8/site-packages/social_core/backends/azuread_b2c.py | Vee245/dukapepedj | 8525166b38c8f74dc8d62a2fdf1905c32793efcd | [
"MIT"
] | null | null | null | """
Copyright (c) 2018 Noderabbit Inc., d.b.a. Appsembler
All rights reserved.
MIT License
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 r... | 35.842105 | 108 | 0.64699 |
1abfa8181f8832e12a236c522b43a4f566cdde82 | 2,232 | py | Python | plotly/validators/scattercarpet/marker/colorbar/_tickformatstops.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/scattercarpet/marker/colorbar/_tickformatstops.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | null | null | null | plotly/validators/scattercarpet/marker/colorbar/_tickformatstops.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class TickformatstopsValidator(
_plotly_utils.basevalidators.CompoundArrayValidator
):
def __init__(
self,
plotly_name='tickformatstops',
parent_name='scattercarpet.marker.colorbar',
**kwargs
):
super(TickformatstopsValidator, se... | 40.581818 | 63 | 0.56586 |
edb1bf68dfb5ebd1e098715abee7d66de24823bc | 5,650 | py | Python | isi_sdk_8_2_0/isi_sdk_8_2_0/models/drives_drive_firmware_update.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/drives_drive_firmware_update.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/drives_drive_firmware_update.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_0.models.drives_... | 31.741573 | 142 | 0.608673 |
096db180792048d5636dd260aefd96ef77c52d40 | 6,398 | py | Python | misc/send-umb-iib-notifier.py | ppitonak/umb | 89b0d32d3867f9f489ee8a442a1faf7e04c52f45 | [
"Apache-2.0"
] | null | null | null | misc/send-umb-iib-notifier.py | ppitonak/umb | 89b0d32d3867f9f489ee8a442a1faf7e04c52f45 | [
"Apache-2.0"
] | null | null | null | misc/send-umb-iib-notifier.py | ppitonak/umb | 89b0d32d3867f9f489ee8a442a1faf7e04c52f45 | [
"Apache-2.0"
] | 2 | 2021-08-16T14:18:59.000Z | 2021-08-25T14:52:41.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to send a umb message to be plugged in a finally task"""
import argparse
import json
import os
import subprocess
import sys
import typing
import urllib.request
import datetime
import uuid
class UMBNotificationError(Exception):
"""Custom exception when we f... | 34.961749 | 137 | 0.59503 |
2d237afa98db4b9a0cae184889d5e486b3b12991 | 3,832 | py | Python | cohesity_management_sdk/models/sqlaag_host_and_databases.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/sqlaag_host_and_databases.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/sqlaag_host_and_databases.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.aag_and_databases
import cohesity_management_sdk.models.node_in_a_protection_sources_tree
import cohesity_management_sdk.models.protection_source
class SQLAAGHostAndDatabases(object):
"""Implementation of the 'SQL AAG Ho... | 39.916667 | 218 | 0.668319 |
afc9b9bfb9f5106de308fdcb52fcce23527d7e57 | 4,982 | py | Python | angr/exploration_techniques/__init__.py | ecoppa/angr | 91ff545eb19d09ed6196ec3bf7ad4e10e0a37ca5 | [
"BSD-2-Clause"
] | null | null | null | angr/exploration_techniques/__init__.py | ecoppa/angr | 91ff545eb19d09ed6196ec3bf7ad4e10e0a37ca5 | [
"BSD-2-Clause"
] | null | null | null | angr/exploration_techniques/__init__.py | ecoppa/angr | 91ff545eb19d09ed6196ec3bf7ad4e10e0a37ca5 | [
"BSD-2-Clause"
] | 1 | 2022-02-03T20:06:20.000Z | 2022-02-03T20:06:20.000Z | from ..errors import SimError
class ExplorationTechnique(object):
"""
An otiegnqwvk is a set of hooks for a simulation manager that assists in the implementation of new techniques in
symbolic exploration.
TODO: choose actual name for the functionality (techniques? strategies?)
Any number of these... | 40.177419 | 164 | 0.655159 |
48a6d7ff3d9a1147b54a47ec45a19e0ca3c3da16 | 3,702 | py | Python | source/hsicbt/task/task_varieddim.py | choasma/HSIC-Bottleneck | 9f1fe2447592d61c0ba524aad0ff0820ae2ba9cb | [
"MIT"
] | 49 | 2019-12-05T03:03:43.000Z | 2022-02-23T13:12:02.000Z | source/hsicbt/task/task_varieddim.py | choasma/HSIC-Bottleneck | 9f1fe2447592d61c0ba524aad0ff0820ae2ba9cb | [
"MIT"
] | 10 | 2020-04-02T22:22:02.000Z | 2020-12-19T04:36:27.000Z | source/hsicbt/task/task_varieddim.py | choasma/HSIC-Bottleneck | 9f1fe2447592d61c0ba524aad0ff0820ae2ba9cb | [
"MIT"
] | 18 | 2020-01-18T00:17:11.000Z | 2022-01-13T10:07:55.000Z | from . import *
def plot_varieddim_result(config_dict):
try:
out_standard_batch_001 = load_logs(get_log_filepath(
config_dict['task'], TTYPE_FORMAT, config_dict['data_code'], 1))['batch_log_list']
out_standard_batch_005 = load_logs(get_log_filepath(
config_dict['task'], TTY... | 41.133333 | 128 | 0.634522 |
edf7f7ddb08e00f4c72a9556b4eed346dd5a96ac | 10,888 | py | Python | Team7/parser.py | paralysedforce/Recipe-Project | 35336252f0629c1879e1c55238b6be451f4cf603 | [
"MIT"
] | 1 | 2016-03-15T01:49:33.000Z | 2016-03-15T01:49:33.000Z | Team7/parser.py | paralysedforce/Recipe-Project | 35336252f0629c1879e1c55238b6be451f4cf603 | [
"MIT"
] | null | null | null | Team7/parser.py | paralysedforce/Recipe-Project | 35336252f0629c1879e1c55238b6be451f4cf603 | [
"MIT"
] | null | null | null | #!usr/bin/python
from data import *
import scrape
import sys
#from collections import namedtuple
from string import punctuation
import re
import nltk
from pymongo import MongoClient
import recipe_classes
import reconstruction
import transform
client = MongoClient()
db = client["k_base"]
# Quantity = namedtuple("Qua... | 34.675159 | 100 | 0.558597 |
832e7208be27188e8ce63f2cc78843b68612bb20 | 414 | py | Python | neurospyke/__init__.py | RebeccaClarkson/NeuroSpyke | 750090062939738add8bc20a1ee3cae768a66d58 | [
"FSFAP"
] | null | null | null | neurospyke/__init__.py | RebeccaClarkson/NeuroSpyke | 750090062939738add8bc20a1ee3cae768a66d58 | [
"FSFAP"
] | null | null | null | neurospyke/__init__.py | RebeccaClarkson/NeuroSpyke | 750090062939738add8bc20a1ee3cae768a66d58 | [
"FSFAP"
] | null | null | null | # set up module defaults across project
import numpy as np
print("Setting defaults for numpy")
np.set_printoptions(precision=2, linewidth=40, suppress=True)
import matplotlib as mpl
print("Setting defaults for matplotlib")
mpl.use('TkAgg')
mpl.rcParams['axes.spines.right'] = False
mpl.rcParams['axes.spines.top'] = F... | 25.875 | 61 | 0.770531 |
7941033c88397f8adf0c96551952397941d27dd0 | 495 | py | Python | registration/forms.py | timgates42/timestrap | 744ebcb0cd5fc536245c18058236169f4f36cb8b | [
"BSD-2-Clause"
] | 1,758 | 2017-04-21T08:42:59.000Z | 2022-03-09T22:58:53.000Z | registration/forms.py | timgates42/timestrap | 744ebcb0cd5fc536245c18058236169f4f36cb8b | [
"BSD-2-Clause"
] | 172 | 2017-04-23T21:30:03.000Z | 2022-02-10T20:10:06.000Z | registration/forms.py | timgates42/timestrap | 744ebcb0cd5fc536245c18058236169f4f36cb8b | [
"BSD-2-Clause"
] | 138 | 2017-04-23T23:02:16.000Z | 2022-03-25T04:44:19.000Z | from django.contrib.auth.forms import PasswordResetForm
from conf.models import Site
from conf.utils import current_site_id
class TimestrapPasswordResetForm(PasswordResetForm):
"""
Override the 'domain' and 'site_name' email context variables to use the
current site.
"""
def save(self, **kwargs)... | 29.117647 | 87 | 0.705051 |
d83ebc8d48c8223b3cc422c5a57fc1c8d5c90505 | 2,927 | py | Python | tests/integration/frameworks/test_torchscript_impl.py | matheusMoreno/BentoML | 4c139142fae486ba1ccf6b24e89505c030e3df3f | [
"Apache-2.0"
] | null | null | null | tests/integration/frameworks/test_torchscript_impl.py | matheusMoreno/BentoML | 4c139142fae486ba1ccf6b24e89505c030e3df3f | [
"Apache-2.0"
] | null | null | null | tests/integration/frameworks/test_torchscript_impl.py | matheusMoreno/BentoML | 4c139142fae486ba1ccf6b24e89505c030e3df3f | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import pytest
import torch.nn as nn
import bentoml
from tests.utils.helpers import assert_have_file_extension
from tests.utils.frameworks.pytorch_utils import test_df
from tests.utils.frameworks.pytorch_utils import predict_df
from tests.utils.frameworks.pytorch_utils import LinearModel... | 31.815217 | 83 | 0.703109 |
2d4a5fe0c8e888a47da9ae2365c8adb59f34216c | 1,072 | py | Python | test/test_tmep_integration.py | Josef-Friedrich/mutagen-renamer | 3df494f04dc74b4ed5a70150502756ba80a81cd4 | [
"MIT"
] | 6 | 2020-03-09T10:23:32.000Z | 2022-03-14T21:29:15.000Z | test/test_tmep_integration.py | Josef-Friedrich/mutagen-renamer | 3df494f04dc74b4ed5a70150502756ba80a81cd4 | [
"MIT"
] | 10 | 2022-02-02T17:09:08.000Z | 2022-03-23T22:19:47.000Z | test/test_tmep_integration.py | Josef-Friedrich/mutagen-renamer | 3df494f04dc74b4ed5a70150502756ba80a81cd4 | [
"MIT"
] | 1 | 2022-02-06T14:06:30.000Z | 2022-02-06T14:06:30.000Z | """Test the integration of the python package “tmep”."""
import unittest
import helper
class TestFunctions(unittest.TestCase):
def test_ifdefempty_empty_existent_field(self):
out = helper.call_bin('--dry-run', '--format',
'%ifdefempty{mb_workid,_empty_,_notempty_}',
... | 35.733333 | 74 | 0.576493 |
c8a2793e61fe3a7d19043419ada42edc90cb5228 | 7,448 | py | Python | setup.py | jawaff/python-sfml | 135d95d7da45478b352771073bf73789997e9047 | [
"Zlib"
] | 2 | 2018-10-24T15:40:41.000Z | 2018-12-16T12:34:24.000Z | setup.py | jawaff/python-sfml | 135d95d7da45478b352771073bf73789997e9047 | [
"Zlib"
] | null | null | null | setup.py | jawaff/python-sfml | 135d95d7da45478b352771073bf73789997e9047 | [
"Zlib"
] | null | null | null | import sys, os, platform
import os.path, shutil
from glob import glob
import versioneer
from subprocess import call
from setuptools import setup, Command, Extension
try:
from Cython.Distutils import build_ext
except ImportError:
print("Please install cython and try again.")
raise SystemExit
if platform.ar... | 41.377778 | 238 | 0.62312 |
203ceca59e5438cfaaba24a8cca3330f82881a39 | 4,463 | py | Python | gjnn/lda.py | gnebbia/gj-deep-forecasts | ce8cfa74ee3e2b8b77fa5fb3e674070b5a0c5423 | [
"BSD-3-Clause"
] | null | null | null | gjnn/lda.py | gnebbia/gj-deep-forecasts | ce8cfa74ee3e2b8b77fa5fb3e674070b5a0c5423 | [
"BSD-3-Clause"
] | null | null | null | gjnn/lda.py | gnebbia/gj-deep-forecasts | ce8cfa74ee3e2b8b77fa5fb3e674070b5a0c5423 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import re
import gensim
from nltk.tokenize import RegexpTokenizer
from stop_words import get_stop_words
from nltk.stem.porter import PorterStemmer
from gensim import corpora, models
import logging
logger = logging.getLogger(__name__)
# create sample documents
def get_questions_text(questions_df... | 31.878571 | 108 | 0.674434 |
79ab1e99e2e577b818c358facb36fb94379026a2 | 801 | py | Python | python/code_challenges/class_30/test_hash.py | Leenhazaimeh/data-structures-and-algorithms | d55d55bf8c98e768cb929326b5ec8c18fb5c8384 | [
"MIT"
] | null | null | null | python/code_challenges/class_30/test_hash.py | Leenhazaimeh/data-structures-and-algorithms | d55d55bf8c98e768cb929326b5ec8c18fb5c8384 | [
"MIT"
] | 10 | 2021-07-29T18:56:48.000Z | 2021-09-11T19:11:00.000Z | python/code_challenges/class_30/test_hash.py | Leenhazaimeh/data-structures-and-algorithms | d55d55bf8c98e768cb929326b5ec8c18fb5c8384 | [
"MIT"
] | 3 | 2021-08-16T06:16:37.000Z | 2021-12-05T14:29:51.000Z | import pytest
from hash_tabel import *
def test_hashtable():
test=HashTable()
test.add("hash",3333)
test.add("tabel",4444)
return test
def test_add():
test=HashTable()
test.add("map",5555)
assert test.contains('map')==True
def test_hash():
test=HashTable()
assert test.hash("leen")==700... | 19.071429 | 35 | 0.672909 |
cee989bc2bb9eefb24a90e6640f54a1389214631 | 3,642 | py | Python | dogpile/cache/backends/memory.py | SandySalvatore/dogpile_cache_release | 863b35becbf741bba89ddbf2700b7667298bf3d3 | [
"BSD-3-Clause"
] | 152 | 2015-01-06T00:56:19.000Z | 2022-03-11T21:08:32.000Z | dogpile/cache/backends/memory.py | SandySalvatore/dogpile_cache_release | 863b35becbf741bba89ddbf2700b7667298bf3d3 | [
"BSD-3-Clause"
] | 25 | 2015-01-19T15:57:43.000Z | 2020-06-29T08:51:22.000Z | dogpile/cache/backends/memory.py | SandySalvatore/dogpile_cache_release | 863b35becbf741bba89ddbf2700b7667298bf3d3 | [
"BSD-3-Clause"
] | 34 | 2015-02-10T01:45:14.000Z | 2022-01-03T13:52:35.000Z | """
Memory Backends
---------------
Provides simple dictionary-based backends.
The two backends are :class:`.MemoryBackend` and :class:`.MemoryPickleBackend`;
the latter applies a serialization step to cached values while the former
places the value as given into the dictionary.
"""
from dogpile.cache.api import Ca... | 29.609756 | 79 | 0.644701 |
7b6aafb9ee7cd5ec4f3dc385c93e4f53fdd99ca3 | 145 | py | Python | pycs/misc/types.py | sfarrens/cosmostat | a475315cda06dca346095a1e83cb6ad23979acae | [
"MIT"
] | 3 | 2021-02-09T05:03:24.000Z | 2021-11-26T10:20:02.000Z | pycs/misc/types.py | sfarrens/cosmostat | a475315cda06dca346095a1e83cb6ad23979acae | [
"MIT"
] | 8 | 2020-04-28T17:09:50.000Z | 2022-02-01T16:24:43.000Z | pycs/misc/types.py | sfarrens/cosmostat | a475315cda06dca346095a1e83cb6ad23979acae | [
"MIT"
] | 3 | 2020-06-22T07:53:00.000Z | 2021-02-10T19:59:53.000Z | # -*- coding: utf-8 -*-
"""TYPE HANDLING ROUTINES
This module contains methods for handing object types.
"""
from modopt.base.types import *
| 14.5 | 54 | 0.696552 |
fce135424f62df8a659f9049811ce07a6bd607ea | 5,753 | py | Python | tests/rough_clustering_tests.py | geofizx/rough-clustering | 9ab5da8bbc26fc062a15fe9732c3fadac9e77fdf | [
"MIT"
] | 6 | 2019-10-28T12:14:42.000Z | 2021-11-28T18:17:00.000Z | tests/rough_clustering_tests.py | geofizx/rough-clustering | 9ab5da8bbc26fc062a15fe9732c3fadac9e77fdf | [
"MIT"
] | null | null | null | tests/rough_clustering_tests.py | geofizx/rough-clustering | 9ab5da8bbc26fc062a15fe9732c3fadac9e77fdf | [
"MIT"
] | 3 | 2020-12-28T01:54:14.000Z | 2021-11-28T18:17:13.000Z | #!/usr/bin/env python2.7
# encoding: utf-8
"""
Some unit tests and usage examples for rough set clustering class
@data UCI Statlog Data Set:
Lichman, M. (2013). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA:
University of California, School of Information and Computer Science.
@author M... | 37.357143 | 110 | 0.678429 |
47647450eb011c1188dc4a11fa1f2dcfe3a2f996 | 2,588 | py | Python | utils/boolmask.py | rdjdejong/attention-learn-to-route | 3b6bbdad677a36df53eabad98b48f436be298ac8 | [
"MIT"
] | 540 | 2019-02-07T13:52:30.000Z | 2022-03-31T12:51:46.000Z | utils/boolmask.py | rdjdejong/attention-learn-to-route | 3b6bbdad677a36df53eabad98b48f436be298ac8 | [
"MIT"
] | 40 | 2019-02-06T17:57:11.000Z | 2022-03-18T12:18:48.000Z | utils/boolmask.py | rdjdejong/attention-learn-to-route | 3b6bbdad677a36df53eabad98b48f436be298ac8 | [
"MIT"
] | 227 | 2019-02-15T09:25:02.000Z | 2022-03-27T10:42:21.000Z | import torch
import torch.nn.functional as F
def _pad_mask(mask):
# By taking -size % 8, we get 0 if exactly divisible by 8
# and required padding otherwise (i.e. -1 % 8 = 7 pad)
pad = -mask.size(-1) % 8
if pad != 0:
mask = F.pad(mask, [0, pad])
return mask, mask.size(-1) // 8
def _mask_... | 37.507246 | 131 | 0.633694 |
60079817ffc58cc52c07c3f012e1d15ed0823580 | 37,718 | py | Python | kornia/geometry/transform/affwarp.py | NickleDave/kornia | 5392651d0bc268da577fa0a49aa50f957289c7dd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/geometry/transform/affwarp.py | NickleDave/kornia | 5392651d0bc268da577fa0a49aa50f957289c7dd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/geometry/transform/affwarp.py | NickleDave/kornia | 5392651d0bc268da577fa0a49aa50f957289c7dd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from typing import Union, Tuple, Optional
import torch
import torch.nn as nn
from kornia.geometry.transform.imgwarp import (
warp_affine, get_rotation_matrix2d, get_affine_matrix2d
)
from kornia.geometry.transform.projwarp import (
warp_affine3d, get_projective_transform
)
from kornia.utils import _extract_de... | 41.176856 | 120 | 0.619147 |
5202583833fbf8d07924e1f7355781ee7957dd0e | 182,169 | py | Python | tensorflow/python/framework/ops.py | DHsLc/test | f286c78b619b81ca95ba9f738cc0de4e14440e44 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/ops.py | DHsLc/test | f286c78b619b81ca95ba9f738cc0de4e14440e44 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/ops.py | DHsLc/test | f286c78b619b81ca95ba9f738cc0de4e14440e44 | [
"Apache-2.0"
] | null | null | null | # 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... | 35.852982 | 115 | 0.678387 |
31015490c79dc62d2fa9feae8734845e23f815be | 2,258 | py | Python | nml/cfg_lauer17rse/cfg_lc_ESACCI.py | c3s-magic/ESMValTool | 799150e4784f334262755a39022c72b2d39585c9 | [
"Apache-2.0"
] | null | null | null | nml/cfg_lauer17rse/cfg_lc_ESACCI.py | c3s-magic/ESMValTool | 799150e4784f334262755a39022c72b2d39585c9 | [
"Apache-2.0"
] | null | null | null | nml/cfg_lauer17rse/cfg_lc_ESACCI.py | c3s-magic/ESMValTool | 799150e4784f334262755a39022c72b2d39585c9 | [
"Apache-2.0"
] | 2 | 2017-03-24T04:18:09.000Z | 2020-12-19T06:04:05.000Z | # This is a config file for CCI data and CMIP5 land cover diagnostics
# key list of data sets from CCI and CMIP, depracted
#could be written automatically? It's a copy of namelist_lc_ESACCI.xml with smaller changes
#translatorlist={ 'bare soil' : [['Bare_Soil'],['bare soil']],
# 'natural grass' : [['Na... | 46.081633 | 284 | 0.711692 |
cafb2d926f42656153980ecebb195a295258e7d8 | 1,865 | py | Python | atss_core/modeling/roi_heads/keypoint_head/roi_keypoint_feature_extractors.py | Odin-son/ATSS | b6acccae1d06dfd8e4ee743b8f446e3e82938c15 | [
"BSD-2-Clause"
] | 1,039 | 2019-12-05T14:56:22.000Z | 2022-03-30T05:44:49.000Z | atss_core/modeling/roi_heads/keypoint_head/roi_keypoint_feature_extractors.py | ObjectDetection/ATSS | e111ee9927b408c5a762d356be4bd08f63f04468 | [
"BSD-2-Clause"
] | 96 | 2019-12-06T01:37:37.000Z | 2022-03-11T10:23:37.000Z | atss_core/modeling/roi_heads/keypoint_head/roi_keypoint_feature_extractors.py | ObjectDetection/ATSS | e111ee9927b408c5a762d356be4bd08f63f04468 | [
"BSD-2-Clause"
] | 174 | 2019-12-06T01:42:25.000Z | 2022-03-28T02:57:55.000Z | from torch import nn
from torch.nn import functional as F
from atss_core.modeling import registry
from atss_core.modeling.poolers import Pooler
from atss_core.layers import Conv2d
@registry.ROI_KEYPOINT_FEATURE_EXTRACTORS.register("KeypointRCNNFeatureExtractor")
class KeypointRCNNFeatureExtractor(nn.Module):
de... | 36.568627 | 87 | 0.694906 |
5ca400ce6f503631ddad505e1cae01323eab1e1e | 2,235 | py | Python | no_PII_Storage_folder.py | jyoonkim/Test | c822ff057c48b10afe59146b434a2ac3db0dd712 | [
"MIT"
] | null | null | null | no_PII_Storage_folder.py | jyoonkim/Test | c822ff057c48b10afe59146b434a2ac3db0dd712 | [
"MIT"
] | null | null | null | no_PII_Storage_folder.py | jyoonkim/Test | c822ff057c48b10afe59146b434a2ac3db0dd712 | [
"MIT"
] | null | null | null | import os
import hashlib
def hash_username(n):
"""Return the digest of a hashed username using RSA's MD5 algorithm
:param n: The username to hash
:returns: The hashed usernames digest
:rtype: String
"""
return hashlib.md5(n.encode('utf-8')).hexdigest()
def hash_column(df_column):
"""Hash... | 27.592593 | 74 | 0.597763 |
e28c5e420c69b16bc7ec2d662dc08a28931ff17e | 4,937 | py | Python | zerver/lib/exceptions.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | zerver/lib/exceptions.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | 15 | 2020-06-05T18:44:15.000Z | 2022-03-11T23:26:03.000Z | zerver/lib/exceptions.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from enum import Enum
from typing import Any, Dict, List, Optional, Text, Type
from django.core.exceptions import PermissionDenied
class AbstractEnum(Enum):
'''An enumeration whose members are used strictly for their names.'''
def __new__(cls):
# type: (Type[Abs... | 32.267974 | 83 | 0.616366 |
23a078ce7f3ad5802f663fe637776cccbb2d74ff | 405 | py | Python | Codes/Advance python/enum.py | shohan4556/machine-learning-course-notes | 981f3d6e9861cbee0f4dec45b1d2e6a214d2a051 | [
"MIT"
] | 8 | 2019-10-12T17:08:58.000Z | 2020-02-26T02:54:01.000Z | Codes/Advance python/enum.py | shohan4556/machine-learning-course-notes | 981f3d6e9861cbee0f4dec45b1d2e6a214d2a051 | [
"MIT"
] | null | null | null | Codes/Advance python/enum.py | shohan4556/machine-learning-course-notes | 981f3d6e9861cbee0f4dec45b1d2e6a214d2a051 | [
"MIT"
] | 5 | 2019-10-30T03:50:20.000Z | 2020-07-11T20:53:47.000Z | # Create a list of strings: mutants
mutants = ['charles xavier',
'bobby drake',
'kurt wagner',
'max eisenhardt',
'kitty pryde']
# Create a list of tuples: mutant_list
mutant_list = enumerate(mutants)
print(mutant_list)
for index1, index2 in enumerate(mutants):
... | 23.823529 | 43 | 0.617284 |
ebe55198f20cd9636efaba277d7c6cd26762ab33 | 744 | py | Python | mvp/mvp/presenters/main_presenter.py | 2110521-2563-1-Software-Architecture/four-guys-one-cup-assignment3 | fb771f7521a15aea5c5b563ff87dbcd83edbec77 | [
"MIT"
] | null | null | null | mvp/mvp/presenters/main_presenter.py | 2110521-2563-1-Software-Architecture/four-guys-one-cup-assignment3 | fb771f7521a15aea5c5b563ff87dbcd83edbec77 | [
"MIT"
] | null | null | null | mvp/mvp/presenters/main_presenter.py | 2110521-2563-1-Software-Architecture/four-guys-one-cup-assignment3 | fb771f7521a15aea5c5b563ff87dbcd83edbec77 | [
"MIT"
] | null | null | null | from typing import List
from mvp.contracts.main_contract import MainContract
from mvp.models.repositories.note_repository import NoteRepository
from mvp.models.entities.note import Note
class MainPresenter(MainContract.Presenter):
def __init__(self, view: MainContract.View, note_repository: NoteRepository):
... | 32.347826 | 81 | 0.747312 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.