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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f701d938aba4d8300cacab21080c0e69d8ac18c8 | 2,597 | py | Python | day05.py | spgill/AdventOfCode2021 | 58218062d64de12dac9761a30a1f9762d9a9ab6e | [
"MIT"
] | null | null | null | day05.py | spgill/AdventOfCode2021 | 58218062d64de12dac9761a30a1f9762d9a9ab6e | [
"MIT"
] | null | null | null | day05.py | spgill/AdventOfCode2021 | 58218062d64de12dac9761a30a1f9762d9a9ab6e | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
### stdlib imports
import pathlib
### local imports
import utils
@utils.part1
def part1(puzzleInput: str):
# Parse the coordinate pairs from the puzzle input
coordList = [
[
tuple(int(coord) for coord in pair.split(","))
for pair in line.split(" -> ")
... | 32.4625 | 99 | 0.58298 |
put: str):
coordList = [
[
tuple(int(coord) for coord in pair.split(","))
for pair in line.split(" -> ")
]
for line in puzzleInput.strip().splitlines()
]
part1Grid: dict[tuple[int, int], int] = {}
part2Grid: dict[tuple[int, int], int] = {}
... | true | true |
f701d957a50072dc59b5c2758115c26fdfc2caf8 | 2,245 | py | Python | database/api/ticket.py | aprilsanchez/ictf-framework | 2d37b5632b8ca8a4d90a9d84d689a023d19033cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | database/api/ticket.py | aprilsanchez/ictf-framework | 2d37b5632b8ca8a4d90a9d84d689a023d19033cf | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2022-01-13T03:58:43.000Z | 2022-03-12T01:01:29.000Z | database/api/ticket.py | aprilsanchez/ictf-framework | 2d37b5632b8ca8a4d90a9d84d689a023d19033cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from flask import request, abort, jsonify
from . import app, mysql
from utils import requires_auth
@requires_auth
@app.route("/tickets/add", methods=['POST'])
def submit_ticket():
team_id = request.form.get("team_id")
subject = request.form.get("sub... | 28.0625 | 96 | 0.628508 |
import json
from flask import request, abort, jsonify
from . import app, mysql
from utils import requires_auth
@requires_auth
@app.route("/tickets/add", methods=['POST'])
def submit_ticket():
team_id = request.form.get("team_id")
subject = request.form.get("subject")
msg = request.form.get("message")... | true | true |
f701da916352cb9069d9c0e76375bee26e2ffece | 3,959 | py | Python | quark/plugin_modules/routes.py | Cerberus98/quark | 53848e357a1b4d5d23f565963f22115d8997e38f | [
"Apache-2.0"
] | null | null | null | quark/plugin_modules/routes.py | Cerberus98/quark | 53848e357a1b4d5d23f565963f22115d8997e38f | [
"Apache-2.0"
] | null | null | null | quark/plugin_modules/routes.py | Cerberus98/quark | 53848e357a1b4d5d23f565963f22115d8997e38f | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Openstack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 40.397959 | 78 | 0.674665 |
import netaddr
from neutron.common import exceptions
from neutron import quota
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from quark import allocation_pool
from quark.db import api as db_api
from quark.db import models as db_models
from quark impor... | true | true |
f701da983fde9db5d64162d83f52c871e82c9ed0 | 17,783 | py | Python | rootfs/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_legendre.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | null | null | null | rootfs/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_legendre.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | null | null | null | rootfs/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_legendre.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | null | null | null | """Tests for legendre module.
"""
import numpy as np
import numpy.polynomial.legendre as leg
import numpy.polynomial.polynomial as poly
from numpy.testing import *
P0 = np.array([ 1])
P1 = np.array([ 0, 1])
P2 = np.array([-1, 0, 3])/2
P3 = np.array([ 0, -3, 0, 5])/2
P4 = np.array([ 3, 0, -30, 0, 35... | 33.053903 | 75 | 0.506495 |
import numpy as np
import numpy.polynomial.legendre as leg
import numpy.polynomial.polynomial as poly
from numpy.testing import *
P0 = np.array([ 1])
P1 = np.array([ 0, 1])
P2 = np.array([-1, 0, 3])/2
P3 = np.array([ 0, -3, 0, 5])/2
P4 = np.array([ 3, 0, -30, 0, 35])/8
P5 = np.array([ 0, 15, 0, ... | true | true |
f701dacd676f4efb3f3647cf1a9e39a5a8d89d55 | 3,508 | py | Python | google/ads/googleads/v6/services/services/google_ads_field_service/pagers.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/google_ads_field_service/pagers.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/google_ads_field_service/pagers.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.549451 | 101 | 0.691847 |
from typing import Any, Callable, Iterable, Sequence, Tuple
from google.ads.googleads.v6.resources.types import google_ads_field
from google.ads.googleads.v6.services.types import google_ads_field_service
class SearchGoogleAdsFieldsPager:
def __init__(
self,
method: Callable[
... | true | true |
f701dad2f113506e9b75c3b55da16c8042f59e05 | 869 | py | Python | torchmetrics/functional/audio/__init__.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 1 | 2021-09-14T23:34:48.000Z | 2021-09-14T23:34:48.000Z | torchmetrics/functional/audio/__init__.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 1 | 2021-10-16T05:02:56.000Z | 2021-12-15T07:02:17.000Z | torchmetrics/functional/audio/__init__.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 2 | 2021-10-16T05:02:43.000Z | 2022-02-10T16:01:52.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 48.277778 | 78 | 0.779056 |
from torchmetrics.functional.audio.pit import pit, pit_permutate
from torchmetrics.functional.audio.si_sdr import si_sdr
from torchmetrics.functional.audio.si_snr import si_snr
from torchmetrics.functional.audio.snr import snr
| true | true |
f701dbb60581a894fa82d654ad38824ba276b7a5 | 4,113 | py | Python | model/seg_models/pspnet.py | AceCoooool/segmentation | 2f4d5ac193cab580eb8ba789e79db6dadcfecfd0 | [
"MIT"
] | 2 | 2019-06-08T13:09:08.000Z | 2020-09-21T04:03:09.000Z | model/seg_models/pspnet.py | AceCoooool/segmentation | 2f4d5ac193cab580eb8ba789e79db6dadcfecfd0 | [
"MIT"
] | 2 | 2019-05-20T11:56:02.000Z | 2019-06-02T13:22:55.000Z | model/seg_models/pspnet.py | AceCoooool/segmentation | 2f4d5ac193cab580eb8ba789e79db6dadcfecfd0 | [
"MIT"
] | 1 | 2020-09-22T03:55:39.000Z | 2020-09-22T03:55:39.000Z | """Pyramid Scene Parsing Network"""
import os
import torch
from torch import nn
import torch.nn.functional as F
from model.seg_models.segbase import SegBaseModel
from model.module.basic import _FCNHead
__all__ = ['PSPNet', 'get_psp',
'get_psp_resnet101_voc',
'get_psp_resnet101_citys']
# head
d... | 36.39823 | 106 | 0.644299 | import os
import torch
from torch import nn
import torch.nn.functional as F
from model.seg_models.segbase import SegBaseModel
from model.module.basic import _FCNHead
__all__ = ['PSPNet', 'get_psp',
'get_psp_resnet101_voc',
'get_psp_resnet101_citys']
def _PSP1x1Conv(in_channels, out_channels):... | true | true |
f701dc4aceb91f10edb6c0bfa86f3db68e475953 | 14,857 | py | Python | mechanicalsoup/stateful_browser.py | timgates42/MechanicalSoup | 0b04e8b9aed3a3e5160ac89081e2c270598c2f09 | [
"MIT"
] | null | null | null | mechanicalsoup/stateful_browser.py | timgates42/MechanicalSoup | 0b04e8b9aed3a3e5160ac89081e2c270598c2f09 | [
"MIT"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | mechanicalsoup/stateful_browser.py | timgates42/MechanicalSoup | 0b04e8b9aed3a3e5160ac89081e2c270598c2f09 | [
"MIT"
] | null | null | null | from __future__ import print_function
from six.moves import urllib
from .browser import Browser
from .utils import LinkNotFoundError
from .form import Form
import sys
import re
import bs4
class _BrowserState:
def __init__(self, page=None, url=None, form=None, request=None):
self.page = page
self.... | 39.408488 | 97 | 0.609006 | from __future__ import print_function
from six.moves import urllib
from .browser import Browser
from .utils import LinkNotFoundError
from .form import Form
import sys
import re
import bs4
class _BrowserState:
def __init__(self, page=None, url=None, form=None, request=None):
self.page = page
self.... | true | true |
f701dd00d32a4f319dc0dfd776cf299128e400bf | 781 | py | Python | authDemo/python/mongo_sandbox.py | borro0/Remote-BatterlylessSensorTestbed | caea8bd9490d55f86de31761b1cc8712b3ebf06d | [
"MIT"
] | null | null | null | authDemo/python/mongo_sandbox.py | borro0/Remote-BatterlylessSensorTestbed | caea8bd9490d55f86de31761b1cc8712b3ebf06d | [
"MIT"
] | null | null | null | authDemo/python/mongo_sandbox.py | borro0/Remote-BatterlylessSensorTestbed | caea8bd9490d55f86de31761b1cc8712b3ebf06d | [
"MIT"
] | null | null | null | from pymongo import MongoClient
from bson.objectid import ObjectId
import pprint
client = MongoClient()
db = client.auth_demo
collection = db.users
#myquery = {"local": {"testRuns": {"$elemMatch": {"_id": ObjectId("5c6c119e5724c9272ca7266d")}}}}
#myquery = {"local": {"testRuns": {"date": "20190219"}}}
#myquery = {"l... | 30.038462 | 97 | 0.699104 | from pymongo import MongoClient
from bson.objectid import ObjectId
import pprint
client = MongoClient()
db = client.auth_demo
collection = db.users
myquery = {"testRuns._id" : ObjectId('5c6d70ce5e0ee62337b47db3')}
newvalues = { "$set": { "local.testRuns.$.status": "done" } }
collection.update_one(myquery, ... | true | true |
f701dd084a73bcb11656e05d04be88875e0a57a1 | 184 | py | Python | ps2/test_Lect7.py | John-L-Jones-IV/6.0001 | e58620b7fd59aa369c6d75071311d2930b669d8e | [
"MIT"
] | null | null | null | ps2/test_Lect7.py | John-L-Jones-IV/6.0001 | e58620b7fd59aa369c6d75071311d2930b669d8e | [
"MIT"
] | null | null | null | ps2/test_Lect7.py | John-L-Jones-IV/6.0001 | e58620b7fd59aa369c6d75071311d2930b669d8e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from Lect7 import *
def test_abs():
""" Unit test for abs() """
failure = False
if not failure:
print('SUCESS')
print('Testing abs()...')
test_abs()
| 15.333333 | 29 | 0.619565 |
from Lect7 import *
def test_abs():
failure = False
if not failure:
print('SUCESS')
print('Testing abs()...')
test_abs()
| true | true |
f701de2c1d23a64551fa8d5ea8b116d1515678bb | 1,407 | py | Python | generator.py | akshay482/Discord-Token-Bruteforcer-Helper | b51845b145f8de867eb9e5ee152829803d104807 | [
"MIT"
] | 7 | 2021-05-17T22:36:39.000Z | 2021-11-29T13:00:28.000Z | generator.py | akshay482/Discord-Token-Bruteforcer-Helper | b51845b145f8de867eb9e5ee152829803d104807 | [
"MIT"
] | 4 | 2021-03-11T22:52:47.000Z | 2022-03-18T20:10:57.000Z | generator.py | akshay482/Discord-Token-Bruteforcer-Helper | b51845b145f8de867eb9e5ee152829803d104807 | [
"MIT"
] | 21 | 2021-03-21T13:07:12.000Z | 2022-03-27T14:50:33.000Z | import ctypes, os, threading, strgen, base64
tokenid = "4030200023"
class Discord:
def __init__(self):
self.regularExpression = ".([a-zA-Z0-9]{6})\.([a-zA-Z0-9]{27})" # This is the regular expression for discord.
self.generated = 0
def generate(self):
discordToken = strgen.S... | 34.317073 | 118 | 0.618337 | import ctypes, os, threading, strgen, base64
tokenid = "4030200023"
class Discord:
def __init__(self):
self.regularExpression = ".([a-zA-Z0-9]{6})\.([a-zA-Z0-9]{27})"
self.generated = 0
def generate(self):
discordToken = strgen.StringGenerator(self.regularExpression).render(... | true | true |
f701de88c351c8b4d1ced5a28d63e4d979a67525 | 164 | py | Python | library/forms.py | Elcaveman/Universias | 252a4bdaabbaa723d5afa9a070efd33c5d37ec87 | [
"MIT"
] | null | null | null | library/forms.py | Elcaveman/Universias | 252a4bdaabbaa723d5afa9a070efd33c5d37ec87 | [
"MIT"
] | 8 | 2021-03-19T03:06:36.000Z | 2022-01-13T02:41:19.000Z | library/forms.py | Elcaveman/Universias | 252a4bdaabbaa723d5afa9a070efd33c5d37ec87 | [
"MIT"
] | null | null | null | from django import forms
from .models import Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
exclude = ('timestamp' ,'owner')
| 16.4 | 40 | 0.652439 | from django import forms
from .models import Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
exclude = ('timestamp' ,'owner')
| true | true |
f701df068b2f136d27f5c1dacf5a101cbdf4bc52 | 2,388 | py | Python | search_tool.py | PabloEmidio/Findout-in-Comment | d57fab1e9333290366619f3fb0542708af53234c | [
"MIT"
] | 7 | 2021-05-28T11:23:10.000Z | 2021-11-16T11:09:18.000Z | search_tool.py | PabloEmidio/Findout-in-Comment | d57fab1e9333290366619f3fb0542708af53234c | [
"MIT"
] | null | null | null | search_tool.py | PabloEmidio/Findout-in-Comment | d57fab1e9333290366619f3fb0542708af53234c | [
"MIT"
] | 1 | 2021-08-02T02:45:08.000Z | 2021-08-02T02:45:08.000Z | import parsel, requests, asyncio, re
from typing import List
class InComment:
def __init__(self, optional_words: List[str]=[], remove_words: List[str]=[]) -> None:
self.might_sensitive_words = [
'user',
'password',
'import',
'login',
'.php',
... | 37.904762 | 125 | 0.567839 | import parsel, requests, asyncio, re
from typing import List
class InComment:
def __init__(self, optional_words: List[str]=[], remove_words: List[str]=[]) -> None:
self.might_sensitive_words = [
'user',
'password',
'import',
'login',
'.php',
... | true | true |
f701df2d6c3bb3e37f1bcdb97765f18418e63e7b | 2,302 | py | Python | homeassistant/components/supervisord/sensor.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/supervisord/sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/supervisord/sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Sensor for Supervisord process status."""
import logging
import xmlrpc.client
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_URL
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
ATTR... | 28.775 | 86 | 0.662467 | import logging
import xmlrpc.client
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_URL
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
ATTR_DESCRIPTION = "description"
ATTR_GROUP = "gr... | true | true |
f701df6b7161b3abc24aeed5c7a185b8b3c69e8c | 2,342 | py | Python | app/api/routes/transfer.py | cPoolChia/ChiaAutoplotter-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | 7 | 2021-06-01T09:20:34.000Z | 2021-10-12T07:24:04.000Z | app/api/routes/transfer.py | cPoolChia/ChiaFarmerManager-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | null | null | null | app/api/routes/transfer.py | cPoolChia/ChiaFarmerManager-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | 1 | 2021-05-31T13:08:14.000Z | 2021-05-31T13:08:14.000Z | from app.schemas import filtration
from typing import Any
from uuid import UUID, uuid4
import celery
from datetime import datetime, timedelta
from app import crud, models, schemas
from app.celery import celery as celery_app
from app.api import deps
from app.core.config import settings
from app.utils import auth
from a... | 37.174603 | 86 | 0.727583 | from app.schemas import filtration
from typing import Any
from uuid import UUID, uuid4
import celery
from datetime import datetime, timedelta
from app import crud, models, schemas
from app.celery import celery as celery_app
from app.api import deps
from app.core.config import settings
from app.utils import auth
from a... | true | true |
f701dfb05b4e2b1468d4835338476d9029415eab | 1,686 | py | Python | src/get_5_five_letter_words.py | Masa-Shin/make-4-five-letter-words-without-repetition | 102de6a0eaaaa59086e351b7af44861ad63dcce6 | [
"MIT"
] | 3 | 2022-02-02T22:15:27.000Z | 2022-02-04T13:01:00.000Z | src/get_5_five_letter_words.py | Masa-Shin/make-4-five-letter-words-without-repetition- | 102de6a0eaaaa59086e351b7af44861ad63dcce6 | [
"MIT"
] | null | null | null | src/get_5_five_letter_words.py | Masa-Shin/make-4-five-letter-words-without-repetition- | 102de6a0eaaaa59086e351b7af44861ad63dcce6 | [
"MIT"
] | 1 | 2022-02-17T20:46:41.000Z | 2022-02-17T20:46:41.000Z | import re
import time
import json
import numpy as np
from collections import Counter
from utilities.utilities import VOWELS, LETTERS, get_vowel_count, get_available_words, log_list
start = time.time()
# 正解単語リストを開く
with open('data/answer-word-list.txt', mode='r') as f:
answer_word_list = f.read().split('\n')
# 入力... | 31.222222 | 95 | 0.675563 | import re
import time
import json
import numpy as np
from collections import Counter
from utilities.utilities import VOWELS, LETTERS, get_vowel_count, get_available_words, log_list
start = time.time()
with open('data/answer-word-list.txt', mode='r') as f:
answer_word_list = f.read().split('\n')
with open('data... | true | true |
f701dfdb741a6485ded2f00f3d7adc9bb8d37b17 | 8,773 | py | Python | homeassistant/components/glances/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/glances/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/glances/sensor.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Support gathering system information of hosts which are running glances."""
import logging
from homeassistant.const import CONF_NAME, STATE_UNAVAILABLE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from ... | 37.978355 | 84 | 0.493788 | import logging
from homeassistant.const import CONF_NAME, STATE_UNAVAILABLE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import DATA_UPDATED, DOMAIN, SENSOR_TYPES
_LOGGER = logging.getLogger(_... | true | true |
f701e15de95b18608b398cedc0243f079d79d203 | 8,082 | py | Python | dvc/external_repo.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | null | null | null | dvc/external_repo.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 81 | 2021-04-13T08:02:09.000Z | 2022-03-30T16:10:17.000Z | dvc/external_repo.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 2 | 2021-06-14T19:12:25.000Z | 2021-06-14T19:12:29.000Z | import logging
import os
import tempfile
import threading
from contextlib import contextmanager
from typing import Dict
from funcy import retry, wrap_with
from dvc.exceptions import (
FileMissingError,
NoOutputInExternalRepoError,
NoRemoteInExternalRepoError,
NotDvcRepoError,
OutputNotFoundError,
... | 30.730038 | 78 | 0.607152 | import logging
import os
import tempfile
import threading
from contextlib import contextmanager
from typing import Dict
from funcy import retry, wrap_with
from dvc.exceptions import (
FileMissingError,
NoOutputInExternalRepoError,
NoRemoteInExternalRepoError,
NotDvcRepoError,
OutputNotFoundError,
... | true | true |
f701e16a8bd60c349e5ada9ef3d576de5a949a72 | 366 | py | Python | app/account/urls.py | GeoffMahugu/django-blog-backend | f77b8ebda4267f30757ebedd531c485a16cbf9c3 | [
"MIT"
] | null | null | null | app/account/urls.py | GeoffMahugu/django-blog-backend | f77b8ebda4267f30757ebedd531c485a16cbf9c3 | [
"MIT"
] | null | null | null | app/account/urls.py | GeoffMahugu/django-blog-backend | f77b8ebda4267f30757ebedd531c485a16cbf9c3 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import AuthorSignupView, AuthorList, AuthorDetailView
urlpatterns = [
url(r'^$', AuthorList.as_view(), name='author-list'),
url(r'^(?P<pk>\d+)/$', AuthorDetailView, name='author-rud'),
url(r'^signup/... | 36.6 | 65 | 0.726776 | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import AuthorSignupView, AuthorList, AuthorDetailView
urlpatterns = [
url(r'^$', AuthorList.as_view(), name='author-list'),
url(r'^(?P<pk>\d+)/$', AuthorDetailView, name='author-rud'),
url(r'^signup/... | true | true |
f701e246974e360051eafba0655fea735ddd49d1 | 4,012 | py | Python | tests/test_modeler.py | joanvaquer/SDV | 83e4fdf0ff72e6c5b72cfc8c6ec9584dbd34de28 | [
"MIT"
] | null | null | null | tests/test_modeler.py | joanvaquer/SDV | 83e4fdf0ff72e6c5b72cfc8c6ec9584dbd34de28 | [
"MIT"
] | null | null | null | tests/test_modeler.py | joanvaquer/SDV | 83e4fdf0ff72e6c5b72cfc8c6ec9584dbd34de28 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import Mock, call
import pandas as pd
from sdv.metadata import Metadata
from sdv.modeler import Modeler
from sdv.models.base import SDVModel
from sdv.models.copulas import GaussianCopula
class TestModeler(TestCase):
def test___init__default(self):
"""Tes... | 34.886957 | 94 | 0.620887 | from unittest import TestCase
from unittest.mock import Mock, call
import pandas as pd
from sdv.metadata import Metadata
from sdv.modeler import Modeler
from sdv.models.base import SDVModel
from sdv.models.copulas import GaussianCopula
class TestModeler(TestCase):
def test___init__default(self):
... | true | true |
f701e2724db3063e715cbb18755d4cc1f682a147 | 404 | py | Python | project2/tests/q2_1_3.py | DrRossTaylor/intro-DS-Assignments | 88f0747b89869cae4e4227e6f3a936f0f1583937 | [
"CC0-1.0"
] | null | null | null | project2/tests/q2_1_3.py | DrRossTaylor/intro-DS-Assignments | 88f0747b89869cae4e4227e6f3a936f0f1583937 | [
"CC0-1.0"
] | null | null | null | project2/tests/q2_1_3.py | DrRossTaylor/intro-DS-Assignments | 88f0747b89869cae4e4227e6f3a936f0f1583937 | [
"CC0-1.0"
] | null | null | null | test = {
'name': 'q2_1_3',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> np.isclose(distance_from_batman_returns('titanic'), 0.0023550202650824965)
True
""",
'hidden': False,
'locked': False
}
],
'scored':... | 17.565217 | 88 | 0.398515 | test = {
'name': 'q2_1_3',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> np.isclose(distance_from_batman_returns('titanic'), 0.0023550202650824965)
True
""",
'hidden': False,
'locked': False
}
],
'scored':... | true | true |
f701e5714469931c76e895573715c567623da2a7 | 13,446 | py | Python | tests.py | vishalsodani/deal | da3b06da2f7c463431fd5d674b9762133e9296a3 | [
"MIT"
] | null | null | null | tests.py | vishalsodani/deal | da3b06da2f7c463431fd5d674b9762133e9296a3 | [
"MIT"
] | null | null | null | tests.py | vishalsodani/deal | da3b06da2f7c463431fd5d674b9762133e9296a3 | [
"MIT"
] | null | null | null | import unittest
from typing import NoReturn
import marshmallow
import urllib3
import vaa
import deal
import pytest
class TestPreDeal:
@pytest.mark.parametrize('correct,incorrect', [(1, -1), (2, -2), (3, -3), (5, -5), (7, -7), (11, -11)])
def test_pre_contract_fulfilled(self, correct, incorrect):
fun... | 28.487288 | 109 | 0.562175 | import unittest
from typing import NoReturn
import marshmallow
import urllib3
import vaa
import deal
import pytest
class TestPreDeal:
@pytest.mark.parametrize('correct,incorrect', [(1, -1), (2, -2), (3, -3), (5, -5), (7, -7), (11, -11)])
def test_pre_contract_fulfilled(self, correct, incorrect):
fun... | true | true |
f701e5ba1cf40d87257e9a32a37af0b6e506bd69 | 5,565 | py | Python | pykeyatome/client.py | jugla/pyKeyAtome | 2ea833f54f95c15279254565e912e4036869b139 | [
"MIT"
] | 1 | 2021-12-21T23:08:58.000Z | 2021-12-21T23:08:58.000Z | pykeyatome/client.py | jugla/pyKeyAtome | 2ea833f54f95c15279254565e912e4036869b139 | [
"MIT"
] | 1 | 2022-01-26T21:40:34.000Z | 2022-01-27T01:10:43.000Z | pykeyatome/client.py | jugla/pyKeyAtome | 2ea833f54f95c15279254565e912e4036869b139 | [
"MIT"
] | null | null | null | """Class client for atome protocol."""
import json
import logging
import requests
import simplejson
from fake_useragent import UserAgent
# export const
DAILY_PERIOD_TYPE = "day"
WEEKLY_PERIOD_TYPE = "week"
MONTHLY_PERIOD_TYPE = "month"
YEARLY_PERIOD_TYPE = "year"
# internal const
COOKIE_NAME = "PHPSESSID"
API_BASE_... | 27.825 | 109 | 0.554537 | import json
import logging
import requests
import simplejson
from fake_useragent import UserAgent
DAILY_PERIOD_TYPE = "day"
WEEKLY_PERIOD_TYPE = "week"
MONTHLY_PERIOD_TYPE = "month"
YEARLY_PERIOD_TYPE = "year"
COOKIE_NAME = "PHPSESSID"
API_BASE_URI = "https://esoftlink.esoftthings.com"
API_ENDPOINT_LOGIN = "/api/... | true | true |
f701e753de84fad7ebd01a4470ae510c0c88bfb2 | 870 | py | Python | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class WhenDirectivesFalse(Package):
"""Package that tests False when specs on directives."""
... | 33.461538 | 84 | 0.697701 |
from spack import *
class WhenDirectivesFalse(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/example-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
patch('https://example.com/foo.patch',
sha256='abcd1234abcd1234abcd1234abcd1234abcd1234abcd... | true | true |
f701e9169b162fe7563cb382ae08c1a558adaba4 | 1,100 | py | Python | cache.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 2 | 2019-10-31T15:18:06.000Z | 2021-02-13T00:14:07.000Z | cache.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 1 | 2019-10-21T21:23:02.000Z | 2019-10-21T21:23:02.000Z | cache.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 3 | 2020-01-20T21:46:10.000Z | 2021-05-27T09:49:54.000Z | import numpy as np
import math
class Cache():
def __init__(self, max_size=10):
self.cache = []
self.size = 0
self.max_size=max_size
def add(self, element):
self.cache.append(element)
self.size+=1
if self.size > self.max_size:
del self.cache[0]
... | 21.153846 | 52 | 0.564545 | import numpy as np
import math
class Cache():
def __init__(self, max_size=10):
self.cache = []
self.size = 0
self.max_size=max_size
def add(self, element):
self.cache.append(element)
self.size+=1
if self.size > self.max_size:
del self.cache[0]
... | true | true |
f701e93ad73088654fd6b538457d54c52ecec092 | 22,885 | py | Python | Src/Scripts/generate_exceptions.py | 0xFireball/exascript2 | f6c69ac41f8fa1e5e9e42a677717e85b9ff9d0c3 | [
"Apache-2.0"
] | null | null | null | Src/Scripts/generate_exceptions.py | 0xFireball/exascript2 | f6c69ac41f8fa1e5e9e42a677717e85b9ff9d0c3 | [
"Apache-2.0"
] | null | null | null | Src/Scripts/generate_exceptions.py | 0xFireball/exascript2 | f6c69ac41f8fa1e5e9e42a677717e85b9ff9d0c3 | [
"Apache-2.0"
] | 1 | 2019-09-18T05:37:46.000Z | 2019-09-18T05:37:46.000Z | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | 45.678643 | 224 | 0.590387 | ),
),
ExceptionInfo('SyntaxError', 'Microsoft.Scripting.SyntaxErrorException', None, ('text', 'print_file_and_line', 'filename', 'lineno', 'offset', 'msg'), (
ExceptionInfo('IndentationError', 'IronPyt... | true | true |
f701e9411422a12eaa72972194de87ab9163810c | 27,768 | py | Python | dask/array/tests/test_slicing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2018-12-29T13:47:40.000Z | 2018-12-29T13:47:49.000Z | dask/array/tests/test_slicing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2019-03-19T22:19:04.000Z | 2019-03-26T19:04:00.000Z | dask/array/tests/test_slicing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 1 | 2021-11-05T10:06:27.000Z | 2021-11-05T10:06:27.000Z | import itertools
from operator import getitem
import pytest
from toolz import merge
np = pytest.importorskip('numpy')
import dask
import dask.array as da
from dask.array.slicing import (_sanitize_index_element, _slice_1d,
new_blockdim, sanitize_index, slice_array,
... | 33.334934 | 97 | 0.509327 | import itertools
from operator import getitem
import pytest
from toolz import merge
np = pytest.importorskip('numpy')
import dask
import dask.array as da
from dask.array.slicing import (_sanitize_index_element, _slice_1d,
new_blockdim, sanitize_index, slice_array,
... | true | true |
f701e9533dc1976894d91db2b7c579ad252ba370 | 4,438 | py | Python | zag/examples/distance_calculator.py | ToolsForHumans/taskflow | ce13d65e70213cb50ef19a714581997793b4e5fb | [
"Apache-2.0"
] | 1 | 2018-11-06T16:17:21.000Z | 2018-11-06T16:17:21.000Z | zag/examples/distance_calculator.py | ToolsForHumans/zag | ce13d65e70213cb50ef19a714581997793b4e5fb | [
"Apache-2.0"
] | 45 | 2018-11-07T21:35:55.000Z | 2021-01-08T06:26:50.000Z | zag/examples/distance_calculator.py | ToolsForHumans/taskflow | ce13d65e70213cb50ef19a714581997793b4e5fb | [
"Apache-2.0"
] | 3 | 2018-11-05T16:07:45.000Z | 2019-09-01T07:52:16.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
#
# 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/... | 40.345455 | 78 | 0.557008 |
import collections
import math
import os
import sys
top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.pardir,
os.pardir))
sys.path.insert(0, top_dir)
from zag import engines
from zag.patterns import linear... | true | true |
f701eae7d9153c4940a9de47ed79a004e74e6560 | 33,232 | py | Python | correlcalc/antpcf.py | rohinkumar/CorrelCalc | d7887448af8d3dc3170c00c0aae6ee2561b8a3d5 | [
"MIT"
] | null | null | null | correlcalc/antpcf.py | rohinkumar/CorrelCalc | d7887448af8d3dc3170c00c0aae6ee2561b8a3d5 | [
"MIT"
] | null | null | null | correlcalc/antpcf.py | rohinkumar/CorrelCalc | d7887448af8d3dc3170c00c0aae6ee2561b8a3d5 | [
"MIT"
] | null | null | null | __author__ = 'Rohin Kumar Y'
# Calculate anisotropic 2pCF
from tpcf import *
import scipy as sp
# antpcf(dat,datR,bins,parmetric,permetric) returns numpy 2d array DD, RR, DR correl
# poserr(xi,DD) returns (1.0+xi)/np.sqrt(DD)
def atpcf(datfile, binspar, binsper, **kwargs):
"""Main function to calculate anisotro... | 41.748744 | 401 | 0.604327 | __author__ = 'Rohin Kumar Y'
from tpcf import *
import scipy as sp
def atpcf(datfile, binspar, binsper, **kwargs):
global binsparv
global binsperv
global maxrad
global dat
global datR
global Nd
global Nr
DD = DR = RD = RR = np.zeros((len(binspar)-1, len(binsper)-1))
weigh... | true | true |
f701eb659d29808c9a1f074f5e5d862a3df1c0a1 | 4,076 | py | Python | tests/test_resource_synchronization.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | 6 | 2019-11-14T08:12:08.000Z | 2021-04-08T11:13:35.000Z | tests/test_resource_synchronization.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | 16 | 2019-06-25T16:44:13.000Z | 2022-02-15T18:05:28.000Z | tests/test_resource_synchronization.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | 8 | 2019-07-03T08:28:26.000Z | 2021-07-12T08:11:53.000Z | """Test package."""
import shapely.geometry
import simpy
import openclsim.core as core
import openclsim.model as model
from .test_utils import assert_log
def test_test_resource_synchronization():
"""Test resource Synchronization."""
simulation_start = 0
my_env = simpy.Environment(initial_time=simulati... | 25.63522 | 82 | 0.569676 |
import shapely.geometry
import simpy
import openclsim.core as core
import openclsim.model as model
from .test_utils import assert_log
def test_test_resource_synchronization():
simulation_start = 0
my_env = simpy.Environment(initial_time=simulation_start)
registry = {}
Site = type(
"Site",... | true | true |
f701ebc777f0e75bb15805fc60c334c03e73cfd1 | 590 | py | Python | Hello-producer/producer.py | mydevground/ApacheKafkaPython | 96da0e5d0294a9823776f9622fca6a3b46ff06bb | [
"MIT"
] | 5 | 2021-06-06T13:25:47.000Z | 2022-01-16T15:48:22.000Z | Hello-producer/producer.py | mydevground/ApacheKafkaPython | 96da0e5d0294a9823776f9622fca6a3b46ff06bb | [
"MIT"
] | null | null | null | Hello-producer/producer.py | mydevground/ApacheKafkaPython | 96da0e5d0294a9823776f9622fca6a3b46ff06bb | [
"MIT"
] | 2 | 2021-09-21T17:34:18.000Z | 2021-10-01T21:40:10.000Z | from confluent_kafka import Producer
import socket
if __name__ == '__main__':
print("Starting Kafka Producer")
producer_config = {'client.id': socket.gethostname(),
'bootstrap.servers': 'localhost:9092'}
print("Creating Producer")
producer = Producer(producer_config)
print... | 28.095238 | 96 | 0.640678 | from confluent_kafka import Producer
import socket
if __name__ == '__main__':
print("Starting Kafka Producer")
producer_config = {'client.id': socket.gethostname(),
'bootstrap.servers': 'localhost:9092'}
print("Creating Producer")
producer = Producer(producer_config)
print... | true | true |
f701ec8d1673c733a95290013d8b9a3737b4b8a1 | 35,290 | py | Python | pytests/security/SecretsMgmtTests.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | pytests/security/SecretsMgmtTests.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | pytests/security/SecretsMgmtTests.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | from membase.api.rest_client import RestConnection, RestHelper
import urllib.request, urllib.parse, urllib.error
import json
from remote.remote_util import RemoteMachineShellConnection, RemoteMachineHelper
from newupgradebasetest import NewUpgradeBaseTest
from security.auditmain import audit
import subprocess
import so... | 58.330579 | 144 | 0.662992 | from membase.api.rest_client import RestConnection, RestHelper
import urllib.request, urllib.parse, urllib.error
import json
from remote.remote_util import RemoteMachineShellConnection, RemoteMachineHelper
from newupgradebasetest import NewUpgradeBaseTest
from security.auditmain import audit
import subprocess
import so... | true | true |
f701ece674622dd3e1e9f5d4513a6d4ada63ad22 | 246 | py | Python | test_app/urls.py | arielcalzadadeveloper/django-test-app | c304d3be20f0280405229635fc01bce6f5732383 | [
"MIT"
] | null | null | null | test_app/urls.py | arielcalzadadeveloper/django-test-app | c304d3be20f0280405229635fc01bce6f5732383 | [
"MIT"
] | null | null | null | test_app/urls.py | arielcalzadadeveloper/django-test-app | c304d3be20f0280405229635fc01bce6f5732383 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from test_app.views.home import Home
from test_app.views.ajax import Ajax
app_name = "test_app"
urlpatterns = [
url(regex=r"^$", view=Home, name="home"),
url(regex=r"^ajax$", view=Ajax, name="ajax"),
]
| 20.5 | 49 | 0.691057 | from django.conf.urls import url
from test_app.views.home import Home
from test_app.views.ajax import Ajax
app_name = "test_app"
urlpatterns = [
url(regex=r"^$", view=Home, name="home"),
url(regex=r"^ajax$", view=Ajax, name="ajax"),
]
| true | true |
f701ed7fcc38600056f8b02f2241a501d702625b | 598 | py | Python | watchmen/common/security/algorithm/algorithm_date.py | Insurance-Metrics-Measure-Advisory/watchman-data-connector | 8ecab0c5b28174f1611e51deba8d94a42f53d51d | [
"MIT"
] | 125 | 2021-03-13T07:39:46.000Z | 2022-02-28T03:14:17.000Z | pipeline/common/security/algorithm/algorithm_date.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | null | null | null | pipeline/common/security/algorithm/algorithm_date.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | 17 | 2021-03-13T07:31:58.000Z | 2021-05-20T09:38:02.000Z | import arrow
def __mask_day(date_str):
return date_str[:8] + "**"
def __mask_month(date_str):
return date_str[:5] + "**" + date_str[7:]
def encrypt_day(value_, params=None):
date = arrow.get(value_)
date_str = date.format('YYYY-MM-DD')
return __mask_day(date_str)
def encrypt_month(value_, pa... | 21.357143 | 45 | 0.685619 | import arrow
def __mask_day(date_str):
return date_str[:8] + "**"
def __mask_month(date_str):
return date_str[:5] + "**" + date_str[7:]
def encrypt_day(value_, params=None):
date = arrow.get(value_)
date_str = date.format('YYYY-MM-DD')
return __mask_day(date_str)
def encrypt_month(value_, pa... | true | true |
f701ee0891de92a9e4c2d1f4a5f6b50e45dc2dab | 1,048 | py | Python | bot.py | ijoosong/pycascadediscordbot | 2a04bc021165c5310d65428332862a4852009d92 | [
"MIT"
] | 1 | 2022-02-05T18:37:59.000Z | 2022-02-05T18:37:59.000Z | bot.py | ijoosong/pycascadediscordbot | 2a04bc021165c5310d65428332862a4852009d92 | [
"MIT"
] | null | null | null | bot.py | ijoosong/pycascadediscordbot | 2a04bc021165c5310d65428332862a4852009d92 | [
"MIT"
] | null | null | null | import discord
import config
import requests
client = discord.Client()
@client.event
async def on_ready():
for guild_id in client.guilds:
if guild_id.name == config.DISCORD_GUILD_NAME:
break
print(
f'{client.user} is connected to {guild_id.name}(id: {guild_id.id})'
... | 32.75 | 109 | 0.666031 | import discord
import config
import requests
client = discord.Client()
@client.event
async def on_ready():
for guild_id in client.guilds:
if guild_id.name == config.DISCORD_GUILD_NAME:
break
print(
f'{client.user} is connected to {guild_id.name}(id: {guild_id.id})'
... | true | true |
f701f070e1babd894c04e750b2e0413d9f6581a5 | 779 | py | Python | deskbookingsystem42/users/migrations/0002_auto_20210907_1827.py | rollinger/deskbooking42 | bb032148fce9f36ac3ac8e57a59783a394d5c17c | [
"MIT"
] | 1 | 2021-09-03T19:01:16.000Z | 2021-09-03T19:01:16.000Z | deskbookingsystem42/users/migrations/0002_auto_20210907_1827.py | rollinger/deskbooking42 | bb032148fce9f36ac3ac8e57a59783a394d5c17c | [
"MIT"
] | 1 | 2022-03-30T18:21:27.000Z | 2022-03-30T18:21:27.000Z | deskbookingsystem42/users/migrations/0002_auto_20210907_1827.py | rollinger/deskbooking42 | bb032148fce9f36ac3ac8e57a59783a394d5c17c | [
"MIT"
] | 1 | 2021-09-05T13:45:05.000Z | 2021-09-05T13:45:05.000Z | # Generated by Django 3.1.13 on 2021-09-07 16:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Role',
fie... | 28.851852 | 122 | 0.591784 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Role',
fields=[
('id', models.AutoField(au... | true | true |
f701f0b73b4b02efa8588306921412084c0c3993 | 4,217 | py | Python | kittycad/api/file/create_file_conversion.py | KittyCAD/kittycad.py | 7f7460d366dbd55fce50e5faa4a032b62e4baae4 | [
"MIT"
] | 1 | 2022-02-06T05:07:25.000Z | 2022-02-06T05:07:25.000Z | kittycad/api/file/create_file_conversion.py | KittyCAD/kittycad.py | 7f7460d366dbd55fce50e5faa4a032b62e4baae4 | [
"MIT"
] | 7 | 2022-02-04T11:29:25.000Z | 2022-03-07T01:37:26.000Z | kittycad/api/file/create_file_conversion.py | KittyCAD/kittycad.py | 7f7460d366dbd55fce50e5faa4a032b62e4baae4 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...models.file_conversion_output_format import FileConversionOutputFormat
from ...models.file_conversion_sourc... | 31.237037 | 239 | 0.77235 | from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...models.file_conversion_output_format import FileConversionOutputFormat
from ...models.file_conversion_sourc... | true | true |
f701f15d445c5d00ebc440579ff2c5e6d88fda23 | 428 | py | Python | students/k3343/laboratory_works/Zhabrovets_Ekaterina/laboratory_work_1/workshops/migrations/0007_workshop_name.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3343/laboratory_works/Zhabrovets_Ekaterina/laboratory_work_1/workshops/migrations/0007_workshop_name.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3343/laboratory_works/Zhabrovets_Ekaterina/laboratory_work_1/workshops/migrations/0007_workshop_name.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | # Generated by Django 3.0.5 on 2020-04-14 19:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0006_auto_20200414_2235'),
]
operations = [
migrations.AddField(
model_name='workshop',
name='name',
... | 22.526316 | 92 | 0.614486 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0006_auto_20200414_2235'),
]
operations = [
migrations.AddField(
model_name='workshop',
name='name',
field=models.CharField(default='kkkk'... | true | true |
f701f1abff83536a090c2e94d28527084e8c64b6 | 64,646 | py | Python | tests/admin_widgets/tests.py | ronpad/django | 312174f9730cd594980de58e6b9db32cbdebf4ba | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2020-09-11T10:43:58.000Z | 2021-03-04T15:31:40.000Z | tests/admin_widgets/tests.py | fabioruicci/django | 6efc35b4fe3009666e56a60af0675d7d532bf4ff | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | tests/admin_widgets/tests.py | fabioruicci/django | 6efc35b4fe3009666e56a60af0675d7d532bf4ff | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2021-07-19T08:16:56.000Z | 2021-07-19T08:16:56.000Z | import gettext
import os
import re
from datetime import datetime, timedelta
from importlib import import_module
import pytz
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.tests import AdminSeleniumTestCase
f... | 44.522039 | 119 | 0.63891 | import gettext
import os
import re
from datetime import datetime, timedelta
from importlib import import_module
import pytz
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.tests import AdminSeleniumTestCase
f... | true | true |
f701f1d7ecfbfea55fbc17179f0299931e6d1dd5 | 11,669 | py | Python | extra/tsfresh_examples/tsfresh/feature_selection/feature_selector.py | davidcrowland/layer_vb_tagging | 83865d67b7a931a9eff4ba6fd4d033b2219225f1 | [
"MIT"
] | null | null | null | extra/tsfresh_examples/tsfresh/feature_selection/feature_selector.py | davidcrowland/layer_vb_tagging | 83865d67b7a931a9eff4ba6fd4d033b2219225f1 | [
"MIT"
] | null | null | null | extra/tsfresh_examples/tsfresh/feature_selection/feature_selector.py | davidcrowland/layer_vb_tagging | 83865d67b7a931a9eff4ba6fd4d033b2219225f1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
"""
Contains a feature selection method that evaluates the importance of the different extracted features. To do so,
for ev... | 41.824373 | 119 | 0.675208 |
from __future__ import absolute_import, division, print_function
from functools import partial
from builtins import zip
from builtins import range
import os
import numpy as np
import pandas as pd
import logging
from multiprocessing import Pool
from tsfresh.feature_selection.significance_tests import target_binary... | true | true |
f701f1faed6d0b007d0b45d55a30e12c9f632cc2 | 7,403 | py | Python | docs/conf.py | coordt/django-faq | 1aa924ee5806dd8611fcf4a83ec46182b191ab60 | [
"BSD-3-Clause"
] | 1 | 2019-06-14T15:29:49.000Z | 2019-06-14T15:29:49.000Z | docs/conf.py | natgeosociety/django-faq | 1aa924ee5806dd8611fcf4a83ec46182b191ab60 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | natgeosociety/django-faq | 1aa924ee5806dd8611fcf4a83ec46182b191ab60 | [
"BSD-3-Clause"
] | 1 | 2016-05-05T21:56:37.000Z | 2016-05-05T21:56:37.000Z | # -*- coding: utf-8 -*-
#
# django-faq documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 17 13:09:21 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 32.612335 | 80 | 0.717142 |
import sys, os
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
intersphinx_mapping = {
'python': ('http://python.readthedocs.org/en/latest/', None),
'django': ('http://django.readthedocs.org/en/latest/', None),
'sphinx': ('http://sphinx.readthedocs.org/en/latest/', None),
... | true | true |
f701f30df1fc51076dcd0f5de3aeec82d2c612ae | 7,050 | py | Python | Statistical Methods and Data Analysis/Module 2 Assignment/venv/lib/python3.8/site-packages/matplotlib/tests/test_backends_interactive.py | ZohaibZ/DataScience | ba06c724293f8674375827bdf2d4f42d32788ebb | [
"MIT"
] | 9 | 2021-04-12T16:11:38.000Z | 2022-03-18T09:03:58.000Z | Statistical Methods and Data Analysis/Module 2 Assignment/venv/lib/python3.8/site-packages/matplotlib/tests/test_backends_interactive.py | ZohaibZ/DataScience | ba06c724293f8674375827bdf2d4f42d32788ebb | [
"MIT"
] | 21 | 2021-04-13T01:17:40.000Z | 2022-03-11T16:06:50.000Z | Statistical Methods and Data Analysis/Module 2 Assignment/venv/lib/python3.8/site-packages/matplotlib/tests/test_backends_interactive.py | ZohaibZ/DataScience | ba06c724293f8674375827bdf2d4f42d32788ebb | [
"MIT"
] | 2 | 2020-09-10T10:24:52.000Z | 2021-01-05T21:54:51.000Z | import importlib
import importlib.util
import json
import os
import signal
import subprocess
import sys
import time
import urllib.request
import pytest
import matplotlib as mpl
# Minimal smoke-testing of the backends for which the dependencies are
# PyPI-installable on CI. They are not available for all tested Pyt... | 36.340206 | 79 | 0.650355 | import importlib
import importlib.util
import json
import os
import signal
import subprocess
import sys
import time
import urllib.request
import pytest
import matplotlib as mpl
def _get_testable_interactive_backends():
backends = []
for deps, backend in [
(["cairo", "gi"], "gtk3agg"),
... | true | true |
f701f37a4174ee79bfb8e774f9a1ee876fc707d0 | 1,077 | py | Python | tests/settings.py | chefgonpachi/MISO | cf2109550be7e7ed6740ff736b1e1778dffaab9b | [
"Apache-2.0"
] | 80 | 2020-11-30T00:25:51.000Z | 2022-03-15T12:02:37.000Z | brownie/tests/settings.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 8 | 2021-09-01T17:33:57.000Z | 2022-02-25T20:11:27.000Z | brownie/tests/settings.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 30 | 2020-11-30T00:25:57.000Z | 2022-01-09T06:01:27.000Z | TENPOW18 = 10 ** 18
TENPOW6 = 10 ** 6
ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
ETH_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
AUCTION_TOKENS = 10000 * TENPOW18
AUCTION_TIME = 50000
AUCTION_START_PRICE = 100 * TENPOW18
AUCTION_RESERVE = 0.001 * TENPOW18
AUCTION_MINIMUM_COMMITMENT = 10 * ... | 24.477273 | 59 | 0.793872 | TENPOW18 = 10 ** 18
TENPOW6 = 10 ** 6
ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
ETH_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
AUCTION_TOKENS = 10000 * TENPOW18
AUCTION_TIME = 50000
AUCTION_START_PRICE = 100 * TENPOW18
AUCTION_RESERVE = 0.001 * TENPOW18
AUCTION_MINIMUM_COMMITMENT = 10 * ... | true | true |
f701f391b62bbe8b77e06a6851b313415c5310ce | 9,763 | py | Python | google/cloud/servicecontrol_v1/services/quota_controller/async_client.py | parthea/python-service-control | 94c7fc51a5f84fe5c11d35ef6b7bd64462fa6b41 | [
"Apache-2.0"
] | null | null | null | google/cloud/servicecontrol_v1/services/quota_controller/async_client.py | parthea/python-service-control | 94c7fc51a5f84fe5c11d35ef6b7bd64462fa6b41 | [
"Apache-2.0"
] | null | null | null | google/cloud/servicecontrol_v1/services/quota_controller/async_client.py | parthea/python-service-control | 94c7fc51a5f84fe5c11d35ef6b7bd64462fa6b41 | [
"Apache-2.0"
] | 1 | 2021-04-21T11:34:34.000Z | 2021-04-21T11:34:34.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.342975 | 154 | 0.693434 |
from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources
import google.api_core.client_options as ClientOptions
from google.api_core import exceptions
from google.api_core import gapic_v1
from google.api_core import... | true | true |
f701f47df818f2b9c8dc438e57bfeecedf6e1d89 | 9,208 | py | Python | octopus/platforms/EOS/wasm.py | ZarvisD/octopus | 3e238721fccfec69a69a1635b8a0dc485e525e69 | [
"MIT"
] | 2 | 2019-01-19T07:12:02.000Z | 2021-08-14T13:23:37.000Z | octopus/platforms/EOS/wasm.py | ZarvisD/octopus | 3e238721fccfec69a69a1635b8a0dc485e525e69 | [
"MIT"
] | null | null | null | octopus/platforms/EOS/wasm.py | ZarvisD/octopus | 3e238721fccfec69a69a1635b8a0dc485e525e69 | [
"MIT"
] | 1 | 2019-01-19T07:12:05.000Z | 2019-01-19T07:12:05.000Z | # extract from:
# * https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md
# * https://webassembly.github.io/spec/core/binary/instructions.html
# * https://github.com/athre0z/wasm/blob/master/wasm/opcodes.py
from wasm.immtypes import *
from wasm.opcodes import INSN_ENTER_BLOCK, INSN_LEAVE_BLOCK, INSN_BRAN... | 42.43318 | 100 | 0.484796 |
from wasm.immtypes import *
from wasm.opcodes import INSN_ENTER_BLOCK, INSN_LEAVE_BLOCK, INSN_BRANCH, INSN_NO_FLOW
_table = {
0x00: ('unreachable', None, INSN_NO_FLOW, 0, 0, ''),
0x01: ('nop', None, 0, 0, 0, ''),
0x02: ('block', BlockImm(), INSN_ENTER_BLOCK, 0, 0, ''),
0x03: ('loop', BlockImm... | true | true |
f701f57a6d66a5162c4485e2059098ca7ddc59f7 | 49,207 | py | Python | tests/core_type/test_introspection.py | jhgg/graphql-py | 47ad2ca029954423e4b13f5b4ef84f788e865f6f | [
"MIT"
] | 1 | 2021-04-28T21:35:02.000Z | 2021-04-28T21:35:02.000Z | tests/core_type/test_introspection.py | jhgg/graphql-py | 47ad2ca029954423e4b13f5b4ef84f788e865f6f | [
"MIT"
] | null | null | null | tests/core_type/test_introspection.py | jhgg/graphql-py | 47ad2ca029954423e4b13f5b4ef84f788e865f6f | [
"MIT"
] | null | null | null | import json
from pytest import raises
from graphql.core import graphql
from graphql.core.error import format_error
from graphql.core.language.location import SourceLocation
from graphql.core.language.parser import parse
from graphql.core.execution import execute
from graphql.core.type import (
GraphQLSchema,
Gr... | 58.440618 | 133 | 0.25285 | import json
from pytest import raises
from graphql.core import graphql
from graphql.core.error import format_error
from graphql.core.language.location import SourceLocation
from graphql.core.language.parser import parse
from graphql.core.execution import execute
from graphql.core.type import (
GraphQLSchema,
Gr... | true | true |
f701f5da9daa45c173263130bee6d726af6e96a9 | 8,044 | py | Python | apps/meetup/views.py | VladimirFilonov/moscowdjango | e1e97139f0bff2d8a0f8b41f219e0416a4733d5e | [
"BSD-3-Clause"
] | 10 | 2015-10-01T18:41:50.000Z | 2020-11-26T14:00:54.000Z | apps/meetup/views.py | VladimirFilonov/moscowdjango | e1e97139f0bff2d8a0f8b41f219e0416a4733d5e | [
"BSD-3-Clause"
] | 33 | 2016-01-13T08:52:54.000Z | 2022-01-13T00:34:23.000Z | apps/meetup/views.py | VladimirFilonov/moscowdjango | e1e97139f0bff2d8a0f8b41f219e0416a4733d5e | [
"BSD-3-Clause"
] | 4 | 2015-10-04T12:35:03.000Z | 2021-06-15T05:57:10.000Z | # coding=utf-8
import os
import sys
import django
from django.core.urlresolvers import reverse
from django.db import DatabaseError
from django.db.models import Count
from django.http import HttpResponse, Http404
from django.shortcuts import redirect, get_object_or_404
from django.utils import six
from django.views.gen... | 32.435484 | 95 | 0.632645 |
import os
import sys
import django
from django.core.urlresolvers import reverse
from django.db import DatabaseError
from django.db.models import Count
from django.http import HttpResponse, Http404
from django.shortcuts import redirect, get_object_or_404
from django.utils import six
from django.views.generic.base impo... | true | true |
f701f680ba8554ccbd354efc16483113776c0acd | 197 | py | Python | codewars/7kyu/doha22/repeater/test.py | doha22/Training_one | 0cd7cf86c7da0f6175834146296b763d1841766b | [
"MIT"
] | null | null | null | codewars/7kyu/doha22/repeater/test.py | doha22/Training_one | 0cd7cf86c7da0f6175834146296b763d1841766b | [
"MIT"
] | 2 | 2019-01-22T10:53:42.000Z | 2019-01-31T08:02:48.000Z | codewars/7kyu/doha22/repeater/test.py | doha22/Training_one | 0cd7cf86c7da0f6175834146296b763d1841766b | [
"MIT"
] | 13 | 2019-01-22T10:37:42.000Z | 2019-01-25T13:30:43.000Z | import unittest
from repeater import repeater
def test_repeater(benchmark):
assert benchmark(repeater,'a',5) == 'aaaaa'
assert benchmark(repeater,'Wub', 6 ) == 'Wub Wub Wub Wub Wub Wub '
| 24.625 | 70 | 0.71066 | import unittest
from repeater import repeater
def test_repeater(benchmark):
assert benchmark(repeater,'a',5) == 'aaaaa'
assert benchmark(repeater,'Wub', 6 ) == 'Wub Wub Wub Wub Wub Wub '
| true | true |
f701f7a9a7a4a33178b37d3b9fb2b490dd4d8458 | 243 | py | Python | Chapter03/Setup As Admin.py | delgadoa1/Python-For-Offensive-Pentest | c768d61f15fccc77768eb400b5c0e36bebde9511 | [
"MIT"
] | 62 | 2018-05-22T20:46:01.000Z | 2022-03-30T11:25:58.000Z | Chapter03/Setup As Admin.py | delgadoa1/Python-For-Offensive-Pentest | c768d61f15fccc77768eb400b5c0e36bebde9511 | [
"MIT"
] | null | null | null | Chapter03/Setup As Admin.py | delgadoa1/Python-For-Offensive-Pentest | c768d61f15fccc77768eb400b5c0e36bebde9511 | [
"MIT"
] | 61 | 2018-04-27T16:49:33.000Z | 2022-03-27T17:59:32.000Z | from distutils.core import setup
import py2exe , sys, os
sys.argv.append("py2exe")
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "DNS.py", 'uac_info': "requireAdministrator"}],
zipfile = None,
)
| 17.357143 | 73 | 0.625514 | from distutils.core import setup
import py2exe , sys, os
sys.argv.append("py2exe")
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "DNS.py", 'uac_info': "requireAdministrator"}],
zipfile = None,
)
| true | true |
f701f865b738ef986aac7ad75382e6e9b70325f2 | 6,277 | py | Python | pyinfra_cli/inventory.py | ryanwersal/pyinfra | 350c9053953531d1d258512f1e0761879df772fb | [
"MIT"
] | 1 | 2022-03-24T05:44:45.000Z | 2022-03-24T05:44:45.000Z | pyinfra_cli/inventory.py | marinakravchenko21/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | null | null | null | pyinfra_cli/inventory.py | marinakravchenko21/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | 1 | 2021-11-12T18:36:01.000Z | 2021-11-12T18:36:01.000Z | from os import listdir, path
from types import GeneratorType
import six
from pyinfra import logger, pseudo_inventory
from pyinfra.api.inventory import Inventory
from pyinfra_cli.util import exec_file
# Hosts in an inventory can be just the hostname or a tuple (hostname, data)
ALLOWED_HOST_TYPES = tuple(
six.stri... | 29.890476 | 88 | 0.644416 | from os import listdir, path
from types import GeneratorType
import six
from pyinfra import logger, pseudo_inventory
from pyinfra.api.inventory import Inventory
from pyinfra_cli.util import exec_file
ALLOWED_HOST_TYPES = tuple(
six.string_types + (tuple,),
)
ALLOWED_DATA_TYPES = tuple(
six.integer_types
... | true | true |
f701f8f535f597b8a4f9c0cbfcd41fb6de407627 | 338 | py | Python | testprojects/tests/python/pants/constants_only/test_constants_only.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | 1 | 2020-08-26T03:30:31.000Z | 2020-08-26T03:30:31.000Z | testprojects/tests/python/pants/constants_only/test_constants_only.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | 1 | 2021-09-02T21:06:31.000Z | 2021-09-02T21:06:31.000Z | testprojects/tests/python/pants/constants_only/test_constants_only.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
def test_constants_only():
try:
from pants.constants_only.constants import VALID_IDENTIFIERS # noqa
except ImportError as e:
assert False, 'Failed to correctly generate python... | 33.8 | 71 | 0.760355 |
def test_constants_only():
try:
from pants.constants_only.constants import VALID_IDENTIFIERS
except ImportError as e:
assert False, 'Failed to correctly generate python package: %s' % e
| true | true |
f701f949821e1f0ee7ad7abeb6beb95d4ae102bf | 409 | py | Python | bglcapi/bgapi/user/parse.py | edgebr/python-bgapi | 0aeb525edf605e892b20f5c3fb11269cce0c5bdf | [
"MIT"
] | null | null | null | bglcapi/bgapi/user/parse.py | edgebr/python-bgapi | 0aeb525edf605e892b20f5c3fb11269cce0c5bdf | [
"MIT"
] | null | null | null | bglcapi/bgapi/user/parse.py | edgebr/python-bgapi | 0aeb525edf605e892b20f5c3fb11269cce0c5bdf | [
"MIT"
] | null | null | null | from struct import (unpack_from, calcsize)
from bglcapi.types import MessageType
from . import rsp
from . import evt
PARSE_MAP = {
MessageType.COMMAND_RESPONSE: {
0x00: rsp.message_to_target,
},
MessageType.EVENT: {
0x00: evt.message_to_host,
},
}
def from_binary(msg_type: int, msg_... | 20.45 | 70 | 0.691932 | from struct import (unpack_from, calcsize)
from bglcapi.types import MessageType
from . import rsp
from . import evt
PARSE_MAP = {
MessageType.COMMAND_RESPONSE: {
0x00: rsp.message_to_target,
},
MessageType.EVENT: {
0x00: evt.message_to_host,
},
}
def from_binary(msg_type: int, msg_... | true | true |
f701f97e1f188d4e04e78e513ce8208e4d9f71ef | 1,360 | py | Python | deploy.py | blockchainhelppro/CelvinRost | aa2661747d06e4610928466521e4da1db77aeadc | [
"MIT"
] | 2 | 2018-08-15T21:27:59.000Z | 2018-08-21T17:56:12.000Z | deploy.py | blockchainhelppro/CelvinRost | aa2661747d06e4610928466521e4da1db77aeadc | [
"MIT"
] | null | null | null | deploy.py | blockchainhelppro/CelvinRost | aa2661747d06e4610928466521e4da1db77aeadc | [
"MIT"
] | 1 | 2021-12-06T04:03:32.000Z | 2021-12-06T04:03:32.000Z | import itertools
import toposort
from populus.utils.contracts import (
compute_direct_dependency_graph,
compute_recursive_contract_dependencies,
)
def compute_deploy_order(dependency_graph):
"""
Given a dictionary that maps contract to their dependencies,
determine the overall dependency orderin... | 33.170732 | 83 | 0.772794 | import itertools
import toposort
from populus.utils.contracts import (
compute_direct_dependency_graph,
compute_recursive_contract_dependencies,
)
def compute_deploy_order(dependency_graph):
return toposort.toposort_flatten(dict(dependency_graph))
def get_deploy_order(contracts_to_deploy, compiled_con... | true | true |
f701f9d8c81d5e989359e6483b6e3216e93ad459 | 28,601 | py | Python | machine_learning_model.py | prakass1/InteractiveSimilarityExplorer | 2fa5fb91c7df6424b9ed777ef4373ed7094c2348 | [
"MIT"
] | null | null | null | machine_learning_model.py | prakass1/InteractiveSimilarityExplorer | 2fa5fb91c7df6424b9ed777ef4373ed7094c2348 | [
"MIT"
] | null | null | null | machine_learning_model.py | prakass1/InteractiveSimilarityExplorer | 2fa5fb91c7df6424b9ed777ef4373ed7094c2348 | [
"MIT"
] | null | null | null | import utility
import static_sim_functions as smf
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import *
from time_series_grp import TimeSeriesGroupProcessing
from RandomNeighbors import RandomNeighbors
from sklearn.neighbors import NearestNeighbors
from sklearn.model_sele... | 43.009023 | 120 | 0.619908 | import utility
import static_sim_functions as smf
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import *
from time_series_grp import TimeSeriesGroupProcessing
from RandomNeighbors import RandomNeighbors
from sklearn.neighbors import NearestNeighbors
from sklearn.model_sele... | true | true |
f701fac9269066e7967ab93ea5152f17e3b246d9 | 4,528 | py | Python | gpsxml2png.py | felmoltor/kismet-heatmap | d145a865f80db16ad8c6d0bb1dd35e0238706f3b | [
"BSD-2-Clause"
] | 11 | 2016-10-13T13:40:59.000Z | 2021-05-29T23:56:59.000Z | gpsxml2png.py | felmoltor/kismet-heatmap | d145a865f80db16ad8c6d0bb1dd35e0238706f3b | [
"BSD-2-Clause"
] | 1 | 2018-07-27T02:32:05.000Z | 2018-12-25T10:12:25.000Z | gpsxml2png.py | felmoltor/kismet-heatmap | d145a865f80db16ad8c6d0bb1dd35e0238706f3b | [
"BSD-2-Clause"
] | 1 | 2021-11-19T15:22:19.000Z | 2021-11-19T15:22:19.000Z | #!/usr/bin/env python2
"""
Copyright (c) 2016, Bliksem Labs B.V.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list... | 29.594771 | 107 | 0.686396 |
import sys
import numpy
from scipy.interpolate import griddata
import matplotlib.pyplot as plt
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
try... | true | true |
f701facbb5489dd40223e0d27d529651494be784 | 5,612 | py | Python | netapp/santricity/models/symbol/thin_volume_reinitialize_descriptor.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | netapp/santricity/models/symbol/thin_volume_reinitialize_descriptor.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | netapp/santricity/models/symbol/thin_volume_reinitialize_descriptor.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | # coding: utf-8
"""
ThinVolumeReinitializeDescriptor.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following con... | 36.921053 | 844 | 0.64273 |
from pprint import pformat
from six import iteritems
class ThinVolumeReinitializeDescriptor(object):
def __init__(self):
self.swagger_types = {
'thin_vol': 'str',
'init_params': 'ThinVolumeReinitializeParams'
}
self.attribute_map = {
'thin_vol': 't... | true | true |
f701fae7234155f95bb3a662b5f3cf38b6fbec3f | 9,618 | py | Python | gamestonk_terminal/options/op_helpers.py | keshabb/GamestonkTerminal | a0acdfb13f806c35c82a7c4dc81ea98de52814e0 | [
"MIT"
] | 1 | 2021-07-25T20:34:29.000Z | 2021-07-25T20:34:29.000Z | gamestonk_terminal/options/op_helpers.py | TomiToivio/GamestonkTerminal | 419c3691db220c467d2979b19ca308b3b800c0bd | [
"MIT"
] | 1 | 2022-02-10T06:49:37.000Z | 2022-02-10T06:49:37.000Z | gamestonk_terminal/options/op_helpers.py | TomiToivio/GamestonkTerminal | 419c3691db220c467d2979b19ca308b3b800c0bd | [
"MIT"
] | null | null | null | """Option helper functions"""
__docformat__ = "numpy"
import argparse
from typing import List
import pandas as pd
import numpy as np
from gamestonk_terminal.helper_funcs import (
parse_known_args_and_warn,
check_non_negative,
)
# pylint: disable=R1710
def load(other_args: List[str]) -> str:
"""Load ti... | 23.288136 | 104 | 0.555521 | __docformat__ = "numpy"
import argparse
from typing import List
import pandas as pd
import numpy as np
from gamestonk_terminal.helper_funcs import (
parse_known_args_and_warn,
check_non_negative,
)
def load(other_args: List[str]) -> str:
parser = argparse.ArgumentParser(
add_help=False,
... | true | true |
f701fb01fdb4c37afc1d4e5189833e347bf52cf0 | 132 | py | Python | conda_pack/__init__.py | calebho/conda-pack | 06b55eff31bc1b8aab765b64924238fa73176793 | [
"BSD-3-Clause"
] | null | null | null | conda_pack/__init__.py | calebho/conda-pack | 06b55eff31bc1b8aab765b64924238fa73176793 | [
"BSD-3-Clause"
] | null | null | null | conda_pack/__init__.py | calebho/conda-pack | 06b55eff31bc1b8aab765b64924238fa73176793 | [
"BSD-3-Clause"
] | null | null | null | from . import _version
from .core import CondaEnv, CondaPackException, File, pack
__version__ = _version.get_versions()['version']
| 26.4 | 58 | 0.787879 | from . import _version
from .core import CondaEnv, CondaPackException, File, pack
__version__ = _version.get_versions()['version']
| true | true |
f701fef52c14cd1ab59e97d3208e9fba872d50d7 | 14,368 | py | Python | flare/framework/agent.py | skylian/flare | c920abcae975cc49c052f5f2abb6bbee5c39a11e | [
"Apache-2.0"
] | null | null | null | flare/framework/agent.py | skylian/flare | c920abcae975cc49c052f5f2abb6bbee5c39a11e | [
"Apache-2.0"
] | null | null | null | flare/framework/agent.py | skylian/flare | c920abcae975cc49c052f5f2abb6bbee5c39a11e | [
"Apache-2.0"
] | 1 | 2018-10-15T21:38:29.000Z | 2018-10-15T21:38:29.000Z | from abc import ABCMeta, abstractmethod
from multiprocessing import Process, Value
import numpy as np
from flare.common.log import GameLogEntry
from flare.common.communicator import AgentCommunicator
from flare.common.replay_buffer import NoReplacementQueue, ReplayBuffer, Experience
class AgentHelper(object):
"""... | 36.374684 | 93 | 0.600362 | from abc import ABCMeta, abstractmethod
from multiprocessing import Process, Value
import numpy as np
from flare.common.log import GameLogEntry
from flare.common.communicator import AgentCommunicator
from flare.common.replay_buffer import NoReplacementQueue, ReplayBuffer, Experience
class AgentHelper(object):
__m... | true | true |
f701ff2a39c9302a8a5530d6b4a34c9cdf05ddd0 | 1,302 | py | Python | custom_components/ge_home/devices/washer_dryer.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 41 | 2021-08-02T02:15:54.000Z | 2022-03-30T11:11:42.000Z | custom_components/ge_home/devices/washer_dryer.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 46 | 2021-08-03T02:20:59.000Z | 2022-03-30T11:17:15.000Z | custom_components/ge_home/devices/washer_dryer.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 15 | 2021-08-31T00:21:33.000Z | 2022-03-30T12:53:21.000Z | import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk import ErdCode, ErdApplianceType
from .washer import WasherApi
from .dryer import DryerApi
from ..entities import GeErdSensor, GeErdBinarySensor
_LOGGER = logging.getLogger(__name__)
class WasherDryerApi(WasherApi,... | 35.189189 | 85 | 0.725038 | import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk import ErdCode, ErdApplianceType
from .washer import WasherApi
from .dryer import DryerApi
from ..entities import GeErdSensor, GeErdBinarySensor
_LOGGER = logging.getLogger(__name__)
class WasherDryerApi(WasherApi,... | true | true |
f701ffb04ee003deff62ba9a43c50dc9568f0b5f | 6,275 | py | Python | pyldpc/decoder.py | c-w-m/pyldpc | c7eb471359086b7336d7b40f11cc912f0daf0476 | [
"BSD-3-Clause"
] | 69 | 2017-03-12T17:48:54.000Z | 2022-03-25T13:18:46.000Z | pyldpc/decoder.py | hichamjanati/pyldpc | a821ccd1eb3a13b8a0f66ebba8d9923ce2f528ef | [
"BSD-3-Clause"
] | 20 | 2018-03-14T14:29:41.000Z | 2021-12-29T15:40:27.000Z | pyldpc/decoder.py | c-w-m/pyldpc | c7eb471359086b7336d7b40f11cc912f0daf0476 | [
"BSD-3-Clause"
] | 29 | 2017-12-26T22:07:34.000Z | 2022-03-27T13:55:57.000Z | """Decoding module."""
import numpy as np
import warnings
from . import utils
from numba import njit, int64, types, float64
def decode(H, y, snr, maxiter=1000):
"""Decode a Gaussian noise corrupted n bits message using BP algorithm.
Decoding is performed in parallel if multiple codewords are passed in y.
... | 29.599057 | 79 | 0.492271 | import numpy as np
import warnings
from . import utils
from numba import njit, int64, types, float64
def decode(H, y, snr, maxiter=1000):
m, n = H.shape
bits_hist, bits_values, nodes_hist, nodes_values = utils._bitsandnodes(H)
_n_bits = np.unique(H.sum(0))
_n_nodes = np.unique(H.sum(1))
if _n_... | true | true |
f70200850eca38956d7410a98fa9d47cd58d4c0d | 2,895 | py | Python | kubeyard/dependencies.py | socialwifi/kubeyard | 094576e6ad4ff7b9eb419234a3392523cf9e2b18 | [
"BSD-3-Clause"
] | 16 | 2018-11-30T09:53:23.000Z | 2020-06-07T16:36:10.000Z | kubeyard/dependencies.py | socialwifi/kubeyard | 094576e6ad4ff7b9eb419234a3392523cf9e2b18 | [
"BSD-3-Clause"
] | 34 | 2018-12-17T15:22:16.000Z | 2020-08-14T11:04:24.000Z | kubeyard/dependencies.py | socialwifi/kubeyard | 094576e6ad4ff7b9eb419234a3392523cf9e2b18 | [
"BSD-3-Clause"
] | 4 | 2018-12-17T09:57:09.000Z | 2020-05-14T11:16:34.000Z | import logging
import time
import sh
logger = logging.getLogger(__name__)
def is_command_available(name):
try:
sh.bash('which', name)
except sh.ErrorReturnCode:
return False
else:
return True
class KubernetesDependency:
def ensure_running(self):
logger.debug('Checki... | 29.242424 | 99 | 0.56753 | import logging
import time
import sh
logger = logging.getLogger(__name__)
def is_command_available(name):
try:
sh.bash('which', name)
except sh.ErrorReturnCode:
return False
else:
return True
class KubernetesDependency:
def ensure_running(self):
logger.debug('Checki... | true | true |
f7020126c0821383f6a8544cd6c1e7094992bb87 | 25 | py | Python | btd6_memory_info/generated/Unity/Collections/LowLevel/Unsafe/UnsafeUtility/unsafe_utility.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Unity/Collections/LowLevel/Unsafe/UnsafeUtility/unsafe_utility.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Unity/Collections/LowLevel/Unsafe/UnsafeUtility/unsafe_utility.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class UnsafeUtility: pass | 25 | 25 | 0.88 | class UnsafeUtility: pass | true | true |
f7020143781683c04a23b0b50295a1890ca68391 | 6,509 | py | Python | server/accounts/models.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | server/accounts/models.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | server/accounts/models.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | import enum
from itertools import chain
from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserManager
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.functional import cached_pr... | 32.708543 | 103 | 0.665233 | import enum
from itertools import chain
from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserManager
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.functional import cached_pr... | true | true |
f70201eec12852521092e1ed9d3f5bc7a9cd90c2 | 976 | py | Python | deepdab/ai/td0_policy.py | lantunes/deepdab | 0e30f102b9d7c37d3691540496b1649f2704d586 | [
"Apache-2.0"
] | 1 | 2019-04-04T02:26:51.000Z | 2019-04-04T02:26:51.000Z | deepdab/ai/td0_policy.py | lantunes/deepdab | 0e30f102b9d7c37d3691540496b1649f2704d586 | [
"Apache-2.0"
] | null | null | null | deepdab/ai/td0_policy.py | lantunes/deepdab | 0e30f102b9d7c37d3691540496b1649f2704d586 | [
"Apache-2.0"
] | null | null | null | from deepdab.ai import *
class TDZeroPolicy(TabularPolicy):
def __init__(self, board_size, learning_rate=0.0, gamma=0.0, epsilon=0.0, initial_state_value=0.0, table_file_path=None):
super(TDZeroPolicy, self).__init__(board_size=board_size, epsilon=epsilon,
initia... | 57.411765 | 163 | 0.743852 | from deepdab.ai import *
class TDZeroPolicy(TabularPolicy):
def __init__(self, board_size, learning_rate=0.0, gamma=0.0, epsilon=0.0, initial_state_value=0.0, table_file_path=None):
super(TDZeroPolicy, self).__init__(board_size=board_size, epsilon=epsilon,
initia... | true | true |
f7020205688de508cdcaf88f06fa23f6198f18be | 132 | py | Python | tests/classification/digits/ws_digits_SGDClassifier_db2_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 1 | 2019-07-09T14:45:18.000Z | 2019-07-09T14:45:18.000Z | tests/classification/digits/ws_digits_SGDClassifier_db2_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 5 | 2017-11-13T13:35:37.000Z | 2021-11-11T12:57:20.000Z | tests/classification/digits/ws_digits_SGDClassifier_db2_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 1 | 2021-09-19T15:05:33.000Z | 2021-09-19T15:05:33.000Z | from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SGDClassifier" , "digits" , "db2")
| 26.4 | 72 | 0.80303 | from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SGDClassifier" , "digits" , "db2")
| true | true |
f702024c3c01565b670bab7999a264ce4f0d7f8d | 260 | py | Python | slack_app/tasks.py | webscopeio/django-slack-app | 65abb3717460c51a19c1238eb0572f25c47b2a42 | [
"MIT"
] | 3 | 2020-06-23T10:02:48.000Z | 2020-10-28T11:59:28.000Z | slack_app/tasks.py | webscopeio/django-slack-integration | 65abb3717460c51a19c1238eb0572f25c47b2a42 | [
"MIT"
] | 2 | 2020-02-17T11:42:03.000Z | 2020-02-18T13:46:38.000Z | slack_app/tasks.py | webscopeio/django-slack-integration | 65abb3717460c51a19c1238eb0572f25c47b2a42 | [
"MIT"
] | 4 | 2020-10-11T11:02:58.000Z | 2022-03-14T08:23:42.000Z | from celery import shared_task
from .signals import slack_event_received
@shared_task
def receive_slack_signal_task(sender, event_type, event_data, **data):
slack_event_received.send(sender=sender, event_type=event_type, event_data=event_data, **data)
| 26 | 98 | 0.819231 | from celery import shared_task
from .signals import slack_event_received
@shared_task
def receive_slack_signal_task(sender, event_type, event_data, **data):
slack_event_received.send(sender=sender, event_type=event_type, event_data=event_data, **data)
| true | true |
f702027b07c86443c8a600458c57b03f9799e7d6 | 370 | py | Python | 10_days_of_statistics_5_4.py | sercangul/HackerRank | e6d7056babe03baafee8d7f1cacdca7c28b72ded | [
"Apache-2.0"
] | null | null | null | 10_days_of_statistics_5_4.py | sercangul/HackerRank | e6d7056babe03baafee8d7f1cacdca7c28b72ded | [
"Apache-2.0"
] | null | null | null | 10_days_of_statistics_5_4.py | sercangul/HackerRank | e6d7056babe03baafee8d7f1cacdca7c28b72ded | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 19:19:34 2019
@author: sercangul
"""
from math import erf
std = 10
h1 = 80
h2 = 60
mean = 70
def N(mean, std, x):
return 0.5 + 0.5 * erf((x-mean)/(std* 2**0.5))
print (round(((1 - N(mean,std,h1))*100),2))
print (round(((1 - N(mean,std,h2)... | 17.619048 | 50 | 0.575676 |
from math import erf
std = 10
h1 = 80
h2 = 60
mean = 70
def N(mean, std, x):
return 0.5 + 0.5 * erf((x-mean)/(std* 2**0.5))
print (round(((1 - N(mean,std,h1))*100),2))
print (round(((1 - N(mean,std,h2))*100),2))
print (round(((N(mean,std,h2)*100)),2)) | true | true |
f7020407270c486b259d7d6e15d11395208c8459 | 22,252 | py | Python | finder/planets.py | astrohr/dagor-preprocessing | 7b44d39f5559cab5e8cf12234193903336d77e36 | [
"MIT"
] | null | null | null | finder/planets.py | astrohr/dagor-preprocessing | 7b44d39f5559cab5e8cf12234193903336d77e36 | [
"MIT"
] | null | null | null | finder/planets.py | astrohr/dagor-preprocessing | 7b44d39f5559cab5e8cf12234193903336d77e36 | [
"MIT"
] | null | null | null | import requests
import requests_cache
from bs4 import BeautifulSoup
import json
from lxml import html
import pdb
import re
import sys
import logging
import datetime
import time
# import winsound
from jinja2 import Environment, FileSystemLoader
import math
import itertools
from playsound import playsound
class Planet... | 42.223909 | 313 | 0.574915 | import requests
import requests_cache
from bs4 import BeautifulSoup
import json
from lxml import html
import pdb
import re
import sys
import logging
import datetime
import time
from jinja2 import Environment, FileSystemLoader
import math
import itertools
from playsound import playsound
class Planet:
maxSca... | true | true |
f70206340a2324d17bb06e8517c8d216679dd42c | 1,006 | py | Python | bizfriendly/settings.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 13 | 2015-04-27T14:26:19.000Z | 2021-11-21T16:11:17.000Z | bizfriendly/settings.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 15 | 2015-04-25T22:29:50.000Z | 2016-09-01T16:59:21.000Z | bizfriendly/settings.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 9 | 2015-06-19T19:48:40.000Z | 2021-04-16T10:27:29.000Z | from bizfriendly import app
from flask.ext.heroku import Heroku
import os
heroku = Heroku(app) # Sets CONFIG automagically
app.config.update(
# DEBUG = True,
# SQLALCHEMY_DATABASE_URI = 'postgres://hackyourcity@localhost/howtocity',
# SQLALCHEMY_DATABASE_URI = 'postgres://postgres:root@localhost/howtocity'... | 41.916667 | 95 | 0.752485 | from bizfriendly import app
from flask.ext.heroku import Heroku
import os
heroku = Heroku(app)
app.config.update(
)
app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY')
app.config['MAIL_GUN_KEY'] = os.environ.get('MAIL_GUN_KEY')
app.config['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_... | true | true |
f70206cc800c5e0d94292d32c57ac589cda0f286 | 172 | py | Python | learn1/46.py | raghavi101/HackerRank | 48bf812f1b3c60b5201a95458be76ae9b7323a88 | [
"MIT"
] | null | null | null | learn1/46.py | raghavi101/HackerRank | 48bf812f1b3c60b5201a95458be76ae9b7323a88 | [
"MIT"
] | null | null | null | learn1/46.py | raghavi101/HackerRank | 48bf812f1b3c60b5201a95458be76ae9b7323a88 | [
"MIT"
] | null | null | null | from itertools import product
aarr = list(map(int, input().split()))
barr = list(map(int, input().split()))
print(' '.join(str(i) for i in list(product(*[aarr, barr]))))
| 24.571429 | 61 | 0.651163 | from itertools import product
aarr = list(map(int, input().split()))
barr = list(map(int, input().split()))
print(' '.join(str(i) for i in list(product(*[aarr, barr]))))
| true | true |
f702081e249e1d95321d52a2424e1f7a8a4b4c3a | 5,409 | py | Python | previous/week12/object-oriented/FactorySystemOO.py | code-lab-org/sys611 | 3b8c46788dee629a9f2d6b7f84373e041b918ff0 | [
"MIT"
] | 3 | 2021-04-07T03:52:07.000Z | 2022-03-04T18:16:16.000Z | previous/week12/object-oriented/FactorySystemOO.py | code-lab-org/sys611 | 3b8c46788dee629a9f2d6b7f84373e041b918ff0 | [
"MIT"
] | null | null | null | previous/week12/object-oriented/FactorySystemOO.py | code-lab-org/sys611 | 3b8c46788dee629a9f2d6b7f84373e041b918ff0 | [
"MIT"
] | 6 | 2021-02-12T01:57:23.000Z | 2022-03-04T18:05:27.000Z | """
SYS-611: Example factory model in SimPy (object-oriented).
@author: Paul T. Grogan, pgrogan@stevens.edu
"""
# import the python3 behavior for importing, division, and printing in python2
from __future__ import absolute_import, division, print_function
# import the simpy package
# see https://simpy.readthedocs.i... | 32.781818 | 87 | 0.621557 |
from __future__ import absolute_import, division, print_function
import simpy
import numpy as np
import matplotlib.pyplot as plt
NUM_RUNS = 1
SIM_DURATION = 5*8*52
NUM_SPARES = 20
NUM_REPAIRERS = 5
class Factory(object):
def __init__(self, env, num_repairers, num_spares):
self.repairers... | true | true |
f702082ae713bdb7800692e65c05918519ebe0f6 | 809 | py | Python | flower/views/workers.py | KonstantinKlepikov/flower | 89e71c8c00dcb51bc584e908fc6b2ba97706e89a | [
"BSD-3-Clause"
] | 1 | 2020-07-04T23:10:39.000Z | 2020-07-04T23:10:39.000Z | flower/views/workers.py | KonstantinKlepikov/flower | 89e71c8c00dcb51bc584e908fc6b2ba97706e89a | [
"BSD-3-Clause"
] | null | null | null | flower/views/workers.py | KonstantinKlepikov/flower | 89e71c8c00dcb51bc584e908fc6b2ba97706e89a | [
"BSD-3-Clause"
] | null | null | null | import logging
from tornado import web
from tornado import gen
from ..views import BaseHandler
from ..api.workers import ListWorkers
logger = logging.getLogger(__name__)
class WorkerView(BaseHandler):
@web.authenticated
@gen.coroutine
def get(self, name):
try:
yield ListWorkers.upd... | 24.515152 | 83 | 0.621755 | import logging
from tornado import web
from tornado import gen
from ..views import BaseHandler
from ..api.workers import ListWorkers
logger = logging.getLogger(__name__)
class WorkerView(BaseHandler):
@web.authenticated
@gen.coroutine
def get(self, name):
try:
yield ListWorkers.upd... | true | true |
f702088c09ef362dbf362546e58d15f744e9d59b | 3,465 | py | Python | great_expectations/render/renderer/content_block/exception_list_content_block.py | arunnthevapalan/great_expectations | 97f1481bcd1c3f4d8878c6f383f4e6f008b20cd1 | [
"Apache-2.0"
] | 1 | 2022-03-16T22:09:49.000Z | 2022-03-16T22:09:49.000Z | great_expectations/render/renderer/content_block/exception_list_content_block.py | draev/great_expectations | 317e15ee7e50f6e0d537b62154177440f33b795d | [
"Apache-2.0"
] | null | null | null | great_expectations/render/renderer/content_block/exception_list_content_block.py | draev/great_expectations | 317e15ee7e50f6e0d537b62154177440f33b795d | [
"Apache-2.0"
] | null | null | null | from great_expectations.render.renderer.content_block.content_block import (
ContentBlockRenderer,
)
from great_expectations.render.types import (
RenderedBulletListContent,
RenderedStringTemplateContent,
)
class ExceptionListContentBlockRenderer(ContentBlockRenderer):
"""Render a bullet list of excep... | 35 | 95 | 0.529582 | from great_expectations.render.renderer.content_block.content_block import (
ContentBlockRenderer,
)
from great_expectations.render.types import (
RenderedBulletListContent,
RenderedStringTemplateContent,
)
class ExceptionListContentBlockRenderer(ContentBlockRenderer):
_rendered_component_type = Rend... | true | true |
f70209989cb8b53631a4098886ce234e8cb0bf20 | 7,330 | py | Python | plugins/email_requests/qt.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | plugins/email_requests/qt.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | plugins/email_requests/qt.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 34.413146 | 103 | 0.658663 |
import time
import threading
import base64
from functools import partial
import smtplib
import imaplib
import email
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.encoders import encode_base64
from PyQt5.QtGui import *
from PyQt5.QtCore import *... | true | true |
f70209b0d9d20aa5537d8749c49f57d989ad1359 | 8,688 | py | Python | tests/test_manage.py | zhongtianxie/fm-orchestrator | 5ab39bf1981cf4abdf7ca4c2a7d4a6120f1bea2f | [
"MIT"
] | null | null | null | tests/test_manage.py | zhongtianxie/fm-orchestrator | 5ab39bf1981cf4abdf7ca4c2a7d4a6120f1bea2f | [
"MIT"
] | null | null | null | tests/test_manage.py | zhongtianxie/fm-orchestrator | 5ab39bf1981cf4abdf7ca4c2a7d4a6120f1bea2f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
from mock import patch
import pytest
from module_build_service import app
from module_build_service.common import models
from module_build_service.common.models import BUILD_STATES, ModuleBuild
from module_build_service.mana... | 37.938865 | 98 | 0.635474 |
from __future__ import absolute_import
from mock import patch
import pytest
from module_build_service import app
from module_build_service.common import models
from module_build_service.common.models import BUILD_STATES, ModuleBuild
from module_build_service.manage import manager_wrapper, retire
from module_build_s... | true | true |
f7020a1ad7976fedcd2915bb0bdd7f25195e1ef1 | 19,822 | py | Python | python2.7/site-packages/twisted/internet/protocol.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 4 | 2020-10-31T19:52:05.000Z | 2021-09-22T11:39:27.000Z | python2.7/site-packages/twisted/internet/protocol.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | null | null | null | python2.7/site-packages/twisted/internet/protocol.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 2 | 2020-02-27T08:28:35.000Z | 2020-09-13T12:39:26.000Z | # -*- test-case-name: twisted.test.test_factories -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Standard implementations of Twisted protocol-related interfaces.
Start here if you are looking to write a new protocol implementation for
Twisted. The Protocol class contains ... | 31.314376 | 104 | 0.644486 |
import random
from zope.interface import implements
from twisted.python import log, failure, components
from twisted.internet import interfaces, error, defer
class Factory:
implements(interfaces.IProtocolFactory)
protocol = None
numPorts = 0
noisy = True
def doStart(self):
... | true | true |
f7020c7e44ed4271ac16291a8b653971cdef5868 | 1,944 | py | Python | plugins/asciidoc_reader/asciidoc_reader.py | craigriley39/pelican-site | 920d484feb67a2bd7bf9e3576edea7fa3325af2e | [
"MIT"
] | null | null | null | plugins/asciidoc_reader/asciidoc_reader.py | craigriley39/pelican-site | 920d484feb67a2bd7bf9e3576edea7fa3325af2e | [
"MIT"
] | null | null | null | plugins/asciidoc_reader/asciidoc_reader.py | craigriley39/pelican-site | 920d484feb67a2bd7bf9e3576edea7fa3325af2e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
AsciiDoc Reader
===============
This plugin allows you to use AsciiDoc to write your posts.
File extension should be ``.asc``, ``.adoc``, or ``asciidoc``.
"""
from pelican.readers import BaseReader
from pelican.utils import pelican_open
from pelican import signals
import six
try:
# a... | 29.454545 | 78 | 0.656893 |
from pelican.readers import BaseReader
from pelican.utils import pelican_open
from pelican import signals
import six
try:
from .asciidocapi import AsciiDocAPI, AsciiDocError
# AsciiDocAPI class checks for asciidoc.py
AsciiDocAPI()
except:
asciidoc_enabled = False
else:
asciidoc_enabled = Tru... | true | true |
f7020d0e7d8612087a21fa0bdd02292f49996850 | 487 | py | Python | mysite/blog/migrations/0004_auto_20190813_2004.py | wuxiaobai24/django-blog | 6247732f1a4666d18057bb1341a3d7f7e5685a07 | [
"MIT"
] | null | null | null | mysite/blog/migrations/0004_auto_20190813_2004.py | wuxiaobai24/django-blog | 6247732f1a4666d18057bb1341a3d7f7e5685a07 | [
"MIT"
] | null | null | null | mysite/blog/migrations/0004_auto_20190813_2004.py | wuxiaobai24/django-blog | 6247732f1a4666d18057bb1341a3d7f7e5685a07 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-13 12:04
from django.db import migrations
import mdeditor.fields
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_post_clicks'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='excerpt... | 20.291667 | 48 | 0.564682 |
from django.db import migrations
import mdeditor.fields
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_post_clicks'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='excerpt',
),
migrations.AlterField(
... | true | true |
f7020d1de12f52758b00890d55a652104a297a62 | 1,163 | py | Python | tests/urls.py | rcmarron/django-rest-framework-passwordless | 869e9dfc6532071b5e64bff956ae9d2938ecf2bd | [
"MIT"
] | 1 | 2018-06-07T19:51:53.000Z | 2018-06-07T19:51:53.000Z | tests/urls.py | rcmarron/django-rest-framework-passwordless | 869e9dfc6532071b5e64bff956ae9d2938ecf2bd | [
"MIT"
] | null | null | null | tests/urls.py | rcmarron/django-rest-framework-passwordless | 869e9dfc6532071b5e64bff956ae9d2938ecf2bd | [
"MIT"
] | 1 | 2019-07-01T13:59:51.000Z | 2019-07-01T13:59:51.000Z | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from drfpasswordless.views import (ObtainEmailCallbackToken,
ObtainMobileCallbackToken,
ObtainAuthTokenFromCallbackToken,
... | 64.611111 | 111 | 0.648323 | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from drfpasswordless.views import (ObtainEmailCallbackToken,
ObtainMobileCallbackToken,
ObtainAuthTokenFromCallbackToken,
... | true | true |
f7020d653fddccea65982e36062192b1b90e0f46 | 1,433 | py | Python | scripts/get_relative_lib_dir.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | scripts/get_relative_lib_dir.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | scripts/get_relative_lib_dir.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | import distutils.sysconfig
import os
import platform
import re
import sys
def get_python_relative_libdir():
"""Returns the appropropriate python libdir relative to the build directory.
@param exe_path the path to the lldb executable
@return the python path that needs to be added to sys.path (PYTHONPATH)... | 31.844444 | 80 | 0.672017 | import distutils.sysconfig
import os
import platform
import re
import sys
def get_python_relative_libdir():
if platform.system() != 'Linux':
return None
arch_specific_libdir = distutils.sysconfig.get_python_lib(True, False)
split_libdir = arch_specific_libdir.split(os.sep... | true | true |
f7020d8b7d272efd930e45c2c083cb2f1069c47f | 17,979 | py | Python | tests/functional/test_host_functions.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | tests/functional/test_host_functions.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | tests/functional/test_host_functions.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 50.22067 | 100 | 0.647144 |
import json
import os
import random
import allure
import coreapi
import pytest
from adcm_client.objects import ADCMClient
from adcm_pytest_plugin.utils import get_data_dir
from adcm_pytest_plugin import utils
from jsonschema import validate
from tests.library import errorcodes as err
from tests.library i... | true | true |
f7020d9bd382de4a25582f4af06d4bd6d33c3802 | 200 | py | Python | sdk/opendp/smartnoise/sql/reader/engine.py | Tecnarca/whitenoise-system | 9dfc1425bca77f6e30afe1eea253a6b580bfa847 | [
"MIT"
] | 1 | 2021-08-25T09:11:12.000Z | 2021-08-25T09:11:12.000Z | sdk/opendp/smartnoise/sql/reader/engine.py | Tecnarca/whitenoise-system | 9dfc1425bca77f6e30afe1eea253a6b580bfa847 | [
"MIT"
] | null | null | null | sdk/opendp/smartnoise/sql/reader/engine.py | Tecnarca/whitenoise-system | 9dfc1425bca77f6e30afe1eea253a6b580bfa847 | [
"MIT"
] | 1 | 2021-06-22T15:13:47.000Z | 2021-06-22T15:13:47.000Z | class Engine:
PANDAS = "pandas"
POSTGRES = "postgres"
PRESTO = "Presto"
SPARK = "Spark"
SQL_SERVER = "SqlServer"
known_engines = {PANDAS, POSTGRES, PRESTO, SPARK, SQL_SERVER}
| 22.222222 | 65 | 0.64 | class Engine:
PANDAS = "pandas"
POSTGRES = "postgres"
PRESTO = "Presto"
SPARK = "Spark"
SQL_SERVER = "SqlServer"
known_engines = {PANDAS, POSTGRES, PRESTO, SPARK, SQL_SERVER}
| true | true |
f7020da7e2026b64986547ac7c2002542fae98b8 | 446 | py | Python | testsuite/Werror/run.py | 3delight/OpenShadingLanguage | 74616c3707b2e1c3bd76341ab88c66326d87de13 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2019-06-19T17:52:37.000Z | 2021-08-03T19:40:23.000Z | testsuite/Werror/run.py | 3delight/OpenShadingLanguage | 74616c3707b2e1c3bd76341ab88c66326d87de13 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | testsuite/Werror/run.py | 3delight/OpenShadingLanguage | 74616c3707b2e1c3bd76341ab88c66326d87de13 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# This shader would ordinarily issue a warning.
# With -Werror, it should be upgraded to an error.
failureok = 1 # this test is expected... | 27.875 | 62 | 0.746637 |
failureok = 1
oslcargs = "-Werror"
| true | true |
f7020dae8a4e3ad127ef76a4e88a2c72338e8dc6 | 2,139 | py | Python | deafwave/simulator/start_simulator.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/simulator/start_simulator.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/simulator/start_simulator.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | from multiprocessing import freeze_support
from pathlib import Path
from typing import Dict
from deafwave.full_node.full_node import FullNode
from deafwave.rpc.full_node_rpc_api import FullNodeRpcApi
from deafwave.server.outbound_message import NodeType
from deafwave.server.start_service import run_service
from deafwa... | 31 | 98 | 0.726975 | from multiprocessing import freeze_support
from pathlib import Path
from typing import Dict
from deafwave.full_node.full_node import FullNode
from deafwave.rpc.full_node_rpc_api import FullNodeRpcApi
from deafwave.server.outbound_message import NodeType
from deafwave.server.start_service import run_service
from deafwa... | true | true |
f7020dff191d2596228363c19066ef1b0fd24c8b | 11,542 | py | Python | deepchem/dock/binding_pocket.py | ozgurozkan123/deepchem | 7b6248db5f7172ff2a833a1c7c99f48565befe67 | [
"MIT"
] | 2 | 2017-10-28T04:21:31.000Z | 2018-04-02T08:41:17.000Z | deepchem/dock/binding_pocket.py | ozgurozkan123/deepchem | 7b6248db5f7172ff2a833a1c7c99f48565befe67 | [
"MIT"
] | null | null | null | deepchem/dock/binding_pocket.py | ozgurozkan123/deepchem | 7b6248db5f7172ff2a833a1c7c99f48565befe67 | [
"MIT"
] | 1 | 2019-09-03T18:36:31.000Z | 2019-09-03T18:36:31.000Z | """
Computes putative binding pockets on protein.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2017, Stanford University"
__license__ = "MIT"
import os
import tempfile
import numpy as np
fr... | 38.092409 | 122 | 0.692861 | from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2017, Stanford University"
__license__ = "MIT"
import os
import tempfile
import numpy as np
from subprocess import call
from scipy.spatial import Co... | true | true |
f7020e4a4571ee1d2ea14fbea0a4245dd8daf392 | 10,826 | py | Python | tensorflow/python/saved_model/load_test.py | shanyi15/tensorflow | ebb3429856441149e41388dfbea59496f8dbf17b | [
"Apache-2.0"
] | 1 | 2020-09-01T03:03:57.000Z | 2020-09-01T03:03:57.000Z | tensorflow/python/saved_model/load_test.py | shanyi15/tensorflow | ebb3429856441149e41388dfbea59496f8dbf17b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/saved_model/load_test.py | shanyi15/tensorflow | ebb3429856441149e41388dfbea59496f8dbf17b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.044025 | 80 | 0.691391 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
from tensorflow.python.eager import backprop
from tensorflow.python.eager import def_function
from tensorflow.python.eager import test
from tensorflow.python.framework ... | true | true |
f7020e785ead3105ee3e34b471b7a5fcf8a92780 | 1,322 | py | Python | Login.py | npcoder2k14/Login-using-Selenium | 047fa60e7705614d809314388591a9bd1ee68481 | [
"MIT"
] | 1 | 2016-05-28T06:51:16.000Z | 2016-05-28T06:51:16.000Z | Login.py | npcoder2k14/Login-using-Selenium | 047fa60e7705614d809314388591a9bd1ee68481 | [
"MIT"
] | null | null | null | Login.py | npcoder2k14/Login-using-Selenium | 047fa60e7705614d809314388591a9bd1ee68481 | [
"MIT"
] | null | null | null | from selenium import webdriver
import time
from bs4 import BeautifulSoup
import requests
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.PhantomJS()
driver.set_window_size(1120,550)
d... | 30.045455 | 70 | 0.723147 | from selenium import webdriver
import time
from bs4 import BeautifulSoup
import requests
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.PhantomJS()
driver.set_window_size(1120,550)
d... | true | true |
f7020e806b61d3b1b2fd2eb73b1d37b9c9465b3f | 13,166 | py | Python | zuo/bert/tokenization.py | joytianya/google_bert | 0b6ef3ec27031928adb727ad3f53e47aea6954b6 | [
"Apache-2.0"
] | 438 | 2019-10-16T08:30:05.000Z | 2022-03-30T07:59:52.000Z | PyCLUE/utils/classifier_utils/tokenization.py | yyht/PyCLUE | 06f131241163a745747da33c5f563abe4413897b | [
"MIT"
] | 37 | 2019-10-21T02:55:21.000Z | 2021-09-27T02:18:36.000Z | PyCLUE/utils/classifier_utils/tokenization.py | yyht/PyCLUE | 06f131241163a745747da33c5f563abe4413897b | [
"MIT"
] | 110 | 2019-10-18T02:28:11.000Z | 2022-03-18T16:40:08.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 32.751244 | 861 | 0.632159 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import re
import unicodedata
import six
import tensorflow as tf
def validate_case_matches_checkpoint(do_lower_case, init_checkpoint):
# we have to heuristically d... | true | true |
f7020e83e9b4b451e496d6aadff5e7867e1489d5 | 1,733 | py | Python | matrix/inverse_of_matrix.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | matrix/inverse_of_matrix.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | matrix/inverse_of_matrix.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | from __future__ import annotations
from decimal import Decimal
def inverse_of_matrix(matrix: list[list[float]]) -> list[list[float]]:
"""
A matrix multiplied with its inverse gives the identity matrix.
This function finds the inverse of a 2x2 matrix.
If the determinant of a matrix is 0, its inverse d... | 42.268293 | 96 | 0.639931 | from __future__ import annotations
from decimal import Decimal
def inverse_of_matrix(matrix: list[list[float]]) -> list[list[float]]:
D = Decimal
determinant = D(matrix[0][0]) * D(matrix[1][1]) - D(matrix[1][0]) * D(matrix[0][1])
if determinant == 0:
raise ValueError("This matrix has no i... | true | true |
f7020f0b66f99dc8aa38190ae79b0a848af67220 | 289 | py | Python | tests/test_binder.py | yeliudev/nncore | 2160db62268767d3bcc69dd918cd291305fc820f | [
"MIT"
] | 6 | 2021-03-27T15:25:00.000Z | 2021-08-23T06:29:33.000Z | tests/test_binder.py | yeliudev/nncore | 2160db62268767d3bcc69dd918cd291305fc820f | [
"MIT"
] | 4 | 2020-10-23T09:15:09.000Z | 2021-08-24T03:33:59.000Z | tests/test_binder.py | yeliudev/nncore | 2160db62268767d3bcc69dd918cd291305fc820f | [
"MIT"
] | null | null | null | # Copyright (c) Ye Liu. All rights reserved.
import nncore
def test_bind_getter():
@nncore.bind_getter('name', 'depth')
class Backbone:
_name = 'ResNet'
_depth = 50
backbone = Backbone()
assert backbone.name == 'ResNet'
assert backbone.depth == 50
| 18.0625 | 44 | 0.629758 |
import nncore
def test_bind_getter():
@nncore.bind_getter('name', 'depth')
class Backbone:
_name = 'ResNet'
_depth = 50
backbone = Backbone()
assert backbone.name == 'ResNet'
assert backbone.depth == 50
| true | true |
f7020f18b1fea83efb1c2d65e0ce4621434dafd7 | 3,395 | py | Python | blog/apps/users/migrations/0001_initial.py | panchaoco/blog-py | ae4c66080c40024d5bef463c2827c5bf71881786 | [
"Apache-2.0"
] | null | null | null | blog/apps/users/migrations/0001_initial.py | panchaoco/blog-py | ae4c66080c40024d5bef463c2827c5bf71881786 | [
"Apache-2.0"
] | 6 | 2021-03-18T23:09:11.000Z | 2022-03-11T23:43:20.000Z | blog/apps/users/migrations/0001_initial.py | panchaoco/blog-py | ae4c66080c40024d5bef463c2827c5bf71881786 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.4 on 2019-03-24 19:19
import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_u... | 67.9 | 329 | 0.658616 |
import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operatio... | true | true |
f7020fc4a341db582d4d506879dfddefeb0bc378 | 1,773 | py | Python | yoda/main.py | x0y-gt/yoda | 1936d3cb93f4e7997bafbabeee62aebb875faace | [
"MIT"
] | null | null | null | yoda/main.py | x0y-gt/yoda | 1936d3cb93f4e7997bafbabeee62aebb875faace | [
"MIT"
] | null | null | null | yoda/main.py | x0y-gt/yoda | 1936d3cb93f4e7997bafbabeee62aebb875faace | [
"MIT"
] | null | null | null | import os
import click
from yoda.ssh.shell import Shell
from yoda.ssh.config import importHost
# Context obj
class Cmd():
def __init__(self):
self.verbose = False
self.shell = None
self.host = None
pass_cmd = click.make_pass_decorator(Cmd, ensure=True)
class CmdsLoader(click.MultiCommand):
_cmdFolder... | 26.863636 | 118 | 0.688663 | import os
import click
from yoda.ssh.shell import Shell
from yoda.ssh.config import importHost
class Cmd():
def __init__(self):
self.verbose = False
self.shell = None
self.host = None
pass_cmd = click.make_pass_decorator(Cmd, ensure=True)
class CmdsLoader(click.MultiCommand):
_cmdFolder = os.path.ab... | true | true |
f7021005377ccdda8d76009a04d71c7447d772fc | 9,807 | py | Python | grilops/shapes.py | jaylorch/grilops | 6375f1061a4512e18bcee6662939d0e43404db36 | [
"MIT"
] | 2 | 2020-01-11T13:34:34.000Z | 2021-12-03T02:14:10.000Z | grilops/shapes.py | Skynet0/grilops | 7f8cea8fb2b2e7609fe9b5976de90fc2fc23ce13 | [
"MIT"
] | null | null | null | grilops/shapes.py | Skynet0/grilops | 7f8cea8fb2b2e7609fe9b5976de90fc2fc23ce13 | [
"MIT"
] | null | null | null | """This module supports puzzles that place fixed shape regions into the grid."""
from collections import defaultdict
import sys
from typing import Dict, List
from z3 import ArithRef, Int, IntVal, Or, Solver, PbEq
from .fastz3 import fast_and, fast_eq, fast_ne
from .geometry import Lattice, Point, Vector
from .quadtre... | 36.457249 | 90 | 0.665239 |
from collections import defaultdict
import sys
from typing import Dict, List
from z3 import ArithRef, Int, IntVal, Or, Solver, PbEq
from .fastz3 import fast_and, fast_eq, fast_ne
from .geometry import Lattice, Point, Vector
from .quadtree import ExpressionQuadTree
HAS_INSTANCE_ID, NOT_HAS_INSTANCE_ID, HAS_SHAPE_T... | true | true |
f70211c77ad9a61fdf5449a9356c32742a4ff109 | 83 | py | Python | Delivery Cost Project/venv/lib/python3.9/site-packages/qihoo/Test.py | AttiR/Python-Web_Programming | e2eee2ed829c939cc57fccfafc83c284829b2764 | [
"MIT"
] | null | null | null | Delivery Cost Project/venv/lib/python3.9/site-packages/qihoo/Test.py | AttiR/Python-Web_Programming | e2eee2ed829c939cc57fccfafc83c284829b2764 | [
"MIT"
] | null | null | null | Delivery Cost Project/venv/lib/python3.9/site-packages/qihoo/Test.py | AttiR/Python-Web_Programming | e2eee2ed829c939cc57fccfafc83c284829b2764 | [
"MIT"
] | null | null | null | def Print():
print('you may want to install beautifulsoup4,not beautfulsoup4')
| 27.666667 | 69 | 0.746988 | def Print():
print('you may want to install beautifulsoup4,not beautfulsoup4')
| true | true |
f7021220c83b998331014807d4c2b17801b886a1 | 299 | py | Python | simple1/src/config.py | devvid/flask-boilplate | 31310e07cc2db564ad342ea45210cb73dc0dcc54 | [
"MIT"
] | null | null | null | simple1/src/config.py | devvid/flask-boilplate | 31310e07cc2db564ad342ea45210cb73dc0dcc54 | [
"MIT"
] | null | null | null | simple1/src/config.py | devvid/flask-boilplate | 31310e07cc2db564ad342ea45210cb73dc0dcc54 | [
"MIT"
] | null | null | null | from os.path import abspath, dirname, join
from os import environ, path
_cwd = dirname(abspath(__file__))
basedir = path.abspath(path.dirname(__file__))
class BaseConfiguration(object):
DEBUG = True
SECRET_KEY = 'Test'
CORS = ["http://localhost:4200", "http://127.0.0.1:5000"] | 29.9 | 61 | 0.688963 | from os.path import abspath, dirname, join
from os import environ, path
_cwd = dirname(abspath(__file__))
basedir = path.abspath(path.dirname(__file__))
class BaseConfiguration(object):
DEBUG = True
SECRET_KEY = 'Test'
CORS = ["http://localhost:4200", "http://127.0.0.1:5000"] | true | true |
f702139ebf7fda464b890e2a2645a8000c100326 | 895 | py | Python | google_safe_browsing/komand_google_safe_browsing/util/objects.py | GreyNoise-Intelligence/insightconnect-plugins | 2ba3121d42fd96e1267bb095bc76b962678c1f56 | [
"MIT"
] | null | null | null | google_safe_browsing/komand_google_safe_browsing/util/objects.py | GreyNoise-Intelligence/insightconnect-plugins | 2ba3121d42fd96e1267bb095bc76b962678c1f56 | [
"MIT"
] | null | null | null | google_safe_browsing/komand_google_safe_browsing/util/objects.py | GreyNoise-Intelligence/insightconnect-plugins | 2ba3121d42fd96e1267bb095bc76b962678c1f56 | [
"MIT"
] | null | null | null | # File to hold all objects to ease construction of JSON payload.
# Non-PEP8 property declaration used as JSON serializing is 1:1, eg. "clientId = clientId", not "client_id = clientId"
class Client(object):
clientId = ""
clientVersion = "0.0.1"
def __init__(self, client_id, client_version="0.0.1"):
... | 28.870968 | 118 | 0.697207 |
class Client(object):
clientId = ""
clientVersion = "0.0.1"
def __init__(self, client_id, client_version="0.0.1"):
self.clientId = client_id
self.clientVersion = client_version
class ThreatEntry(object):
def __init__(self, url):
self.url = url
class ThreatInfo(object):
... | true | true |
f70214d382ae03efdb4a7b2d43a33a02aafbf03c | 16,363 | py | Python | jill/install.py | KronosTheLate/jill.py | 3b2a29e263ed712f54b0ad2a103083aa2f8045bb | [
"MIT"
] | 162 | 2020-01-18T18:06:56.000Z | 2022-03-28T22:55:15.000Z | jill/install.py | KronosTheLate/jill.py | 3b2a29e263ed712f54b0ad2a103083aa2f8045bb | [
"MIT"
] | 106 | 2020-01-20T05:24:19.000Z | 2022-02-23T06:26:53.000Z | jill/install.py | KronosTheLate/jill.py | 3b2a29e263ed712f54b0ad2a103083aa2f8045bb | [
"MIT"
] | 19 | 2020-07-21T03:10:20.000Z | 2022-03-22T17:30:28.000Z | from .utils.defaults import default_depot_path, default_install_dir, default_symlink_dir
from .utils.filters import f_major_version, f_minor_version
from .utils import query_yes_no
from .utils import current_architecture, current_system, current_libc
from .utils import latest_version
from .utils import DmgMounter, TarM... | 39.524155 | 103 | 0.610829 | from .utils.defaults import default_depot_path, default_install_dir, default_symlink_dir
from .utils.filters import f_major_version, f_minor_version
from .utils import query_yes_no
from .utils import current_architecture, current_system, current_libc
from .utils import latest_version
from .utils import DmgMounter, TarM... | true | true |
f7021558695aa1fdcaa5b4d0bb723146eff9bfc1 | 9,127 | py | Python | ec2_compare/internal/instance_type/a.py | weldpua2008/aws.ec2.compare | 5149fc4c7cb42f4d7df1930ed8a06750155fe578 | [
"Apache-2.0"
] | null | null | null | ec2_compare/internal/instance_type/a.py | weldpua2008/aws.ec2.compare | 5149fc4c7cb42f4d7df1930ed8a06750155fe578 | [
"Apache-2.0"
] | null | null | null | ec2_compare/internal/instance_type/a.py | weldpua2008/aws.ec2.compare | 5149fc4c7cb42f4d7df1930ed8a06750155fe578 | [
"Apache-2.0"
] | 1 | 2021-12-15T11:58:22.000Z | 2021-12-15T11:58:22.000Z |
# Automatically generated
# pylint: disable=all
get = [{'SupportedArchitectures': ['arm64'], 'SustainedClockSpeedInGhz': 2.3, 'DefaultVCpus': 1, 'DefaultCores': 1, 'DefaultThreadsPerCore': 1, 'ValidCores': [1], 'ValidThreadsPerCore': [1], 'SizeInMiB': 2048, 'EbsOptimizedSupport': 'default', 'EncryptionSupport': 'supp... | 760.583333 | 8,938 | 0.739016 |
get = [{'SupportedArchitectures': ['arm64'], 'SustainedClockSpeedInGhz': 2.3, 'DefaultVCpus': 1, 'DefaultCores': 1, 'DefaultThreadsPerCore': 1, 'ValidCores': [1], 'ValidThreadsPerCore': [1], 'SizeInMiB': 2048, 'EbsOptimizedSupport': 'default', 'EncryptionSupport': 'supported', 'NetworkPerformance': 'Up to 10 Gigabi... | true | true |
f70215af683529cb3b43d00b6d7dc7a40230ca48 | 4,623 | py | Python | rlpy/gradnet/samples/single_agent/single_agent_ttt_env.py | imandr/RLpy | f01cf7af47b6054e4e52d663ceafc463df6f6166 | [
"BSD-3-Clause"
] | null | null | null | rlpy/gradnet/samples/single_agent/single_agent_ttt_env.py | imandr/RLpy | f01cf7af47b6054e4e52d663ceafc463df6f6166 | [
"BSD-3-Clause"
] | null | null | null | rlpy/gradnet/samples/single_agent/single_agent_ttt_env.py | imandr/RLpy | f01cf7af47b6054e4e52d663ceafc463df6f6166 | [
"BSD-3-Clause"
] | null | null | null | #
# Tic Tac Toe
#
import numpy as np
from gym import spaces
WinMasks = [
[
[1,0,0],
[1,0,0],
[1,0,0],
],
[
[0,1,0],
[0,1,0],
[0,1,0],
],
[
[0,0,1],
[0,0,1],
[0,0,1],
],
[
[1,1,1],
[0,0,0],
... | 24.590426 | 119 | 0.430889 |
import numpy as np
from gym import spaces
WinMasks = [
[
[1,0,0],
[1,0,0],
[1,0,0],
],
[
[0,1,0],
[0,1,0],
[0,1,0],
],
[
[0,0,1],
[0,0,1],
[0,0,1],
],
[
[1,1,1],
[0,0,0],
[0,0,0],
],... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.