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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73cd7959b4977f5f9409d5c3d63b88906bf112a | 399 | py | Python | backend/apps/family/migrations/0002_alter_family_id_grupo.py | jorgejimenez98/backend-evaluacion-desempenno | 08975303952608809375c5e2185bf20a84cc0f4e | [
"MIT"
] | null | null | null | backend/apps/family/migrations/0002_alter_family_id_grupo.py | jorgejimenez98/backend-evaluacion-desempenno | 08975303952608809375c5e2185bf20a84cc0f4e | [
"MIT"
] | null | null | null | backend/apps/family/migrations/0002_alter_family_id_grupo.py | jorgejimenez98/backend-evaluacion-desempenno | 08975303952608809375c5e2185bf20a84cc0f4e | [
"MIT"
] | null | null | null | # Generated by Django 3.2.2 on 2021-05-28 06:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('family', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='family',
name='id_grupo',
... | 21 | 73 | 0.60401 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('family', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='family',
name='id_grupo',
field=models.IntegerField(primary_key=True, ser... | true | true |
f73cd7d567aca912fa59ab9b173e698c0795c0e9 | 177 | py | Python | users/apps.py | intelligems/stolos | ca658aeea92b841f89992948a136214519dffcc7 | [
"MIT"
] | 5 | 2019-08-27T10:33:14.000Z | 2021-11-09T10:57:40.000Z | users/apps.py | intelligems/stolos | ca658aeea92b841f89992948a136214519dffcc7 | [
"MIT"
] | null | null | null | users/apps.py | intelligems/stolos | ca658aeea92b841f89992948a136214519dffcc7 | [
"MIT"
] | 3 | 2019-05-23T14:37:40.000Z | 2020-12-14T18:43:16.000Z | from __future__ import unicode_literals
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
import users.signals
| 16.090909 | 39 | 0.728814 | from __future__ import unicode_literals
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
import users.signals
| true | true |
f73cd7f0fc22b29974d493ff3a058d4a249f1f47 | 7,206 | py | Python | emotrix/Headset.py | henzer/EMOTRIX | 5d73f3bf0efa0fe92d2ea823ab57425cb1a1ed42 | [
"BSD-2-Clause"
] | null | null | null | emotrix/Headset.py | henzer/EMOTRIX | 5d73f3bf0efa0fe92d2ea823ab57425cb1a1ed42 | [
"BSD-2-Clause"
] | null | null | null | emotrix/Headset.py | henzer/EMOTRIX | 5d73f3bf0efa0fe92d2ea823ab57425cb1a1ed42 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Object representation for Headset device.
"""
import serial
import logging
from pymongo import MongoClient
from InputDeviceInterface import InputDeviceInterface
from HeadsetThreadReader import HeadsetThreadReader
from TimeBuffer import TimeBuffer
import helpers
import constants
class Hea... | 31.194805 | 79 | 0.593256 |
"""
Object representation for Headset device.
"""
import serial
import logging
from pymongo import MongoClient
from InputDeviceInterface import InputDeviceInterface
from HeadsetThreadReader import HeadsetThreadReader
from TimeBuffer import TimeBuffer
import helpers
import constants
class Headset(InputDeviceInterfa... | false | true |
f73cd8409539f599db3c3d3fa91b6e0842779d1c | 9,622 | py | Python | tests/test_hgvs_variantmapper_gcp.py | naomifox/hgvs | 5007142191cac8dba2272bad5b945a27c0a5cf87 | [
"Apache-2.0"
] | null | null | null | tests/test_hgvs_variantmapper_gcp.py | naomifox/hgvs | 5007142191cac8dba2272bad5b945a27c0a5cf87 | [
"Apache-2.0"
] | null | null | null | tests/test_hgvs_variantmapper_gcp.py | naomifox/hgvs | 5007142191cac8dba2272bad5b945a27c0a5cf87 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import pprint
import re
import sys
import os
import unittest
if sys.version_info < (3, ):
import unicodecsv as csv
else:
import csv
import pytest
from hgvs.exceptions import HGVSError
i... | 47.633663 | 165 | 0.518499 |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import pprint
import re
import sys
import os
import unittest
if sys.version_info < (3, ):
import unicodecsv as csv
else:
import csv
import pytest
from hgvs.exceptions import HGVSError
import hgvs.dataprovider... | true | true |
f73cd95bb6aa4920a4638441783cc502b84894db | 11,177 | py | Python | combine_sg2im_neural_motifs/model.py | LUGUANSONG/i2g2i | ec532f2e128301472478c3d8fe4c72929e2967a4 | [
"MIT"
] | null | null | null | combine_sg2im_neural_motifs/model.py | LUGUANSONG/i2g2i | ec532f2e128301472478c3d8fe4c72929e2967a4 | [
"MIT"
] | 3 | 2021-06-08T21:42:14.000Z | 2022-01-13T02:48:20.000Z | combine_sg2im_neural_motifs/model.py | LUGUANSONG/i2g2i | ec532f2e128301472478c3d8fe4c72929e2967a4 | [
"MIT"
] | null | null | null | from lib.object_detector import ObjectDetector, gather_res
import torch
import torch.nn as nn
import torch.nn.parallel
from combine_sg2im_neural_motifs.sg2im_model import Sg2ImModel
from combine_sg2im_neural_motifs.discriminators import PatchDiscriminator, AcCropDiscriminator
import os
from collections import defaultdi... | 40.205036 | 124 | 0.621007 | from lib.object_detector import ObjectDetector, gather_res
import torch
import torch.nn as nn
import torch.nn.parallel
from combine_sg2im_neural_motifs.sg2im_model import Sg2ImModel
from combine_sg2im_neural_motifs.discriminators import PatchDiscriminator, AcCropDiscriminator
import os
from collections import defaultdi... | true | true |
f73cd968a4fa0b9cc7113032ba81b1e6191e4673 | 994 | py | Python | toontown/shtiker/NPCFriendPage.py | journeyfan/toontown-journey | 7a4db507e5c1c38a014fc65588086d9655aaa5b4 | [
"MIT"
] | 1 | 2020-09-27T22:12:47.000Z | 2020-09-27T22:12:47.000Z | toontown/shtiker/NPCFriendPage.py | journeyfan/toontown-journey | 7a4db507e5c1c38a014fc65588086d9655aaa5b4 | [
"MIT"
] | null | null | null | toontown/shtiker/NPCFriendPage.py | journeyfan/toontown-journey | 7a4db507e5c1c38a014fc65588086d9655aaa5b4 | [
"MIT"
] | 2 | 2020-09-26T20:37:18.000Z | 2020-11-15T20:55:33.000Z | from . import ShtikerPage
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toon import NPCFriendPanel
from toontown.toonbase import TTLocalizer
class NPCFriendPage(ShtikerPage.ShtikerPage):
def __init__(self):
ShtikerPage.ShtikerPage.__init__(self)
def load(self):
... | 32.064516 | 146 | 0.714286 | from . import ShtikerPage
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toon import NPCFriendPanel
from toontown.toonbase import TTLocalizer
class NPCFriendPage(ShtikerPage.ShtikerPage):
def __init__(self):
ShtikerPage.ShtikerPage.__init__(self)
def load(self):
... | true | true |
f73cd977f85b3c9985295649dd8bbddf10edc58b | 848 | py | Python | neighbourapp/migrations/0004_newpost.py | dennis027/neighbourhood | ad0878ded40af6917dbf4a8905db4f4915627221 | [
"MIT"
] | null | null | null | neighbourapp/migrations/0004_newpost.py | dennis027/neighbourhood | ad0878ded40af6917dbf4a8905db4f4915627221 | [
"MIT"
] | null | null | null | neighbourapp/migrations/0004_newpost.py | dennis027/neighbourhood | ad0878ded40af6917dbf4a8905db4f4915627221 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-24 21:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('neighbourapp', '0003_bus... | 32.615385 | 118 | 0.641509 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('neighbourapp', '0003_business_neighbourhood_user'),
]
operatio... | true | true |
f73cd9905bcf7f44b5ee4ee03fe193ad304a4274 | 5,508 | py | Python | inference.py | charzy/vocalremover | d7a32c20bb0e272f7bb5a486cd2b4ced45e214e8 | [
"MIT"
] | 411 | 2019-08-15T10:56:09.000Z | 2022-03-27T18:34:11.000Z | vocal-remover-master/inference.py | fernando-figueredo/ChordsWebApp | 9bf983ab5579c36c75447c74eec0400d78ab49f9 | [
"MIT"
] | 71 | 2019-08-13T15:46:50.000Z | 2022-03-31T13:47:48.000Z | vocal-remover-master/inference.py | fernando-figueredo/ChordsWebApp | 9bf983ab5579c36c75447c74eec0400d78ab49f9 | [
"MIT"
] | 83 | 2019-10-10T08:32:31.000Z | 2022-03-15T09:16:39.000Z | import argparse
import os
import cv2
import librosa
import numpy as np
import soundfile as sf
import torch
from tqdm import tqdm
from lib import dataset
from lib import nets
from lib import spec_utils
class VocalRemover(object):
def __init__(self, model, device, window_size):
self.model = model
... | 32.982036 | 93 | 0.611837 | import argparse
import os
import cv2
import librosa
import numpy as np
import soundfile as sf
import torch
from tqdm import tqdm
from lib import dataset
from lib import nets
from lib import spec_utils
class VocalRemover(object):
def __init__(self, model, device, window_size):
self.model = model
... | true | true |
f73cdb1d8c7cc059573c2f696a96be998cad3ac5 | 535 | py | Python | tests/test_40_reformat_zarr.py | shaorenshengg/bopene | 5ad6030e5ff8b501c220ddfdb6510e45399a7ab8 | [
"Apache-2.0"
] | 130 | 2021-04-01T08:23:49.000Z | 2022-03-28T15:59:57.000Z | tests/test_40_reformat_zarr.py | shaorenshengg/bopene | 5ad6030e5ff8b501c220ddfdb6510e45399a7ab8 | [
"Apache-2.0"
] | 80 | 2021-04-11T09:57:43.000Z | 2022-03-18T11:47:04.000Z | tests/test_40_reformat_zarr.py | shaorenshengg/bopene | 5ad6030e5ff8b501c220ddfdb6510e45399a7ab8 | [
"Apache-2.0"
] | 9 | 2021-04-25T21:44:16.000Z | 2022-03-30T06:44:48.000Z | import pathlib
import typing as T
import pytest
from xarray_sentinel import reformat
pytest.importorskip("zarr")
DATA_FOLDER = pathlib.Path(__file__).parent / "data"
def test_to_group_zarr(tmpdir: T.Any) -> None:
product_path = (
DATA_FOLDER
/ "S1B_IW_SLC__1SDV_20210401T052622_20210401T052650_... | 24.318182 | 84 | 0.723364 | import pathlib
import typing as T
import pytest
from xarray_sentinel import reformat
pytest.importorskip("zarr")
DATA_FOLDER = pathlib.Path(__file__).parent / "data"
def test_to_group_zarr(tmpdir: T.Any) -> None:
product_path = (
DATA_FOLDER
/ "S1B_IW_SLC__1SDV_20210401T052622_20210401T052650_... | true | true |
f73cdbfb3cb9a4b8dc9da1d5d65c5ffd3f04f0c7 | 7,457 | py | Python | src/run.py | SaynaEbrahimi/hat | c1333c5f1639a011db336a99eecb75cac8738212 | [
"MIT"
] | 1 | 2021-03-28T09:47:24.000Z | 2021-03-28T09:47:24.000Z | src/run.py | SaynaEbrahimi/hat | c1333c5f1639a011db336a99eecb75cac8738212 | [
"MIT"
] | null | null | null | src/run.py | SaynaEbrahimi/hat | c1333c5f1639a011db336a99eecb75cac8738212 | [
"MIT"
] | null | null | null | import sys,os,argparse,time
import numpy as np
import torch
import utils
tstart=time.time()
# Arguments
parser=argparse.ArgumentParser(description='xxx')
parser.add_argument('--seed',type=int,default=0,help='(default=%(default)d)')
parser.add_argument('--experiment',default='',type=str,required=True,choices=['mnist2... | 37.661616 | 157 | 0.605874 | import sys,os,argparse,time
import numpy as np
import torch
import utils
tstart=time.time()
parser=argparse.ArgumentParser(description='xxx')
parser.add_argument('--seed',type=int,default=0,help='(default=%(default)d)')
parser.add_argument('--experiment',default='',type=str,required=True,choices=['mnist2','pmnist',... | true | true |
f73cdc102133baca532eb69a9883a9bee8c80b62 | 13,395 | py | Python | official/nlp/tasks/question_answering.py | ishani-chakraborty/models | a811a3b7e640722318ad868c99feddf3f3063e36 | [
"Apache-2.0"
] | 1 | 2020-08-05T14:38:17.000Z | 2020-08-05T14:38:17.000Z | official/nlp/tasks/question_answering.py | GulnihalKelkit/models | 367486482c5fe6fc896868edf9bbde7519deb52d | [
"Apache-2.0"
] | null | null | null | official/nlp/tasks/question_answering.py | GulnihalKelkit/models | 367486482c5fe6fc896868edf9bbde7519deb52d | [
"Apache-2.0"
] | 1 | 2022-02-27T23:00:11.000Z | 2022-02-27T23:00:11.000Z | # Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 39.513274 | 80 | 0.707055 |
import collections
import json
import os
from absl import logging
import dataclasses
import orbit
import tensorflow as tf
import tensorflow_hub as hub
from official.core import base_task
from official.core import task_factory
from official.modeling.hyperparams import base_config
from official.modeling.... | true | true |
f73cdca8b08d8e13c6d501dda8cb056a03f59629 | 11,532 | py | Python | tnmlearn/other/convenience.py | t2wain/machine-learning | 4b5e1a24fab7c4ab42f646f7785191ff3d3283ba | [
"MIT"
] | null | null | null | tnmlearn/other/convenience.py | t2wain/machine-learning | 4b5e1a24fab7c4ab42f646f7785191ff3d3283ba | [
"MIT"
] | null | null | null | tnmlearn/other/convenience.py | t2wain/machine-learning | 4b5e1a24fab7c4ab42f646f7785191ff3d3283ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
import numpy as np
import cv2
import sys
# import any special Python 2.7 packages
if sys.version_info.major == 2:
from urllib import urlopen
# import any special Python 3 packages
elif... | 35.925234 | 123 | 0.623136 |
import numpy as np
import cv2
import sys
if sys.version_info.major == 2:
from urllib import urlopen
elif sys.version_info.major == 3:
from urllib.request import urlopen
def translate(image, x, y):
M = np.float32([[1, 0, x], [0, 1, y]])
shifted = cv2.warpAffine(image, M, (image.shape[1], ... | true | true |
f73cdcbcda3e78d69025dbba4af7ab55bc59e09f | 1,268 | py | Python | lang/py/pylib/code/unittest/unittest_simple.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | lang/py/pylib/code/unittest/unittest_simple.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | lang/py/pylib/code/unittest/unittest_simple.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | #!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... | 31.7 | 70 | 0.757886 |
import unittest
class SimplisticTest(unittest.TestCase):
def test(self):
self.failUnless(True)
if __name__ == '__main__':
unittest.main()
| true | true |
f73cdde7b3db41ee93d135a9246e19ad92cb3817 | 247 | py | Python | src/website/apps/taxonomy/lookups.py | rapidsms/rapidsms.org | db871949797150e654a42afe00fc9e8f9fc1559e | [
"Apache-2.0"
] | 2 | 2015-10-09T04:48:55.000Z | 2020-05-29T18:33:39.000Z | src/website/apps/taxonomy/lookups.py | rapidsms/rapidsms.org | db871949797150e654a42afe00fc9e8f9fc1559e | [
"Apache-2.0"
] | 22 | 2015-09-20T14:00:16.000Z | 2021-06-10T20:08:25.000Z | src/website/apps/taxonomy/lookups.py | rapidsms/rapidsms.org | db871949797150e654a42afe00fc9e8f9fc1559e | [
"Apache-2.0"
] | 6 | 2015-12-14T21:05:01.000Z | 2019-11-02T19:35:24.000Z | from selectable.base import ModelLookup
from selectable.registry import registry
from .models import Taxonomy
class TaxonomyLookup(ModelLookup):
model = Taxonomy
search_fields = ('name__icontains', )
registry.register(TaxonomyLookup)
| 19 | 41 | 0.793522 | from selectable.base import ModelLookup
from selectable.registry import registry
from .models import Taxonomy
class TaxonomyLookup(ModelLookup):
model = Taxonomy
search_fields = ('name__icontains', )
registry.register(TaxonomyLookup)
| true | true |
f73cde27fae7b08b820acf1682834ab2d9b1db14 | 10,416 | py | Python | test/doc/conf.py | yasics/vpp | a4d0956082f12ac8269fd415134af7f605c1f3c9 | [
"Apache-2.0"
] | 3 | 2021-03-17T12:40:27.000Z | 2021-05-25T10:31:21.000Z | test/doc/conf.py | yasics/vpp | a4d0956082f12ac8269fd415134af7f605c1f3c9 | [
"Apache-2.0"
] | 32 | 2021-03-24T06:04:08.000Z | 2021-09-14T02:02:22.000Z | test/doc/conf.py | yasics/vpp | a4d0956082f12ac8269fd415134af7f605c1f3c9 | [
"Apache-2.0"
] | 2 | 2021-03-23T19:50:15.000Z | 2022-02-21T10:32:18.000Z | # -*- coding: utf-8 -*-
#
# VPP test framework documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 13 08:45:03 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... | 29.507082 | 79 | 0.693836 |
import os
import sys
import subprocess
from datetime import date
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
autodoc_mock_imports = ['objgraph',
'parameterized',
'pexpect',
'psuti... | true | true |
f73cdfb1e41c650c3e59db1891459d8e5bf73921 | 35,030 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/operations/_packet_captures_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/operations/_packet_captures_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/operations/_packet_captures_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.989811 | 240 | 0.670482 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
f73ce09aafb5da7bb9707cfcc441437a734781e4 | 1,144 | py | Python | python_practice/data_structure/queue/queue_link_list.py | jeremykid/FunAlgorithm | 0ee34f130574d2a42ce995a1a44545a7368f9add | [
"MIT"
] | null | null | null | python_practice/data_structure/queue/queue_link_list.py | jeremykid/FunAlgorithm | 0ee34f130574d2a42ce995a1a44545a7368f9add | [
"MIT"
] | null | null | null | python_practice/data_structure/queue/queue_link_list.py | jeremykid/FunAlgorithm | 0ee34f130574d2a42ce995a1a44545a7368f9add | [
"MIT"
] | null | null | null | import sys, os
sys.path.append(os.path.abspath(os.path.join('..', 'linked_list')))
from LinkedList import linked_list
from node import Node
class queue_linked_list():
def __init__(self):
self.head = None
self.tail = None
def enqueue(self, value):
tempNode = Node(value)
if (se... | 26 | 67 | 0.519231 | import sys, os
sys.path.append(os.path.abspath(os.path.join('..', 'linked_list')))
from LinkedList import linked_list
from node import Node
class queue_linked_list():
def __init__(self):
self.head = None
self.tail = None
def enqueue(self, value):
tempNode = Node(value)
if (se... | true | true |
f73ce0c5a62e6dd1c6e2c1d7bc9490117950691c | 2,467 | py | Python | research/nlp/dam/src/metric.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/dam/src/metric.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/dam/src/metric.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.546875 | 100 | 0.638833 |
from mindspore.nn.metrics import Metric
from src import ubuntu_evaluation as ub_eval
from src import douban_evaluation as db_eval
class EvalMetric(Metric):
def __init__(self, model_name="DAM_ubuntu", score_file=None):
super(EvalMetric, self).__init__()
self.model_name = model_name
... | true | true |
f73ce0dc7c7ae9358a7a96d27890ae5767e7afb1 | 523 | py | Python | M68kConstants.py | lallouslab/pwndra | bced561e5f9c4c033359caa25083bdf2289355f5 | [
"Apache-2.0"
] | null | null | null | M68kConstants.py | lallouslab/pwndra | bced561e5f9c4c033359caa25083bdf2289355f5 | [
"Apache-2.0"
] | null | null | null | M68kConstants.py | lallouslab/pwndra | bced561e5f9c4c033359caa25083bdf2289355f5 | [
"Apache-2.0"
] | null | null | null | # Replace Linux/m68k numeric constants with human readable names.
#@author b0bb
#@category Pwn
#@keybinding
#@menupath Analysis.Pwn.Constants.m68k
#@toolbar
from constants.Constants import Constants
import ghidra.app.util.opinion.ElfLoader as ElfLoader
def run():
if currentProgram.getExecutableFormat() != ElfLo... | 22.73913 | 74 | 0.728489 |
from constants.Constants import Constants
import ghidra.app.util.opinion.ElfLoader as ElfLoader
def run():
if currentProgram.getExecutableFormat() != ElfLoader.ELF_NAME:
popup('Not an ELF file, cannot continue')
return
arch = 'm68k'
abi = 'default'
Constants(currentProgram, c... | true | true |
f73ce0f806cf72d4f3deeaf69d8140f99802c59a | 3,087 | py | Python | asn/files.py | Ayanami-y/GreaterWMS | 9737f0db1d76b829ace921250efa9336635df637 | [
"Apache-2.0"
] | 1 | 2021-06-04T02:06:34.000Z | 2021-06-04T02:06:34.000Z | asn/files.py | Ayanami-y/GreaterWMS | 9737f0db1d76b829ace921250efa9336635df637 | [
"Apache-2.0"
] | null | null | null | asn/files.py | Ayanami-y/GreaterWMS | 9737f0db1d76b829ace921250efa9336635df637 | [
"Apache-2.0"
] | null | null | null | from rest_framework_csv.renderers import CSVStreamingRenderer
def list_file_headers():
return [
'asn_code',
'asn_status',
'total_weight',
'total_volume',
'supplier',
'creater',
'create_time',
'update_time'
]
def list_cn_data_header():
return ... | 27.810811 | 61 | 0.561386 | from rest_framework_csv.renderers import CSVStreamingRenderer
def list_file_headers():
return [
'asn_code',
'asn_status',
'total_weight',
'total_volume',
'supplier',
'creater',
'create_time',
'update_time'
]
def list_cn_data_header():
return ... | true | true |
f73ce1204a8902428142c12bd56a3c7b8848dd70 | 773 | py | Python | pennylane/beta/vqe/__init__.py | InduManimaran/pennylane | 375d25acc7bd2e6d5243b5273958b26513c33189 | [
"Apache-2.0"
] | 2 | 2021-06-29T01:30:08.000Z | 2021-08-23T10:38:52.000Z | pennylane/beta/vqe/__init__.py | InduManimaran/pennylane | 375d25acc7bd2e6d5243b5273958b26513c33189 | [
"Apache-2.0"
] | 4 | 2020-09-25T21:04:22.000Z | 2022-02-10T00:39:53.000Z | pennylane/beta/vqe/__init__.py | InduManimaran/pennylane | 375d25acc7bd2e6d5243b5273958b26513c33189 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 agre... | 40.684211 | 85 | 0.778784 |
from .vqe import Hamiltonian, circuits, aggregate, cost
| true | true |
f73ce1b2093e3b1a5ca3e9e8812834bc3f0d3432 | 1,783 | py | Python | medical_prescription/recommendation/test/test_view_recommendation_custom.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 11 | 2017-09-19T00:29:40.000Z | 2018-04-05T23:52:39.000Z | medical_prescription/recommendation/test/test_view_recommendation_custom.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 271 | 2017-09-09T00:07:28.000Z | 2017-12-07T05:00:45.000Z | medical_prescription/recommendation/test/test_view_recommendation_custom.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 26 | 2017-08-31T20:48:49.000Z | 2018-03-21T15:11:27.000Z | # Django
from django.test import TestCase
from django.test.client import RequestFactory
# Django Local
from recommendation.views import CustomRecommendationCreateView
from user.models import HealthProfessional
class CreateRecomendationCustomViewTeste(TestCase):
def setUp(self):
self.factory = RequestFact... | 36.387755 | 75 | 0.713404 |
from django.test import TestCase
from django.test.client import RequestFactory
from recommendation.views import CustomRecommendationCreateView
from user.models import HealthProfessional
class CreateRecomendationCustomViewTeste(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.he... | true | true |
f73ce20fd80292af353bb5c73e149c26ec3a571d | 118 | py | Python | datasets/__init__.py | dynasty0/tf_hrnet_segmentation | 9e54bb14b518cdf285e5871c051b9cdd851f08d7 | [
"BSD-3-Clause"
] | 1 | 2021-08-31T02:46:12.000Z | 2021-08-31T02:46:12.000Z | datasets/__init__.py | dynasty0/tf_hrnet_segmentation | 9e54bb14b518cdf285e5871c051b9cdd851f08d7 | [
"BSD-3-Clause"
] | 1 | 2021-04-23T04:57:08.000Z | 2021-04-24T09:56:13.000Z | datasets/__init__.py | dynasty0/tf_hrnet_segmentation | 9e54bb14b518cdf285e5871c051b9cdd851f08d7 | [
"BSD-3-Clause"
] | null | null | null | from .celeba_dataset import *
from .ilsvrc12_dataset import *
__all__ =[
"CelebaDataset",
"Ilsvrc12Dataset"
] | 16.857143 | 31 | 0.720339 | from .celeba_dataset import *
from .ilsvrc12_dataset import *
__all__ =[
"CelebaDataset",
"Ilsvrc12Dataset"
] | true | true |
f73ce291d05952665fa74cf72c4dd7096062f5ef | 1,901 | py | Python | install/install.py | PABlond/Portfolio-CMS-for-freelancers | ace9e8ed526b1605ea4a8fbbfcee9461c1e6fa4d | [
"MIT"
] | 1 | 2019-11-04T07:04:35.000Z | 2019-11-04T07:04:35.000Z | install/install.py | PABlond/Portfolio-CMS-for-freelancers | ace9e8ed526b1605ea4a8fbbfcee9461c1e6fa4d | [
"MIT"
] | 4 | 2021-03-19T11:38:03.000Z | 2022-01-13T02:23:51.000Z | install/install.py | PABlond/Portfolio-CMS-for-freelancers | ace9e8ed526b1605ea4a8fbbfcee9461c1e6fa4d | [
"MIT"
] | null | null | null | import pandas
import utils
import config
var = config.Variable()
df = pandas.read_excel(var.config)
pwd = var.pwd
def run():
# Get data for gatsby-config.js
with open(var.gatsby_config_template, "r") as f:
gatsby_config = f.read()
# Get data for src/data/content.js
with open(var.content_te... | 33.350877 | 93 | 0.56707 | import pandas
import utils
import config
var = config.Variable()
df = pandas.read_excel(var.config)
pwd = var.pwd
def run():
with open(var.gatsby_config_template, "r") as f:
gatsby_config = f.read()
with open(var.content_template, "r") as f:
content = f.read()
for inde... | true | true |
f73ce3195424216f1e501720eee6b1f118b8a67f | 36,264 | py | Python | dymos/transcriptions/transcription_base.py | yonghoonlee/dymos | 602109eee4a1b061444dd2b45c7b1ed0ac1aa0f4 | [
"Apache-2.0"
] | null | null | null | dymos/transcriptions/transcription_base.py | yonghoonlee/dymos | 602109eee4a1b061444dd2b45c7b1ed0ac1aa0f4 | [
"Apache-2.0"
] | 9 | 2021-05-24T15:14:37.000Z | 2021-06-28T21:12:55.000Z | dymos/transcriptions/transcription_base.py | yonghoonlee/dymos | 602109eee4a1b061444dd2b45c7b1ed0ac1aa0f4 | [
"Apache-2.0"
] | null | null | null | from collections.abc import Sequence
import numpy as np
import openmdao.api as om
from .common import BoundaryConstraintComp, ControlGroup, PolynomialControlGroup, PathConstraintComp
from ..utils.constants import INF_BOUND
from ..utils.misc import get_rate_units, _unspecified
from ..utils.introspection import get_ta... | 43.691566 | 114 | 0.566016 | from collections.abc import Sequence
import numpy as np
import openmdao.api as om
from .common import BoundaryConstraintComp, ControlGroup, PolynomialControlGroup, PathConstraintComp
from ..utils.constants import INF_BOUND
from ..utils.misc import get_rate_units, _unspecified
from ..utils.introspection import get_ta... | true | true |
f73ce35c3ae0fa1b7eadc5a75b888c8a8208722c | 5,403 | py | Python | test/integration/sagemaker/test_tfs.py | flacout/sagemaker-tensorflow-serving-container | b28564b24049451359c74a4dfa33e5b7ad817248 | [
"Apache-2.0"
] | 143 | 2019-01-21T13:36:58.000Z | 2022-03-17T01:37:12.000Z | test/integration/sagemaker/test_tfs.py | flacout/sagemaker-tensorflow-serving-container | b28564b24049451359c74a4dfa33e5b7ad817248 | [
"Apache-2.0"
] | 207 | 2019-02-19T07:06:28.000Z | 2022-03-11T18:25:02.000Z | test/integration/sagemaker/test_tfs.py | flacout/sagemaker-tensorflow-serving-container | b28564b24049451359c74a4dfa33e5b7ad817248 | [
"Apache-2.0"
] | 118 | 2018-12-07T01:37:30.000Z | 2022-03-03T20:17:12.000Z | # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 39.152174 | 110 | 0.605589 |
import os
import pytest
import util
NON_P3_REGIONS = ["ap-southeast-1", "ap-southeast-2", "ap-south-1",
"ca-central-1", "eu-central-1", "eu-west-2", "us-west-1"]
@pytest.fixture(params=os.environ["TEST_VERSIONS"].split(","))
def version(request):
return request.param
@pytest.fix... | true | true |
f73ce4750e7df131956b6123354ec90427227883 | 10,897 | py | Python | PythonAPI/carla/agents/navigation/local_planner.py | tom-doerr/carla | 2f5409d4b63c8fa24320711e6a7a24e79bf1c833 | [
"MIT"
] | 103 | 2020-03-10T04:21:50.000Z | 2022-03-29T13:26:57.000Z | PythonAPI/carla/agents/navigation/local_planner.py | tom-doerr/carla | 2f5409d4b63c8fa24320711e6a7a24e79bf1c833 | [
"MIT"
] | 12 | 2020-04-11T11:36:01.000Z | 2021-12-09T11:35:56.000Z | PythonAPI/carla/agents/navigation/local_planner.py | jhidalgocarrio/carla | 5404807db43428f2c82451ffacef9f83fab782e1 | [
"MIT"
] | 8 | 2020-11-21T07:47:12.000Z | 2022-03-25T13:41:05.000Z | #!/usr/bin/env python
# Copyright (c) 2018 Intel Labs.
# authors: German Ros (german.ros@intel.com)
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
""" This module contains a local planner to perform low-level waypoint following based on PID contr... | 37.064626 | 117 | 0.634487 |
from enum import Enum
from collections import deque
import random
import carla
from agents.navigation.controller import VehiclePIDController
from agents.tools.misc import draw_waypoints
class RoadOption(Enum):
VOID = -1
LEFT = 1
RIGHT = 2
STRAIGHT = 3
LANEFOLLOW = 4
CHANGELANELEFT = ... | true | true |
f73ce49738c2f3b81bd9f8b17663658289a78c7d | 1,274 | py | Python | setup.py | danstreeter/mattermost-integration-mattbas-insult | 7bf804ce06fcc7e130aca9ca2c41857852e8bf07 | [
"Apache-2.0"
] | null | null | null | setup.py | danstreeter/mattermost-integration-mattbas-insult | 7bf804ce06fcc7e130aca9ca2c41857852e8bf07 | [
"Apache-2.0"
] | 1 | 2018-10-30T08:20:43.000Z | 2018-10-30T08:20:43.000Z | setup.py | danstreeter/mattermost-integration-mattbas-insult | 7bf804ce06fcc7e130aca9ca2c41857852e8bf07 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
from setuptools import setup
from setuptools import find_packages
def version():
if not os.path.isdir(".git"):
print "This does not appear to be a Git repository."
return
try:
p = subprocess.Popen(["git", "describe",
"--tags", "... | 27.695652 | 79 | 0.628728 | import os
import subprocess
from setuptools import setup
from setuptools import find_packages
def version():
if not os.path.isdir(".git"):
print "This does not appear to be a Git repository."
return
try:
p = subprocess.Popen(["git", "describe",
"--tags", "... | false | true |
f73ce4d84d4dcc3f9b02b6a829c7f3f8ca9efc77 | 788 | py | Python | profiles/signals.py | nivbend/memoir | c7239ae9db852f8e14ed53a2ba96d4c72eb47f30 | [
"MIT"
] | null | null | null | profiles/signals.py | nivbend/memoir | c7239ae9db852f8e14ed53a2ba96d4c72eb47f30 | [
"MIT"
] | 18 | 2016-08-26T21:26:58.000Z | 2017-03-21T20:14:35.000Z | profiles/signals.py | nivbend/memoir | c7239ae9db852f8e14ed53a2ba96d4c72eb47f30 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_auth_ldap.backend import populate_user
from .models import UserProfile
try:
USER_ATTR_IMAGE_URL = settings.AUTH_LDAP_USER_ATTR_IMAGE_URL
except At... | 31.52 | 81 | 0.780457 | from __future__ import unicode_literals
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_auth_ldap.backend import populate_user
from .models import UserProfile
try:
USER_ATTR_IMAGE_URL = settings.AUTH_LDAP_USER_ATTR_IMAGE_URL
except At... | true | true |
f73ce5a9d21c84995ddf67b52dd7d49a24ecd107 | 7,633 | py | Python | homeassistant/components/homematicip_cloud/__init__.py | mgosk/home-assistant | 3bf27b9afc50044ad0a244702e8a628247eeb3e0 | [
"Apache-2.0"
] | 2 | 2019-07-28T18:56:14.000Z | 2019-07-28T18:56:17.000Z | homeassistant/components/homematicip_cloud/__init__.py | richh1/home-assistant | a14c299a78259386bbcf7787689e3e7dfa5b1dfd | [
"Apache-2.0"
] | null | null | null | homeassistant/components/homematicip_cloud/__init__.py | richh1/home-assistant | a14c299a78259386bbcf7787689e3e7dfa5b1dfd | [
"Apache-2.0"
] | 1 | 2018-04-29T02:14:32.000Z | 2018-04-29T02:14:32.000Z | """Support for HomematicIP Cloud devices."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as... | 34.538462 | 77 | 0.675357 | import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
import homeassistant.helpers.config_valid... | true | true |
f73ce7007dcf428381faaa5cba3ed159e4dd0c92 | 1,833 | py | Python | hug/input_format.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | hug/input_format.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | hug/input_format.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | """hug/input_formats.py
Defines the built-in Hug input_formatting handlers
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, includi... | 38.1875 | 112 | 0.7485 | import json as json_converter
import re
from hug.format import content_type
UNDERSCORE = (re.compile('(.)([A-Z][a-z]+)'), re.compile('([a-z0-9])([A-Z])'))
@content_type('application/json')
def json(body):
return json_converter.loads(body)
def _under_score_dict(dictionary):
new_dictionary = {}
for key,... | true | true |
f73ce815f021946c17d274a89a2a9a2f8ef1867c | 1,388 | py | Python | setup.py | shx2/apegears | 3fa0408a15df3817fd206d1086d7e49e1b60594c | [
"MIT"
] | 5 | 2020-08-31T20:04:04.000Z | 2022-01-15T17:09:42.000Z | setup.py | shx2/apegears | 3fa0408a15df3817fd206d1086d7e49e1b60594c | [
"MIT"
] | 5 | 2020-10-23T02:41:45.000Z | 2020-11-03T02:27:57.000Z | setup.py | shx2/apegears | 3fa0408a15df3817fd206d1086d7e49e1b60594c | [
"MIT"
] | 1 | 2020-10-23T02:48:08.000Z | 2020-10-23T02:48:08.000Z | #!/usr/bin/env python3
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# Read version i... | 30.173913 | 78 | 0.682277 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
version_vars = {}
with open(path.join("apegears", "version.py")) as fp:
exec(fp.... | true | true |
f73ce82d3f49ea2cb2c39a15d79a96db93baddc9 | 416 | py | Python | Day01-15/04_loopTest_1.py | MaoningGuan/-Python-100-Days | d36e49d67a134278455438348efc41ffb28b778a | [
"MIT"
] | null | null | null | Day01-15/04_loopTest_1.py | MaoningGuan/-Python-100-Days | d36e49d67a134278455438348efc41ffb28b778a | [
"MIT"
] | null | null | null | Day01-15/04_loopTest_1.py | MaoningGuan/-Python-100-Days | d36e49d67a134278455438348efc41ffb28b778a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
猜数字游戏
"""
import random
answer = random.randint(1, 100)
counter = 0
while True:
counter += 1
number = int(input('请输入你猜测的数字:'))
if number > answer:
print('大一点')
elif number < answer:
print('小一点')
else:
print('猜测的数字正确,正确数字为:%d'... | 18.909091 | 42 | 0.572115 |
import random
answer = random.randint(1, 100)
counter = 0
while True:
counter += 1
number = int(input('请输入你猜测的数字:'))
if number > answer:
print('大一点')
elif number < answer:
print('小一点')
else:
print('猜测的数字正确,正确数字为:%d' % answer)
break
print('你总共猜了%d次。' % counter)
if c... | true | true |
f73ce9977a469a3c04e0293258199b7b5438dcdf | 2,943 | py | Python | oss_scripts/pip_package/setup.py | vbod/text | 07c044b8b851ace1e9a033c9597cdb1bee2d69e0 | [
"Apache-2.0"
] | null | null | null | oss_scripts/pip_package/setup.py | vbod/text | 07c044b8b851ace1e9a033c9597cdb1bee2d69e0 | [
"Apache-2.0"
] | null | null | null | oss_scripts/pip_package/setup.py | vbod/text | 07c044b8b851ace1e9a033c9597cdb1bee2d69e0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 TF.Text Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 30.978947 | 80 | 0.706762 |
import os
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install
from setuptools.dist import Distribution
project_name = 'tensorflow-text'
project_version = '2.3.0-rc0'
class BinaryDistribution(Distribution):
def is_pure(self):
return ... | true | true |
f73ce9f26fea6e4a4b1d6562f5a98d048bd85bc5 | 455 | py | Python | newsapp/migrations/0005_business_image.py | Esther-Anyona/four-one-one | 6a5e019b35710941a669c1b49e993b683c99d615 | [
"MIT"
] | null | null | null | newsapp/migrations/0005_business_image.py | Esther-Anyona/four-one-one | 6a5e019b35710941a669c1b49e993b683c99d615 | [
"MIT"
] | null | null | null | newsapp/migrations/0005_business_image.py | Esther-Anyona/four-one-one | 6a5e019b35710941a669c1b49e993b683c99d615 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-24 08:24
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('newsapp', '0004_profile_bio'),
]
operations = [
migrations.AddField(
model_name='business',
name='i... | 22.75 | 110 | 0.637363 |
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('newsapp', '0004_profile_bio'),
]
operations = [
migrations.AddField(
model_name='business',
name='image',
field=cloudinary.models.Clou... | true | true |
f73cea51eeb82a826d94a824065fe954fcfdc93e | 52,944 | py | Python | quarkchain/cluster/master.py | tim-yoshi/pyquarkchain | 1847542c166a180b5ffc3c6e917751be85fa15a6 | [
"MIT"
] | 3 | 2019-03-14T17:08:07.000Z | 2019-10-02T11:13:53.000Z | quarkchain/cluster/master.py | tim-yoshi/pyquarkchain | 1847542c166a180b5ffc3c6e917751be85fa15a6 | [
"MIT"
] | null | null | null | quarkchain/cluster/master.py | tim-yoshi/pyquarkchain | 1847542c166a180b5ffc3c6e917751be85fa15a6 | [
"MIT"
] | 1 | 2019-05-04T22:57:29.000Z | 2019-05-04T22:57:29.000Z | import argparse
import asyncio
import os
import psutil
import random
import time
from collections import deque
from typing import Optional, List, Union, Dict, Tuple
from quarkchain.cluster.guardian import Guardian
from quarkchain.cluster.miner import Miner, MiningWork, validate_seal
from quarkchain.cluster.p2p_comman... | 37.310782 | 119 | 0.624207 | import argparse
import asyncio
import os
import psutil
import random
import time
from collections import deque
from typing import Optional, List, Union, Dict, Tuple
from quarkchain.cluster.guardian import Guardian
from quarkchain.cluster.miner import Miner, MiningWork, validate_seal
from quarkchain.cluster.p2p_comman... | true | true |
f73cecf3e4d7f6300e2bd14b05ac5ead060e242c | 20,112 | py | Python | tests/utils/test_search_utils.py | jene4ekjene4ek/my_mlflow | 1ac1b5d6657789168253101ae3a8477cff54dd9e | [
"Apache-2.0"
] | 1 | 2021-01-10T14:00:57.000Z | 2021-01-10T14:00:57.000Z | tests/utils/test_search_utils.py | jene4ekjene4ek/my_mlflow | 1ac1b5d6657789168253101ae3a8477cff54dd9e | [
"Apache-2.0"
] | null | null | null | tests/utils/test_search_utils.py | jene4ekjene4ek/my_mlflow | 1ac1b5d6657789168253101ae3a8477cff54dd9e | [
"Apache-2.0"
] | 1 | 2020-12-29T18:01:42.000Z | 2020-12-29T18:01:42.000Z | import base64
import json
import pytest
from mlflow.entities import RunInfo, RunData, Run, LifecycleStage, RunStatus, Metric, Param, RunTag
from mlflow.exceptions import MlflowException
from mlflow.utils.search_utils import SearchUtils
@pytest.mark.parametrize("filter_string, parsed_filter", [
("metric.acc >= 0.... | 47.771971 | 100 | 0.559716 | import base64
import json
import pytest
from mlflow.entities import RunInfo, RunData, Run, LifecycleStage, RunStatus, Metric, Param, RunTag
from mlflow.exceptions import MlflowException
from mlflow.utils.search_utils import SearchUtils
@pytest.mark.parametrize("filter_string, parsed_filter", [
("metric.acc >= 0.... | true | true |
f73ced32569e4fc87bf5de6a4e502ea584df54d9 | 304 | py | Python | Online-Judges/CodingBat/Python/String-02/String_2-03-cat_dog.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/String-02/String_2-03-cat_dog.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/String-02/String_2-03-cat_dog.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def cat_dog(str):
count_cat = 0
count_dog = 0
for i in range(len(str)-2):
if str[i:i+3] == "cat":
count_cat += 1
for i in range(len(str)-2):
if str[i:i+3] == "dog":
count_dog += 1
if count_cat == count_dog:
return True
return False
| 23.384615 | 31 | 0.5 | def cat_dog(str):
count_cat = 0
count_dog = 0
for i in range(len(str)-2):
if str[i:i+3] == "cat":
count_cat += 1
for i in range(len(str)-2):
if str[i:i+3] == "dog":
count_dog += 1
if count_cat == count_dog:
return True
return False
| true | true |
f73ceea6d5910865f0b949b4bb9dad83b675db1f | 8,605 | py | Python | munkireport/lib/macosxauth.py | keeleysam/munkireport | 3b5bd4493d5e549ed14dba83e85b95e03c00072b | [
"Apache-2.0"
] | 2 | 2015-04-20T20:47:34.000Z | 2017-08-23T14:11:00.000Z | munkireport/lib/macosxauth.py | keeleysam/munkireport | 3b5bd4493d5e549ed14dba83e85b95e03c00072b | [
"Apache-2.0"
] | null | null | null | munkireport/lib/macosxauth.py | keeleysam/munkireport | 3b5bd4493d5e549ed14dba83e85b95e03c00072b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Authentication of Mac OS X users
Currently uses shell commands to do lookup, should probably be rewritten to
use PAM and/or PyObjC.
"""
import re
import logging
import pexpect
from repoze.what.adapters import BaseSourceAdapter, SourceError
__all__ = ['MacOSXAuthenticator', 'MacOSXMetadata... | 36.461864 | 126 | 0.61964 |
"""Authentication of Mac OS X users
Currently uses shell commands to do lookup, should probably be rewritten to
use PAM and/or PyObjC.
"""
import re
import logging
import pexpect
from repoze.what.adapters import BaseSourceAdapter, SourceError
__all__ = ['MacOSXAuthenticator', 'MacOSXMetadataProvider', 'MacOSXGroup... | false | true |
f73ceee577a1826ee0684236241bd2a85a707770 | 4,685 | py | Python | pandas/tests/plotting/test_groupby.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | pandas/tests/plotting/test_groupby.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | pandas/tests/plotting/test_groupby.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | """ Test cases for GroupBy.plot """
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td
from pandas import DataFrame, Index, Series
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase
pytestmark = pytest.mark.slow
... | 38.089431 | 88 | 0.58698 |
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td
from pandas import DataFrame, Index, Series
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase
pytestmark = pytest.mark.slow
@td.skip_if_no_mpl
class TestDataFr... | true | true |
f73cefc3726c4e243f639210df3e2095e6ff4c8d | 758 | py | Python | main_app/migrations/0001_initial.py | vrathnayake/dJango | c0adb3f37c0e10ba22ee0c67503a2b07844aa260 | [
"MIT"
] | null | null | null | main_app/migrations/0001_initial.py | vrathnayake/dJango | c0adb3f37c0e10ba22ee0c67503a2b07844aa260 | [
"MIT"
] | null | null | null | main_app/migrations/0001_initial.py | vrathnayake/dJango | c0adb3f37c0e10ba22ee0c67503a2b07844aa260 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-01-24 22:47
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Treasure',
fields=[
('id', models.AutoField... | 29.153846 | 114 | 0.575198 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Treasure',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize... | true | true |
f73cf04dc926a67440f658e48b29967329e3fdd9 | 2,217 | py | Python | newsdatascraper/models.py | erikqu/NewsDataScraper | 686102b53d11ba14773ac9d468a2f4b1b4c45a42 | [
"MIT"
] | 5 | 2019-08-13T00:12:02.000Z | 2021-12-14T02:38:41.000Z | newsdatascraper/models.py | erikqu/NewsDataScraper | 686102b53d11ba14773ac9d468a2f4b1b4c45a42 | [
"MIT"
] | null | null | null | newsdatascraper/models.py | erikqu/NewsDataScraper | 686102b53d11ba14773ac9d468a2f4b1b4c45a42 | [
"MIT"
] | null | null | null | import json
import csv
import pickle
class ArticleFromJson: # pragma: no cover
"""Data model for one article"""
def __init__(
self,
publisher: str,
title: str,
description: str,
url: str,
date_published,
content: str,
author: str = 'Not Found',... | 29.56 | 75 | 0.601714 | import json
import csv
import pickle
class ArticleFromJson:
def __init__(
self,
publisher: str,
title: str,
description: str,
url: str,
date_published,
content: str,
author: str = 'Not Found',
):
self.publisher = publisher
self... | true | true |
f73cf0e3aa3957672cd28f652a1f0461874ddcc9 | 14,332 | py | Python | policy_gradient.py | rey-allan/rl | 6124bcfe5de8a9a316c41fb75b50a3e9babfc970 | [
"MIT"
] | null | null | null | policy_gradient.py | rey-allan/rl | 6124bcfe5de8a9a316c41fb75b50a3e9babfc970 | [
"MIT"
] | null | null | null | policy_gradient.py | rey-allan/rl | 6124bcfe5de8a9a316c41fb75b50a3e9babfc970 | [
"MIT"
] | null | null | null | """Implementation of different policy gradient methods"""
import argparse
import numpy as np
import plot as plt
import random
from collections import namedtuple
from env import Action, Easy21, State
from tqdm import tqdm
from typing import Callable, List
# For reproducibility
random.seed(0)
np.random.seed(0)
Traject... | 38.840108 | 120 | 0.612824 | import argparse
import numpy as np
import plot as plt
import random
from collections import namedtuple
from env import Action, Easy21, State
from tqdm import tqdm
from typing import Callable, List
random.seed(0)
np.random.seed(0)
Trajectory = namedtuple("Trajectory", ["state", "action", "reward"])
def encode(s: S... | true | true |
f73cf1cd9472f494b49bd2ce550dbfc38b02b7bd | 92 | py | Python | exercises/for_loops.py | moheeeldin19-meet/y2s18-python_review | d47a343de76adbd8445d1d22227fdb09932edf58 | [
"MIT"
] | null | null | null | exercises/for_loops.py | moheeeldin19-meet/y2s18-python_review | d47a343de76adbd8445d1d22227fdb09932edf58 | [
"MIT"
] | null | null | null | exercises/for_loops.py | moheeeldin19-meet/y2s18-python_review | d47a343de76adbd8445d1d22227fdb09932edf58 | [
"MIT"
] | null | null | null | # Write your solution for 1.1 here!
x=0
for i in range(101):
x+=i
print(x)
| 13.142857 | 35 | 0.543478 |
x=0
for i in range(101):
x+=i
print(x)
| true | true |
f73cf32a7962a7e162bdf513bca407d581fec4f4 | 3,971 | py | Python | engines/ep/management/cli_auth_utils.py | scwright027/kv_engine | 6fc9dc957844f077d44dc6992794ffe35e91e1f7 | [
"BSD-3-Clause"
] | 1 | 2019-06-13T07:33:09.000Z | 2019-06-13T07:33:09.000Z | engines/ep/management/cli_auth_utils.py | paolococchi/kv_engine | 40256dca6bf77fb4bcc18e8ef7d9b8f991bf4e45 | [
"BSD-3-Clause"
] | null | null | null | engines/ep/management/cli_auth_utils.py | paolococchi/kv_engine | 40256dca6bf77fb4bcc18e8ef7d9b8f991bf4e45 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import getpass
import inspect
import os
import sys
import clitool
import mc_bin_client
import memcacheConstants
from functools import wraps
def cmd_decorator(f):
"""Decorate a function with code to authenticate based on
the following additional arguments passed by keyword:
bucke... | 34.833333 | 104 | 0.5379 |
import getpass
import inspect
import os
import sys
import clitool
import mc_bin_client
import memcacheConstants
from functools import wraps
def cmd_decorator(f):
@wraps(f)
def g(*args, **kwargs):
mc = args[0]
spec = inspect.getargspec(f)
max_args = len(spec.args)
... | true | true |
f73cf4b7b989bdf9a60326d5a7f1b1b125497465 | 11,108 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/stringprep.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/stringprep.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/stringprep.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: stringprep.py
"""Library that exposes various tables found in the StringPrep RFC 3454.
There are two kinds of tables: sets, for which a member test ... | 38.435986 | 155 | 0.557796 |
from unicodedata import ucd_3_2_0 as unicodedata
def in_table_a1(code):
if unicodedata.category(code) != 'Cn':
return False
c = ord(code)
if 64976 <= c < 65008:
return False
return c & 65535 not in (65534, 65535)
b1_set = set([173, 847, 6150, 6155, 6156, 6157, 8203, 8204, 8205, 8... | true | true |
f73cf664aa456d02f7e264675360420a7f633c5a | 1,316 | py | Python | setup.py | marcohong/xform | 653ef732aca1cf05f8e973b51a5bc2abbdb46589 | [
"MIT"
] | 2 | 2021-06-04T02:29:23.000Z | 2021-11-24T07:43:07.000Z | setup.py | marcohong/xform | 653ef732aca1cf05f8e973b51a5bc2abbdb46589 | [
"MIT"
] | null | null | null | setup.py | marcohong/xform | 653ef732aca1cf05f8e973b51a5bc2abbdb46589 | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='xargs',
version='0.4.3',
author='Maco',
description='Binding form data validation framework.',
long_description=long_description,
long_description_content_type='text/markdown',
autho... | 34.631579 | 70 | 0.616261 | from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='xargs',
version='0.4.3',
author='Maco',
description='Binding form data validation framework.',
long_description=long_description,
long_description_content_type='text/markdown',
autho... | true | true |
f73cf66c1b4a50d5ca0177942c270fee63ecab95 | 12,968 | py | Python | playbooks/roles/repo_server/files/openstack-wheel-builder.py | digideskio/digideskOPEN | 0ec13cbb35ad2edead9e8381472483b0bbabf9e9 | [
"Apache-2.0"
] | null | null | null | playbooks/roles/repo_server/files/openstack-wheel-builder.py | digideskio/digideskOPEN | 0ec13cbb35ad2edead9e8381472483b0bbabf9e9 | [
"Apache-2.0"
] | null | null | null | playbooks/roles/repo_server/files/openstack-wheel-builder.py | digideskio/digideskOPEN | 0ec13cbb35ad2edead9e8381472483b0bbabf9e9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... | 31.706601 | 78 | 0.490824 |
import os
import traceback
import yaml
from cloudlib import arguments
from cloudlib import shell
REQUIREMENTS_FILE_TYPES = [
'requirements.txt',
'global-requirements.txt',
'test-requirements.txt',
'dev-requirements.txt'
]
BUILT_IN_PIP_PACKAGE_VARS = [
'service_pip_dependenci... | true | true |
f73cf6b2817245d0a3cbe170c9e4dc347bdcf0ad | 610 | py | Python | db_tools/errors.py | ScottSnapperLab/db_tools | f11ce6baf0cb690e7d9eec43e785910d1f892ca8 | [
"MIT"
] | 1 | 2018-05-25T17:00:59.000Z | 2018-05-25T17:00:59.000Z | db_tools/errors.py | ScottSnapperLab/db_tools | f11ce6baf0cb690e7d9eec43e785910d1f892ca8 | [
"MIT"
] | 1 | 2018-03-09T15:59:15.000Z | 2018-03-09T15:59:15.000Z | db_tools/errors.py | ScottSnapperLab/db_tools | f11ce6baf0cb690e7d9eec43e785910d1f892ca8 | [
"MIT"
] | 3 | 2018-01-09T18:07:25.000Z | 2018-02-20T16:44:12.000Z | #!/usr/bin/env python
"""Provide error classes."""
# Imports
from db_tools import __author__, __email__
class DBToolsError(Exception):
"""Base error class."""
class NotImplementedYet(NotImplementedError, DBToolsError):
"""Raise when a section of code that has been left for another time is asked to execute.... | 30.5 | 148 | 0.681967 |
from db_tools import __author__, __email__
class DBToolsError(Exception):
class NotImplementedYet(NotImplementedError, DBToolsError):
def __init__(self, msg=None):
if msg is None:
msg = f"That bonehead {__author__} should really hear your rage about this disgraceful oversight! Feel free ... | true | true |
f73cf8b6fe84cb26171f16532c4ff6a3e3ae4cb9 | 392 | py | Python | datatype.py | taccisum/py_base_learn | d7608827cb03f3d24dabe51309dabc832a55fb34 | [
"MIT"
] | null | null | null | datatype.py | taccisum/py_base_learn | d7608827cb03f3d24dabe51309dabc832a55fb34 | [
"MIT"
] | null | null | null | datatype.py | taccisum/py_base_learn | d7608827cb03f3d24dabe51309dabc832a55fb34 | [
"MIT"
] | null | null | null | #coding=utf-8
# datatype.py
integer = 123
print integer
_float = 12.34
print _float
string = 'hello \'python\' '
print string
string1 = r'hello \\\\'
print string1
boolean = True
print boolean
print
# 逻辑运算
print True and True
print True and False
print True or False
print False or False
print not True
print
pri... | 10.315789 | 28 | 0.721939 |
integer = 123
print integer
_float = 12.34
print _float
string = 'hello \'python\' '
print string
string1 = r'hello \\\\'
print string1
boolean = True
print boolean
print
print True and True
print True and False
print True or False
print False or False
print not True
print
print None
PI = 3.141592653
print... | false | true |
f73cf92b8d16003b4dbe116864ff5454dea6a4f6 | 6,383 | py | Python | src/emotions_tpu.py | Novixous/Emotion-Trainer | a71d7c6ac3a0686e28ad7ee0b3a5489289ee233d | [
"MIT"
] | null | null | null | src/emotions_tpu.py | Novixous/Emotion-Trainer | a71d7c6ac3a0686e28ad7ee0b3a5489289ee233d | [
"MIT"
] | null | null | null | src/emotions_tpu.py | Novixous/Emotion-Trainer | a71d7c6ac3a0686e28ad7ee0b3a5489289ee233d | [
"MIT"
] | null | null | null | import numpy as np
import argparse
import matplotlib.pyplot as plt
import cv2
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.layers import MaxPooling2... | 37.547059 | 130 | 0.681184 | import numpy as np
import argparse
import matplotlib.pyplot as plt
import cv2
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.layers import MaxPooling2... | true | true |
f73cf9a27021c93616be5b0375218d312ee68a00 | 3,330 | py | Python | resources/lib/kodi/context_menu_utils.py | Sopor/plugin.video.netflix-1 | ecefb537cdffa368e104864b313fbcc010b44b68 | [
"MIT"
] | null | null | null | resources/lib/kodi/context_menu_utils.py | Sopor/plugin.video.netflix-1 | ecefb537cdffa368e104864b313fbcc010b44b68 | [
"MIT"
] | null | null | null | resources/lib/kodi/context_menu_utils.py | Sopor/plugin.video.netflix-1 | ecefb537cdffa368e104864b313fbcc010b44b68 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2020 Stefano Gottardo (original implementation module)
Miscellaneous utility functions for generating context menu items
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
f... | 41.625 | 118 | 0.666366 |
from __future__ import absolute_import, division, unicode_literals
import resources.lib.common as common
from resources.lib.globals import G
# unfortunately use 'get_local_string' on a variable in the module header, makes that method (get_local_string)
# run immediately upon loading of the add-on modules, making i... | true | true |
f73cf9e98acc79937549705b6f20437879812e33 | 937 | py | Python | model-optimizer/mo/front/mxnet/extractors/l2_normalization.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 2 | 2021-04-19T06:08:35.000Z | 2021-08-25T02:43:43.000Z | model-optimizer/mo/front/mxnet/extractors/l2_normalization.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 6 | 2022-01-11T18:56:22.000Z | 2022-02-21T13:20:20.000Z | model-optimizer/mo/front/mxnet/extractors/l2_normalization.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 3 | 2021-02-05T17:11:17.000Z | 2021-04-19T08:33:31.000Z | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 30.225806 | 73 | 0.70651 | from mo.front.common.partial_infer.elemental import copy_shape_infer
def l2_normalization_ext(attrs):
eps = attrs.float('eps', 1e-10)
node_attrs = {
'op': 'Normalize',
'type': 'Normalize',
'eps': eps,
'across_spatial': 0,
'channel_shared': 0,
'infer': copy_shap... | true | true |
f73cf9ed066b594d8af8b16eb6a2ffaab0220af6 | 2,648 | py | Python | xknx/dpt/dpt_color.py | iligiddi/xknx | c450d5934c8ddc608741229a7d14168013c3684c | [
"MIT"
] | null | null | null | xknx/dpt/dpt_color.py | iligiddi/xknx | c450d5934c8ddc608741229a7d14168013c3684c | [
"MIT"
] | null | null | null | xknx/dpt/dpt_color.py | iligiddi/xknx | c450d5934c8ddc608741229a7d14168013c3684c | [
"MIT"
] | null | null | null | """Implementation of the KNX date data point."""
from __future__ import annotations
from typing import NamedTuple
from xknx.exceptions import ConversionError
from .dpt import DPTBase
class XYYColor(NamedTuple):
"""
Representation of XY color with brightness.
`color`: tuple(x-axis, y-axis) each 0..1; N... | 30.790698 | 89 | 0.549849 | from __future__ import annotations
from typing import NamedTuple
from xknx.exceptions import ConversionError
from .dpt import DPTBase
class XYYColor(NamedTuple):
color: tuple[float, float] | None = None
brightness: int | None = None
class DPTColorXYY(DPTBase):
payload_length = 6
@classmethod
... | true | true |
f73cfabfc4605a3b2f73acdd941bd367b03624d5 | 28,713 | py | Python | deepxde/model.py | mitchelldaneker/deepxde | 62e09b62ceaab6bda2ebbd02dc30ad99c2990302 | [
"Apache-2.0"
] | 955 | 2019-06-21T21:56:02.000Z | 2022-03-31T03:44:45.000Z | deepxde/model.py | mitchelldaneker/deepxde | 62e09b62ceaab6bda2ebbd02dc30ad99c2990302 | [
"Apache-2.0"
] | 517 | 2019-07-25T16:47:44.000Z | 2022-03-31T17:37:58.000Z | deepxde/model.py | mitchelldaneker/deepxde | 62e09b62ceaab6bda2ebbd02dc30ad99c2990302 | [
"Apache-2.0"
] | 374 | 2019-06-24T00:44:16.000Z | 2022-03-30T08:17:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__all__ = ["Model", "TrainState", "LossHistory"]
import pickle
from collections import OrderedDict
import numpy as np
from . import config
from . import display
from . import gradients as grad
from . import... | 39.549587 | 174 | 0.601574 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__all__ = ["Model", "TrainState", "LossHistory"]
import pickle
from collections import OrderedDict
import numpy as np
from . import config
from . import display
from . import gradients as grad
from . import... | true | true |
f73cfaefb7a4527a990f4d7515e5b63e30ce4a25 | 1,694 | py | Python | utils/util.py | lahu2046/textAI | a000a871ef13fa9b65183f9f3605dd4ef58b49f3 | [
"Apache-2.0"
] | null | null | null | utils/util.py | lahu2046/textAI | a000a871ef13fa9b65183f9f3605dd4ef58b49f3 | [
"Apache-2.0"
] | 10 | 2020-01-28T22:20:46.000Z | 2022-02-10T00:29:15.000Z | utils/util.py | lahu2046/textAI | a000a871ef13fa9b65183f9f3605dd4ef58b49f3 | [
"Apache-2.0"
] | null | null | null | import requests
import platform
import os
sys = platform.system()
dataset_cmd = "python dataset/prepare_data.py -fold=1 -num_folds=1024 -base_fn=dataset/tf/data_1024 -input_fn=dataset/data -max_seq_length=1024 > tf.log"
train_cmd = "python train/train1.py --config_file=configs/mega.json --input_file=dataset/tf/data_10... | 41.317073 | 438 | 0.70425 | import requests
import platform
import os
sys = platform.system()
dataset_cmd = "python dataset/prepare_data.py -fold=1 -num_folds=1024 -base_fn=dataset/tf/data_1024 -input_fn=dataset/data -max_seq_length=1024 > tf.log"
train_cmd = "python train/train1.py --config_file=configs/mega.json --input_file=dataset/tf/data_10... | true | true |
f73cfafeeb37a3a672b842662fff025a873092cf | 10,680 | py | Python | Logchart.py | kinghows/Logchart | fd26433a2b29883a32c4ff25dfce83a15799caec | [
"MIT"
] | 1 | 2022-01-24T03:58:16.000Z | 2022-01-24T03:58:16.000Z | Logchart.py | kinghows/Logchart | fd26433a2b29883a32c4ff25dfce83a15799caec | [
"MIT"
] | null | null | null | Logchart.py | kinghows/Logchart | fd26433a2b29883a32c4ff25dfce83a15799caec | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
# coding: utf-8
# Logchart V1.0.0 for python3
# Log Chart
# Copyright (C) 2017-2017 Kinghow - Kinghow@hotmail.com
# Git repository available at https://github.com/kinghows/Logchart
import getopt
import sys
import configparser
import os
from pyecharts import options as opts
from py... | 55.625 | 176 | 0.56985 |
import getopt
import sys
import configparser
import os
from pyecharts import options as opts
from pyecharts.globals import ThemeType
from pyecharts.charts import Page
from pyecharts.charts import Tab
from pyecharts.charts import Line
def chart(chart_type,title,xlist,ylist,datas,style,themetype):
... | true | true |
f73cfb931582ea2bcc2caff3e32dd7386747f99b | 1,061 | py | Python | tests.py | carlosperate/microrepl | 65881ac592f69f02c0247536c92896a3ea45d02c | [
"Apache-2.0"
] | 32 | 2015-10-23T10:23:18.000Z | 2021-09-23T14:19:07.000Z | tests.py | carlosperate/microrepl | 65881ac592f69f02c0247536c92896a3ea45d02c | [
"Apache-2.0"
] | 17 | 2015-11-12T19:54:46.000Z | 2018-07-13T10:05:43.000Z | tests.py | carlosperate/microrepl | 65881ac592f69f02c0247536c92896a3ea45d02c | [
"Apache-2.0"
] | 21 | 2015-09-21T10:02:56.000Z | 2020-07-23T23:18:02.000Z | import pytest
import io
from unittest.mock import patch
import os
import tempfile
from microrepl import connect_miniterm
@pytest.yield_fixture
def fake_stderr():
fake_stderr = io.StringIO()
with patch('sys.stderr', fake_stderr):
yield fake_stderr
@pytest.yield_fixture
def fake_sys_exit():
with pa... | 34.225806 | 98 | 0.769086 | import pytest
import io
from unittest.mock import patch
import os
import tempfile
from microrepl import connect_miniterm
@pytest.yield_fixture
def fake_stderr():
fake_stderr = io.StringIO()
with patch('sys.stderr', fake_stderr):
yield fake_stderr
@pytest.yield_fixture
def fake_sys_exit():
with pa... | true | true |
f73cfdf0281bc7eb3b3eb6a1ed0fedc6fae30ef1 | 1,244 | py | Python | ether/qpacketlist.py | alexin-ivan/ether | ab7334d800778206d14ed5a479ef1369549d7dca | [
"MIT"
] | null | null | null | ether/qpacketlist.py | alexin-ivan/ether | ab7334d800778206d14ed5a479ef1369549d7dca | [
"MIT"
] | null | null | null | ether/qpacketlist.py | alexin-ivan/ether | ab7334d800778206d14ed5a479ef1369549d7dca | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
##############################################################################
from PyQt4.QtGui import (
QWidget,
QListWidget,
QVBoxLayout,
)
##############################################################################
class QPacketList(QWidget):
def... | 24.88 | 78 | 0.552251 | true | true | |
f73cfe82e35e2f60278615276eea55384c62a200 | 14,243 | py | Python | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/kernel/tests/test_message_spec.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 26 | 2018-02-14T23:52:58.000Z | 2021-08-16T13:50:03.000Z | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/kernel/tests/test_message_spec.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/kernel/tests/test_message_spec.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 10 | 2018-08-13T19:38:39.000Z | 2020-04-19T03:02:00.000Z | """Test suite for our zeromq-based messaging specification.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as par... | 27.549323 | 104 | 0.618269 |
import re
from subprocess import PIPE
from Queue import Empty
import nose.tools as nt
from IPython.kernel import KernelManager
from IPython.testing import decorators as dec
from IPython.utils.traitlets import (
HasTraits, TraitError, Bool, Unicode, Dict, Integer, List, Enum, Any,
)
STARTUP_TIMEOUT = ... | true | true |
f73cfebdc4d158cade3ac32819dbfd4af475739a | 673 | py | Python | exercicios_python_brasil/estrutura_decisao/16_equacao_segundo_grau.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_decisao/16_equacao_segundo_grau.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_decisao/16_equacao_segundo_grau.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | from math import pow, sqrt
print('\033[1m>>> EQUAÇÃO DE 2º GRAU <<<\033[m')
a = int(input('> VALOR DE A: '))
if a != 0:
b = int(input('> VALOR DE B: '))
c = int(input('> VALOR DE C: '))
print('-'*30)
print('\033[1mRESULTADO...\033[m')
delta = pow(b, 2) - (4 * a * c)
if delta > 0:
... | 30.590909 | 62 | 0.459138 | from math import pow, sqrt
print('\033[1m>>> EQUAÇÃO DE 2º GRAU <<<\033[m')
a = int(input('> VALOR DE A: '))
if a != 0:
b = int(input('> VALOR DE B: '))
c = int(input('> VALOR DE C: '))
print('-'*30)
print('\033[1mRESULTADO...\033[m')
delta = pow(b, 2) - (4 * a * c)
if delta > 0:
... | true | true |
f73cfeff7ae8267b2343f68a5bbba178daeff131 | 3,441 | py | Python | myproject/settings.py | albertopitti/coursera_final_template | bfeb3c71562ca63d83dce9b5203cb868ba287517 | [
"Apache-2.0"
] | null | null | null | myproject/settings.py | albertopitti/coursera_final_template | bfeb3c71562ca63d83dce9b5203cb868ba287517 | [
"Apache-2.0"
] | null | null | null | myproject/settings.py | albertopitti/coursera_final_template | bfeb3c71562ca63d83dce9b5203cb868ba287517 | [
"Apache-2.0"
] | null | null | null | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 26.469231 | 91 | 0.699797 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'aay0j_9b&ky3a7(8m8il+-1ud(scw12@w5!+5-=gsk6ynzi0ls'
DEBUG = True
# <HINT> add your cloud host here
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'onlinecourse.templatetags.dict_key',
'o... | true | true |
f73cff8aae354822f72fe132ce08d075d80bc53e | 6,715 | py | Python | src/dataloader.py | pyguan88/EDSR_WDSR_PyTorch | 8212c63f0905f2126dffef7678269b83342b290b | [
"MIT"
] | null | null | null | src/dataloader.py | pyguan88/EDSR_WDSR_PyTorch | 8212c63f0905f2126dffef7678269b83342b290b | [
"MIT"
] | null | null | null | src/dataloader.py | pyguan88/EDSR_WDSR_PyTorch | 8212c63f0905f2126dffef7678269b83342b290b | [
"MIT"
] | null | null | null | import sys
import threading
import queue
import random
import collections
import torch
import torch.multiprocessing as multiprocessing
# from torch._C import _set_worker_signal_handlers, _update_worker_pids, \
# _remove_worker_pids, _error_if_any_worker_fails
# from torch.utils.data.dataloader import DataLoader
#... | 35.157068 | 104 | 0.600745 | import sys
import threading
import queue
import random
import collections
import torch
import torch.multiprocessing as multiprocessing
_signal_handlers
from torch.utils.data import _utils
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.dataloader import _DataLoaderIter
_use_... | true | true |
f73d028c9b85aae8bc073853db7e98b634f042f5 | 15,010 | py | Python | tests/unit/test_consumer.py | mmanciop/loki-operator | 1fe5a87afeebd3b2ce167bb8636f281954bade9c | [
"Apache-2.0"
] | null | null | null | tests/unit/test_consumer.py | mmanciop/loki-operator | 1fe5a87afeebd3b2ce167bb8636f281954bade9c | [
"Apache-2.0"
] | null | null | null | tests/unit/test_consumer.py | mmanciop/loki-operator | 1fe5a87afeebd3b2ce167bb8636f281954bade9c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Canonical Ltd.
# See LICENSE file for licensing details.
import json
import os
import textwrap
import unittest
from unittest.mock import patch
import yaml
from charms.loki_k8s.v0.loki_push_api import LokiPushApiConsumer
from fs.tempfs import TempFS
from helpers import TempFolderSandbox
from ops.charm... | 41.578947 | 243 | 0.65523 |
import json
import os
import textwrap
import unittest
from unittest.mock import patch
import yaml
from charms.loki_k8s.v0.loki_push_api import LokiPushApiConsumer
from fs.tempfs import TempFS
from helpers import TempFolderSandbox
from ops.charm import CharmBase
from ops.framework import StoredState
from ops.testing... | true | true |
f73d02b0670ba031e280d8962600767d547c6811 | 868 | py | Python | vendor/packages/nose/functional_tests/test_multiprocessing/test_nameerror.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | vendor/packages/nose/functional_tests/test_multiprocessing/test_nameerror.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/nose/functional_tests/test_multiprocessing/test_nameerror.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | import os
import unittest
from nose.plugins import PluginTester
from nose.plugins.skip import SkipTest
from nose.plugins.multiprocess import MultiProcess
support = os.path.join(os.path.dirname(__file__), 'support')
def setup():
try:
import multiprocessing
if 'active' in MultiProcess.status:
... | 27.125 | 78 | 0.686636 | import os
import unittest
from nose.plugins import PluginTester
from nose.plugins.skip import SkipTest
from nose.plugins.multiprocess import MultiProcess
support = os.path.join(os.path.dirname(__file__), 'support')
def setup():
try:
import multiprocessing
if 'active' in MultiProcess.status:
... | false | true |
f73d04417507eb9ad8bcb6fbcd23dc9cd31f5d8e | 4,036 | py | Python | models/transformer_block.py | druzhkov-paul/T2T-ViT | 819c3ddc4cb6f464d4a9866d8713c7ace42ebf6c | [
"BSD-3-Clause-Clear"
] | null | null | null | models/transformer_block.py | druzhkov-paul/T2T-ViT | 819c3ddc4cb6f464d4a9866d8713c7ace42ebf6c | [
"BSD-3-Clause-Clear"
] | null | null | null | models/transformer_block.py | druzhkov-paul/T2T-ViT | 819c3ddc4cb6f464d4a9866d8713c7ace42ebf6c | [
"BSD-3-Clause-Clear"
] | null | null | null | # Copyright (c) [2012]-[2021] Shanghai Yitu Technology Co., Ltd.
#
# This source code is licensed under the Clear BSD License
# LICENSE file in the root directory of this file
# All rights reserved.
"""
Borrow from timm(https://github.com/rwightman/pytorch-image-models)
"""
import torch
import torch.nn as nn
import num... | 38.807692 | 112 | 0.641724 |
import torch
import torch.nn as nn
import numpy as np
from timm.models.layers import DropPath
class Mlp(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
super().__init__()
out_features = out_features or in_features
hidden... | true | true |
f73d062989ac2a5616e28a5f89abef2a22ad7f7d | 3,379 | py | Python | sdcflows/workflows/tests/test_ancillary.py | madisoth/sdcflows | c2f01e4f9b19dbd89ac1b54e3cfb0643fc3fd4f2 | [
"Apache-2.0"
] | 16 | 2020-02-25T17:47:10.000Z | 2022-03-07T02:54:51.000Z | sdcflows/workflows/tests/test_ancillary.py | madisoth/sdcflows | c2f01e4f9b19dbd89ac1b54e3cfb0643fc3fd4f2 | [
"Apache-2.0"
] | 175 | 2020-02-15T00:52:28.000Z | 2022-03-29T21:42:31.000Z | sdcflows/workflows/tests/test_ancillary.py | madisoth/sdcflows | c2f01e4f9b19dbd89ac1b54e3cfb0643fc3fd4f2 | [
"Apache-2.0"
] | 12 | 2019-05-28T23:34:37.000Z | 2020-01-22T21:32:22.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 32.805825 | 87 | 0.645753 |
import os
import pytest
from nipype.pipeline import engine as pe
from nipype.interfaces import utility as niu
from niworkflows.interfaces.reportlets.masks import SimpleShowMaskRPT
from ..ancillary import init_brainextraction_wf
@pytest.mark.skipif(os.getenv("GITHUB_ACTIONS") == "true", reason="t... | true | true |
f73d0655aeb3505542c77ad93a17e4f9ef9544a2 | 18,131 | py | Python | env/lib/python3.6/site-packages/sqlalchemy/orm/instrumentation.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | env/lib/python3.6/site-packages/sqlalchemy/orm/instrumentation.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | env/lib/python3.6/site-packages/sqlalchemy/orm/instrumentation.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # orm/instrumentation.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines SQLAlchemy's system of class instrumentation.
This module is usua... | 32.147163 | 78 | 0.650543 |
from . import base
from . import collections
from . import exc
from . import interfaces
from . import state
from .. import util
_memoized_key_collection = util.group_expirable_memoized_property()
class ClassManager(dict):
MANAGER_ATTR = base.DEFAULT_MANAGER_ATTR
STATE_ATTR = base.DEFAULT_STATE_ATT... | true | true |
f73d0759d039f23a64d0b7e1e12cb250c63a58e4 | 5,706 | py | Python | graphs/minimum_spanning_tree_boruvka.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | graphs/minimum_spanning_tree_boruvka.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | graphs/minimum_spanning_tree_boruvka.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | class Graph:
"""
Data structure to store graphs (based on adjacency lists)
"""
def __init__(self):
self.num_vertices = 0
self.num_edges = 0
self.adjacency = {}
def add_vertex(self, vertex):
"""
Adds a vertex to the graph
"""
if vertex not i... | 28.964467 | 78 | 0.487907 | class Graph:
def __init__(self):
self.num_vertices = 0
self.num_edges = 0
self.adjacency = {}
def add_vertex(self, vertex):
if vertex not in self.adjacency:
self.adjacency[vertex] = {}
self.num_vertices += 1
def add_edge(self, head, tail, weight):
... | true | true |
f73d08975ca3cbf8ae8233b59ede8665af9489fd | 1,585 | py | Python | signbank/context_processors.py | Signbank/signbank | d28c843475141b8a0ede17b7977f88d93b27aa85 | [
"BSD-3-Clause"
] | null | null | null | signbank/context_processors.py | Signbank/signbank | d28c843475141b8a0ede17b7977f88d93b27aa85 | [
"BSD-3-Clause"
] | null | null | null | signbank/context_processors.py | Signbank/signbank | d28c843475141b8a0ede17b7977f88d93b27aa85 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from guardian.shortcuts import get_objects_for_user
from signbank.tools import get_selected_datasets_for_user, get_datasets_with_public_glosses
from signbank.dictionary.models import Dataset
def url(request):
if not request.user.is_authenticated():
# for anonymous users, s... | 49.53125 | 108 | 0.748896 | from django.conf import settings
from guardian.shortcuts import get_objects_for_user
from signbank.tools import get_selected_datasets_for_user, get_datasets_with_public_glosses
from signbank.dictionary.models import Dataset
def url(request):
if not request.user.is_authenticated():
viewable_datase... | true | true |
f73d09c2da9b1f1b580b0a0903e9b18a0b4a3e83 | 524 | py | Python | ltcd/test_349.py | ValentynaGorbachenko/cd2 | ad9e05092ddca9bfef29f185b23fdf5b22099e05 | [
"MIT"
] | null | null | null | ltcd/test_349.py | ValentynaGorbachenko/cd2 | ad9e05092ddca9bfef29f185b23fdf5b22099e05 | [
"MIT"
] | null | null | null | ltcd/test_349.py | ValentynaGorbachenko/cd2 | ad9e05092ddca9bfef29f185b23fdf5b22099e05 | [
"MIT"
] | null | null | null | # test_349.py
import unittest
from intersection_349 import intersect
class intersectTest(unittest.TestCase):
def test_intersect_1(self):
self.assertEqual(intersect([1,2,2,1], [2,2]), [2])
# @unittest.skip("demonstrating skipping")
def test_intersect_2(self):
res = intersect([4,4,9,5],... | 26.2 | 58 | 0.625954 |
import unittest
from intersection_349 import intersect
class intersectTest(unittest.TestCase):
def test_intersect_1(self):
self.assertEqual(intersect([1,2,2,1], [2,2]), [2])
def test_intersect_2(self):
res = intersect([4,4,9,5],[9,4,9,8,4])
res.sort()
self.assertEqua... | true | true |
f73d0a70138e299b2e68e833326cde7a43a828e0 | 1,720 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/browser/test_browser_save_image.py | marshall/gaia | 00722269f5d559595fd2f79d9dd70310758af08c | [
"Apache-2.0"
] | 1 | 2019-02-13T23:44:14.000Z | 2019-02-13T23:44:14.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/browser/test_browser_save_image.py | marshall/gaia | 00722269f5d559595fd2f79d9dd70310758af08c | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/functional/browser/test_browser_save_image.py | marshall/gaia | 00722269f5d559595fd2f79d9dd70310758af08c | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
try:
from marionette.marionette import Actions
except:
from marionette_driver.marionette import Actions
from ga... | 31.272727 | 71 | 0.679651 |
try:
from marionette.marionette import Actions
except:
from marionette_driver.marionette import Actions
from gaiatest import GaiaTestCase
from gaiatest.apps.search.app import Search
from gaiatest.apps.system.regions.activities import Activities
from gaiatest.apps.system.app import System
class TestBrowse... | true | true |
f73d0a81543ea606e8f5a1821b795140ae5732d4 | 6,119 | py | Python | ansys/dpf/core/time_freq_scoping_factory.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 18 | 2021-10-16T10:38:29.000Z | 2022-03-29T11:26:42.000Z | ansys/dpf/core/time_freq_scoping_factory.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 79 | 2021-10-11T23:18:54.000Z | 2022-03-29T14:53:14.000Z | ansys/dpf/core/time_freq_scoping_factory.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 5 | 2021-11-29T18:35:37.000Z | 2022-03-16T16:49:21.000Z | """
time_freq_scoping_factory
=========================
Contains functions to simplify creating time frequency scopings.
"""
from ansys.dpf.core import Scoping
from ansys.dpf.core import errors as dpf_errors
from ansys.dpf.core.common import locations
from ansys.dpf.core.model import Model
def scoping_by_load_step(l... | 32.547872 | 100 | 0.68655 |
from ansys.dpf.core import Scoping
from ansys.dpf.core import errors as dpf_errors
from ansys.dpf.core.common import locations
from ansys.dpf.core.model import Model
def scoping_by_load_step(load_step, server=None):
scoping = Scoping(server=server, ids=[load_step], location=locations.time_freq_step)
return sc... | true | true |
f73d0b339751590edcee1d843cf956e4e643fcc3 | 6,148 | py | Python | src/oci/oda/models/create_digital_assistant_version_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/oda/models/create_digital_assistant_version_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/oda/models/create_digital_assistant_version_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 37.950617 | 245 | 0.658426 |
from .create_digital_assistant_details import CreateDigitalAssistantDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class CreateDigitalAssistantVersionDetails(CreateDigitalA... | true | true |
f73d0bfc9c7fa46db6bcab3d6885939da199bcd7 | 944 | py | Python | leetcode/0078_Subsets/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | leetcode/0078_Subsets/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | leetcode/0078_Subsets/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-04-27 21:41:14
# Description:
import os
import sys
class Solution(object):
def subsets(self, nums):
ret = []
self.dfs(nums, [], ret)
return ret
def dfs(self, nums, path, ret):
ret.append(path)
... | 21.454545 | 57 | 0.494703 |
import os
import sys
class Solution(object):
def subsets(self, nums):
ret = []
self.dfs(nums, [], ret)
return ret
def dfs(self, nums, path, ret):
ret.append(path)
for i in range(len(nums)):
self.dfs(nums[i + 1:], path + [nums[i]], ret)
def s... | true | true |
f73d0ccd60d4f9f3638e3275c7a342afcf7e8570 | 24,873 | py | Python | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/horovod/setup.py | mengkai94/training_results_v0.6 | 43dc3e250f8da47b5f8833197d74cb8cf1004fc9 | [
"Apache-2.0"
] | 42 | 2019-07-11T18:23:52.000Z | 2021-09-14T08:21:09.000Z | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/horovod/setup.py | mengkai94/training_results_v0.6 | 43dc3e250f8da47b5f8833197d74cb8cf1004fc9 | [
"Apache-2.0"
] | 23 | 2019-07-29T05:21:52.000Z | 2020-08-31T18:51:42.000Z | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/horovod/setup.py | mengkai94/training_results_v0.6 | 43dc3e250f8da47b5f8833197d74cb8cf1004fc9 | [
"Apache-2.0"
] | 51 | 2019-07-12T05:10:25.000Z | 2021-07-28T16:19:06.000Z | # Copyright 2017 Uber Technologies, 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 required by applica... | 38.924883 | 118 | 0.625297 |
from __future__ import print_function
import os
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from distutils.errors import CompileError, DistutilsError, DistutilsPlatformError, LinkError
import shlex
import subprocess
import sys
import textwrap
... | true | true |
f73d10c8ba87f317b58df20c51d2dd5afc1f1151 | 220 | py | Python | niyopolymers/patches/import_price_list.py | venku31/niyopolymers | f150ee591d2ea10720d8e98c5f6abf7c6e2edb2d | [
"MIT"
] | null | null | null | niyopolymers/patches/import_price_list.py | venku31/niyopolymers | f150ee591d2ea10720d8e98c5f6abf7c6e2edb2d | [
"MIT"
] | null | null | null | niyopolymers/patches/import_price_list.py | venku31/niyopolymers | f150ee591d2ea10720d8e98c5f6abf7c6e2edb2d | [
"MIT"
] | null | null | null | import frappe
def execute():
path = frappe.get_app_path("niyopolymers", "patches", "imports", "price_list.csv")
frappe.core.doctype.data_import.data_import.import_file("Price List", path, "Insert", console=True) | 44 | 103 | 0.740909 | import frappe
def execute():
path = frappe.get_app_path("niyopolymers", "patches", "imports", "price_list.csv")
frappe.core.doctype.data_import.data_import.import_file("Price List", path, "Insert", console=True) | true | true |
f73d10fe1ebd52dc14f7892bc7bc987383890531 | 3,140 | py | Python | chj/app/ObjectSize.py | kestreltechnology/CodeHawk-Java | 7c218f67161bbe1a8aa2cc70f16d28e032957464 | [
"MIT"
] | null | null | null | chj/app/ObjectSize.py | kestreltechnology/CodeHawk-Java | 7c218f67161bbe1a8aa2cc70f16d28e032957464 | [
"MIT"
] | 1 | 2020-08-01T04:20:13.000Z | 2020-08-01T04:20:13.000Z | chj/app/ObjectSize.py | kestreltechnology/CodeHawk-Java | 7c218f67161bbe1a8aa2cc70f16d28e032957464 | [
"MIT"
] | 3 | 2020-07-25T22:55:03.000Z | 2021-10-20T08:18:39.000Z | # ------------------------------------------------------------------------------
# CodeHawk Java Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# Copyright (c) 2021 Andrew McG... | 42.432432 | 80 | 0.626433 |
from typing import List, TYPE_CHECKING
if TYPE_CHECKING:
from chj.app.JavaClass import JavaClass
from chj.index.FieldSignature import FieldSignature
from chj.index.FieldSignature import ClassFieldSignature
from chj.index.JObjectTypes import JObjectTypeBase
class ObjectSize(... | true | true |
f73d11124216d1c078e19899f86739d1c526bec5 | 2,307 | py | Python | Protheus_WebApp/Modules/SIGAJURI/JURA108TestCase.py | HelenaAdrignoli/tir-script-samples | bb4f4ab3a49f723216c93f66a4395e5aa328b846 | [
"MIT"
] | 1 | 2021-12-07T18:16:27.000Z | 2021-12-07T18:16:27.000Z | Modules/SIGAJURI/JURA108TestCase.py | ccpn1988/TIR | fede6db280b35564b73e14a4588451dd88288bab | [
"MIT"
] | null | null | null | Modules/SIGAJURI/JURA108TestCase.py | ccpn1988/TIR | fede6db280b35564b73e14a4588451dd88288bab | [
"MIT"
] | null | null | null | from tir import Webapp
import unittest
class JURA108(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.SetTIRConfig(config_name="user", value="daniel.frodrigues")
inst.oHelper.SetTIRConfig(config_name="password", value="1")
inst.oHelper.Setup('SIGAJURI','','T1','D M... | 38.45 | 92 | 0.739922 | from tir import Webapp
import unittest
class JURA108(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.SetTIRConfig(config_name="user", value="daniel.frodrigues")
inst.oHelper.SetTIRConfig(config_name="password", value="1")
inst.oHelper.Setup('SIGAJURI','','T1','D M... | true | true |
f73d121b6b27b06f03eb59a172064c7c0937ce64 | 6,791 | py | Python | lib/moerdergraphall.py | orithena/moerderspiel | 7a11598cd80f26824376207805d3a937b9c1d831 | [
"MIT"
] | 16 | 2015-09-30T13:45:07.000Z | 2022-01-31T16:45:50.000Z | lib/moerdergraphall.py | orithena/moerderspiel | 7a11598cd80f26824376207805d3a937b9c1d831 | [
"MIT"
] | 5 | 2015-09-16T13:44:08.000Z | 2018-02-06T11:24:59.000Z | lib/moerdergraphall.py | orithena/moerderspiel | 7a11598cd80f26824376207805d3a937b9c1d831 | [
"MIT"
] | 4 | 2015-05-28T17:39:55.000Z | 2022-01-29T01:27:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os.path
import yapgvb as graph
from yapgvb import RenderingContext, CLIRenderError
import textwrap
import math
import colorsys
import pickle
from moerderklassen import *
from utils import colorgen
import utils
class MyRenderingContext(RenderingContext):
... | 33.453202 | 114 | 0.709616 |
import sys
import os.path
import yapgvb as graph
from yapgvb import RenderingContext, CLIRenderError
import textwrap
import math
import colorsys
import pickle
from moerderklassen import *
from utils import colorgen
import utils
class MyRenderingContext(RenderingContext):
def render(self, graph, output_type, destfi... | true | true |
f73d133f1804d0833d771530b775e1da1e558e30 | 853 | py | Python | src.py | duldiev/Assignment-2-Scrapping | a9dbb4bb14b7fe0a1c5ec6eba73491008ff8da52 | [
"MIT"
] | null | null | null | src.py | duldiev/Assignment-2-Scrapping | a9dbb4bb14b7fe0a1c5ec6eba73491008ff8da52 | [
"MIT"
] | null | null | null | src.py | duldiev/Assignment-2-Scrapping | a9dbb4bb14b7fe0a1c5ec6eba73491008ff8da52 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup as soup
from selenium import webdriver
class Scrapper:
def getArticles(self, cryptoName):
url = 'https://coinmarketcap.com/currencies/' + cryptoName + '/news/'
driver = webdriver.Firefox()
driver.get(url)
page = driver.page_source
page_soup = ... | 38.772727 | 110 | 0.588511 | from bs4 import BeautifulSoup as soup
from selenium import webdriver
class Scrapper:
def getArticles(self, cryptoName):
url = 'https://coinmarketcap.com/currencies/' + cryptoName + '/news/'
driver = webdriver.Firefox()
driver.get(url)
page = driver.page_source
page_soup = ... | true | true |
f73d13f885dbff2583adeceb1df3697205245259 | 367 | py | Python | main_app/forms.py | Blankphrase/social_reach | 2dd49799c4f659d823c4d50ac6b79fe58f0bbddc | [
"MIT"
] | null | null | null | main_app/forms.py | Blankphrase/social_reach | 2dd49799c4f659d823c4d50ac6b79fe58f0bbddc | [
"MIT"
] | 3 | 2020-06-05T18:56:01.000Z | 2021-06-10T20:48:50.000Z | main_app/forms.py | Blankphrase/social_reach | 2dd49799c4f659d823c4d50ac6b79fe58f0bbddc | [
"MIT"
] | 1 | 2018-09-11T08:48:43.000Z | 2018-09-11T08:48:43.000Z | from django import forms
class UserSignupForm(forms.Form):
first_name = forms.CharField(max_length=30, label='First Name')
last_name = forms.CharField(max_length=30, label='Last Name')
def signup(self, request, user):
user.first_name = self.cleaned_data['first_name']
user.last_name = self... | 30.583333 | 67 | 0.700272 | from django import forms
class UserSignupForm(forms.Form):
first_name = forms.CharField(max_length=30, label='First Name')
last_name = forms.CharField(max_length=30, label='Last Name')
def signup(self, request, user):
user.first_name = self.cleaned_data['first_name']
user.last_name = self... | true | true |
f73d14dc5923df77021909a76535feb2c4b6de4b | 4,238 | py | Python | src/fhir_helpers/utils.py | anthem-ai/fhir-helpers | 803653f7ef64dbb41bdc24b06cb16425964058aa | [
"Apache-2.0"
] | null | null | null | src/fhir_helpers/utils.py | anthem-ai/fhir-helpers | 803653f7ef64dbb41bdc24b06cb16425964058aa | [
"Apache-2.0"
] | null | null | null | src/fhir_helpers/utils.py | anthem-ai/fhir-helpers | 803653f7ef64dbb41bdc24b06cb16425964058aa | [
"Apache-2.0"
] | null | null | null | import operator
from datetime import date, datetime
from typing import Any, Literal, Optional
from dateutil import tz
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from google.protobuf import message
from proto.google.fhir.proto.r4.core import datatypes_pb2
ComparatorType = Litera... | 26.993631 | 102 | 0.646531 | import operator
from datetime import date, datetime
from typing import Any, Literal, Optional
from dateutil import tz
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from google.protobuf import message
from proto.google.fhir.proto.r4.core import datatypes_pb2
ComparatorType = Litera... | true | true |
f73d14e380b950b8366f085b4d0a7302ccc13da9 | 1,435 | py | Python | utils/test.py | Heedeok/OT_deepsort_kalman | 174e3d618a2340c435ff945edffd00ab3d0a7a97 | [
"MIT"
] | 3 | 2021-03-02T05:55:46.000Z | 2021-09-09T05:43:00.000Z | utils/test.py | Heedeok/OT_deepsort_kalman | 174e3d618a2340c435ff945edffd00ab3d0a7a97 | [
"MIT"
] | null | null | null | utils/test.py | Heedeok/OT_deepsort_kalman | 174e3d618a2340c435ff945edffd00ab3d0a7a97 | [
"MIT"
] | null | null | null | '''
Date of modification : 2021.01.22
Code Summary : realsense camera python code 최종 ë²„ì „
Input option 0 : D435i (default)
1 : L515
2 : D445i
'''
#####################################################
## ... | 26.090909 | 69 | 0.337979 | true | true | |
f73d1651e117027823c5b17efbc497879691d3db | 3,596 | py | Python | Asiago_GALAH_spectra_compare/benchmarks_compare.py | kcotar/Asiago-Echelle-spectra | 57bb7880d4bdd353a25575f5f5c1b2558a5ec118 | [
"MIT"
] | null | null | null | Asiago_GALAH_spectra_compare/benchmarks_compare.py | kcotar/Asiago-Echelle-spectra | 57bb7880d4bdd353a25575f5f5c1b2558a5ec118 | [
"MIT"
] | null | null | null | Asiago_GALAH_spectra_compare/benchmarks_compare.py | kcotar/Asiago-Echelle-spectra | 57bb7880d4bdd353a25575f5f5c1b2558a5ec118 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from sklearn.externals import joblib
from glob import glob
from astropy.io import fits
from astropy.table import Table, join
from copy import deepcopy
import os
import imp
imp.load_source('helper_functions', '../../Carbon-Spectra/helper_functions.py')
from helper_func... | 36.693878 | 117 | 0.631535 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.externals import joblib
from glob import glob
from astropy.io import fits
from astropy.table import Table, join
from copy import deepcopy
import os
import imp
imp.load_source('helper_functions', '../../Carbon-Spectra/helper_functions.py')
from helper_func... | false | true |
f73d169f0c4f6941d6d154dba79e8ea19c3c2e6a | 43,484 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/trafficitem.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/trafficitem.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/trafficitem.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 47.16269 | 829 | 0.680365 |
from uhd_restpy.base import Base
from uhd_restpy.files import Files
class TrafficItem(Base):
__slots__ = ()
_SDM_NAME = 'trafficItem'
_SDM_ATT_MAP = {
'AllowSelfDestined': 'allowSelfDestined',
'BiDirectional': 'biDirectional',
'EgressEnabled': 'egressEnabled',... | true | true |
f73d17d57ea5412b417c94739f617f5b02ecb377 | 11,771 | py | Python | Sketches/RJL/Torrent/TorrentClient.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/RJL/Torrent/TorrentClient.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/RJL/Torrent/TorrentClient.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/li... | 39.901695 | 119 | 0.668252 |
from __future__ import division
from BitTorrent.translation import _
import pdb
import sys
import os
from cStringIO import StringIO
import logging
from logging import ERROR
from time import strftime, sleep
import traceback
import BitTorrent.stackthreading as threading
from BitTorrent.defer import Defer... | false | true |
f73d1836dc7e1efb37ef8462febf2641fff639d7 | 353 | py | Python | src/adafruit-circuitpython-bundle-4.x-mpy-20190713/examples/circuitplayground_light.py | mbaaba/solar_panel | 42059d8c61320494ad1298065dbc50cd9b3bd51e | [
"MIT"
] | null | null | null | src/adafruit-circuitpython-bundle-4.x-mpy-20190713/examples/circuitplayground_light.py | mbaaba/solar_panel | 42059d8c61320494ad1298065dbc50cd9b3bd51e | [
"MIT"
] | null | null | null | src/adafruit-circuitpython-bundle-4.x-mpy-20190713/examples/circuitplayground_light.py | mbaaba/solar_panel | 42059d8c61320494ad1298065dbc50cd9b3bd51e | [
"MIT"
] | null | null | null | """This example uses the light sensor on your CPX, located next to the picture of the eye. Try
shining a flashlight on your CPX, or covering the light sensor with your finger to see the values
increase and decrease."""
import time
from adafruit_circuitplayground.express import cpx
while True:
print("Light:"... | 35.3 | 98 | 0.745042 | import time
from adafruit_circuitplayground.express import cpx
while True:
print("Light:", cpx.light)
time.sleep(1)
| true | true |
f73d18f5dae6d8719eac2d33c9bce7865b8eb90e | 401 | py | Python | openslides/users/migrations/0012_user_auth_type.py | swilde/OpenSlides | 23ae32a75892005632784652d108836d1ba09da9 | [
"MIT"
] | 3 | 2021-02-11T20:45:58.000Z | 2022-02-09T21:59:42.000Z | openslides/users/migrations/0012_user_auth_type.py | swilde/OpenSlides | 23ae32a75892005632784652d108836d1ba09da9 | [
"MIT"
] | 2 | 2021-11-02T15:48:16.000Z | 2022-03-02T08:38:19.000Z | server/openslides/users/migrations/0012_user_auth_type.py | DLRG-Jugend-NDS/OpenSlides | 03704e4852821ccd67fe23adb6e2c38b67d93732 | [
"MIT"
] | 3 | 2021-01-18T11:44:05.000Z | 2022-01-19T16:00:23.000Z | # Generated by Django 2.2.4 on 2019-08-21 12:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0011_postgresql_auth_group_id_sequence")]
operations = [
migrations.AddField(
model_name="user",
name="auth_type",
... | 23.588235 | 72 | 0.640898 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0011_postgresql_auth_group_id_sequence")]
operations = [
migrations.AddField(
model_name="user",
name="auth_type",
field=models.CharField(default="default"... | true | true |
f73d1972d37beccba0b567c5ef01ea3d09253d7f | 10,866 | py | Python | services/ui_backend_service/api/ws.py | runsascoded/metaflow-service | ac7770dfeae17fd060129d408fa3bb472fc00b86 | [
"Apache-2.0"
] | null | null | null | services/ui_backend_service/api/ws.py | runsascoded/metaflow-service | ac7770dfeae17fd060129d408fa3bb472fc00b86 | [
"Apache-2.0"
] | 1 | 2022-01-13T23:46:05.000Z | 2022-01-13T23:46:05.000Z | services/ui_backend_service/api/ws.py | valayDave/metaflow-service | 65e19aef268e9e707522ee0695fd4ebaee42aa69 | [
"Apache-2.0"
] | null | null | null | import os
import json
import time
import asyncio
import collections
from aiohttp import web, WSMsgType
from typing import List, Dict, Any, Callable
from .utils import resource_conditions, TTLQueue
from services.utils import logging
from pyee import AsyncIOEventEmitter
from ..data.refiner import TaskRefiner, ArtifactR... | 45.275 | 132 | 0.61697 | import os
import json
import time
import asyncio
import collections
from aiohttp import web, WSMsgType
from typing import List, Dict, Any, Callable
from .utils import resource_conditions, TTLQueue
from services.utils import logging
from pyee import AsyncIOEventEmitter
from ..data.refiner import TaskRefiner, ArtifactR... | true | true |
f73d1b6f0a863cbf844b200b6f9bfbc5c66038a3 | 1,845 | py | Python | ooobuild/dyn/script/finish_reason.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/script/finish_reason.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/script/finish_reason.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 35.480769 | 131 | 0.702981 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from ooo.helper.enum_helper import uno_enum_class_new
from com.sun... | true | true |
f73d1cdde88ea5054bb83e839c1fa81bfae02767 | 6,257 | py | Python | python/eventserver.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 20 | 2016-04-30T11:24:45.000Z | 2021-11-09T10:39:25.000Z | python/eventserver.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 1 | 2020-09-23T13:36:58.000Z | 2020-09-23T13:36:58.000Z | python/eventserver.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 8 | 2015-10-07T13:40:36.000Z | 2019-08-07T06:45:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde'
import flask
import redis
import os
import json
import bs4
import bridge
import codecs
import datetime
from werkzeug.serving import WSGIRequestHandler
base_path = os.getcwd() + '/'
print "base_path:",base_path
app = flask.Flask(__name__)
ap... | 31.761421 | 149 | 0.712162 |
__author__ = 'Benjamin Milde'
import flask
import redis
import os
import json
import bs4
import bridge
import codecs
import datetime
from werkzeug.serving import WSGIRequestHandler
base_path = os.getcwd() + '/'
print "base_path:",base_path
app = flask.Flask(__name__)
app.secret_key = 'asdf'
app._static_folder = b... | false | true |
f73d1ce0c34183a433022f4bce2769a6211ba93a | 133,829 | py | Python | google_appengine/google/appengine/datastore/entity_pb.py | katoakira/python_study | 7ee7f3658129a918f97067be5c087ef340cc2b0b | [
"MIT"
] | null | null | null | google_appengine/google/appengine/datastore/entity_pb.py | katoakira/python_study | 7ee7f3658129a918f97067be5c087ef340cc2b0b | [
"MIT"
] | null | null | null | google_appengine/google/appengine/datastore/entity_pb.py | katoakira/python_study | 7ee7f3658129a918f97067be5c087ef340cc2b0b | [
"MIT"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 30.10099 | 381 | 0.679703 |
from google.net.proto import ProtocolBuffer
import array
import dummy_thread as thread
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
unusednames=printElemNumber,debug_strs no-special"""
if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
_extension_runtime = Tr... | true | true |
f73d1e2ab377c5666108bb9937d32b45afad104a | 1,519 | py | Python | uppsell/util/serialize.py | upptalk/uppsell | 843dfe81dbbd7d0cc920e6c8256d27e27c3106fe | [
"MIT"
] | 2 | 2020-01-10T18:21:32.000Z | 2021-01-31T13:53:28.000Z | uppsell/util/serialize.py | gaybro8777/uppsell | 843dfe81dbbd7d0cc920e6c8256d27e27c3106fe | [
"MIT"
] | 4 | 2015-12-03T22:59:05.000Z | 2021-06-10T19:12:59.000Z | uppsell/util/serialize.py | gaybro8777/uppsell | 843dfe81dbbd7d0cc920e6c8256d27e27c3106fe | [
"MIT"
] | 1 | 2021-02-08T08:21:22.000Z | 2021-02-08T08:21:22.000Z | import json, uuid
from datetime import datetime, date
from decimal import Decimal
from werkzeug.http import http_date
from django.db.models import Model
from django.db.models.base import ModelBase
from django.db.models.query import QuerySet, ValuesQuerySet
from django.db.models.fields.related import ManyToManyField
fro... | 37.04878 | 95 | 0.665569 | import json, uuid
from datetime import datetime, date
from decimal import Decimal
from werkzeug.http import http_date
from django.db.models import Model
from django.db.models.base import ModelBase
from django.db.models.query import QuerySet, ValuesQuerySet
from django.db.models.fields.related import ManyToManyField
fro... | true | true |
f73d1e44eab9cf821b354de9774a9018ed75b8a1 | 742 | py | Python | tests/test_authorize.py | dutkiewicz/adform-api | 5b670ea971c261565d1fe4cf7c18b2e109f8449d | [
"MIT"
] | null | null | null | tests/test_authorize.py | dutkiewicz/adform-api | 5b670ea971c261565d1fe4cf7c18b2e109f8449d | [
"MIT"
] | 6 | 2019-11-29T04:53:15.000Z | 2020-06-29T04:41:24.000Z | tests/test_authorize.py | dutkiewicz/adform-api | 5b670ea971c261565d1fe4cf7c18b2e109f8449d | [
"MIT"
] | null | null | null | import configparser
import unittest
import adform
class AuthorizeTestCase(unittest.TestCase):
def setUp(self):
config = configparser.ConfigParser()
config.read('config.ini')
self.client_id = config['DEFAULT']['CLIENT_ID']
self.client_secret = config['DEFAULT']['CLIENT_SECRET']
... | 27.481481 | 73 | 0.691375 | import configparser
import unittest
import adform
class AuthorizeTestCase(unittest.TestCase):
def setUp(self):
config = configparser.ConfigParser()
config.read('config.ini')
self.client_id = config['DEFAULT']['CLIENT_ID']
self.client_secret = config['DEFAULT']['CLIENT_SECRET']
... | true | true |
f73d1e7b6ef3cb6a6ce2651fdcee3b1d5ed53155 | 83 | py | Python | Jour 3/myNumpy.py | bellash13/SmartAcademyPython | 44d0f6db0fcdcbbf1449a45b073a2b3182a19714 | [
"MIT"
] | null | null | null | Jour 3/myNumpy.py | bellash13/SmartAcademyPython | 44d0f6db0fcdcbbf1449a45b073a2b3182a19714 | [
"MIT"
] | null | null | null | Jour 3/myNumpy.py | bellash13/SmartAcademyPython | 44d0f6db0fcdcbbf1449a45b073a2b3182a19714 | [
"MIT"
] | null | null | null | import numpy as np
a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])
print(len(a)) | 27.666667 | 50 | 0.566265 | import numpy as np
a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])
print(len(a)) | true | true |
f73d1ed062d1e63988ff94ecca50aa7e8e2f2a26 | 3,562 | py | Python | src/convmag/main.py | tgwoodcock/convmag | d1aec42b2735c66601652a679dac732ac944a888 | [
"MIT"
] | null | null | null | src/convmag/main.py | tgwoodcock/convmag | d1aec42b2735c66601652a679dac732ac944a888 | [
"MIT"
] | null | null | null | src/convmag/main.py | tgwoodcock/convmag | d1aec42b2735c66601652a679dac732ac944a888 | [
"MIT"
] | null | null | null | """
This module contains the code for the interactive conversion
of units at the command line.
@author: tgwoodcock
"""
from . import convmag_functions as cm
# interactive conversion
def main():
CONVERTING = True
print("*****Conversion between magnetic units.*****")
print("\nAt the 'Input:' promt, enter:... | 45.088608 | 95 | 0.49607 |
from . import convmag_functions as cm
def main():
CONVERTING = True
print("*****Conversion between magnetic units.*****")
print("\nAt the 'Input:' promt, enter:")
print("[value startunit endunit] e.g. 6 T A/m,")
print("[units] to list the available units,")
print("[conv] to list the conversi... | true | true |
f73d1eebbf537262d9995df1b48005f623211cd7 | 3,703 | py | Python | tools/filelife.py | figozhang/bcc | 0abd93e5f908a930f87007937f4028aecc13975b | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-01-07T12:10:31.000Z | 2017-01-07T12:10:31.000Z | tools/filelife.py | Agares/bcc | 0abd93e5f908a930f87007937f4028aecc13975b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tools/filelife.py | Agares/bcc | 0abd93e5f908a930f87007937f4028aecc13975b | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2018-10-30T07:57:13.000Z | 2021-06-15T02:29:44.000Z | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# filelife Trace the lifespan of short-lived files.
# For Linux, uses BCC, eBPF. Embedded C.
#
# This traces the creation and deletion of files, providing information
# on who deleted the file, the file age, and the file name. The intent is... | 26.45 | 79 | 0.660546 |
from __future__ import print_function
from bcc import BPF
import argparse
from time import strftime
import ctypes as ct
examples = """examples:
./filelife # trace all stat() syscalls
./filelife -p 181 # only trace PID 181
"""
parser = argparse.ArgumentParser(
description="T... | true | true |
f73d1f9c8efe120b86007ce12c1b4e79557e3ee1 | 631 | py | Python | wildlifecompliance/migrations/0368_auto_20200107_1627.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 1 | 2020-12-07T17:12:40.000Z | 2020-12-07T17:12:40.000Z | wildlifecompliance/migrations/0368_auto_20200107_1627.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 14 | 2020-01-08T08:08:26.000Z | 2021-03-19T22:59:46.000Z | wildlifecompliance/migrations/0368_auto_20200107_1627.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 15 | 2020-01-08T08:02:28.000Z | 2021-11-03T06:48:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2020-01-07 08:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0367_globalsettings'),
]
operations = [
migrations.Al... | 30.047619 | 218 | 0.675119 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0367_globalsettings'),
]
operations = [
migrations.AlterField(
model_name='globalsettings',
name='ke... | true | true |
f73d1fd0b75425e47bd6ece71b944ad623e88d7a | 9,869 | py | Python | samples/VendorReadWriteProperty.py | cbergmiller/bacpypes | 7b1f2e989787c2c1f807680fee5ee7a71b3689ab | [
"MIT"
] | 1 | 2018-01-11T13:10:15.000Z | 2018-01-11T13:10:15.000Z | samples/VendorReadWriteProperty.py | cbergmiller/bacpypes | 7b1f2e989787c2c1f807680fee5ee7a71b3689ab | [
"MIT"
] | null | null | null | samples/VendorReadWriteProperty.py | cbergmiller/bacpypes | 7b1f2e989787c2c1f807680fee5ee7a71b3689ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This application presents a 'console' prompt to the user asking for commands.
For 'read' commands it will create ReadPropertyRequest PDUs, then lines up the
coorresponding ReadPropertyACK and prints the value. For 'write' commands it
will create WritePropertyRequst PDUs and prints out a sim... | 35.37276 | 110 | 0.602594 |
import sys
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.consolelogging import ConfigArgumentParser
from bacpypes.consolecmd import ConsoleCmd
from bacpypes.core import run, enable_sleeping
from bacpypes.iocb import IOCB
from bacpypes.pdu import Address
from bacpypes.object import ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.