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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790446d7cdc8deb70d6166749028b7a8600b03dd | 1,957 | py | Python | sntools/formats/warren2020.py | arfon/sntools | ad783dbb81e50ca786dfcc22a7359e74ecd58010 | [
"BSD-3-Clause"
] | null | null | null | sntools/formats/warren2020.py | arfon/sntools | ad783dbb81e50ca786dfcc22a7359e74ecd58010 | [
"BSD-3-Clause"
] | null | null | null | sntools/formats/warren2020.py | arfon/sntools | ad783dbb81e50ca786dfcc22a7359e74ecd58010 | [
"BSD-3-Clause"
] | null | null | null | """Parse Warren2020 fluxes.
Fluxes from https://zenodo.org/record/3952926 (DOI:10.5281/zenodo.3952926)
See https://arxiv.org/abs/1902.01340 and https://arxiv.org/abs/1912.03328
for description of the models.
"""
import h5py
from sntools.formats import gamma, get_starttime, get_endtime
flux = {}
def parse_input(in... | 30.578125 | 94 | 0.633112 |
import h5py
from sntools.formats import gamma, get_starttime, get_endtime
flux = {}
def parse_input(input, inflv, starttime, endtime):
f = h5py.File(input, 'r')
for (t, r) in f['sim_data']['shock_radius']:
if r > 1:
tbounce = t * 1000
break
starttime = get_starttime(... | true | true |
790447008db9f910586240130365e9560a196a87 | 1,114 | py | Python | code/python/scripts/bible2books.py | morethanbooks/XML-TEI-Bible | eb42b0ff37ad0049e84f01eb55ec786c8b4a54ea | [
"CC-BY-4.0"
] | 18 | 2016-10-05T15:38:49.000Z | 2021-11-09T08:43:16.000Z | code/python/scripts/bible2books.py | morethanbooks/XML-TEI-Bible | eb42b0ff37ad0049e84f01eb55ec786c8b4a54ea | [
"CC-BY-4.0"
] | null | null | null | code/python/scripts/bible2books.py | morethanbooks/XML-TEI-Bible | eb42b0ff37ad0049e84f01eb55ec786c8b4a54ea | [
"CC-BY-4.0"
] | 2 | 2020-12-22T10:27:29.000Z | 2021-04-16T12:00:42.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 2 14:33:27 2018
@author: jose
"""
import pandas as pd
import re
import os
import glob
metadata = pd.read_csv("/home/jose/Dropbox/biblia/tb/documentation/libros.csv", sep="\t")
for doc in glob.glob("/home/jose/Dropbox/biblia/datos/origen/rv95.txt"):
#print("aquí v... | 34.8125 | 126 | 0.552065 |
import pandas as pd
import re
import os
import glob
metadata = pd.read_csv("/home/jose/Dropbox/biblia/tb/documentation/libros.csv", sep="\t")
for doc in glob.glob("/home/jose/Dropbox/biblia/datos/origen/rv95.txt"):
input_name = os.path.splitext(os.path.split(doc)[1])[0]
with open(doc, "r", error... | true | true |
790447429455cd3062a5a8b99b87ade7744c0f00 | 2,025 | py | Python | tests/additionals/test_functions.py | ikamensh/python_dwd | bed0aa6dee4f23bc13cca3a6c400d9c4f0f2c32b | [
"MIT"
] | null | null | null | tests/additionals/test_functions.py | ikamensh/python_dwd | bed0aa6dee4f23bc13cca3a6c400d9c4f0f2c32b | [
"MIT"
] | null | null | null | tests/additionals/test_functions.py | ikamensh/python_dwd | bed0aa6dee4f23bc13cca3a6c400d9c4f0f2c32b | [
"MIT"
] | null | null | null | from python_dwd.additionals.functions import check_parameters, retrieve_time_resolution_from_filename,\
retrieve_parameter_from_filename, retrieve_period_type_from_filename, determine_parameters
from python_dwd.enumerations.period_type_enumeration import PeriodType
from python_dwd.enumerations.time_resolution_enume... | 53.289474 | 119 | 0.788148 | from python_dwd.additionals.functions import check_parameters, retrieve_time_resolution_from_filename,\
retrieve_parameter_from_filename, retrieve_period_type_from_filename, determine_parameters
from python_dwd.enumerations.period_type_enumeration import PeriodType
from python_dwd.enumerations.time_resolution_enume... | true | true |
7904477c1c6c63f98767e457f313574adecf776e | 8,549 | py | Python | v2.5.7/toontown/toon/DistributedNPCSpecialQuestGiverAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v2.5.7/toontown/toon/DistributedNPCSpecialQuestGiverAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v2.5.7/toontown/toon/DistributedNPCSpecialQuestGiverAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from direct.task.Task import Task
from panda3d.core import *
from DistributedNPCToonBaseAI import *
from toontown.quest import Quests
class DistributedNPCSpecialQuestGiverAI(DistributedNPCToonBaseAI):
def __init__(self, air, npcId, questCallback=None, hq=0):
DistributedNPCToonBaseAI.__init__(self, air, np... | 38.336323 | 123 | 0.628729 | from direct.task.Task import Task
from panda3d.core import *
from DistributedNPCToonBaseAI import *
from toontown.quest import Quests
class DistributedNPCSpecialQuestGiverAI(DistributedNPCToonBaseAI):
def __init__(self, air, npcId, questCallback=None, hq=0):
DistributedNPCToonBaseAI.__init__(self, air, np... | true | true |
790448220efac63bfb62d538d5c99a91eed05636 | 1,996 | py | Python | src/main/python/post_setup.py | Shafaq-Siddiqi/systemml | eca11c6fe9cff88df2e1960caf1b0cff9bf2b2b6 | [
"Apache-2.0"
] | 1 | 2020-12-19T23:01:46.000Z | 2020-12-19T23:01:46.000Z | src/main/python/post_setup.py | Shafaq-Siddiqi/systemml | eca11c6fe9cff88df2e1960caf1b0cff9bf2b2b6 | [
"Apache-2.0"
] | 7 | 2020-12-19T21:59:55.000Z | 2022-02-09T22:36:24.000Z | src/main/python/post_setup.py | Shafaq-Siddiqi/systemml | eca11c6fe9cff88df2e1960caf1b0cff9bf2b2b6 | [
"Apache-2.0"
] | 1 | 2021-02-24T22:50:06.000Z | 2021-02-24T22:50:06.000Z | #!/usr/bin/env python3
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses t... | 42.468085 | 119 | 0.695892 |
from __future__ import print_function
import os
import sys
import platform
try:
exec(open('systemds/project_info.py').read())
except IOError:
print("Could not read project_info.py.", file=sys.stderr)
sys.exit()
ARTIFACT_NAME = __project_artifact_id__
ARTIFACT_VERSION = __project_versi... | true | true |
7904487cd040a8ed617d1df88414dfe80ed31c8c | 1,353 | py | Python | examples/accelerometer.py | somacoder/pymetawear | 3cac6415e610e5ae7d2dac3ffbe6136a65f566f1 | [
"MIT"
] | null | null | null | examples/accelerometer.py | somacoder/pymetawear | 3cac6415e610e5ae7d2dac3ffbe6136a65f566f1 | [
"MIT"
] | null | null | null | examples/accelerometer.py | somacoder/pymetawear | 3cac6415e610e5ae7d2dac3ffbe6136a65f566f1 | [
"MIT"
] | 1 | 2021-01-08T03:45:35.000Z | 2021-01-08T03:45:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`accelerometer`
==================
Updated by lkasso <hello@mbientlab.com>
Created by hbldh <henrik.blidh@nedomkull.com>
Created on 2016-04-10
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
impor... | 22.932203 | 81 | 0.739098 |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import time
from pymetawear.discover import select_device
from pymetawear.client import MetaWearClient
address = select_device()
c = MetaWearClient(str(address), 'pygatt', debug=True)
print("New client cre... | true | true |
790448cb187a7ee7056d0fc9952d881e2341275c | 13,032 | py | Python | generated/ansible-collection/subscriptionssubscriptionfactory.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/ansible-collection/subscriptionssubscriptionfactory.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/ansible-collection/subscriptionssubscriptionfactory.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 36.099723 | 319 | 0.518339 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: subscriptionssubscriptionfactory
version_... | true | true |
79044a1643797f0de28142d2867bee9257fac389 | 2,735 | py | Python | game/rendering.py | HexDecimal/7drl-2022 | 755949875cc11e288908eccaee102c7ca0e43777 | [
"CC0-1.0"
] | null | null | null | game/rendering.py | HexDecimal/7drl-2022 | 755949875cc11e288908eccaee102c7ca0e43777 | [
"CC0-1.0"
] | null | null | null | game/rendering.py | HexDecimal/7drl-2022 | 755949875cc11e288908eccaee102c7ca0e43777 | [
"CC0-1.0"
] | null | null | null | from __future__ import annotations
import numpy as np
import tcod
import g
import game.constants
import game.engine
import game.game_map
import game.render_functions
from game.tiles import tile_graphics
def render_map(console: tcod.Console, gamemap: game.game_map.GameMap) -> None:
# The default graphics are of ... | 34.620253 | 105 | 0.652285 | from __future__ import annotations
import numpy as np
import tcod
import g
import game.constants
import game.engine
import game.game_map
import game.render_functions
from game.tiles import tile_graphics
def render_map(console: tcod.Console, gamemap: game.game_map.GameMap) -> None:
light = tile_graphics[gam... | true | true |
79044aafe60974ffe22e1146ae93d53991ba1bf9 | 23,871 | py | Python | src/nfc/llcp/llc.py | javgh/bitpay-brick | 688cb3403111494bba5f453ea681515e03bf43b4 | [
"MIT"
] | 15 | 2016-11-20T15:38:49.000Z | 2021-08-23T02:59:49.000Z | src/nfc/llcp/llc.py | javgh/bitpay-brick | 688cb3403111494bba5f453ea681515e03bf43b4 | [
"MIT"
] | null | null | null | src/nfc/llcp/llc.py | javgh/bitpay-brick | 688cb3403111494bba5f453ea681515e03bf43b4 | [
"MIT"
] | 3 | 2016-11-21T11:57:13.000Z | 2019-03-24T21:12:41.000Z | # -*- coding: latin-1 -*-
# -----------------------------------------------------------------------------
# Copyright 2009-2011 Stephen Tiedemann <stephen.tiedemann@googlemail.com>
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EU... | 38.011146 | 79 | 0.548071 |
import logging
log = logging.getLogger(__name__)
import time
from types import *
import threading
import collections
import random
import nfc.clf
import nfc.dep
from tco import *
from pdu import *
from err import *
from opt import *
RAW_ACCESS_POINT, LOGICAL_DATA_LINK, DATA_LINK_CONNECTION = ... | true | true |
79044b868e61cc658326e8d01a1b024997ff170e | 5,287 | py | Python | awx/main/tests/conftest.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 11,396 | 2017-09-07T04:56:02.000Z | 2022-03-31T13:56:17.000Z | awx/main/tests/conftest.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 11,046 | 2017-09-07T09:30:46.000Z | 2022-03-31T20:28:01.000Z | awx/main/tests/conftest.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 3,592 | 2017-09-07T04:14:31.000Z | 2022-03-31T23:53:09.000Z | # Python
import pytest
from unittest import mock
from contextlib import contextmanager
from awx.main.models import Credential, UnifiedJob
from awx.main.tests.factories import (
create_organization,
create_job_template,
create_instance,
create_instance_group,
create_notification_template,
create... | 28.89071 | 157 | 0.723284 |
import pytest
from unittest import mock
from contextlib import contextmanager
from awx.main.models import Credential, UnifiedJob
from awx.main.tests.factories import (
create_organization,
create_job_template,
create_instance,
create_instance_group,
create_notification_template,
create_survey_... | true | true |
79044bb12a0b11a75934dd8d23e20c3a89850fc7 | 218 | py | Python | conf/script/src/build_system/compiler/build_option/sanitizer.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | conf/script/src/build_system/compiler/build_option/sanitizer.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | 113 | 2021-02-15T19:22:36.000Z | 2021-05-07T15:17:42.000Z | conf/script/src/build_system/compiler/build_option/sanitizer.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | __all__ = ['CompilerSanitizer']
from enum import Enum, unique
@unique
class CompilerSanitizer(Enum):
NONE = 'none'
ADDRESS = 'address'
THREAD = 'thread'
UNDEFINED = 'undefined'
MEMORY = 'memory'
| 16.769231 | 31 | 0.66055 | __all__ = ['CompilerSanitizer']
from enum import Enum, unique
@unique
class CompilerSanitizer(Enum):
NONE = 'none'
ADDRESS = 'address'
THREAD = 'thread'
UNDEFINED = 'undefined'
MEMORY = 'memory'
| true | true |
79044c621323ba7c551b2e4d38f01d306299281a | 1,049 | py | Python | azure-mgmt-resource/azure/mgmt/resource/features/__init__.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-mgmt-resource/azure/mgmt/resource/features/__init__.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-mgmt-resource/azure/mgmt/resource/features/__init__.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... | 36.172414 | 76 | 0.656816 |
from .feature_client import FeatureClient
from .version import VERSION
__all__ = ['FeatureClient']
__version__ = VERSION
| true | true |
79044de0ccade054d72a819f02d293037742a7cd | 1,458 | py | Python | Systems/esh-spring-2015.git/src/plugins/systemInfo_test.py | mikefeneley/school | 5156f4537ca76782e7ad6df3c5ffe7b9fb5038da | [
"MIT"
] | 1 | 2021-04-21T16:54:04.000Z | 2021-04-21T16:54:04.000Z | Systems/esh-spring-2015.git/src/plugins/systemInfo_test.py | mikefeneley/school | 5156f4537ca76782e7ad6df3c5ffe7b9fb5038da | [
"MIT"
] | null | null | null | Systems/esh-spring-2015.git/src/plugins/systemInfo_test.py | mikefeneley/school | 5156f4537ca76782e7ad6df3c5ffe7b9fb5038da | [
"MIT"
] | null | null | null | import sys, imp, atexit, os
sys.path.append("/home/courses/cs3214/software/pexpect-dpty/");
import pexpect, shellio, signal, time, os, re, proc_check
# Determine the path this file is in
thisdir = os.path.dirname(os.path.realpath(__file__))
#Ensure the shell process is terminated
def force_shell_termination(shell_pr... | 34.714286 | 120 | 0.687243 | import sys, imp, atexit, os
sys.path.append("/home/courses/cs3214/software/pexpect-dpty/");
import pexpect, shellio, signal, time, os, re, proc_check
thisdir = os.path.dirname(os.path.realpath(__file__))
def force_shell_termination(shell_process):
c.close(force=True)
definitions_scriptname = sys.argv[1]
def_mo... | true | true |
79044e86db35a13256fbdc227e39b6fae547182d | 1,361 | py | Python | pier14/opc-client/playlist.py | FlamingLotusGirls/soma | df0da411d5b4e1f3a37a09fd4bd3ec3407aec7b5 | [
"Apache-2.0"
] | 1 | 2015-01-15T17:01:29.000Z | 2015-01-15T17:01:29.000Z | pier14/opc-client/playlist.py | FlamingLotusGirls/soma | df0da411d5b4e1f3a37a09fd4bd3ec3407aec7b5 | [
"Apache-2.0"
] | null | null | null | pier14/opc-client/playlist.py | FlamingLotusGirls/soma | df0da411d5b4e1f3a37a09fd4bd3ec3407aec7b5 | [
"Apache-2.0"
] | 1 | 2015-10-29T18:15:53.000Z | 2015-10-29T18:15:53.000Z | import random
class Playlist:
"""
A list of routines (aka a list of light effect layer lists, or a list of
flame sequences) all intended for use in a single context (e.g. when the
headset is on). One routine in the playlist is selected at any given time.
"""
def __init__(self, routines, index... | 34.025 | 78 | 0.588538 | import random
class Playlist:
"""
A list of routines (aka a list of light effect layer lists, or a list of
flame sequences) all intended for use in a single context (e.g. when the
headset is on). One routine in the playlist is selected at any given time.
"""
def __init__(self, routines, index... | false | true |
79044e9948c60a74ceb46f9eb7a137dcb97eefec | 193 | py | Python | src/rest_framework_jwt/compat.py | nigoroll/django-rest-framework-jwt | 737464f7a8b546165fdfc870b73c8059ed926327 | [
"MIT"
] | null | null | null | src/rest_framework_jwt/compat.py | nigoroll/django-rest-framework-jwt | 737464f7a8b546165fdfc870b73c8059ed926327 | [
"MIT"
] | null | null | null | src/rest_framework_jwt/compat.py | nigoroll/django-rest-framework-jwt | 737464f7a8b546165fdfc870b73c8059ed926327 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from django.urls import include, url
except ImportError:
from django.conf.urls import include, url # noqa: F401
| 19.3 | 59 | 0.715026 |
from __future__ import unicode_literals
try:
from django.urls import include, url
except ImportError:
from django.conf.urls import include, url
| true | true |
7904504b598977d27811250029d2b25d47407ac1 | 2,758 | py | Python | tasks/retriever/mrr.py | platiagro/tasks | a6103cb101eeed26381cdb170a11d0e1dc53d3ad | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-02-16T12:39:57.000Z | 2021-07-21T11:36:39.000Z | tasks/retriever/mrr.py | platiagro/tasks | a6103cb101eeed26381cdb170a11d0e1dc53d3ad | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 20 | 2020-10-26T18:05:27.000Z | 2021-11-30T19:05:22.000Z | tasks/retriever/mrr.py | platiagro/tasks | a6103cb101eeed26381cdb170a11d0e1dc53d3ad | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 7 | 2020-10-13T18:12:22.000Z | 2021-08-13T19:16:21.000Z | # Import dependencies
# Math/Torch
import numpy as np
import torch.nn as nn
# Typing
from typing import List
# Instantiate class
class MRR(nn.Module):
"""Compute MRR metric (Mean reciprocal rank)"""
def __init__(self, max_rank = 10):
super(MRR, self).__init__()
# Set max mrr rank
se... | 32.447059 | 130 | 0.603698 |
import numpy as np
import torch.nn as nn
from typing import List
class MRR(nn.Module):
def __init__(self, max_rank = 10):
super(MRR, self).__init__()
self.max_rank = max_rank
def _calculate_reciprocal_rank(self, hypothesis_ids: np.ndarray, reference_id: int) -> float:
... | true | true |
7904505524c62cc2235184f189624e0b2645a878 | 8,080 | py | Python | userena/contrib/umessages/migrations/0001_initial.py | ixc/django-userena | 5a8c61dcf5133e8b745c25d3b54e5578043222d8 | [
"BSD-3-Clause"
] | 2 | 2019-02-14T00:44:29.000Z | 2020-04-28T17:04:05.000Z | userena/contrib/umessages/migrations/0001_initial.py | barszczmm/django-easy-userena | 096052d3e0c5ef0442d93fe90e1bd783f1c1dc7c | [
"BSD-3-Clause"
] | null | null | null | userena/contrib/umessages/migrations/0001_initial.py | barszczmm/django-easy-userena | 096052d3e0c5ef0442d93fe90e1bd783f1c1dc7c | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MessageContact'
db.create_table('umessages_messagecontact', (
('id', self.gf('... | 65.691057 | 221 | 0.593936 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.create_table('umessages_messagecontact', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=... | true | true |
790451695a306cb7aa4c76c5e3e4cccfba51dab7 | 971 | py | Python | test/test_tiktok.py | lijemutu/auddit_extension | 030f965a79fc9d01985d6e00f7fea41083dd6617 | [
"MIT"
] | null | null | null | test/test_tiktok.py | lijemutu/auddit_extension | 030f965a79fc9d01985d6e00f7fea41083dd6617 | [
"MIT"
] | null | null | null | test/test_tiktok.py | lijemutu/auddit_extension | 030f965a79fc9d01985d6e00f7fea41083dd6617 | [
"MIT"
] | 1 | 2021-06-04T16:50:36.000Z | 2021-06-04T16:50:36.000Z | import unittest,os
from src.tasks.scrape_reddit.tiktok import dwn_tiktok
from src.tasks.generate_video.task import generate_tiktok
from src.tasks.upload_video.task import upload_video
class TestTiktok(unittest.TestCase):
def setUp(self):
pass
def test_tiktok(self):
context = {
'... | 37.346154 | 119 | 0.627188 | import unittest,os
from src.tasks.scrape_reddit.tiktok import dwn_tiktok
from src.tasks.generate_video.task import generate_tiktok
from src.tasks.upload_video.task import upload_video
class TestTiktok(unittest.TestCase):
def setUp(self):
pass
def test_tiktok(self):
context = {
'... | true | true |
7904526d4f781baed9cdc8dc4972204a7a65ec51 | 236 | py | Python | some-euler/p31.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | 1 | 2017-02-20T21:04:47.000Z | 2017-02-20T21:04:47.000Z | some-euler/p31.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | null | null | null | some-euler/p31.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | 2 | 2017-02-20T21:04:49.000Z | 2021-05-18T11:29:16.000Z | import constraint
coins = [1, 2, 5, 10, 20, 50, 100, 200]
CSP = constraint.Problem()
for coin in coins:
CSP.addVariable(coin, range(0, 201, coin))
CSP.addConstraint(constraint.ExactSumConstraint(200))
print len(CSP.getSolutions()) | 26.222222 | 53 | 0.724576 | import constraint
coins = [1, 2, 5, 10, 20, 50, 100, 200]
CSP = constraint.Problem()
for coin in coins:
CSP.addVariable(coin, range(0, 201, coin))
CSP.addConstraint(constraint.ExactSumConstraint(200))
print len(CSP.getSolutions()) | false | true |
790452a76a5127c5bfaf46d2b1df02f5a0a37e16 | 1,533 | py | Python | setup.py | andersy005/repo2singularity | 4e0759a625fc856c140c904f87fcdfa891c8bf6b | [
"BSD-3-Clause"
] | 3 | 2020-06-25T17:03:44.000Z | 2022-02-21T17:43:19.000Z | setup.py | andersy005/repo2singularity | 4e0759a625fc856c140c904f87fcdfa891c8bf6b | [
"BSD-3-Clause"
] | 1 | 2020-05-15T04:49:22.000Z | 2020-06-30T15:34:30.000Z | setup.py | andersy005/repo2singularity | 4e0759a625fc856c140c904f87fcdfa891c8bf6b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import find_packages, setup
with open('requirements.txt') as f:
INSTALL_REQUIREs = f.read().strip().split('\n')
with open('README.md', encoding='utf8') as f:
LONG_DESCRIPTION = f.read()
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Lic... | 37.390244 | 119 | 0.700587 |
from setuptools import find_packages, setup
with open('requirements.txt') as f:
INSTALL_REQUIREs = f.read().strip().split('\n')
with open('README.md', encoding='utf8') as f:
LONG_DESCRIPTION = f.read()
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software Licen... | true | true |
79045314afbaa88b5ab7373b4af3d0264c122e9c | 14,093 | py | Python | lte/gateway/python/magma/pipelined/qos/qos_tc_impl.py | khansiddiquekc/magma | 891718acbe3b9cb3973ae0376d9bcadb31503905 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/pipelined/qos/qos_tc_impl.py | khansiddiquekc/magma | 891718acbe3b9cb3973ae0376d9bcadb31503905 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/pipelined/qos/qos_tc_impl.py | khansiddiquekc/magma | 891718acbe3b9cb3973ae0376d9bcadb31503905 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.228792 | 106 | 0.59597 | import logging
import subprocess
from typing import Optional
from lte.protos.policydb_pb2 import FlowMatch
from .tc_ops_cmd import TcOpsCmd, argSplit, run_cmd
from .tc_ops_pyroute2 import TcOpsPyRoute2
from .types import QosInfo
from .utils import IdManager
LOG = logging.getLogger('pipelined.qos.qos_tc_impl')
R... | true | true |
790453b226512eb02d4203b856bf40e88e19d5cb | 348 | py | Python | standard/client.py | Lasx/gb688_downloader | 7e9711e7784c15bcd15a6129ab1fef99c8d44f23 | [
"Apache-2.0"
] | 119 | 2020-02-27T04:27:15.000Z | 2022-03-01T07:02:34.000Z | standard/client.py | Lasx/gb688_downloader | 7e9711e7784c15bcd15a6129ab1fef99c8d44f23 | [
"Apache-2.0"
] | 12 | 2020-03-26T04:50:13.000Z | 2021-11-24T04:00:08.000Z | standard/client.py | Lasx/gb688_downloader | 7e9711e7784c15bcd15a6129ab1fef99c8d44f23 | [
"Apache-2.0"
] | 24 | 2020-03-11T22:50:24.000Z | 2022-03-25T08:13:56.000Z | from . import GB, HDB
from typing import Literal
class Client:
def __init__(self, t: Literal["gb", "hbba", "dbba"]):
self.type = t
def create(self):
if self.type == "gb":
return GB()
elif self.type == "hb":
return HDB("hbba")
elif self.type == "db":
... | 21.75 | 57 | 0.511494 | from . import GB, HDB
from typing import Literal
class Client:
def __init__(self, t: Literal["gb", "hbba", "dbba"]):
self.type = t
def create(self):
if self.type == "gb":
return GB()
elif self.type == "hb":
return HDB("hbba")
elif self.type == "db":
... | true | true |
7904549cf9a9e4c5cbe12df270bf0e7f8f9916c6 | 490 | py | Python | scripts/run_pyright.py | gentle-knight-13/auto-derby | 70593fea2c3d803487e6e0d2ce0c40d60bc6304d | [
"MIT"
] | null | null | null | scripts/run_pyright.py | gentle-knight-13/auto-derby | 70593fea2c3d803487e6e0d2ce0c40d60bc6304d | [
"MIT"
] | null | null | null | scripts/run_pyright.py | gentle-knight-13/auto-derby | 70593fea2c3d803487e6e0d2ce0c40d60bc6304d | [
"MIT"
] | null | null | null | # -*- coding=UTF-8 -*-
# pyright: strict
from __future__ import annotations
import os
import sys
import subprocess
def main():
subprocess.call(
["npx", "pyright"],
env={
**os.environ,
"PATH": os.path.pathsep.join(
(
os.path.dirname(sy... | 15.806452 | 52 | 0.453061 |
from __future__ import annotations
import os
import sys
import subprocess
def main():
subprocess.call(
["npx", "pyright"],
env={
**os.environ,
"PATH": os.path.pathsep.join(
(
os.path.dirname(sys.executable),
os.g... | true | true |
790454bd666d9188fb3392f897386bc556ccd494 | 1,006 | py | Python | 17_process_thread/46_why_need_ThreadLocal.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 17_process_thread/46_why_need_ThreadLocal.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 17_process_thread/46_why_need_ThreadLocal.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | """
多线程操作共享的全局变量是不安全的,多线程操作局部 只归某个线程私有,其他线程是不能访问的
"""
import threading
def do_sth(arg1, arg2, arg3):
local_var1 = arg1
local_var2 = arg2
local_var3 = arg3
fun1(local_var1, local_var2, local_var3)
fun2(local_var1, local_var2, local_var3)
fun3(local_var1, local_var2, local_var3)
def fun1(loca... | 27.189189 | 78 | 0.61332 | import threading
def do_sth(arg1, arg2, arg3):
local_var1 = arg1
local_var2 = arg2
local_var3 = arg3
fun1(local_var1, local_var2, local_var3)
fun2(local_var1, local_var2, local_var3)
fun3(local_var1, local_var2, local_var3)
def fun1(local_var1, local_var2, local_var3):
print('%s: %s -- ... | true | true |
79045531c936fead982568606c85276efcfde4ca | 2,393 | py | Python | tests/test_it.py | eugenehp/jingtrang | 245df07d40773fc09fa51def13149efe5aa53e4f | [
"MIT"
] | null | null | null | tests/test_it.py | eugenehp/jingtrang | 245df07d40773fc09fa51def13149efe5aa53e4f | [
"MIT"
] | null | null | null | tests/test_it.py | eugenehp/jingtrang | 245df07d40773fc09fa51def13149efe5aa53e4f | [
"MIT"
] | null | null | null | import subprocess
import py
import pytest
@pytest.fixture(
params=["tests/dataset-rdstmc", "tests/dataset-wiki", "tests/dataset-rntutor"]
)
def datasetdir(request):
return py.path.local(request.param)
@pytest.fixture
def messages(datasetdir):
msgdir = datasetdir.join("messages")
return msgdir.listd... | 23.93 | 82 | 0.695779 | import subprocess
import py
import pytest
@pytest.fixture(
params=["tests/dataset-rdstmc", "tests/dataset-wiki", "tests/dataset-rntutor"]
)
def datasetdir(request):
return py.path.local(request.param)
@pytest.fixture
def messages(datasetdir):
msgdir = datasetdir.join("messages")
return msgdir.listd... | true | true |
7904569a26f2b9f75916725b719f6cab3b016a5f | 2,363 | py | Python | examples/AdAccountAdCreativesPostCreateCarouselCallToActionAppInstall.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 576 | 2018-05-01T19:09:32.000Z | 2022-03-31T11:45:11.000Z | examples/AdAccountAdCreativesPostCreateCarouselCallToActionAppInstall.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 217 | 2018-05-03T07:31:59.000Z | 2022-03-29T14:19:52.000Z | examples/AdAccountAdCreativesPostCreateCarouselCallToActionAppInstall.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 323 | 2018-05-01T20:32:26.000Z | 2022-03-29T07:05:12.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 59.075 | 865 | 0.752857 |
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.adcreative import AdCreative
from facebook_business.api import FacebookAdsApi
access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<AD_ACCOUNT_ID>'
FacebookAdsApi.init(acces... | false | true |
79045746d76c6cba54bceacab6b61a83a5825c4e | 1,328 | py | Python | components/contrib/_converters/KerasModelHdf5/to_TensorflowSavedModel/component.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | components/contrib/_converters/KerasModelHdf5/to_TensorflowSavedModel/component.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | components/contrib/_converters/KerasModelHdf5/to_TensorflowSavedModel/component.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | from kfp.components import create_component_from_func, InputPath, OutputPath
def keras_convert_hdf5_model_to_tf_saved_model(
model_path: InputPath('KerasModelHdf5'),
converted_model_path: OutputPath('TensorflowSavedModel'),
):
'''Converts Keras HDF5 model to Tensorflow SavedModel format.
Args:
... | 39.058824 | 182 | 0.734187 | from kfp.components import create_component_from_func, InputPath, OutputPath
def keras_convert_hdf5_model_to_tf_saved_model(
model_path: InputPath('KerasModelHdf5'),
converted_model_path: OutputPath('TensorflowSavedModel'),
):
from pathlib import Path
from tensorflow import keras
model = keras... | true | true |
79045777ea1ab9f9218effad7ad0135b3b82b730 | 254 | py | Python | src/packages/tests/test_company_details.py | fbeltrao/az-func-gh-deployment | 92d3bdfc3f9e3c554dc76a46f9dde28d5e04b98e | [
"MIT"
] | null | null | null | src/packages/tests/test_company_details.py | fbeltrao/az-func-gh-deployment | 92d3bdfc3f9e3c554dc76a46f9dde28d5e04b98e | [
"MIT"
] | 1 | 2021-12-26T15:30:40.000Z | 2021-12-26T15:30:40.000Z | src/packages/tests/test_company_details.py | fbeltrao/az-func-gh-deployment | 92d3bdfc3f9e3c554dc76a46f9dde28d5e04b98e | [
"MIT"
] | null | null | null | import pytest
from contoso import get_company_name, get_company_address
def test_get_company_name():
assert get_company_name() == "Contoso"
def test_get_company_address():
assert get_company_address() == "Contosostrasse 1, Zurich, Switzerland" | 28.222222 | 75 | 0.791339 | import pytest
from contoso import get_company_name, get_company_address
def test_get_company_name():
assert get_company_name() == "Contoso"
def test_get_company_address():
assert get_company_address() == "Contosostrasse 1, Zurich, Switzerland" | true | true |
790457b446819e1456316a24dadb693fe44bdd5f | 7,761 | py | Python | Projects/1_Sudoku/solution.py | justinlnx/artificial-intelligence | 5d742d49bc43adf5e6a17ba57a8fef5831ba2ed4 | [
"MIT"
] | null | null | null | Projects/1_Sudoku/solution.py | justinlnx/artificial-intelligence | 5d742d49bc43adf5e6a17ba57a8fef5831ba2ed4 | [
"MIT"
] | null | null | null | Projects/1_Sudoku/solution.py | justinlnx/artificial-intelligence | 5d742d49bc43adf5e6a17ba57a8fef5831ba2ed4 | [
"MIT"
] | null | null | null |
from utils import *
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC','DEF','GHI') for cs in ('123','456','789')]
unitlist = row_units + column_units + square_units
# TODO: Update the unit list to add the new diagonal units
diagon... | 33.309013 | 113 | 0.633552 |
from utils import *
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC','DEF','GHI') for cs in ('123','456','789')]
unitlist = row_units + column_units + square_units
diagonal1 = [['A1', 'B2', 'C3', 'D4', 'E5', 'F6', 'G7', 'H8', 'I... | true | true |
790457e163f06b17aa5b58b9b26ab399be037c71 | 7,258 | py | Python | tests/accsr/test_remote_storage.py | AnesBenmerzoug/accsr | 0485509854fb8ff4919a1d321f57773850a4c98e | [
"MIT"
] | null | null | null | tests/accsr/test_remote_storage.py | AnesBenmerzoug/accsr | 0485509854fb8ff4919a1d321f57773850a4c98e | [
"MIT"
] | null | null | null | tests/accsr/test_remote_storage.py | AnesBenmerzoug/accsr | 0485509854fb8ff4919a1d321f57773850a4c98e | [
"MIT"
] | null | null | null | import logging
import os
from typing import Generator
import pytest
@pytest.fixture(scope="module", autouse=True)
def change_to_resources_dir(test_resources, request):
os.chdir(test_resources)
yield
os.chdir(request.config.invocation_dir)
@pytest.fixture()
def test_filename(
change_to_resources_dir... | 33.601852 | 111 | 0.74194 | import logging
import os
from typing import Generator
import pytest
@pytest.fixture(scope="module", autouse=True)
def change_to_resources_dir(test_resources, request):
os.chdir(test_resources)
yield
os.chdir(request.config.invocation_dir)
@pytest.fixture()
def test_filename(
change_to_resources_dir... | true | true |
7904580d93de3c3f61a13af6030eb25dbfa0ba0e | 16,297 | py | Python | cptac/pancan/file_download.py | PayneLab/cptac | 531ec27a618270a2405bf876443fa58d0362b3c2 | [
"Apache-2.0"
] | 53 | 2019-05-30T02:05:04.000Z | 2022-03-16T00:38:58.000Z | cptac/pancan/file_download.py | PayneLab/cptac | 531ec27a618270a2405bf876443fa58d0362b3c2 | [
"Apache-2.0"
] | 20 | 2020-02-16T23:50:43.000Z | 2021-09-26T10:07:59.000Z | cptac/pancan/file_download.py | PayneLab/cptac | 531ec27a618270a2405bf876443fa58d0362b3c2 | [
"Apache-2.0"
] | 17 | 2019-09-27T20:55:09.000Z | 2021-10-19T07:18:06.000Z | # Copyright 2018 Samuel Payne sam_payne@byu.edu
# 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 ... | 38.894988 | 241 | 0.666196 |
import os
import pandas as pd
import requests
import shutil
import warnings
import cptac
from cptac.file_download import get_box_token
from cptac.exceptions import DatasetAlreadyInstalledWarning, InvalidParameterError, NoInternetError, PdcDownloadError
from .pancanbrca import SOURCES as BRCA_SOURCES
from .... | true | true |
790459598df3387a1374776d11f59ba20fc062de | 14,433 | py | Python | astropy/units/quantity_helper/helpers.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | null | null | null | astropy/units/quantity_helper/helpers.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | 1 | 2018-11-14T14:18:55.000Z | 2020-01-21T10:36:05.000Z | astropy/units/quantity_helper/helpers.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# The idea for this module (but no code) was borrowed from the
# quantities (http://pythonhosted.org/quantities/) package.
"""Helper functions for Quantity.
In particular, this implements the logic that determines scaling and resul... | 35.461916 | 79 | 0.677406 |
from fractions import Fraction
import numpy as np
from . import UFUNC_HELPERS, UNSUPPORTED_UFUNCS
from ..core import (UnitsError, UnitConversionError, UnitTypeError,
dimensionless_unscaled, get_current_unit_registry)
def _d(unit):
if unit is None:
return dimensionless_unscaled
... | true | true |
79045986de02b0ab0ac2765c45bafb29950cbc19 | 12,353 | py | Python | wintersdeep_postcode/postcode_types/standard_postcode/standard_postcode_validator.py | WintersDeep/wintersdeep_postcode | b5f53484d2209d48919a4db663f05c9d39a396fa | [
"MIT"
] | 2 | 2021-12-03T11:41:05.000Z | 2022-01-31T13:33:29.000Z | wintersdeep_postcode/postcode_types/standard_postcode/standard_postcode_validator.py | WintersDeep/wintersdeep_postcode | b5f53484d2209d48919a4db663f05c9d39a396fa | [
"MIT"
] | null | null | null | wintersdeep_postcode/postcode_types/standard_postcode/standard_postcode_validator.py | WintersDeep/wintersdeep_postcode | b5f53484d2209d48919a4db663f05c9d39a396fa | [
"MIT"
] | null | null | null | # python3 imports
from re import compile as compile_regex
from gettext import gettext as _
# project imports
from wintersdeep_postcode.postcode import Postcode
from wintersdeep_postcode.exceptions.validation_fault import ValidationFault
## A wrapper for validation of standard postcodes
# @remarks see \ref wintersdee... | 47.148855 | 117 | 0.727273 |
from re import compile as compile_regex
from gettext import gettext as _
from wintersdeep_postcode.postcode import Postcode
from wintersdeep_postcode.exceptions.validation_fault import ValidationFault
tcode):
impacted_by_rule = False
if postcode.outward_district >= 10:
single_digit_dis... | true | true |
79045ab4b5e373ef0c67cc5edf88b799cf876f33 | 4,654 | py | Python | cellularcaves.py | nmmarzano/CellularCaves.py | 34135c0ae9260df18c9bdd723265122398893947 | [
"MIT"
] | 3 | 2020-05-20T02:48:10.000Z | 2022-01-13T12:28:28.000Z | cellularcaves.py | nmmarzano/CellularCaves.py | 34135c0ae9260df18c9bdd723265122398893947 | [
"MIT"
] | null | null | null | cellularcaves.py | nmmarzano/CellularCaves.py | 34135c0ae9260df18c9bdd723265122398893947 | [
"MIT"
] | 1 | 2022-02-10T22:25:49.000Z | 2022-02-10T22:25:49.000Z | import sys
import random
from collections import deque
def printGrid(grid, wallChar, emptyChar):
finalstr = ""
finalstr += "\n"
for i in range(len(grid[0])):
for j in range(len(grid)):
if grid[j][i]==1:
finalstr += wallChar
else:
finalstr += e... | 37.532258 | 150 | 0.572841 | import sys
import random
from collections import deque
def printGrid(grid, wallChar, emptyChar):
finalstr = ""
finalstr += "\n"
for i in range(len(grid[0])):
for j in range(len(grid)):
if grid[j][i]==1:
finalstr += wallChar
else:
finalstr += e... | true | true |
79045b035efe97fd4687cc0734f65bd708a1ae46 | 6,691 | py | Python | packages/python/plotly/plotly/validators/splom/_marker.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/splom/_marker.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/splom/_marker.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="marker", parent_name="splom", **kwargs):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | 47.792857 | 76 | 0.54521 | import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="marker", parent_name="splom", **kwargs):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | true | true |
79045be7ad9a966185639451d30dc7256170507a | 581 | py | Python | wildlifecompliance/migrations/0147_returntype_return_type.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 1 | 2020-12-07T17:12:40.000Z | 2020-12-07T17:12:40.000Z | wildlifecompliance/migrations/0147_returntype_return_type.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 14 | 2020-01-08T08:08:26.000Z | 2021-03-19T22:59:46.000Z | wildlifecompliance/migrations/0147_returntype_return_type.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 15 | 2020-01-08T08:02:28.000Z | 2021-11-03T06:48:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-18 04:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0146_auto_20190308_1626'),
]
operations = [
migration... | 27.666667 | 162 | 0.628227 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0146_auto_20190308_1626'),
]
operations = [
migrations.AddField(
model_name='returntype',
name='retu... | true | true |
79045c37c7d32490269243291686615239285ef8 | 7,534 | py | Python | test/functional/txn_clone.py | plc-ultima/plcu | d99eb669ac339c4d0dcedb77bc68ccd0dfe29d4f | [
"MIT"
] | 1 | 2022-03-28T02:13:10.000Z | 2022-03-28T02:13:10.000Z | test/functional/txn_clone.py | plc-ultima/plcu | d99eb669ac339c4d0dcedb77bc68ccd0dfe29d4f | [
"MIT"
] | null | null | null | test/functional/txn_clone.py | plc-ultima/plcu | d99eb669ac339c4d0dcedb77bc68ccd0dfe29d4f | [
"MIT"
] | 2 | 2022-03-26T23:59:01.000Z | 2022-03-31T13:27:08.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
imp... | 47.683544 | 117 | 0.623706 |
import struct
from test_framework.test_framework import BitcoinTestFramework
from test_framework.mininode import *
from test_framework.util import *
class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
def add_options(self, parser):
parser.add_option("--m... | true | true |
79045c5821bbd8e25e9af3fc644f6d43a278d730 | 229 | py | Python | toBusUsege/service_module/service_core/__init__.py | sherry0429/tobus | aa694024e18bc977c4f8c45dda4b2c1708aaef06 | [
"Apache-2.0"
] | 2 | 2018-01-30T02:28:28.000Z | 2018-01-30T02:28:32.000Z | toBusUsege/service_module/service_core/__init__.py | sherry0429/tobus | aa694024e18bc977c4f8c45dda4b2c1708aaef06 | [
"Apache-2.0"
] | null | null | null | toBusUsege/service_module/service_core/__init__.py | sherry0429/tobus | aa694024e18bc977c4f8c45dda4b2c1708aaef06 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 tianyou pan <sherry0429 at SOAPython>
"""
from engine import ServiceEngineModule
from template import ServiceParamTemplate
__all__ = ['ServiceEngineModule', 'ServiceParamTemplate'] | 25.444444 | 57 | 0.759825 |
from engine import ServiceEngineModule
from template import ServiceParamTemplate
__all__ = ['ServiceEngineModule', 'ServiceParamTemplate'] | true | true |
79045c662b4bb442f9bac1c70677d6b9400c64e9 | 6,563 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py | jetbridge/openapi-generator | e4701ed5288ee6b7015ff5a88c60d320c9af8ac2 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py | jetbridge/openapi-generator | e4701ed5288ee6b7015ff5a88c60d320c9af8ac2 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py | jetbridge/openapi-generator | e4701ed5288ee6b7015ff5a88c60d320c9af8ac2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 38.380117 | 174 | 0.590279 |
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future_... | false | true |
79045cac6b1256f61939708bfa576d89374ae0e4 | 2,243 | py | Python | src/models.py | DhenryD/CrowdCount-mcnn | a44bcbfd25ca681f7b57e2f92f10b06f602dd93f | [
"MIT"
] | 2 | 2019-06-11T02:16:01.000Z | 2019-09-20T12:01:12.000Z | src/models.py | DhenryD/CrowdCount-mcnn | a44bcbfd25ca681f7b57e2f92f10b06f602dd93f | [
"MIT"
] | 1 | 2019-05-16T08:05:03.000Z | 2019-05-16T08:09:53.000Z | src/models.py | DhenryD/CrowdCount-mcnn | a44bcbfd25ca681f7b57e2f92f10b06f602dd93f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from src.network import Conv2d
class MCNN(nn.Module):
def __init__(self, bn=False):
super(MCNN, self).__init__()
self.branch1 = nn.Sequential(Conv2d(1, 16, 9, same_padding=True, bn=bn),
nn.MaxPool2d(2),
... | 45.77551 | 81 | 0.436469 | import torch
import torch.nn as nn
from src.network import Conv2d
class MCNN(nn.Module):
def __init__(self, bn=False):
super(MCNN, self).__init__()
self.branch1 = nn.Sequential(Conv2d(1, 16, 9, same_padding=True, bn=bn),
nn.MaxPool2d(2),
... | true | true |
79045cb5ac0082d3e9a772647c2cb6fbc430de27 | 857 | py | Python | main.py | kymotsujason/crossybot | 68f585ee21b68394e1b09a63f39f8d2b54ac5f0c | [
"Apache-2.0"
] | null | null | null | main.py | kymotsujason/crossybot | 68f585ee21b68394e1b09a63f39f8d2b54ac5f0c | [
"Apache-2.0"
] | null | null | null | main.py | kymotsujason/crossybot | 68f585ee21b68394e1b09a63f39f8d2b54ac5f0c | [
"Apache-2.0"
] | null | null | null | import cv2
from PIL import ImageGrab
import numpy as np
def main():
while True:
# bbox specifies specific region (bbox= x,y,width,height)
img = ImageGrab.grab(bbox=(0, 40, 1075, 640))
vanilla = img_np = np.array(img)
img_np = np.array(img)
gray = cv2.cvtColor(img_np, cv2.CO... | 29.551724 | 72 | 0.57993 | import cv2
from PIL import ImageGrab
import numpy as np
def main():
while True:
img = ImageGrab.grab(bbox=(0, 40, 1075, 640))
vanilla = img_np = np.array(img)
img_np = np.array(img)
gray = cv2.cvtColor(img_np, cv2.COLOR_BGR2GRAY)
_, binary = cv2.threshold(gray, 100... | true | true |
79045cc5021493b8d26f6e1ca37c30e05ff0efa6 | 5,115 | py | Python | import_and_model.py | kimhyuns91/bird_call | eea20c6e305a2ac322a94f90075d489742e7295c | [
"Apache-2.0"
] | 1 | 2020-10-21T20:45:25.000Z | 2020-10-21T20:45:25.000Z | import_and_model.py | kimhyuns91/bird_call | eea20c6e305a2ac322a94f90075d489742e7295c | [
"Apache-2.0"
] | null | null | null | import_and_model.py | kimhyuns91/bird_call | eea20c6e305a2ac322a94f90075d489742e7295c | [
"Apache-2.0"
] | 1 | 2020-12-12T03:58:01.000Z | 2020-12-12T03:58:01.000Z | import pandas as pd
import numpy as np
import wave
from scipy.io import wavfile
import os
import librosa
import pydub
import ffmpeg
from librosa.feature import melspectrogram
import warnings
from sklearn.utils import shuffle
from sklearn.utils import class_weight
from PIL import Image
import sklearn
import tensorflow ... | 39.045802 | 148 | 0.714761 | import pandas as pd
import numpy as np
import wave
from scipy.io import wavfile
import os
import librosa
import pydub
import ffmpeg
from librosa.feature import melspectrogram
import warnings
from sklearn.utils import shuffle
from sklearn.utils import class_weight
from PIL import Image
import sklearn
import tensorflow ... | true | true |
79045d44774a4846bb1582b88e414a7c94219c8a | 7,156 | py | Python | bioconda_utils/githubhandler.py | sndrtj/bioconda-utils | c10c9ae9055380b36114c0db65415787f0ad3785 | [
"MIT"
] | null | null | null | bioconda_utils/githubhandler.py | sndrtj/bioconda-utils | c10c9ae9055380b36114c0db65415787f0ad3785 | [
"MIT"
] | null | null | null | bioconda_utils/githubhandler.py | sndrtj/bioconda-utils | c10c9ae9055380b36114c0db65415787f0ad3785 | [
"MIT"
] | null | null | null | """Highlevel API for managing PRs on Github"""
import abc
import logging
from copy import copy
from enum import Enum
from typing import Any, Dict, List, Optional
import gidgethub
import gidgethub.aiohttp
import aiohttp
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
#: State for Github Issue... | 35.078431 | 85 | 0.55981 |
import abc
import logging
from copy import copy
from enum import Enum
from typing import Any, Dict, List, Optional
import gidgethub
import gidgethub.aiohttp
import aiohttp
logger = logging.getLogger(__name__)
IssueState = Enum("IssueState", "open closed all")
class GitHubHandler:
PULLS = "/repos/{user... | true | true |
79045d4b8dee7f78fb0980dfb14ddea8470a6b4c | 5,411 | py | Python | restapi/utilities/meta.py | rapydo/http-api | ef0a299173195145303069534d45d446ea4da93a | [
"MIT"
] | 8 | 2018-07-04T09:54:46.000Z | 2022-03-17T08:21:06.000Z | restapi/utilities/meta.py | rapydo/http-api | ef0a299173195145303069534d45d446ea4da93a | [
"MIT"
] | 19 | 2018-04-18T07:24:55.000Z | 2022-03-04T01:03:15.000Z | restapi/utilities/meta.py | rapydo/http-api | ef0a299173195145303069534d45d446ea4da93a | [
"MIT"
] | 7 | 2018-07-03T12:17:50.000Z | 2021-05-05T04:33:32.000Z | """
Meta thinking: python objects & introspection
usefull documentation:
http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Metaprogramming.html
"""
import inspect
import pkgutil
from importlib import import_module
from types import ModuleType
from typing import Any, Callable, Dict, List, Optional, Type
... | 30.398876 | 83 | 0.582887 |
import inspect
import pkgutil
from importlib import import_module
from types import ModuleType
from typing import Any, Callable, Dict, List, Optional, Type
from restapi.config import BACKEND_PACKAGE, CUSTOM_PACKAGE
from restapi.utilities import print_and_exit
from restapi.utilities.logs import log
class Meta:
... | true | true |
79045e05f9262916be303b3c10f61de600268472 | 767 | py | Python | ruobr_api/__init__.py | raitonoberu/ruobr_api | bd78be0cb020990a4e039000ab93d495e8569341 | [
"Apache-2.0"
] | 10 | 2020-05-05T17:47:12.000Z | 2022-02-13T15:31:40.000Z | ruobr_api/__init__.py | raitonoberu/ruobr_api | bd78be0cb020990a4e039000ab93d495e8569341 | [
"Apache-2.0"
] | null | null | null | ruobr_api/__init__.py | raitonoberu/ruobr_api | bd78be0cb020990a4e039000ab93d495e8569341 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ruobr.ru/api
~~~~~~~~~~~~
Библиотека для доступа к API электронного дневника.
Пример:
>>> from ruobr_api import Ruobr
>>> r = Ruobr('username', 'password')
>>> r.getUser()
User(id=7592904, status='child', first_name='Иван', last_name='Иванов', middle_name='Иванович', school='69... | 25.566667 | 223 | 0.694915 |
from .__main__ import (
Ruobr,
AsyncRuobr,
AuthenticationException,
NoSuccessException,
NoChildrenException,
)
__author__ = "raitonoberu"
__version__ = "1.2.1"
__email__ = "raitonoberu@mail.ru"
| true | true |
79045f85c18da745ed09eda968f5bc480749c4e5 | 1,988 | py | Python | research/cv/resnext152_64x4d/postprocess.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/resnext152_64x4d/postprocess.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/resnext152_64x4d/postprocess.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 37.509434 | 107 | 0.666499 |
import os
import json
import argparse
import numpy as np
parser = argparse.ArgumentParser(description="resnet inference")
parser.add_argument("--result_path", type=str, required=True, help="result files path.")
parser.add_argument("--label_path", type=str, required=True, help="image file path.")
args = p... | true | true |
79045f9cd5e72a52096e8052bb76b0d7b07f58cd | 22,693 | py | Python | credstash.py | traveloka/credstash | 85a1f93ebeebffc89539aaa4b3e653c02f0da39b | [
"Apache-2.0"
] | null | null | null | credstash.py | traveloka/credstash | 85a1f93ebeebffc89539aaa4b3e653c02f0da39b | [
"Apache-2.0"
] | null | null | null | credstash.py | traveloka/credstash | 85a1f93ebeebffc89539aaa4b3e653c02f0da39b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2015 Luminal, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.668459 | 107 | 0.524567 |
import argparse
import csv
import json
import operator
import os
import os.path
import sys
import time
import re
import boto3
import botocore.exceptions
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
try:
import yaml
NO_YAML = False
except ImportError:
... | true | true |
7904600ba07e0805f4a8c9ab8409b728dbe04859 | 1,069 | py | Python | src/cluster/sort_dataset_by_column/test.py | maximumSHOT-HSE/CurriculumLearning | bf5291812a9ec3feb083d3d84b579329781c8a6a | [
"MIT"
] | null | null | null | src/cluster/sort_dataset_by_column/test.py | maximumSHOT-HSE/CurriculumLearning | bf5291812a9ec3feb083d3d84b579329781c8a6a | [
"MIT"
] | null | null | null | src/cluster/sort_dataset_by_column/test.py | maximumSHOT-HSE/CurriculumLearning | bf5291812a9ec3feb083d3d84b579329781c8a6a | [
"MIT"
] | null | null | null | import argparse
import datasets
import matplotlib.pyplot as plt
import numpy as np
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--input', type=str, required=True, help='Path to the directory with input dataset')
return parser.parse_args()
if __name__ == '__main__... | 27.410256 | 109 | 0.529467 | import argparse
import datasets
import matplotlib.pyplot as plt
import numpy as np
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--input', type=str, required=True, help='Path to the directory with input dataset')
return parser.parse_args()
if __name__ == '__main__... | true | true |
7904633fa6b03cf05460ce54575952cbcbeed1ec | 16,245 | py | Python | tools/infer/utility.py | xiaolao/PaddleOCR | 21b9bd63646fdca95f63062d94fd62f35cfa61cc | [
"Apache-2.0"
] | 1 | 2021-08-12T16:59:40.000Z | 2021-08-12T16:59:40.000Z | tools/infer/utility.py | xiaolao/PaddleOCR | 21b9bd63646fdca95f63062d94fd62f35cfa61cc | [
"Apache-2.0"
] | null | null | null | tools/infer/utility.py | xiaolao/PaddleOCR | 21b9bd63646fdca95f63062d94fd62f35cfa61cc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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 appli... | 37.004556 | 85 | 0.620499 |
import argparse
import os
import sys
import cv2
import numpy as np
import json
from PIL import Image, ImageDraw, ImageFont
import math
from paddle import inference
def parse_args():
def str2bool(v):
return v.lower() in ("true", "t", "1")
parser = argparse.ArgumentParser()
parse... | true | true |
790463736501d4403b193052a2d4cff7625baeeb | 13,560 | py | Python | edb/lang/ir/inference/types.py | mcaramma/edgedb | 53b18dbaf7407617ca135d1f8a5047bda6414654 | [
"Apache-2.0"
] | null | null | null | edb/lang/ir/inference/types.py | mcaramma/edgedb | 53b18dbaf7407617ca135d1f8a5047bda6414654 | [
"Apache-2.0"
] | null | null | null | edb/lang/ir/inference/types.py | mcaramma/edgedb | 53b18dbaf7407617ca135d1f8a5047bda6414654 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2015-present MagicStack Inc. and the EdgeDB 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... | 30.609481 | 79 | 0.652212 |
import collections
import functools
import typing
from edb.lang.common import ast
from edb.lang.schema import basetypes as s_basetypes
from edb.lang.schema import inheriting as s_inh
from edb.lang.schema import name as s_name
from edb.lang.schema import objects as s_obj
from edb.lang.schema import ... | true | true |
7904640078814a724b5f91b401860607bf111587 | 3,568 | py | Python | 2021/day20/day20.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2021/day20/day20.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2021/day20/day20.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | from __future__ import annotations
import argparse
import logging
from typing import TextIO
def parse_args(args=None):
parser = argparse.ArgumentParser()
parser.add_argument("input", type=argparse.FileType('r'),
metavar="PUZZLE_INPUT")
parser.add_argument('-d', '--debug', action='s... | 29.00813 | 76 | 0.575673 | from __future__ import annotations
import argparse
import logging
from typing import TextIO
def parse_args(args=None):
parser = argparse.ArgumentParser()
parser.add_argument("input", type=argparse.FileType('r'),
metavar="PUZZLE_INPUT")
parser.add_argument('-d', '--debug', action='s... | true | true |
790464bacf98a71049b09f7ad26f6dff004f3be9 | 5,314 | py | Python | kubernetes/client/models/io_cert_manager_acme_v1_challenge_spec_solver_dns01_cloudflare_api_token_secret_ref.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_cert_manager_acme_v1_challenge_spec_solver_dns01_cloudflare_api_token_secret_ref.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_cert_manager_acme_v1_challenge_spec_solver_dns01_cloudflare_api_token_secret_ref.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 34.960526 | 169 | 0.641325 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class IoCertManagerAcmeV1ChallengeSpecSolverDns01CloudflareApiTokenSecretRef(object):
openapi_types = {
'key': 'str',
'name': 'str'
}
attribute_map = {
'key': 'key',
'name... | true | true |
7904669d97c9b36099795440d324d684fc85b945 | 462 | py | Python | analyze_results.py | HamidSajjadi/slr_query_formulation | 5164d7ecd1a798089df284459a451e1e3d1e20e5 | [
"MIT"
] | null | null | null | analyze_results.py | HamidSajjadi/slr_query_formulation | 5164d7ecd1a798089df284459a451e1e3d1e20e5 | [
"MIT"
] | null | null | null | analyze_results.py | HamidSajjadi/slr_query_formulation | 5164d7ecd1a798089df284459a451e1e3d1e20e5 | [
"MIT"
] | null | null | null | import pandas as pd
import plotly.express as px
df = pd.read_csv('data/query_result.csv')
max_df = df.groupby(by='topic_id').max().reset_index()
df = df[df['topic_id'].isin(max_df[max_df['recall'] > 0]['topic_id'].to_list())]
for t in df['topic_id'].unique().tolist():
temp_df = df[df['topic_id'] == t]
fig = px... | 38.5 | 91 | 0.668831 | import pandas as pd
import plotly.express as px
df = pd.read_csv('data/query_result.csv')
max_df = df.groupby(by='topic_id').max().reset_index()
df = df[df['topic_id'].isin(max_df[max_df['recall'] > 0]['topic_id'].to_list())]
for t in df['topic_id'].unique().tolist():
temp_df = df[df['topic_id'] == t]
fig = px... | true | true |
790466d394c7d2b5d9c6dba66e00e134d898c559 | 2,077 | py | Python | internal/twirptest/service_method_same_name/service_method_same_name_pb2.py | guide-century/twirp | 4728e5128a7c4d5f21b431e3e53ff2b3f755c124 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-05-30T21:55:33.000Z | 2019-05-30T21:55:33.000Z | internal/twirptest/service_method_same_name/service_method_same_name_pb2.py | guide-century/twirp | 4728e5128a7c4d5f21b431e3e53ff2b3f755c124 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-05-24T10:00:04.000Z | 2021-05-24T10:00:04.000Z | internal/twirptest/service_method_same_name/service_method_same_name_pb2.py | h2oai/twirp | f779546e4b627ff0ef33a15caa4668a415124b9f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: service_method_same_name.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ref... | 23.602273 | 196 | 0.755416 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db =... | true | true |
790467499ef4dd809fbfbac7e1f50238519438c1 | 648 | py | Python | checkout/migrations/0009_auto_20201105_1324.py | GBrachetta/guillermo | 39e3ae082d2844482adf46143598edd2339447af | [
"PostgreSQL"
] | null | null | null | checkout/migrations/0009_auto_20201105_1324.py | GBrachetta/guillermo | 39e3ae082d2844482adf46143598edd2339447af | [
"PostgreSQL"
] | 8 | 2021-06-09T18:23:43.000Z | 2022-03-12T00:56:01.000Z | checkout/migrations/0009_auto_20201105_1324.py | GBrachetta/guillermo | 39e3ae082d2844482adf46143598edd2339447af | [
"PostgreSQL"
] | 1 | 2020-11-10T21:33:31.000Z | 2020-11-10T21:33:31.000Z | # Generated by Django 3.1.2 on 2020-11-05 12:24
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('checkout', '0008_order_user_profile'),
]
operations = [
migrations.AlterModelOptions(
name='order'... | 27 | 153 | 0.62963 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('checkout', '0008_order_user_profile'),
]
operations = [
migrations.AlterModelOptions(
name='order',
options={'ordering': ['date']},
... | true | true |
790467607d660c81d2051ed7b65b4ec4fa4657ca | 6,390 | py | Python | src/blockchain/block.py | thewh1teagle/yoyocoin | 588ec462e29ed9881fb3e0e413ff0636df06ebe9 | [
"MIT"
] | null | null | null | src/blockchain/block.py | thewh1teagle/yoyocoin | 588ec462e29ed9881fb3e0e413ff0636df06ebe9 | [
"MIT"
] | null | null | null | src/blockchain/block.py | thewh1teagle/yoyocoin | 588ec462e29ed9881fb3e0e413ff0636df06ebe9 | [
"MIT"
] | null | null | null | from typing import List
import json
import hashlib
from time import time
from base64 import b64decode, b64encode
import ecdsa
from config import ECDSA_CURVE
from .constants import BLOCK_COUNT_FREEZE_WALLET_LOTTERY_AFTER_WIN, DEVELOPER_KEY
from .transaction import Transaction
from .exceptions import (
ValidationEr... | 35.10989 | 103 | 0.637715 | from typing import List
import json
import hashlib
from time import time
from base64 import b64decode, b64encode
import ecdsa
from config import ECDSA_CURVE
from .constants import BLOCK_COUNT_FREEZE_WALLET_LOTTERY_AFTER_WIN, DEVELOPER_KEY
from .transaction import Transaction
from .exceptions import (
ValidationEr... | true | true |
7904677ccbc32aa8ea206966e99aefa4e699566f | 403 | py | Python | enCount/__init__.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | enCount/__init__.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | enCount/__init__.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | """
enCount tasks and analyses.
enCount is a Python library for processing RNA-Seq data from ENCODE.
"""
# from ._version import __version__
from . import config # load from myconfig.py if it exists
from . import db
from . import queues
from . import encode
from . import externals
from . import gtfs
from . impor... | 19.190476 | 68 | 0.756824 |
from . import config
from . import db
from . import queues
from . import encode
from . import externals
from . import gtfs
from . import fastqs
from . import experiments
from . import mappings
from . import integration | true | true |
7904679cdbd5df8dee25365f35073d4646a7898a | 3,401 | py | Python | inference/tf_inference.py | videetparekh/latentai-sdk-examples | 2104c097045105957ef7403b09b5a2c114677147 | [
"Apache-2.0"
] | null | null | null | inference/tf_inference.py | videetparekh/latentai-sdk-examples | 2104c097045105957ef7403b09b5a2c114677147 | [
"Apache-2.0"
] | null | null | null | inference/tf_inference.py | videetparekh/latentai-sdk-examples | 2104c097045105957ef7403b09b5a2c114677147 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 by LatentAI Inc.
# All rights reserved.
# This file is part of the LEIP(tm) SDK,
# and is released under the "LatentAI Commercial Software License".
# Please see the LICENSE file that should have been included as part of
# this package.
#
# @file tf_inference.py
#
# @author Videet Parekh
... | 33.673267 | 113 | 0.69362 |
import glob
import os
import logging
import utils.common_utils as utils
import argparse
import numpy as np
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
class TFModel():
def __init__(self, base_path, context, config):
self.context = context
self.config = config
self.load(... | true | true |
79046849a3b562767b04a1500aec39c3e349f734 | 3,386 | py | Python | src/cldfviz/colormap.py | cldf/cldfviz | c222a735a161b61b755584f62eb1ba1c64f797c0 | [
"Apache-2.0"
] | 2 | 2021-09-09T19:53:12.000Z | 2022-01-15T23:25:36.000Z | src/cldfviz/colormap.py | cldf/cldfviz | c222a735a161b61b755584f62eb1ba1c64f797c0 | [
"Apache-2.0"
] | 20 | 2021-08-12T07:50:40.000Z | 2022-03-31T12:56:20.000Z | src/cldfviz/colormap.py | cldf/cldfviz | c222a735a161b61b755584f62eb1ba1c64f797c0 | [
"Apache-2.0"
] | 1 | 2022-02-08T10:12:05.000Z | 2022-02-08T10:12:05.000Z | import json
import typing
import collections
from matplotlib import cm
from matplotlib.colors import Normalize, to_hex, CSS4_COLORS, BASE_COLORS
import matplotlib.pyplot as plt
from clldutils.color import qualitative_colors, sequential_colors, rgb_as_hex
from cldfviz.multiparameter import CONTINUOUS, CATEGORICAL, Par... | 39.835294 | 94 | 0.599232 | import json
import typing
import collections
from matplotlib import cm
from matplotlib.colors import Normalize, to_hex, CSS4_COLORS, BASE_COLORS
import matplotlib.pyplot as plt
from clldutils.color import qualitative_colors, sequential_colors, rgb_as_hex
from cldfviz.multiparameter import CONTINUOUS, CATEGORICAL, Par... | true | true |
7904696be5f1977c8538edd6b795c265ad816b85 | 18,288 | py | Python | src/twisted/web/test/test_distrib.py | mathieui/twisted | 35546d2b50742a32edba54719ce3e752dc50dd2a | [
"MIT",
"Unlicense"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_distrib.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 44 | 2019-05-27T10:59:29.000Z | 2022-03-31T14:14:29.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_distrib.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.distrib}.
"""
from os.path import abspath
from xml.dom.minidom import parseString
try:
import pwd
except ImportError:
pwd = None
from zope.interface.verify import verifyObject
from twisted.python import filep... | 34.636364 | 83 | 0.61308 |
from os.path import abspath
from xml.dom.minidom import parseString
try:
import pwd
except ImportError:
pwd = None
from zope.interface.verify import verifyObject
from twisted.python import filepath, failure
from twisted.internet import reactor, defer
from twisted.trial import unittest
from twisted.spread ... | true | true |
79046ad8537cf3f46e1a1b3bd28c929bb8644a08 | 2,387 | py | Python | project/snowapp/snow.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | 1 | 2020-10-23T14:29:24.000Z | 2020-10-23T14:29:24.000Z | project/snowapp/snow.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | null | null | null | project/snowapp/snow.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import cv2
def overlay(img, glasses, pos):
sx = pos[0]
ex = pos[0] + glasses.shape[1]
sy = pos[1]
ey = pos[1] + glasses.shape[0]
if sx < 0 or sy < 0 or ex > img.shape[1] or ey > img.shape[0]:
return
img1 = img[sy:ey, sx:ex]
img2 = glasses[:, :, 0:3]... | 25.666667 | 106 | 0.566401 | import sys
import numpy as np
import cv2
def overlay(img, glasses, pos):
sx = pos[0]
ex = pos[0] + glasses.shape[1]
sy = pos[1]
ey = pos[1] + glasses.shape[0]
if sx < 0 or sy < 0 or ex > img.shape[1] or ey > img.shape[0]:
return
img1 = img[sy:ey, sx:ex]
img2 = glasses[:, :, 0:3]... | true | true |
79046ae99b3e80ed5be1615069f7dbeda67658f6 | 237 | py | Python | src-server/app/forms/pages/about.py | mjmcconnell/sra | ff1c2563dead2fe4d81cda3d431482defd0f6a62 | [
"Apache-2.0"
] | null | null | null | src-server/app/forms/pages/about.py | mjmcconnell/sra | ff1c2563dead2fe4d81cda3d431482defd0f6a62 | [
"Apache-2.0"
] | null | null | null | src-server/app/forms/pages/about.py | mjmcconnell/sra | ff1c2563dead2fe4d81cda3d431482defd0f6a62 | [
"Apache-2.0"
] | null | null | null | """Form definitions, allow easy validation of input and rendering of forms
"""
# future imports
from __future__ import absolute_import
# local imports
from app.forms.pages.base import PageForm
class AboutPageForm(PageForm):
pass
| 18.230769 | 74 | 0.780591 |
from __future__ import absolute_import
from app.forms.pages.base import PageForm
class AboutPageForm(PageForm):
pass
| true | true |
79046b7a3f5b56818ff01c6981882fca24aaa637 | 1,555 | py | Python | component/tile/param_tile.py | 12rambau/weplan | 16833d5775b4434a7804f7ee6ae419ee79b7c6cf | [
"MIT"
] | null | null | null | component/tile/param_tile.py | 12rambau/weplan | 16833d5775b4434a7804f7ee6ae419ee79b7c6cf | [
"MIT"
] | null | null | null | component/tile/param_tile.py | 12rambau/weplan | 16833d5775b4434a7804f7ee6ae419ee79b7c6cf | [
"MIT"
] | null | null | null | from sepal_ui import sepalwidgets as sw
from ipywidgets import dlink
from component import parameter as cp
class ParamTile(sw.Card):
def __init__(self, model):
# read the model
self.model = model
# add the base widgets
self.close = sw.Icon(children=["mdi-close"], small=True)
... | 26.355932 | 86 | 0.540836 | from sepal_ui import sepalwidgets as sw
from ipywidgets import dlink
from component import parameter as cp
class ParamTile(sw.Card):
def __init__(self, model):
self.model = model
self.close = sw.Icon(children=["mdi-close"], small=True)
self.title = sw.CardTitle(
... | true | true |
79046b8615e3e038faee049cd39f833066f66a55 | 52,814 | py | Python | Lib/test/test_compile.py | sarvex/cpython | 81d968b7c30d5b41f3f28b297b7ee5345d569509 | [
"0BSD"
] | 5 | 2021-12-03T23:11:53.000Z | 2022-01-08T21:02:50.000Z | Lib/test/test_compile.py | Seanpm2001-ASP-DOT-NET-lang/cpython | 47cca0492b3c379823d4bdb600be56a633e5bb88 | [
"0BSD"
] | 6 | 2021-09-12T08:15:12.000Z | 2022-03-05T09:26:40.000Z | Lib/test/test_compile.py | Seanpm2001-ASP-DOT-NET-lang/cpython | 47cca0492b3c379823d4bdb600be56a633e5bb88 | [
"0BSD"
] | 1 | 2019-04-02T05:38:49.000Z | 2019-04-02T05:38:49.000Z | import dis
import math
import os
import unittest
import sys
import ast
import _ast
import tempfile
import types
import textwrap
from test import support
from test.support import script_helper, requires_debug_ranges
from test.support.os_helper import FakePath
class TestSpecifics(unittest.TestCase):
def compile_si... | 34.496408 | 95 | 0.533211 | import dis
import math
import os
import unittest
import sys
import ast
import _ast
import tempfile
import types
import textwrap
from test import support
from test.support import script_helper, requires_debug_ranges
from test.support.os_helper import FakePath
class TestSpecifics(unittest.TestCase):
def compile_si... | true | true |
79046bb7fa59f674883f400dbaf8775cea35d79b | 7,625 | py | Python | scripts/ref_leak_test.py | Sekenre/cbor2 | f789dd080e80607fb5486950e60e700940488c60 | [
"MIT"
] | 127 | 2016-06-13T17:38:42.000Z | 2022-02-13T23:38:35.000Z | scripts/ref_leak_test.py | Sekenre/cbor2 | f789dd080e80607fb5486950e60e700940488c60 | [
"MIT"
] | 125 | 2016-09-17T18:06:27.000Z | 2022-03-15T18:34:09.000Z | scripts/ref_leak_test.py | Sekenre/cbor2 | f789dd080e80607fb5486950e60e700940488c60 | [
"MIT"
] | 43 | 2016-09-09T09:39:58.000Z | 2021-12-22T20:08:56.000Z | #!/usr/bin/env python
"""
This is a crude script for detecting reference leaks in the C-based cbor2
implementation. It is by no means fool-proof and won't pick up all possible ref
leaks, but it is a reasonable "confidence test" that things aren't horribly
wrong. The script assumes you're in an environment with objgrap... | 33.738938 | 93 | 0.570361 |
import sys
import objgraph
import tracemalloc
from datetime import datetime, timezone, timedelta
from fractions import Fraction
from decimal import Decimal
from collections import namedtuple, OrderedDict
def import_cbor2():
import cbor2
import cbor2.types
import cbor2.encoder
import cbor2.... | true | true |
79046c7d31f55452e393c3f704929ce34e69eb05 | 3,817 | py | Python | neurokit2/complexity/entropy_distribution.py | danibene/NeuroKit | df0ab6696e7418cf8b8dcd3ed82dbf879fa61b3a | [
"MIT"
] | null | null | null | neurokit2/complexity/entropy_distribution.py | danibene/NeuroKit | df0ab6696e7418cf8b8dcd3ed82dbf879fa61b3a | [
"MIT"
] | null | null | null | neurokit2/complexity/entropy_distribution.py | danibene/NeuroKit | df0ab6696e7418cf8b8dcd3ed82dbf879fa61b3a | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import scipy.stats
from .utils_complexity_embedding import complexity_embedding
from .entropy_shannon import entropy_shannon
def entropy_distribution(signal=None, delay=1, dimension=3, bins="Sturges", base=2):
"""**Distribution Entropy (DistrEn)**
Distribution Entropy ... | 32.905172 | 98 | 0.596804 | import numpy as np
import pandas as pd
import scipy.stats
from .utils_complexity_embedding import complexity_embedding
from .entropy_shannon import entropy_shannon
def entropy_distribution(signal=None, delay=1, dimension=3, bins="Sturges", base=2):
if isinstance(signal, (np.ndarray, pd.DataFrame)) and signa... | true | true |
79046caa8581e0899b3236005dd8cef53003a204 | 909 | py | Python | test_model/utils/caption2txt.py | lyp2333/External-Attention-pytorch | 08be6baff82bf22d48b1746fd668446280365b9b | [
"MIT"
] | 1 | 2022-03-15T11:25:34.000Z | 2022-03-15T11:25:34.000Z | test_model/utils/caption2txt.py | lyp2333/External-Attention-pytorch | 08be6baff82bf22d48b1746fd668446280365b9b | [
"MIT"
] | null | null | null | test_model/utils/caption2txt.py | lyp2333/External-Attention-pytorch | 08be6baff82bf22d48b1746fd668446280365b9b | [
"MIT"
] | null | null | null | import json
import os
srt_path = '/home/lyp/桌面/MAE_论文逐段精读【论文精读】.457423264.zh-CN.srt'
json_path = '/home/lyp/桌面/caption.json'
txt_path = '/home/lyp/桌面'
def srt2txt(path):
out_path= os.path.join(txt_path,path.split('.')[0]+'.txt')
with open(path,'r+') as f:
with open(out_path, 'w+') as out:
fo... | 36.36 | 73 | 0.585259 | import json
import os
srt_path = '/home/lyp/桌面/MAE_论文逐段精读【论文精读】.457423264.zh-CN.srt'
json_path = '/home/lyp/桌面/caption.json'
txt_path = '/home/lyp/桌面'
def srt2txt(path):
out_path= os.path.join(txt_path,path.split('.')[0]+'.txt')
with open(path,'r+') as f:
with open(out_path, 'w+') as out:
fo... | true | true |
79046d31ed91366118a39dcf7f70c3237ed795ac | 39 | py | Python | a1d05eba1/utils/__init__.py | dorey/a1d05eba1 | eb6f66a946f3c417ab6bf9047ba9715be071967c | [
"0BSD"
] | null | null | null | a1d05eba1/utils/__init__.py | dorey/a1d05eba1 | eb6f66a946f3c417ab6bf9047ba9715be071967c | [
"0BSD"
] | 28 | 2020-06-23T19:00:58.000Z | 2021-03-26T22:13:07.000Z | a1d05eba1/utils/__init__.py | dorey/a1d05eba1 | eb6f66a946f3c417ab6bf9047ba9715be071967c | [
"0BSD"
] | null | null | null | from .kfrozendict import kassertfrozen
| 19.5 | 38 | 0.871795 | from .kfrozendict import kassertfrozen
| true | true |
79046db2ac5bf7ab7c68b2186b55ab8aa0c5d8ee | 2,177 | py | Python | data_utils.py | shivgahlout/DenseNet-pytorch | 8fd286d9f718d164a4583eebd100dff127263891 | [
"MIT"
] | 3 | 2018-08-20T04:55:04.000Z | 2019-05-18T02:10:31.000Z | data_utils.py | gahshiv/DenseNet-pytorch | 8fd286d9f718d164a4583eebd100dff127263891 | [
"MIT"
] | null | null | null | data_utils.py | gahshiv/DenseNet-pytorch | 8fd286d9f718d164a4583eebd100dff127263891 | [
"MIT"
] | 1 | 2019-07-17T01:10:10.000Z | 2019-07-17T01:10:10.000Z | import matplotlib.pyplot as plt
import matplotlib
import numpy as np
from PIL import Image
from scipy.misc import imsave, imread
def plots(epochs, train_acc, test_acc, train_loss, test_loss, train_error, test_error,filename):
plt.style.use('bmh')
fig=plt.figure(figsize=(8,6))
plt.plot(epochs,train_acc, ... | 35.112903 | 96 | 0.509417 | import matplotlib.pyplot as plt
import matplotlib
import numpy as np
from PIL import Image
from scipy.misc import imsave, imread
def plots(epochs, train_acc, test_acc, train_loss, test_loss, train_error, test_error,filename):
plt.style.use('bmh')
fig=plt.figure(figsize=(8,6))
plt.plot(epochs,train_acc, ... | true | true |
79046e72c3b7ce43e36846ffb09e38e0ed9245f9 | 6,677 | py | Python | unit_test/docker_container_test.py | bjtucker/cibuildwheel | 856f59d5031f42bb27aa4af28e4019add9bbcb89 | [
"BSD-2-Clause"
] | 1 | 2019-07-28T12:51:30.000Z | 2019-07-28T12:51:30.000Z | unit_test/docker_container_test.py | bjtucker/cibuildwheel | 856f59d5031f42bb27aa4af28e4019add9bbcb89 | [
"BSD-2-Clause"
] | 1 | 2021-05-25T20:07:09.000Z | 2021-05-25T20:07:09.000Z | unit_test/docker_container_test.py | pradyunsg/cibuildwheel | 61af5e461581d9b315b27cb6db1d0cc56979cc67 | [
"BSD-2-Clause"
] | null | null | null | import platform
import random
import shutil
import subprocess
import textwrap
from pathlib import Path, PurePath
import pytest
from cibuildwheel.docker_container import DockerContainer
from cibuildwheel.environment import EnvironmentAssignment
# for these tests we use manylinux2014 images, because they're available ... | 33.385 | 98 | 0.634417 | import platform
import random
import shutil
import subprocess
import textwrap
from pathlib import Path, PurePath
import pytest
from cibuildwheel.docker_container import DockerContainer
from cibuildwheel.environment import EnvironmentAssignment
# multi architectures and include python3.8
pm = platform.machine()
if p... | true | true |
79046e9ef7bef36d5dc67989725dd7e5a8af1cb7 | 42,375 | py | Python | tests/integration/test_fscmds.py | mensago/mensagod | 3b62e4038691ee3c9db618b024edf62467d402f5 | [
"MIT"
] | null | null | null | tests/integration/test_fscmds.py | mensago/mensagod | 3b62e4038691ee3c9db618b024edf62467d402f5 | [
"MIT"
] | null | null | null | tests/integration/test_fscmds.py | mensago/mensagod | 3b62e4038691ee3c9db618b024edf62467d402f5 | [
"MIT"
] | 1 | 2021-03-06T18:46:48.000Z | 2021-03-06T18:46:48.000Z | # pylint: disable=too-many-lines
import os
import random
import shutil
import time
import uuid
from retval import RetVal
from pycryptostring import CryptoString
from pymensago.encryption import EncryptionPair
from pymensago.hash import blake2hash
from pymensago.serverconn import ServerConnection
from integration_set... | 29.59148 | 99 | 0.693192 |
import os
import random
import shutil
import time
import uuid
from retval import RetVal
from pycryptostring import CryptoString
from pymensago.encryption import EncryptionPair
from pymensago.hash import blake2hash
from pymensago.serverconn import ServerConnection
from integration_setup import login_admin, regcode_a... | true | true |
79046f5b495206bc0d904acfd0a5c0fac1401b4a | 15,554 | py | Python | semanticmapping/sspspace.py | nsdumont/SemanticMapping | af97a452b3de30a9670536c7fa92c28a70fae44d | [
"MIT"
] | null | null | null | semanticmapping/sspspace.py | nsdumont/SemanticMapping | af97a452b3de30a9670536c7fa92c28a70fae44d | [
"MIT"
] | null | null | null | semanticmapping/sspspace.py | nsdumont/SemanticMapping | af97a452b3de30a9670536c7fa92c28a70fae44d | [
"MIT"
] | null | null | null | import numpy as np
import scipy
from scipy.stats import qmc
from scipy.stats import special_ortho_group
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import warnings
from .ssp import SSP
class SSPSpace:
def __init__(self, domain_dim: int, ssp_dim: int, axis_matrix=None, phase_matrix=None,
... | 44.44 | 158 | 0.594317 | import numpy as np
import scipy
from scipy.stats import qmc
from scipy.stats import special_ortho_group
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import warnings
from .ssp import SSP
class SSPSpace:
def __init__(self, domain_dim: int, ssp_dim: int, axis_matrix=None, phase_matrix=None,
... | true | true |
790470298781d11b85153ed42699fa2112365e5e | 1,497 | py | Python | pyvdk/api/categories/utils.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 16 | 2020-11-24T18:27:59.000Z | 2021-05-14T19:25:44.000Z | pyvdk/api/categories/utils.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 1 | 2021-04-21T14:35:55.000Z | 2021-06-26T04:18:44.000Z | pyvdk/api/categories/utils.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 2 | 2020-12-03T16:56:31.000Z | 2020-12-19T16:28:58.000Z | # -*- coding: utf-8 -*-
#
from typing import Optional
from ..category import Category
class Utils(Category):
def check_link(
self,
url: str = None,
**kwargs
) -> dict:
return self._request("checkLink", locals())
def delete_from_last_shortened(
self,
key: ... | 23.390625 | 65 | 0.560454 |
from typing import Optional
from ..category import Category
class Utils(Category):
def check_link(
self,
url: str = None,
**kwargs
) -> dict:
return self._request("checkLink", locals())
def delete_from_last_shortened(
self,
key: str = None,
**kw... | true | true |
790471054c1b09baa754315f543aef0cde3d50c8 | 648 | py | Python | test/test_contactdeletetest.py | winsok/pythonlearning | b74e31a2c3e830d0563ca90c5ba32d59eaf4e74d | [
"Apache-2.0"
] | null | null | null | test/test_contactdeletetest.py | winsok/pythonlearning | b74e31a2c3e830d0563ca90c5ba32d59eaf4e74d | [
"Apache-2.0"
] | null | null | null | test/test_contactdeletetest.py | winsok/pythonlearning | b74e31a2c3e830d0563ca90c5ba32d59eaf4e74d | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
import random
def test_delete_some_contact(app, db, check_ui):
if app.contacts.count() == 0:
app.contacts.create_new_contact(Contact(firstname="crab"))
old_contacts = db.get_contact_list()
contact = random.choice(old_contacts)
app.contacts.delete_contact_by_id(... | 36 | 125 | 0.739198 | from model.contact import Contact
import random
def test_delete_some_contact(app, db, check_ui):
if app.contacts.count() == 0:
app.contacts.create_new_contact(Contact(firstname="crab"))
old_contacts = db.get_contact_list()
contact = random.choice(old_contacts)
app.contacts.delete_contact_by_id(... | true | true |
79047169f4d03379b0dde84408f6ba416ba2cc8a | 6,507 | py | Python | funkyvalidate/tests/test_interfaces.py | OaklandPeters/funkyvalidate | 10fb69173d7912769721b06794a57a93a03dacde | [
"MIT"
] | null | null | null | funkyvalidate/tests/test_interfaces.py | OaklandPeters/funkyvalidate | 10fb69173d7912769721b06794a57a93a03dacde | [
"MIT"
] | null | null | null | funkyvalidate/tests/test_interfaces.py | OaklandPeters/funkyvalidate | 10fb69173d7912769721b06794a57a93a03dacde | [
"MIT"
] | null | null | null | import os
import unittest
import abc
from funkyvalidate.examples.existing_directory import ExistingDirectory
from funkyvalidate.examples.existing_file import ExistingFile
from funkyvalidate import InterfaceType, meets
form_path = lambda *parts: os.path.abspath(os.path.join(*parts))
test_dir = form_path(__file__, '... | 35.950276 | 94 | 0.716306 | import os
import unittest
import abc
from funkyvalidate.examples.existing_directory import ExistingDirectory
from funkyvalidate.examples.existing_file import ExistingFile
from funkyvalidate import InterfaceType, meets
form_path = lambda *parts: os.path.abspath(os.path.join(*parts))
test_dir = form_path(__file__, '... | true | true |
790471a34452b433ba41649b7e3a92c0604e5e81 | 39,279 | py | Python | pytype/pytd/optimize.py | adamcataldo/pytype | 7163e85880b52d53d58044e53157e2a21988308e | [
"Apache-2.0"
] | 2 | 2019-07-25T12:53:02.000Z | 2019-08-18T16:26:16.000Z | pytype/pytd/optimize.py | adamcataldo/pytype | 7163e85880b52d53d58044e53157e2a21988308e | [
"Apache-2.0"
] | null | null | null | pytype/pytd/optimize.py | adamcataldo/pytype | 7163e85880b52d53d58044e53157e2a21988308e | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8; python-indent:2; indent-tabs-mode:nil -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 33.007563 | 80 | 0.675705 |
import collections
import logging
from pytype import utils
from pytype.pytd import abc_hierarchy
from pytype.pytd import booleq
from pytype.pytd import mro
from pytype.pytd import pytd
from pytype.pytd import pytd_utils
from pytype.pytd import type_match
from pytype.pytd import visitors
import six
l... | true | true |
790472ee541ced8da5ee14485c34662ec01fd4c1 | 433 | py | Python | 4° Período/Programação de Computadores/lista 1/CONCEITOS DE LÓGICA DE PROGRAMAÇÃO/Estrutura de seleção/Exercício 14.py | sullyvan15/UVV | 2390cc2881792d036db1d8b098fe366f47cd98c3 | [
"MIT"
] | null | null | null | 4° Período/Programação de Computadores/lista 1/CONCEITOS DE LÓGICA DE PROGRAMAÇÃO/Estrutura de seleção/Exercício 14.py | sullyvan15/UVV | 2390cc2881792d036db1d8b098fe366f47cd98c3 | [
"MIT"
] | 1 | 2020-10-07T23:33:21.000Z | 2020-10-08T01:15:11.000Z | 4° Período/Programação de Computadores/lista 1/CONCEITOS DE LÓGICA DE PROGRAMAÇÃO/Estrutura de seleção/Exercício 14.py | sullyvan15/Universidade-Vila-Velha | 2390cc2881792d036db1d8b098fe366f47cd98c3 | [
"MIT"
] | null | null | null | av1 = float(input('Nota 1° avaliação'))
av2 = float(input('Nota 2° avaliação'))
mp = av1 + av2 / 2
tf = int(input('Total geral de faltas: ')
pf = float(input('Prova final: '))
final = mp + pf / 2
if tf > 20:
print("Reprovado por falta")
else
elif mp => 7:
print("Aprovado")
elif 3 <= mp < 7:
... | 19.681818 | 41 | 0.558891 | av1 = float(input('Nota 1° avaliação'))
av2 = float(input('Nota 2° avaliação'))
mp = av1 + av2 / 2
tf = int(input('Total geral de faltas: ')
pf = float(input('Prova final: '))
final = mp + pf / 2
if tf > 20:
print("Reprovado por falta")
else
elif mp => 7:
print("Aprovado")
elif 3 <= mp < 7:
... | false | true |
7904734f69e8d1103ec2f6c7d5a09c45e4cf3266 | 241 | py | Python | json_content.py | mell-old/mell-old-echo-bot | a59436fe0632254f76c627d52cbb6fd118fb017d | [
"MIT"
] | null | null | null | json_content.py | mell-old/mell-old-echo-bot | a59436fe0632254f76c627d52cbb6fd118fb017d | [
"MIT"
] | null | null | null | json_content.py | mell-old/mell-old-echo-bot | a59436fe0632254f76c627d52cbb6fd118fb017d | [
"MIT"
] | null | null | null | import json
def get_text_from_json(file):
with open(file) as f:
json_text = f.read()
text = json.loads(json_text)
return text
content = get_text_from_json('content.json')
test = get_text_from_json('test.json') | 20.083333 | 44 | 0.672199 | import json
def get_text_from_json(file):
with open(file) as f:
json_text = f.read()
text = json.loads(json_text)
return text
content = get_text_from_json('content.json')
test = get_text_from_json('test.json') | true | true |
790474c6e3eedd4bf4f4c049f9d76deba7187f54 | 280 | py | Python | netbox/ipam/forms/bulk_create.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | 4,994 | 2019-07-01T13:15:44.000Z | 2022-03-31T19:55:45.000Z | netbox/ipam/forms/bulk_create.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | 4,045 | 2019-07-01T14:24:09.000Z | 2022-03-31T16:07:39.000Z | netbox/ipam/forms/bulk_create.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | 1,225 | 2019-07-01T15:34:03.000Z | 2022-03-31T16:47:09.000Z | from django import forms
from utilities.forms import BootstrapMixin, ExpandableIPAddressField
__all__ = (
'IPAddressBulkCreateForm',
)
class IPAddressBulkCreateForm(BootstrapMixin, forms.Form):
pattern = ExpandableIPAddressField(
label='Address pattern'
)
| 20 | 68 | 0.764286 | from django import forms
from utilities.forms import BootstrapMixin, ExpandableIPAddressField
__all__ = (
'IPAddressBulkCreateForm',
)
class IPAddressBulkCreateForm(BootstrapMixin, forms.Form):
pattern = ExpandableIPAddressField(
label='Address pattern'
)
| true | true |
790474e882b4a327f4a6aff90f1ba7404b35dcec | 187 | py | Python | ktrade/queue_messages/buy_message.py | webclinic017/ktrade | 49c02b2e93235f925e41c92603040e15b1885b0d | [
"MIT"
] | null | null | null | ktrade/queue_messages/buy_message.py | webclinic017/ktrade | 49c02b2e93235f925e41c92603040e15b1885b0d | [
"MIT"
] | null | null | null | ktrade/queue_messages/buy_message.py | webclinic017/ktrade | 49c02b2e93235f925e41c92603040e15b1885b0d | [
"MIT"
] | null | null | null | from ktrade.queue_messages.queue_message import QueueMessage
class BuyMessage(QueueMessage):
def __init__(self, ticker: str):
super().__init__(type='BUY')
self.ticker = ticker
| 26.714286 | 60 | 0.759358 | from ktrade.queue_messages.queue_message import QueueMessage
class BuyMessage(QueueMessage):
def __init__(self, ticker: str):
super().__init__(type='BUY')
self.ticker = ticker
| true | true |
79047555a9cb961132f9f4c9bf637bfcd9bcd92d | 3,907 | py | Python | utils/preprocessing_data.py | 1Stohk1/tami | e0aa902bb767631dd2435ed0eac05209b9bd64ed | [
"MIT"
] | 2 | 2020-12-17T20:51:48.000Z | 2021-02-01T09:28:30.000Z | utils/preprocessing_data.py | Djack1010/claransom | e823a64ed957b37ce5f9bcf77ada1e7097a06fc4 | [
"MIT"
] | 1 | 2020-12-25T19:48:49.000Z | 2020-12-25T19:48:49.000Z | utils/preprocessing_data.py | Djack1010/claransom | e823a64ed957b37ce5f9bcf77ada1e7097a06fc4 | [
"MIT"
] | 2 | 2020-11-02T12:00:27.000Z | 2021-09-20T09:52:45.000Z | import os
import numpy as np
import pickle
import pathlib
from random import shuffle, choice
def get_info_dataset(dataset_path, update=False):
# TODO: Implements some checks to verify edits to the dataset from last pickle.dump(data)
storing_data_path = dataset_path + "/info.txt"
if update and os.path.exi... | 48.8375 | 120 | 0.604044 | import os
import numpy as np
import pickle
import pathlib
from random import shuffle, choice
def get_info_dataset(dataset_path, update=False):
storing_data_path = dataset_path + "/info.txt"
if update and os.path.exists(dataset_path + "/info.txt"):
os.remove(dataset_path + "/info.txt")
if os... | true | true |
7904755a1dd1799e443bdc36e69d4061e983af6d | 1,572 | py | Python | services/engine/webs/core/requests/request.py | huang-zp/crawloop | 3411bfaac3b0a6a534cf6518f5132883477e7442 | [
"Apache-2.0"
] | 19 | 2021-03-10T03:51:31.000Z | 2022-03-14T01:05:46.000Z | services/engine/webs/core/requests/request.py | c89758971/crawloop | b9fcc21f7ec712a74cb5952686c1f4cce896207e | [
"Apache-2.0"
] | 1 | 2021-03-12T02:14:17.000Z | 2021-03-12T02:14:17.000Z | services/engine/webs/core/requests/request.py | c89758971/crawloop | b9fcc21f7ec712a74cb5952686c1f4cce896207e | [
"Apache-2.0"
] | 5 | 2021-03-23T09:51:23.000Z | 2022-01-14T08:16:09.000Z | # -*- coding: utf-8 -*-
import requests
from webs.api.exceptions.customs import ServerError, InvalidAPIRequest, RecordNotFound, RecordAlreadyExists
class RequestMixin(object):
CODE_EXCEPTION_MSG = {
400: InvalidAPIRequest,
404: RecordNotFound,
409: RecordAlreadyExists,
422: Inva... | 30.230769 | 107 | 0.632316 |
import requests
from webs.api.exceptions.customs import ServerError, InvalidAPIRequest, RecordNotFound, RecordAlreadyExists
class RequestMixin(object):
CODE_EXCEPTION_MSG = {
400: InvalidAPIRequest,
404: RecordNotFound,
409: RecordAlreadyExists,
422: InvalidAPIRequest,
... | true | true |
790476bfb1348ab4e0cb7a3cfe0c76769a6bf9e2 | 9,966 | py | Python | mmcls/models/backbones/mobilenet_v2.py | ChaseMonsterAway/mmclassification | 85d26b8eb2fc799599c42ca33831c40707311bd7 | [
"Apache-2.0"
] | null | null | null | mmcls/models/backbones/mobilenet_v2.py | ChaseMonsterAway/mmclassification | 85d26b8eb2fc799599c42ca33831c40707311bd7 | [
"Apache-2.0"
] | null | null | null | mmcls/models/backbones/mobilenet_v2.py | ChaseMonsterAway/mmclassification | 85d26b8eb2fc799599c42ca33831c40707311bd7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from torch.nn.modules.batchnorm import _BatchNorm
from mmcls.models.utils import make_divisible
from ..builder import BACKBONES
from .base_backbon... | 36.639706 | 173 | 0.553783 |
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from torch.nn.modules.batchnorm import _BatchNorm
from mmcls.models.utils import make_divisible
from ..builder import BACKBONES
from .base_backbone import BaseBackbone
class InvertedResidual(... | true | true |
790476c58be6046db4315612dc2aed8517f59372 | 5,449 | py | Python | mmdet3d/datasets/pipelines/test_time_aug.py | Guangyun-Xu/mmdetection3d | 75c5c6cd590386bd1539a686c5fd2cc45c5480d5 | [
"Apache-2.0"
] | 2,216 | 2020-07-09T19:10:11.000Z | 2022-03-31T12:39:26.000Z | mmdet3d/datasets/pipelines/test_time_aug.py | Guangyun-Xu/mmdetection3d | 75c5c6cd590386bd1539a686c5fd2cc45c5480d5 | [
"Apache-2.0"
] | 1,174 | 2020-07-10T07:02:28.000Z | 2022-03-31T12:38:56.000Z | mmdet3d/datasets/pipelines/test_time_aug.py | Guangyun-Xu/mmdetection3d | 75c5c6cd590386bd1539a686c5fd2cc45c5480d5 | [
"Apache-2.0"
] | 681 | 2020-07-09T19:40:06.000Z | 2022-03-31T11:02:24.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import warnings
from copy import deepcopy
from mmdet.datasets.builder import PIPELINES
from mmdet.datasets.pipelines import Compose
@PIPELINES.register_module()
class MultiScaleFlipAug3D(object):
"""Test-time augmentation with multiple scales and flippi... | 45.033058 | 78 | 0.576436 |
import mmcv
import warnings
from copy import deepcopy
from mmdet.datasets.builder import PIPELINES
from mmdet.datasets.pipelines import Compose
@PIPELINES.register_module()
class MultiScaleFlipAug3D(object):
def __init__(self,
transforms,
img_scale,
pts_scale_... | true | true |
790478398a39a0505d83b637eb44b9874a909f47 | 445 | py | Python | Crashkurs Python/03_if.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | 2 | 2020-03-23T14:57:50.000Z | 2021-03-24T18:12:07.000Z | Crashkurs Python/03_if.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs Python/03_if.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | # if funktioniert (fast) wie in allen anderen Sprachen
# - Einrückungen ersetzen { } Gilt für Python generell!
# - Es gibt ein elif statt einem else if
weight = 50 # kg
height = 190 # cm
bmi = weight / (height/100)**2
# bmi < 18.5 : Untergewicht
# bmi > 25 : Übergewicht
# sonst : Normalgewicht
if bmi < 18.5... | 22.25 | 55 | 0.653933 |
weight = 50
height = 190
bmi = weight / (height/100)**2
if bmi < 18.5:
print("Untergewicht")
print("Mehr essen!")
elif bmi > 25:
print("Übergewicht")
else:
print("Normalgewicht") | true | true |
790478e4b414f4421bbf8c39bb19609c4d28716f | 556 | py | Python | tests/test_croncierge/test_cmd_services.py | mburdeev/croncierge | b9eb086bdf4f286640e0bdc263f03851f43a13fc | [
"Apache-2.0"
] | null | null | null | tests/test_croncierge/test_cmd_services.py | mburdeev/croncierge | b9eb086bdf4f286640e0bdc263f03851f43a13fc | [
"Apache-2.0"
] | null | null | null | tests/test_croncierge/test_cmd_services.py | mburdeev/croncierge | b9eb086bdf4f286640e0bdc263f03851f43a13fc | [
"Apache-2.0"
] | null | null | null | import logging
from croncierge import cmd_services
def log_cmd(cmd_response):
logging.info(f"Command response:\n{cmd_response}")
def test_cmd_stdout():
cmd = "python3 /home/maxim/projects/celecron/tests/test_croncierge/debug_cmd.py"
log_cmd(cmd_services.run_cmd(cmd))
def test_cmd_stderr():
cmd = "p... | 25.272727 | 84 | 0.717626 | import logging
from croncierge import cmd_services
def log_cmd(cmd_response):
logging.info(f"Command response:\n{cmd_response}")
def test_cmd_stdout():
cmd = "python3 /home/maxim/projects/celecron/tests/test_croncierge/debug_cmd.py"
log_cmd(cmd_services.run_cmd(cmd))
def test_cmd_stderr():
cmd = "p... | true | true |
790478f6b7ae1e647cd65752e4961dacecadecf8 | 2,065 | py | Python | User.py | imjacksonchen/weightTracker | 9dfdd9a943cfdc5148a5a15876df2f159b0623cf | [
"MIT"
] | null | null | null | User.py | imjacksonchen/weightTracker | 9dfdd9a943cfdc5148a5a15876df2f159b0623cf | [
"MIT"
] | null | null | null | User.py | imjacksonchen/weightTracker | 9dfdd9a943cfdc5148a5a15876df2f159b0623cf | [
"MIT"
] | null | null | null | # User class to hold name and __data
class User:
### Instance Variables ###
__userName = ""
__validUser = None
__data = []
__weights = []
__notes = []
__dates = []
__intWeights = []
__avgWeight = 0
__minWeight = 0
__maxWeight = 0
##########################
### G... | 21.071429 | 77 | 0.595157 |
class User:
= []
__weights = []
__notes = []
__dates = []
__intWeights = []
__avgWeight = 0
__minWeight = 0
__maxWeight = 0
ght(self):
return str(self.__avgWeight)
def getMinWeight(self):
return str(self.__minWeight)
def getMaxWeight(self):
ret... | true | true |
790478ff56f8ca4d2493e0f15bcd8e0a387ff1ec | 4,017 | py | Python | cogs/Matchmaking.py | DevvyDont/CraneDuels | a6c8ed9f2fd5dbc01cc3419856fae3d4a587bdc4 | [
"MIT"
] | null | null | null | cogs/Matchmaking.py | DevvyDont/CraneDuels | a6c8ed9f2fd5dbc01cc3419856fae3d4a587bdc4 | [
"MIT"
] | null | null | null | cogs/Matchmaking.py | DevvyDont/CraneDuels | a6c8ed9f2fd5dbc01cc3419856fae3d4a587bdc4 | [
"MIT"
] | null | null | null | import random
import string
from discord import TextChannel
from discord.ext import commands
from discord.ext.tasks import loop
from discord_components import Button, ButtonStyle
from config import settings
from util.Match import Match
class Matchmaking(commands.Cog):
def __init__(self, bot):
self.bot ... | 33.475 | 135 | 0.668658 | import random
import string
from discord import TextChannel
from discord.ext import commands
from discord.ext.tasks import loop
from discord_components import Button, ButtonStyle
from config import settings
from util.Match import Match
class Matchmaking(commands.Cog):
def __init__(self, bot):
self.bot ... | true | true |
7904792449df4d8709b46025734d4a46c9fe9f94 | 11,585 | py | Python | src/sage/modular/abvar/cuspidal_subgroup.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2018-09-11T11:16:26.000Z | 2019-09-10T15:26:37.000Z | src/sage/modular/abvar/cuspidal_subgroup.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/modular/abvar/cuspidal_subgroup.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | """
Cuspidal subgroups of modular abelian varieties
AUTHORS:
- William Stein (2007-03, 2008-02)
EXAMPLES: We compute the cuspidal subgroup of `J_1(13)`::
sage: A = J1(13)
sage: C = A.cuspidal_subgroup(); C
Finite subgroup with invariants [19, 19] over QQ of Abelian variety J1(13) of dimension 2
sage... | 30.248042 | 210 | 0.543979 | from __future__ import absolute_import
from .finite_subgroup import FiniteSubgroup
from sage.rings.all import infinity, QQ, ZZ
from sage.matrix.all import matrix
from sage.modular.arithgroup.all import is_Gamma0
from sage.modular.cusps import Cusp
... | true | true |
79047a1921bb946a12fb69de9909965c1f79cd84 | 7,283 | py | Python | tests/python/sealapi/test_sanity.py | ZSoumia/TenSEAL | 02697d41f92b834daa1559cc12162ffc8b2bc44d | [
"Apache-2.0"
] | null | null | null | tests/python/sealapi/test_sanity.py | ZSoumia/TenSEAL | 02697d41f92b834daa1559cc12162ffc8b2bc44d | [
"Apache-2.0"
] | null | null | null | tests/python/sealapi/test_sanity.py | ZSoumia/TenSEAL | 02697d41f92b834daa1559cc12162ffc8b2bc44d | [
"Apache-2.0"
] | null | null | null | import sys, os
import pytest
import tenseal.sealapi as sealapi
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from utils import *
@pytest.mark.parametrize(
"compr_type",
[sealapi.COMPR_MODE_TYPE.NONE, sealapi.COMPR_MODE_TYPE.ZLIB, sealapi.COMPR_MODE_TYPE.ZSTD],
)
def test_serialization_compressi... | 30.472803 | 95 | 0.679665 | import sys, os
import pytest
import tenseal.sealapi as sealapi
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from utils import *
@pytest.mark.parametrize(
"compr_type",
[sealapi.COMPR_MODE_TYPE.NONE, sealapi.COMPR_MODE_TYPE.ZLIB, sealapi.COMPR_MODE_TYPE.ZSTD],
)
def test_serialization_compressi... | true | true |
79047d7fba7698ce873fce1411a0eb4c9c2d536b | 516 | py | Python | vcr/files.py | charlax/vcrpy | 1d3fe5c33ecf06b494fa6cbea4acd62585820687 | [
"MIT"
] | null | null | null | vcr/files.py | charlax/vcrpy | 1d3fe5c33ecf06b494fa6cbea4acd62585820687 | [
"MIT"
] | null | null | null | vcr/files.py | charlax/vcrpy | 1d3fe5c33ecf06b494fa6cbea4acd62585820687 | [
"MIT"
] | null | null | null | import os
import yaml
from .cassette import Cassette
def load_cassette(cassette_path):
try:
pc = yaml.load(open(cassette_path))
cassette = Cassette(pc)
return cassette
except IOError:
return None
def save_cassette(cassette_path, cassette):
dirname, filename = os.path.spli... | 24.571429 | 60 | 0.689922 | import os
import yaml
from .cassette import Cassette
def load_cassette(cassette_path):
try:
pc = yaml.load(open(cassette_path))
cassette = Cassette(pc)
return cassette
except IOError:
return None
def save_cassette(cassette_path, cassette):
dirname, filename = os.path.spli... | true | true |
79047d8bf589e4ad1e9f31097f15d6aed736d7d8 | 831 | py | Python | examples/plot_raw_minimpl.py | jrobrien91/ACT | 604b93d75366d23029f89d88df9053d52825c214 | [
"BSD-3-Clause"
] | 9 | 2019-03-11T19:41:34.000Z | 2019-09-17T08:34:19.000Z | examples/plot_raw_minimpl.py | jrobrien91/ACT | 604b93d75366d23029f89d88df9053d52825c214 | [
"BSD-3-Clause"
] | 127 | 2019-03-18T12:24:17.000Z | 2020-01-06T20:53:06.000Z | examples/plot_raw_minimpl.py | jrobrien91/ACT | 604b93d75366d23029f89d88df9053d52825c214 | [
"BSD-3-Clause"
] | 15 | 2019-03-11T15:30:56.000Z | 2019-11-01T19:10:11.000Z | """
Read and plot a PPI from raw mini-MPL data
------------------------------------------
Example of how to read in raw data from the mini-MPL
and plot out the PPI by converting it to PyART
Author: Adam Theisen
"""
from matplotlib import pyplot as plt
import act
try:
import pyart
PYART_AVAILABLE = True
e... | 22.459459 | 86 | 0.701564 |
from matplotlib import pyplot as plt
import act
try:
import pyart
PYART_AVAILABLE = True
except ImportError:
PYART_AVAILABLE = False
files = act.tests.sample_files.EXAMPLE_SIGMA_MPLV5
obj = act.io.mpl.read_sigma_mplv5(files)
radar = act.utils.create_pyart_obj(
obj, azimuth='azimuth_angle', elev... | true | true |
79047e67658193682158b84ee11a1f02342e0e08 | 2,992 | py | Python | chemfiles/selection.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 2 | 2019-04-17T11:13:13.000Z | 2021-04-28T20:34:49.000Z | chemfiles/selection.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 15 | 2016-02-19T21:51:33.000Z | 2021-07-21T09:01:52.000Z | chemfiles/selection.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 3 | 2020-06-16T08:41:24.000Z | 2021-07-22T14:51:33.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64
import numpy as np
from .utils import CxxPointer, _call_with_growing_buffer
from .ffi import chfl_match
class Selection(CxxPointer):
"""
Select atoms in a :py:class:`Frame` with a sele... | 34.390805 | 88 | 0.612634 |
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64
import numpy as np
from .utils import CxxPointer, _call_with_growing_buffer
from .ffi import chfl_match
class Selection(CxxPointer):
def __init__(self, selection):
ptr = self.ffi.chfl_selection(selecti... | true | true |
79047eb85e32823c2a4d4d6af7c2191e1a040f52 | 3,617 | py | Python | osdf/adapters/policy/utils.py | onap/optf-osdf | 2b9e7f4fca3d510a201283a8561f6ff3424f5fd6 | [
"Apache-2.0"
] | 3 | 2019-04-15T13:33:57.000Z | 2019-10-21T17:19:19.000Z | osdf/adapters/policy/utils.py | onap/optf-osdf | 2b9e7f4fca3d510a201283a8561f6ff3424f5fd6 | [
"Apache-2.0"
] | null | null | null | osdf/adapters/policy/utils.py | onap/optf-osdf | 2b9e7f4fca3d510a201283a8561f6ff3424f5fd6 | [
"Apache-2.0"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) 2015-2017 AT&T Intellectual Property
#
# 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
#
# ... | 46.371795 | 123 | 0.685651 |
import copy
import json
from collections import defaultdict
import itertools
from osdf.utils.programming_utils import dot_notation, list_flatten
def group_policies_gen(flat_policies, config):
filtered_policies = defaultdict(list)
policy_name = []
policies = [x for x in flat_policies if x... | true | true |
79047f4ad8f97f702fadf845f7f020c37c878e91 | 3,515 | py | Python | userbot/modules/gabut.py | abinaya0101/Kampang-Bot | 281ce0e11a8d3f87b57ff87c0358c30bf9a8d5b5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/gabut.py | abinaya0101/Kampang-Bot | 281ce0e11a8d3f87b57ff87c0358c30bf9a8d5b5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/gabut.py | abinaya0101/Kampang-Bot | 281ce0e11a8d3f87b57ff87c0358c30bf9a8d5b5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from datetime import datetime
import time
from time import sleep
from platform import uname
from userbot import ALIVE_NAME, CMD_HELP, StartTime
from userbot.events import register
# ================= CONSTANT =================
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else uname().node
# ============================... | 29.788136 | 283 | 0.572688 | from datetime import datetime
import time
from time import sleep
from platform import uname
from userbot import ALIVE_NAME, CMD_HELP, StartTime
from userbot.events import register
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else uname().node
async def get_readable_time(seconds: int) -> str:
count = 0
up_ti... | true | true |
79047f4f73742dccd3820d22f7afa068a36e9b11 | 10,702 | py | Python | luigi/contrib/scalding.py | soxofaan/luigi | 865cc4e97540b5adc19898cbb5f31f39bff791de | [
"Apache-2.0"
] | 5 | 2015-02-26T18:52:56.000Z | 2017-07-07T05:47:18.000Z | luigi/contrib/scalding.py | RileyEv/luigi | 00a094ddf6438aca5b481ac94bf03c2b7d8d2f73 | [
"Apache-2.0"
] | 9 | 2017-03-22T23:38:48.000Z | 2019-01-28T21:13:06.000Z | luigi/contrib/scalding.py | RileyEv/luigi | 00a094ddf6438aca5b481ac94bf03c2b7d8d2f73 | [
"Apache-2.0"
] | 9 | 2015-01-26T14:47:57.000Z | 2020-07-07T17:01:25.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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 law... | 34.411576 | 100 | 0.611942 |
import logging
import os
import re
import subprocess
import warnings
from luigi import six
import luigi.configuration
import luigi.contrib.hadoop
import luigi.contrib.hadoop_jar
import luigi.contrib.hdfs
from luigi import LocalTarget
from luigi.task import flatten
logger = logging.getLogger('luigi-i... | true | true |
79047f716fd6e7825a04bd9da395cccf0a71fea9 | 1,690 | py | Python | cmsplugin_blocks/migrations/0004_change_image_as_filefield_.py | emencia/cmsplugin-blocks | 7ec99afd542948aef5d9069bd001729f5c14bded | [
"MIT"
] | 1 | 2019-04-14T01:30:37.000Z | 2019-04-14T01:30:37.000Z | cmsplugin_blocks/migrations/0004_change_image_as_filefield_.py | emencia/cmsplugin-blocks | 7ec99afd542948aef5d9069bd001729f5c14bded | [
"MIT"
] | 16 | 2018-02-19T11:13:15.000Z | 2022-02-05T00:10:41.000Z | cmsplugin_blocks/migrations/0004_change_image_as_filefield_.py | emencia/cmsplugin-blocks | 7ec99afd542948aef5d9069bd001729f5c14bded | [
"MIT"
] | null | null | null | # Generated by Django 2.1.9 on 2020-03-20 00:50
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_blocks', '0003_slideitem_title'),
]
operations = [
migrations.AlterField(
model_name='al... | 48.285714 | 258 | 0.646154 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_blocks', '0003_slideitem_title'),
]
operations = [
migrations.AlterField(
model_name='albumitem',
name='image',
... | true | true |
79047ff73d39d72ec6d8b62aeae198e9367c9603 | 4,076 | py | Python | benchmark/startQiskit953.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit953.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit953.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=45
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 30.878788 | 82 | 0.603042 |
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def build_oracle(n: int, f) -... | true | true |
7904801ab0a3f99c8b161f5051596acd78dda87a | 3,154 | py | Python | src/_query.py | SlumberDemon/AioTube | c2423175d58619a0998a67c9e3c059bbfd5659b3 | [
"MIT"
] | null | null | null | src/_query.py | SlumberDemon/AioTube | c2423175d58619a0998a67c9e3c059bbfd5659b3 | [
"MIT"
] | null | null | null | src/_query.py | SlumberDemon/AioTube | c2423175d58619a0998a67c9e3c059bbfd5659b3 | [
"MIT"
] | null | null | null | import re
from ._video import Video
from ._channel import Channel
from ._playlist import Playlist
from ._videobulk import _VideoBulk
from ._channelbulk import _ChannelBulk
from ._playlistbulk import _PlaylistBulk
from ._auxiliary import _parser, _filter, _src
class Search:
def __init__(self):
pass
@... | 40.435897 | 107 | 0.640457 | import re
from ._video import Video
from ._channel import Channel
from ._playlist import Playlist
from ._videobulk import _VideoBulk
from ._channelbulk import _ChannelBulk
from ._playlistbulk import _PlaylistBulk
from ._auxiliary import _parser, _filter, _src
class Search:
def __init__(self):
pass
@... | true | true |
7904808e2822971be1e1963ca0e5bea097efa146 | 13,590 | py | Python | texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 43.980583 | 161 | 0.634216 |
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.grpc_helpers
import grpc
from google.cloud.texttospeech_v1beta1.gapic import e... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.