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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c020b7e2c4fa9b2af198b7d18b9c7bc2f381457 | 1,992 | py | Python | synapse/rest/client/v1/base.py | mweinelt/synapse | 42a9ea37e4c6ff9d91b530c40d366446b9fc2234 | [
"Apache-2.0"
] | null | null | null | synapse/rest/client/v1/base.py | mweinelt/synapse | 42a9ea37e4c6ff9d91b530c40d366446b9fc2234 | [
"Apache-2.0"
] | null | null | null | synapse/rest/client/v1/base.py | mweinelt/synapse | 42a9ea37e4c6ff9d91b530c40d366446b9fc2234 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 33.2 | 78 | 0.709337 |
from synapse.http.servlet import RestServlet
from synapse.api.urls import CLIENT_PREFIX
from .transactions import HttpTransactionStore
import re
import logging
logger = logging.getLogger(__name__)
def client_path_patterns(path_regex, releases=(0,), include_in_unstable=True):
patterns = [re.compile("^" + CLIE... | true | true |
1c020c05bb09625e6b3ec2fa5b3fd3d439a809b1 | 3,869 | py | Python | examples-scripts/rl/atari/dqn/breakout_dqn.py | yngtodd/vel | 689f24ce5b12dd985b7164874538d590a0e6e59b | [
"MIT"
] | null | null | null | examples-scripts/rl/atari/dqn/breakout_dqn.py | yngtodd/vel | 689f24ce5b12dd985b7164874538d590a0e6e59b | [
"MIT"
] | null | null | null | examples-scripts/rl/atari/dqn/breakout_dqn.py | yngtodd/vel | 689f24ce5b12dd985b7164874538d590a0e6e59b | [
"MIT"
] | null | null | null | import torch
import torch.optim as optim
from vel.rl.metrics import EpisodeRewardMetric
from vel.storage.streaming.stdout import StdoutStreaming
from vel.util.random import set_seed
from vel.rl.env.classic_atari import ClassicAtariEnv
from vel.rl.models.q_model import QModelFactory
from vel.rl.models.backbone.nature... | 33.643478 | 110 | 0.696304 | import torch
import torch.optim as optim
from vel.rl.metrics import EpisodeRewardMetric
from vel.storage.streaming.stdout import StdoutStreaming
from vel.util.random import set_seed
from vel.rl.env.classic_atari import ClassicAtariEnv
from vel.rl.models.q_model import QModelFactory
from vel.rl.models.backbone.nature... | true | true |
1c020c67e87e2c7154ebd489b70107987ace54ea | 23 | py | Python | miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py | NimBuzz01/Project-Miika_SDGP | 08ad1aafafbe9f47c59bd1568b8ac367fefe5503 | [
"MIT"
] | null | null | null | miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py | NimBuzz01/Project-Miika_SDGP | 08ad1aafafbe9f47c59bd1568b8ac367fefe5503 | [
"MIT"
] | null | null | null | miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py | NimBuzz01/Project-Miika_SDGP | 08ad1aafafbe9f47c59bd1568b8ac367fefe5503 | [
"MIT"
] | null | null | null | __version__ = '4.64.0'
| 11.5 | 22 | 0.652174 | __version__ = '4.64.0'
| true | true |
1c020ce85f2728b9ec37e7a7ddce01f19fe1209f | 4,404 | py | Python | test/document_stores/test_weaviate.py | deepset-ai/Haystack | 4a63707f1a177123c13929eb316d3ecaa7fd6c5f | [
"Apache-2.0"
] | null | null | null | test/document_stores/test_weaviate.py | deepset-ai/Haystack | 4a63707f1a177123c13929eb316d3ecaa7fd6c5f | [
"Apache-2.0"
] | null | null | null | test/document_stores/test_weaviate.py | deepset-ai/Haystack | 4a63707f1a177123c13929eb316d3ecaa7fd6c5f | [
"Apache-2.0"
] | 1 | 2022-02-17T05:08:53.000Z | 2022-02-17T05:08:53.000Z | import uuid
import numpy as np
import pytest
from haystack.schema import Document
from ..conftest import get_document_store
embedding_dim = 768
def get_uuid():
return str(uuid.uuid4())
DOCUMENTS = [
{"content": "text1", "id": "not a correct uuid", "key": "a"},
{"content": "text2", "id": get_uuid(), ... | 36.098361 | 118 | 0.706403 | import uuid
import numpy as np
import pytest
from haystack.schema import Document
from ..conftest import get_document_store
embedding_dim = 768
def get_uuid():
return str(uuid.uuid4())
DOCUMENTS = [
{"content": "text1", "id": "not a correct uuid", "key": "a"},
{"content": "text2", "id": get_uuid(), ... | true | true |
1c020cee20b2ea2d9f2f5cb0978a88d344690e36 | 4,195 | py | Python | alerta/commands.py | smbambling/alerta | 1b3c3888b67ac4db48ef5eb9dcd704ac0c5aecb1 | [
"Apache-2.0"
] | null | null | null | alerta/commands.py | smbambling/alerta | 1b3c3888b67ac4db48ef5eb9dcd704ac0c5aecb1 | [
"Apache-2.0"
] | null | null | null | alerta/commands.py | smbambling/alerta | 1b3c3888b67ac4db48ef5eb9dcd704ac0c5aecb1 | [
"Apache-2.0"
] | null | null | null | import click
from flask import current_app
from flask.cli import FlaskGroup, with_appcontext
from alerta.app import db
from alerta.auth.utils import generate_password_hash
from alerta.models.enums import Scope
from alerta.models.key import ApiKey
from alerta.models.user import User
from alerta.settings import DEFAULT_... | 32.269231 | 109 | 0.615256 | import click
from flask import current_app
from flask.cli import FlaskGroup, with_appcontext
from alerta.app import db
from alerta.auth.utils import generate_password_hash
from alerta.models.enums import Scope
from alerta.models.key import ApiKey
from alerta.models.user import User
from alerta.settings import DEFAULT_... | true | true |
1c020d356d58610a8c798c374407d7d8dcfb6e90 | 1,458 | py | Python | maya/ae/Obq_NodeInfoTemplate.py | madesjardins/Obq_Shaders | 9b5df11d54fc08cf217631a4f655603313de8d77 | [
"Unlicense",
"MIT"
] | 43 | 2016-01-17T01:57:48.000Z | 2021-08-30T21:10:26.000Z | maya/ae/Obq_NodeInfoTemplate.py | madesjardins/Obq_Shaders | 9b5df11d54fc08cf217631a4f655603313de8d77 | [
"Unlicense",
"MIT"
] | 11 | 2015-12-15T21:25:38.000Z | 2021-01-14T22:58:40.000Z | maya/ae/Obq_NodeInfoTemplate.py | madesjardins/Obq_Shaders | 9b5df11d54fc08cf217631a4f655603313de8d77 | [
"Unlicense",
"MIT"
] | 10 | 2015-12-03T22:32:59.000Z | 2020-06-02T16:30:36.000Z | # 2016-12-18 5.46 AM
import pymel.core as pm
import maya.cmds as cmds
import maya.mel as mel
import mtoa.utils as utils
import mtoa.ui.ae.utils as aeUtils
from mtoa.ui.ae.shaderTemplate import ShaderAETemplate
def Obq_NodeInfoHelpURL():
# Add the Obq_Shader docs URL to the Attribute Editor help menu
ObqNodeType ... | 30.375 | 119 | 0.761317 |
import pymel.core as pm
import maya.cmds as cmds
import maya.mel as mel
import mtoa.utils as utils
import mtoa.ui.ae.utils as aeUtils
from mtoa.ui.ae.shaderTemplate import ShaderAETemplate
def Obq_NodeInfoHelpURL():
ObqNodeType = 'Obq_NodeInfo'
ObqNodeHelpURL = 'https://github.com/madesjardins/Obq_Shaders/wiki/... | true | true |
1c020d573aa524043f254d84e024f50e1285497c | 8,610 | py | Python | ocrd_typegroups_classifier/network/densenet.py | bertsky/ocrd_typegroups_classifier | 245be86af76826bb3e7d1c5b2cfe638b6395d30c | [
"Apache-2.0"
] | 11 | 2018-11-12T17:06:03.000Z | 2021-09-10T13:02:17.000Z | ocrd_typegroups_classifier/network/densenet.py | bertsky/ocrd_typegroups_classifier | 245be86af76826bb3e7d1c5b2cfe638b6395d30c | [
"Apache-2.0"
] | 19 | 2019-06-18T10:56:31.000Z | 2021-07-01T07:55:13.000Z | ocrd_typegroups_classifier/network/densenet.py | bertsky/ocrd_typegroups_classifier | 245be86af76826bb3e7d1c5b2cfe638b6395d30c | [
"Apache-2.0"
] | 8 | 2018-11-19T17:50:35.000Z | 2022-01-31T08:20:24.000Z | import re
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
__all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161']
model_urls = {
'densenet121': 'https://download.pytorch.org/models/densenet121-a639ec97.pth',
'densenet169': 'http... | 42.413793 | 105 | 0.62741 | import re
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
__all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161']
model_urls = {
'densenet121': 'https://download.pytorch.org/models/densenet121-a639ec97.pth',
'densenet169': 'http... | true | true |
1c020d794ded75bf270f78b62a2e725ca934ff7e | 2,293 | py | Python | pyensembl/exon.py | chiragmatkar/pyensembl | 3541cfab1993f51b1a8f455fd065cd7660812cc9 | [
"Apache-2.0"
] | 162 | 2018-01-15T13:43:17.000Z | 2022-03-23T20:32:17.000Z | pyensembl/exon.py | chiragmatkar/pyensembl | 3541cfab1993f51b1a8f455fd065cd7660812cc9 | [
"Apache-2.0"
] | 81 | 2018-01-11T05:32:23.000Z | 2022-03-23T12:56:19.000Z | pyensembl/exon.py | chiragmatkar/pyensembl | 3541cfab1993f51b1a8f455fd065cd7660812cc9 | [
"Apache-2.0"
] | 35 | 2018-03-28T08:59:20.000Z | 2022-03-23T12:42:02.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 29.397436 | 74 | 0.557785 |
from __future__ import print_function, division, absolute_import
from .locus import Locus
class Exon(Locus):
def __init__(
self,
exon_id,
contig,
start,
end,
strand,
gene_name,
gene_id):
Locus.__init__(self, ... | true | true |
1c020d99554f238817ba33931a82972341f36b69 | 1,186 | py | Python | pyclesperanto_prototype/_tier9/_average_distance_of_n_closest_neighbors_map.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | null | null | null | pyclesperanto_prototype/_tier9/_average_distance_of_n_closest_neighbors_map.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | null | null | null | pyclesperanto_prototype/_tier9/_average_distance_of_n_closest_neighbors_map.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | null | null | null | from .._tier0 import plugin_function
from .._tier1 import average_distance_of_n_shortest_distances
from .._tier1 import replace_intensities
from .._tier0 import Image
@plugin_function(categories=['label measurement', 'map', 'in assistant'])
def average_distance_of_n_closest_neighbors_map(labels : Image, distance_map :... | 31.210526 | 106 | 0.731872 | from .._tier0 import plugin_function
from .._tier1 import average_distance_of_n_shortest_distances
from .._tier1 import replace_intensities
from .._tier0 import Image
@plugin_function(categories=['label measurement', 'map', 'in assistant'])
def average_distance_of_n_closest_neighbors_map(labels : Image, distance_map :... | true | true |
1c020dbec7fe8d5e9e58cd8ddc508cc309d44f33 | 6,494 | py | Python | byceps/blueprints/common/authentication/password/views.py | GyBraLAN/byceps | b53087849c10a531b66d08999116fa1bef312a7f | [
"BSD-3-Clause"
] | null | null | null | byceps/blueprints/common/authentication/password/views.py | GyBraLAN/byceps | b53087849c10a531b66d08999116fa1bef312a7f | [
"BSD-3-Clause"
] | null | null | null | byceps/blueprints/common/authentication/password/views.py | GyBraLAN/byceps | b53087849c10a531b66d08999116fa1bef312a7f | [
"BSD-3-Clause"
] | null | null | null | """
byceps.blueprints.common.authentication.password.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask import abort, current_app, g, request
from flask_babel import gettext
from .....services.a... | 27.516949 | 86 | 0.647059 |
from flask import abort, current_app, g, request
from flask_babel import gettext
from .....services.authentication.password import (
reset_service as password_reset_service,
service as password_service,
)
from .....services.email import service as email_service
from .....services.email.transfer.models import ... | true | true |
1c020e9e2ea2bac71a383bfa9d2293cfea894909 | 2,859 | py | Python | avatar/relgan/utils/utils.py | Julian-Theis/AVATAR | 24fcd6eaa26f413be528a160d865d5d7e49a780b | [
"MIT"
] | 7 | 2020-12-22T12:09:14.000Z | 2022-03-29T12:50:35.000Z | avatar/relgan/utils/utils.py | ProminentLab/AVATAR | a20c767d8739a52f538927b4ec3d528952263d5a | [
"MIT"
] | 10 | 2020-11-13T17:45:59.000Z | 2022-02-10T00:50:38.000Z | avatar/relgan/utils/utils.py | ProminentLab/AVATAR | a20c767d8739a52f538927b4ec3d528952263d5a | [
"MIT"
] | 2 | 2020-03-26T22:27:27.000Z | 2020-07-07T22:36:41.000Z | import numpy as np
import tensorflow as tf
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import pprint
from avatar.relgan.utils.text_process import *
pp = pprint.PrettyPrinter()
def generate_samples(sess, gen_x, batch_size, generated_num, output_file=None, get_code=True):
# Ge... | 33.635294 | 100 | 0.674362 | import numpy as np
import tensorflow as tf
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import pprint
from avatar.relgan.utils.text_process import *
pp = pprint.PrettyPrinter()
def generate_samples(sess, gen_x, batch_size, generated_num, output_file=None, get_code=True):
... | true | true |
1c020f9fee008f713630890c248ea5523857467d | 1,643 | py | Python | main.py | lofilamp/convert_kelvin_to_rgb | d69622cf711f36565f2e4e0f662aa67b1af4be12 | [
"MIT"
] | null | null | null | main.py | lofilamp/convert_kelvin_to_rgb | d69622cf711f36565f2e4e0f662aa67b1af4be12 | [
"MIT"
] | null | null | null | main.py | lofilamp/convert_kelvin_to_rgb | d69622cf711f36565f2e4e0f662aa67b1af4be12 | [
"MIT"
] | null | null | null | def convert_kelvin_to_rgb(cct_in_kelvin: float) -> list:
"""Converts color temperature (CCT) to RGB values, for CCT between 1000 and 40000.
Accepts CCT in degrees Kelvin as an int or float; otherwise will return a TypeError.
Returns RGB as a list of three floats, each in the range 0.0-255.0.
Assumes a ... | 41.075 | 105 | 0.646987 | def convert_kelvin_to_rgb(cct_in_kelvin: float) -> list:
from math import log
kelvin = (lambda k: max(min(40000.0, k), 1000.0))(cct_in_kelvin) kel = round(kelvin / 100, 3)
def a_bx_clnx(a, b, c, x):
return a + (b * x) + (c * log(x))
if kel <= 66:
red = 255.0
green = a_bx... | true | true |
1c02106014b26e8026dc314f4df3a9864d86009e | 17,798 | py | Python | examples/textbook/plot_projected_disk_density_from_top.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 1 | 2019-12-28T22:47:51.000Z | 2019-12-28T22:47:51.000Z | examples/textbook/plot_projected_disk_density_from_top.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | null | null | null | examples/textbook/plot_projected_disk_density_from_top.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 2 | 2021-11-19T04:41:37.000Z | 2021-11-20T02:11:17.000Z | """
Visualization for simple N-body integration.
Reads particle set from file (nbody.hdf5) and prints subsequent frames.
"""
import os
import sys
import numpy
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot
#from matplotlib import pyplot
from amuse.plot import scatter, xlabel, ylabel
from ... | 35.454183 | 112 | 0.619845 | """
Visualization for simple N-body integration.
Reads particle set from file (nbody.hdf5) and prints subsequent frames.
"""
import os
import sys
import numpy
import matplotlib
from matplotlib import pyplot
from amuse.plot import scatter, xlabel, ylabel
from amuse.lab import *
from amuse.io import store
from opt... | false | true |
1c0211d0320c3886e26f301b16478e46910b8f4c | 2,635 | py | Python | tests/test_language_models.py | X-rayLaser/keras-auto-hwr | 67cfc0209045b1e211f0491b0199cb9d6811bfd0 | [
"MIT"
] | null | null | null | tests/test_language_models.py | X-rayLaser/keras-auto-hwr | 67cfc0209045b1e211f0491b0199cb9d6811bfd0 | [
"MIT"
] | 2 | 2020-01-04T09:03:31.000Z | 2021-05-10T18:29:41.000Z | tests/test_language_models.py | X-rayLaser/keras-auto-hwr | 67cfc0209045b1e211f0491b0199cb9d6811bfd0 | [
"MIT"
] | null | null | null | from unittest import TestCase
from data.language_models import WordDictionary
from data.providers import BaseSource
class ProviderMock(BaseSource):
def __init__(self, sentences):
self.sentences = sentences
def get_sequences(self):
for s in self.sentences:
yield [], s
def __le... | 29.606742 | 83 | 0.611765 | from unittest import TestCase
from data.language_models import WordDictionary
from data.providers import BaseSource
class ProviderMock(BaseSource):
def __init__(self, sentences):
self.sentences = sentences
def get_sequences(self):
for s in self.sentences:
yield [], s
def __le... | true | true |
1c02123e769383fec1ce95becc277bd26bd69d5b | 267 | py | Python | Section 7/amazon/create_s3_bucket.py | cleonb-packt/Enterprise-Automation-with-Python- | 37b8a28a722e76d300a4e3568102315ed0dd8a4e | [
"MIT"
] | 14 | 2018-04-19T01:41:24.000Z | 2022-01-06T02:15:56.000Z | Section 7/amazon/create_s3_bucket.py | cleonb-packt/Enterprise-Automation-with-Python- | 37b8a28a722e76d300a4e3568102315ed0dd8a4e | [
"MIT"
] | null | null | null | Section 7/amazon/create_s3_bucket.py | cleonb-packt/Enterprise-Automation-with-Python- | 37b8a28a722e76d300a4e3568102315ed0dd8a4e | [
"MIT"
] | 12 | 2018-06-06T06:43:44.000Z | 2021-04-19T05:17:38.000Z | import boto3 as boto3
s = boto3.Session(region_name="us-west-1")
s3Client = s.resource('s3')
response = s3Client.create_bucket(
ACL='private',
Bucket='python-example-bucket',
CreateBucketConfiguration={
'LocationConstraint': 'us-east-1'
}
)
| 20.538462 | 42 | 0.681648 | import boto3 as boto3
s = boto3.Session(region_name="us-west-1")
s3Client = s.resource('s3')
response = s3Client.create_bucket(
ACL='private',
Bucket='python-example-bucket',
CreateBucketConfiguration={
'LocationConstraint': 'us-east-1'
}
)
| true | true |
1c021302a225b0c9f317491ecb3d0d18843fcb82 | 1,418 | py | Python | hsstock/vnpy/trader/app/ctaStrategy/strategy/__init__.py | hsstock/hsstock | f8841331022e8844537a5c5b08d047e2cc328856 | [
"Apache-2.0"
] | 2 | 2018-10-04T08:04:24.000Z | 2021-01-21T06:58:30.000Z | hsstock/vnpy/trader/app/ctaStrategy/strategy/__init__.py | hsstock/hsstock | f8841331022e8844537a5c5b08d047e2cc328856 | [
"Apache-2.0"
] | null | null | null | hsstock/vnpy/trader/app/ctaStrategy/strategy/__init__.py | hsstock/hsstock | f8841331022e8844537a5c5b08d047e2cc328856 | [
"Apache-2.0"
] | 1 | 2018-10-20T09:39:50.000Z | 2018-10-20T09:39:50.000Z | # encoding: UTF-8
'''
动态载入所有的策略类
'''
import os
import importlib
import traceback
# 用来保存策略类的字典
STRATEGY_CLASS = {}
#----------------------------------------------------------------------
def loadStrategyModule(moduleName):
"""使用importlib动态载入模块"""
try:
module = importlib.import_module(moduleName)
... | 27.269231 | 98 | 0.573343 |
import os
import importlib
import traceback
STRATEGY_CLASS = {}
def loadStrategyModule(moduleName):
try:
module = importlib.import_module(moduleName)
print( moduleName )
for k in dir(module):
if 'Strategy' in k:
v = module.__getattribute__(k)
... | true | true |
1c0213ffbeb9e7d04d952db051d340b025b590e7 | 3,963 | py | Python | qa/rpc-tests/maxblocksinflight.py | mirzaei-ce/core-goldbit | cc957d795f7af032967943208171acee8a527441 | [
"MIT"
] | null | null | null | qa/rpc-tests/maxblocksinflight.py | mirzaei-ce/core-goldbit | cc957d795f7af032967943208171acee8a527441 | [
"MIT"
] | null | null | null | qa/rpc-tests/maxblocksinflight.py | mirzaei-ce/core-goldbit | cc957d795f7af032967943208171acee8a527441 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import GoldbitTestFramework
from test_framework.util import *
import logging
... | 39.237624 | 114 | 0.60863 |
from test_framework.mininode import *
from test_framework.test_framework import GoldbitTestFramework
from test_framework.util import *
import logging
'''
In this test we connect to one node over p2p, send it numerous inv's, and
compare the resulting number of getdata requests to a max allowed value. We
test for exce... | false | true |
1c0215d027d720365e356877632f4e9e4ee7d819 | 710 | py | Python | 05_SshAndSmartWidgets/src/oval_parameters.py | paper-lark/pythondev | a284118f3d339387c014319a140e88cfaa61057a | [
"MIT"
] | null | null | null | 05_SshAndSmartWidgets/src/oval_parameters.py | paper-lark/pythondev | a284118f3d339387c014319a140e88cfaa61057a | [
"MIT"
] | null | null | null | 05_SshAndSmartWidgets/src/oval_parameters.py | paper-lark/pythondev | a284118f3d339387c014319a140e88cfaa61057a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class OvalParameters:
def __init__(
self,
id: int,
x0: int,
y0: int,
x1: int,
y1: int,
outline_width: int,
outline_color: str,
fill_color: str,
):
self.id = id
self.x0 = x0
self.y0 = y0
... | 26.296296 | 204 | 0.559155 |
class OvalParameters:
def __init__(
self,
id: int,
x0: int,
y0: int,
x1: int,
y1: int,
outline_width: int,
outline_color: str,
fill_color: str,
):
self.id = id
self.x0 = x0
self.y0 = y0
self.x1 = x1
... | true | true |
1c0216ec883aba91bd4c7b2ef317cb08012c952c | 610 | py | Python | src/aggregator/worker.py | MakerSpaceLeiden/aggregator | 3a9f3f061ecec5b69c883407303e8850f22ca64d | [
"Apache-2.0"
] | null | null | null | src/aggregator/worker.py | MakerSpaceLeiden/aggregator | 3a9f3f061ecec5b69c883407303e8850f22ca64d | [
"Apache-2.0"
] | 10 | 2019-02-14T17:57:22.000Z | 2019-03-04T21:36:35.000Z | src/aggregator/worker.py | MakerSpaceLeiden/aggregator | 3a9f3f061ecec5b69c883407303e8850f22ca64d | [
"Apache-2.0"
] | null | null | null | import threading
class Worker(object):
def __init__(self, input_queue):
self.input_queue = input_queue
def start_working_in_background_thread(self):
thread = threading.Thread(target=self._main)
thread.daemon = True
thread.start()
def _main(self):
while True:
... | 26.521739 | 77 | 0.577049 | import threading
class Worker(object):
def __init__(self, input_queue):
self.input_queue = input_queue
def start_working_in_background_thread(self):
thread = threading.Thread(target=self._main)
thread.daemon = True
thread.start()
def _main(self):
while True:
... | true | true |
1c021740c620d9bfdf07533d75520471a5fc0810 | 324 | py | Python | blog/apps/banner/serializers.py | panchaoco/blog-py | ae4c66080c40024d5bef463c2827c5bf71881786 | [
"Apache-2.0"
] | null | null | null | blog/apps/banner/serializers.py | panchaoco/blog-py | ae4c66080c40024d5bef463c2827c5bf71881786 | [
"Apache-2.0"
] | 6 | 2021-03-18T23:09:11.000Z | 2022-03-11T23:43:20.000Z | blog/apps/banner/serializers.py | panchaoco/blog-py | ae4c66080c40024d5bef463c2827c5bf71881786 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from rest_framework import serializers
from .models import Banner
__author__ = 'panchao'
class BannerSerializer(serializers.ModelSerializer):
add_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S", required=False)
class Meta:
model = Banner
fields = "__all_... | 19.058824 | 84 | 0.682099 |
from rest_framework import serializers
from .models import Banner
__author__ = 'panchao'
class BannerSerializer(serializers.ModelSerializer):
add_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S", required=False)
class Meta:
model = Banner
fields = "__all__"
| true | true |
1c02176c77483eba795310d05f6186a4ebcf4d07 | 466 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/geo/projection/rotation/_lat.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/geo/projection/rotation/_lat.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/geo/projection/rotation/_lat.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class LatValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="lat", parent_name="layout.geo.projection.rotation", **kwargs
):
super(LatValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | 31.066667 | 87 | 0.635193 | import _plotly_utils.basevalidators
class LatValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="lat", parent_name="layout.geo.projection.rotation", **kwargs
):
super(LatValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | true | true |
1c021789b2db5754a1be222b93184b5dea132b65 | 1,479 | py | Python | http_parser_server.py | pgjones/asgi_server_from_scratch | 45cecf08c5de681f2d0310fa41d2b5e7c4a0ff25 | [
"MIT"
] | 9 | 2020-07-19T13:26:57.000Z | 2021-06-26T20:08:13.000Z | http_parser_server.py | pgjones/asgi_server_from_scratch | 45cecf08c5de681f2d0310fa41d2b5e7c4a0ff25 | [
"MIT"
] | 1 | 2020-07-23T11:50:12.000Z | 2020-07-23T11:50:12.000Z | http_parser_server.py | pgjones/asgi_server_from_scratch | 45cecf08c5de681f2d0310fa41d2b5e7c4a0ff25 | [
"MIT"
] | 2 | 2020-07-23T11:39:23.000Z | 2020-08-31T02:03:12.000Z | # This can be used,
# $ python http_parser_server.py localhost 5006
# and tested,
# $ curl -v localhost:5006
import asyncio
import sys
class HTTPParser:
def __init__(self):
self.part = "REQUEST"
self.headers = []
self.body_length = 0
def feed_line(self, line: bytes):
if... | 28.442308 | 71 | 0.587559 |
import asyncio
import sys
class HTTPParser:
def __init__(self):
self.part = "REQUEST"
self.headers = []
self.body_length = 0
def feed_line(self, line: bytes):
if self.part == "REQUEST":
self.method, self.path, self.version = line.split(b" ", 2)
self.pa... | true | true |
1c02182c092ec362a1c6fc703add14d0e0557297 | 965 | py | Python | legacysms/tests/test_checks.py | jbrownrs/issue-376-GDS-link | e8cce1b79f46b98a7d24b2da5eca48430fd904a3 | [
"MIT"
] | 5 | 2019-01-07T17:22:34.000Z | 2020-10-08T15:03:12.000Z | legacysms/tests/test_checks.py | jbrownrs/issue-376-GDS-link | e8cce1b79f46b98a7d24b2da5eca48430fd904a3 | [
"MIT"
] | 203 | 2017-12-14T09:51:56.000Z | 2018-08-28T14:04:08.000Z | legacysms/tests/test_checks.py | jbrownrs/issue-376-GDS-link | e8cce1b79f46b98a7d24b2da5eca48430fd904a3 | [
"MIT"
] | 5 | 2018-10-22T11:36:01.000Z | 2020-07-20T05:47:49.000Z | """
Test that the registered system checks work as expected.
"""
from django.core.management import call_command
# Q: is this a documented import location for SystemCheckError?
from django.core.management.base import SystemCheckError
from django.test import TestCase
from legacysms.systemchecks import REQUIRED_SETTING... | 31.129032 | 85 | 0.693264 | from django.core.management import call_command
from django.core.management.base import SystemCheckError
from django.test import TestCase
from legacysms.systemchecks import REQUIRED_SETTINGS
class RequiredSettings(TestCase):
@staticmethod
def test_checks_pass():
call_command('check')
def test_c... | true | true |
1c02185e653c07a621c49a699be91669beae27b8 | 18,094 | py | Python | scieloopds/tests.py | scieloorg/scielo-opds | e7e6b2ae4b0817c7b3b395cc45ca24c8b9039353 | [
"Unlicense"
] | 4 | 2015-04-15T22:52:51.000Z | 2022-03-31T13:23:59.000Z | scieloopds/tests.py | DalavanCloud/scielo-opds | e7e6b2ae4b0817c7b3b395cc45ca24c8b9039353 | [
"Unlicense"
] | 2 | 2016-02-29T18:49:12.000Z | 2021-03-31T18:31:50.000Z | scieloopds/tests.py | DalavanCloud/scielo-opds | e7e6b2ae4b0817c7b3b395cc45ca24c8b9039353 | [
"Unlicense"
] | 1 | 2019-03-16T04:43:35.000Z | 2019-03-16T04:43:35.000Z | # coding: utf-8
"""
.. module: scieloopds.tests
:synopsis: Automated tests.
.. moduleauthor:: Allison Vollmann <allisonvoll@gmail.com>
"""
import unittest
import json
from datetime import datetime
from urlparse import urlparse
import pymongo
import feedparser
from lxml import etree
from pyramid import testing
fro... | 39.592998 | 77 | 0.599259 | import unittest
import json
from datetime import datetime
from urlparse import urlparse
import pymongo
import feedparser
from lxml import etree
from pyramid import testing
from scieloopds.utils import get_db_connection
from scieloopds import (
sync,
urllib2_mock,
)
settings = {
'mong... | true | true |
1c0219a5a2ff9645d1c7057208276ebb9c3db86e | 2,088 | py | Python | vsts/vsts/task/v4_1/models/task_orchestration_queued_plan_group.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/task/v4_1/models/task_orchestration_queued_plan_group.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/task/v4_1/models/task_orchestration_queued_plan_group.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.391304 | 116 | 0.599617 |
from msrest.serialization import Model
class TaskOrchestrationQueuedPlanGroup(Model):
_attribute_map = {
'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'},
'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'},
'plan_group': {'key': 'planGroup', 'type': 'str'},
... | true | true |
1c021a1dfce89d5c9b5289b3d1450224f9b72c5d | 8,590 | py | Python | torch/testing/_internal/common_fx2trt.py | mreso/pytorch | 4f32bdd80217a51d9bb8d6c4d55b97159bc1f02d | [
"Intel"
] | null | null | null | torch/testing/_internal/common_fx2trt.py | mreso/pytorch | 4f32bdd80217a51d9bb8d6c4d55b97159bc1f02d | [
"Intel"
] | null | null | null | torch/testing/_internal/common_fx2trt.py | mreso/pytorch | 4f32bdd80217a51d9bb8d6c4d55b97159bc1f02d | [
"Intel"
] | null | null | null | import unittest
from typing import Callable, List, Tuple
import torch
import torch.fx
import fx2trt_oss.tracer.acc_tracer.acc_tracer as acc_tracer
from fx2trt_oss.fx import (
TRTInterpreter,
InputTensorSpec,
TRTModule,
)
from fx2trt_oss.fx.passes.pass_utils import chain_passes
from fx2trt_oss.fx.utils impo... | 34.36 | 91 | 0.609313 | import unittest
from typing import Callable, List, Tuple
import torch
import torch.fx
import fx2trt_oss.tracer.acc_tracer.acc_tracer as acc_tracer
from fx2trt_oss.fx import (
TRTInterpreter,
InputTensorSpec,
TRTModule,
)
from fx2trt_oss.fx.passes.pass_utils import chain_passes
from fx2trt_oss.fx.utils impo... | true | true |
1c021a6a1257fd047a41452c325d66ec9435d119 | 13,619 | py | Python | projects/NLR_MEG/summer_interv_session1.py | yeatmanlab/BrainTools | 890db4256b0290918045e53cd3c6fd6197fcbb4e | [
"BSD-3-Clause"
] | 4 | 2019-09-20T13:29:31.000Z | 2021-05-20T00:26:53.000Z | projects/NLR_MEG/summer_interv_session1.py | yeatmanlab/BrainTools | 890db4256b0290918045e53cd3c6fd6197fcbb4e | [
"BSD-3-Clause"
] | 3 | 2016-03-09T22:12:10.000Z | 2016-08-26T15:44:47.000Z | projects/NLR_MEG/summer_interv_session1.py | yeatmanlab/BrainTools | 890db4256b0290918045e53cd3c6fd6197fcbb4e | [
"BSD-3-Clause"
] | 7 | 2015-11-17T06:30:38.000Z | 2022-03-04T05:59:09.000Z | # -*- coding: utf-8 -*-
# Authors: Sung Jun Joo; Jason Yeatman; Kambiz Tavabi <ktavabi@gmail.com>
#
#
# License: BSD (3-clause)
import numpy as np
import mnefun
import os
#import glob
os.chdir('/home/sjjoo/git/BrainTools/projects/NLR_MEG')
from score import score
from nlr_organizeMEG_mnefun import nlr_organizeMEG_mne... | 44.074434 | 113 | 0.634555 |
import numpy as np
import mnefun
import os
os.chdir('/home/sjjoo/git/BrainTools/projects/NLR_MEG')
from score import score
from nlr_organizeMEG_mnefun import nlr_organizeMEG_mnefun
import mne
import time
t0 = time.time()
mne.set_config('MNE_USE_CUDA', 'true')
raw_dir = '/mnt/diskArray/projects/MEG/nlr/raw'
out_di... | true | true |
1c021a880014cb8dfb06aab87fd163edfe31a866 | 5,229 | py | Python | python/vpc-peering/vpc.py | Young-ook/aws-cdk-examples | 32f74305ae4e843edd49a5d133205b93fbd8a1b7 | [
"Apache-2.0"
] | 1 | 2021-09-15T01:46:21.000Z | 2021-09-15T01:46:21.000Z | python/vpc-peering/vpc.py | juneceo/aws-cdk-examples | 32f74305ae4e843edd49a5d133205b93fbd8a1b7 | [
"Apache-2.0"
] | null | null | null | python/vpc-peering/vpc.py | juneceo/aws-cdk-examples | 32f74305ae4e843edd49a5d133205b93fbd8a1b7 | [
"Apache-2.0"
] | 1 | 2021-09-15T01:46:04.000Z | 2021-09-15T01:46:04.000Z | from aws_cdk import (
aws_ec2 as ec2,
core,
)
class Vpc(core.Stack):
def __init__(self, app: core.Construct, id: str, props, cidr: str, **kwargs) -> None:
super().__init__(app, id, **kwargs)
self.output_props=props.copy()
self.output_props['vpc']=self.vpc(cidr)
def vpc(self, c... | 27.962567 | 89 | 0.547715 | from aws_cdk import (
aws_ec2 as ec2,
core,
)
class Vpc(core.Stack):
def __init__(self, app: core.Construct, id: str, props, cidr: str, **kwargs) -> None:
super().__init__(app, id, **kwargs)
self.output_props=props.copy()
self.output_props['vpc']=self.vpc(cidr)
def vpc(self, c... | true | true |
1c021aa855321498d7a516c3e40c4039ce365a3f | 1,171 | py | Python | setup.py | domdfcoding/pytest-mypy-plugins | f7b249d0e40c25e2979adfbdb804a2e489072837 | [
"MIT"
] | null | null | null | setup.py | domdfcoding/pytest-mypy-plugins | f7b249d0e40c25e2979adfbdb804a2e489072837 | [
"MIT"
] | null | null | null | setup.py | domdfcoding/pytest-mypy-plugins | f7b249d0e40c25e2979adfbdb804a2e489072837 | [
"MIT"
] | null | null | null | from setuptools import setup
with open("README.md", "r") as f:
readme = f.read()
dependencies = [
"pytest>=6.0.0",
"mypy>=0.790",
"decorator",
"pyyaml",
"chevron",
"regex",
"dataclasses ; python_version<'3.7'",
]
setup(
name="pytest-mypy-plugins",
version="1.9.0",
descript... | 29.275 | 85 | 0.635354 | from setuptools import setup
with open("README.md", "r") as f:
readme = f.read()
dependencies = [
"pytest>=6.0.0",
"mypy>=0.790",
"decorator",
"pyyaml",
"chevron",
"regex",
"dataclasses ; python_version<'3.7'",
]
setup(
name="pytest-mypy-plugins",
version="1.9.0",
descript... | true | true |
1c021b8879f795afbade595ba3c8214a130ee66f | 10,261 | py | Python | tf_tpu_models/official/detection/modeling/maskrcnn_model.py | apls777/kaggle-imaterialist2020-model | 6a653615fa48cbeaf34adda7c0545a49739b3189 | [
"Apache-2.0"
] | 25 | 2020-08-05T14:34:14.000Z | 2022-03-10T22:03:11.000Z | tf_tpu_models/official/detection/modeling/maskrcnn_model.py | apls777/kaggle-imaterialist2020-model | 6a653615fa48cbeaf34adda7c0545a49739b3189 | [
"Apache-2.0"
] | 5 | 2020-08-20T12:33:46.000Z | 2021-07-28T16:05:04.000Z | tf_tpu_models/official/detection/modeling/maskrcnn_model.py | apls777/kaggle-imaterialist2020-model | 6a653615fa48cbeaf34adda7c0545a49739b3189 | [
"Apache-2.0"
] | 7 | 2020-10-13T11:52:17.000Z | 2021-12-07T18:14:28.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.003509 | 115 | 0.704317 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
from dataloader import anchor
from dataloader import mode_keys
from modeling import base_model
from modeling import losses
from modeling.architecture import factory
from ops ... | true | true |
1c021bc0e405cbdfa70c4f051fe29c5f0b00acf8 | 1,336 | py | Python | mathipy/__init__.py | BatiDyDx/maths-tools-python | e9a58aa669b5f36d7ee01402fe1f16a1db7b0e50 | [
"MIT"
] | 1 | 2021-02-02T02:58:38.000Z | 2021-02-02T02:58:38.000Z | mathipy/__init__.py | BatiDyDx/maths-tools-python | e9a58aa669b5f36d7ee01402fe1f16a1db7b0e50 | [
"MIT"
] | null | null | null | mathipy/__init__.py | BatiDyDx/maths-tools-python | e9a58aa669b5f36d7ee01402fe1f16a1db7b0e50 | [
"MIT"
] | null | null | null | __version__ = '0.1dev'
from . import (
math,
arithmetic,
datastr,
functions,
numeric_operations
)
from .math import (
complex_math,
ntheory,
calculus,
geometry,
trigonometry,
linalg,
polynomial,
statistics,
quaternion,
octonion,
)
from .arithmetic import (
... | 17.813333 | 104 | 0.652695 | __version__ = '0.1dev'
from . import (
math,
arithmetic,
datastr,
functions,
numeric_operations
)
from .math import (
complex_math,
ntheory,
calculus,
geometry,
trigonometry,
linalg,
polynomial,
statistics,
quaternion,
octonion,
)
from .arithmetic import (
... | true | true |
1c021c0ed2b178bf5312df02c51e2700bfb242b9 | 5,012 | py | Python | trainer/default_trainer.py | system123/SOMatch | 6f10cf28f506998a5e430ccd3faab3076fe350d5 | [
"MIT"
] | 22 | 2020-09-25T05:10:57.000Z | 2022-03-16T08:16:00.000Z | trainer/default_trainer.py | system123/SOMatch | 6f10cf28f506998a5e430ccd3faab3076fe350d5 | [
"MIT"
] | 14 | 2020-10-09T14:12:08.000Z | 2021-05-18T12:55:18.000Z | trainer/default_trainer.py | system123/SOMatch | 6f10cf28f506998a5e430ccd3faab3076fe350d5 | [
"MIT"
] | 15 | 2020-11-02T02:01:58.000Z | 2022-03-30T08:00:17.000Z | import torch
import torch.nn.functional as F
from ignite.engine.engine import Engine, State, Events
from ignite._utils import convert_tensor
from utils.helpers import BinaryClassificationMeter, accuracy
class DefaultTrainer:
def __init__(self, model, optimizer, loss_fn, logger, config):
self.opts = config... | 35.8 | 170 | 0.594573 | import torch
import torch.nn.functional as F
from ignite.engine.engine import Engine, State, Events
from ignite._utils import convert_tensor
from utils.helpers import BinaryClassificationMeter, accuracy
class DefaultTrainer:
def __init__(self, model, optimizer, loss_fn, logger, config):
self.opts = config... | true | true |
1c021e263236052c6d08516fb2b1242a59d199a7 | 10,421 | py | Python | ScienceCruiseDataManagement/main/management/commands/downloademailsbyage.py | Swiss-Polar-Institute/science-cruise-data-management | 67721a0f4a1255b8ac43e530ed95a8c324239c7c | [
"MIT"
] | 6 | 2017-10-06T09:18:04.000Z | 2022-02-10T08:54:56.000Z | ScienceCruiseDataManagement/main/management/commands/downloademailsbyage.py | Swiss-Polar-Institute/science-cruise-data-management | 67721a0f4a1255b8ac43e530ed95a8c324239c7c | [
"MIT"
] | 12 | 2020-02-27T09:24:50.000Z | 2021-09-22T17:39:55.000Z | ScienceCruiseDataManagement/main/management/commands/downloademailsbyage.py | Swiss-Polar-Institute/science-cruise-data-management | 67721a0f4a1255b8ac43e530ed95a8c324239c7c | [
"MIT"
] | 1 | 2017-10-16T13:49:33.000Z | 2017-10-16T13:49:33.000Z | from django.core.management.base import BaseCommand, CommandError
import datetime
from main.models import Email, Leg
from django.conf import settings
import os
import shutil
import time
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
# This file is part of https://github.com/cpina/... | 35.206081 | 160 | 0.64418 | from django.core.management.base import BaseCommand, CommandError
import datetime
from main.models import Email, Leg
from django.conf import settings
import os
import shutil
import time
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
TEMP_DIRECTORY = os.path.join(os.getenv("HOME")... | true | true |
1c021e56e97cb7b364367b4bc5d39e8c70069fa1 | 9,368 | py | Python | tests/training/test_train.py | julien-c/rasa_nlu | e7901773a7ce0af18707019c849909fd3bbde8ef | [
"Apache-2.0"
] | 1 | 2018-11-14T06:46:05.000Z | 2018-11-14T06:46:05.000Z | tests/training/test_train.py | julien-c/rasa_nlu | e7901773a7ce0af18707019c849909fd3bbde8ef | [
"Apache-2.0"
] | 6 | 2019-12-16T22:14:34.000Z | 2022-02-10T00:26:05.000Z | tests/training/test_train.py | julien-c/rasa_nlu | e7901773a7ce0af18707019c849909fd3bbde8ef | [
"Apache-2.0"
] | 1 | 2021-07-24T08:01:47.000Z | 2021-07-24T08:01:47.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import pytest
from rasa_nlu.config import RasaNLUModelConfig
from tests.conftest import DEFAULT_DATA_PATH
from rasa_nlu import registr... | 41.451327 | 87 | 0.65585 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import pytest
from rasa_nlu.config import RasaNLUModelConfig
from tests.conftest import DEFAULT_DATA_PATH
from rasa_nlu import registry, train
from rasa_nlu.m... | true | true |
1c021e7be7c6b6633b57b2a0fe4d543331f152d8 | 1,563 | py | Python | tests/unit/via/cache_buster_test.py | mattdricker/via-1 | 5f4919518337540d183bc079abbd3ea502a0e281 | [
"BSD-2-Clause"
] | 113 | 2015-02-13T23:22:29.000Z | 2021-09-09T19:42:10.000Z | tests/unit/via/cache_buster_test.py | mattdricker/via-1 | 5f4919518337540d183bc079abbd3ea502a0e281 | [
"BSD-2-Clause"
] | 265 | 2015-02-05T15:32:47.000Z | 2022-03-31T17:05:43.000Z | tests/unit/via/cache_buster_test.py | mattdricker/via-1 | 5f4919518337540d183bc079abbd3ea502a0e281 | [
"BSD-2-Clause"
] | 70 | 2015-04-17T23:52:08.000Z | 2022-03-14T16:50:31.000Z | from unittest.mock import sentinel
import pytest
from via.cache_buster import PathCacheBuster
class TestPathCacheBuster:
EXPECTED_HASH = "606e8d07c0af18c736c272a592038742"
def test_salt_is_generated_from_dir_hash(self, cache_buster):
assert cache_buster.salt == self.EXPECTED_HASH
def test_salt... | 30.647059 | 83 | 0.68842 | from unittest.mock import sentinel
import pytest
from via.cache_buster import PathCacheBuster
class TestPathCacheBuster:
EXPECTED_HASH = "606e8d07c0af18c736c272a592038742"
def test_salt_is_generated_from_dir_hash(self, cache_buster):
assert cache_buster.salt == self.EXPECTED_HASH
def test_salt... | true | true |
1c021fa82bb71b55843653beeb271a096ed17f4d | 570 | py | Python | setup.py | ricardosasilva/pagseguro-python | 8e39d1b0585684c460b86073d1fb3f33112b5b3d | [
"Apache-2.0"
] | 1 | 2017-02-02T05:54:15.000Z | 2017-02-02T05:54:15.000Z | setup.py | ricardosasilva/pagseguro-python | 8e39d1b0585684c460b86073d1fb3f33112b5b3d | [
"Apache-2.0"
] | 1 | 2021-01-07T03:15:02.000Z | 2021-01-19T08:32:32.000Z | setup.py | ricardosasilva/pagseguro-python | 8e39d1b0585684c460b86073d1fb3f33112b5b3d | [
"Apache-2.0"
] | 3 | 2015-03-28T07:21:30.000Z | 2019-03-28T01:55:56.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='pagseguro-python',
version='0.37',
description='PagSeguro API v.2 client library ',
author='Ricardo Silva',
author_email='rsas79@gmail.com',
url='https://github.com/ricardosasilva/pagseguro-pyt... | 24.782609 | 61 | 0.610526 | from setuptools import setup, find_packages
setup(
name='pagseguro-python',
version='0.37',
description='PagSeguro API v.2 client library ',
author='Ricardo Silva',
author_email='rsas79@gmail.com',
url='https://github.com/ricardosasilva/pagseguro-python',
packages=find_packages(),
insta... | true | true |
1c022080cb44d14b16cbc2f6f65d18734bbcfcd2 | 1,175 | py | Python | leetcode_904.py | xiaolinzi-xl/Play-Leetcode-Explore | 0ad20335606d52f9fd5bb1306eadacd1a6f1f7d5 | [
"MIT"
] | null | null | null | leetcode_904.py | xiaolinzi-xl/Play-Leetcode-Explore | 0ad20335606d52f9fd5bb1306eadacd1a6f1f7d5 | [
"MIT"
] | null | null | null | leetcode_904.py | xiaolinzi-xl/Play-Leetcode-Explore | 0ad20335606d52f9fd5bb1306eadacd1a6f1f7d5 | [
"MIT"
] | null | null | null | class Solution:
def totalFruit(self, tree):
res = 1
l, r = 0, 1
n = len(tree)
record = []
record.append(tree[0])
tmp_ans = 1
index = -1
flag = False # 是否交叉,默认没有交叉
while r < n:
if tree[r] in record:
tmp_ans += 1
... | 27.325581 | 61 | 0.354043 | class Solution:
def totalFruit(self, tree):
res = 1
l, r = 0, 1
n = len(tree)
record = []
record.append(tree[0])
tmp_ans = 1
index = -1
flag = False while r < n:
if tree[r] in record:
tmp_ans += 1
re... | true | true |
1c02216dcc60442c3236ba8c2167da9f39ce58de | 6,046 | py | Python | release/scripts/startup/bl_operators/brkimportexport.py | brickmack/BrickCAD | f9ae7abfffaaa7d07983d0cde2a8e5d5dd7e15c0 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2019-06-03T02:47:42.000Z | 2020-04-03T10:23:33.000Z | release/scripts/startup/bl_operators/brkimportexport.py | brickmack/BrickCAD | f9ae7abfffaaa7d07983d0cde2a8e5d5dd7e15c0 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_operators/brkimportexport.py | brickmack/BrickCAD | f9ae7abfffaaa7d07983d0cde2a8e5d5dd7e15c0 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Derived from io_scene_obj in stock Blender, by Campbell Barton, Jiri Hnidek, and Paolo Ciccone
if "bpy" in locals():
import importlib
if "import_brk" in locals():
importlib.reload(import_brk)
if "export_brk" in locals():
importlib.reload(export_brk)
import bpy
from bpy.props import (
BoolProperty,
Float... | 23.617188 | 100 | 0.697155 |
if "bpy" in locals():
import importlib
if "import_brk" in locals():
importlib.reload(import_brk)
if "export_brk" in locals():
importlib.reload(export_brk)
import bpy
from bpy.props import (
BoolProperty,
FloatProperty,
StringProperty,
EnumProperty,
)
from bpy_extras.io_utils import (
ImportHelper,... | true | true |
1c0221797a729fa006fae954d2d2afa890027830 | 13,656 | py | Python | iam/api/client.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 2 | 2021-07-28T01:48:31.000Z | 2021-11-17T11:02:26.000Z | iam/api/client.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | iam/api/client.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 40.764179 | 120 | 0.653412 |
from __future__ import unicode_literals
import time
import json
import logging
import os
from requests.models import PreparedRequest
from cachetools import cached, TTLCache
from .http import http_get, http_post, http_put, http_delete
logger = logging.getLogger("iam")
BK_IAM_VERSION = "1"
class Client(object):
... | true | true |
1c0221f82eb5a100101f5d275d3c03d579eabd89 | 85 | py | Python | spyder/app/tests/script_unicode.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 7,956 | 2015-02-17T01:19:09.000Z | 2022-03-31T21:52:15.000Z | spyder/app/tests/script_unicode.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 16,326 | 2015-02-16T23:15:21.000Z | 2022-03-31T23:34:34.000Z | spyder/app/tests/script_unicode.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 1,918 | 2015-02-20T19:26:26.000Z | 2022-03-31T19:03:25.000Z | import numpy as np
def aaʹbb(a):
"""This function docstring."""
return True
| 14.166667 | 34 | 0.647059 | import numpy as np
def aaʹbb(a):
return True
| true | true |
1c0222eea65d0b9bf96aed4e61c402e84067a9e8 | 3,644 | py | Python | pennylane/templates/state_preparations/arbitrary_state_preparation.py | rmoyard/pennylane | 14fdee89d8c3673840708b002c304aee4b31c507 | [
"Apache-2.0"
] | 3 | 2021-02-22T18:30:55.000Z | 2021-02-23T10:54:58.000Z | pennylane/templates/state_preparations/arbitrary_state_preparation.py | rmoyard/pennylane | 14fdee89d8c3673840708b002c304aee4b31c507 | [
"Apache-2.0"
] | null | null | null | pennylane/templates/state_preparations/arbitrary_state_preparation.py | rmoyard/pennylane | 14fdee89d8c3673840708b002c304aee4b31c507 | [
"Apache-2.0"
] | 1 | 2021-03-27T09:03:15.000Z | 2021-03-27T09:03:15.000Z | # Copyright 2018-2021 Xanadu Quantum 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 required by applicable law or... | 31.686957 | 107 | 0.662459 |
import functools
import pennylane as qml
from pennylane.operation import Operation, AnyWires
@functools.lru_cache()
def _state_preparation_pauli_words(num_wires):
if num_wires == 1:
return ["X", "Y"]
sub_pauli_words = _state_preparation_pauli_words(num_wires - 1)
sub_id = "I" * (num_wires - 1)... | true | true |
1c0223c00d9a015b30bd8af2fbc0167eb073a108 | 1,045 | py | Python | zerver/webhooks/zapier/view.py | ajayns/zulip | c5ff020246cd75d0650f93ef621b76bdc4bbb8aa | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/zapier/view.py | ajayns/zulip | c5ff020246cd75d0650f93ef621b76bdc4bbb8aa | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/zapier/view.py | ajayns/zulip | c5ff020246cd75d0650f93ef621b76bdc4bbb8aa | [
"Apache-2.0"
] | 1 | 2019-10-14T23:36:14.000Z | 2019-10-14T23:36:14.000Z | from django.utils.translation import ugettext as _
from typing import Any, Callable, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_stream_message
from zerver.lib.response import json_success, json_error
from zerver... | 41.8 | 85 | 0.744498 | from django.utils.translation import ugettext as _
from typing import Any, Callable, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_stream_message
from zerver.lib.response import json_success, json_error
from zerver... | true | true |
1c02256b7f2497612dc8353f6e63ce29accc5407 | 1,914 | py | Python | backends/gdb_plugin/libwayland_symbols.py | wmww/wayland-debug | b408905e55480f427a2abfba7aea7211fcd3e1c0 | [
"MIT"
] | 38 | 2018-12-21T19:11:42.000Z | 2021-06-09T09:37:28.000Z | backends/gdb_plugin/libwayland_symbols.py | wmww/wayland-debug | b408905e55480f427a2abfba7aea7211fcd3e1c0 | [
"MIT"
] | 24 | 2018-12-21T20:14:03.000Z | 2022-03-21T20:42:29.000Z | backends/gdb_plugin/libwayland_symbols.py | wmww/wayland-debug | b408905e55480f427a2abfba7aea7211fcd3e1c0 | [
"MIT"
] | 4 | 2018-12-21T19:23:04.000Z | 2021-03-02T07:59:56.000Z | import subprocess
import re
import logging
import gdb # type: ignore
def verify() -> None:
'''Verifies libwayland debug symbols are available on the system'''
# First, we use ldconfig to find libwayland
cmd = ['ldconfig', '-p']
logging.info('Running `' + ' '.join(cmd) + '`')
sp = subprocess.Popen(c... | 46.682927 | 101 | 0.637409 | import subprocess
import re
import logging
import gdb
def verify() -> None:
cmd = ['ldconfig', '-p']
logging.info('Running `' + ' '.join(cmd) + '`')
sp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout_bytes, stderr_bytes = sp.communicate()
stdout = stdout_bytes.dec... | true | true |
1c0226359be5d90eed1ee670df670cee82051696 | 2,199 | py | Python | emailable/client.py | bernardoduarte/emailable-python | cc06fd9c461693913b51691e5c04a1a004693b90 | [
"MIT"
] | 3 | 2021-05-20T18:19:42.000Z | 2021-11-24T14:37:21.000Z | emailable/client.py | bernardoduarte/emailable-python | cc06fd9c461693913b51691e5c04a1a004693b90 | [
"MIT"
] | null | null | null | emailable/client.py | bernardoduarte/emailable-python | cc06fd9c461693913b51691e5c04a1a004693b90 | [
"MIT"
] | null | null | null | import requests
from .response import Response
from .error import (ClientError, AuthError, PaymentRequiredError,
ResourceNotFoundError, RateLimitExceededError,
ServerUnavailableError)
class Client(object):
def __init__(self, api_key):
self.api_key = api_key
self.base_... | 27.835443 | 69 | 0.643474 | import requests
from .response import Response
from .error import (ClientError, AuthError, PaymentRequiredError,
ResourceNotFoundError, RateLimitExceededError,
ServerUnavailableError)
class Client(object):
def __init__(self, api_key):
self.api_key = api_key
self.base_... | true | true |
1c02279b352af9eb3760417c0345dabeff01d1bf | 10,378 | py | Python | utils/settingsDCM2NII.py | dpedrosac/cDBS | 75ddb6a37a6f3b25f428005afc4e882bf31b09bf | [
"MIT"
] | null | null | null | utils/settingsDCM2NII.py | dpedrosac/cDBS | 75ddb6a37a6f3b25f428005afc4e882bf31b09bf | [
"MIT"
] | 6 | 2020-09-04T23:35:01.000Z | 2021-05-16T00:09:38.000Z | utils/settingsDCM2NII.py | dpedrosac/cDBS | 75ddb6a37a6f3b25f428005afc4e882bf31b09bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import yaml
import os
from utils.HelperFunctions import Output, Configuration, FileOperations, MatlabEquivalent
import private.allToolTips as setToolTips
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QGroupBox, QVBox... | 44.350427 | 118 | 0.667084 |
import sys
import yaml
import os
from utils.HelperFunctions import Output, Configuration, FileOperations, MatlabEquivalent
import private.allToolTips as setToolTips
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QGroupBox, QVBoxLayout, QHBoxLayout, \
QPushButton, QButto... | true | true |
1c02289e04963357daa828c2e03667b2b886ecba | 5,768 | py | Python | feat2vec/sampler.py | dongchirua/Feat2Vec | 32f2345065f767be2ba61ec62ba6c89540eb83d6 | [
"Apache-2.0"
] | 9 | 2018-07-05T17:31:41.000Z | 2020-07-13T20:42:57.000Z | feat2vec/sampler.py | dongchirua/Feat2Vec | 32f2345065f767be2ba61ec62ba6c89540eb83d6 | [
"Apache-2.0"
] | 1 | 2020-02-06T08:31:44.000Z | 2020-02-10T17:55:26.000Z | feat2vec/sampler.py | dongchirua/Feat2Vec | 32f2345065f767be2ba61ec62ba6c89540eb83d6 | [
"Apache-2.0"
] | 2 | 2018-11-08T06:47:12.000Z | 2020-01-21T07:58:35.000Z | from keras.utils import Sequence
import numpy as np
import math
import scipy
class FMData(Sequence):
def __init__(self, inputs, output, batch_size, implicit_samples=0,splits=None, feature_extraction=None, sample_probabilities={}, mask=None, shuffle=True, nce=None):
#validate inputs:
check_length ... | 37.212903 | 169 | 0.570388 | from keras.utils import Sequence
import numpy as np
import math
import scipy
class FMData(Sequence):
def __init__(self, inputs, output, batch_size, implicit_samples=0,splits=None, feature_extraction=None, sample_probabilities={}, mask=None, shuffle=True, nce=None):
check_length = -1
for f... | true | true |
1c0228ee5cb8f997a42cf4ce4b2805c7169a40e8 | 2,176 | py | Python | python/doc/en/2.0/gwiki2rst.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 21 | 2015-02-06T21:55:59.000Z | 2021-04-29T11:23:18.000Z | python/doc/en/2.0/gwiki2rst.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 9 | 2015-02-03T10:41:35.000Z | 2020-02-18T12:46:10.000Z | python/doc/en/2.0/gwiki2rst.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 20 | 2015-02-06T00:09:19.000Z | 2020-01-10T13:27:06.000Z |
import re
import sys
headers = [('^=([^=].*[^=])=$', '-'),
('^==([^=].*[^=])==$', '~'),
('^===([^=].*[^=])===$', '"')]
def convert_headers(line):
for (pat, char) in headers:
# process section headers
m = re.match(pat, line.strip())
if m:
h = m.groups(1)[0... | 24.727273 | 73 | 0.480699 |
import re
import sys
headers = [('^=([^=].*[^=])=$', '-'),
('^==([^=].*[^=])==$', '~'),
('^===([^=].*[^=])===$', '"')]
def convert_headers(line):
for (pat, char) in headers:
# process section headers
m = re.match(pat, line.strip())
if m:
h = m.groups(1)[0... | false | true |
1c0229c1705a5214addc45456ba482bca28c2b80 | 8,745 | py | Python | textClassifier/all_features.py | vikash06131721/autoMltext | 96f41161947d78c663e7f6b4ff452fc5bf2462e8 | [
"MIT"
] | null | null | null | textClassifier/all_features.py | vikash06131721/autoMltext | 96f41161947d78c663e7f6b4ff452fc5bf2462e8 | [
"MIT"
] | null | null | null | textClassifier/all_features.py | vikash06131721/autoMltext | 96f41161947d78c663e7f6b4ff452fc5bf2462e8 | [
"MIT"
] | null | null | null | from sklearn.base import BaseEstimator, TransformerMixin
import pandas as pd
import joblib
import numpy as np
import ast
import nltk
import re
import argparse
from textClassifier.statistical_features_pipeline import stats_models
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text i... | 41.25 | 108 | 0.601487 | from sklearn.base import BaseEstimator, TransformerMixin
import pandas as pd
import joblib
import numpy as np
import ast
import nltk
import re
import argparse
from textClassifier.statistical_features_pipeline import stats_models
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text i... | true | true |
1c022a1a93cab202cffba39634e31e4d50be5367 | 950 | py | Python | tmp/leetcode/network-delay-time.py | mangchhe/algorithm | 2e82ce1a71773d0dcb581fa8a3849553b985c34f | [
"MIT"
] | 1 | 2021-01-01T13:41:18.000Z | 2021-01-01T13:41:18.000Z | tmp/leetcode/network-delay-time.py | mangchhe/Algorithm | 6623f3ed0ae56d59397fdbce867fd8ac907b600c | [
"MIT"
] | null | null | null | tmp/leetcode/network-delay-time.py | mangchhe/Algorithm | 6623f3ed0ae56d59397fdbce867fd8ac907b600c | [
"MIT"
] | null | null | null | import heapq
from collections import defaultdict
class Solution(object):
def networkDelayTime(self, times, n, k):
dist = [float('INF')] * (n + 1)
dist[k] = 0
dist[0] = 0
mv = defaultdict(list)
for i in range(1, n + 1): mv[i] = []
for t in times:
mv[t[0]]... | 25.675676 | 61 | 0.375789 | import heapq
from collections import defaultdict
class Solution(object):
def networkDelayTime(self, times, n, k):
dist = [float('INF')] * (n + 1)
dist[k] = 0
dist[0] = 0
mv = defaultdict(list)
for i in range(1, n + 1): mv[i] = []
for t in times:
mv[t[0]]... | true | true |
1c022a1d90c016000f4a2d29f339c507d9e7750f | 2,037 | py | Python | dev_scripts/templates_lightblue.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | dev_scripts/templates_lightblue.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | dev_scripts/templates_lightblue.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from __future__ import print_function
import os
import sys
from pprint import pprint
# Allow imports from parent directory.
sys.path.insert(1, os.path.join(sys.path[0], '..'))
# Set the FRESHMAKER_DEVELOPER_ENV variable.
os.environ["FRESHMAKER_DEVELOPER_ENV"] = "1"
from freshmaker.lightblue import... | 26.115385 | 76 | 0.515464 | from __future__ import print_function
import os
import sys
from pprint import pprint
sys.path.insert(1, os.path.join(sys.path[0], '..'))
os.environ["FRESHMAKER_DEVELOPER_ENV"] = "1"
from freshmaker.lightblue import LightBlue
if len(sys.argv) != 4:
print("Template for testing freshmaker.Lightblue class")
pr... | true | true |
1c022ba6aff56da877086df5249ba4be14998be1 | 4,672 | py | Python | main.py | scottoss/streama-kodi | 3ab7cb3e2b0918cf81d57470255df0a110055be8 | [
"MIT"
] | null | null | null | main.py | scottoss/streama-kodi | 3ab7cb3e2b0918cf81d57470255df0a110055be8 | [
"MIT"
] | null | null | null | main.py | scottoss/streama-kodi | 3ab7cb3e2b0918cf81d57470255df0a110055be8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Module: default
# Author: joen, bodems
# Created on: 24.08.2017
# License: MIT
# #
# this file is just for testing #
# #
import sys
#from urllib import urlencode
from urlparse import parse_qsl
#import xbmcgui
#import xbmcplugin
impo... | 30.736842 | 111 | 0.662671 |
import sys
from urlparse import parse_qsl
import urllib, urllib2, cookielib
import json
username = '' password = '' streamaurl = 'https://streama.example.net'
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
login_data = urllib.urlencode({'username' : username, 'password' : ... | false | true |
1c022c18a1f726b6b6dea30882dc83de7078cc0c | 689 | py | Python | tests/integration/questionnaire/test_questionnaire_plurals.py | petechd/eq-questionnaire-runner | 1c5b182a7f8bc878cfdd767ae080410fa679abd6 | [
"MIT"
] | 3 | 2020-09-28T13:21:21.000Z | 2021-05-05T14:14:51.000Z | tests/integration/questionnaire/test_questionnaire_plurals.py | petechd/eq-questionnaire-runner | 1c5b182a7f8bc878cfdd767ae080410fa679abd6 | [
"MIT"
] | 402 | 2019-11-06T17:23:03.000Z | 2022-03-31T16:03:35.000Z | tests/integration/questionnaire/test_questionnaire_plurals.py | petechd/eq-questionnaire-runner | 1c5b182a7f8bc878cfdd767ae080410fa679abd6 | [
"MIT"
] | 10 | 2020-03-03T14:23:27.000Z | 2022-01-31T12:21:21.000Z | from tests.integration.integration_test_case import IntegrationTestCase
class TestQuestionnairePlurals(IntegrationTestCase):
def test_plural_page(self):
self.launchSurvey("test_plural_forms")
self.post({"number-of-people-answer": 0})
self.assertEqualPageTitle(
"… people live ... | 34.45 | 71 | 0.679245 | from tests.integration.integration_test_case import IntegrationTestCase
class TestQuestionnairePlurals(IntegrationTestCase):
def test_plural_page(self):
self.launchSurvey("test_plural_forms")
self.post({"number-of-people-answer": 0})
self.assertEqualPageTitle(
"… people live ... | true | true |
1c022d87bcd10d9bc4b4fce2f1d2b73f16f4e08a | 7,313 | py | Python | lib/googlecloudsdk/core/credentials/gce.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/credentials/gce.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/credentials/gce.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 30.598326 | 79 | 0.717626 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import threading
from googlecloudsdk.core.credentials import gce_cache
from googlecloudsdk.core.credentials import gce_read
from googlecloudsdk.core.util import retry
from six.moves import urllib
class ... | true | true |
1c022ddb5d3bb1b27657c6e1ab1a59a8a0d81474 | 1,642 | py | Python | setup.py | tkliuxing/bgframework | c32c609aa49688875ce9f9db11e83655f7258a42 | [
"Apache-2.0"
] | null | null | null | setup.py | tkliuxing/bgframework | c32c609aa49688875ce9f9db11e83655f7258a42 | [
"Apache-2.0"
] | null | null | null | setup.py | tkliuxing/bgframework | c32c609aa49688875ce9f9db11e83655f7258a42 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
from bgframework import __version__
# from Cython.Build import cythonize
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
... | 32.196078 | 79 | 0.638855 | from setuptools import setup, find_packages
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
from bgframework import __version__
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
... | true | true |
1c022de9a7a44094d8d23092c9e77ee72b58e8a4 | 4,177 | py | Python | fixture/group.py | Belyanova/Python_-training | 2e38e489bbed05995cf067187e62c2842ad8f661 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | Belyanova/Python_-training | 2e38e489bbed05995cf067187e62c2842ad8f661 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | Belyanova/Python_-training | 2e38e489bbed05995cf067187e62c2842ad8f661 | [
"Apache-2.0"
] | null | null | null | from model.configurations_group import Configurations_group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new"))) > 0:
wd.find_element_b... | 35.398305 | 100 | 0.650706 | from model.configurations_group import Configurations_group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new"))) > 0:
wd.find_element_b... | false | true |
1c022e678127094404498607d8c2d2dd54ae86ba | 4,944 | py | Python | src/tensorforce/tensorforce/tests/agent_unittest.py | linus87/drl_shape_optimization | 39e6b66bd5b70dfce07e145aafe815071bc1b6fe | [
"MIT"
] | 17 | 2020-12-28T16:25:47.000Z | 2022-03-27T18:28:44.000Z | src/tensorforce/tensorforce/tests/agent_unittest.py | linus87/drl_shape_optimization | 39e6b66bd5b70dfce07e145aafe815071bc1b6fe | [
"MIT"
] | 2 | 2021-04-18T03:40:02.000Z | 2022-01-24T08:40:10.000Z | src/tensorforce/tensorforce/tests/agent_unittest.py | linus87/drl_shape_optimization | 39e6b66bd5b70dfce07e145aafe815071bc1b6fe | [
"MIT"
] | 8 | 2020-12-23T05:59:52.000Z | 2022-03-28T12:06:35.000Z | # Copyright 2018 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.573427 | 91 | 0.610032 |
import sys
from tensorforce.tests.unittest_base import UnittestBase
class AgentUnittest(UnittestBase):
exclude_bool_action = False
exclude_int_action = False
exclude_float_action = False
exclude_bounded_action = False
replacement_action = 'bool'
def test_bool(self):
states = di... | true | true |
1c0230251bb3e2493604212e62ed69ffd81d2c38 | 14,879 | py | Python | tests_adapters/test_adapter_composition.py | techthiyanes/adapter-transformers | 04aeaf63c4c54856d416925258393d9e06866b46 | [
"Apache-2.0"
] | null | null | null | tests_adapters/test_adapter_composition.py | techthiyanes/adapter-transformers | 04aeaf63c4c54856d416925258393d9e06866b46 | [
"Apache-2.0"
] | null | null | null | tests_adapters/test_adapter_composition.py | techthiyanes/adapter-transformers | 04aeaf63c4c54856d416925258393d9e06866b46 | [
"Apache-2.0"
] | null | null | null | import copy
import random
import unittest
import torch
from tests.test_modeling_common import ids_tensor
from transformers import (
MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
AutoAdapterModel,
AutoTokenizer,
BertConfig,
BertForSequenceClassification,
T5AdapterModel,
Trainer,
TrainingAr... | 36.290244 | 115 | 0.613953 | import copy
import random
import unittest
import torch
from tests.test_modeling_common import ids_tensor
from transformers import (
MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
AutoAdapterModel,
AutoTokenizer,
BertConfig,
BertForSequenceClassification,
T5AdapterModel,
Trainer,
TrainingAr... | true | true |
1c0230367d8215f5db42b13398f6fd55857a1539 | 10,382 | py | Python | models.py | RoozbehFarhoodi/McNeuron | da07a6c780c59ca3e6e785cb9e742ce4a9953965 | [
"MIT"
] | null | null | null | models.py | RoozbehFarhoodi/McNeuron | da07a6c780c59ca3e6e785cb9e742ce4a9953965 | [
"MIT"
] | null | null | null | models.py | RoozbehFarhoodi/McNeuron | da07a6c780c59ca3e6e785cb9e742ce4a9953965 | [
"MIT"
] | 1 | 2020-11-02T18:11:45.000Z | 2020-11-02T18:11:45.000Z | """Collection of Keras models for hierarchical GANs."""
# Imports
from keras.layers.core import Dense, Reshape, Dropout
from keras.layers import Input, merge
from keras.models import Model
from keras.layers.wrappers import TimeDistributed, Bidirectional
from keras.layers.recurrent import LSTM
from keras import backend... | 31.846626 | 79 | 0.595839 |
from keras.layers.core import Dense, Reshape, Dropout
from keras.layers import Input, merge
from keras.models import Model
from keras.layers.wrappers import TimeDistributed, Bidirectional
from keras.layers.recurrent import LSTM
from keras import backend as K
from keras.constraints import maxnorm
def geometry_embedde... | true | true |
1c0230a0f8297c18a91ff00b7df82e2889631a98 | 3,487 | py | Python | crackshot/views/base_menu_bar.py | Evan-Hsieh/crackshot | 7f493c8fd5171ab052236f98b0e194cc53d448de | [
"MIT"
] | null | null | null | crackshot/views/base_menu_bar.py | Evan-Hsieh/crackshot | 7f493c8fd5171ab052236f98b0e194cc53d448de | [
"MIT"
] | null | null | null | crackshot/views/base_menu_bar.py | Evan-Hsieh/crackshot | 7f493c8fd5171ab052236f98b0e194cc53d448de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Sep 12 2010)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################
impor... | 36.705263 | 120 | 0.616289 |
import wx
id_m_file_create_project = 1000
id_file_open_project = 1001
id_m_file_save_project = 1002
id_m_para_set_para = 1003
id_m_para_check_para = 1004
id_m_cal_cal = 1005
id_m_cal_draw = 1006
id_m_help_guide = 1007
id_m_about_version = 1008
id_m_about_copyright = 1009
class BaseMenuBar(wx.MenuBar):
def __i... | true | true |
1c0230bb78a56a74fddcc6cee94ab33325dfab1b | 1,718 | py | Python | src/sentry/runner/commands/init.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 4 | 2016-03-16T07:21:36.000Z | 2017-09-04T07:29:56.000Z | src/sentry/runner/commands/init.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | 8 | 2019-12-28T23:49:55.000Z | 2022-03-02T04:34:18.000Z | src/sentry/runner/commands/init.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | 1 | 2017-04-08T04:09:18.000Z | 2017-04-08T04:09:18.000Z | """
sentry.runner.commands.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import os
import click
@click.command()
@click.option('--dev', default=False, is_... | 33.686275 | 109 | 0.694412 | from __future__ import absolute_import, print_function
import os
import click
@click.command()
@click.option('--dev', default=False, is_flag=True, help='Use settings more conducive to local development.')
@click.argument('directory', required=False)
@click.pass_context
def init(ctx, dev, directory):
from sentry.... | true | true |
1c02320b24138fbd46d2b707e33e64b233edb91e | 5,127 | py | Python | models/SemanticSegmentation/FisheyeMODNet.py | Dou-Yu-xuan/deep-learning-visal | 82978f454c7f2662d0eb972b5a4a1e5d5961b232 | [
"Apache-2.0"
] | 150 | 2021-12-10T01:21:06.000Z | 2022-03-30T08:13:42.000Z | models/SemanticSegmentation/FisheyeMODNet.py | Curdboycc/torch-template-for-deep-learning | da1ebc527d44c8c5a524e757a1d784ba37ec2d5c | [
"Apache-2.0"
] | 2 | 2021-12-23T04:59:54.000Z | 2021-12-23T06:23:24.000Z | models/SemanticSegmentation/FisheyeMODNet.py | Curdboycc/torch-template-for-deep-learning | da1ebc527d44c8c5a524e757a1d784ba37ec2d5c | [
"Apache-2.0"
] | 54 | 2021-12-10T03:36:27.000Z | 2022-03-22T11:57:12.000Z | import torch
import torch.nn as nn
def Conv3x3BNReLU(in_channels,out_channels,stride,groups):
return nn.Sequential(
nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=stride, padding=1,groups=groups),
nn.BatchNorm2d(out_channels),
nn.ReLU6(inplac... | 39.744186 | 134 | 0.645602 | import torch
import torch.nn as nn
def Conv3x3BNReLU(in_channels,out_channels,stride,groups):
return nn.Sequential(
nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=stride, padding=1,groups=groups),
nn.BatchNorm2d(out_channels),
nn.ReLU6(inplac... | true | true |
1c02324f2dd3a28c36d60798dcebddd0b891dedb | 4,727 | py | Python | skl2onnx/operator_converters/scaler_op.py | elcolie/sklearn-onnx | 004fa39cb995ada0cde232ae8e30341018f450ac | [
"MIT"
] | null | null | null | skl2onnx/operator_converters/scaler_op.py | elcolie/sklearn-onnx | 004fa39cb995ada0cde232ae8e30341018f450ac | [
"MIT"
] | null | null | null | skl2onnx/operator_converters/scaler_op.py | elcolie/sklearn-onnx | 004fa39cb995ada0cde232ae8e30341018f450ac | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import nu... | 43.768519 | 79 | 0.607997 |
import numpy as np
from sklearn.preprocessing import MaxAbsScaler, MinMaxScaler
from sklearn.preprocessing import RobustScaler, StandardScaler
from ..algebra.onnx_ops import OnnxSub, OnnxDiv, OnnxCast
from ..common._registration import register_converter
from ..common.data_types import guess_numpy_type, guess_proto_ty... | true | true |
1c02330a7ab2c337698374bfb911233c86ac39fc | 7,289 | py | Python | distributed_computing/client.py | boaz85/DistributedComputing | e957b2a3b8d578bd696d38d25b9d8f881e90fed5 | [
"MIT"
] | null | null | null | distributed_computing/client.py | boaz85/DistributedComputing | e957b2a3b8d578bd696d38d25b9d8f881e90fed5 | [
"MIT"
] | null | null | null | distributed_computing/client.py | boaz85/DistributedComputing | e957b2a3b8d578bd696d38d25b9d8f881e90fed5 | [
"MIT"
] | 1 | 2021-09-19T07:50:08.000Z | 2021-09-19T07:50:08.000Z | import atexit
import os
import signal
import socket
import time
from collections import Counter
from multiprocessing import Process
import GPUtil
import psutil
from distributed_computing.common import RedisQueue
from distributed_computing.globals import MANAGEMENT_Q_NAME
class ExperimentWorkerExecutor(Process):
... | 37.379487 | 116 | 0.630265 | import atexit
import os
import signal
import socket
import time
from collections import Counter
from multiprocessing import Process
import GPUtil
import psutil
from distributed_computing.common import RedisQueue
from distributed_computing.globals import MANAGEMENT_Q_NAME
class ExperimentWorkerExecutor(Process):
... | true | true |
1c023657ed9ca6859247f94b5edd3ca52f0d92ba | 906 | py | Python | src/min_avg_two_slice.py | RomanoViolet/Python3 | 94af932466edbb1930a63f3852bb8494a7c48a41 | [
"MIT"
] | null | null | null | src/min_avg_two_slice.py | RomanoViolet/Python3 | 94af932466edbb1930a63f3852bb8494a7c48a41 | [
"MIT"
] | null | null | null | src/min_avg_two_slice.py | RomanoViolet/Python3 | 94af932466edbb1930a63f3852bb8494a7c48a41 | [
"MIT"
] | null | null | null | def solution(A):
"""
Need to check only size-2 and size-3 slices as any larger slice can be combined by combining
size-2 and size-3 slices.
Also, since the mean of two numbers (or, two non-overlapping slices) must lie between the mean of individual slices,
therefore, finding min of size-2 and size-... | 30.2 | 120 | 0.580574 | def solution(A):
import sys
min_idx = -1
global_min = sys.maxsize
for i in range(len(A)-1):
size_2_min = (A[i] + A[i+1])/2.0
if global_min > size_2_min:
global_min = size_2_min
min_idx = i
if i >= len(A) - 2:
continue
size_3_min = (A[i... | true | true |
1c0236761abed9d8e04194b266cc34076f10d8a9 | 719 | py | Python | tests/unit_tests/test_tethys_services/test_backends/test_okta.py | ezrajrice/tethys | 238271ebb09913f1f57b0d127fd5c81bb4780a0a | [
"BSD-2-Clause"
] | 79 | 2015-10-05T13:13:28.000Z | 2022-02-01T12:30:33.000Z | tests/unit_tests/test_tethys_services/test_backends/test_okta.py | ezrajrice/tethys | 238271ebb09913f1f57b0d127fd5c81bb4780a0a | [
"BSD-2-Clause"
] | 542 | 2015-08-12T22:11:32.000Z | 2022-03-29T22:18:08.000Z | tests/unit_tests/test_tethys_services/test_backends/test_okta.py | Aquaveo/tethys | 15f67c3fb9458d3af2733542be5ea6391f33b222 | [
"BSD-2-Clause"
] | 71 | 2016-01-16T01:03:41.000Z | 2022-03-31T17:55:54.000Z | from django import test
from tethys_services.backends.okta import OktaOpenIdConnectMultiTenant, OktaOauth2MultiTenant
from tethys_services.backends.multi_tenant_mixin import MultiTenantMixin
class OktaOpenIdConnectMultiTenantBackendTest(test.SimpleTestCase):
def setUp(self):
pass
def tearDown(self):... | 23.966667 | 93 | 0.741307 | from django import test
from tethys_services.backends.okta import OktaOpenIdConnectMultiTenant, OktaOauth2MultiTenant
from tethys_services.backends.multi_tenant_mixin import MultiTenantMixin
class OktaOpenIdConnectMultiTenantBackendTest(test.SimpleTestCase):
def setUp(self):
pass
def tearDown(self):... | true | true |
1c023694e4cffe8cf86a448410fbf4f5180bda27 | 1,301 | py | Python | project-3/percolation.py | Schoyen/FYS4460 | 0c6ba1deefbfd5e9d1657910243afc2297c695a3 | [
"MIT"
] | 1 | 2019-08-29T16:29:18.000Z | 2019-08-29T16:29:18.000Z | project-3/percolation.py | Schoyen/FYS4460 | 0c6ba1deefbfd5e9d1657910243afc2297c695a3 | [
"MIT"
] | null | null | null | project-3/percolation.py | Schoyen/FYS4460 | 0c6ba1deefbfd5e9d1657910243afc2297c695a3 | [
"MIT"
] | 1 | 2020-05-27T14:01:36.000Z | 2020-05-27T14:01:36.000Z | import warnings
import numpy as np
import scipy.ndimage
import scipy.optimize
import skimage
def compute_percolation_probability(L, p, num_samples):
num_percolating = 0
for i in range(num_samples):
system = np.random.rand(L, L) < p
labels, num_features = scipy.ndimage.measurements.label(syst... | 22.431034 | 71 | 0.578017 | import warnings
import numpy as np
import scipy.ndimage
import scipy.optimize
import skimage
def compute_percolation_probability(L, p, num_samples):
num_percolating = 0
for i in range(num_samples):
system = np.random.rand(L, L) < p
labels, num_features = scipy.ndimage.measurements.label(syst... | true | true |
1c0236e445d0b44a99f1a6f8186fdea0ad825b76 | 153,182 | py | Python | venv/Lib/site-packages/paho/mqtt/client.py | fearmansighah/gdsc-iot2-workshop | 6036947981924e4319820ec8cfaf2edaecbfc73a | [
"MIT"
] | 2 | 2022-03-25T10:21:16.000Z | 2022-03-29T06:51:22.000Z | venv/Lib/site-packages/paho/mqtt/client.py | fearmansighah/gdsc-iot2-workshop | 6036947981924e4319820ec8cfaf2edaecbfc73a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/paho/mqtt/client.py | fearmansighah/gdsc-iot2-workshop | 6036947981924e4319820ec8cfaf2edaecbfc73a | [
"MIT"
] | 1 | 2022-03-25T10:21:18.000Z | 2022-03-25T10:21:18.000Z | # Copyright (c) 2012-2019 Roger Light and others
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# htt... | 38.391479 | 137 | 0.589488 |
import base64
import hashlib
import logging
import string
import struct
import sys
import threading
import time
import uuid
from .matcher import MQTTMatcher
from .properties import Properties
from .reasoncodes import ReasonCodes
from .subscribeoptions import SubscribeOptions
import collections
import errno
import os... | true | true |
1c0237ad65ca1218e8e6cde4a565bd8181d5d4ff | 2,748 | py | Python | bindings/python/tests-py/test_suite.py | ismailbaskin/jsonschema-rs | da5d124b521d33caa6d71ec8ec67c407f0ff2c22 | [
"MIT"
] | 212 | 2020-05-11T18:58:59.000Z | 2022-03-27T09:05:23.000Z | bindings/python/tests-py/test_suite.py | ismailbaskin/jsonschema-rs | da5d124b521d33caa6d71ec8ec67c407f0ff2c22 | [
"MIT"
] | 278 | 2020-03-25T17:09:56.000Z | 2022-03-29T12:43:07.000Z | bindings/python/tests-py/test_suite.py | ismailbaskin/jsonschema-rs | da5d124b521d33caa6d71ec8ec67c407f0ff2c22 | [
"MIT"
] | 49 | 2020-05-11T18:06:34.000Z | 2022-03-30T07:47:36.000Z | import json
import os
import random
import socket
import subprocess
import sys
from time import sleep
from urllib.parse import urlparse
import pytest
import jsonschema_rs
TEST_SUITE_PATH = "../../jsonschema/tests/suite"
EXPONENTIAL_BASE = 2
JITTER = (0.0, 0.5)
INITIAL_RETRY_DELAY = 0.05
MAX_WAITING_RETRIES = 10
de... | 29.869565 | 116 | 0.674309 | import json
import os
import random
import socket
import subprocess
import sys
from time import sleep
from urllib.parse import urlparse
import pytest
import jsonschema_rs
TEST_SUITE_PATH = "../../jsonschema/tests/suite"
EXPONENTIAL_BASE = 2
JITTER = (0.0, 0.5)
INITIAL_RETRY_DELAY = 0.05
MAX_WAITING_RETRIES = 10
de... | true | true |
1c02382c7e625dbf04310157fa56a467e20bf0b2 | 9,462 | py | Python | revscoring/features/wikitext/features/chars.py | mariushoch/revscoring | 5ecd54d31c4088b6f142c0ef54116cc5bdce0ff2 | [
"MIT"
] | 2 | 2016-10-26T18:58:53.000Z | 2017-06-22T20:11:20.000Z | revscoring/features/wikitext/features/chars.py | mariushoch/revscoring | 5ecd54d31c4088b6f142c0ef54116cc5bdce0ff2 | [
"MIT"
] | null | null | null | revscoring/features/wikitext/features/chars.py | mariushoch/revscoring | 5ecd54d31c4088b6f142c0ef54116cc5bdce0ff2 | [
"MIT"
] | null | null | null | from itertools import groupby
from ....datasources.meta import mappers
from ...feature import Feature
from ...meta import aggregators
class Revision:
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.chars = aggregators.len(
self.datasources.text,
... | 40.26383 | 78 | 0.623335 | from itertools import groupby
from ....datasources.meta import mappers
from ...feature import Feature
from ...meta import aggregators
class Revision:
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.chars = aggregators.len(
self.datasources.text,
... | true | true |
1c02390b9df47c812bd299bae39554141edfe9a4 | 13,742 | py | Python | icrestimator.py | Injector-Spenral/libswervedrive | 4981d7103aaded08464b8c78b65b452f2ac41b0d | [
"MIT"
] | null | null | null | icrestimator.py | Injector-Spenral/libswervedrive | 4981d7103aaded08464b8c78b65b452f2ac41b0d | [
"MIT"
] | null | null | null | icrestimator.py | Injector-Spenral/libswervedrive | 4981d7103aaded08464b8c78b65b452f2ac41b0d | [
"MIT"
] | null | null | null | import numpy as np
import math
class ICREstimator:
# constants used in the lmda estimation algo
eta_lmda: float = 1e-3 # TODO: figure out what values this should be
eta_delta: float = 1e-3 # TODO: figure out what values this should be
min_delta_size: float = 1e-3 # TODO: figure out what value this sh... | 44.186495 | 98 | 0.563455 | import numpy as np
import math
class ICREstimator:
eta_lmda: float = 1e-3 eta_delta: float = 1e-3 min_delta_size: float = 1e-3 max_iter = 3
def __init__(self, epsilon_init: np.ndarray, modules_alpha: np.ndarray, modules_l: np.ndarray,
modules_b: np.ndarray):
self.ep... | true | true |
1c023974b1de4c36d11f02ec1d92298d2ecde6f5 | 3,949 | py | Python | fairseq/optim/fairseq_optimizer.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 429 | 2020-08-04T01:27:22.000Z | 2022-03-20T06:37:52.000Z | fairseq/optim/fairseq_optimizer.py | TokisakiKurumi2001/delight | ba340f2f4c2c541ceb126f87b219864058565505 | [
"MIT"
] | 42 | 2020-11-19T09:49:21.000Z | 2022-03-21T09:55:24.000Z | fairseq/optim/fairseq_optimizer.py | TokisakiKurumi2001/delight | ba340f2f4c2c541ceb126f87b219864058565505 | [
"MIT"
] | 49 | 2020-08-05T11:21:32.000Z | 2022-02-25T12:13:38.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq import utils
class FairseqOptimizer(object):
def __init__(self, args):
super().__init__()
se... | 32.636364 | 87 | 0.645227 |
import torch
from fairseq import utils
class FairseqOptimizer(object):
def __init__(self, args):
super().__init__()
self.args = args
@staticmethod
def add_args(parser):
pass
@property
def optimizer(self):
if not hasattr(self, '_optimizer'):
raise No... | true | true |
1c023a7fab14254bd6ec8ad335a5b3a196d2e061 | 9,425 | py | Python | demucs/wav.py | i9nn/demucs | f17a7af8cd99d0b275d399f55b3ca5bf8dea2e4f | [
"MIT"
] | 1 | 2021-12-15T17:10:32.000Z | 2021-12-15T17:10:32.000Z | demucs/wav.py | i9nn/demucs | f17a7af8cd99d0b275d399f55b3ca5bf8dea2e4f | [
"MIT"
] | null | null | null | demucs/wav.py | i9nn/demucs | f17a7af8cd99d0b275d399f55b3ca5bf8dea2e4f | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Loading wav based datasets, including MusdbHQ."""
from collections import OrderedDict
import hashlib
import math
import ... | 38.786008 | 100 | 0.605411 |
from collections import OrderedDict
import hashlib
import math
import json
import os
from pathlib import Path
import tqdm
import musdb
import julius
import torch as th
from torch import distributed
import torchaudio as ta
from torch.nn import functional as F
from .audio import convert_audio_channels
from . import di... | true | true |
1c023b20c5ca6705a3f35cfdb79e269913a577c6 | 9,664 | py | Python | architecture_view_sdk/model/container/container_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | architecture_view_sdk/model/container/container_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | architecture_view_sdk/model/container/container_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: container.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | 57.52381 | 1,185 | 0.78839 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
1c023bd88659300193cfc7d28563a8aca81d4240 | 771 | py | Python | multilabel_classifiers/subsets.py | zcikojevic/toxic-language-detection | 32e0e83fbc5d341dbb77bfa677f78dce82960861 | [
"MIT"
] | 1 | 2019-07-02T08:12:21.000Z | 2019-07-02T08:12:21.000Z | multilabel_classifiers/subsets.py | zcikojevic/toxic-language-detection | 32e0e83fbc5d341dbb77bfa677f78dce82960861 | [
"MIT"
] | null | null | null | multilabel_classifiers/subsets.py | zcikojevic/toxic-language-detection | 32e0e83fbc5d341dbb77bfa677f78dce82960861 | [
"MIT"
] | null | null | null | from run_multilabel_classifier import _load_comments
import os
import numpy as np
from pprint import pprint
import pandas as pd
data_path = os.path.abspath(os.path.join('.', 'data/train.csv'))
data = pd.read_csv(data_path, sep=',')
X, y = np.array(data['comment_text']), np.array(data[data.columns[2:]])
labels = np.a... | 35.045455 | 115 | 0.690013 | from run_multilabel_classifier import _load_comments
import os
import numpy as np
from pprint import pprint
import pandas as pd
data_path = os.path.abspath(os.path.join('.', 'data/train.csv'))
data = pd.read_csv(data_path, sep=',')
X, y = np.array(data['comment_text']), np.array(data[data.columns[2:]])
labels = np.a... | true | true |
1c023c6d7d2340409fc1582ea22e1762e6c3ce52 | 2,980 | py | Python | electricity-demand-byoc-multimodel-endpoint/container/test_model_handler.py | daekeun-ml/time-series-on-aws-hol | e670d653e798826c20d32c4e60a0a1ea3d5d8e50 | [
"MIT"
] | 5 | 2020-09-12T19:29:30.000Z | 2022-01-01T05:23:54.000Z | electricity-demand-byoc-multimodel-endpoint/container/test_model_handler.py | daekeun-ml/time-series-on-aws-hol | e670d653e798826c20d32c4e60a0a1ea3d5d8e50 | [
"MIT"
] | null | null | null | electricity-demand-byoc-multimodel-endpoint/container/test_model_handler.py | daekeun-ml/time-series-on-aws-hol | e670d653e798826c20d32c4e60a0a1ea3d5d8e50 | [
"MIT"
] | 5 | 2020-09-12T19:27:17.000Z | 2021-07-01T08:23:21.000Z | import io
import json
from typing import List
import pytest
from gluonts.model.predictor import Predictor
from model_handler import ModelHandler
# Define some helper classes
class Context(object):
def __init__(self, system_properties):
self.system_properties = system_properties
class Request(object):
... | 36.790123 | 338 | 0.682886 | import io
import json
from typing import List
import pytest
from gluonts.model.predictor import Predictor
from model_handler import ModelHandler
class Context(object):
def __init__(self, system_properties):
self.system_properties = system_properties
class Request(object):
def __init__(self, body):
... | true | true |
1c023d00eeb0cbce3d0a7123467c807c8d2e6224 | 21,953 | py | Python | ml3d/torch/models/sparseconvnet.py | thomasbrockmeier-ams/Open3D-ML | 1e362bbf133537668923905a12a15c540d9b689d | [
"MIT"
] | 7 | 2021-08-11T02:21:37.000Z | 2022-01-15T19:32:04.000Z | ml3d/torch/models/sparseconvnet.py | thomasbrockmeier-ams/Open3D-ML | 1e362bbf133537668923905a12a15c540d9b689d | [
"MIT"
] | 1 | 2021-08-31T09:06:08.000Z | 2021-08-31T09:06:08.000Z | ml3d/torch/models/sparseconvnet.py | thomasbrockmeier-ams/Open3D-ML | 1e362bbf133537668923905a12a15c540d9b689d | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from .base_model import BaseModel
from ...utils import MODEL
from ..modules.losses import filter_valid_label
from ...datasets.augment import SemsegAugmentation
from open3d.ml.torch.layers import SparseConv, SparseConvTranspose
from open3d.ml.torch.ops import voxeli... | 33.2118 | 80 | 0.547852 | import numpy as np
import torch
import torch.nn as nn
from .base_model import BaseModel
from ...utils import MODEL
from ..modules.losses import filter_valid_label
from ...datasets.augment import SemsegAugmentation
from open3d.ml.torch.layers import SparseConv, SparseConvTranspose
from open3d.ml.torch.ops import voxeli... | true | true |
1c023d6b099f10c3eb9600e382e2e54aa7a49fdc | 443 | py | Python | tests/functionality/test_filter_variants.py | Varstation/genmod | 991a0fca36936b5dde49a95e8ea1d4336288c7c0 | [
"MIT"
] | 46 | 2015-01-15T17:53:22.000Z | 2021-08-09T09:35:29.000Z | tests/functionality/test_filter_variants.py | Varstation/genmod | 991a0fca36936b5dde49a95e8ea1d4336288c7c0 | [
"MIT"
] | 55 | 2015-06-04T09:09:29.000Z | 2021-05-20T10:48:18.000Z | tests/functionality/test_filter_variants.py | moonso/genmod | 99b6c9510ffc67fd54c07eab24de5db7345ef95d | [
"MIT"
] | 15 | 2015-02-06T04:08:23.000Z | 2021-05-04T10:06:58.000Z | from genmod.commands import filter_command
from click.testing import CliRunner
ANNOTATED_VCF_FILE = "tests/fixtures/test_vcf_annotated.vcf"
from genmod import logger
from genmod.log import init_log
init_log(logger, loglevel="INFO")
def test_genmod_filter():
"""docstring for test_genmod_annotate_models"""
ru... | 24.611111 | 64 | 0.774266 | from genmod.commands import filter_command
from click.testing import CliRunner
ANNOTATED_VCF_FILE = "tests/fixtures/test_vcf_annotated.vcf"
from genmod import logger
from genmod.log import init_log
init_log(logger, loglevel="INFO")
def test_genmod_filter():
runner = CliRunner()
result = runner.invoke(filter... | true | true |
1c023e02059a5c4e1b74f38f9745ab60b91c75dd | 673 | py | Python | tests/test_config.py | boerwastaken/pgcli | 6d6ab3dab755759ea51ffdc7e7cc2e49379eca4f | [
"BSD-3-Clause"
] | 1 | 2019-08-22T07:11:16.000Z | 2019-08-22T07:11:16.000Z | tests/test_config.py | boerwastaken/pgcli | 6d6ab3dab755759ea51ffdc7e7cc2e49379eca4f | [
"BSD-3-Clause"
] | null | null | null | tests/test_config.py | boerwastaken/pgcli | 6d6ab3dab755759ea51ffdc7e7cc2e49379eca4f | [
"BSD-3-Clause"
] | 1 | 2022-03-26T12:14:13.000Z | 2022-03-26T12:14:13.000Z | import os
import stat
import pytest
from pgcli.config import ensure_dir_exists
def test_ensure_file_parent(tmpdir):
subdir = tmpdir.join("subdir")
rcfile = subdir.join("rcfile")
ensure_dir_exists(str(rcfile))
def test_ensure_existing_dir(tmpdir):
rcfile = str(tmpdir.mkdir("subdir").join("rcfile"))... | 21.709677 | 62 | 0.720654 | import os
import stat
import pytest
from pgcli.config import ensure_dir_exists
def test_ensure_file_parent(tmpdir):
subdir = tmpdir.join("subdir")
rcfile = subdir.join("rcfile")
ensure_dir_exists(str(rcfile))
def test_ensure_existing_dir(tmpdir):
rcfile = str(tmpdir.mkdir("subdir").join("rcfile"))... | true | true |
1c023e7b1f7451007f2bcbf538130bdea89fbe73 | 34,022 | py | Python | test/sql/test_quote.py | foxyblue/sqlalchemy | a15aeba4fb22503c1eb235fdc2e7a574136ca7dc | [
"MIT"
] | 1 | 2020-12-09T21:56:16.000Z | 2020-12-09T21:56:16.000Z | test/sql/test_quote.py | foxyblue/sqlalchemy | a15aeba4fb22503c1eb235fdc2e7a574136ca7dc | [
"MIT"
] | null | null | null | test/sql/test_quote.py | foxyblue/sqlalchemy | a15aeba4fb22503c1eb235fdc2e7a574136ca7dc | [
"MIT"
] | 1 | 2020-12-04T14:51:39.000Z | 2020-12-04T14:51:39.000Z | #!coding: utf-8
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchemy import ForeignKey
from sqlalchemy import Index
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import schema
from sqlalchemy i... | 32.588123 | 79 | 0.536065 |
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchemy import ForeignKey
from sqlalchemy import Index
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import schema
from sqlalchemy import select
fro... | true | true |
1c023eb979dc5e85dc64e09c3c7045f8ba1ce293 | 7,095 | py | Python | physical/cluster.py | yangsuli/tam-simulation | 6e6b124f745cd464584cc906ddd0f925325b9a22 | [
"MIT"
] | 8 | 2018-11-10T11:49:17.000Z | 2022-02-15T08:55:31.000Z | physical/cluster.py | yangsuli/tam-simulation | 6e6b124f745cd464584cc906ddd0f925325b9a22 | [
"MIT"
] | null | null | null | physical/cluster.py | yangsuli/tam-simulation | 6e6b124f745cd464584cc906ddd0f925325b9a22 | [
"MIT"
] | 3 | 2019-06-17T01:56:24.000Z | 2020-04-23T17:30:24.000Z | import sys
from scheduler import FIFOScheduler, get_scheduler
from seda_config import ConfigError
from seda_resource import Resource
class PhysicalNode(object):
def __init__(self, env, name, cpu_res, io_res, network_res):
self.env = env
self.name = name
self.cpu_res = cpu_res
self... | 46.071429 | 120 | 0.663002 | import sys
from scheduler import FIFOScheduler, get_scheduler
from seda_config import ConfigError
from seda_resource import Resource
class PhysicalNode(object):
def __init__(self, env, name, cpu_res, io_res, network_res):
self.env = env
self.name = name
self.cpu_res = cpu_res
self... | true | true |
1c023f353c81e829c01e9a3cb1d6e033275e7b02 | 3,655 | py | Python | tests/st/control/test_recrusive_fun.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/control/test_recrusive_fun.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/control/test_recrusive_fun.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 23.733766 | 78 | 0.584952 | import mindspore.context as context
from mindspore import Tensor, ms_function
from mindspore.common import dtype as mstype
from mindspore import ops
import mindspore.nn as nn
import numpy as np
ZERO = Tensor([0], mstype.int32)
ONE = Tensor([1], mstype.int32)
@ms_function
def f(x):
y = ZERO
if x < 0:
... | true | true |
1c023ff6778e32a0eb1313fa7aabf4b0350c99f2 | 64 | py | Python | demo.py | pdmccormick/pyconca2019-fun-with-compilers | 2f1025cc0b7ec182fcedab678a121a7ab93fb448 | [
"BSD-3-Clause"
] | 3 | 2019-11-17T17:56:56.000Z | 2020-02-25T18:05:05.000Z | demo.py | pdmccormick/pyconca2019-fun-with-compilers | 2f1025cc0b7ec182fcedab678a121a7ab93fb448 | [
"BSD-3-Clause"
] | null | null | null | demo.py | pdmccormick/pyconca2019-fun-with-compilers | 2f1025cc0b7ec182fcedab678a121a7ab93fb448 | [
"BSD-3-Clause"
] | null | null | null | names = [ 'Elaine', 'Chris', 'David', 'Peter', 'PyCon Canada' ]
| 32 | 63 | 0.578125 | names = [ 'Elaine', 'Chris', 'David', 'Peter', 'PyCon Canada' ]
| true | true |
1c02400d69c2d5a401a81c5d46841baf3c7c2e0e | 12,453 | py | Python | development/configuration.py | netcore-jsa/netbox-plugin-unimus | 09484d7f624f9f434e26ef4ae8221af5a4dce065 | [
"MIT"
] | 1 | 2021-06-29T08:46:03.000Z | 2021-06-29T08:46:03.000Z | development/configuration.py | netcore-jsa/netbox-plugin-unimus | 09484d7f624f9f434e26ef4ae8221af5a4dce065 | [
"MIT"
] | 5 | 2020-12-29T22:39:45.000Z | 2020-12-29T22:49:27.000Z | development/configuration.py | netcore-jsa/netbox-plugin-unimus | 09484d7f624f9f434e26ef4ae8221af5a4dce065 | [
"MIT"
] | null | null | null | """NetBox configuration."""
import os
from distutils.util import strtobool
from packaging import version
from django.core.exceptions import ImproperlyConfigured
from .settings import VERSION # pylint: disable=relative-beyond-top-level
NETBOX_RELEASE_CURRENT = version.parse(VERSION)
NETBOX_RELEASE_28 = version.parse(... | 43.694737 | 120 | 0.72344 | import os
from distutils.util import strtobool
from packaging import version
from django.core.exceptions import ImproperlyConfigured
from .settings import VERSION
NETBOX_RELEASE_CURRENT = version.parse(VERSION)
NETBOX_RELEASE_28 = version.parse("2.8")
NETBOX_RELEASE_29 = version.parse("2.9")
NETBOX_RELEASE_211 = ver... | true | true |
1c024079b60025372314dd362bd6b4854f57a88c | 38,831 | py | Python | vendor/github.com/Yawning/chacha20/chacha20_amd64.py | Justsoos/dnsproxy | 9bfbdd716cec61103da1ec41584172ede5f018f3 | [
"MIT"
] | 207 | 2017-07-29T04:27:07.000Z | 2022-02-04T08:38:36.000Z | vendor/github.com/Yawning/chacha20/chacha20_amd64.py | dou4cc/dnsproxy | fcd4a9cb61ff86281016aaeecc6ffd6040bd45b5 | [
"MIT"
] | 13 | 2017-07-31T16:48:48.000Z | 2020-01-15T15:12:12.000Z | vendor/github.com/Yawning/chacha20/chacha20_amd64.py | dou4cc/dnsproxy | fcd4a9cb61ff86281016aaeecc6ffd6040bd45b5 | [
"MIT"
] | 46 | 2017-07-29T04:40:52.000Z | 2022-02-11T05:10:55.000Z | #!/usr/bin/env python3
#
# To the extent possible under law, Yawning Angel has waived all copyright
# and related or neighboring rights to chacha20, using the Creative
# Commons "CC0" public domain dedication. See LICENSE or
# <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
#
# cgo sucks. Plan 9... | 29.93909 | 89 | 0.58819 |
#
# Code based on Ted Krovetz's vec128 C implementation, with corrections
from peachpy import *
from peachpy.x86_64 import *
x = Argument(ptr(uint32_t))
inp = Argument(ptr(const_uint8_t))
outp = Argument(ptr(uint8_t))
nrBlocks = Argument(ptr(size_t))
def ROTW16_sse2(tmp, d):
MOVDQA(tmp, d)
PSLLD(tmp, 16)
... | true | true |
1c0240a4d145f2e59686ed365faf0ab5abd8addb | 12,823 | py | Python | test/functional/interface_rest.py | CryptSen/aych | 3f37edbbffa220c2cda083fca5084890f12e710d | [
"MIT"
] | null | null | null | test/functional/interface_rest.py | CryptSen/aych | 3f37edbbffa220c2cda083fca5084890f12e710d | [
"MIT"
] | 253 | 2020-04-01T23:10:52.000Z | 2020-04-14T05:45:07.000Z | test/functional/interface_rest.py | CryptSen/aych | 3f37edbbffa220c2cda083fca5084890f12e710d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015 - 2020 The AYCHDeveloper.
# Distributed under the MIT software license, the AGPL-3.0+, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
# file LICENSE or https://www.gnu.org/licenses.
"""Test the REST API."""
import binascii
from de... | 41.905229 | 153 | 0.649536 |
import binascii
from decimal import Decimal
from enum import Enum
from io import BytesIO
import json
from struct import pack, unpack
import http.client
import urllib.parse
from test_framework.test_framework import AychTestFramework
from test_framework.util import (
assert_equal,
assert_greater_than,
ass... | true | true |
1c0240b9e7146d39fad172ddb392d67ddf241b8d | 20,549 | py | Python | flux_mito/model_219.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_mito/model_219.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_mito/model_219.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.134259 | 798 | 0.804127 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', '... | true | true |
1c024132f5bfcb7deaf44141618641bb6d985bf9 | 8,692 | py | Python | imagepy/app/loader.py | FengZhiheng/imagepy | b8edb21df12a2d18688d150a2f5307dbb4b43eee | [
"BSD-4-Clause"
] | null | null | null | imagepy/app/loader.py | FengZhiheng/imagepy | b8edb21df12a2d18688d150a2f5307dbb4b43eee | [
"BSD-4-Clause"
] | null | null | null | imagepy/app/loader.py | FengZhiheng/imagepy | b8edb21df12a2d18688d150a2f5307dbb4b43eee | [
"BSD-4-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 6 23:45:59 2017
@author: yxl
"""
import os, sys, os.path as osp
from glob import glob
from sciapp.action import Macros, Widget#, Report
from .. import root_dir
from .manager import DocumentManager, DictManager
from codecs import open
def get_path(root, path):
for i ... | 36.987234 | 82 | 0.483893 | import os, sys, os.path as osp
from glob import glob
from sciapp.action import Macros, Widgetfrom .. import root_dir
from .manager import DocumentManager, DictManager
from codecs import open
def get_path(root, path):
for i in range(10,0,-1):
if not '../'*i in path: continue
s = root
for j i... | true | true |
1c0241a03e38d684da54096b42ce54e2f0da9fa0 | 21,813 | py | Python | authorizenet/authorizenet/doctype/authorizenet_settings/authorizenet_settings.py | Alchez/authorizenet | f94e6b073a230e96b940a93da631d728bb40d28a | [
"MIT"
] | 1 | 2018-12-12T15:42:45.000Z | 2018-12-12T15:42:45.000Z | authorizenet/authorizenet/doctype/authorizenet_settings/authorizenet_settings.py | Alchez/authorizenet | f94e6b073a230e96b940a93da631d728bb40d28a | [
"MIT"
] | 2 | 2017-12-13T07:46:23.000Z | 2019-12-30T05:50:57.000Z | authorizenet/authorizenet/doctype/authorizenet_settings/authorizenet_settings.py | Alchez/authorizenet | f94e6b073a230e96b940a93da631d728bb40d28a | [
"MIT"
] | 8 | 2017-12-06T20:42:50.000Z | 2020-09-12T18:06:22.000Z | """
# Integrating Authorize.Net
### 1. Validate Currency Support
Example:
from frappe.integration_broker.doctype.integration_service.integration_service import get_integration_controller
controller = get_integration_controller("AuthorizeNet")
controller().validate_transaction_currency(currency)
### 2. Redirect ... | 31.983871 | 297 | 0.700912 |
from __future__ import unicode_literals
import frappe
from frappe import _, _dict
from frappe.utils import get_url, call_hook_method, flt
from frappe.model.document import Document
from frappe.integrations.utils import create_request_log, create_payment_gateway
import json
from datetime import datetime
import urllib
i... | true | true |
1c02437a279fb55755d05e34b5fdb1f38e9d9979 | 5,379 | py | Python | scraper/combine.py | rohanthomas1202/HypeInvesting-HackUTD | 8e4234ddcc7f207d87223e0986d759d3df0ccdd9 | [
"MIT"
] | null | null | null | scraper/combine.py | rohanthomas1202/HypeInvesting-HackUTD | 8e4234ddcc7f207d87223e0986d759d3df0ccdd9 | [
"MIT"
] | null | null | null | scraper/combine.py | rohanthomas1202/HypeInvesting-HackUTD | 8e4234ddcc7f207d87223e0986d759d3df0ccdd9 | [
"MIT"
] | null | null | null |
from flair.models import TextClassifier
from flair.data import Sentence
from newsapi import NewsApiClient
import tweepy
import praw
class Message:
def __init__(self, perception, popularity, platform):
self.perception = perception
self.popularity = popularity
self.platform = platform
c... | 34.261146 | 254 | 0.63655 |
from flair.models import TextClassifier
from flair.data import Sentence
from newsapi import NewsApiClient
import tweepy
import praw
class Message:
def __init__(self, perception, popularity, platform):
self.perception = perception
self.popularity = popularity
self.platform = platform
c... | true | true |
1c024384286174899d3d3261431e785cc28393bb | 220 | py | Python | musicProject/musicApp/urls.py | cs-fullstack-2019-fall/django-intro1-cw-mandani-tech | 0ef1e40b7f63369b5b603cf9e4fc0881ac612338 | [
"Apache-2.0"
] | null | null | null | musicProject/musicApp/urls.py | cs-fullstack-2019-fall/django-intro1-cw-mandani-tech | 0ef1e40b7f63369b5b603cf9e4fc0881ac612338 | [
"Apache-2.0"
] | null | null | null | musicProject/musicApp/urls.py | cs-fullstack-2019-fall/django-intro1-cw-mandani-tech | 0ef1e40b7f63369b5b603cf9e4fc0881ac612338 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.music),
path('shreya/', views.shreyaFunction),
path('rehman/', views.rehmanFunction),
path('alka/', views.alkaFunction),
] | 22 | 42 | 0.668182 | from django.urls import path
from . import views
urlpatterns = [
path('', views.music),
path('shreya/', views.shreyaFunction),
path('rehman/', views.rehmanFunction),
path('alka/', views.alkaFunction),
] | true | true |
1c02439b12f9f91dbeaab055efab4772bfb0dc4d | 22,624 | py | Python | web2py/applications/ControleEstoque/controllers/default.py | GuizaoBR/Controle-Estoque | b4d7e3c665a14ea77224fa448aaf7e3d4d6fe4ed | [
"Apache-2.0"
] | null | null | null | web2py/applications/ControleEstoque/controllers/default.py | GuizaoBR/Controle-Estoque | b4d7e3c665a14ea77224fa448aaf7e3d4d6fe4ed | [
"Apache-2.0"
] | null | null | null | web2py/applications/ControleEstoque/controllers/default.py | GuizaoBR/Controle-Estoque | b4d7e3c665a14ea77224fa448aaf7e3d4d6fe4ed | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# This is a sample controller
# this file is released under public domain and you can use without limitations
# -------------------------------------------------------------------------
import io
from gluon.tools import ... | 43.760155 | 161 | 0.567008 | import io
from gluon.tools import Mail
import time
mail = Mail()
mail.settings.server = "smtp.gmail.com:587"
mail.settings.sender = 'djangonoreplay@gmail.com'
mail.settings.login = 'djangonoreplay@gmail.com:GuizaoTech'
mail.settings.tls = True
from gluon.contrib.login_methods.email_auth import email_auth
def vali... | true | true |
1c0244597aa9888b398281b0906f02d140780d09 | 3,925 | py | Python | backend/pyrogram/raw/types/group_call.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/types/group_call.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/types/group_call.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 36.342593 | 120 | 0.620892 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
class GroupCall(TLObject):
__slots__: List[str] = ["id", "access_hash", "participa... | true | true |
1c0244bb2ad6d58e2cdf1777a437bca64263dcbf | 1,315 | py | Python | aux_scripts/relative_memory.py | lverwimp/state_gradients | 1dfa42df068d009d2dddbab7484c87bd7177ec1f | [
"MIT"
] | 1 | 2020-02-26T22:56:58.000Z | 2020-02-26T22:56:58.000Z | aux_scripts/relative_memory.py | lverwimp/state_gradients | 1dfa42df068d009d2dddbab7484c87bd7177ec1f | [
"MIT"
] | null | null | null | aux_scripts/relative_memory.py | lverwimp/state_gradients | 1dfa42df068d009d2dddbab7484c87bd7177ec1f | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# calculate relative memory =
# norm(avg gradient matrix * normalized difference vector) / largest singular value for avg gradient matrix
import sys, glob, os
import numpy as np
diff_vector = sys.argv[1]
grad_dir = sys.argv[2]
norm_emb_f = sys.argv[3]
if len(sys.argv) > 4:
name_avg = sys.ar... | 32.875 | 107 | 0.719392 |
import sys, glob, os
import numpy as np
diff_vector = sys.argv[1]
grad_dir = sys.argv[2]
norm_emb_f = sys.argv[3]
if len(sys.argv) > 4:
name_avg = sys.argv[4]
list_grads = glob.glob('{0}/delay_*_avg_{1}_norm.npy'.format(grad_dir, name_avg))
else:
list_grads = glob.glob('{0}/delay_*_avg_norm.npy'.format(gr... | true | true |
1c0245894ccd093ec70713293665b78ac624ee24 | 13,048 | py | Python | infoblox_netmri/api/broker/v2_2_0/script_broker.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/broker/v2_2_0/script_broker.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/broker/v2_2_0/script_broker.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | from ..broker import Broker
class ScriptBroker(Broker):
controller = "scripts"
def index(self, **kwargs):
"""Lists the available scripts. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is mos... | 34.61008 | 363 | 0.519083 | from ..broker import Broker
class ScriptBroker(Broker):
controller = "scripts"
def index(self, **kwargs):
return self.api_list_request(self._get_method_fullname("index"), kwargs)
def show(self, **kwargs):
return self.api_request(self.... | true | true |
1c0246e50d936b70e676d29f69b98a95b9135687 | 755 | py | Python | DirectCharity/urls.py | jyothisbenny/Direct_Charity | a7b4e36274032046ba1864067f75bc6cae02e9a1 | [
"MIT"
] | null | null | null | DirectCharity/urls.py | jyothisbenny/Direct_Charity | a7b4e36274032046ba1864067f75bc6cae02e9a1 | [
"MIT"
] | null | null | null | DirectCharity/urls.py | jyothisbenny/Direct_Charity | a7b4e36274032046ba1864067f75bc6cae02e9a1 | [
"MIT"
] | null | null | null | """DirectCharity URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 34.318182 | 77 | 0.711258 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
1c02472de2ead5864f9b20f364e342487b2036b5 | 13,543 | py | Python | src/Rect/scripts/rebuild_Rect.py | xylsxyls/xueyelingshuan | 61eb1c7c4f76c3eaf4cf26e4b2b37b6ed2abc5b9 | [
"MIT"
] | 3 | 2019-11-26T05:33:47.000Z | 2020-05-18T06:49:41.000Z | src/Rect/scripts/rebuild_Rect.py | xylsxyls/xueyelingshuan | 61eb1c7c4f76c3eaf4cf26e4b2b37b6ed2abc5b9 | [
"MIT"
] | null | null | null | src/Rect/scripts/rebuild_Rect.py | xylsxyls/xueyelingshuan | 61eb1c7c4f76c3eaf4cf26e4b2b37b6ed2abc5b9 | [
"MIT"
] | null | null | null | #!python3
# -*- coding:utf-8 -*-
import os
import sys
import time
import ctypes
import shutil
import subprocess
IsPy3 = sys.version_info[0] >= 3
if IsPy3:
import winreg
else:
import codecs
import _winreg as winreg
BuildType = 'Release'
IsRebuild = True
Build = 'Rebuild'
Update = False
Copy = False
CleanAl... | 38.042135 | 195 | 0.594551 | import os
import sys
import time
import ctypes
import shutil
import subprocess
IsPy3 = sys.version_info[0] >= 3
if IsPy3:
import winreg
else:
import codecs
import _winreg as winreg
BuildType = 'Release'
IsRebuild = True
Build = 'Rebuild'
Update = False
Copy = False
CleanAll = False
BuildTimeout = 30*60
Bi... | false | true |
1c0247614889d02210724252ae1d5900c0ef44e7 | 952 | py | Python | ninestargram_server/users/migrations/0012_auto_20180822_2103.py | apJammanbo/ninestargram-server | 6aaf5e49a4189da6df9af8afec921d97455d6841 | [
"MIT"
] | null | null | null | ninestargram_server/users/migrations/0012_auto_20180822_2103.py | apJammanbo/ninestargram-server | 6aaf5e49a4189da6df9af8afec921d97455d6841 | [
"MIT"
] | 11 | 2020-09-05T20:04:21.000Z | 2022-03-03T22:38:32.000Z | ninestargram_server/users/migrations/0012_auto_20180822_2103.py | apJammanbo/ninestargram-server | 6aaf5e49a4189da6df9af8afec921d97455d6841 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.8 on 2018-08-22 12:03
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0011_auto_20180822_0006'),
]
operations = [
migrations.AlterField(
model_name='user',
... | 31.733333 | 147 | 0.613445 |
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0011_auto_20180822_0006'),
]
operations = [
migrations.AlterField(
model_name='user',
name='followers',
field=... | true | true |
1c0247dcc873c02362458afb8b61bfdcd8f868e9 | 808 | py | Python | setup.py | ufal/pytreex | 9633c1420e6b4adecd73baaf761d26fa49708a61 | [
"Apache-2.0"
] | 11 | 2015-06-24T08:41:44.000Z | 2021-09-02T21:12:10.000Z | setup.py | ufal/pytreex | 9633c1420e6b4adecd73baaf761d26fa49708a61 | [
"Apache-2.0"
] | 4 | 2016-01-12T19:21:22.000Z | 2019-05-10T14:46:44.000Z | setup.py | ufal/pytreex | 9633c1420e6b4adecd73baaf761d26fa49708a61 | [
"Apache-2.0"
] | 3 | 2016-01-22T11:54:11.000Z | 2019-04-30T17:09:55.000Z | #!/usr/bin/env python
# -"- coding: utf-8 -"-
from distutils.core import setup
import codecs
setup(
name='PyTreex',
author='Ondrej Dusek',
packages=['pytreex', 'pytreex.core', 'pytreex.tool', 'pytreex.tool.ml',
'pytreex.tool.lexicon', 'pytreex.block', 'pytreex.block.t2a',
'pytr... | 32.32 | 82 | 0.612624 |
from distutils.core import setup
import codecs
setup(
name='PyTreex',
author='Ondrej Dusek',
packages=['pytreex', 'pytreex.core', 'pytreex.tool', 'pytreex.tool.ml',
'pytreex.tool.lexicon', 'pytreex.block', 'pytreex.block.t2a',
'pytreex.block.t2a.cs', 'pytreex.block.a2w', 'pytre... | true | true |
1c0248ffe1d1d136a35f16a10efaee38a3a38e03 | 2,160 | py | Python | tutorial/sadlife.py | fsbr/robot-arm | 5b481dda7cd0332adc895c49db697d8df5ea7728 | [
"MIT"
] | null | null | null | tutorial/sadlife.py | fsbr/robot-arm | 5b481dda7cd0332adc895c49db697d8df5ea7728 | [
"MIT"
] | null | null | null | tutorial/sadlife.py | fsbr/robot-arm | 5b481dda7cd0332adc895c49db697d8df5ea7728 | [
"MIT"
] | null | null | null | #
class Vertex:
def __init__(self,n):
self.name = n
self.neighbors = list()
self.distance = 9999
self.color = 'black'
def add_neighbor(self,v):
if v not in self.neighbors:
self.neighbors.append(v)
self.neighbors.sort()
class Graph:
... | 27.341772 | 99 | 0.499537 | class Vertex:
def __init__(self,n):
self.name = n
self.neighbors = list()
self.distance = 9999
self.color = 'black'
def add_neighbor(self,v):
if v not in self.neighbors:
self.neighbors.append(v)
self.neighbors.sort()
class Graph:
ver... | true | true |
1c0249527fa2184afd9a6ae89eafb923de7a2b51 | 15,129 | py | Python | espnet/lm/pytorch_backend/lm.py | ysk24ok/espnet | cf91a45e2a2c0b0c1ebf807d9dc107247fb73e3f | [
"Apache-2.0"
] | 8 | 2020-11-23T13:43:45.000Z | 2021-09-29T08:18:02.000Z | espnet/lm/pytorch_backend/lm.py | ysk24ok/espnet | cf91a45e2a2c0b0c1ebf807d9dc107247fb73e3f | [
"Apache-2.0"
] | 83 | 2020-09-14T15:28:59.000Z | 2021-04-19T23:07:45.000Z | espnet/lm/pytorch_backend/lm.py | ysk24ok/espnet | cf91a45e2a2c0b0c1ebf807d9dc107247fb73e3f | [
"Apache-2.0"
] | 4 | 2020-11-03T13:33:43.000Z | 2021-11-19T05:49:26.000Z | #!/usr/bin/env python3
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
# This code is ported from the following implementation written in Torch.
# https://github.com/chainer/chainer/blob/master/examples/ptb/train_ptb_custom_loop.py
"""LM training ... | 36.810219 | 88 | 0.637451 |
import copy
import json
import logging
import numpy as np
import torch
import torch.nn as nn
from torch.nn.parallel import data_parallel
from chainer import Chain
from chainer.dataset import convert
from chainer import reporter
from chainer import training
from chainer.training import extensions
from espnet.lm.lm_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.