hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f2829a2b29183af9ed19d23d75a62844ad48ec | 2,239 | py | Python | test/test_tft_match.py | bangingheads/Pyot | d133e93d96b6f51a3e22da182b9a9d738442e760 | [
"MIT"
] | 1 | 2021-02-17T01:02:08.000Z | 2021-02-17T01:02:08.000Z | test/test_tft_match.py | bangingheads/Pyot | d133e93d96b6f51a3e22da182b9a9d738442e760 | [
"MIT"
] | null | null | null | test/test_tft_match.py | bangingheads/Pyot | d133e93d96b6f51a3e22da182b9a9d738442e760 | [
"MIT"
] | null | null | null | from pyot.utils import loop_run
from pyot.models import tft
from datetime import datetime, timedelta
async def async_match_history():
summoner = await tft.Summoner(name="Morimorph", platform="na1").get()
history = await summoner.match_history.get()
assert isinstance(history.puuid, str)
for i in history... | 38.603448 | 73 | 0.685574 | from pyot.utils import loop_run
from pyot.models import tft
from datetime import datetime, timedelta
async def async_match_history():
summoner = await tft.Summoner(name="Morimorph", platform="na1").get()
history = await summoner.match_history.get()
assert isinstance(history.puuid, str)
for i in history... | true | true |
f7f282d72f913bdd6b6651b4ec7edab88488ec32 | 1,199 | py | Python | previous python implementation/outputSimple.py | georghess/fastmurty | ec9f862268b8cee3dd7d3c229b5901a137e692f1 | [
"MIT"
] | 21 | 2019-07-07T21:01:55.000Z | 2021-12-07T10:08:53.000Z | previous python implementation/outputSimple.py | georghess/fastmurty | ec9f862268b8cee3dd7d3c229b5901a137e692f1 | [
"MIT"
] | 4 | 2020-03-02T09:43:42.000Z | 2021-06-23T15:39:43.000Z | previous python implementation/outputSimple.py | georghess/fastmurty | ec9f862268b8cee3dd7d3c229b5901a137e692f1 | [
"MIT"
] | 8 | 2019-04-13T11:01:39.000Z | 2022-02-04T16:23:01.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
last mod 3/7/19
"""
import numba as nb
@nb.jit(nb.i8(nb.i8[:,:], nb.b1[:], nb.i8[:], nb.i8[:], nb.i8[:,:], nb.i8))
def processOutput(matches, hypothesis, x, y, backward_index, n_matches):
"""
This one removes matches that are found after the limit has been hi... | 31.552632 | 75 | 0.531276 |
import numba as nb
@nb.jit(nb.i8(nb.i8[:,:], nb.b1[:], nb.i8[:], nb.i8[:], nb.i8[:,:], nb.i8))
def processOutput(matches, hypothesis, x, y, backward_index, n_matches):
for i,j in enumerate(x):
if j == -2: continue
backidx = backward_index[i,j]
if backidx == -1:
if n_matches =... | true | true |
f7f283cd56ff01b63646d591743da9ab0111937d | 7,074 | py | Python | x2paddle/project_convertor/pytorch/torch2paddle/vision_transforms.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 2 | 2019-03-15T06:49:08.000Z | 2019-03-15T06:49:08.000Z | x2paddle/project_convertor/pytorch/torch2paddle/vision_transforms.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | null | null | null | x2paddle/project_convertor/pytorch/torch2paddle/vision_transforms.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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 appl... | 37.036649 | 96 | 0.577184 |
import paddle
import PIL
import numbers
import numpy as np
from PIL import Image
from paddle.vision.transforms import BaseTransform
from paddle.vision.transforms import functional as F
class ToPILImage(BaseTransform):
def __init__(self, mode=None, keys=None):
super(ToTensor, self).__init__(k... | true | true |
f7f283ed05bf455cf2dd5fcf74d9a9cb670a23e3 | 6,523 | py | Python | framework/scripts/tests/Teston/adapters/connection.py | hashnfv/hashnfv-onosfw | 2507e130fd41d86f6c7116b6664fe9c28aea6476 | [
"Apache-2.0"
] | null | null | null | framework/scripts/tests/Teston/adapters/connection.py | hashnfv/hashnfv-onosfw | 2507e130fd41d86f6c7116b6664fe9c28aea6476 | [
"Apache-2.0"
] | null | null | null | framework/scripts/tests/Teston/adapters/connection.py | hashnfv/hashnfv-onosfw | 2507e130fd41d86f6c7116b6664fe9c28aea6476 | [
"Apache-2.0"
] | null | null | null | """
Description:
This file is used to make connections
Include ssh & exchange public-key to each other so that
it can run without password
lanqinglong@huawei.com
"""
import os
import time
import pexpect
import re
import sys
from foundation import foundation
class connection( foundation ):
def __i... | 33.973958 | 82 | 0.527211 | """
Description:
This file is used to make connections
Include ssh & exchange public-key to each other so that
it can run without password
lanqinglong@huawei.com
"""
import os
import time
import pexpect
import re
import sys
from foundation import foundation
class connection( foundation ):
def __i... | false | true |
f7f284e0895ee110fb0fc5444aad176749ef3397 | 42,081 | py | Python | opy/compiler2/pycodegen.py | darius/oil | 0942ce4e0cbfaec7ee1523772ee94abf3f236799 | [
"Apache-2.0"
] | null | null | null | opy/compiler2/pycodegen.py | darius/oil | 0942ce4e0cbfaec7ee1523772ee94abf3f236799 | [
"Apache-2.0"
] | 1 | 2018-05-28T21:30:28.000Z | 2018-05-28T21:30:28.000Z | opy/compiler2/pycodegen.py | darius/oil | 0942ce4e0cbfaec7ee1523772ee94abf3f236799 | [
"Apache-2.0"
] | null | null | null | import itertools
from . import ast, pyassem, misc
from .visitor import ASTVisitor
from .consts import (
SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICIT, SC_FREE, SC_CELL)
# NOTE: removed CO_NESTED because it is unused
from .consts import (
CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,
CO_GENERATOR, CO_FUTURE... | 30.079342 | 81 | 0.573299 | import itertools
from . import ast, pyassem, misc
from .visitor import ASTVisitor
from .consts import (
SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICIT, SC_FREE, SC_CELL)
from .consts import (
CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,
CO_GENERATOR, CO_FUTURE_DIVISION,
CO_FUTURE_ABSIMPORT, CO_FUTURE_... | false | true |
f7f285083b66929427d71915da9ecd2d20f2994d | 3,023 | py | Python | external/scons-local-3.0.3/scons-local-3.0.3/SCons/Tool/pdf.py | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | external/scons-local-3.0.3/scons-local-3.0.3/SCons/Tool/pdf.py | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | external/scons-local-3.0.3/scons-local-3.0.3/SCons/Tool/pdf.py | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | """SCons.Tool.pdf
Common PDF Builder definition for various other Tool modules that use it.
Add an explicit action to run epstopdf to convert .eps files to .pdf
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software a... | 38.265823 | 115 | 0.657625 |
__revision__ = "src/engine/SCons/Tool/pdf.py 27552f9e8d59c13c3567f2bd380b74e34ee25324 2019-01-08 02:59:02 bdbaddog"
import SCons.Builder
import SCons.Tool
PDFBuilder = None
EpsPdfAction = SCons.Action.Action('$EPSTOPDFCOM', '$EPSTOPDFCOMSTR')
def generate(env):
try:
env['BUILDERS... | true | true |
f7f285902157b3b30ead5a4870f33d8709dfb570 | 5,464 | py | Python | data_gen_label.py | huhuzwxy/keras_classfication | 9fc69f8f13fe26f8048c94d5d71e842c47222bbc | [
"MIT"
] | 2 | 2020-12-22T08:23:59.000Z | 2021-03-22T06:40:56.000Z | data_gen_label.py | zywvvd/keras_classfication | 0a2c801f210141e447ef3c5346ce44e2e33125bb | [
"Apache-2.0"
] | null | null | null | data_gen_label.py | zywvvd/keras_classfication | 0a2c801f210141e447ef3c5346ce44e2e33125bb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import codecs
import math
import os
import random
from glob import glob
import keras
import numpy as np
from PIL import Image
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import np_utils, Sequence
from sklearn.model_selection import train_test_split
from random_eras... | 33.115152 | 117 | 0.631955 |
import codecs
import math
import os
import random
from glob import glob
import keras
import numpy as np
from PIL import Image
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import np_utils, Sequence
from sklearn.model_selection import train_test_split
from random_eraser import get_random_er... | true | true |
f7f2864ddd9d77b1b8689405f2972ecf2e49cd0a | 1,404 | py | Python | bldr/gen/history.py | bldr-cmd/bldr-cmd | 300750fbccc2987efd23f69b7b2d76d8563e2995 | [
"Apache-2.0"
] | null | null | null | bldr/gen/history.py | bldr-cmd/bldr-cmd | 300750fbccc2987efd23f69b7b2d76d8563e2995 | [
"Apache-2.0"
] | null | null | null | bldr/gen/history.py | bldr-cmd/bldr-cmd | 300750fbccc2987efd23f69b7b2d76d8563e2995 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from hashlib import sha256
import os
import tarfile
import bldr.util
def targz_pack_atomic(tgz_next_name: Path, tgz_name: Path, source_path: Path):
"""
Atomically create a new .tar.gz by writing to the "next" .tar.gz
and renaming when complete
"""
targz_pack(tgz_next_name,... | 27 | 78 | 0.69302 | from pathlib import Path
from hashlib import sha256
import os
import tarfile
import bldr.util
def targz_pack_atomic(tgz_next_name: Path, tgz_name: Path, source_path: Path):
targz_pack(tgz_next_name, source_path)
if tgz_name.exists():
tgz_name.unlink()
tgz_next_name.rename(tgz_name)
def targz_pa... | true | true |
f7f286fa6520add84a0cd26c1ecf8cb4421b8e90 | 2,279 | py | Python | deepchem/molnet/load_function/toxcast_datasets.py | nitinprakash96/deepchem | 8c85d155a8a8dcf4e8e675920860a5bbffdcf2d5 | [
"MIT"
] | null | null | null | deepchem/molnet/load_function/toxcast_datasets.py | nitinprakash96/deepchem | 8c85d155a8a8dcf4e8e675920860a5bbffdcf2d5 | [
"MIT"
] | null | null | null | deepchem/molnet/load_function/toxcast_datasets.py | nitinprakash96/deepchem | 8c85d155a8a8dcf4e8e675920860a5bbffdcf2d5 | [
"MIT"
] | null | null | null | """
TOXCAST dataset loader.
"""
from __future__ import division
from __future__ import unicode_literals
import os
import deepchem
def load_toxcast(featurizer='ECFP', split='index', reload=True):
data_dir = deepchem.utils.get_data_dir()
if reload:
save_dir = os.path.join(data_dir, "toxcast/" + featurizer + "... | 32.098592 | 92 | 0.715665 | from __future__ import division
from __future__ import unicode_literals
import os
import deepchem
def load_toxcast(featurizer='ECFP', split='index', reload=True):
data_dir = deepchem.utils.get_data_dir()
if reload:
save_dir = os.path.join(data_dir, "toxcast/" + featurizer + "/" + split)
dataset_file = os... | true | true |
f7f287cb426ec28338361ccb26557bd810e9a454 | 1,135 | py | Python | app/core/models.py | hussainanjar/recipe-app-api | bf6fe3f2fb0f7aafd88ca0e07137fc8748062b72 | [
"MIT"
] | null | null | null | app/core/models.py | hussainanjar/recipe-app-api | bf6fe3f2fb0f7aafd88ca0e07137fc8748062b72 | [
"MIT"
] | null | null | null | app/core/models.py | hussainanjar/recipe-app-api | bf6fe3f2fb0f7aafd88ca0e07137fc8748062b72 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Create and save new user"""
if not ... | 29.868421 | 76 | 0.657269 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
if not email:
raise ValueError("Em... | true | true |
f7f288c005df085929c000ceeb4faf3de7677ac2 | 6,306 | py | Python | py/selenium/webdriver/safari/webdriver.py | TamsilAmani/selenium | 65b7a240185e1de4bc7693c69cd60cca11c3903a | [
"Apache-2.0"
] | null | null | null | py/selenium/webdriver/safari/webdriver.py | TamsilAmani/selenium | 65b7a240185e1de4bc7693c69cd60cca11c3903a | [
"Apache-2.0"
] | null | null | null | py/selenium/webdriver/safari/webdriver.py | TamsilAmani/selenium | 65b7a240185e1de4bc7693c69cd60cca11c3903a | [
"Apache-2.0"
] | null | null | null | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 43.191781 | 150 | 0.681097 |
import http.client as http_client
import warnings
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .options import Options
from .s... | true | true |
f7f28a31beb470086db47eca1a963a9e8e01da98 | 2,239 | py | Python | citrix_hypervisor/tests/test_metrics.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | citrix_hypervisor/tests/test_metrics.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | citrix_hypervisor/tests/test_metrics.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import logging
import mock
import pytest
from datadog_checks.citrix_hypervisor import metrics
logger = logging.getLogger(__name__)
@pytest.mark.unit
@pytest.mark.parametrize(
'raw_metric, expected... | 30.256757 | 110 | 0.648057 |
import logging
import mock
import pytest
from datadog_checks.citrix_hypervisor import metrics
logger = logging.getLogger(__name__)
@pytest.mark.unit
@pytest.mark.parametrize(
'raw_metric, expected_name, expected_tags',
[
pytest.param(
'AVERAGE:host:123-abc:pool_task_count', 'host.poo... | true | true |
f7f28aa38ce7d979dfc7c5dc6ef04b5918a19570 | 4,246 | py | Python | classy_text/train_ngram_model.py | mt-edwards/classy-text | 5d33f935e4879f4649d08d927d8428a3cec11a29 | [
"MIT"
] | null | null | null | classy_text/train_ngram_model.py | mt-edwards/classy-text | 5d33f935e4879f4649d08d927d8428a3cec11a29 | [
"MIT"
] | null | null | null | classy_text/train_ngram_model.py | mt-edwards/classy-text | 5d33f935e4879f4649d08d927d8428a3cec11a29 | [
"MIT"
] | null | null | null | """Module to train n-gram model.
Vectorizes training and validation texts into n-grams and uses that for
training a n-gram model - a simple multi-layer perceptron model. We use n-gram
model for text classification when the ratio of number of samples to number of
words per sample for the given dataset is very small (<~... | 37.245614 | 79 | 0.647433 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import time
import tensorflow as tf
import numpy as np
import classy_text.build_model as build_model
import classy_text.load_data as load_data
import classy_text.vectorize_data as vectorize_da... | true | true |
f7f28ab5cc96167d99d4fc3b11a91b0f3f9c2a64 | 430 | py | Python | ml_studio/visualate/cli.py | john-james-ai/ml-studio | 2230fcd6579d2291c761e559ec93b18ddd7a96e6 | [
"BSD-3-Clause"
] | 1 | 2020-01-30T09:37:00.000Z | 2020-01-30T09:37:00.000Z | ml_studio/visualate/cli.py | john-james-ai/ml-studio | 2230fcd6579d2291c761e559ec93b18ddd7a96e6 | [
"BSD-3-Clause"
] | 3 | 2019-12-05T19:37:59.000Z | 2020-03-31T05:49:53.000Z | ml_studio/visualate/cli.py | john-james-ai/ml-studio | 2230fcd6579d2291c761e559ec93b18ddd7a96e6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Console script for visualate."""
import sys
import click
@click.command()
def main(args=None):
"""Console script for visualate."""
click.echo("Replace this message by putting your code into "
"visualate.cli.main")
click.echo("See click documentation at https://cl... | 22.631579 | 79 | 0.651163 |
import sys
import click
@click.command()
def main(args=None):
click.echo("Replace this message by putting your code into "
"visualate.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/")
return 0
if __name__ == "__main__":
sys.exit(main())
| true | true |
f7f28c122feaa13f3595267be877a60360498eff | 31,095 | py | Python | tests/gpflow/conditionals/test_multioutput.py | HarrySpearing/GPflow | 02cd9000f72f4302f24a9fa1b28237f86140e04e | [
"Apache-2.0"
] | 1,724 | 2016-01-21T18:10:26.000Z | 2022-03-22T20:03:57.000Z | tests/gpflow/conditionals/test_multioutput.py | HarrySpearing/GPflow | 02cd9000f72f4302f24a9fa1b28237f86140e04e | [
"Apache-2.0"
] | 1,713 | 2016-02-26T13:09:35.000Z | 2022-03-31T14:39:30.000Z | tests/gpflow/conditionals/test_multioutput.py | HarrySpearing/GPflow | 02cd9000f72f4302f24a9fa1b28237f86140e04e | [
"Apache-2.0"
] | 519 | 2016-02-17T19:04:45.000Z | 2022-03-26T00:13:13.000Z | import numpy as np
import pytest
import scipy
import tensorflow as tf
import gpflow
import gpflow.inducing_variables.multioutput as mf
import gpflow.kernels.multioutput as mk
from gpflow import set_trainable
from gpflow.conditionals import sample_conditional
from gpflow.conditionals.util import (
fully_correlated_... | 33.762215 | 101 | 0.641614 | import numpy as np
import pytest
import scipy
import tensorflow as tf
import gpflow
import gpflow.inducing_variables.multioutput as mf
import gpflow.kernels.multioutput as mk
from gpflow import set_trainable
from gpflow.conditionals import sample_conditional
from gpflow.conditionals.util import (
fully_correlated_... | true | true |
f7f28c18cfb828d0d9015adae492d9702b64508c | 233 | py | Python | topCoder/srms/500s/srm545/div2/and_equation.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 25 | 2015-01-21T16:39:18.000Z | 2021-05-24T07:01:24.000Z | topCoder/srms/500s/srm545/div2/and_equation.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 2 | 2020-09-30T19:39:36.000Z | 2020-10-01T17:15:16.000Z | topCoder/srms/500s/srm545/div2/and_equation.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 15 | 2015-01-21T16:39:27.000Z | 2020-10-01T17:00:22.000Z | from operator import __and__
class ANDEquation:
def restoreY(self, A):
m = max(A)
for i, e in enumerate(A):
if e == reduce(__and__, A[:i] + A[i + 1 :], m):
return e
return -1
| 21.181818 | 59 | 0.493562 | from operator import __and__
class ANDEquation:
def restoreY(self, A):
m = max(A)
for i, e in enumerate(A):
if e == reduce(__and__, A[:i] + A[i + 1 :], m):
return e
return -1
| true | true |
f7f28cf1702d0fa5a04295a7555c8df8e99be0f8 | 3,649 | py | Python | stdplugins/remove.bg.py | Jayraj448/TGUserBot | 3b56fe32686ed35b8b2392f54fcaaa93f7b6d700 | [
"Apache-2.0"
] | 4 | 2019-10-03T04:59:02.000Z | 2019-10-31T00:01:33.000Z | stdplugins/remove.bg.py | Jayraj448/TGUserBot | 3b56fe32686ed35b8b2392f54fcaaa93f7b6d700 | [
"Apache-2.0"
] | 1 | 2020-03-19T13:23:15.000Z | 2020-03-25T09:18:56.000Z | stdplugins/remove.bg.py | Jayraj448/TGUserBot | 3b56fe32686ed35b8b2392f54fcaaa93f7b6d700 | [
"Apache-2.0"
] | 16 | 2019-09-30T17:26:32.000Z | 2020-05-21T10:23:26.000Z | # (c) Shrimadhav U K
#
# This file is part of @UniBorg
#
# @UniBorg is free software; you cannot redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# @UniBorg is ... | 32.008772 | 138 | 0.64182 |
import asyncio
from datetime import datetime
import io
import os
import requests
from telethon import events
from uniborg.util import progress, admin_cmd
@borg.on(admin_cmd("rbg ?(.*)"))
async def _(event):
HELP_STR = "`.rbg` as reply to a media, or give a link as an argument to this command"
if... | true | true |
f7f28d195f5fed8dab4d84417c2e034af87c4253 | 1,355 | py | Python | 69.py | alanbly/ProjectEuler | ed9617fd8cf25e48be2a9d1f542166c95c5b09c2 | [
"MIT"
] | null | null | null | 69.py | alanbly/ProjectEuler | ed9617fd8cf25e48be2a9d1f542166c95c5b09c2 | [
"MIT"
] | null | null | null | 69.py | alanbly/ProjectEuler | ed9617fd8cf25e48be2a9d1f542166c95c5b09c2 | [
"MIT"
] | null | null | null | import math
def primes(n):
# all even numbers greater than 2 are not prime.
s = [False]*2 + [True]*2 + [False,True]*((n-4)//2) + [False]*(n%2)
i = 3;
limit = n**0.5
while i < limit:
sq = i*i
# get rid of ** and skip even numbers.
s[sq : n : i*2] = [False]*(1+(n-sq)//(i*2))
i += 2
# skip n... | 21.854839 | 93 | 0.564576 | import math
def primes(n):
s = [False]*2 + [True]*2 + [False,True]*((n-4)//2) + [False]*(n%2)
i = 3;
limit = n**0.5
while i < limit:
sq = i*i
s[sq : n : i*2] = [False]*(1+(n-sq)//(i*2))
i += 2
while not s[i]: i += 2
return s
primeList=primes(10**6)
def miller_rabin_isprime(a, ... | true | true |
f7f28d9dc72e299687d2062450dcfa3a0e53c571 | 16,988 | py | Python | third-party/llvm/llvm-src/tools/clang/utils/analyzer/CmpRuns.py | nldias/chapel | 3a63044cd50b639dca8e851d4a505546b57bc299 | [
"ECL-2.0",
"Apache-2.0"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | third-party/llvm/llvm-src/tools/clang/utils/analyzer/CmpRuns.py | nldias/chapel | 3a63044cd50b639dca8e851d4a505546b57bc299 | [
"ECL-2.0",
"Apache-2.0"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | third-party/llvm/llvm-src/tools/clang/utils/analyzer/CmpRuns.py | nldias/chapel | 3a63044cd50b639dca8e851d4a505546b57bc299 | [
"ECL-2.0",
"Apache-2.0"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | #!/usr/bin/env python
"""
CmpRuns - A simple tool for comparing two static analyzer runs to determine
which reports have been added, removed, or changed.
This is designed to support automated testing using the static analyzer, from
two perspectives:
1. To monitor changes in the static analyzer's reports on real cod... | 32.05283 | 79 | 0.610431 |
import json
import os
import plistlib
import re
import sys
from math import log
from collections import defaultdict
from copy import copy
from enum import Enum
from typing import (Any, cast, Dict, List, NamedTuple, Optional, Sequence,
TextIO, TypeVar, Tuple, Union)
Number = Union[int, float]
St... | true | true |
f7f28dd83f76843c3f8e6422b775ff357dfb960e | 22,859 | py | Python | src/cli/onefuzz/debug.py | gdhuper/onefuzz | 6aca32ed9c8318aa81887eeaacff03c406c0e98c | [
"MIT"
] | null | null | null | src/cli/onefuzz/debug.py | gdhuper/onefuzz | 6aca32ed9c8318aa81887eeaacff03c406c0e98c | [
"MIT"
] | 1 | 2021-03-03T11:06:24.000Z | 2021-03-03T11:06:24.000Z | src/cli/onefuzz/debug.py | gdhuper/onefuzz | 6aca32ed9c8318aa81887eeaacff03c406c0e98c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import json
import logging
import os
import tempfile
import time
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import urlparse
from uuid import UUID
import jmespath
from azure.applicationins... | 33.715339 | 92 | 0.597314 |
import json
import logging
import os
import tempfile
import time
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import urlparse
from uuid import UUID
import jmespath
from azure.applicationinsights import ApplicationInsightsDataClient
from azure.applicationinsights.models import Query... | true | true |
f7f28ddc2536ba98b829820f3410c66d3704f66b | 7,925 | py | Python | src/pycalver/rewrite.py | git-albertomarin/pycalver | 809a6becb6e0348e944d8a64adb51604f62f589d | [
"MIT"
] | null | null | null | src/pycalver/rewrite.py | git-albertomarin/pycalver | 809a6becb6e0348e944d8a64adb51604f62f589d | [
"MIT"
] | null | null | null | src/pycalver/rewrite.py | git-albertomarin/pycalver | 809a6becb6e0348e944d8a64adb51604f62f589d | [
"MIT"
] | null | null | null | # This file is part of the pycalver project
# https://gitlab.com/mbarkhau/pycalver
#
# Copyright (c) 2019 Manuel Barkhau (mbarkhau@gmail.com) - MIT License
# SPDX-License-Identifier: MIT
"""Rewrite files, updating occurences of version strings."""
import io
import glob
import difflib
import logging
import typing as ty... | 33.438819 | 90 | 0.638486 |
import io
import glob
import difflib
import logging
import typing as typ
import pathlib2 as pl
from . import parse
from . import config
from . import version
from . import patterns
log = logging.getLogger("pycalver.rewrite")
def detect_line_sep(content: str) -> str:
if "\r\n" in content:
return "... | true | true |
f7f28e00c3cd4999af9dfa59f6d6b946b3d83043 | 7,972 | py | Python | SoftLayer/CLI/report/bandwidth.py | rodrabe/softlayer-python | a00df24256e5b94854200d9ebce9fb6cd7463821 | [
"MIT"
] | 2 | 2016-07-06T15:31:48.000Z | 2016-07-06T15:40:25.000Z | SoftLayer/CLI/report/bandwidth.py | rodrabe/softlayer-python | a00df24256e5b94854200d9ebce9fb6cd7463821 | [
"MIT"
] | 73 | 2016-07-05T15:17:51.000Z | 2016-08-18T18:16:29.000Z | SoftLayer/CLI/report/bandwidth.py | kyubifire/softlayer-python | bee36eec73474a8b6a1813fbbcc0512f81bf1779 | [
"MIT"
] | 1 | 2019-07-22T05:20:39.000Z | 2019-07-22T05:20:39.000Z | """Metric Utilities"""
from __future__ import print_function
import datetime
import itertools
import sys
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
# pylint: disable=unused-argument
def _validate_datetime(ctx, param, value):
try:
r... | 33.495798 | 78 | 0.509282 | from __future__ import print_function
import datetime
import itertools
import sys
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
def _validate_datetime(ctx, param, value):
try:
return datetime.datetime.strptime(value, "%Y-%m-%d")
... | true | true |
f7f28e470c2d4e3955aff49344cdb671bb08773c | 736 | py | Python | 2019/05/code.py | Akumatic/Advent-of-Code | bf2efe4d5a2c95ceb5f52ddbbc15ef0f2ac48618 | [
"MIT"
] | 22 | 2019-12-13T20:41:52.000Z | 2022-01-05T00:19:21.000Z | 2019/05/code.py | Akumatic/Advent-of-Code | bf2efe4d5a2c95ceb5f52ddbbc15ef0f2ac48618 | [
"MIT"
] | null | null | null | 2019/05/code.py | Akumatic/Advent-of-Code | bf2efe4d5a2c95ceb5f52ddbbc15ef0f2ac48618 | [
"MIT"
] | 13 | 2019-12-21T02:35:19.000Z | 2022-02-14T09:37:01.000Z | # SPDX-License-Identifier: MIT
# Copyright (c) 2019 Akumatic
#
# https://adventofcode.com/2019/day/5
import sys, os
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import intcode, intcode_test
def readFile() -> list:
with open(f"{__file__.rstrip('code.py')}input.txt", "r") as f:
... | 26.285714 | 79 | 0.648098 |
import sys, os
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import intcode, intcode_test
def readFile() -> list:
with open(f"{__file__.rstrip('code.py')}input.txt", "r") as f:
return [int(num) for num in f.readline().split(",")]
def part1(pc: intcode.Computer) -> in... | true | true |
f7f2918c31af37594c66952f8f0d7af6c461ffa6 | 210 | py | Python | Ch03/test46.py | pearpai/MachineLearnAction | d23def83e50bf53b7cfcdb52d362d88eb52d9115 | [
"Apache-2.0"
] | null | null | null | Ch03/test46.py | pearpai/MachineLearnAction | d23def83e50bf53b7cfcdb52d362d88eb52d9115 | [
"Apache-2.0"
] | null | null | null | Ch03/test46.py | pearpai/MachineLearnAction | d23def83e50bf53b7cfcdb52d362d88eb52d9115 | [
"Apache-2.0"
] | null | null | null | import treePlotter
if __name__ == '__main__':
print treePlotter.retrieveTree(1)
myTree = treePlotter.retrieveTree(0)
print treePlotter.getNumLeafs(myTree)
print treePlotter.getTreeDepth(myTree) | 30 | 42 | 0.766667 | import treePlotter
if __name__ == '__main__':
print treePlotter.retrieveTree(1)
myTree = treePlotter.retrieveTree(0)
print treePlotter.getNumLeafs(myTree)
print treePlotter.getTreeDepth(myTree) | false | true |
f7f2919caf6aba9ed1c602d59cd29740097e8a3a | 808 | py | Python | devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 108 | 2020-11-23T01:22:37.000Z | 2022-03-29T09:27:32.000Z | devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 794 | 2020-11-21T22:27:37.000Z | 2022-03-24T06:41:19.000Z | devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 3 | 2021-06-19T00:57:54.000Z | 2021-11-01T11:55:07.000Z | from raytkUtil import ROPInfo, InputInfo
# noinspection PyUnreachableCode
if False:
# noinspection PyUnresolvedReferences
from _stubs import *
from _typeAliases import *
class _InspectorCorePars(ParCollection):
Hastarget: 'BoolParamT'
Definitiontable: 'DatParamT'
Targetcomp: 'CompParamT'
ipar.inspectorCore... | 23.764706 | 54 | 0.730198 | from raytkUtil import ROPInfo, InputInfo
if False:
from _stubs import *
from _typeAliases import *
class _InspectorCorePars(ParCollection):
Hastarget: 'BoolParamT'
Definitiontable: 'DatParamT'
Targetcomp: 'CompParamT'
ipar.inspectorCore = _InspectorCorePars()
class InputsPanel:
def __init__(self, owner... | true | true |
f7f29279fc13397ad2c8f4f7da5be1bbb56cd1c3 | 907 | py | Python | py/py_0341_golomb's_self-describing_sequence.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0341_golomb's_self-describing_sequence.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0341_golomb's_self-describing_sequence.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | # Solution of;
# Project Euler Problem 341: Golomb's self-describing sequence
# https://projecteuler.net/problem=341
#
# The Golomb's self-describing sequence $(G(n))$ is the only nondecreasing
# sequence of natural numbers such that $n$ appears exactly $G(n)$ times in
# the sequence. The values of $G(n)$ for the fi... | 33.592593 | 79 | 0.593164 |
# https://projecteuler.net/problem=341
#
# The Golomb's self-describing sequence $(G(n))$ is the only nondecreasing
import timed
def dummy(n):
pass
if __name__ == '__main__':
n = 1000
i = 10000
prob_id = 341
timed.caller(dummy, n, i, prob_id)
| true | true |
f7f2941b4612f57326c712b462c91530ee558970 | 3,046 | py | Python | src/tests/5_Logintesting.py | mihirchhiber/SingHealth_Retail_Management_ESC | f2faa77bb621058f53f8354a96292640662d0ff0 | [
"MIT"
] | 1 | 2021-04-21T06:44:30.000Z | 2021-04-21T06:44:30.000Z | src/tests/5_Logintesting.py | mihirchhiber/SingHealth_Retail_Management_ESC | f2faa77bb621058f53f8354a96292640662d0ff0 | [
"MIT"
] | null | null | null | src/tests/5_Logintesting.py | mihirchhiber/SingHealth_Retail_Management_ESC | f2faa77bb621058f53f8354a96292640662d0ff0 | [
"MIT"
] | 1 | 2021-04-22T15:02:11.000Z | 2021-04-22T15:02:11.000Z | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
import re
import time
from selenium.webdriver.common.by import B... | 30.46 | 85 | 0.685161 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
import re
import time
from selenium.webdriver.common.by import B... | true | true |
f7f2950e4c14d5e0f9c87cbd913ecb322f4b7316 | 2,823 | py | Python | hangman/game.py | Akataya/itp-u6-c2-oop-hangman-game | df78cb0d0ec052716bc0937e2f6b35cde9729799 | [
"MIT"
] | null | null | null | hangman/game.py | Akataya/itp-u6-c2-oop-hangman-game | df78cb0d0ec052716bc0937e2f6b35cde9729799 | [
"MIT"
] | null | null | null | hangman/game.py | Akataya/itp-u6-c2-oop-hangman-game | df78cb0d0ec052716bc0937e2f6b35cde9729799 | [
"MIT"
] | null | null | null | from .exceptions import *
import random
class GuessAttempt(object):
def __init__(self, letter, hit=None, miss=None):
if hit and miss:
raise InvalidGuessAttempt()
self.letter = letter
self.hit = hit
self.miss = miss
def is_hit(self):
if self.hit:
... | 28.23 | 60 | 0.560397 | from .exceptions import *
import random
class GuessAttempt(object):
def __init__(self, letter, hit=None, miss=None):
if hit and miss:
raise InvalidGuessAttempt()
self.letter = letter
self.hit = hit
self.miss = miss
def is_hit(self):
if self.hit:
... | true | true |
f7f29617891b9686414d897f875f54cc192cf124 | 3,621 | py | Python | sparse_operation_kit/sparse_operation_kit/optimizers/utils.py | Chunshuizhao/HugeCTR | 085b2e8ad2abaee5578e7bf43b8394d0b8473b58 | [
"Apache-2.0"
] | null | null | null | sparse_operation_kit/sparse_operation_kit/optimizers/utils.py | Chunshuizhao/HugeCTR | 085b2e8ad2abaee5578e7bf43b8394d0b8473b58 | [
"Apache-2.0"
] | null | null | null | sparse_operation_kit/sparse_operation_kit/optimizers/utils.py | Chunshuizhao/HugeCTR | 085b2e8ad2abaee5578e7bf43b8394d0b8473b58 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021, NVIDIA 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... | 35.851485 | 102 | 0.671362 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from sparse_operation_kit.core.embedding_variable import EmbeddingVariable
from tensorflow.python.distribute.values import MirroredVariable
from tensorflow.python.distribute.values import Distri... | true | true |
f7f2968b5a88420ee3aaba1f5d890e69afabd4c7 | 1,121 | py | Python | masakari_monitors_icmp_plugin/tests/unit/fakes.py | ooneko/masakari-monitors-icmp-plugin | b57309a2590fa5436b197275a77da7f34f691a2e | [
"Apache-2.0"
] | null | null | null | masakari_monitors_icmp_plugin/tests/unit/fakes.py | ooneko/masakari-monitors-icmp-plugin | b57309a2590fa5436b197275a77da7f34f691a2e | [
"Apache-2.0"
] | null | null | null | masakari_monitors_icmp_plugin/tests/unit/fakes.py | ooneko/masakari-monitors-icmp-plugin | b57309a2590fa5436b197275a77da7f34f691a2e | [
"Apache-2.0"
] | null | null | null | # Copyright(c) 2019 UnitedStack 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 ... | 32.028571 | 74 | 0.696699 |
class FakeHost(object):
def __init__(self, name=None,
failover_segment_id=None,
on_maintenance=False):
self.name = name
self.on_maintenance = on_maintenance
self.failover_segment_id = failover_segment_id
def __eq__(self, other):
r... | true | true |
f7f296b5814cc08dd60c70b0e9d2c7631c813f4e | 2,384 | py | Python | src/educrawler/__main__.py | Iain-S/EduCrawler | 98160da5eaa3d389bf936c5d1a508d77d138a1cf | [
"MIT"
] | null | null | null | src/educrawler/__main__.py | Iain-S/EduCrawler | 98160da5eaa3d389bf936c5d1a508d77d138a1cf | [
"MIT"
] | null | null | null | src/educrawler/__main__.py | Iain-S/EduCrawler | 98160da5eaa3d389bf936c5d1a508d77d138a1cf | [
"MIT"
] | null | null | null | """
Command line tools package for crawling the Education section of
portal.azure.com.
Tomas Lazauskas
"""
import os
import argparse
from educrawler.crawler import crawl
from educrawler.constants import (
CONST_OUTPUT_LIST,
CONST_ACTION_LIST,
CONST_USAGE_ACTION,
CONST_OUTPUT_TABLE,
)
def set_c... | 20.20339 | 69 | 0.627097 |
import os
import argparse
from educrawler.crawler import crawl
from educrawler.constants import (
CONST_OUTPUT_LIST,
CONST_ACTION_LIST,
CONST_USAGE_ACTION,
CONST_OUTPUT_TABLE,
)
def set_command_line_args(default_output):
parser = argparse.ArgumentParser(
description="A command lin... | true | true |
f7f296f2053010f01c431530c4428577a7497028 | 992 | py | Python | tests/table/test_str.py | 0scarB/piccolo | 27539219431874bae99b7206df48133fbe1a27eb | [
"MIT"
] | 750 | 2019-01-03T16:02:48.000Z | 2022-03-30T19:53:03.000Z | tests/table/test_str.py | 0scarB/piccolo | 27539219431874bae99b7206df48133fbe1a27eb | [
"MIT"
] | 311 | 2019-01-14T13:07:13.000Z | 2022-03-31T07:43:08.000Z | tests/table/test_str.py | 0scarB/piccolo | 27539219431874bae99b7206df48133fbe1a27eb | [
"MIT"
] | 48 | 2020-12-18T08:13:50.000Z | 2022-03-24T03:18:06.000Z | from unittest import TestCase
from tests.example_apps.music.tables import Manager
class TestTableStr(TestCase):
def test_str(self):
self.assertEqual(
Manager._table_str(),
(
"class Manager(Table, tablename='manager'):\n"
" id = Serial(null=False,... | 35.428571 | 200 | 0.569556 | from unittest import TestCase
from tests.example_apps.music.tables import Manager
class TestTableStr(TestCase):
def test_str(self):
self.assertEqual(
Manager._table_str(),
(
"class Manager(Table, tablename='manager'):\n"
" id = Serial(null=False,... | true | true |
f7f2975ffa78fa8615214f85b29ee48126cd50ea | 12,182 | py | Python | nbgrader/utils.py | jedbrown/nbgrader | bdfb861b6129d80eb60165bcba1485484cc8f67e | [
"BSD-3-Clause-Clear"
] | null | null | null | nbgrader/utils.py | jedbrown/nbgrader | bdfb861b6129d80eb60165bcba1485484cc8f67e | [
"BSD-3-Clause-Clear"
] | null | null | null | nbgrader/utils.py | jedbrown/nbgrader | bdfb861b6129d80eb60165bcba1485484cc8f67e | [
"BSD-3-Clause-Clear"
] | null | null | null | import os
import hashlib
import dateutil.parser
import glob
import six
import sys
import shutil
import stat
import logging
import traceback
import contextlib
from setuptools.archive_util import unpack_archive
from setuptools.archive_util import unpack_tarfile
from setuptools.archive_util import unpack_zipfile
from con... | 29.639903 | 113 | 0.630685 | import os
import hashlib
import dateutil.parser
import glob
import six
import sys
import shutil
import stat
import logging
import traceback
import contextlib
from setuptools.archive_util import unpack_archive
from setuptools.archive_util import unpack_tarfile
from setuptools.archive_util import unpack_zipfile
from con... | true | true |
f7f2981a85c9a21f8e633b11dff49961433bc4af | 6,450 | py | Python | tests/regressiontests/localflavor/mk/tests.py | hafeez3000/django | 08e1175ac8d683b692ec3c67dc31df149f07dc8f | [
"BSD-3-Clause"
] | 4 | 2015-08-27T22:03:47.000Z | 2017-09-04T08:13:44.000Z | tests/regressiontests/localflavor/mk/tests.py | hafeez3000/django | 08e1175ac8d683b692ec3c67dc31df149f07dc8f | [
"BSD-3-Clause"
] | null | null | null | tests/regressiontests/localflavor/mk/tests.py | hafeez3000/django | 08e1175ac8d683b692ec3c67dc31df149f07dc8f | [
"BSD-3-Clause"
] | 1 | 2020-01-04T14:51:18.000Z | 2020-01-04T14:51:18.000Z | from django.test import TestCase
from forms import MKPersonForm
class MKLocalflavorTests(TestCase):
def setUp(self):
self.form = MKPersonForm({
'first_name':'Someone',
'last_name':'Something',
'umcn': '2402983450006',
'municipality':'OD',
'municip... | 36.440678 | 86 | 0.648837 | from django.test import TestCase
from forms import MKPersonForm
class MKLocalflavorTests(TestCase):
def setUp(self):
self.form = MKPersonForm({
'first_name':'Someone',
'last_name':'Something',
'umcn': '2402983450006',
'municipality':'OD',
'municip... | true | true |
f7f29822cebcb85979b85dd808def9a31c31c396 | 17,764 | py | Python | models/hoztpn.py | sx-zhang/HOZ | 7be117f078a34c6f97ea6c64f60d7df7b47bef49 | [
"MIT"
] | 11 | 2021-09-08T03:40:08.000Z | 2022-01-14T08:36:13.000Z | models/hoztpn.py | JJJJasper/HOZ | 7be117f078a34c6f97ea6c64f60d7df7b47bef49 | [
"MIT"
] | null | null | null | models/hoztpn.py | JJJJasper/HOZ | 7be117f078a34c6f97ea6c64f60d7df7b47bef49 | [
"MIT"
] | 2 | 2021-12-01T13:00:35.000Z | 2021-12-08T01:56:31.000Z | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from utils.model_util import norm_col_init, weights_init
from .model_io import ModelOutput
import scipy.sparse as sp
import numpy as np
import scipy.io as scio
import os... | 41.699531 | 175 | 0.624803 | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from utils.model_util import norm_col_init, weights_init
from .model_io import ModelOutput
import scipy.sparse as sp
import numpy as np
import scipy.io as scio
import os... | true | true |
f7f29884ea265905018c0858586f43bb0b8684a2 | 11,316 | py | Python | tensorflow/python/training/tracking/tracking_test.py | nkgwer/tensorflow | 9cfb4b13c4639f741ec6b92e24c77d294a44c2d5 | [
"Apache-2.0"
] | 615 | 2018-04-14T22:04:13.000Z | 2022-03-31T12:46:50.000Z | tensorflow/python/training/tracking/tracking_test.py | govl-psb/tensorflow-1 | 60028072a1c3b4376e145b6fea8e4ccd3324377f | [
"Apache-2.0"
] | 1,167 | 2018-05-15T15:26:33.000Z | 2022-03-31T18:58:41.000Z | tensorflow/python/training/tracking/tracking_test.py | govl-psb/tensorflow-1 | 60028072a1c3b4376e145b6fea8e4ccd3324377f | [
"Apache-2.0"
] | 93 | 2018-04-11T02:46:16.000Z | 2022-03-31T12:46:16.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.470199 | 80 | 0.723666 |
import os
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.eager import wrap_function
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.platform import test... | true | true |
f7f299616ccd21a9599442416de1219c0950366d | 6,714 | py | Python | experiments.py | Mickey253/spherical-mds | 5c96f5ec0273233ac81adcd90a39ec35cfc83557 | [
"MIT"
] | null | null | null | experiments.py | Mickey253/spherical-mds | 5c96f5ec0273233ac81adcd90a39ec35cfc83557 | [
"MIT"
] | null | null | null | experiments.py | Mickey253/spherical-mds | 5c96f5ec0273233ac81adcd90a39ec35cfc83557 | [
"MIT"
] | null | null | null | import numpy as np
import graph_tool.all as gt
from graph_functions import apsp,sphere_stress, distortion
from graph_io import write_to_json
from SGD_MDS_sphere import SMDS
from HMDS import HMDS
from SGD_MDS2 import SGD
import pylab
import s_gd2
sin,cos, acos, sqrt = np.sin, np.cos, np.arccos, np.sqrt
acosh, cosh, sin... | 31.819905 | 119 | 0.609324 | import numpy as np
import graph_tool.all as gt
from graph_functions import apsp,sphere_stress, distortion
from graph_io import write_to_json
from SGD_MDS_sphere import SMDS
from HMDS import HMDS
from SGD_MDS2 import SGD
import pylab
import s_gd2
sin,cos, acos, sqrt = np.sin, np.cos, np.arccos, np.sqrt
acosh, cosh, sin... | true | true |
f7f299c773255e0d97e6a7b7b8a01adff6efbb20 | 19,565 | py | Python | api/tests.py | Gitoffomalawn/babybuddy | 3fc147c2f16167858284e2bbec657b1756157fd3 | [
"BSD-2-Clause"
] | null | null | null | api/tests.py | Gitoffomalawn/babybuddy | 3fc147c2f16167858284e2bbec657b1756157fd3 | [
"BSD-2-Clause"
] | null | null | null | api/tests.py | Gitoffomalawn/babybuddy | 3fc147c2f16167858284e2bbec657b1756157fd3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.urls import reverse
from django.utils import timezone
from rest_framework import status
from rest_framework.test import APITestCase
from babybuddy.models import User
from core import models
class TestBase:
class BabyBuddyAPITestCaseBase(APITestCase):
fixtures = ["test... | 35.315884 | 87 | 0.560337 |
from django.urls import reverse
from django.utils import timezone
from rest_framework import status
from rest_framework.test import APITestCase
from babybuddy.models import User
from core import models
class TestBase:
class BabyBuddyAPITestCaseBase(APITestCase):
fixtures = ["tests.json"]
model ... | true | true |
f7f299dfa63fa19a90bae13e06cca5b1d9f8c83b | 8,811 | py | Python | hexcnn_train.py | AllisonShen/MalConv-Pytorch | 08f2a00890fcf5ec11e455bf949741ea845a24f5 | [
"MIT"
] | null | null | null | hexcnn_train.py | AllisonShen/MalConv-Pytorch | 08f2a00890fcf5ec11e455bf949741ea845a24f5 | [
"MIT"
] | null | null | null | hexcnn_train.py | AllisonShen/MalConv-Pytorch | 08f2a00890fcf5ec11e455bf949741ea845a24f5 | [
"MIT"
] | null | null | null | # coding: utf-8
import os
import time
import sys
import yaml
import numpy as np
import pandas as pd
from src.util import HexDumpDataset,write_pred
from src.cnn_model import CNN_Model
from torch.utils.data import DataLoader
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variabl... | 32.512915 | 191 | 0.658382 |
import os
import time
import sys
import yaml
import numpy as np
import pandas as pd
from src.util import HexDumpDataset,write_pred
from src.cnn_model import CNN_Model
from torch.utils.data import DataLoader
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.ut... | true | true |
f7f29a5bc8eb3fad1b67d788f5a31565007519c9 | 1,155 | py | Python | common/settings.py | lbozarth/exercise-toes | 25aed0949ae57a04fb738c2bf6c2a7ade0eece2b | [
"MIT"
] | 4 | 2019-09-18T03:32:25.000Z | 2020-04-27T14:08:16.000Z | common/settings.py | lbozarth/exercise-toes | 25aed0949ae57a04fb738c2bf6c2a7ade0eece2b | [
"MIT"
] | 3 | 2019-07-02T02:37:44.000Z | 2019-08-24T05:12:08.000Z | common/settings.py | lbozarth/exercise-toes | 25aed0949ae57a04fb738c2bf6c2a7ade0eece2b | [
"MIT"
] | 13 | 2019-07-02T00:37:47.000Z | 2020-09-28T20:30:28.000Z | from common.parameter_store import get_parameter
class Settings:
_mobile_commons_username = None
_mobile_commons_password = None
_actblue_webhook_username = None
_actblue_webhook_password = None
def mobile_commons_username(self):
if not self._mobile_commons_username:
self._mob... | 36.09375 | 108 | 0.761039 | from common.parameter_store import get_parameter
class Settings:
_mobile_commons_username = None
_mobile_commons_password = None
_actblue_webhook_username = None
_actblue_webhook_password = None
def mobile_commons_username(self):
if not self._mobile_commons_username:
self._mob... | true | true |
f7f29a909d8a31b17b1f7e95c3648c8e7380d7a0 | 2,573 | py | Python | psycaio/cursor.py | blenq/psycaio | 22225538701979b57d38907d4bc3c3ee399287ba | [
"MIT"
] | null | null | null | psycaio/cursor.py | blenq/psycaio | 22225538701979b57d38907d4bc3c3ee399287ba | [
"MIT"
] | null | null | null | psycaio/cursor.py | blenq/psycaio | 22225538701979b57d38907d4bc3c3ee399287ba | [
"MIT"
] | null | null | null | from psycopg2.extensions import cursor as PGCursor
class AioCursorMixin:
""" Mixin class to add asyncio behavior to the psycopg2
:py:class:`psycopg2:cursor` class.
This class should be not be instantiated directly. It should be used as a
base class when implementing a custom cursor.
When an oper... | 35.246575 | 79 | 0.693354 | from psycopg2.extensions import cursor as PGCursor
class AioCursorMixin:
__module__ = 'psycaio'
async def _call_async(self, func, *args, **kwargs):
async with self.connection._execute_lock:
ret = func(*args, **kwargs)
await self.connection._start_poll()
return ret
... | true | true |
f7f29b32992f41b3b48724789b2d4ee29a58928b | 5,662 | py | Python | sgnlp/models/lif_3way_ap/config.py | jonheng/sgnlp | aeee85b78de2e449ca1dc6b18686a060cb938d07 | [
"MIT"
] | null | null | null | sgnlp/models/lif_3way_ap/config.py | jonheng/sgnlp | aeee85b78de2e449ca1dc6b18686a060cb938d07 | [
"MIT"
] | null | null | null | sgnlp/models/lif_3way_ap/config.py | jonheng/sgnlp | aeee85b78de2e449ca1dc6b18686a060cb938d07 | [
"MIT"
] | null | null | null | from transformers import PretrainedConfig
DEFAULT_CONFIG_ARGS = {
"char_embedding_args": {
"num_embeddings": 102,
"embedding_dim": 20,
"num_filters": 100,
"kernel_size": 5,
"padding_idx": 0,
"stride": 1
},
"word_embedding_args": {
"num_embeddings": 10... | 32.54023 | 118 | 0.574885 | from transformers import PretrainedConfig
DEFAULT_CONFIG_ARGS = {
"char_embedding_args": {
"num_embeddings": 102,
"embedding_dim": 20,
"num_filters": 100,
"kernel_size": 5,
"padding_idx": 0,
"stride": 1
},
"word_embedding_args": {
"num_embeddings": 10... | true | true |
f7f29c43bcb354c197caac950d42c6e7f2350bde | 775 | py | Python | apps/accounts/admin.py | julianwachholz/thefarland | c7259311fafb60beba167422eefd0d0c5d362514 | [
"WTFPL"
] | null | null | null | apps/accounts/admin.py | julianwachholz/thefarland | c7259311fafb60beba167422eefd0d0c5d362514 | [
"WTFPL"
] | null | null | null | apps/accounts/admin.py | julianwachholz/thefarland | c7259311fafb60beba167422eefd0d0c5d362514 | [
"WTFPL"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.forms import UserChangeForm
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
form = UserChangeForm
fieldsets = [
(None, {'fields': ['username', 'password', 'is_verified', 'verification_code', 'is_trusted']}),
... | 40.789474 | 103 | 0.667097 | from django.contrib import admin
from django.contrib.auth.forms import UserChangeForm
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
form = UserChangeForm
fieldsets = [
(None, {'fields': ['username', 'password', 'is_verified', 'verification_code', 'is_trusted']}),
... | true | true |
f7f29ca8e7caeef4b95c9caf4771e13cb64d0d0f | 7,058 | py | Python | Lib/site-packages/virtualenv/seed/via_app_data/pip_install/base.py | jmsnur/mytaxi-test | eb7f70d0ac1c4df32aaebaab118a25c83683ce13 | [
"bzip2-1.0.6"
] | 1 | 2021-12-03T17:07:00.000Z | 2021-12-03T17:07:00.000Z | Lib/site-packages/virtualenv/seed/via_app_data/pip_install/base.py | jmsnur/mytaxi-test | eb7f70d0ac1c4df32aaebaab118a25c83683ce13 | [
"bzip2-1.0.6"
] | 8 | 2021-03-19T04:46:04.000Z | 2021-09-22T19:11:11.000Z | Lib/site-packages/virtualenv/seed/via_app_data/pip_install/base.py | jmsnur/mytaxi-test | eb7f70d0ac1c4df32aaebaab118a25c83683ce13 | [
"bzip2-1.0.6"
] | 1 | 2021-12-03T17:07:06.000Z | 2021-12-03T17:07:06.000Z | from __future__ import absolute_import, unicode_literals
import logging
import os
import re
import zipfile
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from tempfile import mkdtemp
from threading import Lock
# noinspection PyProtectedMember
from distlib.scripts import ScriptMaker, _en... | 39.651685 | 118 | 0.620714 | from __future__ import absolute_import, unicode_literals
import logging
import os
import re
import zipfile
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from tempfile import mkdtemp
from threading import Lock
from distlib.scripts import ScriptMaker, _enquote_executable
from six import... | true | true |
f7f29ce5d6293cf084e22e9281137ab8727b7238 | 638 | py | Python | neko/models/db_init.py | airt/neko-api | 22959b4ff3994c595bcdab70dc4b533e316c22c7 | [
"MIT"
] | 2 | 2018-01-10T14:02:38.000Z | 2018-02-09T09:48:55.000Z | neko/models/db_init.py | airt/neko-api | 22959b4ff3994c595bcdab70dc4b533e316c22c7 | [
"MIT"
] | null | null | null | neko/models/db_init.py | airt/neko-api | 22959b4ff3994c595bcdab70dc4b533e316c22c7 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import Flask
from . import db
from .post import Post
def db_init(app: Flask):
with app.app_context():
if app.config['SQLALCHEMY_DATABASE_URI'] == 'sqlite:///:memory:':
db.create_all()
if app.debug and not app.testing:
# pylint: disable = no-member
... | 26.583333 | 69 | 0.636364 | from datetime import datetime
from flask import Flask
from . import db
from .post import Post
def db_init(app: Flask):
with app.app_context():
if app.config['SQLALCHEMY_DATABASE_URI'] == 'sqlite:///:memory:':
db.create_all()
if app.debug and not app.testing:
db.session.add_all(map(mo... | true | true |
f7f29d92136e023fb4de51b2f18559a8b9b3bbfa | 3,408 | py | Python | regulations/validators.py | uktrade/tamato | 4ba2ffb25eea2887e4e081c81da7634cd7b4f9ca | [
"MIT"
] | 14 | 2020-03-25T11:11:29.000Z | 2022-03-08T20:41:33.000Z | regulations/validators.py | uktrade/tamato | 4ba2ffb25eea2887e4e081c81da7634cd7b4f9ca | [
"MIT"
] | 352 | 2020-03-25T10:42:09.000Z | 2022-03-30T15:32:26.000Z | regulations/validators.py | uktrade/tamato | 4ba2ffb25eea2887e4e081c81da7634cd7b4f9ca | [
"MIT"
] | 3 | 2020-08-06T12:22:41.000Z | 2022-01-16T11:51:12.000Z | """Validators for regulations."""
from django.core.validators import RegexValidator
from django.db import models
class RoleType(models.IntegerChoices):
"""The code which indicates the role of the regulation."""
# The integer values are hard-coded into the TARIC3 Schema
BASE = 1, "Base"
PROVISIONAL_A... | 37.043478 | 85 | 0.683979 | from django.core.validators import RegexValidator
from django.db import models
class RoleType(models.IntegerChoices):
BASE = 1, "Base"
PROVISIONAL_ANTIDUMPING = 2, "Provisional anti-dumping"
DEFINITIVE_ANTIDUMPING = 3, "Definitive anti-dumping"
MODIFICATION = 4, "Modification"
PROROGATION =... | true | true |
f7f29dbcbbc3450a50d805ec037a9639e78813ee | 2,498 | py | Python | creator/studies/nodes.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 3 | 2019-05-04T02:07:28.000Z | 2020-10-16T17:47:44.000Z | creator/studies/nodes.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 604 | 2019-02-21T18:14:51.000Z | 2022-02-10T08:13:54.000Z | creator/studies/nodes.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | null | null | null | import graphene
from graphql import GraphQLError
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from creator.events.schema import EventNode, EventFilter
from creator.files.schema.file import FileNode, FileFilter
from creator.files.schema.version import Versio... | 27.755556 | 77 | 0.667334 | import graphene
from graphql import GraphQLError
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from creator.events.schema import EventNode, EventFilter
from creator.files.schema.file import FileNode, FileFilter
from creator.files.schema.version import Versio... | true | true |
f7f29f00cc7e3f20c0aa9d1d3ac92a2fd51ab746 | 3,457 | py | Python | script/dropbox_upload.py | silky/lean | df8b88dca2f8da1a422cb618cd476ef5be730546 | [
"Apache-2.0"
] | 1 | 2019-06-27T11:33:01.000Z | 2019-06-27T11:33:01.000Z | script/dropbox_upload.py | silky/lean | df8b88dca2f8da1a422cb618cd476ef5be730546 | [
"Apache-2.0"
] | null | null | null | script/dropbox_upload.py | silky/lean | df8b88dca2f8da1a422cb618cd476ef5be730546 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2013 Microsoft Corporation. All rights reserved.
# Released under Apache 2.0 license as described in the file LICENSE.
#
# Author: Soonho Kong
#
import dropbox
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dropbox-token', type=str, help='Dr... | 32.308411 | 104 | 0.660399 |
import dropbox
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dropbox-token', type=str, help='Dropbox token for authentication', required=True)
parser.add_argument('--destpath', type=str, help='Destination in Dropbox', required=True)
parser.add_argument('--srcpath', ... | false | true |
f7f29f5226de7c44860776c7e863938daf8e442e | 561 | py | Python | python_aulas/desaf092_dicionario_trabalhadores.py | gilsonaureliano/Python-aulas | 64269872acd482bcf297941ba28d30f13f29c752 | [
"MIT"
] | 1 | 2021-08-05T13:52:12.000Z | 2021-08-05T13:52:12.000Z | python_aulas/desaf092_dicionario_trabalhadores.py | gilsonaureliano/Python-aulas | 64269872acd482bcf297941ba28d30f13f29c752 | [
"MIT"
] | null | null | null | python_aulas/desaf092_dicionario_trabalhadores.py | gilsonaureliano/Python-aulas | 64269872acd482bcf297941ba28d30f13f29c752 | [
"MIT"
] | null | null | null | from datetime import date
func = {}
func['Nome'] = str(input('Nome: '))
func['idade'] = int(input('Ano de Nascimento: '))
anoatual = date.today().year
idade = anoatual - func['idade']
func['idade'] = idade
func['CTPS'] = int(input('Carteira de trabalho (0 não possui): '))
if not func['CTPS'] == 0:
func['Contratação... | 35.0625 | 72 | 0.622103 | from datetime import date
func = {}
func['Nome'] = str(input('Nome: '))
func['idade'] = int(input('Ano de Nascimento: '))
anoatual = date.today().year
idade = anoatual - func['idade']
func['idade'] = idade
func['CTPS'] = int(input('Carteira de trabalho (0 não possui): '))
if not func['CTPS'] == 0:
func['Contratação... | true | true |
f7f29fbeedfafeba8cbb0777c76d4bbc0c6bd74e | 929 | py | Python | sign_out.py | BhaskarJoshi-01/Book-Review-System | e8947bb06b62fe054dd54b1c36a3ec8a72c58bfc | [
"MIT"
] | 1 | 2020-08-19T05:12:12.000Z | 2020-08-19T05:12:12.000Z | sign_out.py | BhaskarJoshi-01/Book-Review-System | e8947bb06b62fe054dd54b1c36a3ec8a72c58bfc | [
"MIT"
] | null | null | null | sign_out.py | BhaskarJoshi-01/Book-Review-System | e8947bb06b62fe054dd54b1c36a3ec8a72c58bfc | [
"MIT"
] | null | null | null | import flask
from flask import render_template
import os
import sign_out
import login
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from flask import Flask, redirect, render_template, url_for , session, request, flash
from datetime import timedelta
import psycopg2
import r... | 28.151515 | 85 | 0.786868 | import flask
from flask import render_template
import os
import sign_out
import login
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from flask import Flask, redirect, render_template, url_for , session, request, flash
from datetime import timedelta
import psycopg2
import r... | true | true |
f7f2a02b003d1afe6d232d08ede39dc0abb55036 | 1,020 | py | Python | setup.py | peerchemist/cryptotik | 24ffd74c43ff1fc171081e135cb2b66b775af3f3 | [
"BSD-3-Clause"
] | 67 | 2016-09-27T09:13:24.000Z | 2022-03-28T15:33:36.000Z | setup.py | alimogh/cryptotik | 24ffd74c43ff1fc171081e135cb2b66b775af3f3 | [
"BSD-3-Clause"
] | 33 | 2016-10-25T21:23:31.000Z | 2018-03-25T18:40:59.000Z | setup.py | alimogh/cryptotik | 24ffd74c43ff1fc171081e135cb2b66b775af3f3 | [
"BSD-3-Clause"
] | 21 | 2016-10-25T17:19:00.000Z | 2022-03-26T05:37:05.000Z | from setuptools import setup
from os import path
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Financial and Insurance Industry',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Natural Language :: English',
'License :: OSI Approved :: BSD License'
]
# re... | 31.875 | 82 | 0.698039 | from setuptools import setup
from os import path
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Financial and Insurance Industry',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Natural Language :: English',
'License :: OSI Approved :: BSD License'
]
thi... | true | true |
f7f2a0e4a50bd4fc3d4e8f894bec49217aa78dc1 | 1,980 | py | Python | src/openprocurement/tender/competitivedialogue/adapters.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 10 | 2020-02-18T01:56:21.000Z | 2022-03-28T00:32:57.000Z | src/openprocurement/tender/competitivedialogue/adapters.py | quintagroup/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 26 | 2018-07-16T09:30:44.000Z | 2021-02-02T17:51:30.000Z | src/openprocurement/tender/competitivedialogue/adapters.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 15 | 2019-08-08T10:50:47.000Z | 2022-02-05T14:13:36.000Z | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.openua.adapters import TenderAboveThresholdUAConfigurator
from openprocurement.tender.competitivedialogue.constants import MINIMAL_NUMBER_OF_BIDS
from openprocurement.tender.competi... | 38.076923 | 95 | 0.818182 |
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.openua.adapters import TenderAboveThresholdUAConfigurator
from openprocurement.tender.competitivedialogue.constants import MINIMAL_NUMBER_OF_BIDS
from openprocurement.tender.competitivedialogue.models imp... | true | true |
f7f2a104de411458cb6c14497ed67fed97189c54 | 1,769 | py | Python | src/dashboard/urls.py | thesus/bokstaever | e0a5e2614dd222ccd56a8945aba4fd28de85dd31 | [
"MIT"
] | null | null | null | src/dashboard/urls.py | thesus/bokstaever | e0a5e2614dd222ccd56a8945aba4fd28de85dd31 | [
"MIT"
] | 7 | 2019-11-18T16:11:01.000Z | 2019-11-18T16:11:04.000Z | src/dashboard/urls.py | thesus/bokstaever | e0a5e2614dd222ccd56a8945aba4fd28de85dd31 | [
"MIT"
] | null | null | null | from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path, include
from dashboard.views import (
Dashboard,
PostList,
PostUpdate,
PostDelete,
PostCreate,
PageList,
PageUpdate,
PageDelete,
PageCreate,
ImageList,
ImageUpdate,
ImageDelete,
... | 36.854167 | 86 | 0.667609 | from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path, include
from dashboard.views import (
Dashboard,
PostList,
PostUpdate,
PostDelete,
PostCreate,
PageList,
PageUpdate,
PageDelete,
PageCreate,
ImageList,
ImageUpdate,
ImageDelete,
... | true | true |
f7f2a116f6143275a8277224fa283c2946829f29 | 2,174 | py | Python | setup.py | jeffknupp/domain-parser | e3a2195b3720c984730b67ee0be00e6a203ad7e2 | [
"Apache-2.0"
] | 33 | 2015-01-16T12:43:53.000Z | 2022-03-10T20:57:29.000Z | setup.py | jeffknupp/domain-parser | e3a2195b3720c984730b67ee0be00e6a203ad7e2 | [
"Apache-2.0"
] | null | null | null | setup.py | jeffknupp/domain-parser | e3a2195b3720c984730b67ee0be00e6a203ad7e2 | [
"Apache-2.0"
] | 13 | 2015-05-21T03:43:41.000Z | 2020-01-06T01:44:21.000Z | from __future__ import print_function
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import codecs
import os
import sys
import re
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
ret... | 32.447761 | 76 | 0.653174 | from __future__ import print_function
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import codecs
import os
import sys
import re
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
return codecs.open(os.path.join(here, *parts), 'r').read()... | true | true |
f7f2a18ae70033fa17c86f020e79f896f8cde481 | 984 | py | Python | pygeotoolbox/sharedtools/python2html.py | raugustyn/doctest | c37b0e2fa11ebd30d600923020b1ce44145a0250 | [
"MIT"
] | null | null | null | pygeotoolbox/sharedtools/python2html.py | raugustyn/doctest | c37b0e2fa11ebd30d600923020b1ce44145a0250 | [
"MIT"
] | null | null | null | pygeotoolbox/sharedtools/python2html.py | raugustyn/doctest | c37b0e2fa11ebd30d600923020b1ce44145a0250 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = "radek.augustyn@email.cz"
# @PRODUCTION MODULE [Full]
from pygeotoolbox.sharedtools import setParameters
def convertCode(code, lexer="python", removeFirstDiv = True):
import sys, os
import pygments.cmdline
from pygeotoolbox.sharedtools import saveStrToFile, fileRead
... | 27.333333 | 64 | 0.64126 |
__author__ = "radek.augustyn@email.cz"
from pygeotoolbox.sharedtools import setParameters
def convertCode(code, lexer="python", removeFirstDiv = True):
import sys, os
import pygments.cmdline
from pygeotoolbox.sharedtools import saveStrToFile, fileRead
workingDir = os.path.dirname(__file__)
cod... | true | true |
f7f2a1dbba5a2b74687db748fa9596374a11c462 | 1,476 | py | Python | pyclesperanto_prototype/_tier1/_binary_xor.py | haesleinhuepf/pyclesperanto_prototype | 65bc3035d3b2b61a2722c93b95bae310bfbd190e | [
"BSD-3-Clause"
] | 1 | 2021-01-15T15:32:19.000Z | 2021-01-15T15:32:19.000Z | pyclesperanto_prototype/_tier1/_binary_xor.py | haesleinhuepf/pyclesperanto_prototype | 65bc3035d3b2b61a2722c93b95bae310bfbd190e | [
"BSD-3-Clause"
] | null | null | null | pyclesperanto_prototype/_tier1/_binary_xor.py | haesleinhuepf/pyclesperanto_prototype | 65bc3035d3b2b61a2722c93b95bae310bfbd190e | [
"BSD-3-Clause"
] | null | null | null | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
@plugin_function(categories=['combine', 'binary processing', 'in assistant'])
def binary_xor(operand1 : Image, operand2 : Image, destination : Image = None):
"""Computes a binary image (containing pixel values 0 and 1) fro... | 30.122449 | 190 | 0.635501 | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
@plugin_function(categories=['combine', 'binary processing', 'in assistant'])
def binary_xor(operand1 : Image, operand2 : Image, destination : Image = None):
parameters = {
"src1":operand1,
"src2":operand... | true | true |
f7f2a29bf5617b2273dedd7134d7f9516c8137d3 | 602 | py | Python | lib/pyasn1/compat/octets.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 0b767c27b2ec173ce2fe2cbb39cbf71115eb4aba | [
"Apache-2.0"
] | 6,550 | 2017-04-27T13:33:41.000Z | 2022-03-31T14:27:13.000Z | lib/pyasn1/compat/octets.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 0b767c27b2ec173ce2fe2cbb39cbf71115eb4aba | [
"Apache-2.0"
] | 581 | 2015-01-01T08:07:16.000Z | 2022-02-23T11:44:37.000Z | lib/pyasn1/compat/octets.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 0b767c27b2ec173ce2fe2cbb39cbf71115eb4aba | [
"Apache-2.0"
] | 2,586 | 2017-04-25T06:57:32.000Z | 2022-03-31T02:10:35.000Z | from sys import version_info
if version_info[0] <= 2:
int2oct = chr
ints2octs = lambda s: ''.join([ int2oct(x) for x in s ])
null = ''
oct2int = ord
octs2ints = lambda s: [ oct2int(x) for x in s ]
str2octs = lambda x: x
octs2str = lambda x: x
isOctetsType = lambda s: isinstance(s, str)
... | 28.666667 | 60 | 0.612957 | from sys import version_info
if version_info[0] <= 2:
int2oct = chr
ints2octs = lambda s: ''.join([ int2oct(x) for x in s ])
null = ''
oct2int = ord
octs2ints = lambda s: [ oct2int(x) for x in s ]
str2octs = lambda x: x
octs2str = lambda x: x
isOctetsType = lambda s: isinstance(s, str)
... | true | true |
f7f2a2e7c8bd6d1d9809b8e00c4f64d21fc6fb15 | 852 | py | Python | trakt/objects/__init__.py | milokmet/trakt.py | 94fac17931a2f16e4719ff71cd35cf70e5be3e7b | [
"MIT"
] | 147 | 2015-01-07T11:27:26.000Z | 2022-02-21T19:57:44.000Z | trakt/objects/__init__.py | milokmet/trakt.py | 94fac17931a2f16e4719ff71cd35cf70e5be3e7b | [
"MIT"
] | 90 | 2015-01-11T14:38:22.000Z | 2021-10-03T12:18:13.000Z | trakt/objects/__init__.py | milokmet/trakt.py | 94fac17931a2f16e4719ff71cd35cf70e5be3e7b | [
"MIT"
] | 61 | 2015-01-09T12:32:09.000Z | 2022-02-03T00:50:36.000Z | from __future__ import absolute_import, division, print_function
from trakt.objects.comment import Comment
from trakt.objects.episode import Episode
from trakt.objects.list import CustomList, List, PublicList
from trakt.objects.media import Media
from trakt.objects.movie import Movie
from trakt.objects.person i... | 27.483871 | 71 | 0.726526 | from __future__ import absolute_import, division, print_function
from trakt.objects.comment import Comment
from trakt.objects.episode import Episode
from trakt.objects.list import CustomList, List, PublicList
from trakt.objects.media import Media
from trakt.objects.movie import Movie
from trakt.objects.person i... | true | true |
f7f2a412a050e485e7eb9572efbb8d41064764c8 | 28,024 | py | Python | ingest/ingest_pipeline.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | null | null | null | ingest/ingest_pipeline.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | null | null | null | ingest/ingest_pipeline.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | null | null | null | """Ingest Pipeline for ingesting expression, metadata and cluster
files into MongoDB.
DESCRIPTION
This CLI extracts and transforms different file types then writes them into
a remote MongoDB instance.
PREREQUISITES
See https://github.com/broadinstitute/scp-ingest-pipeline#prerequisites
DEVELOPER SETUP (see README.md... | 43.856025 | 761 | 0.633314 | import json
import logging
import os
import re
import sys
import re
from contextlib import nullcontext
from typing import Dict, Generator, List, Tuple, Union
from wsgiref.simple_server import WSGIRequestHandler
from bson.objectid import ObjectId
try:
from ingest_files import IngestFiles
import... | true | true |
f7f2a4e85d3d21b6cce472ca447fe74811e527de | 800 | py | Python | CheckBinarySearchTreeSequence.py | AlexLim-Pro/CodeChecker | dfee3981ab4fff152b5e6bfa3b9c73fc9c506162 | [
"Apache-2.0"
] | null | null | null | CheckBinarySearchTreeSequence.py | AlexLim-Pro/CodeChecker | dfee3981ab4fff152b5e6bfa3b9c73fc9c506162 | [
"Apache-2.0"
] | null | null | null | CheckBinarySearchTreeSequence.py | AlexLim-Pro/CodeChecker | dfee3981ab4fff152b5e6bfa3b9c73fc9c506162 | [
"Apache-2.0"
] | null | null | null | def CheckBinarySearchTreeSequence(arr: iter):
"""
Checks if a binary search sequence can is feasible
:param arr: An array containing the binary search tree sequence
:type arr: iter
"""
invalidSequenceString = "sequence is invalid: %s %s %s."
searchVal = arr[-1]
minVal = min(arr) - 1
maxVal = max(ar... | 29.62963 | 71 | 0.62125 | def CheckBinarySearchTreeSequence(arr: iter):
invalidSequenceString = "sequence is invalid: %s %s %s."
searchVal = arr[-1]
minVal = min(arr) - 1
maxVal = max(arr) + 1
for i in arr:
if i < searchVal:
if i < minVal:
return invalidSequenceString % (i, "<", minVal)
if i == minVal:
... | true | true |
f7f2a577f9664a8a940fe490719e5109911fc092 | 829 | py | Python | Pages/cart_page.py | tienn321/saucedemo | ecf9bed84311eeca2010b7040ac0c041dd5ca555 | [
"MIT"
] | null | null | null | Pages/cart_page.py | tienn321/saucedemo | ecf9bed84311eeca2010b7040ac0c041dd5ca555 | [
"MIT"
] | null | null | null | Pages/cart_page.py | tienn321/saucedemo | ecf9bed84311eeca2010b7040ac0c041dd5ca555 | [
"MIT"
] | null | null | null | from Locators.cart_locators import CartLocators
from Objects.product import Product
from Pages.base_page import BasePage
class CartPage(BasePage):
def __init__(self, driver):
super().__init__(driver)
def get_product_info(self, index):
name = self.get_text(CartLocators.LABEL_PRODUCT_NAME(index))
desc ... | 33.16 | 72 | 0.787696 | from Locators.cart_locators import CartLocators
from Objects.product import Product
from Pages.base_page import BasePage
class CartPage(BasePage):
def __init__(self, driver):
super().__init__(driver)
def get_product_info(self, index):
name = self.get_text(CartLocators.LABEL_PRODUCT_NAME(index))
desc ... | true | true |
f7f2a595cb1064065bfd6f5f69da729a64b132b1 | 2,654 | py | Python | vk2rss/using_api.py | WarmongeR1/vk2rss | 53929c7866366a1db7e48f9ddc4238d68cc6fb29 | [
"MIT"
] | null | null | null | vk2rss/using_api.py | WarmongeR1/vk2rss | 53929c7866366a1db7e48f9ddc4238d68cc6fb29 | [
"MIT"
] | null | null | null | vk2rss/using_api.py | WarmongeR1/vk2rss | 53929c7866366a1db7e48f9ddc4238d68cc6fb29 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
import pickle
import re
import textwrap
from functools import lru_cache
import vk
from feedgen.feed import FeedGenerator
def _(text):
return r"<![CDATA[{}]]>".format(text)
@lru_cache()
def get_author_name(api, author_id: int):
if author_id < 0:
info = api.groups.getById(gr... | 28.234043 | 111 | 0.579503 |
import pickle
import re
import textwrap
from functools import lru_cache
import vk
from feedgen.feed import FeedGenerator
def _(text):
return r"<![CDATA[{}]]>".format(text)
@lru_cache()
def get_author_name(api, author_id: int):
if author_id < 0:
info = api.groups.getById(group_ids=abs(author_id), f... | true | true |
f7f2a74ab64859ee0733c60d98dac1221208a6df | 5,613 | py | Python | armada/tests/unit/handlers/test_chartbuilder.py | openstack/airship-armada | 416eff4e52f72169c3ebf49a8ffca36086692b7a | [
"Apache-2.0"
] | 29 | 2018-05-21T04:34:34.000Z | 2019-05-10T12:32:46.000Z | armada/tests/unit/handlers/test_chartbuilder.py | openstack/airship-armada | 416eff4e52f72169c3ebf49a8ffca36086692b7a | [
"Apache-2.0"
] | 1 | 2019-11-11T23:31:27.000Z | 2019-11-11T23:31:27.000Z | armada/tests/unit/handlers/test_chartbuilder.py | airshipit/armada | 790af88d61bb3d0f0368faae22e94b4e533df92d | [
"Apache-2.0"
] | 9 | 2019-05-23T10:14:00.000Z | 2020-03-03T03:08:02.000Z | # Copyright 2017 The Armada 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 w... | 33.213018 | 79 | 0.618208 |
import os
from pathlib import Path
import shutil
import fixtures
import mock
import testtools
import yaml
from armada import const
from armada.handlers.chartbuilder import ChartBuilder
from armada.exceptions import chartbuilder_exceptions
class BaseChartBuilderTestCase(testtools.TestCase):
chart_y... | true | true |
f7f2a7772a7f8bf7f02b5b2e37768ec85524e7e8 | 2,295 | py | Python | 2021/CVE-2021-42567/poc/pocsploit/CVE-2021-42567.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 421 | 2021-12-07T08:46:40.000Z | 2022-03-31T12:42:16.000Z | 2021/CVE-2021-42567/poc/pocsploit/CVE-2021-42567.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 5 | 2022-03-27T07:37:32.000Z | 2022-03-31T13:56:11.000Z | 2021/CVE-2021-42567/poc/pocsploit/CVE-2021-42567.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 144 | 2021-12-07T11:06:14.000Z | 2022-03-31T07:41:35.000Z | import requests
# Vuln Base Info
def info():
return {
"author": "cckuailong",
"name": '''Apereo CAS Reflected Cross-Site Scripting''',
"description": '''Apereo CAS through 6.4.1 allows cross-site scripting via POST requests sent to the REST API endpoints.''',
"severity": "medium",
... | 32.323944 | 147 | 0.576906 | import requests
def info():
return {
"author": "cckuailong",
"name": '''Apereo CAS Reflected Cross-Site Scripting''',
"description": '''Apereo CAS through 6.4.1 allows cross-site scripting via POST requests sent to the REST API endpoints.''',
"severity": "medium",
"referen... | true | true |
f7f2a9a6c7ab8ce82f433919b2af0a776d4c798e | 68,764 | py | Python | Registry/RegistryParse.py | binref/python-registry | 11e857623469dd28ed14519a08d2db7c8228ca0c | [
"Apache-2.0"
] | null | null | null | Registry/RegistryParse.py | binref/python-registry | 11e857623469dd28ed14519a08d2db7c8228ca0c | [
"Apache-2.0"
] | null | null | null | Registry/RegistryParse.py | binref/python-registry | 11e857623469dd28ed14519a08d2db7c8228ca0c | [
"Apache-2.0"
] | null | null | null | #!/bin/python
# This file is part of python-registry.
#
# Copyright 2011 Will Ballenthin <william.ballenthin@mandiant.com>
# while at Mandiant <http://www.mandiant.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | 34.852509 | 132 | 0.595428 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import struct
import datetime
import decimal
import binascii
from ctypes import c_uint32
from enum import Enum
from collections import namedtuple
from Registry import SettingsParse
... | true | true |
f7f2ab3b39a3c2e4255ead00f77dcc26f40c91bb | 2,144 | py | Python | Bot1/instrumented_file/twitterRetweet.py | miztiik/aws-twitterbot-workshop | c4971bc00f4d808a414f7344935ddf27255909cd | [
"MIT-0"
] | 21 | 2019-02-20T04:53:58.000Z | 2022-02-18T12:47:12.000Z | Bot1/instrumented_file/twitterRetweet.py | aws-samples/aws-twitterbot-workshop | c4971bc00f4d808a414f7344935ddf27255909cd | [
"MIT-0"
] | null | null | null | Bot1/instrumented_file/twitterRetweet.py | aws-samples/aws-twitterbot-workshop | c4971bc00f4d808a414f7344935ddf27255909cd | [
"MIT-0"
] | 7 | 2019-03-04T09:32:43.000Z | 2022-03-17T20:45:03.000Z | import boto3
import tweepy
import os
import json
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core import patch_all
ssm = boto3.client('ssm', region_name='us-west-2')
def authenticate_twitter():
xray_recorder.begin_subsegment('twitter-authentication')
xray_recorder.begin_subsegment('ssm-get_... | 34.031746 | 124 | 0.659981 | import boto3
import tweepy
import os
import json
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core import patch_all
ssm = boto3.client('ssm', region_name='us-west-2')
def authenticate_twitter():
xray_recorder.begin_subsegment('twitter-authentication')
xray_recorder.begin_subsegment('ssm-get_... | true | true |
f7f2ab4fe0e93d403d85cd99c97c845680784686 | 2,231 | py | Python | oauthlib/oauth2/rfc6749/utils.py | braedon/oauthlib | 6875e3ac513a3828c3328d4f585d4c38b2b2c698 | [
"BSD-3-Clause"
] | 1 | 2021-11-18T13:47:29.000Z | 2021-11-18T13:47:29.000Z | oauthlib/oauth2/rfc6749/utils.py | braedon/oauthlib | 6875e3ac513a3828c3328d4f585d4c38b2b2c698 | [
"BSD-3-Clause"
] | null | null | null | oauthlib/oauth2/rfc6749/utils.py | braedon/oauthlib | 6875e3ac513a3828c3328d4f585d4c38b2b2c698 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth 2 spec.
"""
import datetime
import os
from urllib.parse import quote, urlparse
from oauthlib.common import urldecode
def list_to_scope(scope):
"""Convert a list of scopes to a space ... | 26.247059 | 92 | 0.629314 |
import datetime
import os
from urllib.parse import quote, urlparse
from oauthlib.common import urldecode
def list_to_scope(scope):
if isinstance(scope, str) or scope is None:
return scope
elif isinstance(scope, (set, tuple, list)):
return " ".join([str(s) for s in scope])
else:
r... | true | true |
f7f2ac6e88bcf2cf7587a76493d6deb8330bbf6c | 23 | py | Python | mkultra/app_version.py | jsenellart/mkultra | c43d909e6bd9b9c71c8bec8c656e2d3ea7d695d6 | [
"BSD-3-Clause"
] | null | null | null | mkultra/app_version.py | jsenellart/mkultra | c43d909e6bd9b9c71c8bec8c656e2d3ea7d695d6 | [
"BSD-3-Clause"
] | null | null | null | mkultra/app_version.py | jsenellart/mkultra | c43d909e6bd9b9c71c8bec8c656e2d3ea7d695d6 | [
"BSD-3-Clause"
] | 1 | 2021-01-01T12:13:07.000Z | 2021-01-01T12:13:07.000Z | version = "0.1.0.dev0"
| 11.5 | 22 | 0.608696 | version = "0.1.0.dev0"
| true | true |
f7f2ac71fb720e7865344ccf9b0ce0409495c146 | 1,160 | py | Python | tests/test_state_machine.py | wesleyks/fine_sm | 12ec4f25cbab301f6d8a09c94c1806de1cccb847 | [
"MIT"
] | 2 | 2017-03-14T20:37:16.000Z | 2017-04-05T02:12:28.000Z | tests/test_state_machine.py | wesleyks/finesm | 12ec4f25cbab301f6d8a09c94c1806de1cccb847 | [
"MIT"
] | null | null | null | tests/test_state_machine.py | wesleyks/finesm | 12ec4f25cbab301f6d8a09c94c1806de1cccb847 | [
"MIT"
] | null | null | null | from finesm import StateMachine, State
class SimpleStateMachine(StateMachine):
waiting = State(default=True)
running = State()
def __init__(self):
super(SimpleStateMachine, self).__init__()
self.foo = False
self.bar = False
self.updoot = 0
@waiting.on_message('start')... | 22.307692 | 60 | 0.684483 | from finesm import StateMachine, State
class SimpleStateMachine(StateMachine):
waiting = State(default=True)
running = State()
def __init__(self):
super(SimpleStateMachine, self).__init__()
self.foo = False
self.bar = False
self.updoot = 0
@waiting.on_message('start')... | true | true |
f7f2ad3ded912b88f4241a7f0ff4e78024f8a471 | 19,701 | py | Python | recohut/datasets/movielens.py | sparsh-ai/recohut | 4121f665761ffe38c9b6337eaa9293b26bee2376 | [
"Apache-2.0"
] | null | null | null | recohut/datasets/movielens.py | sparsh-ai/recohut | 4121f665761ffe38c9b6337eaa9293b26bee2376 | [
"Apache-2.0"
] | 1 | 2022-01-12T05:40:57.000Z | 2022-01-12T05:40:57.000Z | recohut/datasets/movielens.py | RecoHut-Projects/recohut | 4121f665761ffe38c9b6337eaa9293b26bee2376 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/datasets/datasets.movielens.ipynb (unless otherwise specified).
__all__ = ['ML1mDataset', 'ML1mDataModule', 'ML1mDataset_v2', 'ML1mDataModule_v2', 'ML1mDataset_v3',
'ML1mDataModule_v3', 'ML1mDataset_v4', 'ML100kDataset', 'sparseFeature', 'create_ml_1m_dataset'... | 40.95842 | 113 | 0.625298 |
__all__ = ['ML1mDataset', 'ML1mDataModule', 'ML1mDataset_v2', 'ML1mDataModule_v2', 'ML1mDataset_v3',
'ML1mDataModule_v3', 'ML1mDataset_v4', 'ML100kDataset', 'sparseFeature', 'create_ml_1m_dataset',
'create_implicit_ml_1m_dataset']
from typing import Any, Iterable, List, Optional, Tuple, Union,... | true | true |
f7f2adf00045e7b0c1ab53a32d052e8efd66fe88 | 6,407 | py | Python | loldib/getratings/models/NA/na_ivern/na_ivern_bot.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_ivern/na_ivern_bot.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_ivern/na_ivern_bot.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | from getratings.models.ratings import Ratings
class NA_Ivern_Bot_Aatrox(Ratings):
pass
class NA_Ivern_Bot_Ahri(Ratings):
pass
class NA_Ivern_Bot_Akali(Ratings):
pass
class NA_Ivern_Bot_Alistar(Ratings):
pass
class NA_Ivern_Bot_Amumu(Ratings):
pass
class NA_Ivern_Bot_Anivia(Ratings):
pass
... | 15.364508 | 46 | 0.761667 | from getratings.models.ratings import Ratings
class NA_Ivern_Bot_Aatrox(Ratings):
pass
class NA_Ivern_Bot_Ahri(Ratings):
pass
class NA_Ivern_Bot_Akali(Ratings):
pass
class NA_Ivern_Bot_Alistar(Ratings):
pass
class NA_Ivern_Bot_Amumu(Ratings):
pass
class NA_Ivern_Bot_Anivia(Ratings):
pass
... | true | true |
f7f2af179b6db55972aaf5e128e051884afc6825 | 20,638 | py | Python | tests/test_imageconfig.py | crashvb/docker-sign-verify | 3c2a968fc1461398c8be04ecaa54c028cca5c0fe | [
"Apache-2.0"
] | 4 | 2019-07-22T02:47:44.000Z | 2021-09-16T18:44:39.000Z | tests/test_imageconfig.py | crashvb/docker-sign-verify | 3c2a968fc1461398c8be04ecaa54c028cca5c0fe | [
"Apache-2.0"
] | 20 | 2019-03-18T22:50:19.000Z | 2021-02-26T04:07:34.000Z | tests/test_imageconfig.py | crashvb/docker-sign-verify | 3c2a968fc1461398c8be04ecaa54c028cca5c0fe | [
"Apache-2.0"
] | 6 | 2019-04-14T01:15:01.000Z | 2022-03-04T04:34:15.000Z | #!/usr/bin/env python
# pylint: disable=protected-access,redefined-outer-name,too-many-arguments
"""ImageConfig tests."""
import json
import logging
from copy import deepcopy
from typing import List
import pytest
from docker_registry_client_async import FormattedSHA256
from pytest_gnupg_fixtures import GnuPGKeypa... | 37.320072 | 119 | 0.713538 |
import json
import logging
from copy import deepcopy
from typing import List
import pytest
from docker_registry_client_async import FormattedSHA256
from pytest_gnupg_fixtures import GnuPGKeypair
from docker_sign_verify import (
DigestMismatchError,
GPGSigner,
ImageConfig,
NoSignatureError,
... | true | true |
f7f2b090ebb7da606272a6e87ca6f138ea964b9b | 158 | py | Python | Chapter_2/Integer_Float/bitwise_operation.py | random-forest-ai/python_course | cd6b7f30e1932312c05178e6bb66cc95c72fe6c1 | [
"MIT"
] | null | null | null | Chapter_2/Integer_Float/bitwise_operation.py | random-forest-ai/python_course | cd6b7f30e1932312c05178e6bb66cc95c72fe6c1 | [
"MIT"
] | null | null | null | Chapter_2/Integer_Float/bitwise_operation.py | random-forest-ai/python_course | cd6b7f30e1932312c05178e6bb66cc95c72fe6c1 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
print(bin(47))
print(~47)
print(47 | 48)
print(47 & -48)
print(47 ^ -48)
print(47 << 2)
print(47 >> 2)
| 17.555556 | 26 | 0.493671 | if __name__ == '__main__':
print(bin(47))
print(~47)
print(47 | 48)
print(47 & -48)
print(47 ^ -48)
print(47 << 2)
print(47 >> 2)
| true | true |
f7f2b0b4ca8bca9402db95806f0c33db4f8e1e0f | 5,382 | py | Python | lib/googlecloudsdk/core/util/importing.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/core/util/importing.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/util/importing.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
#
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 33.222222 | 80 | 0.730026 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import imp
import sys
import types
import six
try:
from importlib._bootstrap import _ImportLockContext
except ImportError:
class _ImportLockContext(object):
"""Context manager... | true | true |
f7f2b1a1eff4d6bfea06266a596eb7738a75ef12 | 8,885 | py | Python | tests/unit/test_pipe.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | 1 | 2022-02-12T06:27:26.000Z | 2022-02-12T06:27:26.000Z | tests/unit/test_pipe.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | tests/unit/test_pipe.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | import os
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributed as dist
import pytest
import deepspeed
import deepspeed.runtime.utils as ds_utils
from deepspeed.runtime.pipe.topology import PipeDataParallelTopology, PipeModelDataParallelTopology
PipeTopo = PipeDat... | 32.907407 | 129 | 0.508385 | import os
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributed as dist
import pytest
import deepspeed
import deepspeed.runtime.utils as ds_utils
from deepspeed.runtime.pipe.topology import PipeDataParallelTopology, PipeModelDataParallelTopology
PipeTopo = PipeDat... | true | true |
f7f2b2ecba38ee55d0eab4249175249121ec6370 | 449 | py | Python | etc/coq-scripts/strictify-coqdep.py | anonymous-code-submission-01/sp2019-54-code | 8867f5bed0821415ec99f593b1d61f715ed4f789 | [
"MIT"
] | null | null | null | etc/coq-scripts/strictify-coqdep.py | anonymous-code-submission-01/sp2019-54-code | 8867f5bed0821415ec99f593b1d61f715ed4f789 | [
"MIT"
] | null | null | null | etc/coq-scripts/strictify-coqdep.py | anonymous-code-submission-01/sp2019-54-code | 8867f5bed0821415ec99f593b1d61f715ed4f789 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import sys, subprocess
import re
if __name__ == '__main__':
p = subprocess.Popen(sys.argv[1:], stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()
reg = re.compile(r'''Warning(: in file .*?,\s*required library .*? matches several files in path)''')
if reg.search(stderr):
... | 32.071429 | 105 | 0.650334 |
import sys, subprocess
import re
if __name__ == '__main__':
p = subprocess.Popen(sys.argv[1:], stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()
reg = re.compile(r'''Warning(: in file .*?,\s*required library .*? matches several files in path)''')
if reg.search(stderr):
sys.stderr.writ... | true | true |
f7f2b347f088456fb18e5356a6694ff99b14fcf3 | 1,456 | py | Python | Tests/Validation/Simulation/test_CEFC_001.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | Tests/Validation/Simulation/test_CEFC_001.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | Tests/Validation/Simulation/test_CEFC_001.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.Simu1 import Simu1
from pyleecan.Classes.InputCurrent import InputCurrent
from pyleecan.Classes.ImportGenVectLin import ImportGenVectLin
from pyleecan.Classes.ImportMatrixVal import ImportMatrixVal
from pyleecan.Classes.MagFEMM import MagFEMM
from pyleecan.Cla... | 33.860465 | 86 | 0.724588 |
import pytest
from pyleecan.Classes.Simu1 import Simu1
from pyleecan.Classes.InputCurrent import InputCurrent
from pyleecan.Classes.ImportGenVectLin import ImportGenVectLin
from pyleecan.Classes.ImportMatrixVal import ImportMatrixVal
from pyleecan.Classes.MagFEMM import MagFEMM
from pyleecan.Classes.Output import Outp... | true | true |
f7f2b4739026738154e0ff3519792f40cbcbf0a9 | 2,355 | py | Python | tinyfunds/urls.py | sleepy/tinyfunds | e66c9ee158fa4c3b5ec14b2a5ea20cbdcc1c29e1 | [
"MIT"
] | 1 | 2020-12-02T19:47:33.000Z | 2020-12-02T19:47:33.000Z | tinyfunds/urls.py | sleepy/tinyfunds | e66c9ee158fa4c3b5ec14b2a5ea20cbdcc1c29e1 | [
"MIT"
] | 4 | 2021-04-08T20:35:24.000Z | 2021-09-22T19:40:03.000Z | tinyfunds/urls.py | sleepy/tinyfunds | e66c9ee158fa4c3b5ec14b2a5ea20cbdcc1c29e1 | [
"MIT"
] | null | null | null | """tinyfunds URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 51.195652 | 109 | 0.697665 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from django.views.generic import TemplateView
from .users import views as user_views
from . import views
urlpatterns = [
path('', views.HomeView.as_view(), name='home'),
path('user/', views.UserView.as_view(... | true | true |
f7f2b4794b36e229f0e263b5729f8d8dec56a5d4 | 4,234 | py | Python | partition_decode/network.py | rflperry/double_descent | 5001613791b3bbfa77c86f8426458253e8989bea | [
"Apache-2.0"
] | 3 | 2021-09-05T15:03:10.000Z | 2021-12-21T21:00:41.000Z | partition_decode/network.py | rflperry/double_descent | 5001613791b3bbfa77c86f8426458253e8989bea | [
"Apache-2.0"
] | 1 | 2021-12-01T18:57:19.000Z | 2021-12-01T18:57:19.000Z | partition_decode/network.py | rflperry/double_descent | 5001613791b3bbfa77c86f8426458253e8989bea | [
"Apache-2.0"
] | 1 | 2021-05-17T22:27:47.000Z | 2021-05-17T22:27:47.000Z | import numpy as np
import torch
from torch import nn
import os
## Network functions
# Model
class Net(nn.Module):
"""
A class for a deep neural net architecture.
Parameters
----------
in_dim: int
Input dimension.
out_dim: int
Output dimension.
hidden_size: int, default ... | 22.167539 | 91 | 0.607463 | import numpy as np
import torch
from torch import nn
import os
ule):
def __init__(
self,
in_dim,
out_dim,
hidden_size=10,
n_hidden=2,
activation=torch.nn.ReLU(),
bias=False,
bn=False,
):
super(Net, self).__init__()
module = nn.M... | true | true |
f7f2b4a0f4a56f1c6688d80dc3602f95a3b30d00 | 4,556 | py | Python | loadHDF5.py | msw1293/HDF5-data-Mining | 2343b26f0e1c5b82ba2cbd56ae3cc2d48311f75c | [
"MIT"
] | null | null | null | loadHDF5.py | msw1293/HDF5-data-Mining | 2343b26f0e1c5b82ba2cbd56ae3cc2d48311f75c | [
"MIT"
] | null | null | null | loadHDF5.py | msw1293/HDF5-data-Mining | 2343b26f0e1c5b82ba2cbd56ae3cc2d48311f75c | [
"MIT"
] | null | null | null | import h5py
import numpy as np
import time
import sys
import os
import glob
import subprocess
categories = [
'Data_Point',
'Test_Time',
'Step_Time',
'DateTime',
'Step_Index',
'Cycle_Index',
'Current',
... | 29.393548 | 114 | 0.44403 | import h5py
import numpy as np
import time
import sys
import os
import glob
import subprocess
categories = [
'Data_Point',
'Test_Time',
'Step_Time',
'DateTime',
'Step_Index',
'Cycle_Index',
'Current',
... | false | true |
f7f2b4a75f20df412c95c554e4dbf94c513b8bc3 | 1,791 | py | Python | main.py | AlexandraSharipova/streamlit-image-editor | 5f287ea448b9cbd3a87945253332185a40beb4ab | [
"MIT"
] | 1 | 2021-11-29T16:18:00.000Z | 2021-11-29T16:18:00.000Z | main.py | AlexandraSharipova/streamlit-image-editor | 5f287ea448b9cbd3a87945253332185a40beb4ab | [
"MIT"
] | 1 | 2021-12-08T17:55:22.000Z | 2021-12-08T17:55:22.000Z | main.py | AlexandraSharipova/streamlit-image-editor | 5f287ea448b9cbd3a87945253332185a40beb4ab | [
"MIT"
] | 8 | 2021-11-28T10:57:25.000Z | 2021-12-15T16:04:27.000Z | import streamlit as st
import numpy as np
from PIL import Image, ImageFile
import os
from utils import *
from image_analysis import *
from image_manipulations import *
ImageFile.LOAD_TRUNCATED_IMAGES = True
state = {
'image': None, # An active image to work with
'original_image': None # An active image to ... | 32.563636 | 177 | 0.676717 | import streamlit as st
import numpy as np
from PIL import Image, ImageFile
import os
from utils import *
from image_analysis import *
from image_manipulations import *
ImageFile.LOAD_TRUNCATED_IMAGES = True
state = {
'image': None,
'original_image': None
}
state = on_start(state)
show_analysis = st.s... | true | true |
f7f2b693001085d4869f0c7e274c172ffd3b28bb | 1,368 | py | Python | kubernetes/test/test_v1_secret.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_secret.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_secret.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.5.0-beta.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Lice... | 25.333333 | 105 | 0.710526 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_secret import V1Secret
class TestV1Secret(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
p... | true | true |
f7f2b6f1cbca432b5265dc97c4ee1a53cfb96e26 | 7,823 | py | Python | cm_install.py | it-gro/cdp-deploy | 5589e835c8ba1a15f1fb34f3196438824e8d8111 | [
"Apache-2.0"
] | null | null | null | cm_install.py | it-gro/cdp-deploy | 5589e835c8ba1a15f1fb34f3196438824e8d8111 | [
"Apache-2.0"
] | null | null | null | cm_install.py | it-gro/cdp-deploy | 5589e835c8ba1a15f1fb34f3196438824e8d8111 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python3
import cm_client
import json
import hashlib
import time
from optparse import OptionParser
from cm_client.rest import ApiException
from collections import namedtuple
from pprint import pprint
# API can be called from the browser: http://192.168.0.182:7180/api/v41/cm/deployment
# https://cloudera.gi... | 39.71066 | 140 | 0.691934 |
import cm_client
import json
import hashlib
import time
from optparse import OptionParser
from cm_client.rest import ApiException
from collections import namedtuple
from pprint import pprint
hostname = None
password = None
localrepo = False
parcelsuri = ''
cm_client.configuration.username = 'admin'
cm_clien... | true | true |
f7f2b83bc96a03552366a1631158a5fb70f5f18f | 1,447 | py | Python | tests/functional/dpg_events/test_dpg_renamed.py | atsgen/tf-vcenter-fabric-manager | bb2cf0a0f80464457e1b884847df77a11259077c | [
"Apache-2.0"
] | 1 | 2022-03-13T06:31:49.000Z | 2022-03-13T06:31:49.000Z | tests/functional/dpg_events/test_dpg_renamed.py | atsgen/tf-vcenter-fabric-manager | bb2cf0a0f80464457e1b884847df77a11259077c | [
"Apache-2.0"
] | null | null | null | tests/functional/dpg_events/test_dpg_renamed.py | atsgen/tf-vcenter-fabric-manager | bb2cf0a0f80464457e1b884847df77a11259077c | [
"Apache-2.0"
] | 1 | 2020-08-25T12:44:56.000Z | 2020-08-25T12:44:56.000Z | import pytest
from pyVmomi import vim
from tests import utils
from vnc_api import vnc_api
from cvfm import models
@pytest.fixture
def vmware_dpg():
net_data = {
"key": "dvportgroup-1",
"name": "dpg-1",
"type": vim.DistributedVirtualPortgroup,
"dvs-name": "dvs-1",
"vlan": 5... | 28.372549 | 78 | 0.730477 | import pytest
from pyVmomi import vim
from tests import utils
from vnc_api import vnc_api
from cvfm import models
@pytest.fixture
def vmware_dpg():
net_data = {
"key": "dvportgroup-1",
"name": "dpg-1",
"type": vim.DistributedVirtualPortgroup,
"dvs-name": "dvs-1",
"vlan": 5... | true | true |
f7f2b856ec3152dd01390d3c8725b97744e58d6a | 8,625 | py | Python | data/demo_dataset.py | AIprogrammer/Detailed-virtual-try-on | 25691ef097a3e82d108a8dbf596ba635092a8301 | [
"MIT"
] | 160 | 2020-04-11T12:24:19.000Z | 2022-03-25T06:34:03.000Z | data/demo_dataset.py | AIprogrammer/Detailed-virtual-try-on | 25691ef097a3e82d108a8dbf596ba635092a8301 | [
"MIT"
] | 42 | 2020-04-11T12:23:02.000Z | 2021-11-29T15:31:58.000Z | data/demo_dataset.py | AIprogrammer/Detailed-virtual-try-on | 25691ef097a3e82d108a8dbf596ba635092a8301 | [
"MIT"
] | 51 | 2020-04-20T01:46:54.000Z | 2022-02-19T07:27:38.000Z | import os
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.data.dataset import Dataset
import os.path as osp
from PIL import Image
import numpy as np
from torchvision import transforms
from torchvision import utils
from utils import pose_utils
from PIL import ImageDraw
from ut... | 44.458763 | 157 | 0.617391 | import os
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.data.dataset import Dataset
import os.path as osp
from PIL import Image
import numpy as np
from torchvision import transforms
from torchvision import utils
from utils import pose_utils
from PIL import ImageDraw
from ut... | true | true |
f7f2b8964e17915d07c022e0657c6634b8b1ebaa | 1,521 | py | Python | tests/test_style_settings_config.py | rohankumardubey/chartify | 5ac3a88e54cf620389741f396cc19d60fe032822 | [
"Apache-2.0"
] | 3,111 | 2018-09-18T01:59:56.000Z | 2022-03-29T14:45:00.000Z | tests/test_style_settings_config.py | rohankumardubey/chartify | 5ac3a88e54cf620389741f396cc19d60fe032822 | [
"Apache-2.0"
] | 97 | 2018-09-21T19:53:19.000Z | 2022-03-03T04:48:54.000Z | tests/test_style_settings_config.py | rohankumardubey/chartify | 5ac3a88e54cf620389741f396cc19d60fe032822 | [
"Apache-2.0"
] | 316 | 2018-10-06T05:39:39.000Z | 2022-03-21T08:38:00.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2020 Spotify AB
#
# 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... | 29.823529 | 76 | 0.734385 |
import importlib
import os
STYLE_SETTINGS_CONFIG = '''\
foo:
baz.bar: 0.25
quux: deadbeef
bar:
baz: bar quux
'''
def test_style_settings_config(monkeypatch, tmpdir):
f = tmpdir.join('style_settings_config.yaml')
f.write(STYLE_SETTINGS_CONFIG)
monkeypatch.setenv('CHARTIFY_CONFI... | true | true |
f7f2b8b216b780d370232b12d4478ecff9ee1c7c | 2,361 | py | Python | demo3.py | OvJat/LoadData | 2ed1d65b91c534ebf999e272cb067e60275a7318 | [
"BSD-3-Clause"
] | null | null | null | demo3.py | OvJat/LoadData | 2ed1d65b91c534ebf999e272cb067e60275a7318 | [
"BSD-3-Clause"
] | null | null | null | demo3.py | OvJat/LoadData | 2ed1d65b91c534ebf999e272cb067e60275a7318 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Support Python 3.8
@author: Lou Xiao(louxiao@i32n.com)
@maintainer: Lou Xiao(louxiao@i32n.com)
@copyright: Copyright 2018~2021
@created time: 2021-10-17 19:26:32 CST
@updated time: 2021-10-17 19:26:32 CST
"""
import os
import time
... | 29.148148 | 95 | 0.576451 |
import os
import time
import torch
import torch.utils.data as td
import h5py
def preprocess(data_dir: str, num_samples: int):
data_file = os.path.join(data_dir, 'dataset.hdf5')
os.makedirs(data_dir, exist_ok=True)
with h5py.File(data_file, 'w') as f:
for i in range(num_samples):
... | true | true |
f7f2b8d5b4585dfe0ac1b37a3a97fa36040e037a | 12,837 | py | Python | jans-linux-setup/jans_setup/static/extension/person_authentication/BasicLockAccountExternalAuthenticator.py | nikdavnik/jans | 5e9abc74cca766a066512eab2aca6563ce480bff | [
"Apache-2.0"
] | 18 | 2022-01-13T13:45:13.000Z | 2022-03-30T04:41:18.000Z | jans-linux-setup/jans_setup/static/extension/person_authentication/BasicLockAccountExternalAuthenticator.py | nikdavnik/jans | 5e9abc74cca766a066512eab2aca6563ce480bff | [
"Apache-2.0"
] | 604 | 2022-01-13T12:32:50.000Z | 2022-03-31T20:27:36.000Z | jans-linux-setup/jans_setup/static/extension/person_authentication/BasicLockAccountExternalAuthenticator.py | nikdavnik/jans | 5e9abc74cca766a066512eab2aca6563ce480bff | [
"Apache-2.0"
] | 8 | 2022-01-28T00:23:25.000Z | 2022-03-16T05:12:12.000Z | # Janssen Project software is available under the Apache 2.0 License (2004). See http://www.apache.org/licenses/ for full text.
# Copyright (c) 2020, Janssen Project
#
# Author: Yuriy Movchan
# Author: Gasmyr Mougang
#
from io.jans.service.cdi.util import CdiUtil
from io.jans.as.server.security import Identity
from io... | 47.194853 | 258 | 0.671652 |
from io.jans.service.cdi.util import CdiUtil
from io.jans.as.server.security import Identity
from io.jans.model.custom.script.type.auth import PersonAuthenticationType
from io.jans.as.server.service import AuthenticationService
from io.jans.as.server.service import UserService
from io.jans.service import CacheSe... | false | true |
f7f2b8db7e38718b22b602c0bac6d46e36326082 | 10,272 | py | Python | python/test/test_frame.py | Sandeepa1995/cylon | a42d04ad9a65b20c84a15d649f9d849f18676183 | [
"Apache-2.0"
] | null | null | null | python/test/test_frame.py | Sandeepa1995/cylon | a42d04ad9a65b20c84a15d649f9d849f18676183 | [
"Apache-2.0"
] | null | null | null | python/test/test_frame.py | Sandeepa1995/cylon | a42d04ad9a65b20c84a15d649f9d849f18676183 | [
"Apache-2.0"
] | null | null | null | ##
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 27.465241 | 96 | 0.615849 |
import os
import numpy as np
import pandas as pd
import pycylon as cn
import pyarrow as pa
from pycylon import Series
from pycylon.frame import DataFrame
from pycylon import Table
from pycylon.io import CSVReadOptions
from pycylon.io import read_csv
from pycylon import CylonContext
import operator
def te... | true | true |
f7f2ba7875f0ded2805b38584d378976a8478b99 | 545 | py | Python | pika/models.py | jphacks/SP_1906 | 98be72deac12c845daebc5c021bba7d37066f2da | [
"MIT"
] | 1 | 2020-03-25T19:38:38.000Z | 2020-03-25T19:38:38.000Z | pika/models.py | jphacks/SP_1906 | 98be72deac12c845daebc5c021bba7d37066f2da | [
"MIT"
] | null | null | null | pika/models.py | jphacks/SP_1906 | 98be72deac12c845daebc5c021bba7d37066f2da | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Tree(models.Model):
date = models.DateTimeField(auto_now_add=True)
name = models.CharField(max_length=20)
CHOICES = (
(1, 'クール'),
(2, 'かわいい'),
(3, 'おしゃれ'),
(4, 'ばえ'),
(5, '読める!'),
(6, 'おもしろい'),
)
look = models.I... | 20.185185 | 73 | 0.6 | from django.db import models
class Tree(models.Model):
date = models.DateTimeField(auto_now_add=True)
name = models.CharField(max_length=20)
CHOICES = (
(1, 'クール'),
(2, 'かわいい'),
(3, 'おしゃれ'),
(4, 'ばえ'),
(5, '読める!'),
(6, 'おもしろい'),
)
look = models.IntegerField(choices=CHOICE... | true | true |
f7f2bb2e30d5d380e6dae2c03e5889cd7f2f381b | 313 | py | Python | wireframe/wireframe.py | AliShazly/maya-scripts | 1716a1f80f7081fbb36300ad98baf4a08e2376b4 | [
"MIT"
] | null | null | null | wireframe/wireframe.py | AliShazly/maya-scripts | 1716a1f80f7081fbb36300ad98baf4a08e2376b4 | [
"MIT"
] | null | null | null | wireframe/wireframe.py | AliShazly/maya-scripts | 1716a1f80f7081fbb36300ad98baf4a08e2376b4 | [
"MIT"
] | null | null | null | import maya.cmds as cmds
def wireframe(obj_name, offset, thickness):
cmds.select(obj_name + ".f[0:]")
cmds.setAttr(cmds.polyExtrudeFacet(keepFacesTogether=False)[0] + ".offset", offset)
cmds.delete()
cmds.select("{}.f[0:]".format(obj_name))
cmds.polyExtrudeFacet(thickness=thickness) | 39.125 | 88 | 0.686901 | import maya.cmds as cmds
def wireframe(obj_name, offset, thickness):
cmds.select(obj_name + ".f[0:]")
cmds.setAttr(cmds.polyExtrudeFacet(keepFacesTogether=False)[0] + ".offset", offset)
cmds.delete()
cmds.select("{}.f[0:]".format(obj_name))
cmds.polyExtrudeFacet(thickness=thickness) | true | true |
f7f2bb9b5d9f16b1b98ed5aa4cb72cbd7c28bf67 | 9,940 | py | Python | src/amuse/support/options.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 1 | 2019-04-09T09:06:08.000Z | 2019-04-09T09:06:08.000Z | src/amuse/support/options.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | null | null | null | src/amuse/support/options.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 2 | 2021-11-19T04:41:37.000Z | 2021-11-20T02:11:17.000Z | import ConfigParser
import os.path
import os
import platform
from StringIO import StringIO
from amuse.support.core import late
from amuse.support import exceptions
try:
import pkg_resources
except ImportError:
pkg_resources = None
class GlobalOptions(object):
INSTANCE = None
def __init__... | 32.064516 | 158 | 0.594869 | import ConfigParser
import os.path
import os
import platform
from StringIO import StringIO
from amuse.support.core import late
from amuse.support import exceptions
try:
import pkg_resources
except ImportError:
pkg_resources = None
class GlobalOptions(object):
INSTANCE = None
def __init__... | true | true |
f7f2bbde349bc28d2b2999561cd8cb94d511aec3 | 12,595 | py | Python | tsai/models/TSiTPlus.py | miladalipour99/tsai | 1f11d56c2d170eab5c70500bec41d9041315743a | [
"Apache-2.0"
] | null | null | null | tsai/models/TSiTPlus.py | miladalipour99/tsai | 1f11d56c2d170eab5c70500bec41d9041315743a | [
"Apache-2.0"
] | null | null | null | tsai/models/TSiTPlus.py | miladalipour99/tsai | 1f11d56c2d170eab5c70500bec41d9041315743a | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/124_models.TSiTPlus.ipynb (unless otherwise specified).
__all__ = ['TSiTPlus', 'TSiT']
# Cell
from ..imports import *
from .utils import *
from .layers import *
from typing import Callable
# Cell
class _TSiTEncoderLayer(nn.Module):
def __init__(self, d_model:int, n... | 55.977778 | 157 | 0.632553 |
__all__ = ['TSiTPlus', 'TSiT']
from ..imports import *
from .utils import *
from .layers import *
from typing import Callable
class _TSiTEncoderLayer(nn.Module):
def __init__(self, d_model:int, n_heads:int, q_len:int=None, attn_dropout:float=0., dropout:float=0, drop_path_rate:float=0.,
mlp_r... | true | true |
f7f2bbf088a62c145d6de9428102bce0c2e3b07f | 7,241 | py | Python | keras_fcn/encoders.py | psmaAaron/keras-fcn | 90843ef7465e0ce289f0a45a62d2d176a932e7ab | [
"MIT"
] | null | null | null | keras_fcn/encoders.py | psmaAaron/keras-fcn | 90843ef7465e0ce289f0a45a62d2d176a932e7ab | [
"MIT"
] | null | null | null | keras_fcn/encoders.py | psmaAaron/keras-fcn | 90843ef7465e0ce289f0a45a62d2d176a932e7ab | [
"MIT"
] | null | null | null | from __future__ import (
absolute_import,
unicode_literals
)
import tensorflow.keras
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.utils import get_file, convert_all_kernels_in_model
from keras_fcn.blocks import (
vgg_conv,
vgg_fc
)
def load_weig... | 34.645933 | 145 | 0.577683 | from __future__ import (
absolute_import,
unicode_literals
)
import tensorflow.keras
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.utils import get_file, convert_all_kernels_in_model
from keras_fcn.blocks import (
vgg_conv,
vgg_fc
)
def load_weig... | true | true |
f7f2bc34cad10eede80b4783ae54bd86af944151 | 1,107 | py | Python | scripts/utils/api.py | tayutaedomo/google-calendar-tools | 7a7890e58b2228b71c16796b0ab63d9a89dd7a0f | [
"MIT"
] | null | null | null | scripts/utils/api.py | tayutaedomo/google-calendar-tools | 7a7890e58b2228b71c16796b0ab63d9a89dd7a0f | [
"MIT"
] | null | null | null | scripts/utils/api.py | tayutaedomo/google-calendar-tools | 7a7890e58b2228b71c16796b0ab63d9a89dd7a0f | [
"MIT"
] | null | null | null | import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']
CREDENTIALS_PATH = os.path.join(os.path.dirname(
__file__), '..', '..', ... | 29.918919 | 69 | 0.6757 | import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']
CREDENTIALS_PATH = os.path.join(os.path.dirname(
__file__), '..', '..', ... | true | true |
f7f2bc7492d2944d8c7ad2bb57c4ceb713028269 | 2,422 | py | Python | startup_scripts/260_ip_addresses.py | FragmentedPacket/netbox-docker | d8c12c9602cbf9ef2a2aeecef4a9e9e7dfb4dd46 | [
"Apache-2.0"
] | 1 | 2019-05-25T20:57:40.000Z | 2019-05-25T20:57:40.000Z | startup_scripts/260_ip_addresses.py | FragmentedPacket/netbox-docker | d8c12c9602cbf9ef2a2aeecef4a9e9e7dfb4dd46 | [
"Apache-2.0"
] | null | null | null | startup_scripts/260_ip_addresses.py | FragmentedPacket/netbox-docker | d8c12c9602cbf9ef2a2aeecef4a9e9e7dfb4dd46 | [
"Apache-2.0"
] | null | null | null | from ipam.models import IPAddress, VRF
from ipam.constants import IPADDRESS_STATUS_CHOICES
from dcim.models import Device, Interface
from virtualization.models import VirtualMachine
from tenancy.models import Tenant
from extras.models import CustomField, CustomFieldValue
from ruamel.yaml import YAML
from netaddr impor... | 33.178082 | 93 | 0.6346 | from ipam.models import IPAddress, VRF
from ipam.constants import IPADDRESS_STATUS_CHOICES
from dcim.models import Device, Interface
from virtualization.models import VirtualMachine
from tenancy.models import Tenant
from extras.models import CustomField, CustomFieldValue
from ruamel.yaml import YAML
from netaddr impor... | true | true |
f7f2bcb61453850ac39bb9c9a0884495dbc15615 | 912 | py | Python | api/posts/serializers.py | flatcoke/django-structure | d0a7a7489d2f49c72ec4ec030f87c3942d84bb90 | [
"MIT"
] | 6 | 2019-02-27T14:16:48.000Z | 2021-08-12T23:47:13.000Z | api/posts/serializers.py | flatcoke/django-structure | d0a7a7489d2f49c72ec4ec030f87c3942d84bb90 | [
"MIT"
] | 3 | 2020-02-11T23:47:05.000Z | 2021-06-10T17:46:35.000Z | api/posts/serializers.py | flatcoke/django-structure | d0a7a7489d2f49c72ec4ec030f87c3942d84bb90 | [
"MIT"
] | 1 | 2019-07-24T12:02:02.000Z | 2019-07-24T12:02:02.000Z | from rest_framework import serializers
from api.users.serializers import UserSerializer
from api.posts.models import Post, Comment
class CommentSerializer(serializers.ModelSerializer):
content = serializers.CharField(required=True)
created_at = serializers.DateTimeField(read_only=True)
user = UserSerializ... | 32.571429 | 77 | 0.733553 | from rest_framework import serializers
from api.users.serializers import UserSerializer
from api.posts.models import Post, Comment
class CommentSerializer(serializers.ModelSerializer):
content = serializers.CharField(required=True)
created_at = serializers.DateTimeField(read_only=True)
user = UserSerializ... | true | true |
f7f2bcb754f323cae86ddd711e98a4e4d047bcca | 5,712 | py | Python | official/resnet/cifar10_test.py | jieming2002/models-quiz8 | 421dc407a10444cab4bd88c25599077acca96bdb | [
"Apache-2.0"
] | 7 | 2018-04-29T03:54:00.000Z | 2021-08-17T13:27:28.000Z | official/resnet/cifar10_test.py | jieming2002/models-quiz8 | 421dc407a10444cab4bd88c25599077acca96bdb | [
"Apache-2.0"
] | null | null | null | official/resnet/cifar10_test.py | jieming2002/models-quiz8 | 421dc407a10444cab4bd88c25599077acca96bdb | [
"Apache-2.0"
] | 3 | 2018-10-23T01:46:50.000Z | 2019-03-19T02:51:51.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.259259 | 81 | 0.704482 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tempfile import mkstemp
import numpy as np
import tensorflow as tf
from official.resnet import cifar10_main
from official.utils.testing import integration
tf.logging.set_verbosity(tf.lo... | true | true |
f7f2bd3e1770863abbda96a5e92ed0f3b3ece60f | 225 | py | Python | tests/compas/geometry/test_transformations/test_translation.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | tests/compas/geometry/test_transformations/test_translation.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | tests/compas/geometry/test_transformations/test_translation.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | from compas.geometry.transformations import Translation
def test_translation():
T = Translation([1, 2, 3])
assert T.matrix == [[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 2.0], [0.0, 0.0, 1.0, 3.0], [0.0, 0.0, 0.0, 1.0]]
| 32.142857 | 111 | 0.573333 | from compas.geometry.transformations import Translation
def test_translation():
T = Translation([1, 2, 3])
assert T.matrix == [[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 2.0], [0.0, 0.0, 1.0, 3.0], [0.0, 0.0, 0.0, 1.0]]
| true | true |
f7f2bdb28791d65b650b1664362a0a775927f208 | 26,106 | py | Python | homebytwo/routes/models/activity.py | drixselecta/homebytwo | 29d26ce9f5586943e3b64c95aa4ce9ea7263bd10 | [
"MIT"
] | 7 | 2018-03-10T20:58:59.000Z | 2021-08-22T17:18:09.000Z | homebytwo/routes/models/activity.py | HomebyTwo/homebytwo | 29d26ce9f5586943e3b64c95aa4ce9ea7263bd10 | [
"MIT"
] | 69 | 2017-02-01T21:15:43.000Z | 2022-02-26T09:33:27.000Z | homebytwo/routes/models/activity.py | drixselecta/homebytwo | 29d26ce9f5586943e3b64c95aa4ce9ea7263bd10 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import List, Optional
from django.contrib.gis.db import models
from django.contrib.gis.measure import D
from django.core.exceptions import FieldError
from django.db.models import Count
from numpy import array
from pandas import DataFrame
from stravalib import unithelper
from... | 33.947984 | 88 | 0.659159 | from abc import abstractmethod
from typing import List, Optional
from django.contrib.gis.db import models
from django.contrib.gis.measure import D
from django.core.exceptions import FieldError
from django.db.models import Count
from numpy import array
from pandas import DataFrame
from stravalib import unithelper
from... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.