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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73b5c1e79c92fa6ef6f381bd62a1507aff098fb | 1,393 | py | Python | gpipsfs/tests/test_main.py | brynickson/gpipsfs | 88b352d8767dae61c90e6d7904d9af42bc3ec4b2 | [
"BSD-3-Clause"
] | 13 | 2017-04-18T21:39:22.000Z | 2022-01-06T03:54:16.000Z | gpipsfs/tests/test_main.py | brynickson/gpipsfs | 88b352d8767dae61c90e6d7904d9af42bc3ec4b2 | [
"BSD-3-Clause"
] | 4 | 2015-05-20T14:06:55.000Z | 2018-07-20T00:57:49.000Z | gpipsfs/tests/test_main.py | brynickson/gpipsfs | 88b352d8767dae61c90e6d7904d9af42bc3ec4b2 | [
"BSD-3-Clause"
] | 10 | 2015-05-19T23:43:12.000Z | 2022-01-06T03:52:37.000Z | import gpipsfs
def test_coron():
gpi = gpipsfs.GPI()
gpi.obsmode='H_coron'
psf = gpi.calc_psf(monochromatic=1.6e-6)
assert psf[0].data.sum() < 5e-4
def test_direct():
gpi = gpipsfs.GPI()
gpi.obsmode='H_direct'
psf = gpi.calc_psf(monochromatic=1.6e-6)
assert psf[0].data.sum() > 0.99
... | 27.86 | 116 | 0.637473 | import gpipsfs
def test_coron():
gpi = gpipsfs.GPI()
gpi.obsmode='H_coron'
psf = gpi.calc_psf(monochromatic=1.6e-6)
assert psf[0].data.sum() < 5e-4
def test_direct():
gpi = gpipsfs.GPI()
gpi.obsmode='H_direct'
psf = gpi.calc_psf(monochromatic=1.6e-6)
assert psf[0].data.sum() > 0.99
... | true | true |
f73b5c7e264fbb04fc6fa186f79cd693449b5d9f | 1,115 | py | Python | backend/transaction/schema.py | elielagmay/react-budgeteer | 49a25dbd6dd6ea5d8bc93421eefbc12808f585af | [
"Unlicense"
] | 2 | 2018-10-23T00:40:53.000Z | 2021-05-31T08:19:40.000Z | backend/transaction/schema.py | elielagmay/react-budgeteer | 49a25dbd6dd6ea5d8bc93421eefbc12808f585af | [
"Unlicense"
] | null | null | null | backend/transaction/schema.py | elielagmay/react-budgeteer | 49a25dbd6dd6ea5d8bc93421eefbc12808f585af | [
"Unlicense"
] | null | null | null | import graphene
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from graphql_relay.node.node import from_global_id
from . import models
class TransactionNode(DjangoObjectType):
class Meta:
model = models.Transaction
filter_fields = ... | 29.342105 | 65 | 0.66009 | import graphene
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from graphql_relay.node.node import from_global_id
from . import models
class TransactionNode(DjangoObjectType):
class Meta:
model = models.Transaction
filter_fields = ... | true | true |
f73b5cbe03c416b9c5425c7ecbdfdda0e06c6149 | 238 | py | Python | sdk/python/pulumi_kubernetes/extensions/__init__.py | kulado/kulado-kubernetes | ecb72f9b25f6dbbae41f00c82388b1ca32329cc7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/extensions/__init__.py | kulado/kulado-kubernetes | ecb72f9b25f6dbbae41f00c82388b1ca32329cc7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/extensions/__init__.py | kulado/kulado-kubernetes | ecb72f9b25f6dbbae41f00c82388b1ca32329cc7 | [
"Apache-2.0"
] | 1 | 2019-08-20T22:51:57.000Z | 2019-08-20T22:51:57.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Kulado Kubernetes codegen tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Make subpackages available:
__all__ = [
"v1beta1",
]
| 26.444444 | 81 | 0.680672 |
# Make subpackages available:
__all__ = [
"v1beta1",
]
| true | true |
f73b5ced4b615cbfe356275292c3fc0b19c10053 | 11,037 | py | Python | as_download.py | frozenburst/download_audioset | a4ce2fbdeaf23c155717800bd17a986b5c1f51ad | [
"Apache-2.0"
] | null | null | null | as_download.py | frozenburst/download_audioset | a4ce2fbdeaf23c155717800bd17a986b5c1f51ad | [
"Apache-2.0"
] | null | null | null | as_download.py | frozenburst/download_audioset | a4ce2fbdeaf23c155717800bd17a986b5c1f51ad | [
"Apache-2.0"
] | null | null | null | '''
================================================
DOWNLOAD_AUDIOSET REPOSITORY
================================================
Original:
repository name: download_audioset
repository version: 1.0
repository link: https://github.com/jim-schwoebel/download_audioset
author: Jim Schwoebel
... | 37.287162 | 111 | 0.542358 | true | true | |
f73b5e0ff24c3074a9cb2314daee337c069474cd | 7,366 | py | Python | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/openpyxl/drawing/tests/test_shape.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/openpyxl/drawing/tests/test_shape.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | null | null | null | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/openpyxl/drawing/tests/test_shape.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | 1 | 2018-09-03T03:02:06.000Z | 2018-09-03T03:02:06.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2016 openpyxl
import pytest
from openpyxl.xml.constants import CHART_DRAWING_NS
from openpyxl.xml.functions import Element, fromstring, tostring
from openpyxl.tests.helper import compare_xml
class DummyDrawing(object):
"""Shapes need charts which need... | 38.768421 | 674 | 0.543171 | from __future__ import absolute_import
import pytest
from openpyxl.xml.constants import CHART_DRAWING_NS
from openpyxl.xml.functions import Element, fromstring, tostring
from openpyxl.tests.helper import compare_xml
class DummyDrawing(object):
width = 10
height = 20
class DummyChart(object):
widt... | true | true |
f73b5e276b69634a1739f519d1cdbf87ab8c964d | 9,862 | py | Python | test_app/tests/test_lare_request.py | iekadou/lare.js | 9f01fcb585d3532d4ab6d169978d3abde1f5796a | [
"MIT"
] | null | null | null | test_app/tests/test_lare_request.py | iekadou/lare.js | 9f01fcb585d3532d4ab6d169978d3abde1f5796a | [
"MIT"
] | 1 | 2016-05-20T08:31:09.000Z | 2016-05-20T08:31:09.000Z | test_app/tests/test_lare_request.py | lare-team/lare.js | 9f01fcb585d3532d4ab6d169978d3abde1f5796a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from selenium.common.exceptions import NoSuchElementException
from .helpers import SeleniumTestCase
class LareRequestTest(SeleniumTestCase):
def test_lare_request_depth_1(self):
self.browser_get_reverse('index')
... | 40.752066 | 115 | 0.685054 | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from selenium.common.exceptions import NoSuchElementException
from .helpers import SeleniumTestCase
class LareRequestTest(SeleniumTestCase):
def test_lare_request_depth_1(self):
self.browser_get_reverse('index')
... | true | true |
f73b5e8ec3430e389c2cf9ed9eb6b37bcc781a92 | 1,001 | py | Python | opencv/q23.py | wuwuwuyuanhang/python | eb5ac23cb46c4beeab1638fda963dd154b9db1b7 | [
"MIT"
] | 1 | 2021-08-02T09:22:34.000Z | 2021-08-02T09:22:34.000Z | opencv/q23.py | wuwuwuyuanhang/python | eb5ac23cb46c4beeab1638fda963dd154b9db1b7 | [
"MIT"
] | null | null | null | opencv/q23.py | wuwuwuyuanhang/python | eb5ac23cb46c4beeab1638fda963dd154b9db1b7 | [
"MIT"
] | null | null | null | # @Auther : wuwuwu
# @Time : 2020/4/15
# @File : q23.py
# @Description : 直方图均衡化
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
def histogramEqualization(img, Zmax=255):
"""
直方图均衡化
:param img:
:param Zmax: 像素的最大取值
:return:
"""
H, W, C = img.shape
S = H * W * ... | 22.75 | 65 | 0.59041 |
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
def histogramEqualization(img, Zmax=255):
H, W, C = img.shape
S = H * W * C
dst = img.copy()
sum_h = 0
for i in range(1, 255):
index = np.where(img == i)
sum_h += len(img[index])
dst[index] = Zm... | true | true |
f73b5ef50666564fef665b6054b2cf691e77900f | 2,187 | py | Python | othello/fast_bit_board_tester.py | yuishihara/Pythello | 1b4b91bfc8bd5d1bd0bdc96d3d289d8058c08b84 | [
"MIT"
] | null | null | null | othello/fast_bit_board_tester.py | yuishihara/Pythello | 1b4b91bfc8bd5d1bd0bdc96d3d289d8058c08b84 | [
"MIT"
] | null | null | null | othello/fast_bit_board_tester.py | yuishihara/Pythello | 1b4b91bfc8bd5d1bd0bdc96d3d289d8058c08b84 | [
"MIT"
] | null | null | null | from board import Board
from logging import getLogger, DEBUG, basicConfig
from libfastbb import FastBitBoard
import numpy as np
import utilities
class FastBitBoardTester(Board):
def __init__(self, rows=8, columns=8):
super(FastBitBoardTester, self).__init__()
self._impl = FastBitBoard()
se... | 32.161765 | 73 | 0.677641 | from board import Board
from logging import getLogger, DEBUG, basicConfig
from libfastbb import FastBitBoard
import numpy as np
import utilities
class FastBitBoardTester(Board):
def __init__(self, rows=8, columns=8):
super(FastBitBoardTester, self).__init__()
self._impl = FastBitBoard()
se... | true | true |
f73b5f789bb033d53575ff2de4de2cf83d105738 | 7,902 | py | Python | utils.py | voodoohop/Creative-Adversarial-Networks | 7d8632b7bfe12a698f61c442aa9c1a07d68d21c9 | [
"MIT"
] | 1 | 2020-10-20T02:15:10.000Z | 2020-10-20T02:15:10.000Z | utils.py | Chediak/Creative-Adversarial-Networks | 7d8632b7bfe12a698f61c442aa9c1a07d68d21c9 | [
"MIT"
] | null | null | null | utils.py | Chediak/Creative-Adversarial-Networks | 7d8632b7bfe12a698f61c442aa9c1a07d68d21c9 | [
"MIT"
] | 1 | 2020-10-20T02:13:10.000Z | 2020-10-20T02:13:10.000Z | """
Some codes from https://github.com/Newmu/dcgan_code
"""
from __future__ import division
import math
import json
import random
import pprint
import scipy.misc
import numpy as np
from time import gmtime, strftime
from six.moves import xrange
from glob import glob
import cv2
import imageio
import tensorflow as tf
imp... | 34.50655 | 145 | 0.649709 | from __future__ import division
import math
import json
import random
import pprint
import scipy.misc
import numpy as np
from time import gmtime, strftime
from six.moves import xrange
from glob import glob
import cv2
import imageio
import tensorflow as tf
import tensorflow.contrib.slim as slim
pp = pprint.PrettyPrint... | true | true |
f73b6022673fcd9dfb2e398bb51a7bbf33d4bb06 | 2,467 | py | Python | alien_tag.py | sacherjj/python-AlienRFID | aaddd846d46cca533dca43c256890c072e8f5ec5 | [
"MIT"
] | 1 | 2021-03-21T13:52:00.000Z | 2021-03-21T13:52:00.000Z | alien_tag.py | sacherjj/python-AlienRFID | aaddd846d46cca533dca43c256890c072e8f5ec5 | [
"MIT"
] | null | null | null | alien_tag.py | sacherjj/python-AlienRFID | aaddd846d46cca533dca43c256890c072e8f5ec5 | [
"MIT"
] | 2 | 2015-10-12T10:02:50.000Z | 2020-03-09T13:30:12.000Z | __author__ = 'joesacher'
import datetime as dt
class AlienTag(object):
def __init__(self, taglist_entry):
self.disc = 0
self.last = 0
self.last_last = 0
self.id = 0
self.ant = 0
self.count = 0
self.proto = 0
self.rssi = 0
self.freq = 0
# ... | 31.628205 | 165 | 0.565464 | __author__ = 'joesacher'
import datetime as dt
class AlienTag(object):
def __init__(self, taglist_entry):
self.disc = 0
self.last = 0
self.last_last = 0
self.id = 0
self.ant = 0
self.count = 0
self.proto = 0
self.rssi = 0
self.freq = 0
... | true | true |
f73b60439e1031a0d4a27c44af81f40197e78d1f | 1,048 | py | Python | clemency_fix.py | cseagle/ida_clemency | 7101ce142df676c7b62b176a96f43f8df01ce3d6 | [
"MIT"
] | 66 | 2017-07-31T03:44:15.000Z | 2022-03-27T07:58:13.000Z | clemency_fix.py | cseagle/ida_clemency | 7101ce142df676c7b62b176a96f43f8df01ce3d6 | [
"MIT"
] | null | null | null | clemency_fix.py | cseagle/ida_clemency | 7101ce142df676c7b62b176a96f43f8df01ce3d6 | [
"MIT"
] | 14 | 2017-07-31T13:39:10.000Z | 2021-12-10T03:16:01.000Z | from idaapi import *
'''
Author: Chris Eagle
Name: Clemency function fixup plugin defcon 25
How: Install into <idadir>/plugins
Activate within a function using Alt-8
'''
class clemency_plugin_t(plugin_t):
flags = 0
wanted_name = "Fix Clemency Functions"
wanted_hotkey = "Alt-8"
comment = ""
help = ... | 25.560976 | 66 | 0.537214 | from idaapi import *
class clemency_plugin_t(plugin_t):
flags = 0
wanted_name = "Fix Clemency Functions"
wanted_hotkey = "Alt-8"
comment = ""
help = ""
def init(self):
return PLUGIN_OK
def term(self):
pass
def run(self, arg):
f = get_func(ScreenEA())
if f is not None... | true | true |
f73b6077afbbe4aea1500a7d721be460eba78b98 | 1,235 | py | Python | config_app/migrations/0001_initial.py | radekska/django-network-controller | 6bcb847cbe1efa7dee118974de5e49b4f411e5da | [
"MIT"
] | null | null | null | config_app/migrations/0001_initial.py | radekska/django-network-controller | 6bcb847cbe1efa7dee118974de5e49b4f411e5da | [
"MIT"
] | null | null | null | config_app/migrations/0001_initial.py | radekska/django-network-controller | 6bcb847cbe1efa7dee118974de5e49b4f411e5da | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-23 19:14
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Network',
fields=[
('id', models.AutoField(... | 30.875 | 114 | 0.527126 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Network',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=... | true | true |
f73b610d1eca0381b83984305cd68fb9135b1ecd | 5,834 | py | Python | test/azure/low-level/Expected/AcceptanceTests/AzureSpecialsLowLevel/azurespecialpropertieslowlevel/rest/api_version_local/_request_builders_py3.py | Azure/autorest.python | c36f5c1a2d614a1eeba6fec6a2c02517f2d1cce7 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/azure/low-level/Expected/AcceptanceTests/AzureSpecialsLowLevel/azurespecialpropertieslowlevel/rest/api_version_local/_request_builders_py3.py | Azure/autorest.python | c36f5c1a2d614a1eeba6fec6a2c02517f2d1cce7 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/azure/low-level/Expected/AcceptanceTests/AzureSpecialsLowLevel/azurespecialpropertieslowlevel/rest/api_version_local/_request_builders_py3.py | Azure/autorest.python | c36f5c1a2d614a1eeba6fec6a2c02517f2d1cce7 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.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 ... | 44.534351 | 108 | 0.700034 |
from typing import Any, Optional
from azure.core.rest import HttpRequest
from msrest import Serializer
from ..._vendor import _format_url_section
_SERIALIZER = Serializer()
def build_get_method_local_valid_request(**kwargs: Any) -> HttpRequest:
api_version = "2.0"
accept = "application/json"
... | true | true |
f73b619dc67c20e47d8c1c61f60f735298ab7699 | 11,260 | py | Python | src/tests/ftest/container/attribute.py | fedepad/daos | ac71a320b8426b1eeb1457b0b6f5e6e115dfc9aa | [
"BSD-2-Clause-Patent"
] | 429 | 2016-09-28T20:43:20.000Z | 2022-03-25T01:22:50.000Z | src/tests/ftest/container/attribute.py | fedepad/daos | ac71a320b8426b1eeb1457b0b6f5e6e115dfc9aa | [
"BSD-2-Clause-Patent"
] | 6,341 | 2016-11-24T12:34:26.000Z | 2022-03-31T23:53:46.000Z | src/tests/ftest/container/attribute.py | fedepad/daos | ac71a320b8426b1eeb1457b0b6f5e6e115dfc9aa | [
"BSD-2-Clause-Patent"
] | 202 | 2016-10-30T14:47:53.000Z | 2022-03-30T21:29:11.000Z | #!/usr/bin/python3
'''
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
import traceback
import threading
import random
import base64
from apricot import TestWithServers
from general_utils import DaosTestError, get_random_bytes
from pydaos.raw import DaosApiError
from da... | 35.408805 | 80 | 0.567584 |
import traceback
import threading
import random
import base64
from apricot import TestWithServers
from general_utils import DaosTestError, get_random_bytes
from pydaos.raw import DaosApiError
from daos_utils import DaosCommand
GLOB_SIGNAL = None
GLOB_RC = -99000000
def cb_func(event):
global GLOB_SIGNAL
g... | true | true |
f73b61abc09d5ccb96ab0ad2f1cdea16eb5f4891 | 5,889 | py | Python | train.py | Vaden4d/logo-classifier | 18c397e52352da8e79868158123c13bf0417130f | [
"MIT"
] | null | null | null | train.py | Vaden4d/logo-classifier | 18c397e52352da8e79868158123c13bf0417130f | [
"MIT"
] | null | null | null | train.py | Vaden4d/logo-classifier | 18c397e52352da8e79868158123c13bf0417130f | [
"MIT"
] | null | null | null | import os
import argparse
import pandas as pd
from tqdm import tqdm
import torch
import torch.nn as nn
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from utils.models import EfficientNetModel, EfficientNetSSL
from utils.transforms import get_transforms
from utils.loaders impo... | 37.75 | 151 | 0.689421 | import os
import argparse
import pandas as pd
from tqdm import tqdm
import torch
import torch.nn as nn
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from utils.models import EfficientNetModel, EfficientNetSSL
from utils.transforms import get_transforms
from utils.loaders impo... | true | true |
f73b61d5003c633db0b53a0a5061de0573d4d808 | 491 | py | Python | efi_monitor/_cli.py | ambauma/efi-monitor | 2519c19a0b3cd27c38014a36066978cd888adc18 | [
"MIT"
] | null | null | null | efi_monitor/_cli.py | ambauma/efi-monitor | 2519c19a0b3cd27c38014a36066978cd888adc18 | [
"MIT"
] | null | null | null | efi_monitor/_cli.py | ambauma/efi-monitor | 2519c19a0b3cd27c38014a36066978cd888adc18 | [
"MIT"
] | null | null | null | """Define the command line iterface."""
import os
import glob
def _file_path():
"""Determine the file path."""
return os.environ.get("EFI_MONITOR_FILE_PATH", "/sys/firmware/efi/efivars/dump*")
def _files():
"""Find the dump_files."""
return glob.glob(_file_path())
def check():
"""Check for efi... | 18.884615 | 85 | 0.627291 | import os
import glob
def _file_path():
return os.environ.get("EFI_MONITOR_FILE_PATH", "/sys/firmware/efi/efivars/dump*")
def _files():
return glob.glob(_file_path())
def check():
for a_file in _files():
print(a_file)
def clear():
for a_file in _files():
os.unlink(a_file)
| true | true |
f73b61e350cc5a30b9026232f71c75e484784fb4 | 4,535 | py | Python | direct/src/particles/SpriteParticleRendererExt.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | direct/src/particles/SpriteParticleRendererExt.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/direct/particles/SpriteParticleRendererExt.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 1 | 2020-03-11T17:38:45.000Z | 2020-03-11T17:38:45.000Z | from panda3d.physics import SpriteParticleRenderer
class SpriteParticleRendererExt(SpriteParticleRenderer):
"""
Contains methods to extend functionality
of the SpriteParticleRenderer class
"""
# Initialize class variables for texture, source file and node for texture and
# node path textures ... | 35.155039 | 92 | 0.629548 | from panda3d.physics import SpriteParticleRenderer
class SpriteParticleRendererExt(SpriteParticleRenderer):
sourceTextureName = None
sourceFileName = None
sourceNodeName = None
def getSourceTextureName(self):
if self.sourceTextureName == None:
SpriteParti... | true | true |
f73b632634309b095bbcf2d01716af21add4e5a6 | 516 | py | Python | adapters/zemismart/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | adapters/zemismart/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | adapters/zemismart/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | from adapters.rgbw_adapter import RGBWAdapter
from adapters.generic.blind_adapter import BlindAdapter
from adapters.zemismart.ZMCSW002D import ZMCSW002D
from adapters.zemismart.ZML03EZ import ZML03EZ
zemismart_adapters = {
'LXZB-12A': RGBWAdapter, # Zemismart RGB LED downlight
'ZM-CSW002-D': ZMCSW002D, # ... | 43 | 85 | 0.763566 | from adapters.rgbw_adapter import RGBWAdapter
from adapters.generic.blind_adapter import BlindAdapter
from adapters.zemismart.ZMCSW002D import ZMCSW002D
from adapters.zemismart.ZML03EZ import ZML03EZ
zemismart_adapters = {
'LXZB-12A': RGBWAdapter,
'ZM-CSW002-D': ZMCSW002D,
'ZM-CSW032-D': BlindAdapte... | true | true |
f73b64f5c28bcd29dc0aad247be19c4dc6b5659b | 1,078 | py | Python | basic_SPN_tests.py | hkscy/Basic-SPN-cryptanalysis | c93cc88785d4ac7d3e9f9ae8f3c926a52a051d82 | [
"MIT"
] | 6 | 2019-03-06T01:05:27.000Z | 2022-01-11T13:23:51.000Z | basic_SPN_tests.py | hicksc/Basic-SPN-cryptanalysis | c93cc88785d4ac7d3e9f9ae8f3c926a52a051d82 | [
"MIT"
] | 1 | 2018-09-20T10:07:53.000Z | 2019-08-13T13:28:12.000Z | basic_SPN_tests.py | hicksc/Basic-SPN-cryptanalysis | c93cc88785d4ac7d3e9f9ae8f3c926a52a051d82 | [
"MIT"
] | 4 | 2018-04-18T17:58:26.000Z | 2021-09-27T19:41:21.000Z | import basic_SPN as cipher
pbox = {0:0, 1:4, 2:8, 3:12, 4:1, 5:5, 6:9, 7:13, 8:2, 9:6, 10:10, 11:14, 12:3, 13:7, 14:11, 15:15}
# test pbox functionality/symmetry
def testPBox(statem: list, pbox: dict):
staten = [0]*len(pbox)
for tpi, tp in enumerate(statem):
staten[pbox[tpi]] = tp
#print (staten)
... | 34.774194 | 118 | 0.620594 | import basic_SPN as cipher
pbox = {0:0, 1:4, 2:8, 3:12, 4:1, 5:5, 6:9, 7:13, 8:2, 9:6, 10:10, 11:14, 12:3, 13:7, 14:11, 15:15}
def testPBox(statem: list, pbox: dict):
staten = [0]*len(pbox)
for tpi, tp in enumerate(statem):
staten[pbox[tpi]] = tp
return staten
testpBoxm = ['a','b','c','d'... | true | true |
f73b650199f4c433026c13de7b49a04d23556ac4 | 8,951 | py | Python | stellar_sdk/sep/federation.py | kaotisk-hund/py-stellar-base | 30dbe1139d8f0c03c4c20ea3c9a45a19285bedb8 | [
"Apache-2.0"
] | 341 | 2015-10-06T20:56:19.000Z | 2022-03-23T15:58:54.000Z | stellar_sdk/sep/federation.py | kaotisk-hund/py-stellar-base | 30dbe1139d8f0c03c4c20ea3c9a45a19285bedb8 | [
"Apache-2.0"
] | 479 | 2015-11-09T18:39:40.000Z | 2022-03-16T06:46:58.000Z | stellar_sdk/sep/federation.py | kaotisk-hund/py-stellar-base | 30dbe1139d8f0c03c4c20ea3c9a45a19285bedb8 | [
"Apache-2.0"
] | 181 | 2015-10-01T23:00:59.000Z | 2022-03-05T13:42:19.000Z | """
SEP: 0002
Title: Federation protocol
Author: stellar.org
Status: Final
Created: 2017-10-30
Updated: 2019-10-10
Version 1.1.0
"""
from typing import Any, Coroutine, Dict, Optional, Union
from ..client.base_async_client import BaseAsyncClient
from ..client.base_sync_client import BaseSyncClient
from ..client.request... | 37.767932 | 121 | 0.683611 | from typing import Any, Coroutine, Dict, Optional, Union
from ..client.base_async_client import BaseAsyncClient
from ..client.base_sync_client import BaseSyncClient
from ..client.requests_client import RequestsClient
from ..client.response import Response
from ..exceptions import ValueError
from .exceptions import (
... | true | true |
f73b65df5a71053517f328f5398688d89886cefe | 5,652 | py | Python | tests/unit/types/document/test_converters.py | rudranshsharma123/jina | cdc66eb44fe1ae5c84ba6ddfe0a6173476f773bb | [
"Apache-2.0"
] | null | null | null | tests/unit/types/document/test_converters.py | rudranshsharma123/jina | cdc66eb44fe1ae5c84ba6ddfe0a6173476f773bb | [
"Apache-2.0"
] | null | null | null | tests/unit/types/document/test_converters.py | rudranshsharma123/jina | cdc66eb44fe1ae5c84ba6ddfe0a6173476f773bb | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import pytest
from jina import Document, __windows__
cur_dir = os.path.dirname(os.path.abspath(__file__))
def test_uri_to_blob():
doc = Document(uri=os.path.join(cur_dir, 'test.png'))
doc.convert_image_uri_to_blob()
assert isinstance(doc.blob, np.ndarray)
assert doc.mim... | 32.482759 | 90 | 0.646851 | import os
import numpy as np
import pytest
from jina import Document, __windows__
cur_dir = os.path.dirname(os.path.abspath(__file__))
def test_uri_to_blob():
doc = Document(uri=os.path.join(cur_dir, 'test.png'))
doc.convert_image_uri_to_blob()
assert isinstance(doc.blob, np.ndarray)
assert doc.mim... | true | true |
f73b66c0fc50e179b49e0fa95dfebcc24277c7b8 | 997 | py | Python | mmseg/models/scalar_schedulers/step.py | evgeniya-egupova/mmsegmentation | 3857f19321ad6af41c8a6af364898ee050225f4c | [
"Apache-2.0"
] | null | null | null | mmseg/models/scalar_schedulers/step.py | evgeniya-egupova/mmsegmentation | 3857f19321ad6af41c8a6af364898ee050225f4c | [
"Apache-2.0"
] | null | null | null | mmseg/models/scalar_schedulers/step.py | evgeniya-egupova/mmsegmentation | 3857f19321ad6af41c8a6af364898ee050225f4c | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ..builder import SCALAR_SCHEDULERS
from .base import BaseScalarScheduler
@SCALAR_SCHEDULERS.register_module()
class StepScalarScheduler(BaseScalarScheduler):
def __init__(self, scales, num_iters, by_epoch=False):
super(StepScalarScheduler, self).__init__()
self.by_epoch =... | 26.945946 | 70 | 0.62989 | import numpy as np
from ..builder import SCALAR_SCHEDULERS
from .base import BaseScalarScheduler
@SCALAR_SCHEDULERS.register_module()
class StepScalarScheduler(BaseScalarScheduler):
def __init__(self, scales, num_iters, by_epoch=False):
super(StepScalarScheduler, self).__init__()
self.by_epoch =... | true | true |
f73b672bbd29fa50d1c7e8e9e447edad247f7fbd | 12,768 | py | Python | ArbitraryCS_main.py | Raeyi/multipooling-AdaPECT | 9632b98ff1612344de798321298f6488f1c303b0 | [
"Apache-2.0"
] | null | null | null | ArbitraryCS_main.py | Raeyi/multipooling-AdaPECT | 9632b98ff1612344de798321298f6488f1c303b0 | [
"Apache-2.0"
] | null | null | null | ArbitraryCS_main.py | Raeyi/multipooling-AdaPECT | 9632b98ff1612344de798321298f6488f1c303b0 | [
"Apache-2.0"
] | null | null | null | # coding:utf8
import torch as t
import torchvision as tv
import torchnet as tnt
from torch.utils import data
from transformer_net import TransformerNet
import utils
from PackedVGG import Vgg16
from torch.nn import functional as F
import tqdm
import os
import ipdb
# from WCT2_train import WCT2
# import model
from Lap... | 38.342342 | 114 | 0.617951 |
import torch as t
import torchvision as tv
import torchnet as tnt
from torch.utils import data
from transformer_net import TransformerNet
import utils
from PackedVGG import Vgg16
from torch.nn import functional as F
import tqdm
import os
import ipdb
from LapSobGaus_train import Lap_Sob_Gaus
import net
import Ovo... | true | true |
f73b67a9de1ad56358596d1aeb0c035c9bcfe833 | 5,933 | py | Python | pyisis/tests/test_invtech.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | null | null | null | pyisis/tests/test_invtech.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | null | null | null | pyisis/tests/test_invtech.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | 2 | 2019-11-08T20:51:54.000Z | 2021-08-17T23:49:48.000Z | # -*- coding: utf-8 -*-
"""
File to test Indexing Techniques
"""
__created__ = "2009-09-14"
__updated__ = "2009-09-14"
__author__ = "João Chaves <joaochaves@gpr.com.br>"
from os.path import join, exists
from os import remove, getcwd
from sys import platform, path
from pyisis.files import MasterFile
from pyisis.conf... | 34.294798 | 91 | 0.63644 |
__created__ = "2009-09-14"
__updated__ = "2009-09-14"
__author__ = "João Chaves <joaochaves@gpr.com.br>"
from os.path import join, exists
from os import remove, getcwd
from sys import platform, path
from pyisis.files import MasterFile
from pyisis.config import config as base_config
from pyisis.engine import Engine... | true | true |
f73b682591833686efd6e92758e2b9d79fddde20 | 1,119 | py | Python | setup.py | gralin/python-qnapstats | e9ab3b8e91e9db13db9625f7812810ed19cab70c | [
"MIT"
] | null | null | null | setup.py | gralin/python-qnapstats | e9ab3b8e91e9db13db9625f7812810ed19cab70c | [
"MIT"
] | null | null | null | setup.py | gralin/python-qnapstats | e9ab3b8e91e9db13db9625f7812810ed19cab70c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import io
from setuptools import setup
setup(
name='qnapstats',
description='Python API for obtaining QNAP NAS system stats',
long_description=io.open('README.rst', encoding='utf-8').read(),
version='0.3.1',
license='MIT',
author='Colin O\'Dell',
... | 31.971429 | 68 | 0.607685 |
import io
from setuptools import setup
setup(
name='qnapstats',
description='Python API for obtaining QNAP NAS system stats',
long_description=io.open('README.rst', encoding='utf-8').read(),
version='0.3.1',
license='MIT',
author='Colin O\'Dell',
author_email='colinodell@gmail.com',
... | true | true |
f73b68d789b0facbcae3900bed3fa18434dbb6e1 | 897 | py | Python | src/ciscosupportsdk/api/asd.py | supermanny81/ciscosupportsdk | dd2ff2714b4bac6fe33576f1ab2c7999a80e0dd3 | [
"MIT"
] | null | null | null | src/ciscosupportsdk/api/asd.py | supermanny81/ciscosupportsdk | dd2ff2714b4bac6fe33576f1ab2c7999a80e0dd3 | [
"MIT"
] | null | null | null | src/ciscosupportsdk/api/asd.py | supermanny81/ciscosupportsdk | dd2ff2714b4bac6fe33576f1ab2c7999a80e0dd3 | [
"MIT"
] | null | null | null | from ciscosupportsdk.apisession import ApiSession
SERVICE_BASE_URL = "/software/v4.0"
class AutomatedSoftwareDistributionApi(object):
"""
Cisco Automated Software Distribution service provides software
information and download URLs to assist you in upgrading your
device/application to the latest vers... | 32.035714 | 77 | 0.664437 | from ciscosupportsdk.apisession import ApiSession
SERVICE_BASE_URL = "/software/v4.0"
class AutomatedSoftwareDistributionApi(object):
def __init__(self, session: ApiSession) -> None:
self._session = session
def get_bug_details(self, bug_ids: list[str]) -> None:
path = f"{SERVICE_BASE_URL}/b... | true | true |
f73b69cd2099483b6123684818356c6537070845 | 406 | py | Python | scripts/serializers.py | AdmiralGT/botc-scripts | e1b1805e030bc9af7f02c04cfa0a514c476f6bdb | [
"MIT"
] | 2 | 2022-02-28T17:05:03.000Z | 2022-02-28T22:30:03.000Z | scripts/serializers.py | AdmiralGT/botc-scripts | e1b1805e030bc9af7f02c04cfa0a514c476f6bdb | [
"MIT"
] | 50 | 2021-07-20T22:17:45.000Z | 2022-03-31T22:19:00.000Z | scripts/serializers.py | AdmiralGT/botc-scripts | e1b1805e030bc9af7f02c04cfa0a514c476f6bdb | [
"MIT"
] | null | null | null | from rest_framework import serializers
from scripts.models import ScriptVersion
# Serializers define the API representation.
class ScriptSerializer(serializers.ModelSerializer):
name = serializers.CharField(source="script.name")
score = serializers.ReadOnlyField(source="votes.count")
class Meta:
... | 29 | 62 | 0.73399 | from rest_framework import serializers
from scripts.models import ScriptVersion
class ScriptSerializer(serializers.ModelSerializer):
name = serializers.CharField(source="script.name")
score = serializers.ReadOnlyField(source="votes.count")
class Meta:
model = ScriptVersion
fields = ["pk... | true | true |
f73b6a7b07cf7322c5d2c422b130434fb0d97ed6 | 1,315 | py | Python | routing.py | kingfozhou/tornado-middleware | 0429942c9aead1a20b142030d2e987d40356e7bf | [
"Unlicense"
] | 2 | 2019-02-10T20:52:26.000Z | 2021-02-22T14:51:38.000Z | routing.py | kingfozhou/tornado-middleware | 0429942c9aead1a20b142030d2e987d40356e7bf | [
"Unlicense"
] | 1 | 2019-02-08T12:15:37.000Z | 2019-02-08T12:15:37.000Z | routing.py | kingfozhou/tornado-middleware | 0429942c9aead1a20b142030d2e987d40356e7bf | [
"Unlicense"
] | 2 | 2021-01-13T03:13:50.000Z | 2021-02-22T14:56:24.000Z | import functools
from tornado.routing import PathMatches
from core import PipelineDelegate
class MethodMatches(PathMatches):
"""Matches request path and maethod."""
def __init__(self, path_pattern, method: str):
super().__init__(path_pattern)
self.method = method.upper()
def match(self,... | 27.395833 | 110 | 0.641065 | import functools
from tornado.routing import PathMatches
from core import PipelineDelegate
class MethodMatches(PathMatches):
def __init__(self, path_pattern, method: str):
super().__init__(path_pattern)
self.method = method.upper()
def match(self, request):
result = super().match(re... | true | true |
f73b6a83340aaf0846a9e08c3fb0253c5b22a9a0 | 4,599 | py | Python | keras/backend/common.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 126 | 2017-09-08T15:21:10.000Z | 2022-01-10T00:57:22.000Z | keras/backend/common.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 12 | 2018-04-03T03:45:24.000Z | 2020-07-28T14:42:08.000Z | keras/backend/common.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 52 | 2017-12-26T13:19:49.000Z | 2022-03-17T06:14:19.000Z | import numpy as np
from collections import defaultdict
# the type of float to use throughout the session.
_FLOATX = 'float32'
_EPSILON = 10e-8
_UID_PREFIXES = defaultdict(int)
_IMAGE_DIM_ORDERING = 'tf'
_LEGACY_WEIGHT_ORDERING = False
def epsilon():
'''Returns the value of the fuzz
factor used in numeric ex... | 21.09633 | 78 | 0.572081 | import numpy as np
from collections import defaultdict
_FLOATX = 'float32'
_EPSILON = 10e-8
_UID_PREFIXES = defaultdict(int)
_IMAGE_DIM_ORDERING = 'tf'
_LEGACY_WEIGHT_ORDERING = False
def epsilon():
return _EPSILON
def set_epsilon(e):
global _EPSILON
_EPSILON = e
def floatx():
return _FLOATX
... | true | true |
f73b6ad30fd0ae3e66665286385f5fc82a71dc17 | 68 | py | Python | budget/management/commands/__init__.py | NTUSA/fudez-app | 91c8d85238fb642488ef5616be441e4417f21d0a | [
"MIT"
] | 2 | 2017-04-13T08:52:19.000Z | 2018-05-07T12:14:34.000Z | budget/management/commands/__init__.py | NTUSA/fudez-app | 91c8d85238fb642488ef5616be441e4417f21d0a | [
"MIT"
] | null | null | null | budget/management/commands/__init__.py | NTUSA/fudez-app | 91c8d85238fb642488ef5616be441e4417f21d0a | [
"MIT"
] | 1 | 2018-07-28T16:09:59.000Z | 2018-07-28T16:09:59.000Z | from .setup_budget import Command
from .clear_budget import Command
| 22.666667 | 33 | 0.852941 | from .setup_budget import Command
from .clear_budget import Command
| true | true |
f73b6af957400f898d06f92e8e267411e1aeaa6c | 668 | py | Python | backend/Backendapi/library/migrations/0007_auto_20170613_0605.py | f0rdream/SkyRead | 798b4dd35b7e6be41e5fed4537d3f6034d20494e | [
"MIT"
] | null | null | null | backend/Backendapi/library/migrations/0007_auto_20170613_0605.py | f0rdream/SkyRead | 798b4dd35b7e6be41e5fed4537d3f6034d20494e | [
"MIT"
] | null | null | null | backend/Backendapi/library/migrations/0007_auto_20170613_0605.py | f0rdream/SkyRead | 798b4dd35b7e6be41e5fed4537d3f6034d20494e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('library', '0006_auto_20170516_0903'),
]
operations = [
migrations.RenameField(
model_name='borrowitem',
... | 23.034483 | 49 | 0.568862 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('library', '0006_auto_20170516_0903'),
]
operations = [
migrations.RenameField(
model_name='borrowitem',
old_name='borrow_fi... | true | true |
f73b6ed86ce45be7b09155b8bc2c2938bbacb8ab | 13,346 | py | Python | test/functional/test_framework/sha256.py | tradecraftio/tradecraft | a014fea4d4656df67aef19e379f10322386cf6f8 | [
"MIT"
] | 10 | 2019-03-08T04:10:37.000Z | 2021-08-20T11:55:14.000Z | test/functional/test_framework/sha256.py | tradecraftio/tradecraft | a014fea4d4656df67aef19e379f10322386cf6f8 | [
"MIT"
] | 69 | 2018-11-09T20:29:29.000Z | 2021-10-05T00:08:36.000Z | test/functional/test_framework/sha256.py | tradecraftio/tradecraft | a014fea4d4656df67aef19e379f10322386cf6f8 | [
"MIT"
] | 7 | 2019-01-21T06:00:18.000Z | 2021-12-19T16:18:00.000Z | #!/usr/bin/env python
#
# Copyright (c) 2012 Dave Pifke.
#
# 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,... | 35.589333 | 155 | 0.608947 |
import binascii
import codecs
import collections
import struct
import sys
if sys.version > '3':
long = int
class SHA256(object):
State = collections.namedtuple('State', 'a b c d e f g h')
INITIAL_STATE = State(
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
... | true | true |
f73b6f6235e4a70614c6d8a32122b633eaefd46e | 4,169 | py | Python | rh_project/rk4_two_body.py | hrichstein/phys_50733 | a333bfa4dd5b0ca464bd861336bc2f32d8e72a2b | [
"MIT"
] | null | null | null | rh_project/rk4_two_body.py | hrichstein/phys_50733 | a333bfa4dd5b0ca464bd861336bc2f32d8e72a2b | [
"MIT"
] | null | null | null | rh_project/rk4_two_body.py | hrichstein/phys_50733 | a333bfa4dd5b0ca464bd861336bc2f32d8e72a2b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# from scipy.constants import G
# Setting plotting parameters
from matplotlib import rc,rcParams
rc('text', usetex=True)
rc('axes', linewidth=2)
rc('font', weight='bold')
rc('font', **{'family': 'serif', 'serif':['Computer Modern']})
def find_vel_init(M1, M2, A):
pe... | 21.713542 | 77 | 0.623171 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc,rcParams
rc('text', usetex=True)
rc('axes', linewidth=2)
rc('font', weight='bold')
rc('font', **{'family': 'serif', 'serif':['Computer Modern']})
def find_vel_init(M1, M2, A):
period = np.sqrt(4 * np.pi**2 * A**3 / G / (M1 + M2))
v = 2... | true | true |
f73b6f6d7d6955528eef744b500e27d5eca877ef | 1,000 | py | Python | vyperlogix/django/forms/fields.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/django/forms/fields.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/django/forms/fields.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import sys
from vyperlogix.misc import _utils
from django.utils.datastructures import SortedDict as SortedDictFromList
from vyperlogix.classes.SmartObject import SmartObject
def fields_for_model(model, formfield_callback=lambda f: f.formfield()):
"""
Returns a list of fields for the given Django model class... | 33.333333 | 78 | 0.698 | import sys
from vyperlogix.misc import _utils
from django.utils.datastructures import SortedDict as SortedDictFromList
from vyperlogix.classes.SmartObject import SmartObject
def fields_for_model(model, formfield_callback=lambda f: f.formfield()):
field_list = []
try:
opts = model._meta
for f... | true | true |
f73b70081d30dca56b8865df6df3912715334caf | 51,771 | py | Python | dianhua/worker/crawler/china_mobile/jiangsu/main.py | Svolcano/python_exercise | a50e05891cc7f1fbb40ebcae324b09b6a14473d2 | [
"MIT"
] | 6 | 2015-07-09T08:47:08.000Z | 2020-05-16T10:47:31.000Z | dianhua/worker/crawler/china_mobile/jiangsu/main.py | Svolcano/python_exercise | a50e05891cc7f1fbb40ebcae324b09b6a14473d2 | [
"MIT"
] | 7 | 2019-03-27T04:13:12.000Z | 2022-03-02T14:54:56.000Z | dianhua/worker/crawler/china_mobile/jiangsu/main.py | Svolcano/python_exercise | a50e05891cc7f1fbb40ebcae324b09b6a14473d2 | [
"MIT"
] | 2 | 2019-06-21T06:46:28.000Z | 2019-12-23T09:31:09.000Z | # -*- coding: utf-8 -*-
import base64
import datetime
import json
import sys
import time
import random
import traceback
from datetime import date
from calendar import monthrange
import hashlib
import re
import execjs
from dateutil.relativedelta import relativedelta
from requests.utils import add_dict_to_cookiejar
rel... | 67.410156 | 556 | 0.601321 |
import base64
import datetime
import json
import sys
import time
import random
import traceback
from datetime import date
from calendar import monthrange
import hashlib
import re
import execjs
from dateutil.relativedelta import relativedelta
from requests.utils import add_dict_to_cookiejar
reload(sys)
sys.setdefault... | true | true |
f73b718d2cae9741980debef98a010af966684c5 | 7,308 | py | Python | cloudmerge-hpc/mpi_merge.py | xsun28/CloudMerge | c4211bac841b103c77d6f9c4af633102742298ac | [
"Apache-2.0"
] | null | null | null | cloudmerge-hpc/mpi_merge.py | xsun28/CloudMerge | c4211bac841b103c77d6f9c4af633102742298ac | [
"Apache-2.0"
] | 1 | 2020-03-27T18:29:00.000Z | 2020-03-27T18:29:00.000Z | cloudmerge-hpc/mpi_merge.py | xsun28/CloudMerge | c4211bac841b103c77d6f9c4af633102742298ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 27 16:54:42 2017
@author: Xiaobo
"""
import numpy as np
from mpi4py import MPI
import commands
import os
import sys
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
#sys.path.append('/Users/Xiaobo/git/CloudMerge/CloudMerge/cl... | 38.666667 | 146 | 0.632868 |
import numpy as np
from mpi4py import MPI
import commands
import os
import sys
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
import multiway_merge as mm
import argparse
| true | true |
f73b7194cf9635a1ee1a086d7b28c9a5c9ce3dbc | 215 | py | Python | superlists/lists/urls.py | Rishant96/Test-Driven-Development | e60f24e1554acf933878c000b64c865902de53db | [
"BSD-3-Clause"
] | null | null | null | superlists/lists/urls.py | Rishant96/Test-Driven-Development | e60f24e1554acf933878c000b64c865902de53db | [
"BSD-3-Clause"
] | null | null | null | superlists/lists/urls.py | Rishant96/Test-Driven-Development | e60f24e1554acf933878c000b64c865902de53db | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from . import views
app_name = "lists"
urlpatterns = [
path('', views.home_page, name="home"),
path('the-only-list-in-the-world/', views.view_list,
name='view_list')
]
| 21.5 | 56 | 0.655814 | from django.urls import path
from . import views
app_name = "lists"
urlpatterns = [
path('', views.home_page, name="home"),
path('the-only-list-in-the-world/', views.view_list,
name='view_list')
]
| true | true |
f73b738d4173688dd65e3dc89f6ba73e754fedaa | 624 | py | Python | indico/modules/news/views.py | uxmaster/indico | ecd19f17ef6fdc9f5584f59c87ec647319ce5d31 | [
"MIT"
] | 1 | 2019-11-03T11:34:16.000Z | 2019-11-03T11:34:16.000Z | indico/modules/news/views.py | NP-compete/indico | 80db7ca0ef9d1f3240a16b9ff2d84bf0bf26c549 | [
"MIT"
] | null | null | null | indico/modules/news/views.py | NP-compete/indico | 80db7ca0ef9d1f3240a16b9ff2d84bf0bf26c549 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.modules.admin.views import WPAdmin
from indico.util.i... | 24.96 | 57 | 0.745192 |
from __future__ import unicode_literals
from indico.modules.admin.views import WPAdmin
from indico.util.i18n import _
from indico.web.views import WPDecorated, WPJinjaMixin
class WPNews(WPJinjaMixin, WPDecorated):
template_prefix = 'news/'
title = _('News')
def _get_body(self, params):
re... | true | true |
f73b7408bc16ab24872927eba07c71af7a4367d2 | 802 | py | Python | lib/django-1.2/django/core/cache/backends/dummy.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.2/django/core/cache/backends/dummy.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.2/django/core/cache/backends/dummy.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | "Dummy cache backend"
from django.core.cache.backends.base import BaseCache
class CacheClass(BaseCache):
def __init__(self, *args, **kwargs):
pass
def add(self, key, *args, **kwargs):
self.validate_key(key)
return True
def get(self, key, default=None):
self.validate_key(k... | 21.105263 | 53 | 0.593516 |
from django.core.cache.backends.base import BaseCache
class CacheClass(BaseCache):
def __init__(self, *args, **kwargs):
pass
def add(self, key, *args, **kwargs):
self.validate_key(key)
return True
def get(self, key, default=None):
self.validate_key(key)
return def... | true | true |
f73b7592057f2df4bc67cde0a7d7949e4e675d90 | 2,265 | py | Python | simulation-code/old_functions/average_rotated_trials.py | young24/LFP-simulation-in-turtle-brain | cd801dc02804d027b7c245b0f0ca9c8b00f8d450 | [
"MIT"
] | null | null | null | simulation-code/old_functions/average_rotated_trials.py | young24/LFP-simulation-in-turtle-brain | cd801dc02804d027b7c245b0f0ca9c8b00f8d450 | [
"MIT"
] | null | null | null | simulation-code/old_functions/average_rotated_trials.py | young24/LFP-simulation-in-turtle-brain | cd801dc02804d027b7c245b0f0ca9c8b00f8d450 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 12 09:12:00 2016
Average the spatial influence of the morphology
@author: young
"""
import os
from os.path import join
import pylab as plt
import numpy as np
def average_data_in_dif_folder(dirName,dataName,z_pos,numRotation,idxSection):
yfileName = dirName+'_0/'+dataN... | 33.80597 | 107 | 0.628256 |
import os
from os.path import join
import pylab as plt
import numpy as np
def average_data_in_dif_folder(dirName,dataName,z_pos,numRotation,idxSection):
yfileName = dirName+'_0/'+dataName+str(z_pos)+'.npy'
y=np.load(yfileName)
y=y[idxSection]
for i in range(1,numRotation,1):
yfileName = dirNam... | true | true |
f73b7616494b07699e5229ce405a2904632aaff8 | 7,493 | py | Python | Rasp-main/PruebasDB.py | ascuadrado/ISC | 0d3f623dabf40dc0057e8da0d3c75c8b2dd339e9 | [
"MIT"
] | 1 | 2020-11-18T12:22:09.000Z | 2020-11-18T12:22:09.000Z | Rasp-main/PruebasDB.py | ascuadrado/ISC | 0d3f623dabf40dc0057e8da0d3c75c8b2dd339e9 | [
"MIT"
] | null | null | null | Rasp-main/PruebasDB.py | ascuadrado/ISC | 0d3f623dabf40dc0057e8da0d3c75c8b2dd339e9 | [
"MIT"
] | null | null | null | import sqlite3
import time
import random
from tqdm import tqdm
# Setup
dbFile = 'ISC/Rasp-main/Database.db'
DBDelay = 2 # seconds
# Data
general = dict()
charger = dict()
sevcon = dict()
bms1 = dict()
bms2 = dict()
bms3 = dict()
bms = [bms1, bms2, bms3]
def init_dict():
'''
Initializes internal dictionaries... | 38.425641 | 86 | 0.558521 | import sqlite3
import time
import random
from tqdm import tqdm
dbFile = 'ISC/Rasp-main/Database.db'
DBDelay = 2
general = dict()
charger = dict()
sevcon = dict()
bms1 = dict()
bms2 = dict()
bms3 = dict()
bms = [bms1, bms2, bms3]
def init_dict():
d = -1
v = 4.2
t = 30
bms1['voltages'] = [v, v, v,... | true | true |
f73b782d9623bde7cf1340322e29f574a1f998f3 | 10,738 | py | Python | userbot/plugins/chatinfo.py | SH4DOWV/X-tra-Telegram | 73634556989ac274c44a0a2cc9ff4322e7a52158 | [
"MIT"
] | null | null | null | userbot/plugins/chatinfo.py | SH4DOWV/X-tra-Telegram | 73634556989ac274c44a0a2cc9ff4322e7a52158 | [
"MIT"
] | null | null | null | userbot/plugins/chatinfo.py | SH4DOWV/X-tra-Telegram | 73634556989ac274c44a0a2cc9ff4322e7a52158 | [
"MIT"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Credits to Hitalo-Sama and FTG Modules
from datetime import datetime
from emoji import emojize
from math import sqrt... | 52.637255 | 206 | 0.668653 |
from datetime import datetime
from emoji import emojize
from math import sqrt
from telethon.tl.functions.channels import GetFullChannelRequest, GetParticipantsRequest
from telethon.tl.functions.messages import GetHistoryRequest, CheckChatInviteRequest, GetFullChatRequest
from telethon.tl.types import MessageActi... | true | true |
f73b7842ef9014e2395b7d6bb610683e124791d0 | 49,387 | py | Python | pandas/tests/internals/test_internals.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 1 | 2019-05-04T03:42:25.000Z | 2019-05-04T03:42:25.000Z | pandas/tests/internals/test_internals.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/internals/test_internals.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
from datetime import date, datetime
from distutils.version import LooseVersion
import itertools
import operator
import re
import sys
import numpy as np
import pytest
from pandas._libs.internals import BlockPlacement
from pandas.compat import lrange
import pandas as pd
from pandas ... | 37.585236 | 79 | 0.547978 | from collections import OrderedDict
from datetime import date, datetime
from distutils.version import LooseVersion
import itertools
import operator
import re
import sys
import numpy as np
import pytest
from pandas._libs.internals import BlockPlacement
from pandas.compat import lrange
import pandas as pd
from pandas ... | true | true |
f73b78c1acef35629be71052e1e9fa32f0ad298a | 151 | py | Python | livy/__init__.py | EDS-APHP/pylivy | 0714e4e74e27c1a13b74228700bb3e800e9646fe | [
"MIT"
] | null | null | null | livy/__init__.py | EDS-APHP/pylivy | 0714e4e74e27c1a13b74228700bb3e800e9646fe | [
"MIT"
] | null | null | null | livy/__init__.py | EDS-APHP/pylivy | 0714e4e74e27c1a13b74228700bb3e800e9646fe | [
"MIT"
] | 1 | 2020-02-05T09:31:01.000Z | 2020-02-05T09:31:01.000Z | from livy.session import LivySession # noqa: F401
from livy.models import ( # noqa: F401
SessionKind,
SessionState,
SparkRuntimeError,
)
| 21.571429 | 50 | 0.715232 | from livy.session import LivySession
from livy.models import (
SessionKind,
SessionState,
SparkRuntimeError,
)
| true | true |
f73b78d3a2989df5213f148680faeebb5b1c6a9b | 32,481 | py | Python | ndlib/test/test_ndlib.py | KDDComplexNetworkAnalysis/ndlib | 2d05df8cd67de142ef068cc051969f86e51dfbc6 | [
"BSD-2-Clause"
] | 6 | 2018-12-20T07:33:09.000Z | 2020-05-10T07:33:33.000Z | ndlib/test/test_ndlib.py | KDDComplexNetworkAnalysis/ndlib | 2d05df8cd67de142ef068cc051969f86e51dfbc6 | [
"BSD-2-Clause"
] | null | null | null | ndlib/test/test_ndlib.py | KDDComplexNetworkAnalysis/ndlib | 2d05df8cd67de142ef068cc051969f86e51dfbc6 | [
"BSD-2-Clause"
] | 2 | 2020-02-05T09:11:17.000Z | 2020-02-07T11:12:33.000Z | from __future__ import absolute_import
import unittest
import random
import future.utils
import networkx as nx
import igraph as ig
import numpy as np
import ndlib.models.ModelConfig as mc
import ndlib.models.epidemics as epd
import ndlib.models.opinions as opn
import ndlib.utils as ut
__author__ = 'Giulio Rossetti'
... | 40.299007 | 92 | 0.58859 | from __future__ import absolute_import
import unittest
import random
import future.utils
import networkx as nx
import igraph as ig
import numpy as np
import ndlib.models.ModelConfig as mc
import ndlib.models.epidemics as epd
import ndlib.models.opinions as opn
import ndlib.utils as ut
__author__ = 'Giulio Rossetti'
... | true | true |
f73b7950730aa42386ba3444f382424ff9044cff | 9,836 | py | Python | 1_AdvancedBasicsPart_I/otus_hw1_log_analyzer/log_analyzer.py | a-agarkov/otus-python-2017-11 | 2f0977f83e0f46f2360a74a7d941199bbe9e9306 | [
"MIT"
] | 2 | 2017-12-14T14:50:52.000Z | 2018-03-08T20:48:44.000Z | 1_AdvancedBasicsPart_I/otus_hw1_log_analyzer/log_analyzer.py | a-agarkov/otus-python-2017-11 | 2f0977f83e0f46f2360a74a7d941199bbe9e9306 | [
"MIT"
] | null | null | null | 1_AdvancedBasicsPart_I/otus_hw1_log_analyzer/log_analyzer.py | a-agarkov/otus-python-2017-11 | 2f0977f83e0f46f2360a74a7d941199bbe9e9306 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gzip
import json
import re
import logging
import sys
import datetime as dt
import os
from operator import itemgetter
from statistics import median, mean
import argparse
from time import time, sleep
from itertools import groupby
from collections import namedtuple
from... | 32.569536 | 119 | 0.638878 |
import gzip
import json
import re
import logging
import sys
import datetime as dt
import os
from operator import itemgetter
from statistics import median, mean
import argparse
from time import time, sleep
from itertools import groupby
from collections import namedtuple
from string import Template
from functools impor... | true | true |
f73b79b13a7fe69d626231f46dd7d033d19ba62c | 1,581 | py | Python | Service/website_service.py | H0R4T1U/SRI | ed0891c595551929ce649b38f722ed2a8b7a696d | [
"Apache-2.0"
] | 1 | 2021-12-04T08:40:30.000Z | 2021-12-04T08:40:30.000Z | Service/website_service.py | H0R4T1U/SRI | ed0891c595551929ce649b38f722ed2a8b7a696d | [
"Apache-2.0"
] | null | null | null | Service/website_service.py | H0R4T1U/SRI | ed0891c595551929ce649b38f722ed2a8b7a696d | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
from Domain.website import Website
from selenium.webdriver.firefox.options import Options
from Repository.file_repository import FileRepository
class WebsiteService:
def __init__(self, website_repository: FileRepository):
s... | 31.62 | 91 | 0.631246 | from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
from Domain.website import Website
from selenium.webdriver.firefox.options import Options
from Repository.file_repository import FileRepository
class WebsiteService:
def __init__(self, website_repository: FileRepository):
s... | true | true |
f73b7ad8716953e988a19b8a3da79faac94ccecb | 492 | py | Python | src/unittest/python/injection_tests.py | DMRSystem/dmr-cli | a884347facb07a4b5c5bd7486d95cc3a05340917 | [
"MIT"
] | null | null | null | src/unittest/python/injection_tests.py | DMRSystem/dmr-cli | a884347facb07a4b5c5bd7486d95cc3a05340917 | [
"MIT"
] | 2 | 2018-05-24T21:20:43.000Z | 2018-05-28T05:35:32.000Z | src/unittest/python/injection_tests.py | DMRSystem/dmr-cli | a884347facb07a4b5c5bd7486d95cc3a05340917 | [
"MIT"
] | null | null | null | import dependency_injector.providers as providers
import dependency_injector.containers as containers
class Engine(object):
def go(self):
return "I'm going."
class Car(object):
def __init__(self, engine: Engine):
self.engine = engine
def go(self):
print(self.engine.go())
cla... | 16.4 | 51 | 0.693089 | import dependency_injector.providers as providers
import dependency_injector.containers as containers
class Engine(object):
def go(self):
return "I'm going."
class Car(object):
def __init__(self, engine: Engine):
self.engine = engine
def go(self):
print(self.engine.go())
cla... | true | true |
f73b7c904f290646d369fe3840c216cd9b34d97c | 5,606 | py | Python | tetris/ai/population.py | TomerHanochi/Tetris | 5be6c02b27164d0b3897006e5d1476b3e8546533 | [
"MIT"
] | null | null | null | tetris/ai/population.py | TomerHanochi/Tetris | 5be6c02b27164d0b3897006e5d1476b3e8546533 | [
"MIT"
] | null | null | null | tetris/ai/population.py | TomerHanochi/Tetris | 5be6c02b27164d0b3897006e5d1476b3e8546533 | [
"MIT"
] | null | null | null | from __future__ import annotations
from random import random
import numpy as np
from tetris.ai.network import Network
class Population:
def __init__(self, size: int = 500, old_pop: Population = None,
parent_candidates_pct: float = .1, offspring_pct: float = .3,
mutation_chance:... | 49.175439 | 99 | 0.644488 | from __future__ import annotations
from random import random
import numpy as np
from tetris.ai.network import Network
class Population:
def __init__(self, size: int = 500, old_pop: Population = None,
parent_candidates_pct: float = .1, offspring_pct: float = .3,
mutation_chance:... | true | true |
f73b7ca19f8edaa9bba225fd779a3bdd7e08513f | 2,207 | py | Python | internal/notes/builtin-SAVE/packages/r-affyplm/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/r-affyplm/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/r-affyplm/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 46.957447 | 125 | 0.67739 | true | true | |
f73b7cb326a90d8c48085cb16779f4e82197e119 | 4,233 | py | Python | taxi_uploader.py | nicor88/data-sets-s3-uploader | 872f702ec0c366a25ef1b4e24f1d23ad435076bd | [
"MIT"
] | null | null | null | taxi_uploader.py | nicor88/data-sets-s3-uploader | 872f702ec0c366a25ef1b4e24f1d23ad435076bd | [
"MIT"
] | null | null | null | taxi_uploader.py | nicor88/data-sets-s3-uploader | 872f702ec0c366a25ef1b4e24f1d23ad435076bd | [
"MIT"
] | null | null | null | """
Script to upload the data set of New York Taxi trips in S3 data lake
Sources
http://www.nyc.gov/html/tlc/html/about/trip_record_data.shtml
https://github.com/toddwschneider/nyc-taxi-data/blob/master/setup_files/raw_data_urls.txt
Example
>>> sample_url = 'https://s3.amazonaws.com/nyc-tlc/trip+data/fhv_tripdata_2015... | 38.481818 | 140 | 0.725254 | import argparse
import sys
import boto3
from dateutil import parser, relativedelta
import requests
s3 = boto3.resource('s3')
BASE_URL = 'https://s3.amazonaws.com/nyc-tlc/trip+data'
def save_to_s3(*, source_url, s3_key, s3_bucket):
destination_bucket_resource = s3.Bucket(s3_bucket)
global transfer_size_byt... | true | true |
f73b7ebdcce8413f0b05b38edc2d5c459acd40a6 | 2,180 | py | Python | modules/test/npcore/layers/test_layer.py | tuantle/simple_nn_with_numpy | 4bf5ba23e2df7879030de85eb22b8e30ad9708de | [
"MIT"
] | 1 | 2019-01-31T20:24:34.000Z | 2019-01-31T20:24:34.000Z | modules/test/npcore/layers/test_layer.py | tuantle/simple_nn_with_numpy | 4bf5ba23e2df7879030de85eb22b8e30ad9708de | [
"MIT"
] | null | null | null | modules/test/npcore/layers/test_layer.py | tuantle/simple_nn_with_numpy | 4bf5ba23e2df7879030de85eb22b8e30ad9708de | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016-present Tuan Le.
#
# Licensed under the MIT License.
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://opensource.org/licenses/mit-license.html
#
# Unless required by applicable law or agreed to in writing, so... | 32.537313 | 94 | 0.588532 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import env
import unittest
from npcore.layer.layer import Layer
class TestCoreLayerClass(unittest.TestCase):
def test_init(self):
print('Testing Core Layer.')
shap... | true | true |
f73b7fb2430cdbeb17654b7f2b0f9f0760596f0e | 282 | py | Python | mesa_behaviors/history/base_history.py | tokesim/mesa_behaviors | 3f34c1227799b37880b123b0953d9311c32a5fd3 | [
"Apache-2.0"
] | 1 | 2021-08-19T23:44:52.000Z | 2021-08-19T23:44:52.000Z | mesa_behaviors/history/base_history.py | tokesim/mesa_behaviors | 3f34c1227799b37880b123b0953d9311c32a5fd3 | [
"Apache-2.0"
] | 5 | 2020-04-15T05:24:31.000Z | 2020-04-23T03:44:08.000Z | mesa_behaviors/history/base_history.py | tokesim/mesa_behaviors | 3f34c1227799b37880b123b0953d9311c32a5fd3 | [
"Apache-2.0"
] | 2 | 2020-04-14T02:21:55.000Z | 2020-09-16T03:22:22.000Z | from abc import ABC, abstractmethod
from typing import Generic, TypeVar
H = TypeVar("H")
T = TypeVar("T")
class BaseHistory(Generic[H, T], ABC):
@abstractmethod
def add(self, entry: T) -> None:
pass
@abstractmethod
def retrieve(self) -> H:
pass
| 16.588235 | 38 | 0.631206 | from abc import ABC, abstractmethod
from typing import Generic, TypeVar
H = TypeVar("H")
T = TypeVar("T")
class BaseHistory(Generic[H, T], ABC):
@abstractmethod
def add(self, entry: T) -> None:
pass
@abstractmethod
def retrieve(self) -> H:
pass
| true | true |
f73b80548356187472913852e6bad7c3fe661f47 | 6,598 | py | Python | train_script.py | zhlinup/Relay-FL | 3a64d75108295412ed438f95ef2cf0da6c87bdbd | [
"MIT"
] | null | null | null | train_script.py | zhlinup/Relay-FL | 3a64d75108295412ed438f95ef2cf0da6c87bdbd | [
"MIT"
] | null | null | null | train_script.py | zhlinup/Relay-FL | 3a64d75108295412ed438f95ef2cf0da6c87bdbd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
np.set_printoptions(precision=6, threshold=1e3)
import torch
from torchvision import datasets, transforms
import copy
import torch.nn as nn
from torch.utils.data import DataLoader
def mnist_iid(dataset, K, M):
dict_users, all_idxs = {}, [i for i in range... | 39.508982 | 117 | 0.608518 |
import numpy as np
np.set_printoptions(precision=6, threshold=1e3)
import torch
from torchvision import datasets, transforms
import copy
import torch.nn as nn
from torch.utils.data import DataLoader
def mnist_iid(dataset, K, M):
dict_users, all_idxs = {}, [i for i in range(len(dataset))]
f... | true | true |
f73b8059a63758aeac0948d27b41ba7599e9741e | 17,308 | py | Python | allennlp/data/dataset_readers/dataset_utils/span_utils.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 11,433 | 2017-06-27T03:08:46.000Z | 2022-03-31T18:14:33.000Z | allennlp/data/dataset_readers/dataset_utils/span_utils.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 4,006 | 2017-06-26T21:45:43.000Z | 2022-03-31T02:11:10.000Z | allennlp/data/dataset_readers/dataset_utils/span_utils.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 2,560 | 2017-06-26T21:16:53.000Z | 2022-03-30T07:55:46.000Z | from typing import Callable, List, Set, Tuple, TypeVar, Optional
import warnings
from allennlp.common.checks import ConfigurationError
from allennlp.data.tokenizers import Token
TypedSpan = Tuple[int, Tuple[int, int]]
TypedStringSpan = Tuple[str, Tuple[int, int]]
class InvalidTagSequence(Exception):
def __init... | 38.981982 | 100 | 0.620349 | from typing import Callable, List, Set, Tuple, TypeVar, Optional
import warnings
from allennlp.common.checks import ConfigurationError
from allennlp.data.tokenizers import Token
TypedSpan = Tuple[int, Tuple[int, int]]
TypedStringSpan = Tuple[str, Tuple[int, int]]
class InvalidTagSequence(Exception):
def __init... | true | true |
f73b806038319cb54561e5961d12b124b0058fcb | 1,268 | py | Python | test7-2.py | carolninganga/week7project | 9a114701371f653ffceb1555ab05d1161831cf78 | [
"Apache-2.0"
] | null | null | null | test7-2.py | carolninganga/week7project | 9a114701371f653ffceb1555ab05d1161831cf78 | [
"Apache-2.0"
] | null | null | null | test7-2.py | carolninganga/week7project | 9a114701371f653ffceb1555ab05d1161831cf78 | [
"Apache-2.0"
] | null | null | null | # Bruce Maxwell
# Fall 2020
# CS 5001 Project 7
# First L-system project
# Some test code
import turtle
import turtle_interpreter as ti
# useful goto function
def goto(x, y):
turtle.up()
turtle.goto(x, y)
turtle.down()
# main function that makes a small tree in a pot
def makeTree():
# set up the win... | 19.8125 | 57 | 0.58123 |
import turtle
import turtle_interpreter as ti
def goto(x, y):
turtle.up()
turtle.goto(x, y)
turtle.down()
def makeTree():
turtle.setup(500, 500)
turtle.tracer(False)
turtle.setheading(90)
goto(0,0)
s = 'F[+F[+F][-F]][-F[+F][-F]]'
turtle.width(3)
ti.drawStrin... | true | true |
f73b81858ce995d925555f906571c7538ded8f4d | 16,179 | py | Python | pyaxe/axesrc/axecommands.py | sosey/pyaxe | f57de55daf77de21d5868ace08b69090778d5975 | [
"BSD-3-Clause"
] | null | null | null | pyaxe/axesrc/axecommands.py | sosey/pyaxe | f57de55daf77de21d5868ace08b69090778d5975 | [
"BSD-3-Clause"
] | null | null | null | pyaxe/axesrc/axecommands.py | sosey/pyaxe | f57de55daf77de21d5868ace08b69090778d5975 | [
"BSD-3-Clause"
] | null | null | null | import sys
import shutil
import logging
from astropy.io import fits
from pyaxe import config as config_util
from . import axetasks
from .axeerror import aXeSIMError
# make sure there is a logger
_log = logging.getLogger(__name__)
"""
The following deal with axe simulations
"""
class DispImator(object):
"""Cl... | 35.095445 | 80 | 0.570925 | import sys
import shutil
import logging
from astropy.io import fits
from pyaxe import config as config_util
from . import axetasks
from .axeerror import aXeSIMError
_log = logging.getLogger(__name__)
class DispImator(object):
def __init__(self, dummyImages, configfile, simobjects, lambda_psf=None,
... | true | true |
f73b830b90c647991499d0a0d7660ad41ed300da | 6,798 | py | Python | kubernetes/client/models/v1_service_list.py | pllsxyc/python | 442ebc019056c2dc246be94f85cf61f1e1d26a88 | [
"Apache-2.0"
] | 1 | 2019-10-07T13:54:36.000Z | 2019-10-07T13:54:36.000Z | kubernetes/client/models/v1_service_list.py | pllsxyc/python | 442ebc019056c2dc246be94f85cf61f1e1d26a88 | [
"Apache-2.0"
] | 8 | 2020-12-21T03:18:50.000Z | 2022-03-02T03:06:30.000Z | kubernetes/client/models/v1_service_list.py | pllsxyc/python | 442ebc019056c2dc246be94f85cf61f1e1d26a88 | [
"Apache-2.0"
] | 1 | 2021-03-16T16:05:33.000Z | 2021-03-16T16:05:33.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.16
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 33 | 312 | 0.619594 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1ServiceList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[V1Service]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'api_v... | true | true |
f73b84aebb0ba5336bdcf4ec5c5f044e640e835e | 6,136 | py | Python | mystic/__init__.py | RykerCohen/mystic | 5f60e43642e21f13068cc9a755712f240038fa48 | [
"MIT"
] | 2 | 2020-11-06T02:27:57.000Z | 2020-11-06T08:22:06.000Z | mystic/__init__.py | RykerCohen/mystic | 5f60e43642e21f13068cc9a755712f240038fa48 | [
"MIT"
] | 16 | 2020-11-06T05:13:39.000Z | 2020-11-08T03:23:29.000Z | mystic/__init__.py | RykerCohen/mystic | 5f60e43642e21f13068cc9a755712f240038fa48 | [
"MIT"
] | 3 | 2020-11-06T17:13:29.000Z | 2020-11-25T16:17:30.000Z | import asyncio
import importlib
import logging
import pkgutil
from abc import ABC, abstractmethod
from collections import OrderedDict
from types import FunctionType
def get_package_modules(package):
package_modules = []
for importer, module_name, is_package in pkgutil.iter_modules(package.__path__):
f... | 36.963855 | 95 | 0.670469 | import asyncio
import importlib
import logging
import pkgutil
from abc import ABC, abstractmethod
from collections import OrderedDict
from types import FunctionType
def get_package_modules(package):
package_modules = []
for importer, module_name, is_package in pkgutil.iter_modules(package.__path__):
f... | true | true |
f73b8567300bcad64d1eefbaf7a24b0223b81b9b | 8,972 | py | Python | sentry_sdk/integrations/asgi.py | simonschmidt/sentry-python | cad2f65316bab4ee5792b1b788c32c57293eea5e | [
"BSD-2-Clause"
] | 1,213 | 2018-06-19T00:51:01.000Z | 2022-03-31T06:37:16.000Z | sentry_sdk/integrations/asgi.py | maltalk/sentry-python | 4e346acbabb1fd5592663bf9acd580835236fcf0 | [
"BSD-2-Clause"
] | 1,020 | 2018-07-16T12:50:36.000Z | 2022-03-31T20:42:49.000Z | sentry_sdk/integrations/asgi.py | maltalk/sentry-python | 4e346acbabb1fd5592663bf9acd580835236fcf0 | [
"BSD-2-Clause"
] | 340 | 2018-07-16T12:47:27.000Z | 2022-03-22T10:13:21.000Z | """
An ASGI middleware.
Based on Tom Christie's `sentry-asgi <https://github.com/encode/sentry-asgi>`_.
"""
import asyncio
import inspect
import urllib
from sentry_sdk._functools import partial
from sentry_sdk._types import MYPY
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.integrations._w... | 34.507692 | 161 | 0.589835 |
import asyncio
import inspect
import urllib
from sentry_sdk._functools import partial
from sentry_sdk._types import MYPY
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.integrations._wsgi_common import _filter_headers
from sentry_sdk.utils import (
ContextVar,
event_from_exception,
... | true | true |
f73b85f193f4842955a6156528b9f7c2b37048ca | 1,618 | py | Python | dataPipelines/gc_db_utils/web/utils.py | Wildertrek/gamechanger-data | d087044594c722bd373cce1a48293d1a6da5d24e | [
"MIT"
] | 18 | 2021-04-20T20:34:01.000Z | 2021-11-08T10:28:17.000Z | dataPipelines/gc_db_utils/web/utils.py | Wildertrek/gamechanger-data | d087044594c722bd373cce1a48293d1a6da5d24e | [
"MIT"
] | 15 | 2021-04-20T20:31:33.000Z | 2022-03-18T16:00:44.000Z | dataPipelines/gc_db_utils/web/utils.py | dod-advana/gamechanger-data | 1cdba2a3dbc1072f5991dcfe1daea6310c8ae42b | [
"MIT"
] | 8 | 2021-04-23T11:38:26.000Z | 2021-11-17T22:42:38.000Z | from .models import DeferredWebReflectedBase
from . import PACKAGE_PATH
from pathlib import Path
from typing import Union
import sqlalchemy
def run_sql_file(sql_subpath: Union[str, Path], engine: sqlalchemy.engine.Engine) -> None:
sql_path = Path(PACKAGE_PATH, 'sql', sql_subpath).resolve()
if not sql_path.is_... | 28.385965 | 90 | 0.756489 | from .models import DeferredWebReflectedBase
from . import PACKAGE_PATH
from pathlib import Path
from typing import Union
import sqlalchemy
def run_sql_file(sql_subpath: Union[str, Path], engine: sqlalchemy.engine.Engine) -> None:
sql_path = Path(PACKAGE_PATH, 'sql', sql_subpath).resolve()
if not sql_path.is_... | true | true |
f73b86f9e4cc03edff393d41811d7d010c0f56c4 | 14,530 | py | Python | env/Lib/site-packages/plotly/validators/scatter/marker/_symbol.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/scatter/marker/_symbol.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/scatter/marker/_symbol.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="symbol", parent_name="scatter.marker", **kwargs):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 29.53252 | 85 | 0.205024 | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="symbol", parent_name="scatter.marker", **kwargs):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f73b87003f1f33b5c18fe3c26ca7dde6b9e2dc4f | 488 | py | Python | fluent_contents/plugins/text/__init__.py | django-fluent/django-fluent-contents | 5577567303d29b56fd48128c22c7dc5d8b2c7476 | [
"Apache-2.0"
] | 82 | 2016-07-21T08:43:47.000Z | 2021-12-21T09:23:42.000Z | fluent_contents/plugins/text/__init__.py | edoburu/django-fluent-contents | 5577567303d29b56fd48128c22c7dc5d8b2c7476 | [
"Apache-2.0"
] | 47 | 2015-01-30T22:08:12.000Z | 2016-05-30T16:18:17.000Z | fluent_contents/plugins/text/__init__.py | django-fluent/django-fluent-contents | 5577567303d29b56fd48128c22c7dc5d8b2c7476 | [
"Apache-2.0"
] | 17 | 2016-09-03T05:38:52.000Z | 2020-10-04T03:19:16.000Z | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1)
backendapp = "django_wysiwyg"
# Do some settings checks.
if backendapp not in settings.INSTALLED_APPS:
raise ImproperlyConfigured(
"The '{}' application is required to use the '{}' plugin.".format(ba... | 27.111111 | 93 | 0.737705 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1)
backendapp = "django_wysiwyg"
if backendapp not in settings.INSTALLED_APPS:
raise ImproperlyConfigured(
"The '{}' application is required to use the '{}' plugin.".format(backendapp, "text")
)
t... | true | true |
f73b8744aad621c83bc30689bd82deaa31835a32 | 1,614 | py | Python | ZeroMQ/filecode/examples/Python/lvcache.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | ZeroMQ/filecode/examples/Python/lvcache.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | ZeroMQ/filecode/examples/Python/lvcache.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | #
# Last value cache
# Uses XPUB subscription messages to re-send data
#
import zmq
def main():
ctx = zmq.Context.instance()
frontend = ctx.socket(zmq.SUB)
frontend.connect("tcp://*:5557")
backend = ctx.socket(zmq.XPUB)
backend.bind("tcp://*:5558")
# Subscribe to every single topic from publi... | 28.821429 | 69 | 0.591698 |
import zmq
def main():
ctx = zmq.Context.instance()
frontend = ctx.socket(zmq.SUB)
frontend.connect("tcp://*:5557")
backend = ctx.socket(zmq.XPUB)
backend.bind("tcp://*:5558")
frontend.setsockopt(zmq.SUBSCRIBE, b"")
cache = {}
poller = zmq.Poller()
... | true | true |
f73b88263949c93addcd12986f8a49907e56b18c | 4,850 | py | Python | vibe-scraper/vibedb.py | floflo2607/anidb-anime-scraper | de9898069b4cfa51b6e231104a1f283d42130ad5 | [
"Apache-2.0"
] | null | null | null | vibe-scraper/vibedb.py | floflo2607/anidb-anime-scraper | de9898069b4cfa51b6e231104a1f283d42130ad5 | [
"Apache-2.0"
] | null | null | null | vibe-scraper/vibedb.py | floflo2607/anidb-anime-scraper | de9898069b4cfa51b6e231104a1f283d42130ad5 | [
"Apache-2.0"
] | null | null | null | # ####################################################################################################################################################
# ______ _______ _______ _ _______ _______ _ _______ _______ ______ _____
# ( __ \ ( ___ ) ( ____ ) | \ /\ ( __... | 97 | 404 | 0.499175 | true | true | |
f73b88fb9618004b2fd6a77b32afeafff1b37b33 | 3,334 | py | Python | sdk/python/pulumi_aws/get_billing_service_account.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_billing_service_account.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_billing_service_account.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities... | 29.245614 | 251 | 0.602579 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities, _tables
__all__ = [
'GetBillingServiceAccountResult',
'AwaitableGetBillingServiceAccountResult',
'get_billing_service_account',
]
@pulumi.output_type
class GetBillin... | true | true |
f73b8afeaec08209fb9a1f4a90a2f80e291bc648 | 6,359 | py | Python | datatableview/views/xeditable.py | gregneagle/sal | 74c583fb1c1b33d3201b308b147376b3dcaca33f | [
"Apache-2.0"
] | 2 | 2019-11-01T20:50:35.000Z | 2021-01-13T22:02:55.000Z | datatableview/views/xeditable.py | gregneagle/sal | 74c583fb1c1b33d3201b308b147376b3dcaca33f | [
"Apache-2.0"
] | null | null | null | datatableview/views/xeditable.py | gregneagle/sal | 74c583fb1c1b33d3201b308b147376b3dcaca33f | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
import json
import re
import operator
import logging
from ..forms import XEditableUpdateForm
from .base import DatatableView
from django import get_version
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import ensure_csrf_cookie
from django.db... | 37.627219 | 100 | 0.626356 |
import json
import re
import operator
import logging
from ..forms import XEditableUpdateForm
from .base import DatatableView
from django import get_version
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import ensure_csrf_cookie
from django.db.models import ForeignKey... | true | true |
f73b8b2b5932fa5f64fba445978b37c4d46ad40d | 2,276 | py | Python | gae/settings.py | ibagrak/algae | a11230cb41653c74e0fe9764eb8ec2c42bee1f52 | [
"MIT"
] | 3 | 2015-03-11T17:59:45.000Z | 2016-12-02T15:53:15.000Z | gae/settings.py | ibagrak/algae | a11230cb41653c74e0fe9764eb8ec2c42bee1f52 | [
"MIT"
] | null | null | null | gae/settings.py | ibagrak/algae | a11230cb41653c74e0fe9764eb8ec2c42bee1f52 | [
"MIT"
] | null | null | null | import os
from google.appengine.api.app_identity import get_default_version_hostname, get_application_id
from secrets import SESSION_KEY
if 'SERVER_SOFTWARE' in os.environ and os.environ['SERVER_SOFTWARE'].startswith('Dev'):
DEBUG = True
HOME_URL = 'http://localhost' + ':8085'
else:
DEBUG = False
HOME... | 30.756757 | 97 | 0.600615 | import os
from google.appengine.api.app_identity import get_default_version_hostname, get_application_id
from secrets import SESSION_KEY
if 'SERVER_SOFTWARE' in os.environ and os.environ['SERVER_SOFTWARE'].startswith('Dev'):
DEBUG = True
HOME_URL = 'http://localhost' + ':8085'
else:
DEBUG = False
HOME... | true | true |
f73b8c8b9a207572d1e32a32e294041c56147a7d | 1,054 | py | Python | python/scrapy-spider/tutorial/middleware/uaagent.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:30:44.000Z | 2021-01-11T06:30:44.000Z | python/scrapy-spider/tutorial/middleware/uaagent.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 23 | 2020-02-12T02:35:49.000Z | 2022-02-11T03:45:40.000Z | python/scrapy-spider/tutorial/middleware/uaagent.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 2 | 2020-04-08T15:39:46.000Z | 2020-10-10T10:13:09.000Z | # -*- coding: utf-8 -*-
import random
import logging
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
logger = logging.getLogger(__name__)
class RotateUserAgentMiddleware(UserAgentMiddleware):
"""避免被ban策略之一:使用useragent池。
使用注意:需在settings.py中进行相应的设置。
更好的方式是使用:
pip instal... | 35.133333 | 76 | 0.696395 |
import random
import logging
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
logger = logging.getLogger(__name__)
class RotateUserAgentMiddleware(UserAgentMiddleware):
def __init__(self, agents):
super(RotateUserAgentMiddleware, self).__init__()
self.agents = agent... | true | true |
f73b8d0e7a8172c2979c10a918c906cbf88ce04b | 6,117 | py | Python | deprecated/converters/nist_xray_tran_en_db_converter.py | materials-data-facility/connect | 9ec5b61750bf6fa579bf3ec122f31880d3c049b8 | [
"Apache-2.0"
] | 1 | 2019-09-13T18:35:56.000Z | 2019-09-13T18:35:56.000Z | deprecated/converters/nist_xray_tran_en_db_converter.py | materials-data-facility/connect_server | 9ec5b61750bf6fa579bf3ec122f31880d3c049b8 | [
"Apache-2.0"
] | 15 | 2018-11-01T18:08:11.000Z | 2021-12-06T17:55:03.000Z | deprecated/converters/nist_xray_tran_en_db_converter.py | materials-data-facility/connect | 9ec5b61750bf6fa579bf3ec122f31880d3c049b8 | [
"Apache-2.0"
] | 1 | 2020-11-30T17:02:41.000Z | 2020-11-30T17:02:41.000Z | import json
import sys
import os
from tqdm import tqdm
from mdf_refinery.validator import Validator
from mdf_refinery.parsers.tab_parser import parse_tab
# VERSION 0.3.0
# This is the converter for the NIST X-Ray Transition Energies Database
# Arguments:
# input_path (string): The file or directory where the data... | 36.195266 | 971 | 0.564329 | import json
import sys
import os
from tqdm import tqdm
from mdf_refinery.validator import Validator
from mdf_refinery.parsers.tab_parser import parse_tab
def convert(input_path, metadata=None, verbose=False):
if verbose:
print("Begin converting")
if not metadata:
dataset_metada... | true | true |
f73b8f287469e22057eda5b4367a4587ca687649 | 3,260 | py | Python | powerdns_recursor/tests/test_powerdns.py | andersenleo/integrations-core | e521b88e32820a286a70c7797a663d4f9ba41110 | [
"BSD-3-Clause"
] | 2 | 2019-05-28T03:48:29.000Z | 2019-07-05T07:05:58.000Z | powerdns_recursor/tests/test_powerdns.py | andersenleo/integrations-core | e521b88e32820a286a70c7797a663d4f9ba41110 | [
"BSD-3-Clause"
] | 4 | 2019-07-03T02:53:19.000Z | 2019-07-10T14:52:14.000Z | powerdns_recursor/tests/test_powerdns.py | andersenleo/integrations-core | e521b88e32820a286a70c7797a663d4f9ba41110 | [
"BSD-3-Clause"
] | 1 | 2020-01-15T16:58:51.000Z | 2020-01-15T16:58:51.000Z | # (C) Datadog, Inc. 2010-2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import pytest
from . import common, metrics
pytestmark = [pytest.mark.integration, pytest.mark.usefixtures("dd_environment")]
def test_check(aggregator, check):
service_check_tags = common._config_sc_tags(... | 37.471264 | 120 | 0.715031 |
import pytest
from . import common, metrics
pytestmark = [pytest.mark.integration, pytest.mark.usefixtures("dd_environment")]
def test_check(aggregator, check):
service_check_tags = common._config_sc_tags(common.CONFIG)
version = common._get_pdns_version()
if version == 3:
check.check(... | true | true |
f73b9086549b2aab459f315497f818e84b7f645f | 274 | py | Python | python/nxp_imu/__init__.py | MomsFriendlyRobotCompany/adafruit-precision-nxp-9-dof- | b8c39f37e0b77181d23c7095b4dc93bcd5b83a14 | [
"MIT"
] | 8 | 2018-02-25T07:39:10.000Z | 2022-02-02T01:43:52.000Z | python/nxp_imu/__init__.py | MomsFriendlyRobotCompany/adafruit-precision-nxp-9-dof- | b8c39f37e0b77181d23c7095b4dc93bcd5b83a14 | [
"MIT"
] | 5 | 2017-07-19T12:49:38.000Z | 2018-10-26T03:08:50.000Z | python/nxp_imu/__init__.py | MomsFriendlyRobotCompany/adafruit-precision-nxp-9-dof- | b8c39f37e0b77181d23c7095b4dc93bcd5b83a14 | [
"MIT"
] | 4 | 2017-11-07T17:14:38.000Z | 2021-08-17T18:15:41.000Z | from nxp_imu.I2C import I2C
from nxp_imu.IMU import IMU
# class Namespace(object):
# def __init__(self, **kwds):
# self.__dict__.update(kwds)
__version__ = '0.6.1'
__author__ = 'Kevin J. Walchko'
__license__ = 'MIT'
__copyright__ = '2017 Kevin J. Walchko'
| 21.076923 | 40 | 0.686131 | from nxp_imu.I2C import I2C
from nxp_imu.IMU import IMU
__version__ = '0.6.1'
__author__ = 'Kevin J. Walchko'
__license__ = 'MIT'
__copyright__ = '2017 Kevin J. Walchko'
| true | true |
f73b90cd360da438221b08f0e61102773f2b5a86 | 21,273 | py | Python | sdk/python/pulumi_aws/lambda_/outputs.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lambda_/outputs.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lambda_/outputs.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 40.52 | 445 | 0.689889 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
from ._enums import *
__all__ = [
'AliasRoutingConfig',
'CodeSigningConfigAllowedPublishers',
'CodeSigningConfigPolicies',
'EventSo... | true | true |
f73b90e155e1f948a2cdbad982d75178c343f236 | 2,581 | py | Python | impurity/impurity_tester.py | kevaundray/research | 16f20848c614b580071fed3d2ff1dc69688fa4f4 | [
"MIT"
] | 1,351 | 2015-09-22T08:17:10.000Z | 2022-03-31T22:48:07.000Z | impurity/impurity_tester.py | kevaundray/research | 16f20848c614b580071fed3d2ff1dc69688fa4f4 | [
"MIT"
] | 42 | 2016-08-31T14:43:29.000Z | 2021-12-05T23:10:31.000Z | impurity/impurity_tester.py | LaudateCorpus1/research | 6e8b7b367e7f1b18b4b92151df01dfeaa0774a23 | [
"MIT"
] | 334 | 2015-09-20T10:15:23.000Z | 2022-03-28T17:46:57.000Z | from ethereum import tester as t
from ethereum import utils
from ethereum import transactions
import rlp
import serpent
s = t.state()
c = s.abi_contract('check_for_impurity.se')
#from ethereum.slogging import LogRecorder, configure_logging, set_level
#config_string = ':info,eth.vm.log:trace,eth.vm.op:trace,eth.vm.stac... | 20.814516 | 127 | 0.650523 | from ethereum import tester as t
from ethereum import utils
from ethereum import transactions
import rlp
import serpent
s = t.state()
c = s.abi_contract('check_for_impurity.se')
test1 = s.abi_contract("""
data horse
def foo():
return self.horse
""")
try:
c.submit(test1.address)
success = True
excep... | true | true |
f73b920f46b7725c72ef39bd90b06520a9dbd2b0 | 14,268 | py | Python | sdk/python/pulumi_cloudflare/access_rule.py | pulumi/pulumi-cloudflare | d444af2fab6101b388a15cf2e3933e45e9935cc6 | [
"ECL-2.0",
"Apache-2.0"
] | 35 | 2019-03-14T21:29:29.000Z | 2022-03-30T00:00:59.000Z | sdk/python/pulumi_cloudflare/access_rule.py | pulumi/pulumi-cloudflare | d444af2fab6101b388a15cf2e3933e45e9935cc6 | [
"ECL-2.0",
"Apache-2.0"
] | 128 | 2019-03-08T23:45:58.000Z | 2022-03-31T21:05:22.000Z | sdk/python/pulumi_cloudflare/access_rule.py | pulumi/pulumi-cloudflare | d444af2fab6101b388a15cf2e3933e45e9935cc6 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2019-05-10T12:52:56.000Z | 2020-03-24T15:02:14.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 44.448598 | 186 | 0.651248 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *
__all__ = ['AccessRuleArgs', 'AccessRule']
@pulumi.input_type
class AccessRuleArgs:
def __init__(__self__, *,
... | true | true |
f73b92740682e2a96e9119cd7935cc8c606e5abc | 2,479 | py | Python | setup.py | p-boaz/docassemble-graphletter | 38969ea3acc0dd6c913f99faad85567e8731e767 | [
"MIT"
] | null | null | null | setup.py | p-boaz/docassemble-graphletter | 38969ea3acc0dd6c913f99faad85567e8731e767 | [
"MIT"
] | null | null | null | setup.py | p-boaz/docassemble-graphletter | 38969ea3acc0dd6c913f99faad85567e8731e767 | [
"MIT"
] | null | null | null | import os
import sys
from setuptools import setup, find_packages
from fnmatch import fnmatchcase
from distutils.util import convert_path
standard_exclude = ('*.pyc', '*~', '.*', '*.bak', '*.swp*')
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info')
def find_package_dat... | 40.639344 | 143 | 0.546591 | import os
import sys
from setuptools import setup, find_packages
from fnmatch import fnmatchcase
from distutils.util import convert_path
standard_exclude = ('*.pyc', '*~', '.*', '*.bak', '*.swp*')
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info')
def find_package_dat... | true | true |
f73b93ab910858ada11953806a0efea7fb62c984 | 688 | py | Python | syntacticstrutting/migrations/0002_auto_20180316_1526.py | notkrd/languagegames | d0d5a0a0673c039de4f699c1fe5cfd60b8eeaa70 | [
"MIT"
] | null | null | null | syntacticstrutting/migrations/0002_auto_20180316_1526.py | notkrd/languagegames | d0d5a0a0673c039de4f699c1fe5cfd60b8eeaa70 | [
"MIT"
] | null | null | null | syntacticstrutting/migrations/0002_auto_20180316_1526.py | notkrd/languagegames | d0d5a0a0673c039de4f699c1fe5cfd60b8eeaa70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-03-16 22:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('syntacticstrutting', '0001_initial'),
]
operations = [
migrat... | 26.461538 | 115 | 0.56686 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('syntacticstrutting', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='SyntaxToxen',
fields=[
... | true | true |
f73b93b1d7918f3c5b8ba827750cd7b57f8d1a6a | 7,911 | py | Python | folium_maps.py | AlchemistPrimus/data_crunchers_knbs | b6d5a73bdbfed3f4a99e7047bd0747f3653a7fd2 | [
"MIT"
] | null | null | null | folium_maps.py | AlchemistPrimus/data_crunchers_knbs | b6d5a73bdbfed3f4a99e7047bd0747f3653a7fd2 | [
"MIT"
] | null | null | null | folium_maps.py | AlchemistPrimus/data_crunchers_knbs | b6d5a73bdbfed3f4a99e7047bd0747f3653a7fd2 | [
"MIT"
] | null | null | null | # Importing the necessary libraries
import pandas as pd
import geopandas as gpd
import fiona
import matplotlib.pyplot as plt
import folium
import os
from folium.plugins import StripePattern
dir=os.path.dirname("/home/ado/Desktop/new_datacranchers/data_crunchers_knbs/app/data_processing/open_source_data_values/folium_m... | 44.694915 | 494 | 0.69435 |
import pandas as pd
import geopandas as gpd
import fiona
import matplotlib.pyplot as plt
import folium
import os
from folium.plugins import StripePattern
dir=os.path.dirname("/home/ado/Desktop/new_datacranchers/data_crunchers_knbs/app/data_processing/open_source_data_values/folium_maps_data/")
core_healthworkforce ... | true | true |
f73b93defe6ee4a59d12ac0a35ff6e564397e369 | 3,830 | py | Python | src/python/twitter/common/git/__init__.py | zhouyijiaren/commons | 10df6fb63547baa9047782aa7ad4edf354914b10 | [
"Apache-2.0"
] | 1,143 | 2015-01-05T04:19:24.000Z | 2019-12-11T12:02:23.000Z | src/python/twitter/common/git/__init__.py | zhouyijiaren/commons | 10df6fb63547baa9047782aa7ad4edf354914b10 | [
"Apache-2.0"
] | 144 | 2015-01-06T05:05:07.000Z | 2019-12-12T18:02:37.000Z | src/python/twitter/common/git/__init__.py | zhouyijiaren/commons | 10df6fb63547baa9047782aa7ad4edf354914b10 | [
"Apache-2.0"
] | 426 | 2015-01-08T08:33:41.000Z | 2019-12-09T13:15:40.000Z | # ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 34.196429 | 103 | 0.663185 |
from __future__ import print_function
import contextlib
from twitter.common.lang import Compatibility
import git
__all__ = (
'DirtyRepositoryError',
'branch',
'checkout',
)
class DirtyRepositoryError(Exception):
def __init__(self, branch=None):
super(DirtyRepositoryError, self).__init__... | true | true |
f73b9404900e5880147a1838a38652cc7c29e1c3 | 413 | py | Python | annotation_project/wsgi.py | meisin/annotation_project | 158e33b86eef05e6e11a09938149d6f9737eec2c | [
"MIT"
] | null | null | null | annotation_project/wsgi.py | meisin/annotation_project | 158e33b86eef05e6e11a09938149d6f9737eec2c | [
"MIT"
] | null | null | null | annotation_project/wsgi.py | meisin/annotation_project | 158e33b86eef05e6e11a09938149d6f9737eec2c | [
"MIT"
] | null | null | null | """
WSGI config for annotation_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('D... | 24.294118 | 78 | 0.79661 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'annotation_project.settings')
application = get_wsgi_application()
| true | true |
f73b951c5372de73def2e8f15ff4ec2835e78330 | 505 | py | Python | exoplanets/models.py | zemogle/astropony | fc82f4398ddb2bebcce3bf0dc600eb0171392a1a | [
"MIT"
] | null | null | null | exoplanets/models.py | zemogle/astropony | fc82f4398ddb2bebcce3bf0dc600eb0171392a1a | [
"MIT"
] | null | null | null | exoplanets/models.py | zemogle/astropony | fc82f4398ddb2bebcce3bf0dc600eb0171392a1a | [
"MIT"
] | null | null | null | from django.db import models
class Mission(models.Model):
name = models.CharField(max_length=200)
start_date = models.DateTimeField('date discovered')
def __unicode__(self):
return self.name
class Planet(models.Model):
name = models.CharField(max_length=200)
discovery_date = models.DateT... | 25.25 | 60 | 0.708911 | from django.db import models
class Mission(models.Model):
name = models.CharField(max_length=200)
start_date = models.DateTimeField('date discovered')
def __unicode__(self):
return self.name
class Planet(models.Model):
name = models.CharField(max_length=200)
discovery_date = models.DateT... | true | true |
f73b96ad5235bf6c02bb882592c8fa46f4320505 | 722 | py | Python | tests/test_classifier_evaluator.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 351 | 2016-01-27T19:15:27.000Z | 2022-03-09T15:40:56.000Z | tests/test_classifier_evaluator.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 37 | 2016-03-16T03:57:59.000Z | 2021-06-26T14:02:33.000Z | tests/test_classifier_evaluator.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 30 | 2016-01-27T19:27:08.000Z | 2022-03-31T06:09:59.000Z | from sklearn_evaluation import ClassifierEvaluator
# import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
def test_can_plot():
data = datasets.make_classification(200,
... | 28.88 | 76 | 0.635734 | from sklearn_evaluation import ClassifierEvaluator
from sklearn import datasets
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
def test_can_plot():
data = datasets.make_classification(200,
10,
... | true | true |
f73b96b04bd569769b47b3ebd11ac480cc73ca36 | 687 | py | Python | Upload/app.py | bitshop/sam-PresignedS3Trigger | 8ea435e8a4aaff0fefda5df802b78a43aaee6422 | [
"MIT"
] | null | null | null | Upload/app.py | bitshop/sam-PresignedS3Trigger | 8ea435e8a4aaff0fefda5df802b78a43aaee6422 | [
"MIT"
] | null | null | null | Upload/app.py | bitshop/sam-PresignedS3Trigger | 8ea435e8a4aaff0fefda5df802b78a43aaee6422 | [
"MIT"
] | null | null | null | import requests
import pprint
# Configuration:
# filename = file to upload
filename='app.py'
# url = GET API for presigning
url = "https://vqdrwi0ee1.execute-api.us-east-1.amazonaws.com/Prod/PreSign"
# Get presign response
result = requests.get(url).json()
# Print some debug information
pp = pprint.PrettyPrinter(in... | 25.444444 | 96 | 0.724891 | import requests
import pprint
filename='app.py'
url = "https://vqdrwi0ee1.execute-api.us-east-1.amazonaws.com/Prod/PreSign"
result = requests.get(url).json()
pp = pprint.PrettyPrinter(indent=4)
print ("Result from URL:")
pp.pprint(result)
print ("Send to: {}".format(result['url']))
presign = result['url']
... | true | true |
f73b96dca5565331f69bd92053d81d92907d09dd | 330 | py | Python | AdventOfCode/2020/day1/day1-pt1.py | neiesc/Problem-solving | d3bce7a3b9801e6049e2c135418b31cba47b0964 | [
"MIT"
] | 1 | 2019-07-20T16:59:21.000Z | 2019-07-20T16:59:21.000Z | AdventOfCode/2020/day1/day1-pt1.py | neiesc/Problem-solving | d3bce7a3b9801e6049e2c135418b31cba47b0964 | [
"MIT"
] | 5 | 2019-03-10T19:46:42.000Z | 2020-04-24T22:42:30.000Z | AdventOfCode/2020/day1/day1-pt1.py | neiesc/Problem-solving | d3bce7a3b9801e6049e2c135418b31cba47b0964 | [
"MIT"
] | null | null | null | with open("input.txt", "r") as f:
lines = f.readlines()
for line1 in lines:
for line2 in lines:
total = int(line1) + int(line2)
if total == 2020:
print(f"line1: {line1}")
print(f"line2: {line2}")
print(f"Multiply: {int(line1) * int... | 36.666667 | 61 | 0.481818 | with open("input.txt", "r") as f:
lines = f.readlines()
for line1 in lines:
for line2 in lines:
total = int(line1) + int(line2)
if total == 2020:
print(f"line1: {line1}")
print(f"line2: {line2}")
print(f"Multiply: {int(line1) * int... | true | true |
f73b9778f6a9ffca618825b57fbf365955dc0ccb | 18,705 | py | Python | youtube_dl/extractor/xhamster.py | jonyg80/youtube-dl | ef3a87fb77891329de1d3dbebfee53bf50645261 | [
"Unlicense"
] | 66,635 | 2019-03-10T21:34:18.000Z | 2022-03-31T23:50:31.000Z | youtube_dl/extractor/xhamster.py | jonyg80/youtube-dl | ef3a87fb77891329de1d3dbebfee53bf50645261 | [
"Unlicense"
] | 10,936 | 2019-03-10T21:35:47.000Z | 2022-03-31T23:46:52.000Z | youtube_dl/extractor/xhamster.py | jonyg80/youtube-dl | ef3a87fb77891329de1d3dbebfee53bf50645261 | [
"Unlicense"
] | 15,194 | 2019-03-10T21:09:27.000Z | 2022-03-31T22:13:49.000Z | from __future__ import unicode_literals
import itertools
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
clean_html,
determine_ext,
dict_get,
extract_attributes,
ExtractorError,
float_or_none,
int_or_none,
parse_duration,
str_or_non... | 41.474501 | 117 | 0.493077 | from __future__ import unicode_literals
import itertools
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
clean_html,
determine_ext,
dict_get,
extract_attributes,
ExtractorError,
float_or_none,
int_or_none,
parse_duration,
str_or_non... | true | true |
f73b987d0a8e022b4becf7575abd9d18a796cfb7 | 1,004 | py | Python | image-superresolution/esrgan/utils/__init__.py | AaratiAkkapeddi/nnabla-examples | db9e5ad850303c158773aeb275e5c3821b4a3935 | [
"Apache-2.0"
] | 228 | 2017-11-20T06:05:56.000Z | 2022-03-23T12:40:05.000Z | image-superresolution/esrgan/utils/__init__.py | AaratiAkkapeddi/nnabla-examples | db9e5ad850303c158773aeb275e5c3821b4a3935 | [
"Apache-2.0"
] | 36 | 2018-01-11T23:26:20.000Z | 2022-03-12T00:53:38.000Z | image-superresolution/esrgan/utils/__init__.py | AaratiAkkapeddi/nnabla-examples | db9e5ad850303c158773aeb275e5c3821b4a3935 | [
"Apache-2.0"
] | 76 | 2017-11-22T22:00:00.000Z | 2022-03-28T05:58:57.000Z | # Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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 ... | 40.16 | 74 | 0.776892 |
from __future__ import absolute_import
import os
import sys
common_utils_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'utils'))
sys.path.append(common_utils_path)
from neu.yaml_wrapper import read_yaml
from neu.misc import AttrDict
from neu.comm import Communicator... | true | true |
f73b98c8bfa98fc01ddb7670ed85ac605935cf32 | 1,629 | py | Python | chapter5/encoding.py | arifmudi/Python-Machine-Learning-By-Example-Third-Edition | 7bdc45df2b519e3c0a929b03f0ac6fe30e028382 | [
"MIT"
] | 49 | 2020-03-21T08:37:46.000Z | 2022-02-01T12:48:23.000Z | chapter5/encoding.py | hmoharrer/Python-Machine-Learning-By-Example-Third-Edition | 7bdc45df2b519e3c0a929b03f0ac6fe30e028382 | [
"MIT"
] | 2 | 2021-03-28T17:25:57.000Z | 2021-04-05T18:14:55.000Z | chapter5/encoding.py | hmoharrer/Python-Machine-Learning-By-Example-Third-Edition | 7bdc45df2b519e3c0a929b03f0ac6fe30e028382 | [
"MIT"
] | 40 | 2020-05-02T18:30:00.000Z | 2022-02-27T09:15:16.000Z | '''
Source codes for Python Machine Learning By Example 3rd Edition (Packt Publishing)
Chapter 5 Predicting Online Ads Click-through with Logistic Regression
Author: Yuxi (Hayden) Liu (yuxi.liu.ece@gmail.com)
'''
from sklearn.feature_extraction import DictVectorizer
X_dict = [{'interest': 'tech', 'occupation': 'prof... | 31.941176 | 82 | 0.646409 |
from sklearn.feature_extraction import DictVectorizer
X_dict = [{'interest': 'tech', 'occupation': 'professional'},
{'interest': 'fashion', 'occupation': 'student'},
{'interest': 'fashion', 'occupation': 'professional'},
{'interest': 'sports', 'occupation': 'student'},
{'inter... | true | true |
f73b98e2459f56c6b379b085fbdce346491ea5d3 | 77,537 | py | Python | subversion-1.8.9_3/subversion/tests/cmdline/svntest/main.py | Ranga123/test1 | e13f4063961ddcfc3f6e86d1643dafb6249383c8 | [
"Apache-2.0"
] | null | null | null | subversion-1.8.9_3/subversion/tests/cmdline/svntest/main.py | Ranga123/test1 | e13f4063961ddcfc3f6e86d1643dafb6249383c8 | [
"Apache-2.0"
] | null | null | null | subversion-1.8.9_3/subversion/tests/cmdline/svntest/main.py | Ranga123/test1 | e13f4063961ddcfc3f6e86d1643dafb6249383c8 | [
"Apache-2.0"
] | 1 | 2020-11-04T07:25:22.000Z | 2020-11-04T07:25:22.000Z | #
# main.py: a shared, automated test suite for Subversion
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more cont... | 36.677862 | 90 | 0.654268 |
@]+$')
def _quote_arg(arg):
"""Quote ARG for a command line.
Return a quoted version of the string ARG, or just ARG if it contains
only universally harmless characters.
WARNING: This function cannot handle arbitrary command-line
arguments: it is just good enough for what we need here... | false | true |
f73b9b4cf767cc6d6f020ce79bbd368c2eb1d942 | 2,250 | py | Python | heron/tools/cli/src/python/help.py | pjfanning/incubator-heron | 7db7c24733bd7e66ecfe704ea65f864d1fff4adc | [
"Apache-2.0"
] | 3,348 | 2016-05-25T16:04:31.000Z | 2018-03-28T17:46:14.000Z | heron/tools/cli/src/python/help.py | pjfanning/incubator-heron | 7db7c24733bd7e66ecfe704ea65f864d1fff4adc | [
"Apache-2.0"
] | 1,542 | 2016-05-25T16:46:44.000Z | 2018-03-29T17:30:23.000Z | heron/tools/cli/src/python/help.py | pjfanning/incubator-heron | 7db7c24733bd7e66ecfe704ea65f864d1fff4adc | [
"Apache-2.0"
] | 702 | 2016-05-25T16:07:43.000Z | 2018-03-27T06:31:07.000Z | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apach... | 30.405405 | 66 | 0.723111 |
from heron.common.src.python.utils.log import Log
from heron.tools.cli.src.python.result import SimpleResult, Status
from heron.tools.common.src.python.utils import config
def create_parser(subparsers):
parser = subparsers.add_parser(
'help',
help='Prints help for commands',
add... | true | true |
f73b9ba8b769400e549052d9f210b3d340c18d2d | 5,239 | py | Python | Python/Vote.py | amitShindeGit/Miscellaneous-Programs | 11aa892628f44b51a8723d5f282d64f867b01be2 | [
"MIT"
] | 3 | 2020-11-01T05:48:04.000Z | 2021-04-25T05:33:47.000Z | Python/Vote.py | amitShindeGit/Miscellaneous-Programs | 11aa892628f44b51a8723d5f282d64f867b01be2 | [
"MIT"
] | null | null | null | Python/Vote.py | amitShindeGit/Miscellaneous-Programs | 11aa892628f44b51a8723d5f282d64f867b01be2 | [
"MIT"
] | 3 | 2020-10-31T05:29:55.000Z | 2021-06-19T09:33:53.000Z | '''
TCS Codevita Question, 2020
Elections are going on, and there are two candidates A and B, contesting with each other. There is a queue of voters and in this queue some of them are supporters of A and some of them are supporters of B. Many of them are neutral. The fate of the election will be decided on which si... | 40.3 | 397 | 0.671693 |
n=int(input())
i=list(input())
ac=bc=temp=0
latest=[0]
for j in range(n):
if (i[j]=="A" or i[j]=="B"):
latest.append(i[j])
if i[j] == "A":
if (j-1) >= 0:
if (i[j-1] == "-" and (latest[-2] == "A" or latest[-2] == 0)):
ac+=temp+1
else:
... | true | true |
f73b9c28d257bb8ca18da403effc773363ed61fe | 2,158 | py | Python | examples/010_logs_and_prints.py | montefiore-ai/clustertools | ecb63afded2aff2370f54312b0336c28b531b6af | [
"BSD-3-Clause"
] | 7 | 2017-05-31T15:28:28.000Z | 2021-03-25T12:36:48.000Z | examples/010_logs_and_prints.py | montefiore-ai/clustertools | ecb63afded2aff2370f54312b0336c28b531b6af | [
"BSD-3-Clause"
] | 42 | 2017-06-09T07:35:50.000Z | 2019-08-29T15:23:29.000Z | examples/010_logs_and_prints.py | montefiore-ai/clustertools | ecb63afded2aff2370f54312b0336c28b531b6af | [
"BSD-3-Clause"
] | 3 | 2017-05-29T13:39:18.000Z | 2019-06-24T09:43:01.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
When running computations on the background or through a scheduler such as
Slurm, print statement are lost. Although you can redirect the standard outputs
in the former case, the procedure is not as straightforward in the latter case.
Fortunately, Clustertools offers ... | 31.275362 | 80 | 0.661724 |
from clustertools import Computation, CTParser, ParameterSet, \
Experiment, set_stdout_logging
class MyComputation(Computation):
def run(self, result, x, z, w, y=2, **parameters):
import time
from datetime import datetime
from random import randint
print(repr(sel... | true | true |
f73b9c3ba83e00c7aab05b51c2ed203551075aa0 | 97 | py | Python | python/testData/addImport/localFromImport.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/addImport/localFromImport.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/addImport/localFromImport.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def func():
for _ range(10):
from package.module import foo
foo
# <ref> | 19.4 | 38 | 0.515464 | def func():
for _ range(10):
from package.module import foo
foo
| false | true |
f73b9c6f4d7eebe9e6b33fa98a1f56b71aeab19e | 3,647 | py | Python | sdk/python/pulumi_azure_nextgen/containerregistry/get_build_step.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/containerregistry/get_build_step.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/containerregistry/get_build_step.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 32.274336 | 134 | 0.639978 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
__all__ = [
'GetBuildStepResult',
'AwaitableGetBuildStepResult',
'get_build_step',
]
@pulumi.output_type
class GetBuildStepResult:
... | true | true |
f73b9d6623e4d92f66f56427571a87ef28b089c1 | 2,439 | py | Python | pipert/contrib/routines/face_detection.py | Elon-Abulafia/PipeRT | fba46d67a6dd546a9d70c3d854c3b7d3910f82ba | [
"MIT"
] | null | null | null | pipert/contrib/routines/face_detection.py | Elon-Abulafia/PipeRT | fba46d67a6dd546a9d70c3d854c3b7d3910f82ba | [
"MIT"
] | null | null | null | pipert/contrib/routines/face_detection.py | Elon-Abulafia/PipeRT | fba46d67a6dd546a9d70c3d854c3b7d3910f82ba | [
"MIT"
] | null | null | null | import torch
from pipert import Routine
from pipert.core.message import Message
from pipert.core.routine import RoutineTypes
from pipert.utils.structures import Instances, Boxes
from queue import Empty
import time
import cv2
import pkg_resources
class FaceDetection(Routine):
routine_type = RoutineTypes.PROCESSING... | 31.269231 | 101 | 0.585076 | import torch
from pipert import Routine
from pipert.core.message import Message
from pipert.core.routine import RoutineTypes
from pipert.utils.structures import Instances, Boxes
from queue import Empty
import time
import cv2
import pkg_resources
class FaceDetection(Routine):
routine_type = RoutineTypes.PROCESSING... | true | true |
f73b9d8531c50a0be0abdb652d380f1c2b226a1c | 8,219 | py | Python | Project_Data Warehouse/sql_queries.py | yumengdong/Data-Engineer-Nanodegree-Udacity | 9fff4ccc088263049d5842f89174f335142bcb60 | [
"MIT"
] | null | null | null | Project_Data Warehouse/sql_queries.py | yumengdong/Data-Engineer-Nanodegree-Udacity | 9fff4ccc088263049d5842f89174f335142bcb60 | [
"MIT"
] | null | null | null | Project_Data Warehouse/sql_queries.py | yumengdong/Data-Engineer-Nanodegree-Udacity | 9fff4ccc088263049d5842f89174f335142bcb60 | [
"MIT"
] | null | null | null | import configparser
# CONFIG
config = configparser.ConfigParser()
config.read('dwh.cfg')
IAM_ROLE = config['IAM_ROLE']['ARN']
LOG_DATA = config['S3']['LOG_DATA']
SONG_DATA = config['S3']['SONG_DATA']
LOG_JSONPATH = config['S3']['LOG_JSONPATH']
# DROP TABLES
staging_events_table_drop = "DROP TABLE IF EXISTS stagin... | 46.435028 | 181 | 0.453218 | import configparser
config = configparser.ConfigParser()
config.read('dwh.cfg')
IAM_ROLE = config['IAM_ROLE']['ARN']
LOG_DATA = config['S3']['LOG_DATA']
SONG_DATA = config['S3']['SONG_DATA']
LOG_JSONPATH = config['S3']['LOG_JSONPATH']
staging_events_table_drop = "DROP TABLE IF EXISTS staging_events_table"
stagi... | true | true |
f73ba0a3eca9cf1cc7c88a2392cf00c719ba3621 | 8,729 | py | Python | setup.py | vstinner/greenlet | fa91f03d5ec8d46017300cb6b161ec3dbe0d3a0c | [
"PSF-2.0",
"MIT"
] | 1 | 2021-12-21T18:56:12.000Z | 2021-12-21T18:56:12.000Z | setup.py | sthagen/greenlet | fa91f03d5ec8d46017300cb6b161ec3dbe0d3a0c | [
"PSF-2.0",
"MIT"
] | null | null | null | setup.py | sthagen/greenlet | fa91f03d5ec8d46017300cb6b161ec3dbe0d3a0c | [
"PSF-2.0",
"MIT"
] | null | null | null | #! /usr/bin/env python
from __future__ import print_function
import sys
import os
import glob
import platform
# distutils is deprecated and vendored into setuptools now.
from setuptools import setup
from setuptools import Extension
from setuptools import find_packages
# Extra compiler arguments passed to *all* extens... | 38.96875 | 104 | 0.655631 |
from __future__ import print_function
import sys
import os
import glob
import platform
from setuptools import setup
from setuptools import Extension
from setuptools import find_packages
global_compile_args = []
cpp_compile_args = []
cpp_link_args = []
main_compile_args = []
is_linux = sys.platform.star... | true | true |
f73ba1260f6c61ae598472db10d540a6958cc696 | 4,421 | py | Python | apps/fastrunner/adminx.py | fairain/FasterRunner | 56e287bf0e45f0c31ac9a7dc6a4893d312088a11 | [
"MIT"
] | 19 | 2019-05-29T02:33:27.000Z | 2021-05-01T01:48:35.000Z | apps/fastrunner/adminx.py | fairain/FasterRunner | 56e287bf0e45f0c31ac9a7dc6a4893d312088a11 | [
"MIT"
] | 3 | 2020-06-06T01:08:24.000Z | 2021-06-10T22:25:19.000Z | apps/fastrunner/adminx.py | fairain/FasterRunner | 56e287bf0e45f0c31ac9a7dc6a4893d312088a11 | [
"MIT"
] | 6 | 2019-08-07T01:43:20.000Z | 2021-04-20T01:51:36.000Z | # -*- coding: utf-8 -*-
import xadmin
from xadmin import views
from .models import Project, Config, API, Case, CaseStep, HostIP, Variables, Report, ModelWithFileField, Pycode
from djcelery.models import TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule, TaskMeta
class BaseSetting(object):
e... | 40.190909 | 111 | 0.689437 |
import xadmin
from xadmin import views
from .models import Project, Config, API, Case, CaseStep, HostIP, Variables, Report, ModelWithFileField, Pycode
from djcelery.models import TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule, TaskMeta
class BaseSetting(object):
enable_themes = True
... | true | true |
f73ba15148396433a160c8f2ad8cfdd25970f355 | 788 | py | Python | leetcode/algorithms/decode-ways.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | 2 | 2017-02-17T01:40:27.000Z | 2018-04-22T12:47:28.000Z | leetcode/algorithms/decode-ways.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | null | null | null | leetcode/algorithms/decode-ways.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | 1 | 2016-10-14T06:00:42.000Z | 2016-10-14T06:00:42.000Z | # https://leetcode.com/problems/decode-ways/
import string
import fileinput
from typing import Dict
class Solution:
MAPPING = dict(zip(map(str, range(1, 28)), string.ascii_uppercase))
def _numDecodings(self, s: str, mem: Dict[str, int]) -> int:
if s in mem:
return mem[s]
mem[s]... | 24.625 | 71 | 0.573604 |
import string
import fileinput
from typing import Dict
class Solution:
MAPPING = dict(zip(map(str, range(1, 28)), string.ascii_uppercase))
def _numDecodings(self, s: str, mem: Dict[str, int]) -> int:
if s in mem:
return mem[s]
mem[s] = 0
if len(s) >= 1 and s[:1] in sel... | true | true |
f73ba15bafc8d6ae0d62d795f37def44009aa0d3 | 8,945 | py | Python | delfin/drivers/hpe/hpe_3par/rest_handler.py | joseph-v/SIM | 61fedb261aa745d715b8a30c0945a6244fb807e2 | [
"Apache-2.0"
] | 4 | 2020-04-10T03:48:55.000Z | 2020-04-27T07:52:55.000Z | delfin/drivers/hpe/hpe_3par/rest_handler.py | joseph-v/SIM | 61fedb261aa745d715b8a30c0945a6244fb807e2 | [
"Apache-2.0"
] | 210 | 2020-05-08T04:06:49.000Z | 2020-06-22T12:59:02.000Z | delfin/drivers/hpe/hpe_3par/rest_handler.py | joseph-v/SIM | 61fedb261aa745d715b8a30c0945a6244fb807e2 | [
"Apache-2.0"
] | 10 | 2020-04-11T07:09:55.000Z | 2020-04-28T09:50:13.000Z | # Copyright 2020 The SODA Authors.
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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.ap... | 39.579646 | 79 | 0.555953 |
import threading
import six
from oslo_log import log as logging
from delfin import cryptor
from delfin import exception
from delfin.drivers.hpe.hpe_3par import consts
from delfin.drivers.utils.tools import Tools
LOG = logging.getLogger(__name__)
class RestHandler(object):
REST_AUTH_URL = '/api/... | true | true |
f73ba186175834f99c30359a8cd3f218441c1611 | 3,296 | py | Python | setup.py | ckmessi/alfred | 48f85f43ee89d4370e1ef5a5ce1158dffc0596d4 | [
"Apache-2.0"
] | 1 | 2022-01-05T01:19:52.000Z | 2022-01-05T01:19:52.000Z | setup.py | ckmessi/alfred | 48f85f43ee89d4370e1ef5a5ce1158dffc0596d4 | [
"Apache-2.0"
] | null | null | null | setup.py | ckmessi/alfred | 48f85f43ee89d4370e1ef5a5ce1158dffc0596d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2020 JinTian.
#
# This file is part of alfred
# (see http://jinfagang.github.io).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding co... | 33.979381 | 86 | 0.624393 |
from setuptools import setup, find_packages
from setuptools import setup, Extension
import io
from os import path
this_directory = path.abspath(path.dirname(__file__))
with io.open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='alfre... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.