hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f750db35aa365fe21ffd43527f1b9892e385115b | 5,051 | py | Python | discord/bot.py | RPANBot/RPANBot | dc0345e40667cb510490ffd32197f3998c5efe2f | [
"Apache-2.0"
] | 5 | 2020-08-25T23:12:33.000Z | 2021-09-06T20:38:44.000Z | discord/bot.py | b1uejay27/RPANBot | 782ad9bc9f968fd52036ef4d541afd9df8c89025 | [
"Apache-2.0"
] | 2 | 2020-10-30T18:23:44.000Z | 2021-09-19T22:07:12.000Z | discord/bot.py | b1uejay27/RPANBot | 782ad9bc9f968fd52036ef4d541afd9df8c89025 | [
"Apache-2.0"
] | 3 | 2022-03-08T19:50:01.000Z | 2022-03-23T23:13:46.000Z | """
Copyright 2020 RPANBot
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | 33.230263 | 95 | 0.628984 | from discord import Activity, ActivityType, Intents, TextChannel, Guild
from discord.ext.commands import Bot, check, when_mentioned_or
from typing import Union
from traceback import print_exc
from expiringdict import ExpiringDict
from utils.database.models.exclusions import ExcludedUser
from utils.database.models.c... | true | true |
f750dcd5e051c946c4d5874a5a04476502bc9da7 | 5,308 | py | Python | mysite/polls/tests.py | vipul43/django | a4190399868306e3323ac53d6b4ff93ece93d7c9 | [
"MIT"
] | 1 | 2022-02-22T12:18:33.000Z | 2022-02-22T12:18:33.000Z | mysite/polls/tests.py | vipul43/django | a4190399868306e3323ac53d6b4ff93ece93d7c9 | [
"MIT"
] | 6 | 2021-04-08T20:57:25.000Z | 2022-02-10T05:41:10.000Z | mysite/polls/tests.py | vipul43/django | a4190399868306e3323ac53d6b4ff93ece93d7c9 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
import datetime
from polls.models import Question
from django.utils import timezone
from django.urls import reverse
#creating tests for Question model
class QuestionModelTests(TestCase):
def test_was_published_recently_with_future_question(self):
... | 40.519084 | 141 | 0.682366 | from django.test import TestCase
import datetime
from polls.models import Question
from django.utils import timezone
from django.urls import reverse
class QuestionModelTests(TestCase):
def test_was_published_recently_with_future_question(self):
time = timezone.now() + datetime.timedelta(days=30)
... | true | true |
f750de8888138a300a419129b809300724e4c26d | 75,189 | py | Python | prev_ob_models/KaplanLansner2014/simulation_parameters.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | 5 | 2019-10-03T14:49:02.000Z | 2022-01-13T13:37:34.000Z | prev_ob_models/KaplanLansner2014/simulation_parameters.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | 4 | 2019-12-30T15:57:24.000Z | 2020-10-07T22:42:50.000Z | prev_ob_models/KaplanLansner2014/simulation_parameters.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | 2 | 2020-05-19T20:12:48.000Z | 2020-11-04T17:17:44.000Z | import json
import numpy as np
import numpy.random as rnd
import os
class parameter_storage(object):
"""
This class contains the simulation parameters in a dictionary called params.
"""
def __init__(self, params_fn=None):
"""
If a filename is given, it loads the json file and returns t... | 72.576255 | 268 | 0.659006 | import json
import numpy as np
import numpy.random as rnd
import os
class parameter_storage(object):
"""
This class contains the simulation parameters in a dictionary called params.
"""
def __init__(self, params_fn=None):
"""
If a filename is given, it loads the json file and returns t... | false | true |
f750df974e30177939cd21a58ee1c7d1d1983f41 | 10,708 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/19-extending_bound_17.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/19-extending_bound_17.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/19-extending_bound_17.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 35.223684 | 89 | 0.624206 | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | true | true |
f750e01c6280bc3edb0a5f590e2dd2820078d8c1 | 2,112 | py | Python | docs/source/conf.py | zhenghh04/vol-cache | fb05201d5a01b8684a9dff8269fd2f9556de49c9 | [
"BSD-3-Clause"
] | 4 | 2020-12-14T21:58:43.000Z | 2022-02-02T05:28:26.000Z | docs/source/conf.py | zhenghh04/vol-cache | fb05201d5a01b8684a9dff8269fd2f9556de49c9 | [
"BSD-3-Clause"
] | 3 | 2020-12-12T00:23:33.000Z | 2021-05-11T16:12:34.000Z | docs/source/conf.py | zhenghh04/vol-cache | fb05201d5a01b8684a9dff8269fd2f9556de49c9 | [
"BSD-3-Clause"
] | 3 | 2021-01-22T15:27:20.000Z | 2021-08-10T14:56:00.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 37.052632 | 109 | 0.678504 |
project = 'HDF5 Cache I/O VOL Connector'
copyright = '2021, Huihuo Zheng, Venkatram Vishwanath, Houjun Tang, Quincey Koziol, Suren Byna, John Mainzer'
author = 'Huihuo Zheng, Venkatram Vishwanath, Houjun Tang, Quincey Koziol, Suren Byna'
release = '0.1'
extensions = ['sphinx.ext.autosectionlabel']
pygments_st... | true | true |
f750e0577ebf4eff9efd052318a85f30497a3404 | 212 | py | Python | Incident-Response/Tools/dfirtrack/dfirtrack_main/importer/file/csv_importer_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_main/importer/file/csv_importer_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_main/importer/file/csv_importer_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | from django import forms
class SystemImporterFileCsvForm(forms.Form):
# file upload field (variable is used in request object)
systemcsv = forms.FileField(
label = 'CSV with systems (*)',
)
| 23.555556 | 60 | 0.688679 | from django import forms
class SystemImporterFileCsvForm(forms.Form):
systemcsv = forms.FileField(
label = 'CSV with systems (*)',
)
| true | true |
f750e0702420868773169bc3825efae806bc38d4 | 52 | py | Python | web/apps/courts/__init__.py | EasySport/easysport | fa32ad6cdbf1f3e861d7eecf4d4f881deee43910 | [
"MIT"
] | 1 | 2018-05-23T15:58:40.000Z | 2018-05-23T15:58:40.000Z | web/apps/courts/__init__.py | EasySport/easysport | fa32ad6cdbf1f3e861d7eecf4d4f881deee43910 | [
"MIT"
] | 1 | 2018-05-24T11:30:35.000Z | 2018-05-24T11:30:35.000Z | web/apps/courts/__init__.py | EasySport/easysport | fa32ad6cdbf1f3e861d7eecf4d4f881deee43910 | [
"MIT"
] | null | null | null | default_app_config = "apps.courts.apps.CourtsConfig" | 52 | 52 | 0.846154 | default_app_config = "apps.courts.apps.CourtsConfig" | true | true |
f750e2d45f1941eaa63bad21c4ead2d64e033651 | 8,982 | py | Python | src/hanlendar/gui/dataobject.py | anetczuk/hanlendar | 940f2ca52f9d2bb601ffd1fa0332c6e31aaf854f | [
"MIT"
] | null | null | null | src/hanlendar/gui/dataobject.py | anetczuk/hanlendar | 940f2ca52f9d2bb601ffd1fa0332c6e31aaf854f | [
"MIT"
] | null | null | null | src/hanlendar/gui/dataobject.py | anetczuk/hanlendar | 940f2ca52f9d2bb601ffd1fa0332c6e31aaf854f | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... | 36.512195 | 91 | 0.670563 |
import os
import logging
from datetime import date
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtCore import QDate
from PyQt5.QtWidgets import QWidget, QUndoStack
from PyQt5.QtWidgets import QDialog
from hanlendar.gui.widget.taskdialog import TaskDialog
from hanlendar.gui.widget.tododialog import ToDoDia... | true | true |
f750e30c4991c96cda7995ac565e9bcfe9a00927 | 6,390 | py | Python | JumpScale9AYS/jobcontroller/Run.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 4 | 2017-06-07T08:10:06.000Z | 2017-11-10T02:20:38.000Z | JumpScale9AYS/jobcontroller/Run.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 242 | 2017-05-18T10:51:48.000Z | 2019-09-18T15:09:47.000Z | JumpScale9AYS/jobcontroller/Run.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 5 | 2017-06-16T15:43:25.000Z | 2017-09-29T12:48:06.000Z | import colored_traceback
from .RunStep import RunStep
from js9 import j
import json
import aiohttp
colored_traceback.add_hook(always=True)
RETRY_DELAY = [10, 30, 60, 300, 600, 1800] # time of each retry in seconds, total: 46min 10sec
class Run:
def __init__(self, model):
self.lastnr = 0
self.log... | 31.323529 | 125 | 0.54507 | import colored_traceback
from .RunStep import RunStep
from js9 import j
import json
import aiohttp
colored_traceback.add_hook(always=True)
RETRY_DELAY = [10, 30, 60, 300, 600, 1800]
class Run:
def __init__(self, model):
self.lastnr = 0
self.logger = j.atyourservice.server.logger
self.mod... | true | true |
f750e30d3fa0ee8e7f30b74f62e36741533842f3 | 599 | py | Python | gamestonk_terminal/economy/alphavantage_model.py | clairvoyant/GamestonkTerminal | 7b40cfe61b32782e36f5de8a08d075532a08c294 | [
"MIT"
] | 1 | 2021-12-04T13:21:40.000Z | 2021-12-04T13:21:40.000Z | gamestonk_terminal/economy/alphavantage_model.py | clairvoyant/GamestonkTerminal | 7b40cfe61b32782e36f5de8a08d075532a08c294 | [
"MIT"
] | null | null | null | gamestonk_terminal/economy/alphavantage_model.py | clairvoyant/GamestonkTerminal | 7b40cfe61b32782e36f5de8a08d075532a08c294 | [
"MIT"
] | null | null | null | """ Alpha Vantage Model """
__docformat__ = "numpy"
import pandas as pd
from alpha_vantage.sectorperformance import SectorPerformances
from gamestonk_terminal import config_terminal as cfg
def get_sector_data() -> pd.DataFrame:
"""Get real-time performance sector data
Returns
----------
df_sectors ... | 24.958333 | 62 | 0.714524 | __docformat__ = "numpy"
import pandas as pd
from alpha_vantage.sectorperformance import SectorPerformances
from gamestonk_terminal import config_terminal as cfg
def get_sector_data() -> pd.DataFrame:
sector_perf = SectorPerformances(
key=cfg.API_KEY_ALPHAVANTAGE, output_format="pandas"
)
df_... | true | true |
f750e388ca273b3e7cf02ed43d766901fc6243bd | 1,765 | py | Python | haiku2.py | phalladar/SCOTUSHaikus | 26f33d0e9326afd51bb37207b72444e5e30c25b5 | [
"BSD-3-Clause"
] | 1 | 2022-02-05T09:27:18.000Z | 2022-02-05T09:27:18.000Z | haiku2.py | phalladar/SCOTUSHaikus | 26f33d0e9326afd51bb37207b72444e5e30c25b5 | [
"BSD-3-Clause"
] | null | null | null | haiku2.py | phalladar/SCOTUSHaikus | 26f33d0e9326afd51bb37207b72444e5e30c25b5 | [
"BSD-3-Clause"
] | null | null | null | from haikufinder import *
from nltk.util import ngrams
import random, re
tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
# theText = ['on others" or that require "the general public [to] pick up the tab.', 'For good reason, we have repeatedly refused to take such a step.', 'But the Lee Court made two ... | 31.517857 | 374 | 0.709348 | from haikufinder import *
from nltk.util import ngrams
import random, re
tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
# print correctSylables
def findAllHaikus(theText): # identifies all Haikus in a text
correctSylables = []
allHaikus = []
sentences = tokenizer.tokenize(theText)
for i in sent... | false | true |
f750e3ee0d36fcb52baff91688815196a0dda783 | 106,837 | py | Python | arelle/ModelDocument.py | hamscher/Arelle | 64c1beddcc7163e571011faf07a03d8ffe18bb78 | [
"Apache-2.0"
] | null | null | null | arelle/ModelDocument.py | hamscher/Arelle | 64c1beddcc7163e571011faf07a03d8ffe18bb78 | [
"Apache-2.0"
] | null | null | null | arelle/ModelDocument.py | hamscher/Arelle | 64c1beddcc7163e571011faf07a03d8ffe18bb78 | [
"Apache-2.0"
] | null | null | null | '''
Created on Oct 3, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os, io, sys, traceback
from collections import defaultdict
from decimal import Decimal
from lxml import etree
from xml.sax import SAXParseException
from arelle import (PackageManager, X... | 57.532041 | 183 | 0.604463 | import os, io, sys, traceback
from collections import defaultdict
from decimal import Decimal
from lxml import etree
from xml.sax import SAXParseException
from arelle import (PackageManager, XbrlConst, XmlUtil, UrlUtil, ValidateFilingText,
XhtmlValidate, XmlValidateSchema)
from arelle.ModelObject i... | true | true |
f750e4970a85c685808782647ee3e6d640dd1589 | 5,114 | py | Python | cajas/webclient/views/partner_create.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/webclient/views/partner_create.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/webclient/views/partner_create.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null |
from django.db import IntegrityError
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import Group
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views.generic import Vi... | 41.577236 | 123 | 0.647634 |
from django.db import IntegrityError
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import Group
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views.generic import Vi... | true | true |
f750e60d70eaa8beb8aadc004bcaf29c8d03f85b | 1,760 | py | Python | edurange_refactored/commands.py | kovada06/edurange-flask | 6d17023a5dd7a3f3ba9afd1b7f504a1cc4ff51b0 | [
"MIT"
] | null | null | null | edurange_refactored/commands.py | kovada06/edurange-flask | 6d17023a5dd7a3f3ba9afd1b7f504a1cc4ff51b0 | [
"MIT"
] | null | null | null | edurange_refactored/commands.py | kovada06/edurange-flask | 6d17023a5dd7a3f3ba9afd1b7f504a1cc4ff51b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Click commands."""
import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, "tests")
@click.command()
def test():
"""Run the tests."""
... | 26.666667 | 86 | 0.630114 | import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, "tests")
@click.command()
def test():
import pytest
rv = pytest.main([TEST_PATH, "--verbose"])
e... | true | true |
f750e6b8325b0f45da4787ffc4c4cb81848ebb70 | 6,123 | py | Python | pydmd/hodmd.py | mfarthin/PyDMD | ac2c800cfa9fb23ab110d2b2957b5681e2aa5055 | [
"MIT"
] | null | null | null | pydmd/hodmd.py | mfarthin/PyDMD | ac2c800cfa9fb23ab110d2b2957b5681e2aa5055 | [
"MIT"
] | null | null | null | pydmd/hodmd.py | mfarthin/PyDMD | ac2c800cfa9fb23ab110d2b2957b5681e2aa5055 | [
"MIT"
] | null | null | null | """
Derived module from dmdbase.py for higher order dmd.
Reference:
- S. L Clainche, J. M. Vega, Higher Order Dynamic Mode Decomposition.
Journal on Applied Dynamical Systems, 16(2), 882-925, 2017.
"""
import numpy as np
from .dmdbase import DMDBase
from .utils import compute_tlsq
class HODMD(DMDBase):
"""
... | 42.520833 | 106 | 0.647232 | import numpy as np
from .dmdbase import DMDBase
from .utils import compute_tlsq
class HODMD(DMDBase):
def __init__(self, svd_rank=0, tlsq_rank=0, exact=False, opt=False,
rescale_mode=None, forward_backward=False, d=1, sorted_eigs=False,
reconstruction_method='first'):
super(HODMD, self).... | true | true |
f750e74813e3f900730609bbf9f90d1c6ef9d6f1 | 10,259 | py | Python | GenerativeModelling/gen_autoencoder_routine.py | martahal/DeepLearning | c3a70a117c2f3417832c7caecd3baf6cd9862ae2 | [
"MIT"
] | null | null | null | GenerativeModelling/gen_autoencoder_routine.py | martahal/DeepLearning | c3a70a117c2f3417832c7caecd3baf6cd9862ae2 | [
"MIT"
] | null | null | null | GenerativeModelling/gen_autoencoder_routine.py | martahal/DeepLearning | c3a70a117c2f3417832c7caecd3baf6cd9862ae2 | [
"MIT"
] | null | null | null | from GenerativeModelling.Autoencoder import Autoencoder
from GenerativeModelling.Encoder import Encoder
from GenerativeModelling.Decoder import Decoder
from GenerativeModelling.verification_net import VerificationNet
from SemiSupervisedLearning import visualisations
from GenerativeModelling.Trainer import Trainer
from ... | 43.470339 | 194 | 0.685739 | from GenerativeModelling.Autoencoder import Autoencoder
from GenerativeModelling.Encoder import Encoder
from GenerativeModelling.Decoder import Decoder
from GenerativeModelling.verification_net import VerificationNet
from SemiSupervisedLearning import visualisations
from GenerativeModelling.Trainer import Trainer
from ... | true | true |
f750e75095b6109d9f03d40d0e7fc6d1c7f947f9 | 9,580 | py | Python | docs/conf.py | uwcirg/flask-oidc | ed4eb2083493e35eee3b60f4d98295d82f9454ce | [
"BSD-2-Clause"
] | null | null | null | docs/conf.py | uwcirg/flask-oidc | ed4eb2083493e35eee3b60f4d98295d82f9454ce | [
"BSD-2-Clause"
] | null | null | null | docs/conf.py | uwcirg/flask-oidc | ed4eb2083493e35eee3b60f4d98295d82f9454ce | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Flask-OIDC documentation build configuration file, created by
# sphinx-quickstart on Tue May 17 10:16:49 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | 32.585034 | 80 | 0.715971 |
import sys
import os
sys.path.insert(0, os.path.abspath('.'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Flask-OIDC'
copyright = u'2016, Patrick Uiterwijk'
author = u'Patric... | true | true |
f750e829482340dce7b86d7593f9734a28f26542 | 3,068 | py | Python | my_classes/Tuples/.history/name_tuples_20210722113216.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/Tuples/.history/name_tuples_20210722113216.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/Tuples/.history/name_tuples_20210722113216.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Tuple as Data Structure
We have see how we interpreted tuples as data structures
The position of the object contained in the tuple gives it meaning
For example, we can represent a 2D coordinate as: (10, 20)
x y
If pt is a position tuple, we can re... | 32.294737 | 154 | 0.607236 | """ Tuple as Data Structure
We have see how we interpreted tuples as data structures
The position of the object contained in the tuple gives it meaning
For example, we can represent a 2D coordinate as: (10, 20)
x y
If pt is a position tuple, we can re... | false | true |
f750e8ba9db161e57ccd9bfd2ce4ac6fd2251aa9 | 604 | py | Python | src/deploy/ocp_deployer/settings/__init__.py | kamlesh6808/JetPack | 54871b307cc7385939dd89f9bb5e9ed9bb3036fe | [
"Apache-2.0"
] | 31 | 2017-11-14T02:21:18.000Z | 2022-02-16T07:28:54.000Z | src/deploy/ocp_deployer/settings/__init__.py | kamlesh6808/JetPack | 54871b307cc7385939dd89f9bb5e9ed9bb3036fe | [
"Apache-2.0"
] | 324 | 2018-01-10T16:52:25.000Z | 2021-09-23T19:02:50.000Z | src/deploy/ocp_deployer/settings/__init__.py | kamlesh6808/JetPack | 54871b307cc7385939dd89f9bb5e9ed9bb3036fe | [
"Apache-2.0"
] | 215 | 2017-11-01T15:50:16.000Z | 2022-02-16T07:28:56.000Z | # Copyright (c) 2015-2021 Dell Inc. or its subsidiaries.
#
# 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 l... | 40.266667 | 74 | 0.758278 | true | true | |
f750e8d668489f770a5bbf3d19c576a3c110e725 | 254 | py | Python | winnow/utils/multiproc.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 26 | 2019-12-16T21:22:14.000Z | 2022-03-25T16:05:32.000Z | winnow/utils/multiproc.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 325 | 2019-10-28T16:24:45.000Z | 2022-03-31T13:12:15.000Z | winnow/utils/multiproc.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 9 | 2019-10-09T16:20:38.000Z | 2021-12-22T18:44:45.000Z | import multiprocessing as _std_multiprocessing
import billiard as _billiard
# Determine which multiprocessing API to use
if _std_multiprocessing.current_process().daemon:
multiprocessing = _billiard
else:
multiprocessing = _std_multiprocessing
| 25.4 | 49 | 0.830709 | import multiprocessing as _std_multiprocessing
import billiard as _billiard
if _std_multiprocessing.current_process().daemon:
multiprocessing = _billiard
else:
multiprocessing = _std_multiprocessing
| true | true |
f750e92ecafbd0902ffc094875fc623ff1982267 | 749 | py | Python | daisychain/channel_github/urls.py | daisychainme/daisychain | 245d0041f1efd2d6cc110f60aebf2e2dee98bcdb | [
"MIT"
] | 5 | 2016-09-27T10:44:59.000Z | 2022-03-29T08:16:44.000Z | daisychain/channel_github/urls.py | daisychainme/daisychain | 245d0041f1efd2d6cc110f60aebf2e2dee98bcdb | [
"MIT"
] | null | null | null | daisychain/channel_github/urls.py | daisychainme/daisychain | 245d0041f1efd2d6cc110f60aebf2e2dee98bcdb | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from channel_github import views
urlpatterns = [
url(r'^authenticate',
views.StartAuthenticationView.as_view(),
name='connect'),
url(r'^oauth-callback',
views.CallbackView.as_view(),
name='ca... | 27.740741 | 52 | 0.6502 | from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from channel_github import views
urlpatterns = [
url(r'^authenticate',
views.StartAuthenticationView.as_view(),
name='connect'),
url(r'^oauth-callback',
views.CallbackView.as_view(),
name='ca... | true | true |
f750e939c41516f25c0dce6144ce737dc94e4860 | 373 | py | Python | main.py | DyakonovDmitriy/for-remember | 904efa66e35fea23751a34e68039182e45aa62ae | [
"Unlicense"
] | null | null | null | main.py | DyakonovDmitriy/for-remember | 904efa66e35fea23751a34e68039182e45aa62ae | [
"Unlicense"
] | null | null | null | main.py | DyakonovDmitriy/for-remember | 904efa66e35fea23751a34e68039182e45aa62ae | [
"Unlicense"
] | null | null | null | import requests
import json
url='https://www.mail.ru'
print('hello', 'world', 123, sep=':', end=' !!! \n')
st='Марка авто'
age=16
print(type(st))
print(type(age))
engain_volume=1.6
print(type(engain_volume))
a=True
print(type(a))
a=int(input('Введите первое число: '))
b=int(input('Введите второе число: '))
print(a+b)... | 14.92 | 52 | 0.662198 | import requests
import json
url='https://www.mail.ru'
print('hello', 'world', 123, sep=':', end=' !!! \n')
st='Марка авто'
age=16
print(type(st))
print(type(age))
engain_volume=1.6
print(type(engain_volume))
a=True
print(type(a))
a=int(input('Введите первое число: '))
b=int(input('Введите второе число: '))
print(a+b)... | true | true |
f750ea2414b808d0c0468efa2920bb6e618a2362 | 269 | py | Python | sqlalchemy_bigint_id/testapp/db.py | alvinchow86/sqlalchemy-postgres-bigint-ids | 0c84784a95aebedf64c4fe662e88a8311e1866c8 | [
"MIT"
] | 3 | 2021-03-08T20:42:35.000Z | 2021-12-06T23:19:23.000Z | sqlalchemy_bigint_id/testapp/db.py | alvinchow86/sqlalchemy-postgres-bigid | 0c84784a95aebedf64c4fe662e88a8311e1866c8 | [
"MIT"
] | null | null | null | sqlalchemy_bigint_id/testapp/db.py | alvinchow86/sqlalchemy-postgres-bigid | 0c84784a95aebedf64c4fe662e88a8311e1866c8 | [
"MIT"
] | null | null | null | import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
database_url = os.getenv('DATABASE_URL')
Base = declarative_base()
engine = create_engine(database_url)
from sqlalchemy_bigint_id.testapp import models # noqa
| 20.692308 | 56 | 0.821561 | import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
database_url = os.getenv('DATABASE_URL')
Base = declarative_base()
engine = create_engine(database_url)
from sqlalchemy_bigint_id.testapp import models | true | true |
f750ea61ff14d07c1794000e40183091614e0bfb | 2,043 | py | Python | jxa/Progress.py | jkedra/jxa | 380714b954d0f2549e02404d50f408ed7f0999fe | [
"MIT"
] | null | null | null | jxa/Progress.py | jkedra/jxa | 380714b954d0f2549e02404d50f408ed7f0999fe | [
"MIT"
] | null | null | null | jxa/Progress.py | jkedra/jxa | 380714b954d0f2549e02404d50f408ed7f0999fe | [
"MIT"
] | null | null | null | import time
import math
def time_sec():
return int(time.time())
class Progress:
"""
Progress reporting.
Usage:
from jxa.Progress import Progress
from time import sleep
p = Progress(frequency=4)
max = 9000_000
for i in range(0,max,1000):
sleep(1/300)
p.print(i,max... | 26.532468 | 68 | 0.559471 | import time
import math
def time_sec():
return int(time.time())
class Progress:
def __init__(self, frequency) -> None:
self.last_progress = time_sec()
self.frequency = frequency
@staticmethod
def human_readable_byte_count(bytes, si: bool = False):
unit = 1000 if si else 1024... | true | true |
f750ebbc223ea8963cb528f81db2e21ad72fc78c | 5,931 | py | Python | Natural_and_Artificial/MARCC/test_aug500_const_1.py | mlepori1/Representations_Of_Syntax | 7a09004a1e443618ee6b1645e54224766c3965f1 | [
"MIT"
] | 5 | 2020-05-04T02:08:20.000Z | 2020-06-21T08:01:58.000Z | Natural_and_Artificial/MARCC/test_aug500_const_1.py | mlepori1/Representations_Of_Syntax | 7a09004a1e443618ee6b1645e54224766c3965f1 | [
"MIT"
] | null | null | null | Natural_and_Artificial/MARCC/test_aug500_const_1.py | mlepori1/Representations_Of_Syntax | 7a09004a1e443618ee6b1645e54224766c3965f1 | [
"MIT"
] | 1 | 2020-05-04T10:04:31.000Z | 2020-05-04T10:04:31.000Z | import sys
if not sys.warnoptions:
import warnings
warnings.simplefilter("ignore")
import numpy as np
import csv
import copy
from torch import optim
from torch.nn import BCELoss
from torch.optim import Adam
import torch
from random import shuffle
import random
import models
import pickle
embed_matrix = p... | 29.80402 | 117 | 0.619626 | import sys
if not sys.warnoptions:
import warnings
warnings.simplefilter("ignore")
import numpy as np
import csv
import copy
from torch import optim
from torch.nn import BCELoss
from torch.optim import Adam
import torch
from random import shuffle
import random
import models
import pickle
embed_matrix = p... | true | true |
f750ec3cce4399c8d854f85d849eaa49bcaf00fd | 25,361 | py | Python | directord/tests/test_mixin.py | peznauts/directord | 881eff5e4aeed40bcc229c58a2c055b193006295 | [
"Apache-2.0"
] | null | null | null | directord/tests/test_mixin.py | peznauts/directord | 881eff5e4aeed40bcc229c58a2c055b193006295 | [
"Apache-2.0"
] | null | null | null | directord/tests/test_mixin.py | peznauts/directord | 881eff5e4aeed40bcc229c58a2c055b193006295 | [
"Apache-2.0"
] | null | null | null | # Copyright Peznauts <kevin@cloudnull.com>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 37.795827 | 152 | 0.511494 |
import json
import unittest
from unittest.mock import patch
from directord import mixin
from directord import tests
TEST_FINGER_PRINTS = """count parent verb exec job
------- -------------------------------------------------------- ------ -------- -... | true | true |
f750ecd19116acbbb74427e52ca3e8c7ce40518f | 5,356 | py | Python | autowoe/lib/types_handler/types_handler.py | VitaliyPavlyukov/AutoMLWhitebox | 4acd55624490707a7fbf036631533e29123bb1bd | [
"Apache-2.0"
] | 53 | 2020-12-02T20:19:34.000Z | 2022-03-30T05:11:14.000Z | autowoe/lib/types_handler/types_handler.py | VitaliyPavlyukov/AutoMLWhitebox | 4acd55624490707a7fbf036631533e29123bb1bd | [
"Apache-2.0"
] | 8 | 2021-02-16T09:15:48.000Z | 2022-02-16T14:13:36.000Z | autowoe/lib/types_handler/types_handler.py | VitaliyPavlyukov/AutoMLWhitebox | 4acd55624490707a7fbf036631533e29123bb1bd | [
"Apache-2.0"
] | 8 | 2020-12-08T05:05:25.000Z | 2022-01-10T09:34:52.000Z | import collections
import pandas as pd
from typing import Dict, Hashable, Optional, Any
from copy import deepcopy
from .features_checkers_handlers import dates_handler, dates_checker, cat_checker
class TypesHandler:
"""
Класс для автоматического определения типов признаков.
Базовая имплементация порядк... | 32.658537 | 114 | 0.625093 | import collections
import pandas as pd
from typing import Dict, Hashable, Optional, Any
from copy import deepcopy
from .features_checkers_handlers import dates_handler, dates_checker, cat_checker
class TypesHandler:
def __init__(self,
train: pd.DataFrame,
public_features_type... | true | true |
f750ed170ddb6cdf23a4e5350adf69344918007f | 3,214 | py | Python | lens/sie/random.py | bombrun/GaiaLQSO | b4d787a4d80732cbb5a3762c34298f2430dd0540 | [
"CC-BY-4.0"
] | 1 | 2019-04-11T12:48:32.000Z | 2019-04-11T12:48:32.000Z | lens/sie/random.py | bombrun/GaiaLQSO | b4d787a4d80732cbb5a3762c34298f2430dd0540 | [
"CC-BY-4.0"
] | 2 | 2018-05-08T10:09:26.000Z | 2018-05-25T07:55:51.000Z | lens/sie/random.py | bombrun/GaiaLQSO | b4d787a4d80732cbb5a3762c34298f2430dd0540 | [
"CC-BY-4.0"
] | null | null | null | import numpy as np
import pandas as pd
import astropy.units as u
import healpy as hp
from lens.sie.plot import *
def angle2pixel(ra_deg,dec_deg):
""" return healpix index 12"""
phi = ra_deg * np.pi / 180
theta = np.pi/2 - (dec_deg * np.pi/180)
return hp.ang2pix(4096,theta,phi,nest=True)
def lensedQS... | 30.037383 | 94 | 0.609521 | import numpy as np
import pandas as pd
import astropy.units as u
import healpy as hp
from lens.sie.plot import *
def angle2pixel(ra_deg,dec_deg):
phi = ra_deg * np.pi / 180
theta = np.pi/2 - (dec_deg * np.pi/180)
return hp.ang2pix(4096,theta,phi,nest=True)
def lensedQSO(f,scale,w,y,dy,gy):
xs,ph... | true | true |
f750ed848c039b90f20b9719b0d50b0b384f500e | 662 | py | Python | ginger_arxiv/users/tests/test_urls.py | pjhoberman/ginger-arxiv | 5fcfd6c12bfb9342df48f7f609ad073a0fbea1bc | [
"MIT"
] | null | null | null | ginger_arxiv/users/tests/test_urls.py | pjhoberman/ginger-arxiv | 5fcfd6c12bfb9342df48f7f609ad073a0fbea1bc | [
"MIT"
] | null | null | null | ginger_arxiv/users/tests/test_urls.py | pjhoberman/ginger-arxiv | 5fcfd6c12bfb9342df48f7f609ad073a0fbea1bc | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from ginger_arxiv.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{... | 26.48 | 74 | 0.678248 | import pytest
from django.urls import resolve, reverse
from ginger_arxiv.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{... | true | true |
f750edb788d8a72d879cbafe57dc9e164c4dd545 | 1,654 | py | Python | cloudroast/compute/burn_in/test_rescue_server_burn_in.py | lmaycotte/cloudroast | c1835aa45e0e86c755d4b24b33e12ba30eee1995 | [
"Apache-2.0"
] | null | null | null | cloudroast/compute/burn_in/test_rescue_server_burn_in.py | lmaycotte/cloudroast | c1835aa45e0e86c755d4b24b33e12ba30eee1995 | [
"Apache-2.0"
] | null | null | null | cloudroast/compute/burn_in/test_rescue_server_burn_in.py | lmaycotte/cloudroast | c1835aa45e0e86c755d4b24b33e12ba30eee1995 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 32.431373 | 74 | 0.741233 |
from unittest2.suite import TestSuite
from cafe.drivers.unittest.decorators import tags
from cloudroast.compute.fixtures import ComputeFixture
def load_tests(loader, standard_tests, pattern):
suite = TestSuite()
suite.addTest(RescueServerBurnIn("test_rescue_server"))
suite.addTest(RescueServerBurnIn("t... | true | true |
f750edc75880d8e47601b1c4066b15cf1314e05c | 11,495 | py | Python | util/visualizer.py | DongChengdongHangZhou/CycleGAN-tiff | e13a4d702ac6ce3e13af4946a1bc6657c1a2089e | [
"BSD-3-Clause"
] | null | null | null | util/visualizer.py | DongChengdongHangZhou/CycleGAN-tiff | e13a4d702ac6ce3e13af4946a1bc6657c1a2089e | [
"BSD-3-Clause"
] | null | null | null | util/visualizer.py | DongChengdongHangZhou/CycleGAN-tiff | e13a4d702ac6ce3e13af4946a1bc6657c1a2089e | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
import tifffile as tiff
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_images(webpage, visuals, image_path, aspect_... | 46.538462 | 139 | 0.576338 | import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
import tifffile as tiff
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_images(webpage, visuals, image_path, aspect_... | true | true |
f750eec073aeb3a8bf3bda375aa71e8e64761367 | 476 | py | Python | pset_pandas_ext/101problems/solutions/p7.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 5 | 2019-04-08T20:05:37.000Z | 2019-12-04T20:48:45.000Z | pset_pandas_ext/101problems/solutions/p7.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 8 | 2019-04-15T15:16:05.000Z | 2022-02-12T10:33:32.000Z | pset_pandas_ext/101problems/solutions/p7.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 2 | 2019-04-10T00:14:42.000Z | 2020-02-26T20:35:21.000Z | """
7. How to get the items not common to both series A and series B?
"""
"""
Difficulty Level: L2
"""
"""
Get all items of ser1 and ser2 not common to both.
"""
"""
Input
"""
"""
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6, 7, 8])
"""
# Input
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6... | 19.04 | 65 | 0.605042 |
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6, 7, 8])
ser_u = pd.Series(np.union1d(ser1, ser2)) ser_i = pd.Series(np.intersect1d(ser1, ser2)) ser_u[~ser_u.isin(ser_i)] | true | true |
f750efbbb5b0cf1eb1a685ac9c66da42caaf56ff | 4,211 | py | Python | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | xhochy/dagster | 120269fb3b29b8c5e8943624df4b971e04f59b92 | [
"Apache-2.0"
] | 1 | 2019-11-25T19:03:32.000Z | 2019-11-25T19:03:32.000Z | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | xhochy/dagster | 120269fb3b29b8c5e8943624df4b971e04f59b92 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | xhochy/dagster | 120269fb3b29b8c5e8943624df4b971e04f59b92 | [
"Apache-2.0"
] | null | null | null | '''Test fixtures for dagster-airflow.
These make very heavy use of fixture dependency and scope. If you're unfamiliar with pytest
fixtures, read: https://docs.pytest.org/en/latest/fixture.html.
'''
# pylint doesn't understand the way that pytest constructs fixture dependnecies
# pylint: disable=redefined-outer-name, u... | 29.65493 | 100 | 0.713607 | # pylint: disable=redefined-outer-name, unused-argument
import os
import shutil
import subprocess
import tempfile
import uuid
import docker
import pytest
from dagster import check
from dagster.utils import load_yaml_from_path, mkdir_p, pushd, script_relative_path
# Will be set in environment by pipeline.py -> tox.in... | true | true |
f750f166d60fca9fb1e088fb51078cab27812cc5 | 453 | py | Python | Practice/Python/Strings/merge_the_tools.py | nifannn/HackerRank | b05318251226704b1fb949c29aa49493d6ced44b | [
"MIT"
] | 7 | 2019-02-22T10:34:26.000Z | 2021-07-13T01:51:48.000Z | Practice/Python/Strings/merge_the_tools.py | nifannn/HackerRank | b05318251226704b1fb949c29aa49493d6ced44b | [
"MIT"
] | null | null | null | Practice/Python/Strings/merge_the_tools.py | nifannn/HackerRank | b05318251226704b1fb949c29aa49493d6ced44b | [
"MIT"
] | 7 | 2018-11-09T13:52:34.000Z | 2021-03-18T20:36:22.000Z | def merge_the_tools(string, k):
while string:
if len(string) > k:
sub_string = string[:k]
string = string[k:]
else:
sub_string = string[:]
string = ''
s = []
for c in sub_string:
if c not in s:
s.append(c)
... | 26.647059 | 80 | 0.485651 | def merge_the_tools(string, k):
while string:
if len(string) > k:
sub_string = string[:k]
string = string[k:]
else:
sub_string = string[:]
string = ''
s = []
for c in sub_string:
if c not in s:
s.append(c)
... | true | true |
f750f2567e43c503b250e6027380974692328f34 | 1,722 | py | Python | tests/test_buffer.py | pjgao/Deep-Forest | 0fdec38b671ababfcc3476807fe512aa993d4fd4 | [
"BSD-3-Clause"
] | 1 | 2022-03-18T11:56:19.000Z | 2022-03-18T11:56:19.000Z | tests/test_buffer.py | pjgao/Deep-Forest | 0fdec38b671ababfcc3476807fe512aa993d4fd4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_buffer.py | pjgao/Deep-Forest | 0fdec38b671ababfcc3476807fe512aa993d4fd4 | [
"BSD-3-Clause"
] | 1 | 2022-03-19T04:14:20.000Z | 2022-03-19T04:14:20.000Z | import os
import pytest
import numpy as np
from deepforest import _io as io
open_buffer = io.Buffer(use_buffer=True,
buffer_dir="./",
store_est=True,
store_pred=True,
store_data=True)
close_buffer = io.Buffer(use_buffer... | 28.229508 | 76 | 0.681765 | import os
import pytest
import numpy as np
from deepforest import _io as io
open_buffer = io.Buffer(use_buffer=True,
buffer_dir="./",
store_est=True,
store_pred=True,
store_data=True)
close_buffer = io.Buffer(use_buffer... | true | true |
f750f2768a2ff46a5ad67de30bfe28538e3c84ee | 110 | py | Python | neo/SmartContract/StackItemType.py | conscott/neo-python | ea794abbf941638fbe957d511614f3d66a7c2ef1 | [
"MIT"
] | 387 | 2017-07-17T18:25:54.000Z | 2021-11-18T06:19:47.000Z | neo/SmartContract/StackItemType.py | conscott/neo-python | ea794abbf941638fbe957d511614f3d66a7c2ef1 | [
"MIT"
] | 967 | 2017-08-19T15:48:03.000Z | 2021-06-01T21:42:39.000Z | neo/SmartContract/StackItemType.py | conscott/neo-python | ea794abbf941638fbe957d511614f3d66a7c2ef1 | [
"MIT"
] | 286 | 2017-07-17T03:44:36.000Z | 2021-11-18T06:19:32.000Z |
ByteArray = 0x00
Boolean = 0x01
Integer = 0x02
InteropInterface = 0x40
Array = 0x80
Struct = 0x81
Map = 0x82
| 12.222222 | 23 | 0.736364 |
ByteArray = 0x00
Boolean = 0x01
Integer = 0x02
InteropInterface = 0x40
Array = 0x80
Struct = 0x81
Map = 0x82
| true | true |
f750f346a7a1febe8a5cb41c5e2294ccd1d4c54a | 1,076 | py | Python | Leetcode/16.3sum-closest.py | EdwaRen/Competitve-Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | 1 | 2021-05-03T21:48:25.000Z | 2021-05-03T21:48:25.000Z | Leetcode/16.3sum-closest.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | Leetcode/16.3sum-closest.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | class Solution(object):
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums = sorted(nums)
closest = abs((nums[0] + nums[1] + nums[2]) - target)
res = res = [nums[0], nums[1], nums[2]]
for i... | 28.315789 | 61 | 0.417286 | class Solution(object):
def threeSumClosest(self, nums, target):
nums = sorted(nums)
closest = abs((nums[0] + nums[1] + nums[2]) - target)
res = res = [nums[0], nums[1], nums[2]]
for i in range(len(nums)-2):
lo = i+1
hi = len(nums) - 1
while lo < h... | true | true |
f750f368d9b07934c0e0f2b399a5fb1cd4015646 | 6,121 | py | Python | w2v_server.py | jt120/w2v_server_googlenews_py3 | e3f2ac92b82928a8590b8b009e8c1e4029b3a6ab | [
"Apache-2.0"
] | null | null | null | w2v_server.py | jt120/w2v_server_googlenews_py3 | e3f2ac92b82928a8590b8b009e8c1e4029b3a6ab | [
"Apache-2.0"
] | null | null | null | w2v_server.py | jt120/w2v_server_googlenews_py3 | e3f2ac92b82928a8590b8b009e8c1e4029b3a6ab | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
"""
USAGE: %(program)s CONFIG
Example:
./w2v_server.py w2v_hetzner.conf
"""
from __future__ import with_statement
import os
import sys
from functools import wraps
import time
import logging
import bisect
i... | 32.73262 | 118 | 0.61771 |
from __future__ import with_statement
import os
import sys
from functools import wraps
import time
import logging
import bisect
import cherrypy
from cherrypy.process.plugins import DropPrivileges, PIDFile
import gensim
logger = logging.getLogger(__name__)
def server_exception_wrap(func):
@wraps(func)
de... | true | true |
f750f381d90fa8fda8381d592ef4cca0946d7d6c | 1,595 | py | Python | src/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py | WTRipper/jupyter_contrib_nbextensions | 513309a6f4b72836485bc48a47c12b8ec91e2f90 | [
"BSD-3-Clause-Clear"
] | 4,439 | 2016-07-29T15:16:57.000Z | 2022-03-31T07:29:05.000Z | src/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py | WTRipper/jupyter_contrib_nbextensions | 513309a6f4b72836485bc48a47c12b8ec91e2f90 | [
"BSD-3-Clause-Clear"
] | 813 | 2016-07-27T23:15:35.000Z | 2022-03-26T10:22:45.000Z | src/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py | WTRipper/jupyter_contrib_nbextensions | 513309a6f4b72836485bc48a47c12b8ec91e2f90 | [
"BSD-3-Clause-Clear"
] | 741 | 2016-07-28T12:18:05.000Z | 2022-03-14T00:40:46.000Z | """Nbconvert exporter to inline css & js for collapsible_headings."""
from __future__ import print_function
from nbconvert.exporters.html import HTMLExporter
from traitlets import Dict
class ExporterInliner(HTMLExporter):
inliner_resources = Dict(
{'css': [], 'js': []}, config=True,
help='css a... | 33.93617 | 88 | 0.66395 |
from __future__ import print_function
from nbconvert.exporters.html import HTMLExporter
from traitlets import Dict
class ExporterInliner(HTMLExporter):
inliner_resources = Dict(
{'css': [], 'js': []}, config=True,
help='css and js scripts to wrap in html <style> or <script> tags')
def _tem... | true | true |
f750f38fe5953a5b2dd9b4ea4768b822805df42c | 451 | py | Python | src/chessnet/elo.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | src/chessnet/elo.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | src/chessnet/elo.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | def elo_to_category(elo: float) -> str:
if elo >= 2500:
return "IG"
elif 2400 <= elo < 2500:
return "IM"
elif 2300 <= elo < 2400:
return "FM"
elif 2200 <= elo < 2300:
return "CM"
elif 2000 <= elo < 2200:
return "E"
elif 1800 <= elo < 2200:
return "... | 23.736842 | 39 | 0.48337 | def elo_to_category(elo: float) -> str:
if elo >= 2500:
return "IG"
elif 2400 <= elo < 2500:
return "IM"
elif 2300 <= elo < 2400:
return "FM"
elif 2200 <= elo < 2300:
return "CM"
elif 2000 <= elo < 2200:
return "E"
elif 1800 <= elo < 2200:
return "... | true | true |
f750f4d43ae6cb483de558cb67ba87f25cca8e30 | 6,212 | py | Python | train.py | qwertpi/techdiff-textgen | fd7578a24e11b96d86a92d2935b6153b1bea73f8 | [
"FSFAP"
] | null | null | null | train.py | qwertpi/techdiff-textgen | fd7578a24e11b96d86a92d2935b6153b1bea73f8 | [
"FSFAP"
] | null | null | null | train.py | qwertpi/techdiff-textgen | fd7578a24e11b96d86a92d2935b6153b1bea73f8 | [
"FSFAP"
] | null | null | null | from json import dump
from math import ceil
from random import randint
import string
from keras.layers import Input, Dense, Embedding
#uncoment if using CPU
##from keras.layers import LSTM
#comment out the line bellow if using CPU
from keras.layers import CuDNNLSTM as LSTM
from keras.models import Model, load_model
fr... | 35.295455 | 135 | 0.643754 | from json import dump
from math import ceil
from random import randint
import string
from keras.layers import Input, Dense, Embedding
from keras.layers import CuDNNLSTM as LSTM
from keras.models import Model, load_model
from keras.metrics import categorical_accuracy
from keras.utils import to_categorical, plot_model
i... | true | true |
f750f5e3097a73ce4cd78af080821e8ff1a34c55 | 843 | py | Python | run_tests.py | joshuacw/unit_conversions | d5738b23a5711e5b306b253872c5221565fecded | [
"MIT"
] | null | null | null | run_tests.py | joshuacw/unit_conversions | d5738b23a5711e5b306b253872c5221565fecded | [
"MIT"
] | null | null | null | run_tests.py | joshuacw/unit_conversions | d5738b23a5711e5b306b253872c5221565fecded | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
from src.convert import kilometers_to_miles, miles_to_kilometers,\
years_to_minutes, minutes_to_years
class TestConvert(unittest.TestCase):
def test_km_to_miles(self):
actual = kilometers_to_miles(1)
expected = 0.621 #from google
self.assertA... | 27.193548 | 66 | 0.686833 |
import unittest
from src.convert import kilometers_to_miles, miles_to_kilometers,\
years_to_minutes, minutes_to_years
class TestConvert(unittest.TestCase):
def test_km_to_miles(self):
actual = kilometers_to_miles(1)
expected = 0.621 self.assertAlmostEqual(actual, expected, delta=... | true | true |
f750f6f7b42bb028f81a24edb2bb9e30c190578e | 671 | py | Python | contrib/LaneNet/models/__init__.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | contrib/LaneNet/models/__init__.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | contrib/LaneNet/models/__init__.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | # coding: utf8
# copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 37.277778 | 74 | 0.767511 |
import models.modeling
| true | true |
f750f8645ec7db5888d15dbd3cea4b7667d9e040 | 7,012 | py | Python | scripts/data_utils.py | Mithrillion/BiQA | f61bea95521f5b2ffd838aa60aecaad568de6564 | [
"MIT"
] | null | null | null | scripts/data_utils.py | Mithrillion/BiQA | f61bea95521f5b2ffd838aa60aecaad568de6564 | [
"MIT"
] | null | null | null | scripts/data_utils.py | Mithrillion/BiQA | f61bea95521f5b2ffd838aa60aecaad568de6564 | [
"MIT"
] | null | null | null | import numpy as np
import re
import torch.utils.data as tud
import torch
import shutil
def get_word_ids(doc, rnn_encode=True, max_length=100,
nr_unk=100, nr_var=600, rev_dic=None, relabel=True, ent_dict=None):
queue = list(doc)
X = np.zeros(max_length, dtype='int32')
# M = np.zeros(max_le... | 38.527473 | 116 | 0.554478 | import numpy as np
import re
import torch.utils.data as tud
import torch
import shutil
def get_word_ids(doc, rnn_encode=True, max_length=100,
nr_unk=100, nr_var=600, rev_dic=None, relabel=True, ent_dict=None):
queue = list(doc)
X = np.zeros(max_length, dtype='int32')
V = np.zeros(max_... | true | true |
f750f86d11454f20fc17b8943dfd53aec8e560be | 24,618 | py | Python | estimate_gaze_standalone.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | 1 | 2021-07-06T02:01:54.000Z | 2021-07-06T02:01:54.000Z | estimate_gaze_standalone.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | null | null | null | estimate_gaze_standalone.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
from __future__ import print_function, division, absolute_import
import argparse
import os
import sys
import time
import cv2
import matplotlib.... | 44.11828 | 170 | 0.583232 |
from __future__ import print_function, division, absolute_import
import argparse
import os
import sys
import time
import cv2
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
from rt_gene.extract_landmarks_method_base import LandmarkMethodBase
from rt_gene.gaze_tools import get_phi_theta_fro... | true | true |
f750f88806ff7590c8c1ddd15b3b6459d566774e | 17,898 | py | Python | storage/swift.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 1 | 2021-05-30T01:54:21.000Z | 2021-05-30T01:54:21.000Z | storage/swift.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 20 | 2019-12-26T17:32:34.000Z | 2022-03-21T22:18:06.000Z | storage/swift.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 1 | 2020-05-31T16:28:40.000Z | 2020-05-31T16:28:40.000Z | """ Swift storage driver.
Uses: http://docs.openstack.org/developer/swift/overview_large_objects.html
"""
import os.path
import copy
import hmac
import string
import logging
import json
from _pyio import BufferedReader
from collections import namedtuple
from hashlib import sha1
from random import SystemRandom
fr... | 39.685144 | 100 | 0.669796 | import os.path
import copy
import hmac
import string
import logging
import json
from _pyio import BufferedReader
from collections import namedtuple
from hashlib import sha1
from random import SystemRandom
from time import time
from urlparse import urlparse
from uuid import uuid4
from cachetools.func import lru_cache... | true | true |
f750f927632a45d2da2b9f18112507cf846cd84d | 5,128 | py | Python | shynet/analytics/views/ingress.py | MagnumDingusEdu/shynet | 2cbc5ac44170d19db0960090f073b13564840b7b | [
"Apache-2.0"
] | null | null | null | shynet/analytics/views/ingress.py | MagnumDingusEdu/shynet | 2cbc5ac44170d19db0960090f073b13564840b7b | [
"Apache-2.0"
] | 1 | 2020-08-04T04:18:39.000Z | 2020-08-04T04:18:39.000Z | shynet/analytics/views/ingress.py | MagnumDingusEdu/shynet | 2cbc5ac44170d19db0960090f073b13564840b7b | [
"Apache-2.0"
] | null | null | null | import base64
import json
from urllib.parse import urlparse
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render, reverse
from django.utils import... | 34.416107 | 92 | 0.597894 | import base64
import json
from urllib.parse import urlparse
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render, reverse
from django.utils import... | true | true |
f750f993dd775ba0c4c620b0239f50063e53e60e | 186,623 | py | Python | include/zes.py | bgoglin/level-zero | e36cbe25004642a0b0e8ed0670a03725caacd8ad | [
"MIT"
] | null | null | null | include/zes.py | bgoglin/level-zero | e36cbe25004642a0b0e8ed0670a03725caacd8ad | [
"MIT"
] | null | null | null | include/zes.py | bgoglin/level-zero | e36cbe25004642a0b0e8ed0670a03725caacd8ad | [
"MIT"
] | null | null | null | """
Copyright (C) 2019 Intel Corporation
SPDX-License-Identifier: MIT
@file zes.py
@version v1.1-r1.1.10
"""
import platform
from ctypes import *
from enum import *
###############################################################################
__version__ = "1.0"
#############################################... | 66.201845 | 181 | 0.520557 | """
Copyright (C) 2019 Intel Corporation
SPDX-License-Identifier: MIT
@file zes.py
@version v1.1-r1.1.10
"""
import platform
from ctypes import *
from enum import *
__version__ = "1.0"
class zes_driver_handle_t(c_void_p):
pass
class zes_device_handle_t(c_void_p):
pass
class zes_sched_handle_t(c_void... | false | true |
f750fa1f1789f347d7f4343ca0f0a4c9ff0685b9 | 3,119 | py | Python | app/services/lib/config.py | tirinox/thorchainmonitorbot | 9f4604ea3c4ce91239e570b51381209096fc769f | [
"MIT"
] | 3 | 2020-10-13T16:48:35.000Z | 2021-06-02T19:11:51.000Z | app/services/lib/config.py | tirinox/thorchainmonitorbot | 9f4604ea3c4ce91239e570b51381209096fc769f | [
"MIT"
] | null | null | null | app/services/lib/config.py | tirinox/thorchainmonitorbot | 9f4604ea3c4ce91239e570b51381209096fc769f | [
"MIT"
] | 1 | 2021-02-28T19:22:18.000Z | 2021-02-28T19:22:18.000Z | import sys
import yaml
from dotenv import load_dotenv
from services.lib.constants import NetworkIdents
from services.lib.date_utils import parse_timespan_to_seconds
class SubConfig:
def __init__(self, config_data):
self._root_config = config_data
def get(self, path: str = None, default=None, pure=F... | 30.578431 | 117 | 0.597627 | import sys
import yaml
from dotenv import load_dotenv
from services.lib.constants import NetworkIdents
from services.lib.date_utils import parse_timespan_to_seconds
class SubConfig:
def __init__(self, config_data):
self._root_config = config_data
def get(self, path: str = None, default=None, pure=F... | true | true |
f750fa4d44896e47cddead0959e513e2533511ca | 737 | py | Python | LeetCode/Session3/SubarrayProdLessThanK.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/SubarrayProdLessThanK.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/SubarrayProdLessThanK.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], target: int) -> int:
if not nums:
return 0
start, count, prod = 0, 0, 1
for end, num in enumerate(nums):
if num >= target:
prod = 1
start = e... | 29.48 | 88 | 0.511533 | from typing import List
class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], target: int) -> int:
if not nums:
return 0
start, count, prod = 0, 0, 1
for end, num in enumerate(nums):
if num >= target:
prod = 1
start = e... | true | true |
f750fac6efc404f5984f93c568dde3c3576b06ed | 4,613 | py | Python | Source/devtools/scripts/concatenate_application_code.py | crosswalk-project/blink-crosswalk-efl | cb6e853ed11c2aaffb73ca91c11e70e5bb29a0dd | [
"BSD-3-Clause"
] | 2 | 2016-05-19T10:37:25.000Z | 2019-09-18T04:37:14.000Z | Source/devtools/scripts/concatenate_application_code.py | crosswalk-project/blink-crosswalk-efl | cb6e853ed11c2aaffb73ca91c11e70e5bb29a0dd | [
"BSD-3-Clause"
] | null | null | null | Source/devtools/scripts/concatenate_application_code.py | crosswalk-project/blink-crosswalk-efl | cb6e853ed11c2aaffb73ca91c11e70e5bb29a0dd | [
"BSD-3-Clause"
] | 7 | 2015-09-23T09:56:29.000Z | 2022-01-20T10:36:06.000Z | #!/usr/bin/env python
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Concatenates autostart modules, application modules' module.json descriptors,
and the application loader into a single script.
Al... | 40.464912 | 131 | 0.715803 |
from cStringIO import StringIO
from os import path
from modular_build import read_file, write_file, bail_error
import modular_build
import os
import sys
try:
import simplejson as json
except ImportError:
import json
rjsmin_path = os.path.abspath(os.path.join(
os.path.dirname(__file__),
"..",
"..... | true | true |
f750fb29ea9197bae9fbd8f2c7df180c9445caeb | 6,455 | py | Python | tests/test_run.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 2,132 | 2015-01-02T12:48:45.000Z | 2022-03-28T05:32:54.000Z | tests/test_run.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 536 | 2015-01-02T19:42:34.000Z | 2022-03-10T16:40:35.000Z | tests/test_run.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 517 | 2015-01-07T02:09:44.000Z | 2022-03-26T14:18:23.000Z | #!/usr/bin/env python
# encoding: utf-8
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
P... | 33.619792 | 89 | 0.588691 | import pexpect
import unittest
import subprocess
import tempfile
import sys
import os
from . import PexpectTestCase
unicode_type = str if pexpect.PY3 else unicode
def timeout_callback(values):
if values["event_count"] > 3:
return 1
return 0
def function_events_callback(values):
try:
pre... | true | true |
f750fb306b26fde34c89ec0df67fc14db94a6114 | 686 | py | Python | tests/test_source_modules/wctest/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | 1 | 2022-03-25T19:31:00.000Z | 2022-03-25T19:31:00.000Z | tests/test_source_modules/wctest/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | 19 | 2021-05-09T15:49:35.000Z | 2021-07-01T15:56:44.000Z | tests/test_source_modules/wctest/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | null | null | null | from wordsiv.sentence_models_sources import WordCountSource, RandomModel
from pathlib import Path
import json
# Assuming installed as directory (zip_safe=False)
HERE = Path(__file__).parent.absolute()
with open(HERE / "meta.json", "r") as f:
meta = json.load(f)
# Sources should always be prefixed with the packa... | 28.583333 | 80 | 0.682216 | from wordsiv.sentence_models_sources import WordCountSource, RandomModel
from pathlib import Path
import json
HERE = Path(__file__).parent.absolute()
with open(HERE / "meta.json", "r") as f:
meta = json.load(f)
sources = {
"wctest": {
"source": WordCountSource(HERE / "data" / "count-source.txt", met... | true | true |
f750fb61e25e2082495fcd8627be095640138da3 | 8,823 | py | Python | qa/rpc-tests/import-rescan.py | maxmelorj/axe | 1ddc04568573f37f6658eb5a47fac03d78fe7c52 | [
"MIT"
] | 1 | 2018-11-20T15:53:13.000Z | 2018-11-20T15:53:13.000Z | qa/rpc-tests/import-rescan.py | maxmelorj/axe | 1ddc04568573f37f6658eb5a47fac03d78fe7c52 | [
"MIT"
] | null | null | null | qa/rpc-tests/import-rescan.py | maxmelorj/axe | 1ddc04568573f37f6658eb5a47fac03d78fe7c52 | [
"MIT"
] | null | null | null | #!/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 rescan behavior of importaddress, importpubkey, importprivkey, and
importmulti RPCs with different... | 47.181818 | 116 | 0.653633 |
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (start_nodes, connect_nodes, sync_blocks, assert_equal, set_node_times)
from decimal import Decimal
import collections
import enum
import itertools
Call = enum.Enum("Ca... | true | true |
f750fd5632825cabea9ab237dd849f550eeab552 | 1,127 | py | Python | google/ads/googleads/v10/services/services/conversion_custom_variable_service/transports/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/services/services/conversion_custom_variable_service/transports/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/services/services/conversion_custom_variable_service/transports/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.21875 | 74 | 0.787045 | from collections import OrderedDict
from typing import Dict, Type
from .base import ConversionCustomVariableServiceTransport
from .grpc import ConversionCustomVariableServiceGrpcTransport
_transport_registry = (
OrderedDict()
) _transport_registry["grpc"] = ConversionCustomVariableServiceGrpcTransport
__all__ =... | true | true |
f750fda1a6e9c0b46eba13afb00e75619a227305 | 2,142 | py | Python | tests/test_interactor_finder.py | e-bel/drugintfinder | 497a09bc86a12180ccdbb5a8314f03f0a4957cdc | [
"MIT"
] | null | null | null | tests/test_interactor_finder.py | e-bel/drugintfinder | 497a09bc86a12180ccdbb5a8314f03f0a4957cdc | [
"MIT"
] | null | null | null | tests/test_interactor_finder.py | e-bel/drugintfinder | 497a09bc86a12180ccdbb5a8314f03f0a4957cdc | [
"MIT"
] | null | null | null | """Tests for `InteractorFinder` class."""
import pandas as pd
from drugintfinder.finder import InteractorFinder
from .constants import MAPT, PROTEIN, PHOSPHORYLATION, CAUSAL
finder = InteractorFinder(symbol=MAPT, pmods=[PHOSPHORYLATION], edge=CAUSAL)
class TestInteractorFinder:
"""Tests for the InteractorFinde... | 36.305085 | 117 | 0.655929 | import pandas as pd
from drugintfinder.finder import InteractorFinder
from .constants import MAPT, PROTEIN, PHOSPHORYLATION, CAUSAL
finder = InteractorFinder(symbol=MAPT, pmods=[PHOSPHORYLATION], edge=CAUSAL)
class TestInteractorFinder:
def test_find_interactors(self):
finder.find_interactors(target_t... | true | true |
f750fe262b4f79415d003a5b51c34d53766afe98 | 6,949 | py | Python | restui/serializers/ensembl.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | null | null | null | restui/serializers/ensembl.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 7 | 2018-09-05T10:53:44.000Z | 2022-03-08T09:36:14.000Z | restui/serializers/ensembl.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 8 | 2018-09-03T14:29:28.000Z | 2020-07-30T12:54:04.000Z | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 37.972678 | 92 | 0.742409 |
from itertools import chain
from django.utils import timezone
from rest_framework import serializers
from restui.tasks import bulk_upload_task
from restui.models.ensembl import EnsemblTranscript
from restui.models.ensembl import EnsemblSpeciesHistory
from restui.models.ensembl import EnspUCigar
class EnsemblTranscri... | true | true |
f750ff03bbc2a2411b9b09d88958e4ffc6edbed2 | 6,955 | py | Python | jaxlib/pocketfft.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | jaxlib/pocketfft.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | jaxlib/pocketfft.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.413613 | 80 | 0.70913 |
import importlib.util from typing import List
import jaxlib.mlir.ir as ir
import jaxlib.mlir.dialects.mhlo as mhlo
from . import _pocketfft
from . import pocketfft_flatbuffers_py_generated as pd
import numpy as np
import flatbuffers
from jaxlib import xla_client
for _name, _value in _pocketfft.registrations().it... | true | true |
f750fff1a442d3fd7eff7f0946d5683564bf0109 | 13,035 | py | Python | examples/sensors-python/sensors_streams.py | bsc-wdc/distro-stream-lib | 3e1d6a0d5f0b785043992b25e9b6167cf7d644b1 | [
"Apache-2.0"
] | 1 | 2019-09-17T13:36:05.000Z | 2019-09-17T13:36:05.000Z | examples/sensors-python/sensors_streams.py | cristianrcv/distro-stream-lib | d6c048fa26592fe0504c2cfb95afe5f5eb29d042 | [
"Apache-2.0"
] | 2 | 2021-12-10T01:23:10.000Z | 2021-12-14T21:33:17.000Z | examples/sensors-python/sensors_streams.py | cristianrcv/distro-stream-lib | d6c048fa26592fe0504c2cfb95afe5f5eb29d042 | [
"Apache-2.0"
] | 1 | 2021-12-13T15:41:17.000Z | 2021-12-13T15:41:17.000Z | #!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 31.870416 | 118 | 0.670426 |
from __future__ import print_function
from pycompss.api.task import task
from pycompss.api.constraint import constraint
from pycompss.api.parameter import STREAM_IN
from pycompss.api.parameter import STREAM_OUT
from pycompss.api.parameter import INOUT
from pycompss.api.api import compss_wait_on
from pycompss.stream... | true | true |
f751009df47057bacc6d0fbf6d1ab04c87998a96 | 3,617 | py | Python | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 3 | 2019-01-20T19:37:25.000Z | 2019-01-29T10:21:48.000Z | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-02-13T06:42:26.000Z | 2019-03-11T14:04:43.000Z | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-02-13T05:44:16.000Z | 2019-02-13T05:44:16.000Z | import logging
import os
import platform
import re
import subprocess
from pathlib import Path
logger = logging.getLogger(__name__)
BASEDIR = {
"Windows": "C:/Program Files (x86)/StarCraft II",
"Darwin": "/Applications/StarCraft II",
"Linux": "~/StarCraftII",
"WineLinux": "~/.wine/drive_c/Program Files... | 31.72807 | 118 | 0.570086 | import logging
import os
import platform
import re
import subprocess
from pathlib import Path
logger = logging.getLogger(__name__)
BASEDIR = {
"Windows": "C:/Program Files (x86)/StarCraft II",
"Darwin": "/Applications/StarCraft II",
"Linux": "~/StarCraftII",
"WineLinux": "~/.wine/drive_c/Program Files... | true | true |
f75100ccf8b22c124c278c9f27a44949f6cacd11 | 2,635 | py | Python | tests/test_ops/test_bbox.py | Qiza-lyhm/mmcv-1 | 362a90f8bfffe62d5802925944f540ed16b2731e | [
"Apache-2.0"
] | null | null | null | tests/test_ops/test_bbox.py | Qiza-lyhm/mmcv-1 | 362a90f8bfffe62d5802925944f540ed16b2731e | [
"Apache-2.0"
] | null | null | null | tests/test_ops/test_bbox.py | Qiza-lyhm/mmcv-1 | 362a90f8bfffe62d5802925944f540ed16b2731e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import pytest
import torch
from mmcv.device.mlu import IS_MLU_AVAILABLE
from mmcv.utils import IS_CUDA_AVAILABLE
class TestBBox(object):
def _test_bbox_overlaps(self, device, dtype=torch.float):
from mmcv.ops import bbox_overlaps
... | 41.825397 | 79 | 0.526376 | import numpy as np
import pytest
import torch
from mmcv.device.mlu import IS_MLU_AVAILABLE
from mmcv.utils import IS_CUDA_AVAILABLE
class TestBBox(object):
def _test_bbox_overlaps(self, device, dtype=torch.float):
from mmcv.ops import bbox_overlaps
b1 = torch.tensor([[1.0, 1.0, 3.0, 4.0], [2.0, ... | true | true |
f75103588a88b79b20164f71f687534755b24d95 | 3,131 | py | Python | int16_version/tensorflow_mnist/mnist_int16.py | ZenanLin1999/FPGA_accerator_with_mnist_dataset | 1db3d698ebe3cf57050af9465e0b83ffef717d25 | [
"MIT"
] | null | null | null | int16_version/tensorflow_mnist/mnist_int16.py | ZenanLin1999/FPGA_accerator_with_mnist_dataset | 1db3d698ebe3cf57050af9465e0b83ffef717d25 | [
"MIT"
] | null | null | null | int16_version/tensorflow_mnist/mnist_int16.py | ZenanLin1999/FPGA_accerator_with_mnist_dataset | 1db3d698ebe3cf57050af9465e0b83ffef717d25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import input_data
import tensorflow as tf
import numpy as np
from tf_fix import *
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
sess = tf.InteractiveSession()
with tf.name_scope('input'):
x = tf.placeholder("float", shape=[None, 784])
y_ = tf.placeholder("float", shape=[None... | 35.179775 | 112 | 0.696583 | import input_data
import tensorflow as tf
import numpy as np
from tf_fix import *
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
sess = tf.InteractiveSession()
with tf.name_scope('input'):
x = tf.placeholder("float", shape=[None, 784])
y_ = tf.placeholder("float", shape=[None, 10])
def weight_varia... | true | true |
f7510368905d52d274bdf6ce3ff670c4c227f313 | 448 | py | Python | voice_based_email/mysite/homepage/urls.py | Ryuk07/JARVIS_Voice-Based-Email-System | 0cb64a684f59f229b93a32e3a3cd2969520395b3 | [
"Apache-2.0"
] | 5 | 2021-05-12T13:23:27.000Z | 2022-01-29T03:48:08.000Z | voice_based_email/mysite/homepage/urls.py | Ryuk07/JARVIS_Voice-Based-Email-System | 0cb64a684f59f229b93a32e3a3cd2969520395b3 | [
"Apache-2.0"
] | null | null | null | voice_based_email/mysite/homepage/urls.py | Ryuk07/JARVIS_Voice-Based-Email-System | 0cb64a684f59f229b93a32e3a3cd2969520395b3 | [
"Apache-2.0"
] | 1 | 2021-12-26T16:07:09.000Z | 2021-12-26T16:07:09.000Z | from django.conf.urls import url, include
from . import views
app_name = 'homepage'
urlpatterns = [
url(r'^$', views.login_view, name="login"),
url(r'^compose/$', views.compose_view, name="compose"),
url(r'^inbox/$', views.inbox_view, name="inbox"),
url(r'^sent/$', views.sent_view, name="sent... | 29.866667 | 60 | 0.620536 | from django.conf.urls import url, include
from . import views
app_name = 'homepage'
urlpatterns = [
url(r'^$', views.login_view, name="login"),
url(r'^compose/$', views.compose_view, name="compose"),
url(r'^inbox/$', views.inbox_view, name="inbox"),
url(r'^sent/$', views.sent_view, name="sent... | true | true |
f751044e28cb4bad581409c61f6d9e220bf09d27 | 3,184 | py | Python | setup.py | unicef/etools-permissions | 7a6da87c9829290af3cea458314e60dd6d1239fd | [
"Apache-2.0"
] | null | null | null | setup.py | unicef/etools-permissions | 7a6da87c9829290af3cea458314e60dd6d1239fd | [
"Apache-2.0"
] | null | null | null | setup.py | unicef/etools-permissions | 7a6da87c9829290af3cea458314e60dd6d1239fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import codecs
import os.path
import re
import subprocess
import sys
from codecs import open
from distutils import log
from distutils.errors import DistutilsError
from setuptools import find_packages, setup
from setuptools.command.install import install
from setu... | 31.524752 | 139 | 0.617148 | import ast
import codecs
import os.path
import re
import subprocess
import sys
from codecs import open
from distutils import log
from distutils.errors import DistutilsError
from setuptools import find_packages, setup
from setuptools.command.install import install
from setuptools.command.sdist import sdist as BaseSDist... | true | true |
f75104c00eb0bf43776a1fee81f24e4e7df595d6 | 80,035 | py | Python | neutron/db/db_base_plugin_v2.py | downcome13/neutron | ac1691d157509959b85359f8dd1d7e436e6e23ec | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_v2.py | downcome13/neutron | ac1691d157509959b85359f8dd1d7e436e6e23ec | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_v2.py | downcome13/neutron | ac1691d157509959b85359f8dd1d7e436e6e23ec | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 47.78209 | 79 | 0.604186 |
import functools
import netaddr
from neutron_lib.api.definitions import ip_allocation as ipalloc_apidef
from neutron_lib.api.definitions import port as port_def
from neutron_lib.api.definitions import portbindings as portbindings_def
from neutron_lib.api.definitions import subnetpool as subnetpool_def
from neutron_li... | true | true |
f7510691027ef90063d8d3a7ac3e1f9b2b46764a | 1,770 | py | Python | storage/storage.py | np-overflow/bytehackz-discord-bot | 1fb304826a474c5268c0adc684953603b6a2ab64 | [
"MIT"
] | null | null | null | storage/storage.py | np-overflow/bytehackz-discord-bot | 1fb304826a474c5268c0adc684953603b6a2ab64 | [
"MIT"
] | null | null | null | storage/storage.py | np-overflow/bytehackz-discord-bot | 1fb304826a474c5268c0adc684953603b6a2ab64 | [
"MIT"
] | null | null | null | import datetime
import os
from pathlib import Path
import attr
import orjson
from dis_snek.mixins.serialization import DictSerializationMixin
from storage.genius import Genius
from storage.nerf import Nerf
@attr.s(slots=True)
class Container(DictSerializationMixin):
nerf: Nerf = attr.ib(factory=dict, converter=... | 32.181818 | 142 | 0.679096 | import datetime
import os
from pathlib import Path
import attr
import orjson
from dis_snek.mixins.serialization import DictSerializationMixin
from storage.genius import Genius
from storage.nerf import Nerf
@attr.s(slots=True)
class Container(DictSerializationMixin):
nerf: Nerf = attr.ib(factory=dict, converter=... | true | true |
f75106cd522e2e18570249d9ce40db656357a4ba | 3,072 | py | Python | src/doddle/graph.py | CatchemAL/Doddle | 0c2ed8b91f998da645d97160d46178c2dab15c9e | [
"MIT"
] | 3 | 2022-02-03T11:50:41.000Z | 2022-02-14T09:25:35.000Z | src/doddle/graph.py | CatchemAl/Doddle | 0c2ed8b91f998da645d97160d46178c2dab15c9e | [
"MIT"
] | 5 | 2022-03-17T07:38:36.000Z | 2022-03-30T02:33:33.000Z | src/doddle/graph.py | CatchemAL/Doddle | 0c2ed8b91f998da645d97160d46178c2dab15c9e | [
"MIT"
] | 2 | 2022-02-06T15:36:29.000Z | 2022-02-06T23:48:57.000Z | from typing import TYPE_CHECKING, Iterable
from .boards import Scoreboard
if TYPE_CHECKING:
from graphviz import Digraph # type: ignore # pragma: no cover
GREY = "#787c7e"
YELLOW = "#c9b458"
GREEN = "#6aaa64"
class GraphBuilder:
def __init__(self, scoreboards: Iterable[Scoreboard]) -> None:
self.... | 29.825243 | 101 | 0.542969 | from typing import TYPE_CHECKING, Iterable
from .boards import Scoreboard
if TYPE_CHECKING:
from graphviz import Digraph
GREY = "#787c7e"
YELLOW = "#c9b458"
GREEN = "#6aaa64"
class GraphBuilder:
def __init__(self, scoreboards: Iterable[Scoreboard]) -> None:
self.color_by_score = [GREY, YELLOW, GR... | true | true |
f7510702bc88391a6948b01811b2f447037f90f5 | 4,529 | py | Python | sample_coloring.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | null | null | null | sample_coloring.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 1 | 2020-06-16T17:14:45.000Z | 2020-06-16T17:14:45.000Z | sample_coloring.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 2 | 2020-06-16T16:42:40.000Z | 2020-08-28T16:59:42.000Z | #!/usr/bin/env python
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
from colour import Color
from matplotlib.patches import Polygon
import statistics as st
from granatum_sdk import Granatum
COLORS = ["#3891ea", "#29ad19", "#ac2d58", "#db7580",... | 38.709402 | 182 | 0.52219 |
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
from colour import Color
from matplotlib.patches import Polygon
import statistics as st
from granatum_sdk import Granatum
COLORS = ["#3891ea", "#29ad19", "#ac2d58", "#db7580", "#ed2310", "#ca2dc2",... | true | true |
f7510794a3ccdbc4aa28e4673c3350220451b458 | 14,217 | py | Python | model/new_models.py | Bheshaj-Kumar/Transformer-Grapheme-to-Phoneme-Conversion | cc1ff53498cf9d178e1880b5d074ec91559ac95a | [
"MIT"
] | null | null | null | model/new_models.py | Bheshaj-Kumar/Transformer-Grapheme-to-Phoneme-Conversion | cc1ff53498cf9d178e1880b5d074ec91559ac95a | [
"MIT"
] | null | null | null | model/new_models.py | Bheshaj-Kumar/Transformer-Grapheme-to-Phoneme-Conversion | cc1ff53498cf9d178e1880b5d074ec91559ac95a | [
"MIT"
] | null | null | null | import sys
import numpy as np
import tensorflow as tf
from model.transformer_utils import create_encoder_padding_mask, create_mel_padding_mask, create_look_ahead_mask
#from preprocessing.text import Pipeline
from model.layers import PreBottleNeckDecoder, Encoder, Decoder, SpeakerModule
from utils.losses import model_lo... | 45.421725 | 224 | 0.610115 | import sys
import numpy as np
import tensorflow as tf
from model.transformer_utils import create_encoder_padding_mask, create_mel_padding_mask, create_look_ahead_mask
from model.layers import PreBottleNeckDecoder, Encoder, Decoder, SpeakerModule
from utils.losses import model_loss, crossentropy_loss
import data_utils
... | true | true |
f751086f09d3d1f438e80cde14c102827997caf9 | 1,694 | py | Python | lcmtype/lilylcm/L05Ebola.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | lcmtype/lilylcm/L05Ebola.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | lcmtype/lilylcm/L05Ebola.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | """LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class L05Ebola(object):
__slots__ = ["cured"]
def __init__(self):
self.cured = False
def enco... | 29.206897 | 94 | 0.657025 |
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class L05Ebola(object):
__slots__ = ["cured"]
def __init__(self):
self.cured = False
def encode(self):
buf = BytesIO()
buf.write(L05Ebola._get_packed_fingerprint())
... | true | true |
f751087e29eb0ddfc92f6a4a86ac083fa168b7ae | 4,692 | py | Python | python/paddle/distributed/auto_parallel/process_mesh.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/distributed/auto_parallel/process_mesh.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/distributed/auto_parallel/process_mesh.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.276596 | 98 | 0.645141 |
import numpy
import copy
def _get_nested_list_shape(nested_list):
result = []
while isinstance(nested_list, list):
result.append(len(nested_list))
nested_list = nested_list[0]
return result
def _flatten_nested_list(nested_list):
result = numpy.array(nested_list).flatten().tolist()
... | true | true |
f7510917c531028cdc2a3b2f96098d6833ccdc4d | 2,269 | py | Python | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 6 | 2018-11-07T12:41:30.000Z | 2020-04-12T18:07:03.000Z | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 1 | 2020-10-20T12:33:18.000Z | 2020-10-20T12:33:18.000Z | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 10 | 2018-11-12T06:15:19.000Z | 2021-11-18T05:45:12.000Z | """
DRS Package for API unit tests
Copyright (c) 2018-2020 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
Redistribu... | 126.055556 | 844 | 0.806523 | from tests.apis import * | true | true |
f7510a6a0e9c0507795226c04ea7d84dd8aa3a7e | 3,365 | py | Python | python/cugraph/cugraph/link_analysis/hits.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | python/cugraph/cugraph/link_analysis/hits.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | python/cugraph/cugraph/link_analysis/hits.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 36.978022 | 77 | 0.678158 |
from cugraph.link_analysis import hits_wrapper
from cugraph.utilities import check_nx_graph
from cugraph.utilities import df_score_to_dictionary
def hits(G, max_iter=100, tol=1.0e-5, nstart=None, normalized=True):
G, isNx = check_nx_graph(G)
df = hits_wrapper.hits(G, max_iter, tol)
if G.renumbered:
... | true | true |
f7510b6119efd50b0073993842667f1b9377bd18 | 32,510 | py | Python | recaptcha_manager/services.py | charxhit/recaptcha-manager | 18d49653483c77a510e78acf7ed804899c962915 | [
"MIT"
] | 6 | 2021-12-02T22:47:27.000Z | 2022-01-22T17:06:38.000Z | recaptcha_manager/services.py | charxhit/recaptcha-manager | 18d49653483c77a510e78acf7ed804899c962915 | [
"MIT"
] | null | null | null | recaptcha_manager/services.py | charxhit/recaptcha-manager | 18d49653483c77a510e78acf7ed804899c962915 | [
"MIT"
] | null | null | null | from pickle import PicklingError
from abc import abstractmethod, ABC
from requests_futures.sessions import FuturesSession
from concurrent.futures._base import Future
import multiprocess
import recaptcha_manager
from recaptcha_manager.exceptions import LowBidError, NoBalanceError, BadDomainError, BadAPIKeyError, BadSite... | 47.252907 | 145 | 0.607321 | from pickle import PicklingError
from abc import abstractmethod, ABC
from requests_futures.sessions import FuturesSession
from concurrent.futures._base import Future
import multiprocess
import recaptcha_manager
from recaptcha_manager.exceptions import LowBidError, NoBalanceError, BadDomainError, BadAPIKeyError, BadSite... | true | true |
f7510bb9c52ae6cd7c0c469a54fa68c5b71cc587 | 3,634 | py | Python | ProsperFlask-deb/{{cookiecutter.project_name}}/setup.py | EVEprosper/ProsperCookiecutters | 569ca0c311a5ead2b49f0cdde4cb2ad14dcd3a2c | [
"MIT"
] | null | null | null | ProsperFlask-deb/{{cookiecutter.project_name}}/setup.py | EVEprosper/ProsperCookiecutters | 569ca0c311a5ead2b49f0cdde4cb2ad14dcd3a2c | [
"MIT"
] | null | null | null | ProsperFlask-deb/{{cookiecutter.project_name}}/setup.py | EVEprosper/ProsperCookiecutters | 569ca0c311a5ead2b49f0cdde4cb2ad14dcd3a2c | [
"MIT"
] | null | null | null | """Setup.py for ProsperAPI Flask project"""
from os import path, listdir
import importlib
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
HERE = path.abspath(path.dirname(__file__))
def include_all_subfiles(*args):
"""Slurps up all files in a directory (non rec... | 27.953846 | 125 | 0.5776 |
from os import path, listdir
import importlib
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
HERE = path.abspath(path.dirname(__file__))
def include_all_subfiles(*args):
file_list = []
for path_included in args:
local_path = path.join(HERE, path_in... | true | true |
f7510bfbce700152d02c62253717826539faadd0 | 1,542 | py | Python | scripts/compile_mjml.py | whiteowl3/jfa-go | cebde9d4c05d77bbaaec2ab623f2c95d972ca88b | [
"MIT"
] | 189 | 2020-08-02T19:57:53.000Z | 2022-03-29T10:29:35.000Z | scripts/compile_mjml.py | whiteowl3/jfa-go | cebde9d4c05d77bbaaec2ab623f2c95d972ca88b | [
"MIT"
] | 145 | 2020-09-05T03:59:14.000Z | 2022-03-26T18:21:25.000Z | scripts/compile_mjml.py | whiteowl3/jfa-go | cebde9d4c05d77bbaaec2ab623f2c95d972ca88b | [
"MIT"
] | 22 | 2020-11-11T09:31:03.000Z | 2022-03-24T19:55:15.000Z | import subprocess
import shutil
import os
import argparse
from pathlib import Path
from threading import Thread
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", help="output directory for .html and .txt files")
args = parser.parse_args()
def runcmd(cmd):
if os.name == "nt":
return... | 29.09434 | 98 | 0.666667 | import subprocess
import shutil
import os
import argparse
from pathlib import Path
from threading import Thread
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", help="output directory for .html and .txt files")
args = parser.parse_args()
def runcmd(cmd):
if os.name == "nt":
return... | true | true |
f7510da2cad75d71d11a2cee697c25d5a9f80a57 | 449 | py | Python | Dataset/Leetcode/test/7/550.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/7/550.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/7/550.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution(object):
def XXX(self, x):
"""
:type x: int
:rtype: int
"""
a = []
b = ''
if x < 0:
ran = -x
else:
ran = x
for i in str(ran):
a.append(i)
for j in range(1, len(a) + 1):
b =... | 18.708333 | 38 | 0.318486 | class Solution(object):
def XXX(self, x):
"""
:type x: int
:rtype: int
"""
a = []
b = ''
if x < 0:
ran = -x
else:
ran = x
for i in str(ran):
a.append(i)
for j in range(1, len(a) + 1):
b =... | false | true |
f7510dd2f5b54428010a2ad39851b58c5537c047 | 4,968 | py | Python | maze/plotfigure.py | cvanoort/differentiable-plasticity | 28c53765ed38f80fd5a5c49e3e62a0e6555eb669 | [
"Apache-2.0"
] | null | null | null | maze/plotfigure.py | cvanoort/differentiable-plasticity | 28c53765ed38f80fd5a5c49e3e62a0e6555eb669 | [
"Apache-2.0"
] | null | null | null | maze/plotfigure.py | cvanoort/differentiable-plasticity | 28c53765ed38f80fd5a5c49e3e62a0e6555eb669 | [
"Apache-2.0"
] | null | null | null | # Code for making a figure
#
# Copyright (c) 2018 Uber Technologies, 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 requi... | 32.470588 | 139 | 0.628623 |
import numpy as np
import glob
import matplotlib.pyplot as plt
import scipy
from scipy import stats
colorz = ['r', 'b', 'g', 'c', 'm', 'y', 'orange', 'k']
groupnames = glob.glob('./loss_*rngseed_0.txt')
plt.rc('font', size=14)
def mavg(x, N):
cumsum = np.cumsum(np.insert(x, 0, 0))
return (cumsum[N:] - cum... | true | true |
f7510e2e57e70b9bdc54e35893fb2f16f92ff9d7 | 1,917 | py | Python | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | # Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
import os
import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import walk_dir
pyt... | 32.491525 | 98 | 0.651539 | # pylint: disable=redefined-outer-name
import os
import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import walk_dir
pytestmark = pytest.mark.integration
DATA_DIR = os.path.join(os.path.dirname(os... | true | true |
f7510e6623e98b51d35b4913771fb7b9ec054c3d | 11,997 | py | Python | lib/pyexcel/pyexcel/filters.py | tinygg/QQ-Groups-Spider | a161282c6832ed40183905e96205edb5a57e8a05 | [
"MIT"
] | null | null | null | lib/pyexcel/pyexcel/filters.py | tinygg/QQ-Groups-Spider | a161282c6832ed40183905e96205edb5a57e8a05 | [
"MIT"
] | null | null | null | lib/pyexcel/pyexcel/filters.py | tinygg/QQ-Groups-Spider | a161282c6832ed40183905e96205edb5a57e8a05 | [
"MIT"
] | 1 | 2017-03-25T05:08:25.000Z | 2017-03-25T05:08:25.000Z | """
pyexcel.filters
~~~~~~~~~~~~~~~
Filtering functions for pyexcel readers
:copyright: (c) 2014-2015 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
Design note for filter algorithm::
#1 2 3 4 5 6 7 <- original index
# x x
... | 29.695545 | 79 | 0.548637 | from ._compact import PY2
class IndexFilter(object):
def __init__(self, func):
self.eval_func = func
self.shallow_eval_func = None
self.indices = None
def invert(self):
if self.eval_func:
if self.shallow_eval_func is None:
self.s... | true | true |
f7510e7e4972c1139465d15d85e5c9fde99a2491 | 1,650 | py | Python | ooer/blueprints/best_of_modmail/__init__.py | williammck/ooer | d6dc07627acfa41de824b86addf4eb70ecc8fc76 | [
"MIT"
] | null | null | null | ooer/blueprints/best_of_modmail/__init__.py | williammck/ooer | d6dc07627acfa41de824b86addf4eb70ecc8fc76 | [
"MIT"
] | null | null | null | ooer/blueprints/best_of_modmail/__init__.py | williammck/ooer | d6dc07627acfa41de824b86addf4eb70ecc8fc76 | [
"MIT"
] | null | null | null | import itertools
import praw
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('best_of_modmail', __name__, url_prefix='/modmail')
reddit = praw.Reddit(client_id=current_app.config.get('REDDIT_BOT_CLIENT_ID'),
client_secret=current_app.config.get('REDDIT_BOT_CLIENT_... | 35.106383 | 119 | 0.728485 | import itertools
import praw
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('best_of_modmail', __name__, url_prefix='/modmail')
reddit = praw.Reddit(client_id=current_app.config.get('REDDIT_BOT_CLIENT_ID'),
client_secret=current_app.config.get('REDDIT_BOT_CLIENT_... | true | true |
f75110a24a40e75b5471d78bb64ace0f6b3e1fd8 | 4,643 | py | Python | uranium/tests/test_packages_full.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 21 | 2016-01-14T04:06:08.000Z | 2021-03-23T01:43:48.000Z | uranium/tests/test_packages_full.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 45 | 2015-02-09T06:02:01.000Z | 2018-07-22T19:16:01.000Z | uranium/tests/test_packages_full.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 10 | 2015-02-07T20:56:22.000Z | 2018-07-20T03:18:07.000Z | URANIUM_PY = """
def main(build):
build.packages.install("nose")
import nose
assert nose is not None
""".strip()
URANIUM_PY_UPDATE = """
def main(build):
build.packages.install("nose" {0})
import nose
print(nose.__version__)
print("test")
""".strip()
URANIUM_PY_UNINSTALL = """
def main(b... | 27.152047 | 86 | 0.661641 | URANIUM_PY = """
def main(build):
build.packages.install("nose")
import nose
assert nose is not None
""".strip()
URANIUM_PY_UPDATE = """
def main(build):
build.packages.install("nose" {0})
import nose
print(nose.__version__)
print("test")
""".strip()
URANIUM_PY_UNINSTALL = """
def main(b... | true | true |
f75110f9f4870fe4fbe1dec5897bec437c1868e5 | 1,259 | py | Python | keystone-moon/keystone/contrib/endpoint_filter/routers.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/contrib/endpoint_filter/routers.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/contrib/endpoint_filter/routers.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:30.000Z | 2021-03-21T11:38:30.000Z | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 37.029412 | 77 | 0.733122 |
from oslo_log import log
from oslo_log import versionutils
from keystone.common import wsgi
from keystone.i18n import _
LOG = log.getLogger(__name__)
class EndpointFilterExtension(wsgi.Middleware):
def __init__(self, *args, **kwargs):
super(EndpointFilterExtension, self).__init__(*args, **kwargs)
... | true | true |
f75112e8b0608af016ffbc2b6023f4cbb1696bf8 | 3,339 | py | Python | singa_auto/container/container_manager.py | pinpom/singa-auto | e5b80c4728ee65fd0bd7ab15d59ab5621ccc50b1 | [
"Apache-2.0"
] | 1 | 2020-10-26T11:37:26.000Z | 2020-10-26T11:37:26.000Z | singa_auto/container/container_manager.py | pinpom/singa-auto | e5b80c4728ee65fd0bd7ab15d59ab5621ccc50b1 | [
"Apache-2.0"
] | null | null | null | singa_auto/container/container_manager.py | pinpom/singa-auto | e5b80c4728ee65fd0bd7ab15d59ab5621ccc50b1 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.7375 | 127 | 0.640611 |
import abc
from typing import List, Dict, Tuple, Any
class InvalidServiceRequestError(Exception):
pass
class ContainerService():
def __init__(self,
id: str,
hostname: str,
port: int,
info: Dict[str, Any] = {}):
self.id = id ... | true | true |
f7511465eb1d4391679ceb73c8eecf7dc6643a74 | 1,526 | py | Python | dataset_tools/merge_data.py | nyacat/rune_detection | 2da385b3f9f48fd79e41a0f5a5ffc9608c12990b | [
"Unlicense"
] | 2 | 2021-01-14T01:41:18.000Z | 2021-01-14T04:02:38.000Z | dataset_tools/merge_data.py | nyacat/rune_detection | 2da385b3f9f48fd79e41a0f5a5ffc9608c12990b | [
"Unlicense"
] | null | null | null | dataset_tools/merge_data.py | nyacat/rune_detection | 2da385b3f9f48fd79e41a0f5a5ffc9608c12990b | [
"Unlicense"
] | 1 | 2021-03-23T12:51:07.000Z | 2021-03-23T12:51:07.000Z | import os
import shutil
import zipfile
if __name__ == "__main__":
chunk_size = 300
pwd = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(pwd, "package")
tmp_dir = os.path.join(pwd, "tmp")
final_dir = os.path.join(pwd, "final")
for zip_file in os.listdir(package_dir):
... | 33.173913 | 83 | 0.585845 | import os
import shutil
import zipfile
if __name__ == "__main__":
chunk_size = 300
pwd = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(pwd, "package")
tmp_dir = os.path.join(pwd, "tmp")
final_dir = os.path.join(pwd, "final")
for zip_file in os.listdir(package_dir):
... | true | true |
f7511558da2aea246168490825858286e9c013ed | 2,013 | py | Python | 2021/src/day5.py | pantaryl/adventofcode | d53255c55be0447f3cef7bd93818c41b0eeae997 | [
"MIT"
] | 2 | 2021-12-01T05:23:25.000Z | 2021-12-11T05:58:00.000Z | 2021/src/day5.py | pantaryl/adventofcode | d53255c55be0447f3cef7bd93818c41b0eeae997 | [
"MIT"
] | null | null | null | 2021/src/day5.py | pantaryl/adventofcode | d53255c55be0447f3cef7bd93818c41b0eeae997 | [
"MIT"
] | null | null | null | from shared import *
# Input data is in INPUT_DATA.
# INPUT_DATA = [int(x) for x in INPUT_DATA]
class Line:
def __init__(self, start: complex, end: complex):
self.start: complex
self.start = start
self.end: complex
self.end = end
@property
def vertical(self) -> bool:
... | 27.958333 | 89 | 0.571783 | from shared import *
class Line:
def __init__(self, start: complex, end: complex):
self.start: complex
self.start = start
self.end: complex
self.end = end
@property
def vertical(self) -> bool:
return self.start.real == self.end.real
@property
def horiz(s... | true | true |
f75115804fbc3023980fa0ca1865a0fcbe5bb784 | 393 | py | Python | diarypro/diarypro/asgi.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/asgi.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/asgi.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | """
ASGI config for diarypro project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'diarypro.settings')
application = get_asgi_application()
| true | true |
f75116124756a1ebfed290378c23ce44b329ccab | 803 | py | Python | phc/easy/ocr/config.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 1 | 2020-07-22T12:46:58.000Z | 2020-07-22T12:46:58.000Z | phc/easy/ocr/config.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 54 | 2019-10-09T16:19:04.000Z | 2022-01-19T20:28:59.000Z | phc/easy/ocr/config.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 2 | 2019-10-30T19:54:43.000Z | 2020-12-03T18:57:15.000Z | import json
from phc.base_client import BaseClient
from phc.easy.auth import Auth
from phc.easy.ocr.options.ocr_config_types import Config as OcrConfig
class Config:
@staticmethod
def create(config: OcrConfig, auth_args: Auth = Auth.shared()):
auth = Auth(auth_args)
client = BaseClient(auth.s... | 26.766667 | 69 | 0.608966 | import json
from phc.base_client import BaseClient
from phc.easy.auth import Auth
from phc.easy.ocr.options.ocr_config_types import Config as OcrConfig
class Config:
@staticmethod
def create(config: OcrConfig, auth_args: Auth = Auth.shared()):
auth = Auth(auth_args)
client = BaseClient(auth.s... | true | true |
f7511683bcb6f6fa4dbed8eb8a2b3606cd21d6fb | 1,463 | py | Python | snakeplayer.py | colejagdtiger/RL-snake | 09787e5335de3f80204a26c5207e4ffde910077c | [
"MIT"
] | null | null | null | snakeplayer.py | colejagdtiger/RL-snake | 09787e5335de3f80204a26c5207e4ffde910077c | [
"MIT"
] | null | null | null | snakeplayer.py | colejagdtiger/RL-snake | 09787e5335de3f80204a26c5207e4ffde910077c | [
"MIT"
] | null | null | null | import segment as seg
import snakeconfig as config
class Player(object):
def __init__(self):
self.dir_x = 1
self.dir_y = 0
self.length = 4
self.segments = list()
def initializePlayer(self, start_x, start_y):
self.length = 4
self.segments.clear()
... | 25.666667 | 86 | 0.539303 | import segment as seg
import snakeconfig as config
class Player(object):
def __init__(self):
self.dir_x = 1
self.dir_y = 0
self.length = 4
self.segments = list()
def initializePlayer(self, start_x, start_y):
self.length = 4
self.segments.clear()
... | true | true |
f75117246dd7b2da0e686472471b060351ce34f1 | 161 | py | Python | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_Hour_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_Hour_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_Hour_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['NoAR'] ); | 40.25 | 83 | 0.751553 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['NoAR'] ); | true | true |
f7511a92c221d501ccec112a0c2a812e2125407c | 1,259 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.34375 | 93 | 0.664813 |
from msrest.serialization import Model
class VirtualMachineScaleSetManagedDiskParameters(Model):
_attribute_map = {
'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'},
}
def __init__(self, storage_account_type=None):
super(VirtualMachineScaleSetManagedD... | true | true |
f7511ad6381414f04ad8a86f6b3ad04eae926cd6 | 81 | py | Python | factory/factory.py | Soulzerz/discord-memefy | fa45905ca278f77fabc7a607ca250af8342ab3d4 | [
"MIT"
] | null | null | null | factory/factory.py | Soulzerz/discord-memefy | fa45905ca278f77fabc7a607ca250af8342ab3d4 | [
"MIT"
] | 3 | 2018-08-29T01:15:46.000Z | 2018-08-29T15:12:38.000Z | factory/factory.py | Soulzerz/discord-memefy | fa45905ca278f77fabc7a607ca250af8342ab3d4 | [
"MIT"
] | 2 | 2018-08-29T00:46:04.000Z | 2018-08-29T01:13:53.000Z | class Discord(object):
def __init__(self, client):
self.client = client | 27 | 31 | 0.679012 | class Discord(object):
def __init__(self, client):
self.client = client | true | true |
f7511b6c19d2d18648a0a4e100914dde3a3e7420 | 16,553 | py | Python | mariner/tests/test_server.py | smithula/mariner | 1435eba81caa873b42c176304549f00d9bb02df2 | [
"MIT"
] | 167 | 2020-10-13T03:27:45.000Z | 2022-03-20T17:46:11.000Z | mariner/tests/test_server.py | smithula/mariner | 1435eba81caa873b42c176304549f00d9bb02df2 | [
"MIT"
] | 457 | 2020-09-16T14:06:20.000Z | 2022-03-21T10:55:56.000Z | mariner/tests/test_server.py | smithula/mariner | 1435eba81caa873b42c176304549f00d9bb02df2 | [
"MIT"
] | 56 | 2020-10-24T07:37:45.000Z | 2022-03-28T11:13:43.000Z | import hashlib
import io
import os
import pathlib
from unittest.mock import patch, ANY, Mock
from freezegun import freeze_time
from pyexpect import expect
from pyfakefs.fake_filesystem_unittest import TestCase
from werkzeug.datastructures import FileStorage
from mariner import config
from mariner.exceptions import Un... | 38.948235 | 88 | 0.566665 | import hashlib
import io
import os
import pathlib
from unittest.mock import patch, ANY, Mock
from freezegun import freeze_time
from pyexpect import expect
from pyfakefs.fake_filesystem_unittest import TestCase
from werkzeug.datastructures import FileStorage
from mariner import config
from mariner.exceptions import Un... | true | true |
f7511cbeed1b338b992008afc2fe2294b863b06b | 5,405 | py | Python | nbs/13_consensus_clustering/py/030_03-analysis-coassociation.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | 3 | 2021-08-17T21:59:19.000Z | 2022-03-08T15:46:24.000Z | nbs/13_consensus_clustering/py/030_03-analysis-coassociation.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | 4 | 2021-08-04T13:57:24.000Z | 2021-10-11T14:57:15.000Z | nbs/13_consensus_clustering/py/030_03-analysis-coassociation.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | null | null | null | # ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# formats: ipynb,py//py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# ... | 25.738095 | 395 | 0.682701 |
from IPython.display import display
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from utils import generate_result_set_name
import conf
CONSENSUS_CLUSTERING_DIR = Path(
conf.RESULTS["CLUSTERING_DIR"], "consensus_clustering"
).resolve(... | true | true |
f7511cc64c7ed5568a36dc0efffafbdd85e2aa95 | 476 | py | Python | packages/python/plotly/plotly/validators/funnel/marker/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/funnel/marker/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/funnel/marker/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="funnel.marker.colorbar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | 34 | 88 | 0.628151 | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="funnel.marker.colorbar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | true | true |
f7511d0359747f89c4c7d44197e8d4b0e21306dd | 1,158 | py | Python | tower/traces.py | alisonbnt/watchtower | 77cdb4731f6903f9c032f11e5ec1889335b814b9 | [
"MIT"
] | 1 | 2016-05-31T19:20:37.000Z | 2016-05-31T19:20:37.000Z | tower/traces.py | alisonbnt/watchtower | 77cdb4731f6903f9c032f11e5ec1889335b814b9 | [
"MIT"
] | null | null | null | tower/traces.py | alisonbnt/watchtower | 77cdb4731f6903f9c032f11e5ec1889335b814b9 | [
"MIT"
] | null | null | null | TRACES = {
'smell': 'A strange smell',
'rotten_flesh': 'Rotten flesh',
'scratches': "Scratch marks",
'groaning': "Groaning sounds",
'creature_dead': "Entity recognized as deceased",
'creature_wounds': "Some wounds in the body of the entity",
'creature_dirty': "Great amount of dirty covers th... | 37.354839 | 64 | 0.675302 | TRACES = {
'smell': 'A strange smell',
'rotten_flesh': 'Rotten flesh',
'scratches': "Scratch marks",
'groaning': "Groaning sounds",
'creature_dead': "Entity recognized as deceased",
'creature_wounds': "Some wounds in the body of the entity",
'creature_dirty': "Great amount of dirty covers th... | true | true |
f7511d39667a9a4ec5c17be0c560ed30921dafb6 | 15,198 | py | Python | tests/test_tf_shape_inference.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | tests/test_tf_shape_inference.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | tests/test_tf_shape_inference.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
"""Unit Tests for Tensorflow shape inference."""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import variables as variables_lib
from... | 46.054545 | 115 | 0.594684 |
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import variables as variables_lib
from tensorflow.python.ops import init_ops
from backend_test_base import Tf2OnnxBackendTes... | true | true |
f7511d4ef1fcb813aa66c443a4938594c9a3f263 | 3,680 | py | Python | lstm_seq2seq/src/utils/logger.py | arkilpatel/Primitive-Generalization | 81e568ca3f1b1f4026758db24c05acd4ce2eeb9c | [
"MIT"
] | 1 | 2022-03-20T08:40:20.000Z | 2022-03-20T08:40:20.000Z | lstm_seq2seq/src/utils/logger.py | arkilpatel/Primitive-Generalization | 81e568ca3f1b1f4026758db24c05acd4ce2eeb9c | [
"MIT"
] | null | null | null | lstm_seq2seq/src/utils/logger.py | arkilpatel/Primitive-Generalization | 81e568ca3f1b1f4026758db24c05acd4ce2eeb9c | [
"MIT"
] | null | null | null | import logging
from filelock import FileLock
import pdb
import pandas as pd
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
import json
'''Logging Modules'''
def get_logger(name, log_file_path='./logs/temp.log', logging_level=logging.INFO, log_format='%(asctime)s | %(levelname)s | %(fil... | 30.92437 | 186 | 0.674185 | import logging
from filelock import FileLock
import pdb
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import json
def get_logger(name, log_file_path='./logs/temp.log', logging_level=logging.INFO, log_format='%(asctime)s | %(levelname)s | %(filename)s: %(lineno)s : %(funcName)s() ::\t ... | true | true |
f7511d9a8a76f99585b833dd52090e148a209a62 | 3,540 | py | Python | tickit/devices/femto/femto.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | 4 | 2021-09-16T13:35:33.000Z | 2022-02-01T23:35:53.000Z | tickit/devices/femto/femto.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | 46 | 2021-09-16T13:44:58.000Z | 2022-02-02T13:42:56.000Z | tickit/devices/femto/femto.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | null | null | null | from softioc import builder
from tickit.adapters.epicsadapter import EpicsAdapter
from tickit.core.device import Device, DeviceUpdate
from tickit.core.typedefs import SimTime
from tickit.utils.compat.typing_compat import TypedDict
class FemtoDevice(Device):
"""Electronic signal amplifier."""
#: An empty typ... | 33.396226 | 89 | 0.641525 | from softioc import builder
from tickit.adapters.epicsadapter import EpicsAdapter
from tickit.core.device import Device, DeviceUpdate
from tickit.core.typedefs import SimTime
from tickit.utils.compat.typing_compat import TypedDict
class FemtoDevice(Device):
Inputs: TypedDict = TypedDict("Inputs", {"input": ... | true | true |
f7511f12066dedd474f352ce6626ade387c3eb83 | 1,442 | py | Python | cloudinitd/nosetests/service_unit_tests.py | buzztroll/cloudinit.d | 9fcc7c489b646e76f2b7360c0d807dae88d9cc0f | [
"Apache-2.0"
] | null | null | null | cloudinitd/nosetests/service_unit_tests.py | buzztroll/cloudinit.d | 9fcc7c489b646e76f2b7360c0d807dae88d9cc0f | [
"Apache-2.0"
] | null | null | null | cloudinitd/nosetests/service_unit_tests.py | buzztroll/cloudinit.d | 9fcc7c489b646e76f2b7360c0d807dae88d9cc0f | [
"Apache-2.0"
] | null | null | null | import os
import uuid
from cloudinitd.cb_iaas import IaaSTestInstance
from cloudinitd.exceptions import APIUsageException
from cloudinitd.pollables import InstanceHostnamePollable
from cloudinitd.user_api import CloudInitD
import unittest
class ServiceUnitTests(unittest.TestCase):
def test_baddir_name(self):
... | 27.730769 | 59 | 0.615118 | import os
import uuid
from cloudinitd.cb_iaas import IaaSTestInstance
from cloudinitd.exceptions import APIUsageException
from cloudinitd.pollables import InstanceHostnamePollable
from cloudinitd.user_api import CloudInitD
import unittest
class ServiceUnitTests(unittest.TestCase):
def test_baddir_name(self):
... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.