hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f757b4ff43c7357ceccff82978a2f520f9824c56 | 5,384 | py | Python | c-dfs.py | ZhenoSan/DistributedFileSystem | 8776e0ecffcc06ea213603ad0ca202e15595297c | [
"MIT"
] | 1 | 2021-03-01T08:49:26.000Z | 2021-03-01T08:49:26.000Z | c-dfs.py | ZhenoSan/DistributedFileSystem | 8776e0ecffcc06ea213603ad0ca202e15595297c | [
"MIT"
] | null | null | null | c-dfs.py | ZhenoSan/DistributedFileSystem | 8776e0ecffcc06ea213603ad0ca202e15595297c | [
"MIT"
] | null | null | null | import socket, threading, os, struct,selectors#,atexit
from pathlib import Path
from tkinter import *
import queue # thread-safe
Q = queue.Queue()
sel = selectors.DefaultSelector()
serv_fd = None
CLIENT_PORT = 9999
MAX_MSG = 4096
last_cmd = ''
last_print = ''
class CleanExit:
pass
class TextEditor:
#@staticmetho... | 25.760766 | 70 | 0.57188 | import socket, threading, os, struct,selectors
from pathlib import Path
from tkinter import *
import queue
Q = queue.Queue()
sel = selectors.DefaultSelector()
serv_fd = None
CLIENT_PORT = 9999
MAX_MSG = 4096
last_cmd = ''
last_print = ''
class CleanExit:
pass
class TextEditor:
def quit_app(self, event=None):
... | true | true |
f757b60320f3a3b289b2c9b6118f987874439a28 | 1,245 | py | Python | numpy/fft/tests/test_helper.py | enthought/numpy-refactor | c6ca75110acf6d90a75b563bcee17cf1ab37be98 | [
"BSD-3-Clause"
] | 7 | 2016-11-29T18:01:53.000Z | 2018-08-21T09:45:15.000Z | numpy/fft/tests/test_helper.py | plaes/numpy | 209866bc55eee56e92692307c4437af024bae87d | [
"BSD-3-Clause"
] | 1 | 2016-06-28T14:03:59.000Z | 2016-06-28T14:03:59.000Z | numpy/fft/tests/test_helper.py | plaes/numpy | 209866bc55eee56e92692307c4437af024bae87d | [
"BSD-3-Clause"
] | 3 | 2016-10-19T00:41:31.000Z | 2020-03-01T04:57:36.000Z | #!/usr/bin/env python
# Copied from fftpack.helper by Pearu Peterson, October 2005
""" Test functions for fftpack.helper module
"""
from numpy.testing import *
from numpy.fft import fftshift,ifftshift,fftfreq
from numpy import pi
def random(size):
return rand(*size)
class TestFFTShift(TestCase):
def test_de... | 28.953488 | 63 | 0.624096 |
from numpy.testing import *
from numpy.fft import fftshift,ifftshift,fftfreq
from numpy import pi
def random(size):
return rand(*size)
class TestFFTShift(TestCase):
def test_definition(self):
x = [0,1,2,3,4,-4,-3,-2,-1]
y = [-4,-3,-2,-1,0,1,2,3,4]
assert_array_almost_equal(fftshift... | true | true |
f757b61324ce321cbfb3ddc69bb19b3f632b6213 | 1,255 | py | Python | citizen.py | thesquaregroot/election-simulation | cc1725b0b8154527ecf6ca7356af1e44771f27bd | [
"MIT"
] | 3 | 2018-06-20T04:01:37.000Z | 2022-03-01T19:16:21.000Z | citizen.py | thesquaregroot/election-simulation | cc1725b0b8154527ecf6ca7356af1e44771f27bd | [
"MIT"
] | null | null | null | citizen.py | thesquaregroot/election-simulation | cc1725b0b8154527ecf6ca7356af1e44771f27bd | [
"MIT"
] | null | null | null | import math
class Citizen:
def __init__(self, economicPosition, socialPosition):
self.economicPosition = economicPosition
self.socialPosition = socialPosition
def vote(self, politicians):
vote = (0, None)
for politician in politicians:
score = self._score(politician... | 40.483871 | 126 | 0.676494 | import math
class Citizen:
def __init__(self, economicPosition, socialPosition):
self.economicPosition = economicPosition
self.socialPosition = socialPosition
def vote(self, politicians):
vote = (0, None)
for politician in politicians:
score = self._score(politician... | true | true |
f757b68904017fb96c5587ea4e5d55543bbed12e | 7,999 | py | Python | SPConvNets/models/pointnet_epn_netvlad.py | chienerh/EPN_PointCloud | d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30 | [
"MIT"
] | null | null | null | SPConvNets/models/pointnet_epn_netvlad.py | chienerh/EPN_PointCloud | d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30 | [
"MIT"
] | null | null | null | SPConvNets/models/pointnet_epn_netvlad.py | chienerh/EPN_PointCloud | d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30 | [
"MIT"
] | null | null | null | """
Code taken from https://github.com/cattaneod/PointNetVlad-Pytorch/blob/master/models/PointNetVlad.py
"""
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
i... | 41.020513 | 138 | 0.580948 |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
import math
import SPConvNets.models.pr_so3net_pn as pr_so3net_pn
import SPConvNets.utils as M
class STN3d(n... | true | true |
f757b7c1200edc57156bb4e472ccea1fb73eddae | 4,054 | py | Python | pyxlpr/ppocr/postprocess/pse_postprocess/pse_postprocess.py | XLPRUtils/pyUtils | 3a62c14b0658ad3c24d83f953ee0d88530b02b23 | [
"Apache-2.0"
] | null | null | null | pyxlpr/ppocr/postprocess/pse_postprocess/pse_postprocess.py | XLPRUtils/pyUtils | 3a62c14b0658ad3c24d83f953ee0d88530b02b23 | [
"Apache-2.0"
] | null | null | null | pyxlpr/ppocr/postprocess/pse_postprocess/pse_postprocess.py | XLPRUtils/pyUtils | 3a62c14b0658ad3c24d83f953ee0d88530b02b23 | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | 34.067227 | 76 | 0.566848 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import cv2
import paddle
from paddle.nn import functional as F
from pyxlpr.ppocr.postprocess.pse_postprocess.pse import pse
class PSEPostProcess(object):
def __init__(se... | true | true |
f757b84ba221581b6833e7ccbc4643c61e9f3ea7 | 17,035 | py | Python | iroha/iroha.py | Pawlak00/iroha-python | e7a4ba912a82c2cfa1f0135674ef77c58e88f521 | [
"Apache-2.0"
] | null | null | null | iroha/iroha.py | Pawlak00/iroha-python | e7a4ba912a82c2cfa1f0135674ef77c58e88f521 | [
"Apache-2.0"
] | null | null | null | iroha/iroha.py | Pawlak00/iroha-python | e7a4ba912a82c2cfa1f0135674ef77c58e88f521 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
from . import ed25519
import hashlib
import binascii
import grpc
import time
import re
import os
from . import commands_pb2
from . import endpoint_pb2
from . import endpoint_pb2_grpc
from . import pri... | 40.082353 | 108 | 0.657822 |
from . import ed25519
import hashlib
import binascii
import grpc
import time
import re
import os
from . import commands_pb2
from . import endpoint_pb2
from . import endpoint_pb2_grpc
from . import primitive_pb2
from . import queries_pb2
from . import transaction_pb2
class IrohaCrypto(object):
@staticmetho... | true | true |
f757b85a8eacd58ff0b3f0d6414637d35ce84a9f | 850 | py | Python | slices_to_npz.py | mlaves/imes4d | d1505f75487ced0a10c05f1c937af91ff666e3d4 | [
"MIT"
] | 20 | 2018-05-18T10:59:42.000Z | 2022-03-10T18:03:15.000Z | slices_to_npz.py | mlaves/imes4d | d1505f75487ced0a10c05f1c937af91ff666e3d4 | [
"MIT"
] | null | null | null | slices_to_npz.py | mlaves/imes4d | d1505f75487ced0a10c05f1c937af91ff666e3d4 | [
"MIT"
] | 3 | 2018-03-22T13:25:09.000Z | 2018-03-22T13:47:54.000Z | from imes4d.utils import slices_to_npz
from tqdm import tqdm
if __name__ == "__main__":
with tqdm(total=7) as pbar:
slices_to_npz('/home/laves/Pictures/oct/Kugelplatte/0/*.JPG', 'sb_0.npz')
pbar.update()
slices_to_npz('/home/laves/Pictures/oct/Kugelplatte/1/*.JPG', 'sb_1.npz')
pbar... | 40.47619 | 81 | 0.641176 | from imes4d.utils import slices_to_npz
from tqdm import tqdm
if __name__ == "__main__":
with tqdm(total=7) as pbar:
slices_to_npz('/home/laves/Pictures/oct/Kugelplatte/0/*.JPG', 'sb_0.npz')
pbar.update()
slices_to_npz('/home/laves/Pictures/oct/Kugelplatte/1/*.JPG', 'sb_1.npz')
pbar... | true | true |
f757b86d318a40045a02b597a7a5b1440c54a6c4 | 1,702 | py | Python | app/programs/views.py | rukaury/vsrpapi | 0e9b5d0bdef24028b1fb09c65107765245a05224 | [
"MIT"
] | null | null | null | app/programs/views.py | rukaury/vsrpapi | 0e9b5d0bdef24028b1fb09c65107765245a05224 | [
"MIT"
] | null | null | null | app/programs/views.py | rukaury/vsrpapi | 0e9b5d0bdef24028b1fb09c65107765245a05224 | [
"MIT"
] | null | null | null | import datetime
from flask import Blueprint, request, abort
from app.auth.helper import token_required
from app.programs.helper import response, response_for_program, get_programs_json_list, response_for_programs_list, get_programs, get_single_program
from app.models.user import User
from app.models.program import Prog... | 29.859649 | 148 | 0.699177 | import datetime
from flask import Blueprint, request, abort
from app.auth.helper import token_required
from app.programs.helper import response, response_for_program, get_programs_json_list, response_for_programs_list, get_programs, get_single_program
from app.models.user import User
from app.models.program import Prog... | true | true |
f757b8a47032cc0adedc53d18ad428c19af162aa | 662 | py | Python | April 2021/Longest Valid Parentheses.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Longest Valid Parentheses.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Longest Valid Parentheses.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | class Solution(object):
def longestValidParentheses(self, s):
"""
:type s: str
:rtype: int
"""
def length(it, start, c):
depth, longest = 0, 0
for i in it:
if s[i] == c:
depth += 1
else:
... | 30.090909 | 64 | 0.373112 | class Solution(object):
def longestValidParentheses(self, s):
def length(it, start, c):
depth, longest = 0, 0
for i in it:
if s[i] == c:
depth += 1
else:
depth -= 1
if depth < 0:
... | true | true |
f757b949e869bbb195152a0501d6ea14041ff7ff | 423 | py | Python | user_authentication_drf/asgi.py | Debagboola/User-Authentication-And-Registration-With-Django-Rest-Framework | 45637d73d8f9ee679e96eb8332c27f0ad8b6b3be | [
"MIT"
] | null | null | null | user_authentication_drf/asgi.py | Debagboola/User-Authentication-And-Registration-With-Django-Rest-Framework | 45637d73d8f9ee679e96eb8332c27f0ad8b6b3be | [
"MIT"
] | null | null | null | user_authentication_drf/asgi.py | Debagboola/User-Authentication-And-Registration-With-Django-Rest-Framework | 45637d73d8f9ee679e96eb8332c27f0ad8b6b3be | [
"MIT"
] | null | null | null | """
ASGI config for user_authentication_drf 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.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefau... | 24.882353 | 83 | 0.801418 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'user_authentication_drf.settings')
application = get_asgi_application()
| true | true |
f757ba9d5944e480a4734f0dbb08ff1540ba6495 | 13,714 | py | Python | keras/api/tests/api_compatibility_test.py | code-review-doctor/keras | 96130040540e1405ffe746ddf2b2cceb9b8b8f65 | [
"Apache-2.0"
] | null | null | null | keras/api/tests/api_compatibility_test.py | code-review-doctor/keras | 96130040540e1405ffe746ddf2b2cceb9b8b8f65 | [
"Apache-2.0"
] | null | null | null | keras/api/tests/api_compatibility_test.py | code-review-doctor/keras | 96130040540e1405ffe746ddf2b2cceb9b8b8f65 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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... | 36.96496 | 80 | 0.692285 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import argparse
import os
import re
import sys
import six
from google.protobuf import message
from google.protobuf import text_format
from tensorflow.python.lib.io im... | true | true |
f757bbb502ffc7db2356876cfe47bc8a8d90c0dc | 2,484 | py | Python | images/forms.py | chechons/bookmarks | bbd4de4dbe601743f586ba5d11b8a047f209864b | [
"MIT"
] | 1 | 2021-12-13T17:58:35.000Z | 2021-12-13T17:58:35.000Z | images/forms.py | chechons/bookmarks | bbd4de4dbe601743f586ba5d11b8a047f209864b | [
"MIT"
] | 1 | 2021-12-13T17:51:04.000Z | 2021-12-13T17:51:04.000Z | images/forms.py | chechons/bookmarks | bbd4de4dbe601743f586ba5d11b8a047f209864b | [
"MIT"
] | null | null | null | """
Let's start by building a form to submit new images.
"""
from urllib import request
from django.core.files.base import ContentFile
from django.utils.text import slugify
from django import forms
from .models import Image
class ImageCreateForm(forms.ModelForm):
"""
This form is a ModelFOrm form built from ... | 40.064516 | 82 | 0.654992 | from urllib import request
from django.core.files.base import ContentFile
from django.utils.text import slugify
from django import forms
from .models import Image
class ImageCreateForm(forms.ModelForm):
class Meta:
model = Image
fields = ('title', 'url', 'description')
widgets = {
... | true | true |
f757bd2fbdeb805a9f6da95078028eb41711e495 | 6,371 | py | Python | examples/vae/train_vae.py | belldandyxtq/chainer | abffa9a7def07c2e6bcd79d8ddcebeed1e762161 | [
"MIT"
] | null | null | null | examples/vae/train_vae.py | belldandyxtq/chainer | abffa9a7def07c2e6bcd79d8ddcebeed1e762161 | [
"MIT"
] | null | null | null | examples/vae/train_vae.py | belldandyxtq/chainer | abffa9a7def07c2e6bcd79d8ddcebeed1e762161 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Chainer example: train a VAE on MNIST
"""
import argparse
import os
import warnings
import numpy as np
import chainer
from chainer import training
from chainer.training import extensions
import chainerx
import net
import matplotlib
matplotlib.use('Agg')
def main():
parser = argparse.A... | 40.069182 | 79 | 0.624235 |
import argparse
import os
import warnings
import numpy as np
import chainer
from chainer import training
from chainer.training import extensions
import chainerx
import net
import matplotlib
matplotlib.use('Agg')
def main():
parser = argparse.ArgumentParser(description='Chainer example: VAE')
parser.add_a... | true | true |
f757bd71a20251a0dc2438f739c44e4d71128bb3 | 765 | py | Python | checkpointing/looping_test.py | tongni1975/spark_using_python | e59bfe36271899e4298cbfbd1ad88839f6f80ff5 | [
"Apache-2.0"
] | 42 | 2018-05-22T07:00:40.000Z | 2022-03-22T09:21:09.000Z | checkpointing/looping_test.py | tongni1975/spark_using_python | e59bfe36271899e4298cbfbd1ad88839f6f80ff5 | [
"Apache-2.0"
] | null | null | null | checkpointing/looping_test.py | tongni1975/spark_using_python | e59bfe36271899e4298cbfbd1ad88839f6f80ff5 | [
"Apache-2.0"
] | 30 | 2018-06-11T06:38:31.000Z | 2021-09-20T16:45:55.000Z | #
# Source code for the 'Checkpointing RDDs' Exercise in
# Data Analytics with Spark Using Python
# by Jeffrey Aven
#
# $ spark-submit --master looping_test.py
#
import sys
from pyspark import SparkConf, SparkContext
sc = SparkContext()
sc.setCheckpointDir("file:///tmp/checkpointdir")
rddofints = sc.parallelize([1,2,... | 25.5 | 54 | 0.700654 |
import sys
from pyspark import SparkConf, SparkContext
sc = SparkContext()
sc.setCheckpointDir("file:///tmp/checkpointdir")
rddofints = sc.parallelize([1,2,3,4,5,6,7,8,9,10])
try:
for i in range(1000):
rddofints = rddofints.map(lambda x: x+1)
if i % 10 == 0:
print("Looped " + str(i) + " times")
... | true | true |
f757bd85422577e38470e447e15dfa9ab77331db | 14,030 | py | Python | extensions/answer_summarizers/models.py | carolinajimenez26/oppia | 8a8f07e37e11beb441a53635530e1d3cebe6beef | [
"Apache-2.0"
] | 1 | 2019-11-05T09:32:39.000Z | 2019-11-05T09:32:39.000Z | extensions/answer_summarizers/models.py | TakorLucila/oppia | 393a81474ddc02b7141eed80f33c720cde447517 | [
"Apache-2.0"
] | 13 | 2019-03-04T18:29:27.000Z | 2019-08-24T23:27:36.000Z | extensions/answer_summarizers/models.py | TakorLucila/oppia | 393a81474ddc02b7141eed80f33c720cde447517 | [
"Apache-2.0"
] | 1 | 2020-10-04T06:54:41.000Z | 2020-10-04T06:54:41.000Z | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 39.857955 | 80 | 0.696436 |
from __future__ import absolute_import
from __future__ import unicode_literals
import collections
import itertools
import operator
from core.domain import exp_domain
from core.domain import stats_domain
import feconf
import python_utils
import utils
CLASSIFICATION_CATEGORIES = frozenset([
exp... | true | true |
f757bf20335de5c8df286d726f835ca5af5d8966 | 13,920 | py | Python | cove_iati/tests_functional.py | Xtuden-com/cove | 8a26681eb914e6c351171966bff92430816f50f5 | [
"MIT"
] | null | null | null | cove_iati/tests_functional.py | Xtuden-com/cove | 8a26681eb914e6c351171966bff92430816f50f5 | [
"MIT"
] | null | null | null | cove_iati/tests_functional.py | Xtuden-com/cove | 8a26681eb914e6c351171966bff92430816f50f5 | [
"MIT"
] | null | null | null | import os
import time
import pytest
import requests
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
BROWSER = os.environ.get('BROWSER', 'ChromeHeadless')
@pytest.fixture(scope="module")
def browser(request):
if BRO... | 49.014085 | 202 | 0.702514 | import os
import time
import pytest
import requests
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
BROWSER = os.environ.get('BROWSER', 'ChromeHeadless')
@pytest.fixture(scope="module")
def browser(request):
if BRO... | true | true |
f757c0f671ed3b2a8c88b84d579b6e516f2659b3 | 9,273 | py | Python | flask_social/views.py | aerickson/flask-social | 63911f4028772e707be8f985fd40a3339161f374 | [
"MIT"
] | null | null | null | flask_social/views.py | aerickson/flask-social | 63911f4028772e707be8f985fd40a3339161f374 | [
"MIT"
] | null | null | null | flask_social/views.py | aerickson/flask-social | 63911f4028772e707be8f985fd40a3339161f374 | [
"MIT"
] | 1 | 2018-07-09T11:04:12.000Z | 2018-07-09T11:04:12.000Z | # -*- coding: utf-8 -*-
"""
flask.ext.social.views
~~~~~~~~~~~~~~~~~~~~~~
This module contains the Flask-Social views
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from importlib import import_module
from flask import (Blueprint, current_app, redirect, requ... | 35.258555 | 79 | 0.670441 |
from importlib import import_module
from flask import (Blueprint, current_app, redirect, request, session,
after_this_request, abort, url_for)
from flask_security import current_user, login_required
from flask_security.utils import (get_post_login_redirect, login_user,
... | true | true |
f757c25e70d7dbf5c6350622ed539316c0ee0aa0 | 3,475 | py | Python | chrome/common/extensions/docs/server2/permissions_data_source.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | chrome/common/extensions/docs/server2/permissions_data_source.py | xiaoyuyanran/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | chrome/common/extensions/docs/server2/permissions_data_source.py | xiaoyuyanran/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from itertools import ifilter
from operator import itemgetter
from data_source import DataSource
from extensions_paths import PRIVATE_TEMPLATES
import featu... | 38.186813 | 80 | 0.738129 |
from itertools import ifilter
from operator import itemgetter
from data_source import DataSource
from extensions_paths import PRIVATE_TEMPLATES
import features_utility as features
from future import Gettable, Future
def _ListifyPermissions(permissions):
def filter_permissions(perm):
return 'description' in... | true | true |
f757c291d231d3ca17f3af59d1c7fce35cff762d | 4,066 | py | Python | run_util.py | eustomaqua/ml-fairness-gym | 0d69bdb022b2457da29c4f580ad22495cc121a53 | [
"Apache-2.0"
] | null | null | null | run_util.py | eustomaqua/ml-fairness-gym | 0d69bdb022b2457da29c4f580ad22495cc121a53 | [
"Apache-2.0"
] | null | null | null | run_util.py | eustomaqua/ml-fairness-gym | 0d69bdb022b2457da29c4f580ad22495cc121a53 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The ML Fairness Gym 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 applicab... | 33.603306 | 80 | 0.700935 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gin
import tqdm
@gin.configurable
def run_simulation(env, agent, metrics, num_steps, seed=100, agent_seed=50):
agent.seed(agent_seed)
env.seed(seed)
observation = env.reset()
d... | true | true |
f757c353f8889b0eaf160eb60e9734cfa9354b80 | 3,313 | py | Python | kornia/filters/filter.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | 1 | 2019-11-21T13:18:56.000Z | 2019-11-21T13:18:56.000Z | kornia/filters/filter.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | null | null | null | kornia/filters/filter.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | null | null | null | from typing import Tuple, List
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.filters.kernels import normalize_kernel2d
def compute_padding(kernel_size: Tuple[int, int]) -> List[int]:
"""Computes padding tuple."""
# 4 ints: (padding_left, padding_right,padding_top,padding_bot... | 41.4125 | 79 | 0.643224 | from typing import Tuple, List
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.filters.kernels import normalize_kernel2d
def compute_padding(kernel_size: Tuple[int, int]) -> List[int]:
ize) == 2, kernel_size
computed = [(k - 1) // 2 for k in kernel_size]
return [comput... | true | true |
f757c45e93d84f39ad5703013f5312590a60f13d | 1,494 | py | Python | test/unit/test_default_inference_handler.py | ericangelokim/sagemaker-inference-toolkit | 24db871b1b193ac1a924c21be8c3ec48853b3263 | [
"Apache-2.0"
] | null | null | null | test/unit/test_default_inference_handler.py | ericangelokim/sagemaker-inference-toolkit | 24db871b1b193ac1a924c21be8c3ec48853b3263 | [
"Apache-2.0"
] | null | null | null | test/unit/test_default_inference_handler.py | ericangelokim/sagemaker-inference-toolkit | 24db871b1b193ac1a924c21be8c3ec48853b3263 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file acc... | 35.571429 | 88 | 0.777778 |
from mock import patch
import pytest
from sagemaker_inference import content_types
from sagemaker_inference.default_inference_handler import DefaultInferenceHandler
@patch('sagemaker_inference.decoder.decode')
def test_default_input_fn(loads):
assert DefaultInferenceHandler().default_input_fn(42, con... | true | true |
f757c52cac535675e890951ede9392e70036997b | 1,529 | py | Python | meiduo_mall/apps/meiduo_admin/views/sku.py | zhengcongreal/meiduo_project- | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | null | null | null | meiduo_mall/apps/meiduo_admin/views/sku.py | zhengcongreal/meiduo_project- | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | 1 | 2020-10-26T16:10:06.000Z | 2020-10-26T16:10:06.000Z | meiduo_mall/apps/meiduo_admin/views/sku.py | zhengcongreal/meiduo_project | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | null | null | null | from rest_framework.generics import ListAPIView
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from apps.contents.models import GoodsCategory
from apps.goods.models import SKU, SPU, SPUSpecification
from apps.meiduo_admin.serialize... | 27.8 | 110 | 0.753434 | from rest_framework.generics import ListAPIView
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from apps.contents.models import GoodsCategory
from apps.goods.models import SKU, SPU, SPUSpecification
from apps.meiduo_admin.serialize... | true | true |
f757c77eaf5cf1063badbbbd1803d645152d7a17 | 34,161 | py | Python | contrib/python/six/six.py | gwjknvwjn/catboost | a5644bf80e2e37985012fb3bdd285fc6d798c61c | [
"Apache-2.0"
] | 4 | 2020-06-24T06:07:52.000Z | 2021-04-16T22:58:09.000Z | contrib/python/six/six.py | birichie/catboost | de75c6af12cf490700e76c22072fbdc15b35d679 | [
"Apache-2.0"
] | 1 | 2021-12-09T23:08:25.000Z | 2021-12-09T23:08:25.000Z | contrib/python/six/six.py | birichie/catboost | de75c6af12cf490700e76c22072fbdc15b35d679 | [
"Apache-2.0"
] | 1 | 2021-04-27T23:40:09.000Z | 2021-04-27T23:40:09.000Z | # Copyright (c) 2010-2020 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | 34.75178 | 118 | 0.65446 |
from __future__ import absolute_import
import functools
import itertools
import operator
import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
__version__ = "1.15.0"
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
PY34 = sys.version_info[0:2] >= (3, 4)
i... | true | true |
f757c7b30d73cb17342a41e80a874fc1cde80dd6 | 624 | py | Python | vertex_upload_model_docker/composer_op_example.py | ryangillard/gcp_vertex_ai_composer | 71bbd7d73de5196f5c182f65015f151f10108373 | [
"Apache-2.0"
] | null | null | null | vertex_upload_model_docker/composer_op_example.py | ryangillard/gcp_vertex_ai_composer | 71bbd7d73de5196f5c182f65015f151f10108373 | [
"Apache-2.0"
] | null | null | null | vertex_upload_model_docker/composer_op_example.py | ryangillard/gcp_vertex_ai_composer | 71bbd7d73de5196f5c182f65015f151f10108373 | [
"Apache-2.0"
] | null | null | null | vertex_upload_model_op = (
kubernetes_pod_operator.KubernetesPodOperator(
image="gcr.io/my-project/vertex_upload_model_image:latest",
name="vertex_upload_model_pod",
arguments=[
'--project=my-project',
'--region=us-central1',
'--model_display_name=uploaded... | 39 | 102 | 0.644231 | vertex_upload_model_op = (
kubernetes_pod_operator.KubernetesPodOperator(
image="gcr.io/my-project/vertex_upload_model_image:latest",
name="vertex_upload_model_pod",
arguments=[
'--project=my-project',
'--region=us-central1',
'--model_display_name=uploaded... | true | true |
f757c95500ae31f9baefbd6b7eef5abdfd11844a | 3,566 | py | Python | detect_objects.py | debojit10/tf2-object-detection-api-tutorial | d51c29878b47ea9b2b5a572205591923d6210737 | [
"MIT"
] | null | null | null | detect_objects.py | debojit10/tf2-object-detection-api-tutorial | d51c29878b47ea9b2b5a572205591923d6210737 | [
"MIT"
] | null | null | null | detect_objects.py | debojit10/tf2-object-detection-api-tutorial | d51c29878b47ea9b2b5a572205591923d6210737 | [
"MIT"
] | null | null | null | import os
import cv2
import time
import argparse
from google.colab.patches import cv2_imshow
from detector import DetectorTF2
def DetectFromVideo(detector, Video_path, save_output=False, output_dir='output/'):
cap = cv2.VideoCapture(Video_path)
if save_output:
output_path = os.path.join(output_dir, 'detection_'... | 38.344086 | 123 | 0.736399 | import os
import cv2
import time
import argparse
from google.colab.patches import cv2_imshow
from detector import DetectorTF2
def DetectFromVideo(detector, Video_path, save_output=False, output_dir='output/'):
cap = cv2.VideoCapture(Video_path)
if save_output:
output_path = os.path.join(output_dir, 'detection_'... | true | true |
f757c9bd6a2f9987f5c1dc5c9ca18b454bfa510a | 17,179 | py | Python | growconomy/trading/core.py | CutieRei/growtube-news | e9cc1775364f1d9563b86aa84067a632f6a23deb | [
"WTFPL"
] | 2 | 2021-11-23T09:05:21.000Z | 2021-11-23T14:17:37.000Z | growconomy/trading/core.py | ReyterYT/growtube-news | e9cc1775364f1d9563b86aa84067a632f6a23deb | [
"WTFPL"
] | 3 | 2021-12-09T07:17:03.000Z | 2021-12-16T04:01:49.000Z | growconomy/trading/core.py | ReyterYT/growtube-news | e9cc1775364f1d9563b86aa84067a632f6a23deb | [
"WTFPL"
] | 1 | 2021-12-09T07:10:48.000Z | 2021-12-09T07:10:48.000Z | from asyncio.tasks import create_task, sleep
from asyncpg.connection import Connection
from bot import GrowContext, MessagedError
from discord.ext import commands
from typing import Dict, List, Optional, Literal, Tuple
from discord import User, Message, Embed
from secrets import token_urlsafe
from discord.utils import ... | 43.82398 | 117 | 0.478433 | from asyncio.tasks import create_task, sleep
from asyncpg.connection import Connection
from bot import GrowContext, MessagedError
from discord.ext import commands
from typing import Dict, List, Optional, Literal, Tuple
from discord import User, Message, Embed
from secrets import token_urlsafe
from discord.utils import ... | true | true |
f757ca226895e5f618c877313e1727bf3d355de9 | 11,294 | py | Python | base_agent/nsp_dialogue_manager.py | Dhiraj100892/droidlet | e4ea578672531524552b6ff021165fc9371b0ec8 | [
"MIT"
] | null | null | null | base_agent/nsp_dialogue_manager.py | Dhiraj100892/droidlet | e4ea578672531524552b6ff021165fc9371b0ec8 | [
"MIT"
] | null | null | null | base_agent/nsp_dialogue_manager.py | Dhiraj100892/droidlet | e4ea578672531524552b6ff021165fc9371b0ec8 | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import json
import logging
import os
import re
import spacy
from typing import Tuple, Dict, Optional
from glob import glob
import sentry_sdk
import preprocess
from base_agent.memory_nodes import ProgramNode
from base_agent.dialogue_manager import DialogueManag... | 42.458647 | 110 | 0.61422 | import json
import logging
import os
import re
import spacy
from typing import Tuple, Dict, Optional
from glob import glob
import sentry_sdk
import preprocess
from base_agent.memory_nodes import ProgramNode
from base_agent.dialogue_manager import DialogueManager
from base_agent.dialogue_objects import (
BotCapab... | true | true |
f757cafb8c248c327630efb5f46a5a507ef0347b | 175 | py | Python | google_play_scraper/exceptions.py | shikher-chhawchharia/google-play-scraper | 31dfd4df46911e3489a61d50ea098d06c79e8353 | [
"MIT"
] | 325 | 2019-07-19T09:52:45.000Z | 2022-03-31T10:03:56.000Z | google_play_scraper/exceptions.py | shikher-chhawchharia/google-play-scraper | 31dfd4df46911e3489a61d50ea098d06c79e8353 | [
"MIT"
] | 111 | 2019-07-08T16:31:19.000Z | 2022-03-10T07:51:56.000Z | google_play_scraper/exceptions.py | shikher-chhawchharia/google-play-scraper | 31dfd4df46911e3489a61d50ea098d06c79e8353 | [
"MIT"
] | 93 | 2019-07-25T05:38:38.000Z | 2022-03-31T03:08:56.000Z | class GooglePlayScraperException(Exception):
pass
class NotFoundError(GooglePlayScraperException):
pass
class ExtraHTTPError(GooglePlayScraperException):
pass
| 15.909091 | 49 | 0.805714 | class GooglePlayScraperException(Exception):
pass
class NotFoundError(GooglePlayScraperException):
pass
class ExtraHTTPError(GooglePlayScraperException):
pass
| true | true |
f757cb3fd2aba875afd4fac19eb65ce0924f4933 | 2,580 | py | Python | tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py | evgeny-izutov/open_model_zoo | 2cd6145ef342fc9b7ccf32676af73f4a1cb8d9ba | [
"Apache-2.0"
] | 4 | 2019-09-17T13:11:02.000Z | 2021-02-22T15:39:15.000Z | tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py | evgeny-izutov/open_model_zoo | 2cd6145ef342fc9b7ccf32676af73f4a1cb8d9ba | [
"Apache-2.0"
] | 1 | 2021-11-15T15:52:24.000Z | 2021-11-15T15:52:24.000Z | tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py | evgeny-izutov/open_model_zoo | 2cd6145ef342fc9b7ccf32676af73f4a1cb8d9ba | [
"Apache-2.0"
] | 1 | 2022-01-12T03:47:00.000Z | 2022-01-12T03:47:00.000Z | """
Copyright (c) 2018-2020 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 wri... | 33.506494 | 89 | 0.718992 |
from ..representation import (
CharacterRecognitionAnnotation,
CharacterRecognitionPrediction,
)
from .metric import PerImageEvaluationMetric
from ..utils import UnsupportedPackage
try:
import editdistance
except ImportError as import_error:
editdistance = UnsupportedPackage("editdistance", import... | true | true |
f757cb5829e92adfac9915c1134eb9ec4c530dad | 952 | py | Python | app/core/tests/test_comands.py | MauricioAntonioMartinez/recipie-api-django | 69fd3d097033331cb9531e5ae6220d0931ec40e5 | [
"MIT"
] | null | null | null | app/core/tests/test_comands.py | MauricioAntonioMartinez/recipie-api-django | 69fd3d097033331cb9531e5ae6220d0931ec40e5 | [
"MIT"
] | null | null | null | app/core/tests/test_comands.py | MauricioAntonioMartinez/recipie-api-django | 69fd3d097033331cb9531e5ae6220d0931ec40e5 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
def test_wait_for_db_ready(self):
with patch('django.db.utils.ConnectionHandler.__getitem__') as gi:
gi.... | 35.259259 | 76 | 0.653361 | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
def test_wait_for_db_ready(self):
with patch('django.db.utils.ConnectionHandler.__getitem__') as gi:
gi.... | true | true |
f757cb985f072f2cff73c7614f2d2a7f1a71b689 | 368 | py | Python | containers/failures/router/failure3/myapp.py | haizaar/crossbar-examples | a3daffc0348565aa5e989433978dec2913242ea8 | [
"Apache-2.0"
] | 97 | 2016-12-14T16:48:49.000Z | 2021-09-12T17:48:10.000Z | containers/failures/router/failure3/myapp.py | Weeshlow/crossbarexamples | e392ea2708f52ba322e63808041f9fe6dcfe893e | [
"Apache-2.0"
] | 38 | 2016-12-13T09:42:38.000Z | 2020-07-05T11:58:07.000Z | containers/failures/router/failure3/myapp.py | Weeshlow/crossbarexamples | e392ea2708f52ba322e63808041f9fe6dcfe893e | [
"Apache-2.0"
] | 118 | 2016-12-12T21:36:40.000Z | 2021-11-17T11:49:33.000Z | from twisted.logger import Logger
from autobahn.twisted.wamp import ApplicationSession
class MySession(ApplicationSession):
log = Logger()
def __init__(self, config):
a = 1 / 0
self.log.info("MySession.__init__()")
ApplicationSession.__init__(self, config)
def onJoin(self, detail... | 24.533333 | 52 | 0.682065 | from twisted.logger import Logger
from autobahn.twisted.wamp import ApplicationSession
class MySession(ApplicationSession):
log = Logger()
def __init__(self, config):
a = 1 / 0
self.log.info("MySession.__init__()")
ApplicationSession.__init__(self, config)
def onJoin(self, detail... | true | true |
f757cc19f5eb1b50efd6dd829422ab8950d85de4 | 503 | py | Python | shellshocker_server/__init__.py | ArchimedesPi/shellshocker | 3d00cd3daad0c2e55b62cfccf58e638464d189c7 | [
"MIT"
] | 2 | 2021-10-31T12:54:04.000Z | 2022-03-29T13:52:02.000Z | shellshocker_server/__init__.py | ArchimedesPi/shellshocker | 3d00cd3daad0c2e55b62cfccf58e638464d189c7 | [
"MIT"
] | null | null | null | shellshocker_server/__init__.py | ArchimedesPi/shellshocker | 3d00cd3daad0c2e55b62cfccf58e638464d189c7 | [
"MIT"
] | 3 | 2017-09-19T19:36:49.000Z | 2019-08-10T12:59:14.000Z | from flask import Flask
from shellshocker_server.saferproxyfix import SaferProxyFix
from raven.contrib.flask import Sentry
import os
app = Flask(__name__)
app.config['SECRET_KEY'] = os.environ['SECRET_KEY']
try:
if os.environ['SECRET_KEY'] is not None:
app.config['USE_SENTRY'] = True
app.config['SENTRY_DSN... | 21.869565 | 59 | 0.759443 | from flask import Flask
from shellshocker_server.saferproxyfix import SaferProxyFix
from raven.contrib.flask import Sentry
import os
app = Flask(__name__)
app.config['SECRET_KEY'] = os.environ['SECRET_KEY']
try:
if os.environ['SECRET_KEY'] is not None:
app.config['USE_SENTRY'] = True
app.config['SENTRY_DSN... | true | true |
f757cc8bd60cfc76e1b8237ca16f2153d4331b9c | 882 | py | Python | tests/terraform/parser/test_plan_parser.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | tests/terraform/parser/test_plan_parser.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 3 | 2020-02-07T19:51:40.000Z | 2022-03-21T05:06:29.000Z | tests/terraform/parser/test_plan_parser.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
from checkov.terraform.plan_parser import parse_tf_plan
class TestPlanFileParser(unittest.TestCase):
def test_tags_values_are_flattened(self):
current_dir = os.path.dirname(os.path.realpath(__file__))
valid_plan_path = current_dir + "/resources/plan_tags/tfplan.json"
... | 38.347826 | 85 | 0.71542 | import os
import unittest
from checkov.terraform.plan_parser import parse_tf_plan
class TestPlanFileParser(unittest.TestCase):
def test_tags_values_are_flattened(self):
current_dir = os.path.dirname(os.path.realpath(__file__))
valid_plan_path = current_dir + "/resources/plan_tags/tfplan.json"
... | true | true |
f757ccc9cef504dc81f74537e588f475160bbe33 | 1,088 | py | Python | day-2/solution.py | DallogFheir/aoc-2020 | 089bd45d5fbdf98b9729a23f3a142ca3b792567c | [
"MIT"
] | null | null | null | day-2/solution.py | DallogFheir/aoc-2020 | 089bd45d5fbdf98b9729a23f3a142ca3b792567c | [
"MIT"
] | null | null | null | day-2/solution.py | DallogFheir/aoc-2020 | 089bd45d5fbdf98b9729a23f3a142ca3b792567c | [
"MIT"
] | null | null | null | # Advent of Code 2020
# Day 2
from pathlib import Path
# input
with open(Path(__file__).parent / "input.txt") as f:
inp = f.readlines()
# part 1
# Find how many passwords are valid according to the policy of at_least-at_most char : password.
import re
def part_1():
count = 0
for pwd_policy in inp:
... | 23.148936 | 209 | 0.59375 |
from pathlib import Path
with open(Path(__file__).parent / "input.txt") as f:
inp = f.readlines()
import re
def part_1():
count = 0
for pwd_policy in inp:
min_, max_, char, pwd = re.match(
r"(\d+)-(\d+) ([a-z]): (.*)", pwd_policy
).groups()
if int(min_) <= pwd.... | true | true |
f757cd29c05dcc7d49b2c3d51948f9e335c6ef93 | 470 | py | Python | followbot/config.py | snowwhite-boss/github-follow-bot | d1f9638be0c7631e9fb2cc45ad5a9150b9b0db04 | [
"MIT"
] | 3 | 2022-02-24T05:00:55.000Z | 2022-03-12T17:09:09.000Z | followbot/config.py | snowwhite-boss/github-follow-bot | d1f9638be0c7631e9fb2cc45ad5a9150b9b0db04 | [
"MIT"
] | null | null | null | followbot/config.py | snowwhite-boss/github-follow-bot | d1f9638be0c7631e9fb2cc45ad5a9150b9b0db04 | [
"MIT"
] | null | null | null | # Path of your chrome driver
# You'll need to download the Chrome driver compatible with
# your OS and provide the path here. Find the driver:
# https://chromedriver.chromium.org/downloads
CHROME_DRIVER_PATH = "./chromedriver_win32/chromedriver"
# Put your github user name here
YOUR_NAME = "snowwhite-boss"
YOUR_PASS =... | 33.571429 | 70 | 0.778723 |
# your OS and provide the path here. Find the driver:
# https://chromedriver.chromium.org/downloads
CHROME_DRIVER_PATH = "./chromedriver_win32/chromedriver"
# Put your github user name here
YOUR_NAME = "snowwhite-boss"
YOUR_PASS = "!1qazqazqaz"
# List of people's github usernames whose followers you want to follow
... | true | true |
f757cd64df31cb8be2c76dc4efd50feabae651d3 | 255 | py | Python | insrunner/debug.py | MatejKastak/insrunner | 6c99b7c4c6768003ea5822d03b916f2f17ee5900 | [
"MIT"
] | null | null | null | insrunner/debug.py | MatejKastak/insrunner | 6c99b7c4c6768003ea5822d03b916f2f17ee5900 | [
"MIT"
] | null | null | null | insrunner/debug.py | MatejKastak/insrunner | 6c99b7c4c6768003ea5822d03b916f2f17ee5900 | [
"MIT"
] | null | null | null | # Debug helper functions
# Author: Matej Kastak
from colors import Color
from context import Context
def debug_print(s):
if Context().debug_enabled:
Color.print(Color.GREEN, str(s))
def debug_enabled():
return Context().debug_enabled
| 17 | 40 | 0.72549 |
from colors import Color
from context import Context
def debug_print(s):
if Context().debug_enabled:
Color.print(Color.GREEN, str(s))
def debug_enabled():
return Context().debug_enabled
| true | true |
f757cec9e8bf56b6a12e0405c3fe300fb30f2c7b | 22,982 | py | Python | finrl/config/config.py | RomanZWang/FinRL | b8a70c31a5430a01654736b3f83364578c2c6c8a | [
"MIT"
] | null | null | null | finrl/config/config.py | RomanZWang/FinRL | b8a70c31a5430a01654736b3f83364578c2c6c8a | [
"MIT"
] | null | null | null | finrl/config/config.py | RomanZWang/FinRL | b8a70c31a5430a01654736b3f83364578c2c6c8a | [
"MIT"
] | null | null | null | import pathlib
# import finrl
import pandas as pd
import datetime
import os
# pd.options.display.max_rows = 10
# pd.options.display.max_columns = 10
# PACKAGE_ROOT = pathlib.Path(finrl.__file__).resolve().parent
# PACKAGE_ROOT = pathlib.Path().resolve().parent
TRAINED_MODEL_DIR = f"trained_models"
... | 15.444892 | 115 | 0.391306 | import pathlib
import pandas as pd
import datetime
import os
TRAINED_MODEL_DIR = f"trained_models"
DATA_SAVE_DIR = f"datasets"
TRAINED_MODEL_DIR = f"trained_models"
TENSORBOARD_LOG_DIR = f"tensorboard_log"
RESULTS_DIR = f"results"
1"
END_DATE = "2021-06-11"
START_TRADE_DATE... | true | true |
f757cff51ea958ae4cb4c2b73583e3baa6d6199b | 3,017 | py | Python | tests/conftest.py | gatarelib/loguru | 4834eb964baa07e67bd71921d7e009ca0e6756df | [
"MIT"
] | null | null | null | tests/conftest.py | gatarelib/loguru | 4834eb964baa07e67bd71921d7e009ca0e6756df | [
"MIT"
] | null | null | null | tests/conftest.py | gatarelib/loguru | 4834eb964baa07e67bd71921d7e009ca0e6756df | [
"MIT"
] | null | null | null | import loguru
import logging
import itertools
import pytest
import py
import os
import subprocess
import datetime
import time
import calendar
default_levels = loguru._logger.Logger._levels.copy()
@pytest.fixture(autouse=True)
def reset_logger():
def reset():
loguru.logger.stop()
loguru.logger.__i... | 26.9375 | 100 | 0.641697 | import loguru
import logging
import itertools
import pytest
import py
import os
import subprocess
import datetime
import time
import calendar
default_levels = loguru._logger.Logger._levels.copy()
@pytest.fixture(autouse=True)
def reset_logger():
def reset():
loguru.logger.stop()
loguru.logger.__i... | true | true |
f757d16a53c4869852a2a4154e6945e8bbb160b2 | 876 | py | Python | setup.py | unmeshvrije/kge | f2bcbdb47776e6a3b73d07cca28603bbce723f88 | [
"MIT"
] | 1 | 2021-06-24T01:46:53.000Z | 2021-06-24T01:46:53.000Z | setup.py | healx/kge | e778df91c5612f705de1250fb3f98edf4a6c962c | [
"MIT"
] | null | null | null | setup.py | healx/kge | e778df91c5612f705de1250fb3f98edf4a6c962c | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="libkge",
version="0.1",
description="A knowledge graph embedding library",
url="https://github.com/uma-pi1/kge",
author="Universität Mannheim",
author_email="rgemulla@uni-mannheim.de",
packages=["kge"],
install_requires=[
"torch>=1.3.1",... | 29.2 | 83 | 0.599315 | from setuptools import setup
setup(
name="libkge",
version="0.1",
description="A knowledge graph embedding library",
url="https://github.com/uma-pi1/kge",
author="Universität Mannheim",
author_email="rgemulla@uni-mannheim.de",
packages=["kge"],
install_requires=[
"torch>=1.3.1",... | true | true |
f757d2294423be5fdf9b530fedd9aae1fc695a8e | 575 | py | Python | tests/test_utils.py | wandonye/vshare | beea2f71fb7a37d9f9110e16dd3e260ba28bdea1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_utils.py | wandonye/vshare | beea2f71fb7a37d9f9110e16dd3e260ba28bdea1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_utils.py | wandonye/vshare | beea2f71fb7a37d9f9110e16dd3e260ba28bdea1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from vshare.utils import pretty_date
from tests import TestCase
class TestPrettyDate(TestCase):
def test_func(self):
days = [
[timedelta(days=365 * 3), '3 years ago'],
[timedelta(days=365), '1 year ago'],
... | 25 | 64 | 0.553043 |
from datetime import datetime, timedelta
from vshare.utils import pretty_date
from tests import TestCase
class TestPrettyDate(TestCase):
def test_func(self):
days = [
[timedelta(days=365 * 3), '3 years ago'],
[timedelta(days=365), '1 year ago'],
[timedelta(days=30 ... | true | true |
f757d2f81e3c537b3f6df798742ec8740564aecd | 914 | py | Python | luaprettydoc/templates.py | TurtleP/luaprettydoc | 658a47cb13a5b277f921f63e86f5a1018f57d03b | [
"MIT"
] | 3 | 2021-11-11T21:33:55.000Z | 2022-01-07T18:01:42.000Z | luaprettydoc/templates.py | TurtleP/luaprettydoc | 658a47cb13a5b277f921f63e86f5a1018f57d03b | [
"MIT"
] | 10 | 2021-11-10T05:54:12.000Z | 2021-12-12T04:17:24.000Z | luaprettydoc/templates.py | TurtleP/luaprettydoc | 658a47cb13a5b277f921f63e86f5a1018f57d03b | [
"MIT"
] | null | null | null | from enum import Enum
class Templates(str, Enum):
TEMPLATE_START = ("# {}"
"\n\n"
"_{}_"
"\n\n"
"## Functions"
"\n\n")
TEMPLATE_DEFINE = ("### {}"
"\n\n")
TEMPLATE_FUNC = ... | 23.435897 | 56 | 0.277899 | from enum import Enum
class Templates(str, Enum):
TEMPLATE_START = ("# {}"
"\n\n"
"_{}_"
"\n\n"
"## Functions"
"\n\n")
TEMPLATE_DEFINE = ("### {}"
"\n\n")
TEMPLATE_FUNC = ... | true | true |
f757d3c28b90ee6b73ed0f1eff80aa27c65e5a43 | 321 | py | Python | main.py | BITEWKRER/KeepGoing | 2d42c6cd6ad62ff8739183805d5b743dc65910c4 | [
"BSD-3-Clause"
] | 1 | 2021-08-10T05:11:19.000Z | 2021-08-10T05:11:19.000Z | main.py | BITEWKRER/KeepGoing | 2d42c6cd6ad62ff8739183805d5b743dc65910c4 | [
"BSD-3-Clause"
] | null | null | null | main.py | BITEWKRER/KeepGoing | 2d42c6cd6ad62ff8739183805d5b743dc65910c4 | [
"BSD-3-Clause"
] | null | null | null | # encoding : utf-8
# anthor : comi
from gameloop import *
from pygame import *
import pygame,sys,time
if __name__ == '__main__':
player = game()
player.game_start('KEEP-GOING')
while player.playing:
player.new()
player.screen.fill(black)
player.game_start('GAME-OVER')
time.sleep(1.5)
... | 20.0625 | 35 | 0.657321 |
from gameloop import *
from pygame import *
import pygame,sys,time
if __name__ == '__main__':
player = game()
player.game_start('KEEP-GOING')
while player.playing:
player.new()
player.screen.fill(black)
player.game_start('GAME-OVER')
time.sleep(1.5)
| true | true |
f757d4662783a2421a65b5a113e1a17a09a9a354 | 27,385 | py | Python | examples/run_glue.py | rryan/transformers | f382a8decda82062bb6911f05b646f404eacfdd4 | [
"Apache-2.0"
] | 1 | 2020-02-22T10:48:20.000Z | 2020-02-22T10:48:20.000Z | examples/run_glue.py | rryan/transformers | f382a8decda82062bb6911f05b646f404eacfdd4 | [
"Apache-2.0"
] | null | null | null | examples/run_glue.py | rryan/transformers | f382a8decda82062bb6911f05b646f404eacfdd4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 53.590998 | 163 | 0.642578 |
from __future__ import absolute_import, division, print_function
import argparse
import glob
import logging
import os
import random
import numpy as np
import torch
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
from torch.utils.... | true | true |
f757d5afad2818e94177a3045052d514ecb82243 | 7,078 | py | Python | tests/components/erosion_deposition/test_general_erodep.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 257 | 2015-01-13T16:01:21.000Z | 2022-03-29T22:37:43.000Z | tests/components/erosion_deposition/test_general_erodep.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 1,222 | 2015-02-05T21:36:53.000Z | 2022-03-31T17:53:49.000Z | tests/components/erosion_deposition/test_general_erodep.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 274 | 2015-02-11T19:56:08.000Z | 2022-03-28T23:31:07.000Z | import numpy as np
import pytest
from numpy import testing
from landlab import RasterModelGrid
from landlab.components import ErosionDeposition, FlowAccumulator
def test_Ff_too_high_vals():
"""
Test that instantiating ErosionDeposition with a F_f value > 1 throws a
ValueError.
"""
# set up a 5x5... | 27.118774 | 88 | 0.61783 | import numpy as np
import pytest
from numpy import testing
from landlab import RasterModelGrid
from landlab.components import ErosionDeposition, FlowAccumulator
def test_Ff_too_high_vals():
nr = 5
nc = 5
mg = RasterModelGrid((nr, nc), xy_spacing=10.0)
mg.add_zeros("topographic__elevation", at=... | true | true |
f757d6a033627ced46e23255f44a48a76da6c477 | 2,571 | py | Python | ai_flow/test/cli/commands/test_config_command.py | flink-extended/ai-flow | d1427a243097d94d77fedbe1966500ae26975a13 | [
"Apache-2.0"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | ai_flow/test/cli/commands/test_config_command.py | flink-extended/ai-flow | d1427a243097d94d77fedbe1966500ae26975a13 | [
"Apache-2.0"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | ai_flow/test/cli/commands/test_config_command.py | flink-extended/ai-flow | d1427a243097d94d77fedbe1966500ae26975a13 | [
"Apache-2.0"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | # Copyright 2022 The AI Flow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 41.467742 | 105 | 0.695838 |
import io
import logging
import os
import unittest
from contextlib import redirect_stdout
from ai_flow.cli import cli_parser
from ai_flow.cli.commands.config_command import config_init, config_get_value, config_list
from ai_flow.settings import AIFLOW_HOME
logger = logging.getLogger(__name__)
class Te... | true | true |
f757d710be3b8c459049dbf406dfdc3f3e327210 | 28,122 | py | Python | tensorflow/python/distribute/parameter_server_strategy_v2.py | lasdasdas/tensorflow | 7568262b59060ec44474c6d62075e064c492160d | [
"Apache-2.0"
] | 1 | 2020-10-21T12:55:13.000Z | 2020-10-21T12:55:13.000Z | tensorflow/python/distribute/parameter_server_strategy_v2.py | wxm620/tensorflow | 673b993983f37f332ff70cdb642305f69089337d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/parameter_server_strategy_v2.py | wxm620/tensorflow | 673b993983f37f332ff70cdb642305f69089337d | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 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 requ... | 44.356467 | 82 | 0.728398 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.distribute import distribute_lib
from tensorflow.python.distribute import distribute_utils
from tensorflow.python.distribute import parameter_server_strategy
fr... | true | true |
f757d7e69360c015edf58c5401d10ed47a9f43f4 | 1,596 | py | Python | setup.py | refgenie/seqcolapi | 82b8ac994a85d63d815f95a87c5950704aea3d51 | [
"BSD-2-Clause"
] | null | null | null | setup.py | refgenie/seqcolapi | 82b8ac994a85d63d815f95a87c5950704aea3d51 | [
"BSD-2-Clause"
] | null | null | null | setup.py | refgenie/seqcolapi | 82b8ac994a85d63d815f95a87c5950704aea3d51 | [
"BSD-2-Clause"
] | 1 | 2021-12-05T20:55:32.000Z | 2021-12-05T20:55:32.000Z | #! /usr/bin/env python
from setuptools import setup
import sys
PACKAGE = "seqcolapi"
# Additional keyword arguments for setup().
extra = {}
# Ordinary dependencies
DEPENDENCIES = []
with open("requirements/requirements-all.txt", 'r') as reqs_file:
for line in reqs_file:
print(line)
if not line.s... | 26.6 | 65 | 0.629073 |
from setuptools import setup
import sys
PACKAGE = "seqcolapi"
extra = {}
DEPENDENCIES = []
with open("requirements/requirements-all.txt", 'r') as reqs_file:
for line in reqs_file:
print(line)
if not line.strip():
continue
DEPENDENCIES.append(line)
if sys.version_info >= ... | true | true |
f757d8815f5386b96e2da3a50e7913b4a82aa300 | 18,358 | py | Python | python/paddle/fluid/parallel_executor.py | laipaang/Paddle | d7f35434b761707a8479b75636546a624399369a | [
"Apache-2.0"
] | 8 | 2019-06-16T12:36:11.000Z | 2021-03-05T05:33:21.000Z | python/paddle/fluid/parallel_executor.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 1 | 2020-09-10T09:05:52.000Z | 2020-09-10T09:06:22.000Z | python/paddle/fluid/parallel_executor.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2018 PaddlePaddle 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 app... | 49.085561 | 104 | 0.626757 |
from __future__ import print_function
from . import core
from . import framework
from . import executor
from . import compiler
from .data_feeder import check_type
import sys
__all__ = ['ParallelExecutor']
ExecutionStrategy = core.ParallelExecutor.ExecutionStrategy
BuildStrategy = core.ParallelExecutor.B... | true | true |
f757d90a26d19778d2ee71d70f0155d684219f7d | 11,217 | py | Python | demo.py | SeanTater/rsvp | 2f136ee8aac2d9401427d4d4f0d78f74eb757f15 | [
"Apache-2.0"
] | null | null | null | demo.py | SeanTater/rsvp | 2f136ee8aac2d9401427d4d4f0d78f74eb757f15 | [
"Apache-2.0"
] | 1 | 2021-03-24T01:04:02.000Z | 2021-03-24T01:04:02.000Z | demo.py | SeanTater/rsvp | 2f136ee8aac2d9401427d4d4f0d78f74eb757f15 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import cv2
import numpy as np
import sqlite3
import time
class QualityCheck:
def __init__(self):
""" Record model runs """
self.db = sqlite3.connect("logs.db", isolation_level=None)
self.db.execute("""
CREATE TABLE IF NOT EXISTS ModelRun(
run_i... | 34.943925 | 108 | 0.561023 |
import cv2
import numpy as np
import sqlite3
import time
class QualityCheck:
def __init__(self):
self.db = sqlite3.connect("logs.db", isolation_level=None)
self.db.execute("""
CREATE TABLE IF NOT EXISTS ModelRun(
run_id INT,
num_embed INT,
... | true | true |
f757db13e8d2176ac08c7e1b15ab792245dc9967 | 40,596 | py | Python | airavata/model/appcatalog/groupresourceprofile/ttypes.py | DImuthuUpe/airavata_python_sdk | 99724b92efb255e779e0265e0be0ef8fe8906314 | [
"Apache-2.0"
] | null | null | null | airavata/model/appcatalog/groupresourceprofile/ttypes.py | DImuthuUpe/airavata_python_sdk | 99724b92efb255e779e0265e0be0ef8fe8906314 | [
"Apache-2.0"
] | null | null | null | airavata/model/appcatalog/groupresourceprofile/ttypes.py | DImuthuUpe/airavata_python_sdk | 99724b92efb255e779e0265e0be0ef8fe8906314 | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.10.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys
import airavata.... | 48.386174 | 575 | 0.614396 |
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys
import airavata.model.commons.ttypes
import airavata.model.appcatalog.computeresource.ttypes
import airavata.model.data.movement.ttypes
from thrift.t... | true | true |
f757db97fd411f0249d5f34361763d906d242c6d | 5,264 | py | Python | domain/network/node.py | HathorNetwork/hathor-explorer-service | 81236deceac12ddfd813b33723481421a9064c82 | [
"MIT"
] | null | null | null | domain/network/node.py | HathorNetwork/hathor-explorer-service | 81236deceac12ddfd813b33723481421a9064c82 | [
"MIT"
] | 51 | 2021-05-21T18:58:15.000Z | 2022-03-29T17:45:00.000Z | domain/network/node.py | HathorNetwork/hathor-explorer-service | 81236deceac12ddfd813b33723481421a9064c82 | [
"MIT"
] | 1 | 2022-02-08T21:15:26.000Z | 2022-02-08T21:15:26.000Z | from dataclasses import asdict, dataclass
from enum import Enum
from typing import List
class NodeState(str, Enum):
# Node is still initializing
INITIALIZING = 'INITIALIZING'
# Node is ready to establish new connections, sync, and exchange transactions.
READY = 'READY'
@dataclass
class Peer:
""... | 29.909091 | 94 | 0.640578 | from dataclasses import asdict, dataclass
from enum import Enum
from typing import List
class NodeState(str, Enum):
INITIALIZING = 'INITIALIZING'
READY = 'READY'
@dataclass
class Peer:
id: str
app_version: str
uptime: float
address: str
state: NodeState
last_message: float... | true | true |
f757dbaa059ae43fee837b7b296c073cc8ee7a92 | 626 | py | Python | setup.py | PokaInc/cfn-get-export-value | b9558e6ed8e6a302a1c9f72e60894463f893df4a | [
"MIT"
] | 5 | 2018-10-10T14:03:54.000Z | 2020-07-14T08:52:55.000Z | setup.py | PokaInc/cfn-get-export-value | b9558e6ed8e6a302a1c9f72e60894463f893df4a | [
"MIT"
] | 1 | 2019-11-19T15:35:57.000Z | 2019-11-19T15:35:57.000Z | setup.py | PokaInc/cfn-get-export-value | b9558e6ed8e6a302a1c9f72e60894463f893df4a | [
"MIT"
] | 1 | 2017-04-11T14:21:36.000Z | 2017-04-11T14:21:36.000Z | from setuptools import setup
setup(
name='cfn_get_export_value',
packages=['cfn_get_export_value'], # this must be the same as the name above
version='0.0.4',
description='Get an exported value in AWS CloudFormation',
author='Simon-Pierre Gingras',
author_email='spgingras@poka.io',
url='ht... | 34.777778 | 92 | 0.683706 | from setuptools import setup
setup(
name='cfn_get_export_value',
packages=['cfn_get_export_value'],
version='0.0.4',
description='Get an exported value in AWS CloudFormation',
author='Simon-Pierre Gingras',
author_email='spgingras@poka.io',
url='https://github.com/PokaInc/cfn-get-export-v... | true | true |
f757dc93862be840ff7a4d83497fbbcf29cdb10a | 735 | py | Python | config/urls.py | birkin/fast_reconcile_project | de086e312aae9cd4d2eb847c3a5a5ba94cd68de7 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | birkin/fast_reconcile_project | de086e312aae9cd4d2eb847c3a5a5ba94cd68de7 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | birkin/fast_reconcile_project | de086e312aae9cd4d2eb847c3a5a5ba94cd68de7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
from fast_reconcile_app import views
admin.autodiscover()
urlpatterns = [
# url( r'^admin/login/', RedirectView.as_view(pattern_name='login_url') ),
url( r'^adm... | 25.344828 | 99 | 0.672109 |
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
from fast_reconcile_app import views
admin.autodiscover()
urlpatterns = [
url( r'^admin/', admin.site.urls ),
url( r'^info/$', views.info, name='info_url' ),
url( r'^v1/r... | true | true |
f757dce3a577af449a3b60e80f325da24f87fb1c | 7,748 | py | Python | pylot/perception/detection/detection_operator.py | pschafhalter/pylot | 712fd504f9e2669cfc9876eaed4954fbf2b31f20 | [
"Apache-2.0"
] | null | null | null | pylot/perception/detection/detection_operator.py | pschafhalter/pylot | 712fd504f9e2669cfc9876eaed4954fbf2b31f20 | [
"Apache-2.0"
] | null | null | null | pylot/perception/detection/detection_operator.py | pschafhalter/pylot | 712fd504f9e2669cfc9876eaed4954fbf2b31f20 | [
"Apache-2.0"
] | null | null | null | """Implements an operator that detects obstacles."""
import logging
import time
import erdos
import numpy as np
import pylot.utils
from pylot.perception.detection.obstacle import Obstacle
from pylot.perception.detection.utils import BoundingBox2D, \
OBSTACLE_LABELS, load_coco_bbox_colors, load_coco_labels
from p... | 44.528736 | 79 | 0.600413 | import logging
import time
import erdos
import numpy as np
import pylot.utils
from pylot.perception.detection.obstacle import Obstacle
from pylot.perception.detection.utils import BoundingBox2D, \
OBSTACLE_LABELS, load_coco_bbox_colors, load_coco_labels
from pylot.perception.messages import ObstaclesMessage
imp... | true | true |
f757de2b0f73782afa99bdcba4becd69106af1ad | 4,069 | py | Python | learned_optimization/baselines/run_archive.py | Sohl-Dickstein/learned_optimization | cd929359a51d09444665021387c058aac11b63ba | [
"Apache-2.0"
] | null | null | null | learned_optimization/baselines/run_archive.py | Sohl-Dickstein/learned_optimization | cd929359a51d09444665021387c058aac11b63ba | [
"Apache-2.0"
] | null | null | null | learned_optimization/baselines/run_archive.py | Sohl-Dickstein/learned_optimization | cd929359a51d09444665021387c058aac11b63ba | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 35.382609 | 123 | 0.733841 |
from concurrent import futures
import time
from typing import Any, Mapping, Optional
from absl import app
from absl import logging
import gin
import jax
from learned_optimization import setup_experiment
from learned_optimization.baselines import hparam_sets
from learned_optimization.baselines import u... | true | true |
f757df365d80f661e66315f390f1aec550f9f373 | 4,882 | py | Python | kubernetes_asyncio/client/models/v1alpha1_role_ref.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_role_ref.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_role_ref.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1alpha1Ro... | 28.057471 | 124 | 0.569644 |
import pprint
import re
import six
class V1alpha1RoleRef(object):
openapi_types = {
'api_group': 'str',
'kind': 'str',
'name': 'str'
}
attribute_map = {
'api_group': 'apiGroup',
'kind': 'kind',
'name': 'name'
}
def __init__(self, api_group=... | true | true |
f757e0208758e2dcf3c2339edfea27bd8495b9b9 | 771 | py | Python | others/remove_nth_node_from_end.py | sumitsk/leetcode | bb3527b08ca794dea2c9d071efc24b4276bd1c05 | [
"MIT"
] | null | null | null | others/remove_nth_node_from_end.py | sumitsk/leetcode | bb3527b08ca794dea2c9d071efc24b4276bd1c05 | [
"MIT"
] | null | null | null | others/remove_nth_node_from_end.py | sumitsk/leetcode | bb3527b08ca794dea2c9d071efc24b4276bd1c05 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def removeNthFromEnd(self, head, n):
"""
:type head: ListNode
:type n: int
:rtype: ListNode
"""
ptr = head
ln... | 22.028571 | 40 | 0.431907 |
class Solution:
def removeNthFromEnd(self, head, n):
ptr = head
ln = self.length(head)
j = ln - n
i = 0
while i < j-1:
ptr = ptr.next
i += 1
if j==0:
head = head.next
elif j==ln:
ptr.next = None
... | true | true |
f757e0c2c5a4d8a475220cbb8f0a97b4b5d1d305 | 3,846 | py | Python | test/unit/test_base_pipeline_step.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | null | null | null | test/unit/test_base_pipeline_step.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | 8 | 2019-10-10T08:03:02.000Z | 2022-01-11T11:28:58.000Z | test/unit/test_base_pipeline_step.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | null | null | null | __author__ = 'tinglev@kth.se'
import sys
import os
import subprocess
import unittest
import mock
from modules.steps.base_pipeline_step import BasePipelineStep
from modules.steps import base_pipeline_step
from modules.util import exceptions, data_defs
class ConcreteBPS(BasePipelineStep):
def get_required_env_vari... | 40.914894 | 92 | 0.700468 | __author__ = 'tinglev@kth.se'
import sys
import os
import subprocess
import unittest
import mock
from modules.steps.base_pipeline_step import BasePipelineStep
from modules.steps import base_pipeline_step
from modules.util import exceptions, data_defs
class ConcreteBPS(BasePipelineStep):
def get_required_env_vari... | true | true |
f757e142f2bdb777e0d12909c7f6d6346a03d7bd | 251 | py | Python | converter/rate_providers/__init__.py | giefferre/convert | 4f6dc199d32a7c7d4f531fc70e15865bd448a020 | [
"MIT"
] | 1 | 2020-02-28T20:17:19.000Z | 2020-02-28T20:17:19.000Z | converter/rate_providers/__init__.py | giefferre/convert | 4f6dc199d32a7c7d4f531fc70e15865bd448a020 | [
"MIT"
] | null | null | null | converter/rate_providers/__init__.py | giefferre/convert | 4f6dc199d32a7c7d4f531fc70e15865bd448a020 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Offers different rate providers meant to be used with the converter package.
"""
from .interface import RateProviderInterface
from .random_provider import RandomRateProvider
from .ecb_rate_provider import ECBRateProvider
| 25.1 | 76 | 0.792829 |
from .interface import RateProviderInterface
from .random_provider import RandomRateProvider
from .ecb_rate_provider import ECBRateProvider
| true | true |
f757e195477efc671fdd6f88292cdc5907d38a36 | 2,877 | py | Python | tutorials/2_tensorflow_old/numpy&pandas/17_merge.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | 2 | 2019-03-24T12:58:17.000Z | 2021-05-18T06:21:21.000Z | tutorials/2_tensorflow_old/numpy&pandas/17_merge.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | tutorials/2_tensorflow_old/numpy&pandas/17_merge.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | # View more 3_python 2_tensorflow_old on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for 3_python 3+. If you are using 3_python 2+, please modify the code... | 40.521127 | 113 | 0.498436 |
from __future__ import print_function
import pandas as pd
left = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'],
'A': ['A0', 'A1', 'A2', 'A3'],
'B': ['B0', 'B1', 'B2', 'B3']})
right = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'],
... | true | true |
f757e2e1d652c7c9fa62d2ecbf05fa925c7c7ec0 | 1,678 | py | Python | .config/qtile/my_modules/programs.py | Rolv-Apneseth/my-configs | 281f3e301c319ba8775cb5c005bbcef16996dffe | [
"MIT"
] | null | null | null | .config/qtile/my_modules/programs.py | Rolv-Apneseth/my-configs | 281f3e301c319ba8775cb5c005bbcef16996dffe | [
"MIT"
] | null | null | null | .config/qtile/my_modules/programs.py | Rolv-Apneseth/my-configs | 281f3e301c319ba8775cb5c005bbcef16996dffe | [
"MIT"
] | null | null | null | from os import environ
def get_program(environment_variable: str, backup: str) -> str:
return environ.get(environment_variable, default=backup)
def get_terminal_program(program: str) -> str:
return f"{PROGRAMS['terminal']} -e {program}"
def get_site(url: str) -> str:
return f'{PROGRAMS["browser"]} {ur... | 30.509091 | 89 | 0.709774 | from os import environ
def get_program(environment_variable: str, backup: str) -> str:
return environ.get(environment_variable, default=backup)
def get_terminal_program(program: str) -> str:
return f"{PROGRAMS['terminal']} -e {program}"
def get_site(url: str) -> str:
return f'{PROGRAMS["browser"]} {ur... | true | true |
f757e3a3ecd49790a18aa937c628db10addf534d | 671 | py | Python | 00/92.py | shuowangphd/lcpy | 18e11bf7ca77acacadeeef93bf6b7f1667eae2cd | [
"MIT"
] | null | null | null | 00/92.py | shuowangphd/lcpy | 18e11bf7ca77acacadeeef93bf6b7f1667eae2cd | [
"MIT"
] | null | null | null | 00/92.py | shuowangphd/lcpy | 18e11bf7ca77acacadeeef93bf6b7f1667eae2cd | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]:
if left == right: return head
fh = L... | 30.5 | 100 | 0.536513 |
class Solution:
def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]:
if left == right: return head
fh = ListNode(next = head)
nd = fh
for _ in range(left-1):
nd = nd.next
n1 = nd
n2 = nd.next
nd = nd... | true | true |
f757e487548d730609a2e5c6b3944b2cc3ad1623 | 2,155 | py | Python | nbs/utils/args.py | coyotevz/nobix-app | 9523d150e0299b851779f42927992810184e862d | [
"MIT"
] | null | null | null | nbs/utils/args.py | coyotevz/nobix-app | 9523d150e0299b851779f42927992810184e862d | [
"MIT"
] | null | null | null | nbs/utils/args.py | coyotevz/nobix-app | 9523d150e0299b851779f42927992810184e862d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import request
from marshmallow import Schema, fields
from marshmallow.compat import text_type as _text_type
from webargs.flaskparser import FlaskParser, abort as _abort
import warnings
FIELD_MAPPING = {
# type, [use_function] (preprocessing)
fields.Integer: (int, None),
... | 28.355263 | 77 | 0.654756 |
from flask import request
from marshmallow import Schema, fields
from marshmallow.compat import text_type as _text_type
from webargs.flaskparser import FlaskParser, abort as _abort
import warnings
FIELD_MAPPING = {
fields.Integer: (int, None),
fields.Number: (int, None),
fields.Float: (float, None),... | true | true |
f757e54c56242d7bc9d5d7a5411ac4157d348204 | 214 | py | Python | tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py | webcoast-dk/mitogen | a5fe4a9fac5561511b676fe61ed127b732be5b12 | [
"BSD-3-Clause"
] | 1,526 | 2017-09-15T18:49:40.000Z | 2021-01-17T16:04:12.000Z | tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py | webcoast-dk/mitogen | a5fe4a9fac5561511b676fe61ed127b732be5b12 | [
"BSD-3-Clause"
] | 682 | 2017-09-11T17:43:12.000Z | 2021-01-17T05:26:26.000Z | tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py | webcoast-dk/mitogen | a5fe4a9fac5561511b676fe61ed127b732be5b12 | [
"BSD-3-Clause"
] | 111 | 2017-09-15T23:21:37.000Z | 2021-01-01T14:45:35.000Z | # #590: a subpackage that turns itself into a module from elsewhere on sys.path.
I_AM = "the subpackage that was replaced with a system module"
import sys
import system_distro
sys.modules[__name__] = system_distro
| 35.666667 | 80 | 0.794393 | ort system_distro
sys.modules[__name__] = system_distro
| true | true |
f757e57697e197e86174c1b3ca8df5279c84f8f1 | 20,260 | py | Python | datadog_checks_dev/datadog_checks/dev/tooling/utils.py | abraham-leal/integrations-core | 5062702ddae5314f504e6161c7720a1fcde777ea | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | datadog_checks_dev/datadog_checks/dev/tooling/utils.py | abraham-leal/integrations-core | 5062702ddae5314f504e6161c7720a1fcde777ea | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | datadog_checks_dev/datadog_checks/dev/tooling/utils.py | abraham-leal/integrations-core | 5062702ddae5314f504e6161c7720a1fcde777ea | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import csv
import io
import json
import os
import re
from ast import literal_eval
from datetime import datetime, timezone
from json.decoder import JSONDecodeError
import requests
import semver
import yaml... | 30.466165 | 119 | 0.669497 |
import csv
import io
import json
import os
import re
from ast import literal_eval
from datetime import datetime, timezone
from json.decoder import JSONDecodeError
import requests
import semver
import yaml
from datadog_checks.dev.tooling.catalog_const import (
DOGWEB_JSON_DASHBOARDS,
INTEGRATION_LOGS_NOT_PO... | true | true |
f757e586adff2b4d08b1da0d4c5473e9607c79a5 | 703 | py | Python | lib/tool/table_ddl/split_to_words.py | auho/python-ETL | 761589814b04e076ba6fa1c0e64b83ce62ce8556 | [
"Apache-2.0"
] | null | null | null | lib/tool/table_ddl/split_to_words.py | auho/python-ETL | 761589814b04e076ba6fa1c0e64b83ce62ce8556 | [
"Apache-2.0"
] | null | null | null | lib/tool/table_ddl/split_to_words.py | auho/python-ETL | 761589814b04e076ba6fa1c0e64b83ce62ce8556 | [
"Apache-2.0"
] | null | null | null | from .interface import TableDDl
from lib.db.ddl import mysql
class Table(TableDDl):
def __init__(self, table_name, content_name, keyid, suffix='words'):
self._tableName = table_name + '_' + content_name + '_' + suffix
self._keyid = keyid
self.DDLTable = None # type: mysql.DDLBuild
... | 28.12 | 72 | 0.661451 | from .interface import TableDDl
from lib.db.ddl import mysql
class Table(TableDDl):
def __init__(self, table_name, content_name, keyid, suffix='words'):
self._tableName = table_name + '_' + content_name + '_' + suffix
self._keyid = keyid
self.DDLTable = None
self._init()
de... | true | true |
f757e5914daed30701a40ef1bf074e2481036d72 | 1,601 | py | Python | setup.py | lhoenig/yolk | 51da3672831e7781aeb39ccd95f6369597e97b0a | [
"BSD-3-Clause"
] | 62 | 2015-01-02T19:58:48.000Z | 2022-01-12T14:20:12.000Z | setup.py | lhoenig/yolk | 51da3672831e7781aeb39ccd95f6369597e97b0a | [
"BSD-3-Clause"
] | 22 | 2015-03-16T17:27:54.000Z | 2021-05-29T16:53:51.000Z | setup.py | lhoenig/yolk | 51da3672831e7781aeb39ccd95f6369597e97b0a | [
"BSD-3-Clause"
] | 11 | 2015-05-26T14:23:16.000Z | 2022-01-21T13:19:10.000Z | #!/usr/bin/env python
"""Installer for yolk."""
import ast
from setuptools import setup
def version():
"""Return version string."""
with open('yolk/__init__.py') as input_file:
for line in input_file:
if line.startswith('__version__'):
return ast.parse(line).body[0].valu... | 33.354167 | 78 | 0.56777 |
import ast
from setuptools import setup
def version():
with open('yolk/__init__.py') as input_file:
for line in input_file:
if line.startswith('__version__'):
return ast.parse(line).body[0].value.s
with open('README.rst') as readme:
setup(
name='yolk3k',
... | true | true |
f757e5f8c73ab74b56ad9c1904009499df30bb03 | 699 | py | Python | shapemodel.py | elecun/pyface | 47d7d4b6b163492c5c4dfc1ec45b05391dd98a64 | [
"MIT"
] | null | null | null | shapemodel.py | elecun/pyface | 47d7d4b6b163492c5c4dfc1ec45b05391dd98a64 | [
"MIT"
] | null | null | null | shapemodel.py | elecun/pyface | 47d7d4b6b163492c5c4dfc1ec45b05391dd98a64 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from pyFaceAlign.filereader import ptsReader
import pyFaceAlign.plot as plot
from pyFaceAlign.normalization import kabsch2D
import numpy as np
if __name__ == "__main__":
# 1. read all pts file to create shape model
filereader = ptsReader("./dataset")
landmarks = filereader.read()
... | 30.391304 | 73 | 0.736767 |
from pyFaceAlign.filereader import ptsReader
import pyFaceAlign.plot as plot
from pyFaceAlign.normalization import kabsch2D
import numpy as np
if __name__ == "__main__":
filereader = ptsReader("./dataset")
landmarks = filereader.read()
print("Read ", landmarks.shape, " dimension of landmark data fil... | true | true |
f757e5fb9fbb2d3a6a605238d7f555aac1e1672d | 7,165 | py | Python | napari/plugins/_npe2.py | MosGeo/napari | 83e63fb628c5d52887a54324bf6745d63750752b | [
"BSD-3-Clause"
] | 1,345 | 2019-03-03T21:14:14.000Z | 2022-03-31T19:46:39.000Z | napari/plugins/_npe2.py | MosGeo/napari | 83e63fb628c5d52887a54324bf6745d63750752b | [
"BSD-3-Clause"
] | 3,904 | 2019-03-02T01:30:24.000Z | 2022-03-31T20:17:27.000Z | napari/plugins/_npe2.py | MosGeo/napari | 83e63fb628c5d52887a54324bf6745d63750752b | [
"BSD-3-Clause"
] | 306 | 2019-03-29T17:09:10.000Z | 2022-03-30T09:54:11.000Z | from __future__ import annotations
from contextlib import suppress
from typing import (
TYPE_CHECKING,
Callable,
DefaultDict,
Dict,
Iterable,
Iterator,
List,
Optional,
Sequence,
Tuple,
Union,
)
try:
import npe2
from npe2.io_utils import read_get_reader
from npe2... | 29.854167 | 79 | 0.641033 | from __future__ import annotations
from contextlib import suppress
from typing import (
TYPE_CHECKING,
Callable,
DefaultDict,
Dict,
Iterable,
Iterator,
List,
Optional,
Sequence,
Tuple,
Union,
)
try:
import npe2
from npe2.io_utils import read_get_reader
from npe2... | true | true |
f757e6b449fa2a8aa8c6a8b646a1b642c6f94cdc | 21,007 | py | Python | art/classifiers/classifier.py | dohmatob/adversarial-robustness-toolbox | 7d3ba7d2d6690be69c08754fbc632947c2d10a97 | [
"MIT"
] | 1 | 2020-03-09T05:55:46.000Z | 2020-03-09T05:55:46.000Z | art/classifiers/classifier.py | dohmatob/adversarial-robustness-toolbox | 7d3ba7d2d6690be69c08754fbc632947c2d10a97 | [
"MIT"
] | 1 | 2020-03-09T07:04:39.000Z | 2020-03-09T07:04:39.000Z | art/classifiers/classifier.py | dohmatob/adversarial-robustness-toolbox | 7d3ba7d2d6690be69c08754fbc632947c2d10a97 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) IBM Corporation 2018
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | 42.014 | 120 | 0.638882 |
from __future__ import absolute_import, division, print_function, unicode_literals
import abc
import sys
import numpy as np
from art.utils import check_and_transform_label_format
if sys.version_info >= (3, 4):
ABC = abc.ABC
else:
ABC = abc.ABCMeta(str('ABC'), (), {})
class Classifier(ABC... | true | true |
f757e6c6e1e5907da887c34ef41e7ab20c4b4387 | 2,216 | py | Python | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/SubmitPreprocessJobsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/SubmitPreprocessJobsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/SubmitPreprocessJobsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.741935 | 79 | 0.773466 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvod.endpoint import endpoint_data
class SubmitPreprocessJobsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'vod', '2017-03-21', 'SubmitPreprocessJobs','vod')
self.set_method('POST')
if hasattr(self, "endpoint_map... | true | true |
f757e79e9cf218671a42e6be11da974d2e2b0be7 | 4,423 | py | Python | dynamodb-streams-lambda-filter/lambda_filters/lambda_filters_stack.py | MauriceBrg/snippets | 7fb3a5fa553fc72e4327eeac26521b63fc2dbcd5 | [
"Unlicense"
] | 2 | 2022-01-10T16:07:27.000Z | 2022-02-23T03:41:21.000Z | dynamodb-streams-lambda-filter/lambda_filters/lambda_filters_stack.py | MauriceBrg/snippets | 7fb3a5fa553fc72e4327eeac26521b63fc2dbcd5 | [
"Unlicense"
] | null | null | null | dynamodb-streams-lambda-filter/lambda_filters/lambda_filters_stack.py | MauriceBrg/snippets | 7fb3a5fa553fc72e4327eeac26521b63fc2dbcd5 | [
"Unlicense"
] | null | null | null | import json
import os
from aws_cdk import (
# Duration,
Stack,
RemovalPolicy,
aws_dynamodb as dynamodb,
aws_lambda as _lambda,
aws_lambda_event_sources as lambda_events,
# aws_sqs as sqs,
)
from constructs import Construct
import constants
class LambdaFiltersStack(Stack):
def __init_... | 35.95935 | 113 | 0.567036 | import json
import os
from aws_cdk import (
Stack,
RemovalPolicy,
aws_dynamodb as dynamodb,
aws_lambda as _lambda,
aws_lambda_event_sources as lambda_events,
)
from constructs import Construct
import constants
class LambdaFiltersStack(Stack):
def __init__(self, scope: Construct, co... | true | true |
f757e972533d6c87bc341a8afec91fa69a89fb1f | 534 | py | Python | leetcode/MinimumPathSum.py | vry560/CompetativeCoding | 58053531d00cc9a709223274b2909b9f52ab166b | [
"MIT"
] | null | null | null | leetcode/MinimumPathSum.py | vry560/CompetativeCoding | 58053531d00cc9a709223274b2909b9f52ab166b | [
"MIT"
] | null | null | null | leetcode/MinimumPathSum.py | vry560/CompetativeCoding | 58053531d00cc9a709223274b2909b9f52ab166b | [
"MIT"
] | null | null | null | class Solution(object):
def minPathSum(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
slider = [0]*len(grid[0])
slider[0]=grid[0][0]
for i in range(1, len(grid[0])):
slider[i]=slider[i-1]+grid[0][i]
for i in range... | 29.666667 | 66 | 0.447566 | class Solution(object):
def minPathSum(self, grid):
slider = [0]*len(grid[0])
slider[0]=grid[0][0]
for i in range(1, len(grid[0])):
slider[i]=slider[i-1]+grid[0][i]
for i in range(1, len(grid)):
slider[0]=slider[0]+grid[i][0]
for j in ... | true | true |
f757e9b5369ef35c8e599bc682e65c7c5e3b7fa4 | 2,261 | py | Python | remme/genesis/__main__.py | FerrySchuller/remme-core | ca58bfcc5ff0ce6d15c2871a4e03e39f1268d789 | [
"Apache-2.0"
] | 129 | 2018-02-13T21:37:13.000Z | 2020-11-01T23:33:52.000Z | remme/genesis/__main__.py | FerrySchuller/remme-core | ca58bfcc5ff0ce6d15c2871a4e03e39f1268d789 | [
"Apache-2.0"
] | 95 | 2018-03-27T15:57:36.000Z | 2019-08-26T07:35:23.000Z | remme/genesis/__main__.py | FerrySchuller/remme-core | ca58bfcc5ff0ce6d15c2871a4e03e39f1268d789 | [
"Apache-2.0"
] | 30 | 2018-02-24T15:17:37.000Z | 2020-11-14T11:35:25.000Z | # Copyright 2018 REMME
#
# 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, softwa... | 40.375 | 119 | 0.731535 |
import argparse
from remme.protos.account_pb2 import AccountMethod
from remme.protos.transaction_pb2 import TransactionPayload
from remme.clients.account import AccountClient
from remme.tp.account import AccountHandler
from remme.settings import GENESIS_ADDRESS
from remme.settings.default import load_... | true | true |
f757eabf5819ef4c7e17775d295b191a6a1785fd | 11,507 | py | Python | fireup/algos/ddpg/ddpg.py | kashif/spinningup-pytorch | 8f3389c239c94b3ff46453f359061ae30d851ce8 | [
"MIT"
] | 18 | 2018-11-26T07:10:50.000Z | 2019-01-18T17:28:59.000Z | fireup/algos/ddpg/ddpg.py | kashif/spinningup-pytorch | 8f3389c239c94b3ff46453f359061ae30d851ce8 | [
"MIT"
] | 1 | 2019-01-18T08:59:13.000Z | 2019-01-18T09:14:12.000Z | fireup/algos/ddpg/ddpg.py | kashif/spinningup-pytorch | 8f3389c239c94b3ff46453f359061ae30d851ce8 | [
"MIT"
] | null | null | null | import time
import gym
import numpy as np
import torch
import torch.nn.functional as F
from fireup.algos.ddpg import core
from fireup.utils.logx import EpochLogger
class ReplayBuffer:
"""
A simple FIFO experience replay buffer for DDPG agents.
"""
def __init__(self, obs_dim, act_dim, size):
... | 35.297546 | 89 | 0.570522 | import time
import gym
import numpy as np
import torch
import torch.nn.functional as F
from fireup.algos.ddpg import core
from fireup.utils.logx import EpochLogger
class ReplayBuffer:
def __init__(self, obs_dim, act_dim, size):
self.obs1_buf = np.zeros([size, obs_dim], dtype=np.float32)
self.ob... | true | true |
f757eb03ec4c72e6ae541f3f3848f4084356b47e | 816 | py | Python | tools/showfields.py | gbroiles/si100 | 16c24e409ab29038c39d4e04876ddb27ec65f2a9 | [
"MIT"
] | 1 | 2020-03-06T17:07:11.000Z | 2020-03-06T17:07:11.000Z | tools/showfields.py | gbroiles/si100 | 16c24e409ab29038c39d4e04876ddb27ec65f2a9 | [
"MIT"
] | 2 | 2020-03-06T04:15:20.000Z | 2020-03-07T21:05:30.000Z | tools/showfields.py | gbroiles/si100 | 16c24e409ab29038c39d4e04876ddb27ec65f2a9 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
""" dumps name/value pairs for form fields in PDF """
import pdfrw
ANNOT_KEY = "/Annots"
ANNOT_FIELD_KEY = "/T"
ANNOT_VAL_KEY = "/V"
SUBTYPE_KEY = "/Subtype"
WIDGET_SUBTYPE_KEY = "/Widget"
PDF_NAME = "test.pdf"
template_pdf = pdfrw.PdfReader(PDF_NAME)
for page in range(0, len(template_pdf.pag... | 31.384615 | 57 | 0.606618 |
import pdfrw
ANNOT_KEY = "/Annots"
ANNOT_FIELD_KEY = "/T"
ANNOT_VAL_KEY = "/V"
SUBTYPE_KEY = "/Subtype"
WIDGET_SUBTYPE_KEY = "/Widget"
PDF_NAME = "test.pdf"
template_pdf = pdfrw.PdfReader(PDF_NAME)
for page in range(0, len(template_pdf.pages)):
annotations = template_pdf.pages[page][ANNOT_KEY]
for annotatio... | true | true |
f757eb381bde9853d47d941cd57631d3099bc217 | 6,260 | py | Python | purity_fb/purity_fb_1dot10/models/snmp_manager_post.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot10/models/snmp_manager_post.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot10/models/snmp_manager_post.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.10 Python SDK
Pure Storage FlashBlade REST 1.10 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.10
Contact... | 26.752137 | 205 | 0.564377 |
from pprint import pformat
from six import iteritems
import re
class SnmpManagerPost(object):
swagger_types = {
'host': 'str',
'notification': 'str',
'version': 'str',
'v2c': 'SnmpV2c',
'v3': 'SnmpV3'
}
attribute_map = {
'host': 'host',
'notif... | true | true |
f757ebd43fa0fbde3713b84624b2a152ab442c8c | 2,915 | py | Python | daily_programmer/364.py | davidlowryduda/pythonMiniProjects | e74c18720d9fe33fb97019d26a68f3e4c70f2bb6 | [
"MIT"
] | null | null | null | daily_programmer/364.py | davidlowryduda/pythonMiniProjects | e74c18720d9fe33fb97019d26a68f3e4c70f2bb6 | [
"MIT"
] | null | null | null | daily_programmer/364.py | davidlowryduda/pythonMiniProjects | e74c18720d9fe33fb97019d26a68f3e4c70f2bb6 | [
"MIT"
] | null | null | null | """
Description
===========
A Ducci sequence is a sequence of n-tuples of integers, sometimes known as "the
Diffy game", because it is based on sequences. Given an n-tuple of integers
(a_1, a_2, ... a_n) the next n-tuple in the sequence is formed by taking the
absolute differences of neighboring integers. Ducci sequen... | 26.743119 | 79 | 0.611321 | import sys
def ducci_step(seq):
seq = tuple(abs(seq[i] - seq[i-1]) for i in range(len(seq)))
seq = seq[1:] + seq[0:1]
return seq
def count_iters(seq, verbose=False):
seen = set()
while seq not in seen and set(seq) != {0} and len(seen) < 1000:
seen.add(seq)
if verbose:
p... | true | true |
f757ebe75a4a4c928d628e9e59c9dd20e1ccdf02 | 15,643 | py | Python | tools/challenge_validation.py | marinarierav-uab/foveabox | 1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:04:34.000Z | 2021-01-14T12:04:34.000Z | tools/challenge_validation.py | marinarierav-uab/foveabox | 1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5 | [
"Apache-2.0"
] | null | null | null | tools/challenge_validation.py | marinarierav-uab/foveabox | 1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import pandas as pd
from PIL import Image
from matplotlib import pyplot as plt
from scipy.ndimage.measurements import label
def calculate_average_classif_results(results_dict: dict, thresholds, output_file):
avg = pd.DataFrame(columns=["Thr", "TP", "FP", "TN", "FN", "Accuracy", "Conf... | 37.423445 | 145 | 0.585949 | import os
import numpy as np
import pandas as pd
from PIL import Image
from matplotlib import pyplot as plt
from scipy.ndimage.measurements import label
def calculate_average_classif_results(results_dict: dict, thresholds, output_file):
avg = pd.DataFrame(columns=["Thr", "TP", "FP", "TN", "FN", "Accuracy", "Conf... | true | true |
f757ec2ea456ef701213a4fabc591a9a2e62ac38 | 2,669 | py | Python | python/facial_expression.py | peara/cortex-v2-example | c885a0fd57d5fa9234b504c7a412674d291fd852 | [
"MIT"
] | 1 | 2021-01-13T22:03:06.000Z | 2021-01-13T22:03:06.000Z | python/facial_expression.py | peara/cortex-v2-example | c885a0fd57d5fa9234b504c7a412674d291fd852 | [
"MIT"
] | 1 | 2020-07-15T05:26:09.000Z | 2020-07-15T05:26:09.000Z | python/facial_expression.py | peara/cortex-v2-example | c885a0fd57d5fa9234b504c7a412674d291fd852 | [
"MIT"
] | 1 | 2020-07-15T05:12:08.000Z | 2020-07-15T05:12:08.000Z | from cortex import Cortex
class Train():
def __init__(self):
self.c = Cortex(user, debug_mode=True)
self.c.do_prepare_steps()
def train(self,
profile_name,
training_action,
number_of_train):
stream = ['sys']
self.c.sub_request(stream)
profiles = self.c.query_profile()
if profile_name not i... | 23.619469 | 90 | 0.624953 | from cortex import Cortex
class Train():
def __init__(self):
self.c = Cortex(user, debug_mode=True)
self.c.do_prepare_steps()
def train(self,
profile_name,
training_action,
number_of_train):
stream = ['sys']
self.c.sub_request(stream)
profiles = self.c.query_profile()
if profile_name not i... | true | true |
f757ec69046614cb1a3b6eebacd02cc90d78e47e | 1,008 | py | Python | Pacman/processor.py | dorlivne/PoPS | 088425d1a40a4c2e6856b07744281cd8ab9bce3b | [
"Unlicense"
] | 12 | 2020-01-18T11:23:13.000Z | 2022-01-24T22:59:59.000Z | Pacman/processor.py | dorlivne/PoPS | 088425d1a40a4c2e6856b07744281cd8ab9bce3b | [
"Unlicense"
] | 12 | 2019-12-02T08:34:10.000Z | 2022-02-09T23:35:32.000Z | Pacman/processor.py | dorlivne/PoPS | 088425d1a40a4c2e6856b07744281cd8ab9bce3b | [
"Unlicense"
] | 7 | 2020-01-21T07:23:30.000Z | 2021-12-27T08:00:51.000Z | import numpy as np
from PIL import Image
from copy import deepcopy
INPUT_SHAPE = (84, 84)
def init_state():
# return np.zeros((84, 84, 4))
return np.zeros((4, 84, 84))
def append_frame(state, frame):
# new_state = deepcopy(state)
# new_state[:, :, :-1] = state[:, :, 1:]
# new_state[:, :, -1] = fr... | 27.243243 | 95 | 0.659722 | import numpy as np
from PIL import Image
from copy import deepcopy
INPUT_SHAPE = (84, 84)
def init_state():
return np.zeros((4, 84, 84))
def append_frame(state, frame):
new_state = deepcopy(state)
new_state[:-1, :, :, ] = state[1:, :, :]
new_state[-1, :, :] = frame
del state
... | true | true |
f757edc73292f04076b852f29785c59c14e71578 | 531 | py | Python | django_comments_tree/conf/__init__.py | sharpertool/django-comments-tree | 2f86f694d127b1722baf7d025eb5fd22b184b88f | [
"BSD-2-Clause"
] | 13 | 2019-06-03T07:39:34.000Z | 2021-11-10T06:55:35.000Z | django_comments_tree/conf/__init__.py | sharpertool/django-comments-tree | 2f86f694d127b1722baf7d025eb5fd22b184b88f | [
"BSD-2-Clause"
] | 2 | 2019-08-08T05:24:28.000Z | 2019-12-23T23:34:58.000Z | django_comments_tree/conf/__init__.py | sharpertool/django-comments-tree | 2f86f694d127b1722baf7d025eb5fd22b184b88f | [
"BSD-2-Clause"
] | 5 | 2019-12-20T14:57:14.000Z | 2021-03-22T18:52:40.000Z | from django.conf import settings as django_settings
from django.utils.functional import LazyObject
from django_comments_tree.conf import defaults as app_settings
class LazySettings(LazyObject):
def _setup(self):
self._wrapped = Settings(app_settings, django_settings)
class Settings(object):
def __i... | 25.285714 | 63 | 0.679849 | from django.conf import settings as django_settings
from django.utils.functional import LazyObject
from django_comments_tree.conf import defaults as app_settings
class LazySettings(LazyObject):
def _setup(self):
self._wrapped = Settings(app_settings, django_settings)
class Settings(object):
def __i... | true | true |
f757ef59c196f39b498ccaccfb0e24d31e99a25a | 150 | py | Python | ifitwala_ed/ifitwala_integration/doctype/plaid_settings/test_plaid_settings.py | mohsinalimat/ifitwala_ed | 8927695ed9dee36e56571c442ebbe6e6431c7d46 | [
"MIT"
] | 13 | 2020-09-02T10:27:57.000Z | 2022-03-11T15:28:46.000Z | ifitwala_ed/ifitwala_integration/doctype/plaid_settings/test_plaid_settings.py | mohsinalimat/ifitwala_ed | 8927695ed9dee36e56571c442ebbe6e6431c7d46 | [
"MIT"
] | 43 | 2020-09-02T07:00:42.000Z | 2021-07-05T13:22:58.000Z | ifitwala_ed/ifitwala_integration/doctype/plaid_settings/test_plaid_settings.py | mohsinalimat/ifitwala_ed | 8927695ed9dee36e56571c442ebbe6e6431c7d46 | [
"MIT"
] | 6 | 2020-10-19T01:02:18.000Z | 2022-03-11T15:28:47.000Z | # Copyright (c) 2021, ifitwala and Contributors
# See license.txt
# import frappe
import unittest
class TestPlaidSettings(unittest.TestCase):
pass
| 16.666667 | 47 | 0.786667 |
import unittest
class TestPlaidSettings(unittest.TestCase):
pass
| true | true |
f757efe44cb20726543f9df1526381a323c49ccb | 8,511 | py | Python | harness/tests/cli/test_cli.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | null | null | null | harness/tests/cli/test_cli.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | null | null | null | harness/tests/cli/test_cli.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
import uuid
from pathlib import Path
import pytest
import requests
import requests_mock
import determined.cli.cli as cli
import determined.cli.command as command
from determined.common import constants, context
from tests.filetree import FileTree
MINIMAL_CONFIG = '{"description": "test"}'
... | 30.180851 | 100 | 0.541769 | import os
import tempfile
import uuid
from pathlib import Path
import pytest
import requests
import requests_mock
import determined.cli.cli as cli
import determined.cli.command as command
from determined.common import constants, context
from tests.filetree import FileTree
MINIMAL_CONFIG = '{"description": "test"}'
... | true | true |
f757f02640e7889486128f6a2f202845a6387efa | 16,696 | py | Python | dns/rdtypes/svcbbase.py | Ashiq5/dnspython | 5449af5318d88bada34f661247f3bcb16f58f057 | [
"ISC"
] | 250 | 2016-12-29T02:43:04.000Z | 2022-03-31T05:51:23.000Z | dns/rdtypes/svcbbase.py | Ashiq5/dnspython | 5449af5318d88bada34f661247f3bcb16f58f057 | [
"ISC"
] | 29 | 2021-08-17T19:09:23.000Z | 2022-03-29T19:08:23.000Z | dns/rdtypes/svcbbase.py | Ashiq5/dnspython | 5449af5318d88bada34f661247f3bcb16f58f057 | [
"ISC"
] | 86 | 2016-12-29T06:39:34.000Z | 2021-12-12T20:07:39.000Z | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
import base64
import enum
import io
import struct
import dns.enum
import dns.exception
import dns.immutable
import dns.ipv4
import dns.ipv6
import dns.name
import dns.rdata
import dns.tokenizer
import dns.wire
# Until there is an RFC, this m... | 30.691176 | 79 | 0.580798 |
import base64
import enum
import io
import struct
import dns.enum
import dns.exception
import dns.immutable
import dns.ipv4
import dns.ipv6
import dns.name
import dns.rdata
import dns.tokenizer
import dns.wire
class UnknownParamKey(dns.exception.DNSException):
class ParamKey(dns.enum.IntEnum):
MANDATORY ... | true | true |
f757f093137632af54b1137cbe072f8ea3bb37b1 | 524 | py | Python | genetic/recombination/_recombination.py | skoblov-lab/genetic | 98255cbaf7b697c6f3f00dd2618fc1ee02ddf0c0 | [
"MIT"
] | 3 | 2019-06-22T15:34:56.000Z | 2021-12-18T01:22:26.000Z | genetic/recombination/_recombination.py | skoblov-lab/genetic | 98255cbaf7b697c6f3f00dd2618fc1ee02ddf0c0 | [
"MIT"
] | null | null | null | genetic/recombination/_recombination.py | skoblov-lab/genetic | 98255cbaf7b697c6f3f00dd2618fc1ee02ddf0c0 | [
"MIT"
] | 1 | 2020-12-12T12:47:19.000Z | 2020-12-12T12:47:19.000Z | import numpy as np
__all__ = ["binomial"]
def binomial(chr1, chr2):
"""
Picks one allele or the other with 50% success
:type chr1: Sequence
:type chr2: Sequence
"""
if len(chr1) != len(chr2):
raise ValueError("Incompatible chromosome lengths")
choice_mask = np.random.binomial(1, ... | 20.96 | 74 | 0.650763 | import numpy as np
__all__ = ["binomial"]
def binomial(chr1, chr2):
if len(chr1) != len(chr2):
raise ValueError("Incompatible chromosome lengths")
choice_mask = np.random.binomial(1, 0.5, len(chr1))
return [a if ch else b for (ch, a, b) in zip(choice_mask, chr1, chr2)]
def breakpoint(chr1, chr... | true | true |
f757f1148f81bdbbc52d89d3089077795d7d798f | 6,063 | py | Python | riko/modules/subelement.py | sottom/riko | 7898b850b45451420feab33380d252be18e77714 | [
"MIT"
] | null | null | null | riko/modules/subelement.py | sottom/riko | 7898b850b45451420feab33380d252be18e77714 | [
"MIT"
] | null | null | null | riko/modules/subelement.py | sottom/riko | 7898b850b45451420feab33380d252be18e77714 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
riko.modules.subelement
~~~~~~~~~~~~~~~~~~~~~~~
Provides functions for extracting sub-elements from an item
Sometimes the data you need from a stream is buried deep in its hierarchy. You
need to extract just those select sub-elements from the stream. This is what ... | 32.25 | 80 | 0.541316 |
from . import processor
from riko.utils import gen_items
import pygogo as gogo
OPTS = {'emit': True}
DEFAULTS = {'token_key': 'content'}
logger = gogo.Gogo(__name__, monolog=True).logger
def parser(item, objconf, skip=False, **kwargs):
if skip:
stream = kwargs['stream']
else:
element = ite... | true | true |
f757f5f9c4a985b68fbadf6387397a7a4394cec7 | 53 | py | Python | selenium/deleteS3Images.py | InfiniteRandomVariable/hello-world | 6ca4e2f4319c45d5d05b5719f0390f7cb16cca6e | [
"Apache-2.0"
] | null | null | null | selenium/deleteS3Images.py | InfiniteRandomVariable/hello-world | 6ca4e2f4319c45d5d05b5719f0390f7cb16cca6e | [
"Apache-2.0"
] | null | null | null | selenium/deleteS3Images.py | InfiniteRandomVariable/hello-world | 6ca4e2f4319c45d5d05b5719f0390f7cb16cca6e | [
"Apache-2.0"
] | null | null | null | import s3Interface
s3Interface.deleteProcedure()
| 8.833333 | 29 | 0.811321 | import s3Interface
s3Interface.deleteProcedure()
| true | true |
f757f7a17fda99050a4427638352650e01ec68f1 | 5,629 | py | Python | readme/migrations/0012_save_safe_article.py | audax/pypo | 58ce116bf76d50faa34977a80075d488736ffcc8 | [
"Apache-2.0"
] | 25 | 2015-02-12T06:45:24.000Z | 2021-12-30T18:03:10.000Z | readme/migrations/0012_save_safe_article.py | audax/pypo | 58ce116bf76d50faa34977a80075d488736ffcc8 | [
"Apache-2.0"
] | 4 | 2015-01-19T13:38:04.000Z | 2016-04-17T16:06:46.000Z | readme/migrations/0012_save_safe_article.py | audax/pypo | 58ce116bf76d50faa34977a80075d488736ffcc8 | [
"Apache-2.0"
] | 1 | 2016-08-15T01:27:41.000Z | 2016-08-15T01:27:41.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from readme.models import Item
class Migration(DataMigration):
def forwards(self, orm):
for item in orm.Item.objects.all():
item.s... | 63.965909 | 193 | 0.56049 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from readme.models import Item
class Migration(DataMigration):
def forwards(self, orm):
for item in orm.Item.objects.all():
item.safe_article = Item.get_... | true | true |
f757f7e7395931c2b5b8c1b7d554637202ea7803 | 823 | py | Python | migrations/versions/58556190cb24_initial_migration.py | samwel-chege/Pitches | 06e8ad720e123958b64d8fef24a6eea3bee22715 | [
"MIT"
] | null | null | null | migrations/versions/58556190cb24_initial_migration.py | samwel-chege/Pitches | 06e8ad720e123958b64d8fef24a6eea3bee22715 | [
"MIT"
] | null | null | null | migrations/versions/58556190cb24_initial_migration.py | samwel-chege/Pitches | 06e8ad720e123958b64d8fef24a6eea3bee22715 | [
"MIT"
] | null | null | null | """Initial Migration
Revision ID: 58556190cb24
Revises: 4a167476d5f7
Create Date: 2021-08-20 12:30:57.334610
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '58556190cb24'
down_revision = '4a167476d5f7'
branch_labels = None
depends_on = None
def upgrade():
... | 26.548387 | 112 | 0.701094 | from alembic import op
import sqlalchemy as sa
revision = '58556190cb24'
down_revision = '4a167476d5f7'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f757f9468e06f193ec94fa84d6aed912d1508a2c | 1,395 | py | Python | swagger_client/__init__.py | ScsApiTribe/payments-api-python-sdk | 24c784dd2278d80ec741de6fde53d68038de8087 | [
"Apache-2.0"
] | null | null | null | swagger_client/__init__.py | ScsApiTribe/payments-api-python-sdk | 24c784dd2278d80ec741de6fde53d68038de8087 | [
"Apache-2.0"
] | null | null | null | swagger_client/__init__.py | ScsApiTribe/payments-api-python-sdk | 24c784dd2278d80ec741de6fde53d68038de8087 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Payments
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 5.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
yo... | 31.704545 | 104 | 0.779928 |
from __future__ import absolute_import
from .models.error import Error
from .models.payment_details import PaymentDetails
from .models.payment_request import PaymentRequest
from .models.payment_request_payer_id import PaymentRequestPayerId
from .models.payment_status import PaymentStatus
from .models.payments_coll... | true | true |
f757fa727071b71abb431669fc2c610eb978109e | 956 | py | Python | algorithmic-toolbox/2_greedy_algorithms_starter_files/covering_segments.py | richardson-souza/coursera-dsa | 0b77c5420b40efb80cded4405960baf75d6a334b | [
"MIT"
] | null | null | null | algorithmic-toolbox/2_greedy_algorithms_starter_files/covering_segments.py | richardson-souza/coursera-dsa | 0b77c5420b40efb80cded4405960baf75d6a334b | [
"MIT"
] | null | null | null | algorithmic-toolbox/2_greedy_algorithms_starter_files/covering_segments.py | richardson-souza/coursera-dsa | 0b77c5420b40efb80cded4405960baf75d6a334b | [
"MIT"
] | null | null | null | # Uses python3
import sys
from collections import namedtuple
Segment = namedtuple('Segment', 'start end')
def optimal_points(segments):
points = []
segments = list(map(list, segments))
segments.sort(key=lambda s: s[1], reverse=False)
for i in range(len(segments)):
if (i == 0) or (segments[i]... | 27.314286 | 69 | 0.526151 |
import sys
from collections import namedtuple
Segment = namedtuple('Segment', 'start end')
def optimal_points(segments):
points = []
segments = list(map(list, segments))
segments.sort(key=lambda s: s[1], reverse=False)
for i in range(len(segments)):
if (i == 0) or (segments[i][0] != 0 and s... | true | true |
f757fc7349474db8c1c93e51f28501ad18eba87e | 1,774 | py | Python | test/projects/test_maximum_array_rotation.py | jrg94/sample-programs-in-every-language | 507fea4e11ba83b470c31f7bb50234a1a608c8a5 | [
"MIT"
] | 51 | 2018-05-02T07:28:21.000Z | 2018-08-09T08:26:37.000Z | test/projects/test_maximum_array_rotation.py | jrg94/sample-programs-in-every-language | 507fea4e11ba83b470c31f7bb50234a1a608c8a5 | [
"MIT"
] | 252 | 2018-04-11T01:52:37.000Z | 2018-08-10T18:50:30.000Z | test/projects/test_maximum_array_rotation.py | jrg94/sample-programs-in-every-language | 507fea4e11ba83b470c31f7bb50234a1a608c8a5 | [
"MIT"
] | 27 | 2018-04-29T19:50:59.000Z | 2018-07-27T14:36:14.000Z | import pytest
from runner import ProjectType
from glotter import project_test, project_fixture
from test.utilities import clean_list
invalid_permutations = (
'description,in_params,expected', [
(
'no input',
None,
'Usage: please provide a list of integers (e.g. "8, 3, 1... | 29.081967 | 91 | 0.611048 | import pytest
from runner import ProjectType
from glotter import project_test, project_fixture
from test.utilities import clean_list
invalid_permutations = (
'description,in_params,expected', [
(
'no input',
None,
'Usage: please provide a list of integers (e.g. "8, 3, 1... | true | true |
f757fc9860856b83d447855b772cf4d3e4f88e24 | 1,753 | py | Python | tests/test_refund.py | jayvdb/django-restframework-stripe | fe5f75c24b944e5e05c4fd96583e871d111ec47b | [
"BSD-2-Clause"
] | 1 | 2017-07-14T22:41:41.000Z | 2017-07-14T22:41:41.000Z | tests/test_refund.py | jayvdb/django-restframework-stripe | fe5f75c24b944e5e05c4fd96583e871d111ec47b | [
"BSD-2-Clause"
] | 2 | 2016-02-18T23:31:58.000Z | 2020-06-30T15:49:32.000Z | tests/test_refund.py | jayvdb/django-restframework-stripe | fe5f75c24b944e5e05c4fd96583e871d111ec47b | [
"BSD-2-Clause"
] | 3 | 2016-02-05T20:17:23.000Z | 2020-05-15T13:26:09.000Z | from unittest import mock
from django.core.exceptions import ValidationError
import pytest
from model_mommy import mommy
import stripe
from rest_framework.reverse import reverse
from restframework_stripe.test import get_mock_resource
from restframework_stripe import models
@mock.patch("stripe.Refund.create")
@pyt... | 28.274194 | 88 | 0.73474 | from unittest import mock
from django.core.exceptions import ValidationError
import pytest
from model_mommy import mommy
import stripe
from rest_framework.reverse import reverse
from restframework_stripe.test import get_mock_resource
from restframework_stripe import models
@mock.patch("stripe.Refund.create")
@pyt... | true | true |
f757fe3088e5d8b92ca5c0e3d366e6b602d2d4b3 | 2,927 | py | Python | vnpy/app/algo_trading/algos/twap_algo.py | dennislwm/pyalgotrader | 8a58d146d05033fe1699d0711d243f10c710ad13 | [
"MIT"
] | 102 | 2019-09-30T10:45:05.000Z | 2022-03-16T05:39:41.000Z | vnpy/app/algo_trading/algos/twap_algo.py | day0market/vnpy_eng | 8a58d146d05033fe1699d0711d243f10c710ad13 | [
"MIT"
] | 6 | 2019-10-07T07:49:54.000Z | 2020-05-23T02:11:21.000Z | vnpy/app/algo_trading/algos/twap_algo.py | dennislwm/pyalgotrader | 8a58d146d05033fe1699d0711d243f10c710ad13 | [
"MIT"
] | 43 | 2019-09-30T15:04:46.000Z | 2022-01-26T02:09:57.000Z | from vnpy.trader.constant import Offset, Direction
from vnpy.trader.object import TradeData
from vnpy.trader.engine import BaseEngine
from vnpy.app.algo_trading import AlgoTemplate
class TwapAlgo(AlgoTemplate):
""""""
display_name = "TWAP time weighted average "
default_setting = {
"vt_symbol"... | 27.613208 | 115 | 0.5644 | from vnpy.trader.constant import Offset, Direction
from vnpy.trader.object import TradeData
from vnpy.trader.engine import BaseEngine
from vnpy.app.algo_trading import AlgoTemplate
class TwapAlgo(AlgoTemplate):
display_name = "TWAP time weighted average "
default_setting = {
"vt_symbol": "",
... | true | true |
f757fe9021acc2ce7fa0f131432e8c65c0d907d3 | 20,121 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/courseware/tests/test_about.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/courseware/tests/test_about.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/courseware/tests/test_about.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Test the about xblock
"""
import datetime
from unittest import mock
from unittest.mock import patch
import ddt
import pytz
from ccx_keys.locator import CCXLocator
from django.conf import settings
from django.test.utils import override_settings
from django.urls import reverse
from milestones.tests.utils import Mi... | 40.648485 | 255 | 0.676905 |
import datetime
from unittest import mock
from unittest.mock import patch
import ddt
import pytz
from ccx_keys.locator import CCXLocator
from django.conf import settings
from django.test.utils import override_settings
from django.urls import reverse
from milestones.tests.utils import MilestonesTestCaseMixin
from waf... | true | true |
f757fec92af94fbcd9fa8ac43fcb658da0479ba2 | 7,598 | py | Python | cryptoauthlib/python/setup.py | pjaos/atca | 1a6d04468706235c2c8c3b97f6ce3df5f1fba4ec | [
"Apache-2.0"
] | 8 | 2018-01-30T16:24:37.000Z | 2022-02-25T12:50:22.000Z | cryptoauthlib/python/setup.py | pjaos/atca | 1a6d04468706235c2c8c3b97f6ce3df5f1fba4ec | [
"Apache-2.0"
] | 6 | 2018-03-29T15:07:39.000Z | 2022-02-25T11:36:06.000Z | cryptoauthlib/python/setup.py | pjaos/atca | 1a6d04468706235c2c8c3b97f6ce3df5f1fba4ec | [
"Apache-2.0"
] | 3 | 2018-04-10T11:17:10.000Z | 2021-11-01T23:43:59.000Z | from setuptools import setup, Distribution
from setuptools.command.install import install
from setuptools.command.build_ext import build_ext
from setuptools.extension import Extension
import sys
import subprocess
import os
import glob
import shutil
from ctypes import cdll
_NAME = 'cryptoauthlib'
_DESCRIPTION = 'Pytho... | 35.504673 | 158 | 0.632272 | from setuptools import setup, Distribution
from setuptools.command.install import install
from setuptools.command.build_ext import build_ext
from setuptools.extension import Extension
import sys
import subprocess
import os
import glob
import shutil
from ctypes import cdll
_NAME = 'cryptoauthlib'
_DESCRIPTION = 'Pytho... | true | true |
f757ff4a3ebd44dc759440302f4a3e9ab88e2409 | 11,895 | py | Python | tensorflow/python/eager/function_cache.py | kim-com/tensorflow | 4301e3f34b8da528c58bdafe05cd66c8a55fce9e | [
"Apache-2.0"
] | 1 | 2022-03-20T04:34:49.000Z | 2022-03-20T04:34:49.000Z | tensorflow/python/eager/function_cache.py | kim-com/tensorflow | 4301e3f34b8da528c58bdafe05cd66c8a55fce9e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/function_cache.py | kim-com/tensorflow | 4301e3f34b8da528c58bdafe05cd66c8a55fce9e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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.056075 | 111 | 0.731484 |
import collections
from typing import Optional, Sequence, Tuple
from tensorflow.core.function import trace_type
from tensorflow.core.function.polymorphism import type_dispatch
from tensorflow.python.eager import context
from tensorflow.python.framework import device as pydev
from tensorflow.python.frame... | true | true |
f7580000d041ab30f4cdf66c28ca1b2afc5c0c1b | 17,176 | py | Python | examples/lm1b/train.py | skye/flax | 23a91dbc27dd182e26f196546468d33238ca5735 | [
"Apache-2.0"
] | 1 | 2020-10-29T14:21:48.000Z | 2020-10-29T14:21:48.000Z | examples/lm1b/train.py | skye/flax | 23a91dbc27dd182e26f196546468d33238ca5735 | [
"Apache-2.0"
] | null | null | null | examples/lm1b/train.py | skye/flax | 23a91dbc27dd182e26f196546468d33238ca5735 | [
"Apache-2.0"
] | 1 | 2020-07-28T12:14:45.000Z | 2020-07-28T12:14:45.000Z | # Copyright 2020 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 35.196721 | 109 | 0.701677 |
import functools
import itertools
import os
import time
from absl import app
from absl import flags
from absl import logging
from flax import jax_utils
from flax import nn
from flax import optim
import decode
import input_pipeline
import models
from flax.metrics import tensorboard
from flax.training imp... | true | true |
f7580008149e4c96e78a5fe1ba58c3bfd83be6ba | 894 | py | Python | isi_sdk_8_1_0/test/test_event_eventlist.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/test/test_event_eventlist.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/test/test_event_eventlist.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... | 21.804878 | 85 | 0.702461 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from isi_sdk_8_1_0.models.event_eventlist import EventEventlist
from isi_sdk_8_1_0.rest import ApiException
class TestEventEventlist(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.