hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3ec03f18a5a848881af36a1d5ceb7207605662f7 | 3,428 | py | Python | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/agency_token_user_domain.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/agency_token_user_domain.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/agency_token_user_domain.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class AgencyTokenUserDomain:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The ... | 24.485714 | 79 | 0.531505 |
3d942ac896791be5c6cdacb07b8396e3a1a8391e | 20,017 | py | Python | LibVQ/learnable_index/learnable_index.py | staoxiao/LibVQ | f844c60055ace872279daa272b0bad1005c02e2b | [
"MIT"
] | 4 | 2022-03-30T01:39:59.000Z | 2022-03-30T06:20:41.000Z | LibVQ/learnable_index/learnable_index.py | staoxiao/LibVQ | f844c60055ace872279daa272b0bad1005c02e2b | [
"MIT"
] | null | null | null | LibVQ/learnable_index/learnable_index.py | staoxiao/LibVQ | f844c60055ace872279daa272b0bad1005c02e2b | [
"MIT"
] | null | null | null | import logging
import os
import pickle
import shutil
import time
from typing import List, Dict, Type, Union
import faiss
import numpy
import numpy as np
import torch
import torch.multiprocessing as mp
from torch.optim import Optimizer
from transformers import AdamW
from LibVQ.base_index import FaissIndex, IndexConfig... | 48.467312 | 168 | 0.592347 |
a2d85fcebab57e41b6f81e00820097b402789a82 | 2,598 | py | Python | util.py | mdanie2/221Project | d02e63274dc0b69891a28fba77ecaea8b21df3d6 | [
"MIT"
] | null | null | null | util.py | mdanie2/221Project | d02e63274dc0b69891a28fba77ecaea8b21df3d6 | [
"MIT"
] | null | null | null | util.py | mdanie2/221Project | d02e63274dc0b69891a28fba77ecaea8b21df3d6 | [
"MIT"
] | null | null | null | import os, random, operator, sys
from collections import Counter
def dotProduct(d1, d2):
"""
@param dict d1: a feature vector represented by a mapping from a feature (string) to a weight (float).
@param dict d2: same as d1
@return float: the dot product between d1 and d2
"""
if len(d1) < len(d2... | 32.475 | 106 | 0.589684 |
aa3039a3a6b4cc78db8f2e11b9574ab41eb0f4c8 | 8,822 | py | Python | test/test_tensorboard.py | kevinintel/neural-compressor | b57645566aeff8d3c18dc49d2739a583c072f940 | [
"Apache-2.0"
] | 100 | 2020-12-01T02:40:12.000Z | 2021-09-09T08:14:22.000Z | test/test_tensorboard.py | kevinintel/neural-compressor | b57645566aeff8d3c18dc49d2739a583c072f940 | [
"Apache-2.0"
] | 25 | 2021-01-05T00:16:17.000Z | 2021-09-10T03:24:01.000Z | test/test_tensorboard.py | kevinintel/neural-compressor | b57645566aeff8d3c18dc49d2739a583c072f940 | [
"Apache-2.0"
] | 25 | 2020-12-01T19:07:08.000Z | 2021-08-30T14:20:07.000Z | """Tests for quantization"""
import numpy as np
import unittest
import os
import yaml
import tensorflow as tf
import shutil
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import node_def_pb2
from tensorflow.python.framework i... | 43.034146 | 109 | 0.682158 |
04322b04390c269ca054c952f68be3ba792e2a20 | 3,889 | py | Python | catalog/models.py | Jordon-Chen/Django | 592e7a438e0f3823f5def8bea58f7208ba739372 | [
"MIT"
] | null | null | null | catalog/models.py | Jordon-Chen/Django | 592e7a438e0f3823f5def8bea58f7208ba739372 | [
"MIT"
] | 4 | 2021-04-08T21:59:12.000Z | 2021-06-10T20:31:01.000Z | catalog/models.py | Jordon-Chen/Django | 592e7a438e0f3823f5def8bea58f7208ba739372 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from datetime import date
# Create your models here.
class Genre(models.Model):
"""Model representing a book genre."""
name = models.CharField(max_length=200, help_text='Enter a book genre (e.g. Science Fiction)')
def __str__(sel... | 37.038095 | 155 | 0.673952 |
7502587a22652e48aa4549219fb3af6538f34c5e | 539 | py | Python | run.py | jacekkow/docker-plugin-pyipam | 40a1f97aa6f7ef85c73fcf942f7872b61c64a0fd | [
"BSD-3-Clause"
] | 2 | 2021-08-31T11:19:20.000Z | 2021-12-04T14:54:11.000Z | run.py | jacekkow/docker-plugin-pyipam | 40a1f97aa6f7ef85c73fcf942f7872b61c64a0fd | [
"BSD-3-Clause"
] | null | null | null | run.py | jacekkow/docker-plugin-pyipam | 40a1f97aa6f7ef85c73fcf942f7872b61c64a0fd | [
"BSD-3-Clause"
] | 1 | 2021-09-01T01:37:03.000Z | 2021-09-01T01:37:03.000Z | #!/usr/bin/env python3
import logging
import os
import docker_plugin_api.Plugin
import flask
import waitress
app = flask.Flask('pyIPAM')
app.logger.setLevel(logging.DEBUG)
app.register_blueprint(docker_plugin_api.Plugin.app)
import lib.IpamDriver
docker_plugin_api.Plugin.functions.append('IpamDriver')
app.register... | 22.458333 | 79 | 0.777365 |
062585cb85c09df7456aabd83a4ec82338f4db0c | 2,280 | py | Python | test_project/settings.py | drummonds/django-sql-explorer | 0c2c642008fa04a309edfa07011d2238e57d4e64 | [
"MIT"
] | null | null | null | test_project/settings.py | drummonds/django-sql-explorer | 0c2c642008fa04a309edfa07011d2238e57d4e64 | [
"MIT"
] | null | null | null | test_project/settings.py | drummonds/django-sql-explorer | 0c2c642008fa04a309edfa07011d2238e57d4e64 | [
"MIT"
] | null | null | null | import os
import djcelery
SECRET_KEY = 'shhh'
DEBUG = True
STATIC_URL = '/static/'
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'tmp',
'TEST': {
'NAME': 'tmp'
}
},
'alt': {
... | 23.265306 | 73 | 0.611842 |
7b357e7db7a643085256b512ac222a777eeb4bde | 635 | py | Python | SpiMediaGallery/manage.py | Swiss-Polar-Institute/spi-media-gallery | 2f66f938cbe1a7a25a5971d42abb1b0b5deca31e | [
"MIT"
] | 5 | 2020-02-21T20:38:50.000Z | 2022-02-19T11:00:46.000Z | SpiMediaGallery/manage.py | Swiss-Polar-Institute/spi-media-gallery | 2f66f938cbe1a7a25a5971d42abb1b0b5deca31e | [
"MIT"
] | 23 | 2019-10-01T17:13:39.000Z | 2022-01-21T20:02:26.000Z | SpiMediaGallery/manage.py | Swiss-Polar-Institute/spi-media-gallery | 2f66f938cbe1a7a25a5971d42abb1b0b5deca31e | [
"MIT"
] | 2 | 2022-02-03T08:52:51.000Z | 2022-02-03T08:58:00.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'SpiMediaGallery.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... | 28.863636 | 79 | 0.686614 |
9c3f101ac51c4e7768382eecd5cf237a331e1284 | 812 | py | Python | third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/PRESUBMIT.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/PRESUBMIT.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/PRESUBMIT.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script that runs tests before uploading a patch."""
def _RunTests(input_api, output_api):
"""Runs all test files in the directory."""
cmd_name = ... | 33.833333 | 77 | 0.715517 |
09afe34c839e40b575ec2c61fb72b4d5e5fea6cc | 6,687 | py | Python | pyof/v0x01/asynchronous/error_msg.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | pyof/v0x01/asynchronous/error_msg.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | pyof/v0x01/asynchronous/error_msg.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | """Defines an Error Message."""
# System imports
from enum import Enum
from pyof.foundation.base import GenericMessage
from pyof.foundation.basic_types import BinaryData, UBInt16
from pyof.foundation.exceptions import PackException
# Do not import new_message_from_header directly to avoid cyclic import.
from pyof.v0x... | 29.328947 | 79 | 0.654853 |
6460f76185df75b783cf3cd8d4a0de594ab8a013 | 4,935 | py | Python | compose/cli/command.py | killifishd/compose | 3cb2b73d1cf68a8da93c3946729f0635eddd1f58 | [
"Apache-2.0"
] | 3 | 2020-08-12T08:19:40.000Z | 2020-08-12T08:19:43.000Z | compose/cli/command.py | Mason613/compose | 3cb2b73d1cf68a8da93c3946729f0635eddd1f58 | [
"Apache-2.0"
] | null | null | null | compose/cli/command.py | Mason613/compose | 3cb2b73d1cf68a8da93c3946729f0635eddd1f58 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import os
import re
import six
from . import errors
from . import verbose_proxy
from .. import config
from .. import parallel
from ..config.environment import Environment
from ..const import API_VERSIONS
from ..project impo... | 33.344595 | 90 | 0.696657 |
64e9a1000750940f4ba03052761b5a0173986268 | 1,754 | py | Python | album/models.py | ndonyemark/marksgallery | 4aad6ee9d6348723b41a7011add44543071f670c | [
"MIT"
] | null | null | null | album/models.py | ndonyemark/marksgallery | 4aad6ee9d6348723b41a7011add44543071f670c | [
"MIT"
] | 8 | 2021-03-19T03:59:05.000Z | 2022-03-12T00:31:37.000Z | album/models.py | ndonyemark/marksgallery | 4aad6ee9d6348723b41a7011add44543071f670c | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Location(models.Model):
image_location = models.CharField(max_length = 30)
def save_location(self):
self.save()
def delete_location(self):
self.delete()
class Category(models.Model):
category = models.CharField(max_le... | 27.40625 | 82 | 0.672178 |
c9d7733f9828a2b31eb0df2a5684b087ed96a88d | 1,112 | py | Python | supervised/gradDescent/gradientDescent.py | robotenique/mlAlgorithms | 612d7fb2dcf4430528f63d35d6f1d10a33fee1af | [
"Unlicense"
] | 4 | 2017-08-16T21:37:31.000Z | 2022-02-10T05:37:39.000Z | supervised/gradDescent/gradientDescent.py | robotenique/mlAlgorithms | 612d7fb2dcf4430528f63d35d6f1d10a33fee1af | [
"Unlicense"
] | null | null | null | supervised/gradDescent/gradientDescent.py | robotenique/mlAlgorithms | 612d7fb2dcf4430528f63d35d6f1d10a33fee1af | [
"Unlicense"
] | null | null | null | from computeCost import computeCost
import numpy as np
def gradientDescent(X, y, theta, alpha, num_iters):
"""
Performs gradient descent to learn theta
theta = gradientDescent(x, y, theta, alpha, num_iters) updates theta by
taking num_iters gradient steps with learning rate alpha
"""
#... | 27.8 | 78 | 0.639388 |
979661980d246731af47beedc12caf6fe17e0597 | 4,474 | py | Python | openpyxl/tests/test_vba.py | zhangyu836/openpyxl | c2735a2a0fd81cf78082008bd4bee0fc84a3b130 | [
"MIT"
] | 12 | 2019-08-07T16:48:21.000Z | 2021-12-13T02:47:22.000Z | openpyxl/tests/test_vba.py | zhangyu836/openpyxl | c2735a2a0fd81cf78082008bd4bee0fc84a3b130 | [
"MIT"
] | 19 | 2019-12-29T05:07:36.000Z | 2021-04-22T18:09:49.000Z | openpyxl/tests/test_vba.py | zhangyu836/openpyxl | c2735a2a0fd81cf78082008bd4bee0fc84a3b130 | [
"MIT"
] | 1 | 2020-05-26T20:33:10.000Z | 2020-05-26T20:33:10.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
# Python stdlib imports
from io import BytesIO
import zipfile
# package imports
from openpyxl.reader.excel import load_workbook
from openpyxl.writer.excel import save_virtual_workbook
from openpyxl.xml.functions import fromstring
from openpyxl... | 36.975207 | 94 | 0.571077 |
a6861caae3879c7b10dcf89b31a191819eb929dc | 2,277 | py | Python | src/endpoints/pypi_check/crud.py | devsetgo/pip-checker | ba7cbe115459224ad9581f80901434e12a21b3bf | [
"MIT"
] | 1 | 2020-11-16T01:31:26.000Z | 2020-11-16T01:31:26.000Z | src/endpoints/pypi_check/crud.py | devsetgo/devtools | ba7cbe115459224ad9581f80901434e12a21b3bf | [
"MIT"
] | 158 | 2020-05-30T01:26:33.000Z | 2021-04-18T00:48:36.000Z | src/endpoints/pypi_check/crud.py | devsetgo/devtools | ba7cbe115459224ad9581f80901434e12a21b3bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
import uuid
from datetime import datetime
from datetime import timedelta
from loguru import logger
import settings
from com_lib import crud_ops
from com_lib.db_setup import libraries
from com_lib.db_setup import requirements
def get_date():
if settings.DEMO_DATA_CREATE == "... | 28.822785 | 68 | 0.681159 |
af5a8dce69c07909b93a8e04ca2f042138c7df34 | 809 | py | Python | scripts/predict.py | YounessDataV/batch9_dyslexia | ec40ac0b79e7269ddc543e55ddc7a241ca313524 | [
"MIT"
] | null | null | null | scripts/predict.py | YounessDataV/batch9_dyslexia | ec40ac0b79e7269ddc543e55ddc7a241ca313524 | [
"MIT"
] | null | null | null | scripts/predict.py | YounessDataV/batch9_dyslexia | ec40ac0b79e7269ddc543e55ddc7a241ca313524 | [
"MIT"
] | null | null | null | from dyslexia import preprocessing
from dyslexia.io import load_image
from dyslexia.ocr import extract_text_from_image
import pathlib
import cv2
from PIL import Image
import numpy as np
in_path = pathlib.Path("../data/images/")
image_paths = in_path.glob("Sample_0.jpeg")
out_path = pathlib.Path("../data/hypothesis_pr... | 27.896552 | 77 | 0.767614 |
8454f7a4ed10ee1147aedb73240fb8d0a045bbf7 | 1,373 | py | Python | enterprise_manage/urls.py | x315904752/enterprise_manage | ac679d8e7221080dadfdbe6d8ac6ece0b19ed1f1 | [
"MIT"
] | null | null | null | enterprise_manage/urls.py | x315904752/enterprise_manage | ac679d8e7221080dadfdbe6d8ac6ece0b19ed1f1 | [
"MIT"
] | 2 | 2020-06-06T01:09:13.000Z | 2021-06-10T22:26:59.000Z | enterprise_manage/urls.py | x315904752/enterprise_manage | ac679d8e7221080dadfdbe6d8ac6ece0b19ed1f1 | [
"MIT"
] | null | null | null | """enterprise_manage URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
C... | 36.131579 | 78 | 0.753824 |
6e67dc0ac189cb4b807263e62bd16df01d990e5d | 10,491 | py | Python | Src/StdLib/Lib/test/test_base64.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 2,209 | 2016-11-20T10:32:58.000Z | 2022-03-31T20:51:27.000Z | Src/StdLib/Lib/test/test_base64.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 1,074 | 2016-12-07T05:02:48.000Z | 2022-03-22T02:09:11.000Z | Src/StdLib/Lib/test/test_base64.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 269 | 2017-05-21T04:44:47.000Z | 2022-03-31T16:18:13.000Z | import unittest
from test import test_support
import base64
class LegacyBase64TestCase(unittest.TestCase):
def test_encodestring(self):
eq = self.assertEqual
eq(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n")
eq(base64.encodestring("a"), "YQ==\n")
eq(base64.encod... | 43.35124 | 81 | 0.580402 |
23e08f2fbb12873775643ce07b11ae089402036a | 4,488 | py | Python | temboo/core/Library/Basecamp/UpdateList.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Basecamp/UpdateList.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Basecamp/UpdateList.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# UpdateList
# Updates a specified To-do list record
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | 39.716814 | 183 | 0.672237 |
32a48034a36c68b9d274638e22b7d9d50af7541f | 3,786 | py | Python | src/stringify/stringify.py | NSBum/anki_asset_manager | 055d8b6c7226ab0b4db4f4f279fae89dcd88da2a | [
"MIT"
] | null | null | null | src/stringify/stringify.py | NSBum/anki_asset_manager | 055d8b6c7226ab0b4db4f4f279fae89dcd88da2a | [
"MIT"
] | null | null | null | src/stringify/stringify.py | NSBum/anki_asset_manager | 055d8b6c7226ab0b4db4f4f279fae89dcd88da2a | [
"MIT"
] | null | null | null | from hashlib import sha1
from typing import Optional, Union, Literal, Tuple
from ..config_types import (
ScriptSetting,
ConcreteScript,
ScriptInsertion,
ScriptPosition,
Fmt,
)
from ..lib.registrar import get_interface
from ..utils import version
from .condition_parser import get_condition_parser
f... | 26.851064 | 102 | 0.624142 |
1f45d44474152737af08071b9321b60e9422e513 | 7,538 | py | Python | tests/server/unit/services/test_mapping_service.py | Guillon88/tasking-manager | 8f05eef7cb008c680a82dc9884ab7a83a12ab1f8 | [
"BSD-2-Clause"
] | 1 | 2021-08-02T15:32:31.000Z | 2021-08-02T15:32:31.000Z | tests/server/unit/services/test_mapping_service.py | Guillon88/tasking-manager | 8f05eef7cb008c680a82dc9884ab7a83a12ab1f8 | [
"BSD-2-Clause"
] | null | null | null | tests/server/unit/services/test_mapping_service.py | Guillon88/tasking-manager | 8f05eef7cb008c680a82dc9884ab7a83a12ab1f8 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from server.services.mapping_service import (
MappingService,
Task,
MappingServiceError,
TaskStatus,
ProjectService,
NotFound,
StatsService,
MappingNotAllowed,
UserLicenseError,
)
from server.models.dtos.mapping_dto import MappedTaskDTO, LockTaskDTO
from server.models... | 34.263636 | 88 | 0.698594 |
c9a02753a9f6074ca09ffb07002890609ca8a595 | 3,006 | py | Python | hid2sticklog.py | vodka-bears/sticklog2heatmap | c7e329b973574f89ea898500f2871112e07bcf6c | [
"Apache-2.0"
] | 2 | 2022-02-01T22:54:36.000Z | 2022-02-02T17:22:56.000Z | hid2sticklog.py | vodka-bears/sticklog2heatmap | c7e329b973574f89ea898500f2871112e07bcf6c | [
"Apache-2.0"
] | null | null | null | hid2sticklog.py | vodka-bears/sticklog2heatmap | c7e329b973574f89ea898500f2871112e07bcf6c | [
"Apache-2.0"
] | null | null | null | import hid
import datetime
import csv
import signal
from time import sleep
from sys import exit, argv
filename = ''
ERSKY_USB = 0
OPENTX_USB = 1
BF_USB = 2
ELRS_BLE = 3
def to_signed(inp):
if inp & 0x80:
return inp - 256
return inp
def main():
signal.signal(signal.SIGINT, sigint)
devs = [d for d in hid.enum... | 32.673913 | 131 | 0.630406 |
483fb71b5a78f920b7faf3ea7e6be563bb54da87 | 3,468 | py | Python | multiproc.py | terryyizhong/Fastpitch | 4b4eb0206b9727b9daf36628578943f8915cb5ad | [
"BSD-3-Clause"
] | null | null | null | multiproc.py | terryyizhong/Fastpitch | 4b4eb0206b9727b9daf36628578943f8915cb5ad | [
"BSD-3-Clause"
] | null | null | null | multiproc.py | terryyizhong/Fastpitch | 4b4eb0206b9727b9daf36628578943f8915cb5ad | [
"BSD-3-Clause"
] | null | null | null | # *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions... | 37.695652 | 82 | 0.610727 |
a2d3bdb2561e9c3b4f27ee1ac083d527662f1e7f | 3,124 | py | Python | tests/test_led.py | jonasl/python-periphery | 37d2b6d10fdc0fa7779f94047e82d3bed4e79dac | [
"MIT"
] | 58 | 2020-07-23T09:56:16.000Z | 2022-03-15T23:43:26.000Z | tests/test_led.py | jonasl/python-periphery | 37d2b6d10fdc0fa7779f94047e82d3bed4e79dac | [
"MIT"
] | null | null | null | tests/test_led.py | jonasl/python-periphery | 37d2b6d10fdc0fa7779f94047e82d3bed4e79dac | [
"MIT"
] | 16 | 2020-06-09T15:57:39.000Z | 2022-03-23T05:02:47.000Z | import os
import sys
import time
import periphery
from .asserts import AssertRaises
if sys.version_info[0] == 3:
raw_input = input
led_name = None
def test_arguments():
print("Starting arguments test...")
# Invalid open types
with AssertRaises(TypeError):
periphery.LED("abc", "out")
wit... | 23.313433 | 69 | 0.612996 |
9d7d0960f01d011ae94e7053508ddde98b9b8c4f | 856 | py | Python | deep_qa-master/tests/layers/backend/repeat_test.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | 1 | 2017-04-11T13:03:55.000Z | 2017-04-11T13:03:55.000Z | deep_qa-master/tests/layers/backend/repeat_test.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | null | null | null | deep_qa-master/tests/layers/backend/repeat_test.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=no-self-use,invalid-name
import numpy
from keras.layers import Input
from keras.models import Model
from deep_qa.layers.backend.repeat import Repeat
class TestRepeatLayer:
def test_call_works_on_simple_input(self):
batch_size = 2
input_length = 3
repetitions = 4
... | 38.909091 | 96 | 0.675234 |
5ea3e8a1347c0a9a29b085f97dbabd5e7575facd | 837 | py | Python | libapp/init/loggerd.py | octopi-labs/bazzinga | fcdd8e925cbaa31cacbec10dd1d599e72b84c588 | [
"MIT"
] | null | null | null | libapp/init/loggerd.py | octopi-labs/bazzinga | fcdd8e925cbaa31cacbec10dd1d599e72b84c588 | [
"MIT"
] | 3 | 2021-03-20T00:43:11.000Z | 2022-01-06T22:33:23.000Z | libapp/init/loggerd.py | octopi-labs/bazzinga | fcdd8e925cbaa31cacbec10dd1d599e72b84c588 | [
"MIT"
] | null | null | null | __author__ = 'rahul'
import logging
import os
from logging.handlers import TimedRotatingFileHandler
from libapp.config import libconf
def init_app(app):
if not os.path.exists(libconf.LOG_FILE_PATH):
os.makedirs(libconf.LOG_FILE_PATH)
logfile = os.path.join(libconf.LOG_FILE_PATH, libconf.LOG_FILE_N... | 28.862069 | 117 | 0.738351 |
8cb5c8d74b16568c355f542b18e4bf2b4aeba229 | 263 | py | Python | boa3_test/test_sc/interop_test/oracle/OracleRequestFilterMismatchedType.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/interop_test/oracle/OracleRequestFilterMismatchedType.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/interop_test/oracle/OracleRequestFilterMismatchedType.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Any
from boa3.builtin import public
from boa3.builtin.interop.oracle import Oracle
@public
def oracle_call(url: str, callback: str, user_data: Any, gas_for_response: int):
Oracle.request(url, 1234, callback, user_data, gas_for_response)
| 26.3 | 80 | 0.787072 |
011da87584f92403a982030b24a34b9d37920dec | 442 | py | Python | opconsole/views/dashboardView.py | baalkor/timetracking | 35a1650ceffa55e0ff7ef73b63e5f3457dc07612 | [
"Apache-2.0"
] | 1 | 2017-06-05T10:52:13.000Z | 2017-06-05T10:52:13.000Z | opconsole/views/dashboardView.py | baalkor/timetracking | 35a1650ceffa55e0ff7ef73b63e5f3457dc07612 | [
"Apache-2.0"
] | 2 | 2017-05-10T20:47:33.000Z | 2017-05-10T20:49:24.000Z | opconsole/views/dashboardView.py | baalkor/timetracking | 35a1650ceffa55e0ff7ef73b63e5f3457dc07612 | [
"Apache-2.0"
] | null | null | null | from django.urls import reverse_lazy
from django.views.generic import TemplateView
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.shortcuts import render
class DashboardView(PermissionRequiredMixin, TemplateView):
template_name = "opconsole_dashboard.html"
permission_required = '... | 27.625 | 62 | 0.794118 |
c63a34bdd82640f0e2d074a1240beb8647e84e5e | 22,935 | py | Python | lib/tool_shed/test/functional/test_1420_tool_dependency_environment_inheritance.py | lesperry/Metagenomics | a1d8b7d96b32ab83cebe513e889b6ef82f7c1dd6 | [
"CC-BY-3.0"
] | null | null | null | lib/tool_shed/test/functional/test_1420_tool_dependency_environment_inheritance.py | lesperry/Metagenomics | a1d8b7d96b32ab83cebe513e889b6ef82f7c1dd6 | [
"CC-BY-3.0"
] | 2 | 2020-08-19T18:14:59.000Z | 2020-08-20T01:19:12.000Z | lib/tool_shed/test/functional/test_1420_tool_dependency_environment_inheritance.py | lesperry/Metagenomics | a1d8b7d96b32ab83cebe513e889b6ef82f7c1dd6 | [
"CC-BY-3.0"
] | null | null | null | import logging
from ..base.twilltestcase import common, ShedTwillTestCase
log = logging.getLogger(__name__)
category_name = 'Test 1420 Tool dependency environment variable inheritance'
category_description = 'Test script 1420 for interpolation of inherited environment variables.'
package_atlas_repository_name = 'pac... | 71.671875 | 181 | 0.687944 |
c4c6824182be0b6a0ecfc885ab492e8356593b8f | 29,781 | py | Python | tests/test_z_cmdline.py | anthrotype/tox-venv | 9c5b1efbec7c2ee38b691e7a5b3f94cf51d69eb6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_z_cmdline.py | anthrotype/tox-venv | 9c5b1efbec7c2ee38b691e7a5b3f94cf51d69eb6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_z_cmdline.py | anthrotype/tox-venv | 9c5b1efbec7c2ee38b691e7a5b3f94cf51d69eb6 | [
"BSD-3-Clause"
] | null | null | null | import os
import platform
import re
import subprocess
import sys
import py
import pytest
import tox
from tox._pytestplugin import ReportExpectMock
try:
import json
except ImportError:
import simplejson as json
pytest_plugins = "pytester"
from tox.session import Session # noqa #E402 module level import not... | 31.315457 | 99 | 0.59501 |
40114623f9609a5500bcac0b531121ecb8632b76 | 5,413 | py | Python | src/lxrt/entry.py | ashutoshbaghel/tgifqa-lxmert | 7969f478d20fbfbba1c0eaaf0b96891654bfcc26 | [
"MIT"
] | null | null | null | src/lxrt/entry.py | ashutoshbaghel/tgifqa-lxmert | 7969f478d20fbfbba1c0eaaf0b96891654bfcc26 | [
"MIT"
] | null | null | null | src/lxrt/entry.py | ashutoshbaghel/tgifqa-lxmert | 7969f478d20fbfbba1c0eaaf0b96891654bfcc26 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2019 project LXRT.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 34.259494 | 100 | 0.642897 |
e23f6d819023a97df87f3f55a10133be588600f0 | 391 | py | Python | cride/events/migrations/0004_event_img.py | albertoaldanar/betmatcherAPI | c0590025efd79f4e489f9c9433b17554ea6ba23f | [
"MIT"
] | null | null | null | cride/events/migrations/0004_event_img.py | albertoaldanar/betmatcherAPI | c0590025efd79f4e489f9c9433b17554ea6ba23f | [
"MIT"
] | 7 | 2020-06-05T20:53:27.000Z | 2022-03-11T23:47:12.000Z | cride/events/migrations/0004_event_img.py | albertoaldanar/betmatcherAPI | c0590025efd79f4e489f9c9433b17554ea6ba23f | [
"MIT"
] | null | null | null | # Generated by Django 2.0.9 on 2019-10-07 16:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0003_banner'),
]
operations = [
migrations.AddField(
model_name='event',
name='img',
field=mod... | 20.578947 | 74 | 0.588235 |
9d235015a16fbb013badad63bcac79b4bb7a2282 | 1,776 | py | Python | code/multipliers.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | 1 | 2020-11-13T18:02:12.000Z | 2020-11-13T18:02:12.000Z | code/multipliers.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | null | null | null | code/multipliers.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | null | null | null | from talon import Context, Module, actions, app, ui
# The primitive multiplier words in English below a hundred.
multiplier_words = {
0: "times zero",
1: "times one",
2: "times two",
3: "times three",
4: "times four",
5: "times five",
6: "times six",
7: "times seven",
8: "times eigh... | 26.909091 | 85 | 0.642455 |
c95997f23a1b3c4a24bb29b0e05ec431c103a841 | 17,643 | py | Python | official/cv/nima/src/resnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/nima/src/resnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/nima/src/resnet.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... | 39.558296 | 120 | 0.575469 |
a9456c16529093901bae688bb953d11a2dae3938 | 1,548 | py | Python | aiogram_keyboards/dialog/builtin/builtin_converts.py | TheArcherST/aiogram_keyboards | 2a6a6e76e825b53020de985b237f56fcc1f9a8b0 | [
"MIT"
] | 1 | 2021-10-30T23:38:38.000Z | 2021-10-30T23:38:38.000Z | aiogram_keyboards/dialog/builtin/builtin_converts.py | TheArcherST/aiogram_keyboards | 2a6a6e76e825b53020de985b237f56fcc1f9a8b0 | [
"MIT"
] | 7 | 2021-10-30T23:34:22.000Z | 2022-01-21T21:31:20.000Z | aiogram_keyboards/dialog/builtin/builtin_converts.py | TheArcherST/aiogram_keyboards | 2a6a6e76e825b53020de985b237f56fcc1f9a8b0 | [
"MIT"
] | 2 | 2021-11-05T08:08:09.000Z | 2021-11-10T12:17:45.000Z | """Built-in converters
- Text
- PhotoID
- DocumentID
- Integer
- Float
"""
from aiogram.types import CallbackQuery, Message
from ..cast import CastMessage, CastTelegramObj, T, TO
class PhotoID(CastMessage[str]):
def _cast(self, obj: Message) -> T:
photo = obj.photo[0]
return photo.file_id
... | 22.434783 | 81 | 0.577519 |
f6e82b8eb584d06c809e2d842ca950c38feb1ad2 | 1,974 | py | Python | src/preprocessing/transform.py | css459/restaurant-closure-prediction | e93dcc6083a765a2d85f18f944ebaa2e96c7b831 | [
"Apache-2.0"
] | null | null | null | src/preprocessing/transform.py | css459/restaurant-closure-prediction | e93dcc6083a765a2d85f18f944ebaa2e96c7b831 | [
"Apache-2.0"
] | null | null | null | src/preprocessing/transform.py | css459/restaurant-closure-prediction | e93dcc6083a765a2d85f18f944ebaa2e96c7b831 | [
"Apache-2.0"
] | null | null | null | #
# Cole Smith
# Restaurant Closure Engine
# BDS - Undergraduate
# transform.py
#
# Utility functions for train / test splitting, re-balancing,
# and other numerical preparations for data matrices
#
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler,... | 23.223529 | 93 | 0.649443 |
3f7f1c74288a64ae5014c4234100e6151f56b5ea | 165 | py | Python | String.py | Hassan0072/CP_HS99 | 365ecd119e19fcf2c69ccaef42b278a1a9256741 | [
"MIT"
] | null | null | null | String.py | Hassan0072/CP_HS99 | 365ecd119e19fcf2c69ccaef42b278a1a9256741 | [
"MIT"
] | 3 | 2019-05-05T16:30:58.000Z | 2019-05-11T00:23:02.000Z | String.py | Hassan0072/CP_HS99 | 365ecd119e19fcf2c69ccaef42b278a1a9256741 | [
"MIT"
] | 1 | 2019-04-21T18:46:01.000Z | 2019-04-21T18:46:01.000Z | a=input("enter string :")
revstring=""
for i in a:
revstring=i+revstring
if revstring==a:
print("string is palindrome")
else:
print("string is not palindrome") | 20.625 | 35 | 0.709091 |
7f4b89efceaec0491a47e2e63074fbacd50dd723 | 2,374 | py | Python | src/litegraph/graph.py | RemyLau/litegraph | eff1b8204ad1f9e1b7b6c1b9dced09c072333264 | [
"MIT"
] | null | null | null | src/litegraph/graph.py | RemyLau/litegraph | eff1b8204ad1f9e1b7b6c1b9dced09c072333264 | [
"MIT"
] | null | null | null | src/litegraph/graph.py | RemyLau/litegraph | eff1b8204ad1f9e1b7b6c1b9dced09c072333264 | [
"MIT"
] | null | null | null | class Graph:
"""A light weight (undirected and weighted) graph object."""
def __init__(self):
self.data = []
self.ids = []
self.idmap = {}
self._number_of_nodes = 0
self._number_of_edges = 0
@property
def nodes(self):
return self.ids.copy()
@propert... | 28.261905 | 74 | 0.560657 |
12e135376f5b8bc297cfa66e44b749f8f2f639b9 | 741 | py | Python | ipython_save.py | franceme/Scripts | 9d0ffb6a5cc504b011d58f73ae7b5cc5c9602f7d | [
"Apache-2.0"
] | null | null | null | ipython_save.py | franceme/Scripts | 9d0ffb6a5cc504b011d58f73ae7b5cc5c9602f7d | [
"Apache-2.0"
] | null | null | null | ipython_save.py | franceme/Scripts | 9d0ffb6a5cc504b011d58f73ae7b5cc5c9602f7d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import os,sys,shelve
def shelf_out(shelf_name):
with shelve.open(shelf_name, 'n') as shelf:
for key in dir():
try:
shelf[key] = globals()[key]
except TypeError:
print(f"Could not shelf {key} due to type error")
except ... | 27.444444 | 93 | 0.565452 |
27cfd7338d5e0c5f8dda2379f0863bc37faaadc7 | 1,844 | py | Python | archive/Changesets/mbf-76446/Source/Tools/Python/BioIronPython/Util.py | jdm7dv/Microsoft-Biology-Foundation | 4873300d957cb46694392c480301b319b55f58b8 | [
"Apache-2.0"
] | null | null | null | archive/Changesets/mbf-76446/Source/Tools/Python/BioIronPython/Util.py | jdm7dv/Microsoft-Biology-Foundation | 4873300d957cb46694392c480301b319b55f58b8 | [
"Apache-2.0"
] | null | null | null | archive/Changesets/mbf-76446/Source/Tools/Python/BioIronPython/Util.py | jdm7dv/Microsoft-Biology-Foundation | 4873300d957cb46694392c480301b319b55f58b8 | [
"Apache-2.0"
] | null | null | null | # Copyright Microsoft Corporation. All rights reserved.
import clr
import os
import sys
import random
_cwd = os.getcwd()
_solution_path = _cwd[ : _cwd.rindex("\\") + 1]
def add_biodotnet_reference(dll_name):
"Adds a Bio dll reference to the clr so that its contents can be imported."
# An exception will be thr... | 36.156863 | 99 | 0.685466 |
dcf2215860fd3d56b90efe6cad4dc31f8bf87c62 | 1,051 | py | Python | Task1D.py | RichardJZhang2000/CUED-IA-Lent-Computing | ac048257230f57d90c0b12d13990d7ec985c48eb | [
"MIT"
] | null | null | null | Task1D.py | RichardJZhang2000/CUED-IA-Lent-Computing | ac048257230f57d90c0b12d13990d7ec985c48eb | [
"MIT"
] | null | null | null | Task1D.py | RichardJZhang2000/CUED-IA-Lent-Computing | ac048257230f57d90c0b12d13990d7ec985c48eb | [
"MIT"
] | null | null | null | from floodsystem.geo import rivers_with_station
from floodsystem.geo import stations_by_river
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task 1D"""
#build list of stations
stations_list = build_station_list()
rivers = rivers_with_station(stations_list)
... | 37.535714 | 87 | 0.717412 |
d15217759ad2fb207091d404257d09b97756c63d | 738 | py | Python | ndb_utils/exceptions.py | Othernet-Project/ndb-utils | 7804a5e305a4ed280742e22dad1dd10756cbe695 | [
"MIT"
] | 1 | 2018-12-30T18:49:02.000Z | 2018-12-30T18:49:02.000Z | ndb_utils/exceptions.py | Othernet-Project/ndb-utils | 7804a5e305a4ed280742e22dad1dd10756cbe695 | [
"MIT"
] | null | null | null | ndb_utils/exceptions.py | Othernet-Project/ndb-utils | 7804a5e305a4ed280742e22dad1dd10756cbe695 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, print_function
__all__ = ['ModelError', 'BadKeyValueError', 'DuplicateEntityError',
'ValidationError']
class ModelError(Exception):
""" Generic exception for utils module """
pass
class BadKeyValueError(ModelError):
""" Raised when value used for a ke... | 25.448276 | 79 | 0.704607 |
d9b5690d0923006a89a99562d850273dad56052f | 747 | py | Python | tests/migrations/0008_customerregistration.py | Formulka/django-GDPR | 84d427d0856f31f4bff7305298b3292c71e62fec | [
"MIT"
] | 55 | 2018-05-24T18:33:43.000Z | 2022-03-08T13:42:49.000Z | tests/migrations/0008_customerregistration.py | Formulka/django-GDPR | 84d427d0856f31f4bff7305298b3292c71e62fec | [
"MIT"
] | 14 | 2018-04-17T19:42:23.000Z | 2022-02-10T10:21:08.000Z | tests/migrations/0008_customerregistration.py | Formulka/django-GDPR | 84d427d0856f31f4bff7305298b3292c71e62fec | [
"MIT"
] | 12 | 2018-04-16T11:41:39.000Z | 2021-11-09T12:35:38.000Z | # Generated by Django 3.1 on 2021-04-16 11:47
from django.db import migrations, models
import gdpr.mixins
class Migration(migrations.Migration):
dependencies = [
('tests', '0007_childe_extraparentd_parentb_parentc_topparenta'),
]
operations = [
migrations.CreateModel(
name='... | 28.730769 | 114 | 0.601071 |
a254ca15cb6271de6f97e6d971d48275a8c8b2d9 | 329 | py | Python | rest_search/middleware.py | jlaine/django-rest-search | 5a5fad6204cc0b8e64b3c42c6cb172ecc80379c0 | [
"BSD-2-Clause"
] | 7 | 2016-12-06T10:09:18.000Z | 2021-09-02T01:43:18.000Z | rest_search/middleware.py | jlaine/django-rest-search | 5a5fad6204cc0b8e64b3c42c6cb172ecc80379c0 | [
"BSD-2-Clause"
] | 5 | 2020-10-05T08:26:18.000Z | 2021-12-14T14:24:33.000Z | rest_search/middleware.py | jlaine/django-rest-search | 5a5fad6204cc0b8e64b3c42c6cb172ecc80379c0 | [
"BSD-2-Clause"
] | 3 | 2017-05-02T13:51:26.000Z | 2021-09-01T15:03:56.000Z | # -*- coding: utf-8 -*-
from django.utils.deprecation import MiddlewareMixin
from rest_search import queue_flush
class FlushUpdatesMiddleware(MiddlewareMixin):
"""
Middleware that flushes ElasticSearch updates.
"""
def process_response(self, request, response):
queue_flush()
return ... | 20.5625 | 52 | 0.714286 |
214bafdc8a1e90516b5922ce3f53d01147f3df8f | 51,417 | py | Python | sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 48.053271 | 215 | 0.662835 |
37c015d0b3d069db8eedc86454693efb88453378 | 549 | py | Python | Problemset/two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.py | Yuziquan/LeetCode | 303fc1c8af847f783c4020bd731b28b72ed92a35 | [
"MIT"
] | 1 | 2020-12-22T12:39:21.000Z | 2020-12-22T12:39:21.000Z | Problemset/two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.py | Yuziquan/LeetCode | 303fc1c8af847f783c4020bd731b28b72ed92a35 | [
"MIT"
] | null | null | null | Problemset/two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.py | Yuziquan/LeetCode | 303fc1c8af847f783c4020bd731b28b72ed92a35 | [
"MIT"
] | null | null | null |
# @Title: 两数之和 II - 输入有序数组 (Two Sum II - Input array is sorted)
# @Author: KivenC
# @Date: 2018-07-14 15:01:31
# @Runtime: 28 ms
# @Memory: N/A
class Solution(object):
def twoSum(self, numbers, target):
"""
:type numbers: List[int]
:type target: int
:rtype: List[int]
"""
... | 24.954545 | 63 | 0.513661 |
635e1302196fedad154a957c2e0de041045d7954 | 623 | py | Python | scripts/ensemble.py | koukyo1994/kaggle_toxic_comment | 4be3a38f5b0a300de1a5e50c23eab49c666ad3da | [
"Apache-2.0"
] | null | null | null | scripts/ensemble.py | koukyo1994/kaggle_toxic_comment | 4be3a38f5b0a300de1a5e50c23eab49c666ad3da | [
"Apache-2.0"
] | null | null | null | scripts/ensemble.py | koukyo1994/kaggle_toxic_comment | 4be3a38f5b0a300de1a5e50c23eab49c666ad3da | [
"Apache-2.0"
] | null | null | null | import pandas as pd
lgbm = pd.read_csv("../submission/LGBM.csv")
ridge = pd.read_csv("../submission/Ridge.csv")
fmftrl = pd.read_csv("../submission/FMFTRL.csv")
columns = ['toxic', 'severe_toxic', 'obscene', 'threat', 'insult', 'identity_hate']
lgbm_val = lgbm.loc[:, columns].values
ridge_val = ridge.loc[:, columns].... | 31.15 | 83 | 0.704655 |
059f03bfec97c585f6b075a31bf13bfd7ce95af0 | 569 | py | Python | article/migrations/0012_auto_20170808_0911.py | glon/django_test | 4f9d9b93886ca5f861edfcd29b06df1bcedce1ad | [
"Apache-2.0"
] | null | null | null | article/migrations/0012_auto_20170808_0911.py | glon/django_test | 4f9d9b93886ca5f861edfcd29b06df1bcedce1ad | [
"Apache-2.0"
] | null | null | null | article/migrations/0012_auto_20170808_0911.py | glon/django_test | 4f9d9b93886ca5f861edfcd29b06df1bcedce1ad | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-08-08 09:11
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('article', '0011_auto_20170808_0908'),
... | 24.73913 | 108 | 0.650264 |
3b03e98e9c623336a38353686a4ee0524fa64207 | 2,124 | py | Python | histo/HistokatController/scripts/histokat/backend/types.py | muxiao1217/DeformableRegistration.jl | e3b2c7a7d5b15b8b34302ee62a4727fe5a63176f | [
"BSD-3-Clause"
] | 4 | 2017-10-11T15:07:22.000Z | 2019-11-15T06:26:07.000Z | histo/HistokatController/scripts/histokat/backend/types.py | muxiao1217/DeformableRegistration.jl | e3b2c7a7d5b15b8b34302ee62a4727fe5a63176f | [
"BSD-3-Clause"
] | 6 | 2017-10-06T20:06:58.000Z | 2017-10-06T20:07:00.000Z | histo/HistokatController/scripts/histokat/backend/types.py | muxiao1217/DeformableRegistration.jl | e3b2c7a7d5b15b8b34302ee62a4727fe5a63176f | [
"BSD-3-Clause"
] | 2 | 2017-10-06T19:54:33.000Z | 2019-07-29T07:57:57.000Z | import ctypes
class RETURN_CODE:
C_OK = 0
C_CONTROLLER_NOT_INITIALIZED = 1
C_NONEXISTING_ID = 2
C_CANNOT_CREATE_SESSION = 3
C_ERROR = 4
class c_image_info(ctypes.Structure):
_fields_ = \
[
('image_id', ctypes.c_char_p),
('image_url', ctypes.c_char_p)
]... | 20.823529 | 61 | 0.530603 |
9cf18fda4c6629c8a7c75ac7b738466dbfe0e39f | 22,605 | py | Python | teaser/logic/buildingobjects/thermalzone.py | Ja98/TEASER | 1bb782a01ce1b38c4abecb9c6ecc4d59f1ba21a3 | [
"MIT"
] | 1 | 2018-10-22T07:21:15.000Z | 2018-10-22T07:21:15.000Z | teaser/logic/buildingobjects/thermalzone.py | Ja98/TEASER | 1bb782a01ce1b38c4abecb9c6ecc4d59f1ba21a3 | [
"MIT"
] | null | null | null | teaser/logic/buildingobjects/thermalzone.py | Ja98/TEASER | 1bb782a01ce1b38c4abecb9c6ecc4d59f1ba21a3 | [
"MIT"
] | null | null | null | # created June 2015
# by TEASER4 Development Team
"""This module includes the ThermalZone class
"""
from __future__ import division
import random
import re
import warnings
from teaser.logic.buildingobjects.calculation.one_element import OneElement
from teaser.logic.buildingobjects.calculation.two_element import TwoEle... | 32.200855 | 79 | 0.584959 |
8c20fdb1743b337d37275b1677881af08cec3823 | 1,147 | py | Python | testng1.py | fenglwh/Spider | 3499dd801928932a0008684ef623f1ac0bcccd74 | [
"MIT"
] | null | null | null | testng1.py | fenglwh/Spider | 3499dd801928932a0008684ef623f1ac0bcccd74 | [
"MIT"
] | null | null | null | testng1.py | fenglwh/Spider | 3499dd801928932a0008684ef623f1ac0bcccd74 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding:utf-8
__Author__ = 'Adair.l'
import requests
import bs4
import http.cookiejar as cookiejar
headers = {
'Host': 'manhua1032-101-69-161-98.cdndm5.com',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0',
... | 26.068182 | 159 | 0.629468 |
d035a7f7002e1cc03f14b793caf566d9f5f23ad7 | 337 | py | Python | cpovc_offline_mode/urls.py | Rebeccacheptoek/cpims-ovc-3.0 | 25d34dca2f93fcdb6fc934093b625604b46ddd8d | [
"Apache-2.0"
] | 3 | 2022-02-18T13:25:29.000Z | 2022-02-25T11:49:11.000Z | cpovc_offline_mode/urls.py | Rebeccacheptoek/cpims-ovc-3.0 | 25d34dca2f93fcdb6fc934093b625604b46ddd8d | [
"Apache-2.0"
] | null | null | null | cpovc_offline_mode/urls.py | Rebeccacheptoek/cpims-ovc-3.0 | 25d34dca2f93fcdb6fc934093b625604b46ddd8d | [
"Apache-2.0"
] | 22 | 2022-02-05T13:43:53.000Z | 2022-02-26T14:29:06.000Z | from django.conf.urls import patterns, url
urlpatterns = patterns(
'cpovc_offline_mode.views',
url(r'^templates/$', 'templates', name='templates'),
url(r'^data/$', 'fetch_data', name='fetch_data'),
url(r'^services/$', 'fetch_services', name='fetch_services'),
url(r'^submit/$', 'submit_form', name='... | 33.7 | 65 | 0.664688 |
5545b71022c0e8ea67bfeab58ff7fb581a40bb5a | 1,717 | py | Python | var/spack/repos/builtin/packages/libcanberra/package.py | ilagunap/spack | 510f869c3ae8ac2721debd29e98076212ee75852 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-03-09T14:32:26.000Z | 2020-03-09T14:32:26.000Z | var/spack/repos/builtin/packages/libcanberra/package.py | ilagunap/spack | 510f869c3ae8ac2721debd29e98076212ee75852 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 5 | 2021-07-26T12:12:00.000Z | 2022-03-01T12:16:03.000Z | var/spack/repos/builtin/packages/libcanberra/package.py | ilagunap/spack | 510f869c3ae8ac2721debd29e98076212ee75852 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libcanberra(AutotoolsPackage):
"""libcanberra is an implementation of the XDG Sound Theme ... | 34.34 | 94 | 0.65463 |
7e77c11b0ef714bffe00bb6d08adc03def5988ac | 189,740 | py | Python | numba/np/arrayobj.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-08-10T05:33:29.000Z | 2021-08-10T05:33:29.000Z | numba/np/arrayobj.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | numba/np/arrayobj.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-01-31T18:58:54.000Z | 2021-01-31T18:58:54.000Z | """
Implementation of operations on Array objects and objects supporting
the buffer protocol.
"""
import functools
import math
import operator
from llvmlite import ir
import llvmlite.llvmpy.core as lc
from llvmlite.llvmpy.core import Constant
import numpy as np
from numba import pndindex, literal_unroll
from numba... | 36.216835 | 148 | 0.605866 |
f46a32f8e0bf72fdd6880d73f17a956943fd3ac7 | 1,499 | py | Python | networking_bagpipe/bagpipe_bgp/engine/ipvpn.py | oferby/networking-bagpipe | 4c42971872065192b4da33c050ccfa86deb5ea77 | [
"Apache-2.0"
] | null | null | null | networking_bagpipe/bagpipe_bgp/engine/ipvpn.py | oferby/networking-bagpipe | 4c42971872065192b4da33c050ccfa86deb5ea77 | [
"Apache-2.0"
] | null | null | null | networking_bagpipe/bagpipe_bgp/engine/ipvpn.py | oferby/networking-bagpipe | 4c42971872065192b4da33c050ccfa86deb5ea77 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... | 34.068182 | 75 | 0.723816 |
4f75b6cd4b86d199b994c3f2a040a21b969a8a3a | 2,834 | py | Python | tests/test_testbase/test_serialization.py | molayxu/QTAF | a036a22b7baa10214baa60954154bb865c98e44f | [
"BSD-3-Clause"
] | 452 | 2016-09-27T11:21:00.000Z | 2022-03-31T06:11:30.000Z | tests/test_testbase/test_serialization.py | molayxu/QTAF | a036a22b7baa10214baa60954154bb865c98e44f | [
"BSD-3-Clause"
] | 39 | 2016-09-29T06:14:04.000Z | 2022-03-22T04:24:36.000Z | tests/test_testbase/test_serialization.py | molayxu/QTAF | a036a22b7baa10214baa60954154bb865c98e44f | [
"BSD-3-Clause"
] | 129 | 2016-09-27T11:28:42.000Z | 2022-03-17T09:05:16.000Z | # -*- coding: utf-8 -*-
"""test serialization
"""
import unittest
from testbase.testcase import TestCase, SeqTestSuite
from testbase import serialization, datadrive
drive_data = [0, {"data" : 1, "__attrs__" : {"owner" : "bar",
"timeout" : 5,
... | 41.676471 | 87 | 0.636909 |
8f9b2c3312d654109b6084102ee8a3f48a85f867 | 3,871 | py | Python | test/functional/rpc_invalid_address_message.py | pmconrad/bitcoin | 19815b096c6a2b2e0bcb802e9e5842e67952993e | [
"MIT"
] | 5 | 2020-08-25T13:49:02.000Z | 2020-10-08T10:25:39.000Z | test/functional/rpc_invalid_address_message.py | digim3ta/bitcoin | fe03f7a37fd0ef05149161f6b95a25493e1fe38f | [
"MIT"
] | null | null | null | test/functional/rpc_invalid_address_message.py | digim3ta/bitcoin | fe03f7a37fd0ef05149161f6b95a25493e1fe38f | [
"MIT"
] | 3 | 2020-09-01T16:17:50.000Z | 2020-10-08T10:25:43.000Z | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test error messages for 'getaddressinfo' and 'validateaddress' RPC commands."""
from test_framework.te... | 39.10101 | 124 | 0.740119 |
0a3e7f5b219b9e2c29b201ee7f33dcf359829c0d | 5,014 | py | Python | tests/test_core.py | paulosalem/time-blender | 9f902af8068e3db7c7f8a073efc52d5a395e21a1 | [
"MIT"
] | 4 | 2019-02-03T13:46:46.000Z | 2021-04-18T22:04:29.000Z | tests/test_core.py | paulosalem/time-blender | 9f902af8068e3db7c7f8a073efc52d5a395e21a1 | [
"MIT"
] | 1 | 2020-08-16T23:52:01.000Z | 2020-08-16T23:52:01.000Z | tests/test_core.py | paulosalem/time-blender | 9f902af8068e3db7c7f8a073efc52d5a395e21a1 | [
"MIT"
] | null | null | null | import copy
import numpy as np
from tests.common import AbstractTest
from time_blender.coordination_events import Piecewise, Replicated, PastEvent
from time_blender.core import Generator, ConstantEvent, LambdaEvent
from time_blender.deterministic_events import WalkEvent
from time_blender.models import BankingModels, ... | 42.134454 | 111 | 0.571799 |
05191626d5e04f239f2dd55fcca267c6efac5461 | 4,123 | py | Python | tensorforce/core/optimizers/optimizer.py | vbelus/tensorforce | 85504f49f33b4114cdbb19d73cc196539a702a2c | [
"Apache-2.0"
] | 1 | 2019-10-18T17:36:28.000Z | 2019-10-18T17:36:28.000Z | tensorforce/core/optimizers/optimizer.py | vbelus/tensorforce | 85504f49f33b4114cdbb19d73cc196539a702a2c | [
"Apache-2.0"
] | null | null | null | tensorforce/core/optimizers/optimizer.py | vbelus/tensorforce | 85504f49f33b4114cdbb19d73cc196539a702a2c | [
"Apache-2.0"
] | 1 | 2020-07-13T03:00:34.000Z | 2020-07-13T03:00:34.000Z | # Copyright 2018 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 41.23 | 101 | 0.62115 |
abb2466001716bd862791946936f478b4e0f91ce | 787 | py | Python | tests/test_measuring_from_threads.py | tqsd/EQSN_python | 823a315b1c2f5658cded19d8c97e579ce7285c42 | [
"MIT"
] | 3 | 2020-05-03T15:09:41.000Z | 2021-12-17T11:26:34.000Z | tests/test_measuring_from_threads.py | tqsd/EQSN_python | 823a315b1c2f5658cded19d8c97e579ce7285c42 | [
"MIT"
] | 5 | 2020-03-13T10:03:39.000Z | 2020-07-09T12:56:04.000Z | tests/test_measuring_from_threads.py | tqsd/EQSN_python | 823a315b1c2f5658cded19d8c97e579ce7285c42 | [
"MIT"
] | 1 | 2020-05-03T15:06:24.000Z | 2020-05-03T15:06:24.000Z | import threading
import random
import time
from eqsn import EQSN
def test_measure_from_threads():
q_sim = EQSN()
def measure_or_hadamard(_id):
n = random.randrange(10, 20, 1)
for _ in range(n):
time.sleep(0.1)
q_sim.H_gate(_id)
nr_threads = 10
ids = [str(x) f... | 19.195122 | 69 | 0.584498 |
629e6e8c5ac86ec291072f229c9ae5a4ade46716 | 2,731 | py | Python | Server/Python/src/dbs/components/migration/StartUp.py | vkuznet/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 8 | 2015-08-14T04:01:32.000Z | 2021-06-03T00:56:42.000Z | Server/Python/src/dbs/components/migration/StartUp.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 162 | 2015-01-07T21:34:47.000Z | 2021-10-13T09:42:41.000Z | Server/Python/src/dbs/components/migration/StartUp.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 16 | 2015-01-22T15:27:29.000Z | 2021-04-28T09:23:28.000Z | #!/usr/bin/env python
from optparse import OptionParser
import cherrypy, logging, sys
from WMCore.Configuration import Configuration, loadConfigurationFile
from dbs.components.migration.DBSMigrationServer import DBSMigrationServer, MigrationTask, MigrationWebMonitoring
def get_command_line_options(executable_name, ar... | 43.349206 | 116 | 0.656536 |
f69fbfe83a9ede9376849ca8c7ce1ab8a2948695 | 154 | py | Python | python/gdal_cookbook/cookbook_geometry/create_geometry_from_wkt.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_geometry_from_wkt.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_geometry_from_wkt.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from osgeo import ogr
wkt = "POINT (1120351.5712494177 741921.4223245403)"
point = ogr.CreateGeometryFromWkt(wkt)
print(f'{point.GetX()},{point.GetY()}') | 30.8 | 52 | 0.746753 |
b963768ae6b5d7ae5dad85cd12a592f418e50cee | 5,318 | py | Python | lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py | jimingham/llvm-project | 598fd4f8d7ed21b6c4473aec85265f49512d25bd | [
"Apache-2.0"
] | 1 | 2022-03-28T05:58:03.000Z | 2022-03-28T05:58:03.000Z | lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py | DougGregor/llvm-project | 97602a8bd045f087e02348b64ffbdd143a33e10b | [
"Apache-2.0"
] | 2 | 2022-02-19T07:12:22.000Z | 2022-02-27T11:21:53.000Z | llvm-project/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py | ananthdurbha/llvm-mlir | a5e0b8903b83c777fa40a0fa538fbdb8176fd5ac | [
"MIT"
] | null | null | null | """
Use lldb Python SBtarget.WatchAddress() API to create a watchpoint for write of '*g_char_ptr'.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TargetWatchAddressAPITestCase(TestBase):
... | 36.675862 | 94 | 0.617525 |
5f84f995804b7238c743a99e555a1d80255f0f20 | 601 | py | Python | libros/forms.py | dkwelffer/rocbook | 87c92f26e8bd2139cc57d11f65c3fb82ebbc5223 | [
"Apache-2.0"
] | null | null | null | libros/forms.py | dkwelffer/rocbook | 87c92f26e8bd2139cc57d11f65c3fb82ebbc5223 | [
"Apache-2.0"
] | null | null | null | libros/forms.py | dkwelffer/rocbook | 87c92f26e8bd2139cc57d11f65c3fb82ebbc5223 | [
"Apache-2.0"
] | null | null | null |
from django import forms
class ActualizarLibroForm(forms.Form):
isbn_libro = forms.CharField(label="ISBN del libro", required=True)
titulo_libro = forms.CharField(label="Nombre del libro", required=True)
autor_libro = forms.CharField(label="Autor del libro", required=True)
anio_libro = forms.CharFiel... | 31.631579 | 75 | 0.748752 |
5f26eb01ce0b44c64b107b0f93484bb779011ded | 43 | py | Python | tests/components/tile/__init__.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/tile/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/tile/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Define tests for the Tile component."""
| 21.5 | 42 | 0.697674 |
eb5e67387944de7f45754d52182d8c5ad5f3b966 | 2,471 | py | Python | switcheo/test_switcheo_utils.py | Devel484/switcheo-python | 5b3b77fc31328dc5b23fa83a5e71b9a26723559a | [
"MIT"
] | null | null | null | switcheo/test_switcheo_utils.py | Devel484/switcheo-python | 5b3b77fc31328dc5b23fa83a5e71b9a26723559a | [
"MIT"
] | null | null | null | switcheo/test_switcheo_utils.py | Devel484/switcheo-python | 5b3b77fc31328dc5b23fa83a5e71b9a26723559a | [
"MIT"
] | null | null | null | import unittest
from switcheo.utils import get_epoch_milliseconds, num2hexstring, num2varint, reverse_hex,\
stringify_message, Request
r = Request(api_url='https://jsonplaceholder.typicode.com/', api_version='')
s = Request()
class TestSwitcheoUtils(unittest.TestCase):
def test_get_epoch_milliseconds(self)... | 39.854839 | 184 | 0.649535 |
0c508de0e4a998bd5ff71ad6935bd21d78608c6f | 5,888 | py | Python | rab_distributed_system.py | senjianlu/rab_python_packages | 9116ecff2e29889a327f0e1063760edd456f8008 | [
"MIT"
] | 35 | 2021-03-08T06:49:55.000Z | 2022-03-06T00:16:39.000Z | rab_distributed_system.py | senjianlu/rab_python_packages | 9116ecff2e29889a327f0e1063760edd456f8008 | [
"MIT"
] | null | null | null | rab_distributed_system.py | senjianlu/rab_python_packages | 9116ecff2e29889a327f0e1063760edd456f8008 | [
"MIT"
] | 8 | 2021-03-08T07:31:11.000Z | 2021-09-25T09:19:38.000Z | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
#
# @AUTHOR: Rabbir
# @FILE: /root/GitHub/rab_python_packages/rab_distributed_node.py
# @DATE: 2021/07/25 Sun
# @TIME: 14:54:27
#
# @DESCRIPTION: 分布式系统管理模块
import sys
from datetime import datetime, timezone, timedelta
sys.path.append("..") if (".." not in sys.path) else Tr... | 24.330579 | 78 | 0.53142 |
b3915a0c9cc5e714ac12201e338bb4869209ccc3 | 929 | py | Python | grammar/scan.py | esevre/silvius | 4952f76e0cbbe7f9454264a31ceea9b9706bdf35 | [
"BSD-2-Clause"
] | null | null | null | grammar/scan.py | esevre/silvius | 4952f76e0cbbe7f9454264a31ceea9b9706bdf35 | [
"BSD-2-Clause"
] | null | null | null | grammar/scan.py | esevre/silvius | 4952f76e0cbbe7f9454264a31ceea9b9706bdf35 | [
"BSD-2-Clause"
] | null | null | null | # Lexer that produces a sequence of tokens (keywords + ANY).
import re
from lm import get_terminals
def find_keywords(parser):
global keywords
keywords = get_terminals(parser)
global noise
noise = set([x.lower() for x in ['[BREATH]', '[COUGH]', '[NOISE]', \
'[SMACK]', '[UH]', '[UM]', '<unk>']]... | 24.447368 | 72 | 0.564047 |
3147cdf72d2484c335b4ba65844019e490ee7008 | 61 | py | Python | demo01.py | kjhflakf/geng | d609992d03cee119798b5f9fba586debe3fbb7f6 | [
"MIT"
] | null | null | null | demo01.py | kjhflakf/geng | d609992d03cee119798b5f9fba586debe3fbb7f6 | [
"MIT"
] | null | null | null | demo01.py | kjhflakf/geng | d609992d03cee119798b5f9fba586debe3fbb7f6 | [
"MIT"
] | null | null | null | num1 = 10
num2 = 20
num3 = 123
num4 = 40
num5 = 50
num6 = 60
| 8.714286 | 10 | 0.606557 |
31799e3a29569d98d5970b7309ecfb35802b2189 | 1,420 | py | Python | setup.py | echan00/FARM | 2dab3362c749eaddccacfc71d3bcfee4753fd72a | [
"Apache-2.0"
] | 4 | 2020-07-22T02:22:52.000Z | 2021-12-27T22:26:37.000Z | setup.py | echan00/FARM | 2dab3362c749eaddccacfc71d3bcfee4753fd72a | [
"Apache-2.0"
] | null | null | null | setup.py | echan00/FARM | 2dab3362c749eaddccacfc71d3bcfee4753fd72a | [
"Apache-2.0"
] | 1 | 2021-04-07T19:30:02.000Z | 2021-04-07T19:30:02.000Z | from io import open
from setuptools import find_packages, setup
with open("requirements.txt") as f:
parsed_requirements = f.read().splitlines()
# remove blank lines and comments
parsed_requirements = [
x.strip()
for x in parsed_requirements
if ((x.strip()[0] != "#") and (len(x.strip()) > 3))
]
setup... | 37.368421 | 148 | 0.68169 |
8d0ac90eb3e900ece99c8045324523eec91c875d | 11,103 | py | Python | rnn_train.py | qaz734913414/Real-time-dynamic-perception-of-facial-expression | 603ea8c18ce6c6d2c011416002b63eeace888a7c | [
"MIT"
] | 10 | 2019-07-19T10:59:06.000Z | 2019-10-14T12:57:31.000Z | rnn_train.py | jerrynpc/Real-time-dynamic-perception-of-facial-expression | 603ea8c18ce6c6d2c011416002b63eeace888a7c | [
"MIT"
] | null | null | null | rnn_train.py | jerrynpc/Real-time-dynamic-perception-of-facial-expression | 603ea8c18ce6c6d2c011416002b63eeace888a7c | [
"MIT"
] | 3 | 2019-07-24T06:01:55.000Z | 2019-10-14T13:22:28.000Z |
#Written by jerrynpc
#写于2019-6月 雄盛科技
from __future__ import print_function
import tensorflow as tf
from time import time
import numpy as np
from LSTM.setting import batch_size, width, height, rnn_size, out_size, channel, learning_rate, num_epoch
#########################################
import os
os.environ["CUDA... | 37.894198 | 192 | 0.627578 |
c558cd161d971289c2d702f86b9a33b6c1e4b041 | 335 | py | Python | fire.py | v0lkan/learning-salt | 6b13b3a4c474b851568ecb77267c9860db909c2c | [
"MIT"
] | null | null | null | fire.py | v0lkan/learning-salt | 6b13b3a4c474b851568ecb77267c9860db909c2c | [
"MIT"
] | null | null | null | fire.py | v0lkan/learning-salt | 6b13b3a4c474b851568ecb77267c9860db909c2c | [
"MIT"
] | null | null | null | import salt.utils.event
sock_dir = '/var/run/salt/master'
payload = {'sample_msg': 'This is a test.'}
event = salt.utils.event.SaltEvent('master', sock_dir)
event.fire_event(payload, 'salt/mycustomtag')
# other file
import salt.client
caller = salt.client.Caller()
caller.function('event.send', 'salt/mycustomtag', ... | 23.928571 | 65 | 0.722388 |
1a57dc0e3424dc80e4f2a4e6702468079146dde7 | 96 | py | Python | venv/lib/python3.8/site-packages/poetry/core/pyproject/exceptions.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/poetry/core/pyproject/exceptions.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/poetry/core/pyproject/exceptions.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/9e/48/38/c6f60827bedacc0441f5955c7a40fcfa1ac3439b28fdaa1773deb1f24b | 96 | 96 | 0.895833 |
560b072990fa87de3f2708a5bab7b5cf13482f85 | 5,356 | py | Python | speech/api/speech_streaming.py | ettorerizza/python-docs-samples | 439ca4c552940284743f5f22a590cc4b6dae1bef | [
"Apache-2.0"
] | 1 | 2018-09-24T04:54:26.000Z | 2018-09-24T04:54:26.000Z | speech/api/speech_streaming.py | DalavanCloud/python-docs-samples | 439ca4c552940284743f5f22a590cc4b6dae1bef | [
"Apache-2.0"
] | null | null | null | speech/api/speech_streaming.py | DalavanCloud/python-docs-samples | 439ca4c552940284743f5f22a590cc4b6dae1bef | [
"Apache-2.0"
] | 1 | 2018-09-24T04:53:12.000Z | 2018-09-24T04:53:12.000Z | #!/usr/bin/python
# Copyright (C) 2016 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 or ... | 35.706667 | 79 | 0.702763 |
6d5b62bef5f761457d3f896675d1939de79057db | 670 | py | Python | 2021/Day 02/day02.py | nicoloverardo/aoc | 3645c6826880fa3c86686a84cf715796a785cc5b | [
"BSD-3-Clause"
] | null | null | null | 2021/Day 02/day02.py | nicoloverardo/aoc | 3645c6826880fa3c86686a84cf715796a785cc5b | [
"BSD-3-Clause"
] | null | null | null | 2021/Day 02/day02.py | nicoloverardo/aoc | 3645c6826880fa3c86686a84cf715796a785cc5b | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
df = pd.read_csv("2021/Day 02/input.txt", sep=" ", header=None, names=["move", "val"])
# Part 1
df.loc[df.move == "up", "val"] *= -1
df.move = df.move.replace({"down": "depth", "up": "depth"})
dfg = df.groupby("move").agg({"val": sum})
print(dfg.val["depth"] * dfg.val["forward"])
# Part 2
# Cumsu... | 35.263158 | 86 | 0.595522 |
f2963e564df868682ff9c509e0228d88dfc986d0 | 1,278 | py | Python | root/gzip_big_files.py | transitanalystisarel/TransitAnalystIsrael | 341de9272b352c18333ff136a00de0b97cd82216 | [
"MIT"
] | null | null | null | root/gzip_big_files.py | transitanalystisarel/TransitAnalystIsrael | 341de9272b352c18333ff136a00de0b97cd82216 | [
"MIT"
] | null | null | null | root/gzip_big_files.py | transitanalystisarel/TransitAnalystIsrael | 341de9272b352c18333ff136a00de0b97cd82216 | [
"MIT"
] | 3 | 2019-05-08T04:36:03.000Z | 2020-11-23T19:46:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# gzip big data files for upload to cloud
#
import transitanalystisrael_config as cfg
import shutil
import os
from pathlib import Path
cwd = Path.cwd()
print('********** gzip big data files for upload to cloud *************')
if cfg.get_service_date == 'auto' :
gzip_... | 33.631579 | 265 | 0.730829 |
7c2110c352ab6abad614b07d65b483c3de802f22 | 12,110 | py | Python | core/models.py | alexander-koval/bctip | 60b0eeaf4a62123af5c0f4d65aa184e23c9910db | [
"MIT"
] | null | null | null | core/models.py | alexander-koval/bctip | 60b0eeaf4a62123af5c0f4d65aa184e23c9910db | [
"MIT"
] | null | null | null | core/models.py | alexander-koval/bctip | 60b0eeaf4a62123af5c0f4d65aa184e23c9910db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from decimal import Decimal
from urllib.request import urlopen
import shortuuid
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext as _
from lnurl import Lnurl, LnurlWithdrawResponse, encod... | 32.207447 | 88 | 0.654996 |
08752675066900c89c1b1d699c0be3d652e4d8c5 | 2,542 | py | Python | Notebooks/dishonest_casino.py | willyrv/projet2MIC | f57a4c61a1a463fec37518c0e52686ec9645fdcf | [
"Unlicense"
] | 1 | 2020-06-19T13:04:10.000Z | 2020-06-19T13:04:10.000Z | Notebooks/dishonest_casino.py | willyrv/projet2MIC | f57a4c61a1a463fec37518c0e52686ec9645fdcf | [
"Unlicense"
] | null | null | null | Notebooks/dishonest_casino.py | willyrv/projet2MIC | f57a4c61a1a463fec37518c0e52686ec9645fdcf | [
"Unlicense"
] | null | null | null | """
python implementation of the dishonest casino example.
"""
import random
import bisect
import numpy as np
class Dice:
"""
A dice with arbitrary probability (not necessary a fair dice)
"""
def __init__(self, prob_vector):
"""
:type prob_vector: list
"""
if (min(prob... | 35.305556 | 76 | 0.586939 |
0f51fa3cc2d72dc188c779a7324b63b5fdc64f47 | 6,123 | py | Python | examples/VPC_With_VPN_Connection.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | 1 | 2021-04-03T22:24:36.000Z | 2021-04-03T22:24:36.000Z | examples/VPC_With_VPN_Connection.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | null | null | null | examples/VPC_With_VPN_Connection.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | 5 | 2020-05-10T13:50:32.000Z | 2021-09-09T09:06:54.000Z | # Converted from VPC_With_VPN_Connection.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import Join, Output
from troposphere import Parameter, Ref, Tags, Template
from troposphere.ec2 import PortRange
from troposphere.ec2 import NetworkAcl
from troposphere.ec... | 28.347222 | 78 | 0.690838 |
5f3519cb1c71aefd92f96513f258c411c1e1910e | 3,467 | py | Python | app/lib/core/dl/model/dler.py | nonomal/PixivBiu | 19f01736c06c3c2eca101c7e02417b4f81d5d33f | [
"MIT"
] | 1 | 2022-01-12T09:02:42.000Z | 2022-01-12T09:02:42.000Z | app/lib/core/dl/model/dler.py | nonomal/PixivBiu | 19f01736c06c3c2eca101c7e02417b4f81d5d33f | [
"MIT"
] | null | null | null | app/lib/core/dl/model/dler.py | nonomal/PixivBiu | 19f01736c06c3c2eca101c7e02417b4f81d5d33f | [
"MIT"
] | null | null | null | import re
import uuid
class Dler(object):
"""
biu-dl 下载模块接口类
"""
CODE_BAD = 0
CODE_BAD_FAILED = (0, 0)
CODE_BAD_CANCELLED = (0, 1)
CODE_GOOD = 1
CODE_GOOD_RUNNING = (1, 0)
CODE_GOOD_SUCCESS = (1, 1)
CODE_WAIT = 2
CODE_WAIT_PAUSE = (2, 0)
TEMP_dlArgs = {"_headers": {},... | 27.736 | 93 | 0.527834 |
0d98bd736a41241f68d3fe60de8e7310e1c5e691 | 7,035 | py | Python | examples/pwr_run/checkpointing/nonpc_short/v100_only/job1.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/v100_only/job1.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/v100_only/job1.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 31.266667 | 118 | 0.703767 |
53970803c5a0ec63644a15324e8e9af25dc96a9c | 6,632 | py | Python | src/sst/elements/ariel/frontend/simple/examples/stream/memHstream.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 2 | 2019-06-10T15:32:03.000Z | 2019-06-11T14:17:32.000Z | src/sst/elements/ariel/frontend/simple/examples/stream/memHstream.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 39 | 2016-01-06T15:08:15.000Z | 2020-06-03T18:12:31.000Z | src/sst/elements/ariel/frontend/simple/examples/stream/memHstream.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 1 | 2021-01-08T15:56:19.000Z | 2021-01-08T15:56:19.000Z | """
Sample script
Simulating System
Every core with Private L1 and L2 caches.
All L2 cache are connected to shared L3 cache via bus.
L3 connects to MainMemory through memory Controller.
core_0 core_1 core_2 core_3 core_4 core_5 core_6 core_7
L1_0 L1_1 L1_2 L1_3 L1_4 L1_5 ... | 36.844444 | 158 | 0.546592 |
f205bc161630ce4dcdfe9023cbedfbbf3e6d1f69 | 32,802 | py | Python | django_actual/scaffold.py | sipmann/django-actual | f97fef8b4182ba2fdaa3c5b67cbffd7b38f3d52a | [
"MIT"
] | null | null | null | django_actual/scaffold.py | sipmann/django-actual | f97fef8b4182ba2fdaa3c5b67cbffd7b38f3d52a | [
"MIT"
] | null | null | null | django_actual/scaffold.py | sipmann/django-actual | f97fef8b4182ba2fdaa3c5b67cbffd7b38f3d52a | [
"MIT"
] | null | null | null | from __future__ import print_function, unicode_literals, with_statement, division
from os import path, system, listdir, sys, mkdir
from django.conf import settings
import shutil
# VIEW CONSTS
LIST_VIEW = """
def %(lower_model)s_list(request, template='%(lower_model)s/list.html'):
rows = %(model)s.objects.all()
... | 39.003567 | 190 | 0.537193 |
7b35640cc33e749326b0108e01c9308ac2c3ffda | 603 | py | Python | pRestore/stuff.py | snaiperskaya96/pRestore | cd51050fbd02423b038233c804e1c1ee0bfe59e7 | [
"MIT"
] | null | null | null | pRestore/stuff.py | snaiperskaya96/pRestore | cd51050fbd02423b038233c804e1c1ee0bfe59e7 | [
"MIT"
] | null | null | null | pRestore/stuff.py | snaiperskaya96/pRestore | cd51050fbd02423b038233c804e1c1ee0bfe59e7 | [
"MIT"
] | null | null | null | class Stuff:
def __init__(self):
return
@staticmethod
def print_logo():
print '''
____ _
_ __ | _ \ ___ ___| |_ ___ _ __ ___
| '_ \| |_) / _ \/ __| __/ _ \| '__/ _ \\
| |_) | _ < __/\__ \ || (_) | | | __/
| .__/|_| \_\___||___/\__\___/|_| \___|
|_|
'''
cla... | 19.451613 | 41 | 0.507463 |
cf3369496df34c08b7fc5667c3f13cb9692aea97 | 1,450 | py | Python | USBCameraStream.py | lilbowser/CamPS | 293a48160ac21a2ca04b291ce7c1e34ebcdec4a2 | [
"MIT"
] | null | null | null | USBCameraStream.py | lilbowser/CamPS | 293a48160ac21a2ca04b291ce7c1e34ebcdec4a2 | [
"MIT"
] | null | null | null | USBCameraStream.py | lilbowser/CamPS | 293a48160ac21a2ca04b291ce7c1e34ebcdec4a2 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015 Adrian Rosebrock, http://www.pyimagesearch.com
"""
# import the necessary packages
from threading import Thread
import cv2
class USBCameraStream:
def __init__(self, src=0):
# initialize the video camera stream and read the first frame
# from the stre... | 25.892857 | 71 | 0.604138 |
a0bd20c3eac4d7d05fde18567b2c2420a540f32a | 8,386 | py | Python | inventory.py | roman-geraskin/fssh | 80078b02524108994677f891ea7b26c951d49404 | [
"MIT"
] | null | null | null | inventory.py | roman-geraskin/fssh | 80078b02524108994677f891ea7b26c951d49404 | [
"MIT"
] | null | null | null | inventory.py | roman-geraskin/fssh | 80078b02524108994677f891ea7b26c951d49404 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import re
from ansible.inventory.manager import InventoryManager
from ansible.parsing.dataloader import DataLoader
def _get_ssh_params(inventory_file_name):
hosts = {}
data_loader = DataLoader()
inventory = InventoryManager(loader=data_loader,
... | 36.620087 | 79 | 0.576198 |
b857a0b57a36c9d584fa05bf88a80f1f5140af7e | 2,015 | py | Python | tests/test_helloheart_airflow_utils.py | Hello-Heart/helloheart-airflow-utils | 3c21b7e554b4994dfd86eebdc621685f3c09505c | [
"MIT"
] | null | null | null | tests/test_helloheart_airflow_utils.py | Hello-Heart/helloheart-airflow-utils | 3c21b7e554b4994dfd86eebdc621685f3c09505c | [
"MIT"
] | null | null | null | tests/test_helloheart_airflow_utils.py | Hello-Heart/helloheart-airflow-utils | 3c21b7e554b4994dfd86eebdc621685f3c09505c | [
"MIT"
] | null | null | null | """Tests for custom logging class"""
import importlib
from airflow.config_templates import airflow_local_settings
from helloheart_airflow_utils import __version__
from helloheart_airflow_utils.logging import log_config
def test_version():
"""Tests that the __version__ attribute is correct"""
assert __version... | 38.75 | 85 | 0.756328 |
9929939be3a45fb4e559459f76453bd7d0954f52 | 4,127 | py | Python | koans/about_set.py | VMStr8/learn_python_koans | b7b2453d559f520c7fcd3fe2ae5a87db0050fbbc | [
"MIT"
] | null | null | null | koans/about_set.py | VMStr8/learn_python_koans | b7b2453d559f520c7fcd3fe2ae5a87db0050fbbc | [
"MIT"
] | null | null | null | koans/about_set.py | VMStr8/learn_python_koans | b7b2453d559f520c7fcd3fe2ae5a87db0050fbbc | [
"MIT"
] | null | null | null | from koans_plugs import *
def test_create():
"""
Множество в python содержат не повторяющиеся элементы.
Создать множество можно через функцию set(), передав в неё любую последовательность,
или заключив последовательность в фиурные скобки {1, 2, 3}.
P.S пустое множество невозможно... | 30.57037 | 121 | 0.596802 |
917a60d92c3b84c1940d8b683142f325fa5baeba | 421 | py | Python | apps/security/migrations/0012_auto_20210202_1002.py | death-finger/get2unix | 1ff6f729f076040d6493251471cc0ee9cdcdc661 | [
"MIT"
] | null | null | null | apps/security/migrations/0012_auto_20210202_1002.py | death-finger/get2unix | 1ff6f729f076040d6493251471cc0ee9cdcdc661 | [
"MIT"
] | null | null | null | apps/security/migrations/0012_auto_20210202_1002.py | death-finger/get2unix | 1ff6f729f076040d6493251471cc0ee9cdcdc661 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2021-02-02 02:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('security', '0011_auto_20210202_0749'),
]
operations = [
migrations.AlterField(
model_name='collectortasks',
name='id... | 22.157895 | 75 | 0.617577 |
80f8ecc054729f5769f1865789e19964a05e28f0 | 1,876 | py | Python | scripts/plot_nr_of_boxes.py | mozewillo/ROCS | babc44e4486c69405764022c64b17c86f49b4a1a | [
"MIT"
] | null | null | null | scripts/plot_nr_of_boxes.py | mozewillo/ROCS | babc44e4486c69405764022c64b17c86f49b4a1a | [
"MIT"
] | null | null | null | scripts/plot_nr_of_boxes.py | mozewillo/ROCS | babc44e4486c69405764022c64b17c86f49b4a1a | [
"MIT"
] | 1 | 2022-01-28T12:33:59.000Z | 2022-01-28T12:33:59.000Z | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_style("whitegrid")
if __name__ == '__main__':
train_image = pd.read_csv('../data/train_image_level.csv')
train_study = pd.read_csv('../data/train_study_level.csv')
train_study['id'] = train_study['id'].str... | 46.9 | 93 | 0.651386 |
bb35619da078cb96e92a487d924c54278506444c | 483 | py | Python | test_squarespace.py | doprdele/squarespace-python | 140c1b389b91d390f0316e250a9e61454bc32ade | [
"MIT"
] | 7 | 2017-12-31T03:37:22.000Z | 2021-03-07T22:37:58.000Z | test_squarespace.py | doprdele/squarespace-python | 140c1b389b91d390f0316e250a9e61454bc32ade | [
"MIT"
] | 2 | 2019-01-18T19:01:59.000Z | 2020-04-02T16:22:20.000Z | test_squarespace.py | doprdele/squarespace-python | 140c1b389b91d390f0316e250a9e61454bc32ade | [
"MIT"
] | 7 | 2017-02-10T15:50:47.000Z | 2022-01-17T17:09:03.000Z | # coding=UTF-8
from squarespace import Squarespace
def test_squarespace():
store = Squarespace('test')
assert store.api_key == 'test'
assert store.useragent == 'Squarespace python API v0.0.3 by Zach White.'
def test_squarespace_useragent():
store = Squarespace('test')
store.useragent = 'Hello, W... | 28.411765 | 76 | 0.689441 |
079066400055a448bd87fa01cc3ba885eec39265 | 2,112 | py | Python | swot_simulator/error/karin.py | CNES/swot_simulator | 92d0bb4a274ec9923265567968beea3be4283e61 | [
"BSD-3-Clause"
] | 17 | 2020-05-28T08:20:11.000Z | 2022-03-25T07:40:48.000Z | swot_simulator/error/karin.py | CNES/swot_simulator | 92d0bb4a274ec9923265567968beea3be4283e61 | [
"BSD-3-Clause"
] | 7 | 2021-07-21T02:15:52.000Z | 2021-11-14T10:46:41.000Z | swot_simulator/error/karin.py | CNES/swot_simulator | 92d0bb4a274ec9923265567968beea3be4283e61 | [
"BSD-3-Clause"
] | 8 | 2020-05-17T13:53:43.000Z | 2022-03-25T07:40:58.000Z | # Copyright (c) 2021 CNES/JPL
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""
Karin noise
-----------
"""
from typing import Dict
import numpy as np
from .. import random_signal
from .. import settings
class Karin:
"""Karin instrume... | 33.52381 | 74 | 0.641572 |
2d71b90695b6407690c7fbe64655405b9731f366 | 2,033 | py | Python | epytope/Data/pssms/smmpmbec/mat/A_68_02_8.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smmpmbec/mat/A_68_02_8.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smmpmbec/mat/A_68_02_8.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | A_68_02_8 = {0: {'A': 0.256, 'C': 0.077, 'E': 0.093, 'D': 0.016, 'G': 0.176, 'F': 0.055, 'I': 0.076, 'H': -0.087, 'K': 0.066, 'M': -0.596, 'L': -0.088, 'N': -0.421, 'Q': -0.07, 'P': 0.341, 'S': 0.002, 'R': 0.184, 'T': 0.023, 'W': -0.04, 'V': 0.002, 'Y': -0.066}, 1: {'A': -0.003, 'C': 0.002, 'E': 0.003, 'D': 0.006, 'G':... | 2,033 | 2,033 | 0.397934 |
af934ae1f4e890bb305eae238bd717859c33c286 | 26,624 | py | Python | easytext/trainer/trainer.py | cjopengler/easytext | 5561b9a51e7b0aa5d10b7af451374359b559e9b6 | [
"MIT"
] | 17 | 2020-06-19T12:12:13.000Z | 2022-01-28T02:07:01.000Z | easytext/trainer/trainer.py | cjopengler/easytext | 5561b9a51e7b0aa5d10b7af451374359b559e9b6 | [
"MIT"
] | 24 | 2020-06-08T08:51:36.000Z | 2022-02-08T03:30:19.000Z | easytext/trainer/trainer.py | cjopengler/easytext | 5561b9a51e7b0aa5d10b7af451374359b559e9b6 | [
"MIT"
] | 7 | 2020-07-20T06:40:00.000Z | 2022-01-28T03:52:49.000Z | #!/usr/bin/env python 3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Baidu.com, Inc. All Rights Reserved
#
"""
训练器
Authors: panxu(panxu@baidu.com)
Date: 2020/05/16 00:34:00
"""
import os
import torch
import logging
from tqdm import tqdm
import shutil
from typing import Optional, Union, List
from torch.utils.d... | 37.445851 | 116 | 0.604943 |
863bb8a9ac87e9b4c9f70d79100501c399c993bb | 629 | py | Python | sphinxpapyrus/docxbuilder/nodes/classifier.py | amarin/sphinxpapyrus-docxbuilder | 0fd00a0c5467554d0a2b5ad9cd93ab780511f1a3 | [
"MIT"
] | null | null | null | sphinxpapyrus/docxbuilder/nodes/classifier.py | amarin/sphinxpapyrus-docxbuilder | 0fd00a0c5467554d0a2b5ad9cd93ab780511f1a3 | [
"MIT"
] | null | null | null | sphinxpapyrus/docxbuilder/nodes/classifier.py | amarin/sphinxpapyrus-docxbuilder | 0fd00a0c5467554d0a2b5ad9cd93ab780511f1a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Translate docutils node classifier formatting.
each classifier start will processed with visit() and finished with depart()
"""
from docutils.nodes import Node
from sphinxpapyrus.docxbuilder.translator import DocxTranslator
node_name = "classifier"
def visit(visitor: DocxTranslator, node... | 27.347826 | 76 | 0.751987 |
4bc334b2c4f79cd9436a6e4ca5fed86382f2d31b | 24,929 | py | Python | azure/mgmt/sql/operations/servers_operations.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/sql/operations/servers_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/sql/operations/servers_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # 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 ... | 43.430314 | 144 | 0.653135 |
75032570baae5b60b599cbf7f3e1a626494cd1ba | 502 | py | Python | app.py | melodily/wordle-with-friends | 2485c8b3127db3a921410463bab6a61f486aeb1d | [
"MIT"
] | null | null | null | app.py | melodily/wordle-with-friends | 2485c8b3127db3a921410463bab6a61f486aeb1d | [
"MIT"
] | null | null | null | app.py | melodily/wordle-with-friends | 2485c8b3127db3a921410463bab6a61f486aeb1d | [
"MIT"
] | null | null | null | from flask import Flask
import os
from flask_sqlalchemy import SQLAlchemy
from dotenv import load_dotenv
from flask_migrate import Migrate
load_dotenv()
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_E... | 23.904762 | 65 | 0.7749 |
e65a3832f9fd668cff746f356e49c4fe19875cbc | 24,560 | py | Python | src/sage/algebras/tensor_algebra.py | rekhabiswal/sage | e8633b09919542a65e7e990c8369fee30c7edefd | [
"BSL-1.0"
] | null | null | null | src/sage/algebras/tensor_algebra.py | rekhabiswal/sage | e8633b09919542a65e7e990c8369fee30c7edefd | [
"BSL-1.0"
] | null | null | null | src/sage/algebras/tensor_algebra.py | rekhabiswal/sage | e8633b09919542a65e7e990c8369fee30c7edefd | [
"BSL-1.0"
] | null | null | null | r"""
Tensor Algebras
AUTHORS:
- Travis Scrimshaw (2014-01-24): Initial version
.. TODO::
- Coerce to/from free algebra.
"""
#*****************************************************************************
# Copyright (C) 2014 Travis Scrimshaw <tscrim at ucdavis.edu>
#
# Distributed under the terms of the GNU G... | 34.446003 | 110 | 0.500122 |
59ece827e3ea489418d9fc7ccc971f72dfa8f070 | 1,061 | py | Python | extensions/interactions/NumericInput/NumericInput.py | cleophasmashiri/oppia | 443b960756501cffc2654fb7063a309691b9f4cf | [
"Apache-2.0"
] | 3 | 2015-03-17T01:34:14.000Z | 2015-04-11T10:35:53.000Z | extensions/interactions/NumericInput/NumericInput.py | cleophasmashiri/oppia | 443b960756501cffc2654fb7063a309691b9f4cf | [
"Apache-2.0"
] | null | null | null | extensions/interactions/NumericInput/NumericInput.py | cleophasmashiri/oppia | 443b960756501cffc2654fb7063a309691b9f4cf | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 32.151515 | 74 | 0.721018 |
2bcd64affcf51abc8e68396258c6117323888b6c | 7,887 | py | Python | ingenico/connect/sdk/domain/payment/definitions/order.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 12 | 2016-09-26T21:46:31.000Z | 2020-12-23T18:44:54.000Z | ingenico/connect/sdk/domain/payment/definitions/order.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 3 | 2020-05-02T16:53:02.000Z | 2020-06-02T12:49:51.000Z | ingenico/connect/sdk/domain/payment/definitions/order.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 11 | 2017-07-16T00:55:28.000Z | 2021-09-24T17:00:49.000Z | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney
from ingenico.connect.sdk.domai... | 38.661765 | 114 | 0.648789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.