hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6de57f658b19453e2e002d214d67e8819c833f13 | 3,607 | py | Python | hltv_scraping/middlewares.py | crazyhitty/hltv-scraping | 374683eb378549b8345b7d9caa8556ac4be936dc | [
"MIT"
] | 3 | 2021-04-06T11:46:37.000Z | 2021-10-15T23:56:27.000Z | hltv_scraping/middlewares.py | crazyhitty/hltv-scraping | 374683eb378549b8345b7d9caa8556ac4be936dc | [
"MIT"
] | null | null | null | hltv_scraping/middlewares.py | crazyhitty/hltv-scraping | 374683eb378549b8345b7d9caa8556ac4be936dc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class HltvScrapingSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# s... | 34.682692 | 78 | 0.667036 |
70265dbf8a487dacb1299a8a888aaa0c56cd7d42 | 6,157 | py | Python | 2-lab-choreographMicroservices/work/cdk/app.py | rizasaputra/workshop-eventDrivenMicroservices | 46b4c9385eaa9d147ee294c57fb2ac1058126a18 | [
"Apache-2.0"
] | 36 | 2020-11-11T04:26:44.000Z | 2022-03-27T11:04:44.000Z | 2-lab-choreographMicroservices/work/cdk/app.py | rizasaputra/workshop-eventDrivenMicroservices | 46b4c9385eaa9d147ee294c57fb2ac1058126a18 | [
"Apache-2.0"
] | 3 | 2021-04-28T11:31:12.000Z | 2021-06-22T08:24:14.000Z | 2-lab-choreographMicroservices/work/cdk/app.py | donnieprakoso/workshop-eventDrivenMicroservices | eb3ca81b11043823288fa19525e880d7257b3ec9 | [
"Apache-2.0"
] | 18 | 2020-11-11T06:03:48.000Z | 2021-12-14T17:15:44.000Z | #!/usr/bin/env python3
from aws_cdk import aws_apigateway as _ag
from aws_cdk import aws_dynamodb as _ddb
from aws_cdk import aws_events as _eb
from aws_cdk import aws_events_targets as _ebt
from aws_cdk import aws_iam as _iam
from aws_cdk import aws_lambda, core
from aws_cdk.aws_dynamodb import Attribute, AttributeTy... | 41.322148 | 165 | 0.635862 |
0fe75996596dbc1ce53ab5d83b22dc33115f76ff | 8,634 | py | Python | src/ralph/accounts/views.py | elubik/ralph | ac39be38cbd7c80ac64984848423fc92b8661b16 | [
"Apache-2.0"
] | 1,668 | 2015-01-01T12:51:20.000Z | 2022-03-29T09:05:35.000Z | src/ralph/accounts/views.py | elubik/ralph | ac39be38cbd7c80ac64984848423fc92b8661b16 | [
"Apache-2.0"
] | 2,314 | 2015-01-02T13:26:26.000Z | 2022-03-29T04:06:03.000Z | src/ralph/accounts/views.py | elubik/ralph | ac39be38cbd7c80ac64984848423fc92b8661b16 | [
"Apache-2.0"
] | 534 | 2015-01-05T12:40:28.000Z | 2022-03-29T21:10:12.000Z | # -*- coding: utf-8 -*-
from datetime import date
import reversion
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.trans... | 33.08046 | 103 | 0.629025 |
5f36e979e7cbb7417c462d181fbec85b9e2d96cc | 542 | py | Python | custom/icds_reports/migrations/0042_child_health_monthly_view.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/migrations/0042_child_health_monthly_view.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/migrations/0042_child_health_monthly_view.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-13 9:25
from __future__ import absolute_import
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration, noop_migration
migrator = RawSQLMigration(('custom', 'icds_reports', 'migration... | 25.809524 | 85 | 0.736162 |
5e2aa9b29749b10f75ff62cb35883a894bdbfce5 | 8,202 | py | Python | code/python/pmip3_pcoral.py | CommonClimate/EmileGeay_NatGeo2015 | 2474f1a73c7f4dfb0510790dc72cc76aea7ddece | [
"MIT"
] | 3 | 2016-04-05T00:31:06.000Z | 2019-07-16T11:45:01.000Z | code/python/pmip3_pcoral.py | CommonClimate/EmileGeay_NatGeo2015 | 2474f1a73c7f4dfb0510790dc72cc76aea7ddece | [
"MIT"
] | null | null | null | code/python/pmip3_pcoral.py | CommonClimate/EmileGeay_NatGeo2015 | 2474f1a73c7f4dfb0510790dc72cc76aea7ddece | [
"MIT"
] | 5 | 2015-12-17T21:39:52.000Z | 2020-10-12T02:02:46.000Z | # this script compute the pseudocoral based on lon, lat, sos, and tos
# total means no seasonal cycle is removed from the computation
# Import modules
from __future__ import print_function
import numpy as np
import numpy.ma as ma
from os import listdir, chdir
from os.path import isfile, join
import string
import sys
... | 35.201717 | 246 | 0.656791 |
614c74a5b50d2014986811140a6cf2679f2393b0 | 115 | py | Python | tests/pydecompile-test/baselines/tagged_templates_id.py | gengxf0505/pxt | eca93a0e0605e68adcfbebce778cc5912a10efcf | [
"MIT"
] | 1 | 2020-11-11T01:47:26.000Z | 2020-11-11T01:47:26.000Z | tests/pydecompile-test/baselines/tagged_templates_id.py | gengxf0505/pxt | eca93a0e0605e68adcfbebce778cc5912a10efcf | [
"MIT"
] | 3 | 2019-02-07T23:34:43.000Z | 2019-03-06T18:25:37.000Z | tests/pydecompile-test/baselines/tagged_templates_id.py | gengxf0505/pxt | eca93a0e0605e68adcfbebce778cc5912a10efcf | [
"MIT"
] | 2 | 2019-10-29T06:56:11.000Z | 2021-05-25T10:18:12.000Z | #/ <reference path="./testBlocks/templateStrings.ts" />
template_with_id = withID("""1234""")
withID("""1234""") | 19.166667 | 55 | 0.66087 |
200207deeae259f2e4a036c0b093ff90999a03e2 | 546 | py | Python | python-dsa/merge sorted array.py | abhishek-parashar/Right-From-Scratch | e596344b0db95cfdeba876676885f062ef5f7c23 | [
"Apache-2.0"
] | null | null | null | python-dsa/merge sorted array.py | abhishek-parashar/Right-From-Scratch | e596344b0db95cfdeba876676885f062ef5f7c23 | [
"Apache-2.0"
] | null | null | null | python-dsa/merge sorted array.py | abhishek-parashar/Right-From-Scratch | e596344b0db95cfdeba876676885f062ef5f7c23 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 6 13:38:22 2020
@author: Abhishek Parashar
"""
arr1=[1, 3, 5, 7]
arr2=[2, 4, 6, 8]
arr3=[]
n1=len(arr1)
n2=len(arr2)
i=0
j=0
while(i<n1 and j<n2):
if(arr1[i]<arr2[j]):
arr3.append(arr1[i])
i=i+1
else:
arr3.append(ar... | 16.058824 | 36 | 0.46337 |
5d2eaec5aad5fab7e298214974242dcb99505576 | 7,695 | py | Python | sdk/python/pulumi_azure_native/authorization/latest/management_lock_at_resource_group_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/latest/management_lock_at_resource_group_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/latest/management_lock_at_resource_group_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 50.960265 | 699 | 0.680832 |
f6210fdbf4efa86af52e6c69d115de1bfd0e3158 | 1,745 | py | Python | server/server_placekitten.py | karlalopez/hackbright | d3bac1f5120cb3593a64261c897b7401468af524 | [
"Apache-2.0"
] | null | null | null | server/server_placekitten.py | karlalopez/hackbright | d3bac1f5120cb3593a64261c897b7401468af524 | [
"Apache-2.0"
] | null | null | null | server/server_placekitten.py | karlalopez/hackbright | d3bac1f5120cb3593a64261c897b7401468af524 | [
"Apache-2.0"
] | null | null | null | import socket
server_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_sock.bind(('', 5000))
print "Web server running..."
server_sock.listen(10)
while True:
client_sock, addr = server_sock.accept()
print 'We have opened a socket!'
#print client_sock.recv(100) # these are the incoming heade... | 32.924528 | 97 | 0.536963 |
d5528ea45232806fdd7e4deb277b8e9f447d56f7 | 517 | py | Python | examples/system/freertos/real_time_stats/example_test.py | mbrunnen/hal_espressif | 4f2f7d18a5be962ad0c8bcb3e9fbe010d9df80ee | [
"Apache-2.0"
] | 7 | 2020-12-10T14:48:17.000Z | 2022-03-09T14:58:06.000Z | examples/system/freertos/real_time_stats/example_test.py | mbrunnen/hal_espressif | 4f2f7d18a5be962ad0c8bcb3e9fbe010d9df80ee | [
"Apache-2.0"
] | 24 | 2020-12-10T11:29:39.000Z | 2022-03-21T16:18:12.000Z | examples/system/freertos/real_time_stats/example_test.py | mbrunnen/hal_espressif | 4f2f7d18a5be962ad0c8bcb3e9fbe010d9df80ee | [
"Apache-2.0"
] | 16 | 2020-12-10T11:11:20.000Z | 2022-02-22T12:59:19.000Z | from __future__ import print_function
import ttfw_idf
STATS_TASK_ITERS = 3
STATS_TASK_EXPECT = 'Real time stats obtained'
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
def test_real_time_stats_example(env, extra_data):
dut = env.get_dut('real_time_stats', 'examples/system/freertos/real_time_stats', dut_... | 25.85 | 113 | 0.779497 |
4b52cec29bd3c32a7d88cdb4dcbbcda4840779a5 | 12,447 | py | Python | main.py | FelixFu520/PaDiM-Anomaly-Detection-Localization-master | 34db2cb36947f3cdfc02f38edbc2e498c2354184 | [
"Apache-2.0"
] | null | null | null | main.py | FelixFu520/PaDiM-Anomaly-Detection-Localization-master | 34db2cb36947f3cdfc02f38edbc2e498c2354184 | [
"Apache-2.0"
] | null | null | null | main.py | FelixFu520/PaDiM-Anomaly-Detection-Localization-master | 34db2cb36947f3cdfc02f38edbc2e498c2354184 | [
"Apache-2.0"
] | null | null | null | import random
from random import sample
import argparse
import numpy as np
import os
import pickle
from tqdm import tqdm
from collections import OrderedDict
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from sklearn.metrics import precision_recall_curve
from sklearn.covariance import L... | 40.151613 | 113 | 0.610428 |
520b33efa90704042063462c39dc7b3e5772b9ec | 2,053 | py | Python | magenta/models/score2perf/modalities_test.py | vaipatel/magenta | 8a828116c2a73c26724204987d2b5bddaab31a7e | [
"Apache-2.0"
] | 1 | 2020-06-16T10:45:05.000Z | 2020-06-16T10:45:05.000Z | magenta/models/score2perf/modalities_test.py | vaipatel/magenta | 8a828116c2a73c26724204987d2b5bddaab31a7e | [
"Apache-2.0"
] | null | null | null | magenta/models/score2perf/modalities_test.py | vaipatel/magenta | 8a828116c2a73c26724204987d2b5bddaab31a7e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.79661 | 74 | 0.735509 |
56f195eb62bc4dce5833790997360f3baf12edeb | 2,115 | py | Python | projects/migrations/0002_auto_20151224_2345.py | zachsnyder1/zachsite | 2a6d750d8aef7786d1f3c647be62aea7cbdd29c5 | [
"MIT"
] | null | null | null | projects/migrations/0002_auto_20151224_2345.py | zachsnyder1/zachsite | 2a6d750d8aef7786d1f3c647be62aea7cbdd29c5 | [
"MIT"
] | null | null | null | projects/migrations/0002_auto_20151224_2345.py | zachsnyder1/zachsite | 2a6d750d8aef7786d1f3c647be62aea7cbdd29c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ConstructorParam',
fields... | 35.847458 | 104 | 0.515839 |
bf561e1912990bf99e98043eadc7a2bcefe81d3e | 6,067 | py | Python | proto2/turnPlay.py | Ravenshard/AI_Dominion | 8def66aa8575ebc7c46d02f4797a50f603f64630 | [
"Apache-2.0"
] | 1 | 2019-11-18T03:34:55.000Z | 2019-11-18T03:34:55.000Z | proto2/turnPlay.py | Ravenshard/AI_Dominion | 8def66aa8575ebc7c46d02f4797a50f603f64630 | [
"Apache-2.0"
] | null | null | null | proto2/turnPlay.py | Ravenshard/AI_Dominion | 8def66aa8575ebc7c46d02f4797a50f603f64630 | [
"Apache-2.0"
] | null | null | null |
import time
import random
import numpy as np
import matplotlib.pyplot as plt
import card_format
import player_format
maxTurns = 1000
phases = ["action", "buy", "cleanup"]
gSAPEstimates = dict() # State-action pair estimates
gSAPPrevious = None # state-action pair previous
gSAPCurrent = None
gEpsilon = 0.0
gAlpha = 0.... | 36.329341 | 134 | 0.648756 |
19b9012a49f399b3bf94875a83d790cb1aebe982 | 11,178 | py | Python | src/azure-cli/azure/cli/command_modules/deploymentmanager/_help.py | heaths/azure-cli | baae1d17ffc4f3abfeccea17116bfd61de5770f1 | [
"MIT"
] | 1 | 2019-12-12T19:55:26.000Z | 2019-12-12T19:55:26.000Z | src/azure-cli/azure/cli/command_modules/deploymentmanager/_help.py | heaths/azure-cli | baae1d17ffc4f3abfeccea17116bfd61de5770f1 | [
"MIT"
] | 1 | 2021-06-02T02:47:04.000Z | 2021-06-02T02:47:04.000Z | src/azure-cli/azure/cli/command_modules/deploymentmanager/_help.py | heaths/azure-cli | baae1d17ffc4f3abfeccea17116bfd61de5770f1 | [
"MIT"
] | 1 | 2020-11-12T01:49:27.000Z | 2020-11-12T01:49:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | 42.340909 | 399 | 0.74745 |
72a0ab23383cadd3b48930a4ea29a0e6bc0a3c0c | 509 | py | Python | masonite/providers/SassProvider.py | nilsreichert/core | 048f45a2073f3a5c827f445bdf938c28a756af04 | [
"MIT"
] | 95 | 2018-02-22T23:54:00.000Z | 2021-04-17T03:39:21.000Z | masonite/providers/SassProvider.py | nilsreichert/core | 048f45a2073f3a5c827f445bdf938c28a756af04 | [
"MIT"
] | 840 | 2018-01-27T04:26:20.000Z | 2021-01-24T12:28:58.000Z | masonite/providers/SassProvider.py | nilsreichert/core | 048f45a2073f3a5c827f445bdf938c28a756af04 | [
"MIT"
] | 100 | 2018-02-23T00:19:55.000Z | 2020-08-28T07:59:31.000Z | """A SassProvider Service Provider."""
from masonite.provider import ServiceProvider
from masonite.storage import Storage
class SassProvider(ServiceProvider):
wsgi = False
def register(self):
"""Compile Sass.
Compile Sass if the libsass module is installed. Once installed, all
Sass... | 23.136364 | 76 | 0.671906 |
9e64ed7168b3b379aeb451549da4c69492406191 | 269 | py | Python | server/media_manager/models/setting.py | ToxicFrazzles/ImageSorter | 97da8c2cca1e99ce571b77372ef0b8ab7339ed44 | [
"MIT"
] | null | null | null | server/media_manager/models/setting.py | ToxicFrazzles/ImageSorter | 97da8c2cca1e99ce571b77372ef0b8ab7339ed44 | [
"MIT"
] | null | null | null | server/media_manager/models/setting.py | ToxicFrazzles/ImageSorter | 97da8c2cca1e99ce571b77372ef0b8ab7339ed44 | [
"MIT"
] | null | null | null | from django.db import models
class Setting(models.Model):
key = models.CharField(max_length=100, unique=True, db_index=True)
name = models.CharField(max_length=100)
value = models.CharField(max_length=100)
def __str__(self):
return self.name
| 24.454545 | 70 | 0.717472 |
aa384bac95d32c65becd736e59fc896df9f3c58a | 17,839 | py | Python | tests/test_histogram1d.py | janpipek/physt | bf6b05952b7d09bbbdae2b077f0989c392eac13e | [
"MIT"
] | 123 | 2016-04-05T10:29:02.000Z | 2021-12-15T21:18:23.000Z | tests/test_histogram1d.py | janpipek/physt | bf6b05952b7d09bbbdae2b077f0989c392eac13e | [
"MIT"
] | 70 | 2016-03-25T19:10:49.000Z | 2022-03-09T11:47:08.000Z | tests/test_histogram1d.py | janpipek/physt | bf6b05952b7d09bbbdae2b077f0989c392eac13e | [
"MIT"
] | 16 | 2016-09-07T14:07:20.000Z | 2020-07-23T16:13:59.000Z | import numpy as np
import pytest
from physt.config import config
from physt.histogram1d import Histogram1D
from physt import h1
@pytest.fixture
def values():
return np.asarray([4, 0, 3, 7.2])
@pytest.fixture(params=[4, np.asarray([4, 0.17, 3, 7.2], dtype=float), [1, 2, 3, 4]])
def array_like(request):
retu... | 35.965726 | 94 | 0.577779 |
62709ec09216be62f4f116399e0a97262e843fc4 | 685 | py | Python | tests/journal.ext/info_file.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | null | null | null | tests/journal.ext/info_file.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T23:42:13.000Z | 2021-06-10T23:42:13.000Z | tests/journal.ext/info_file.py | jlmaurer/pyre | 6af38a83621d7d6228d147b4bb94f97fbb10f6e2 | [
"BSD-3-Clause"
] | 2 | 2020-08-31T18:07:52.000Z | 2021-12-10T08:54:39.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2020 all rights reserved
def test():
"""
Send info channel output to a log file
"""
# get the channel
from journal.ext.journal import Informational as info
# send all output to a... | 18.026316 | 57 | 0.613139 |
4d0078b67c6959b69afb363b031fb7eb82130d76 | 17,694 | py | Python | tests/components/alexa/test_intent.py | claret-srl/core | 317068a3784648defadead1c2e6e8de29e20b696 | [
"Apache-2.0"
] | null | null | null | tests/components/alexa/test_intent.py | claret-srl/core | 317068a3784648defadead1c2e6e8de29e20b696 | [
"Apache-2.0"
] | null | null | null | tests/components/alexa/test_intent.py | claret-srl/core | 317068a3784648defadead1c2e6e8de29e20b696 | [
"Apache-2.0"
] | null | null | null | """The tests for the Alexa component."""
# pylint: disable=protected-access
import json
import pytest
from homeassistant.components import alexa
from homeassistant.components.alexa import intent
from homeassistant.const import CONTENT_TYPE_JSON
from homeassistant.core import callback
from homeassistant.setup import a... | 36.184049 | 92 | 0.465977 |
4a77b738a95da364215de9438d511aa59b953620 | 1,526 | py | Python | async_tools/shutdown_default_executor.py | HeavenVolkoff/async_tools | c2fb373f4de11542f61fdbf596955f118a2ba467 | [
"BSD-3-Clause"
] | 4 | 2019-10-30T20:03:31.000Z | 2021-03-05T18:29:42.000Z | async_tools/shutdown_default_executor.py | HeavenVolkoff/async_tools | c2fb373f4de11542f61fdbf596955f118a2ba467 | [
"BSD-3-Clause"
] | 2 | 2019-06-11T18:26:10.000Z | 2021-05-25T20:43:50.000Z | async_tools/shutdown_default_executor.py | HeavenVolkoff/async_tools | c2fb373f4de11542f61fdbf596955f118a2ba467 | [
"BSD-3-Clause"
] | 1 | 2021-05-24T13:31:13.000Z | 2021-05-24T13:31:13.000Z | """
This code is a modified version of python 3.9's BaseEventLoop.shutdown_default_executor method
@link: https://github.com/python/cpython/blob/eb0d359b4b0e14552998e7af771a088b4fd01745/Lib/asyncio/base_events.py#L556-L567
@license: https://github.com/python/cpython/blob/eb0d359b4b0e14552998e7af771a088b4fd01745/LICENSE... | 29.921569 | 123 | 0.730668 |
58aa2e991b52b1804066cecdab6822c03ed1f59d | 12,998 | py | Python | modin/engines/ray/pandas_on_ray/frame/partition.py | ckw017/modin | e6efaab24f133d6999901fecd8b7414fce3e7f31 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/engines/ray/pandas_on_ray/frame/partition.py | ckw017/modin | e6efaab24f133d6999901fecd8b7414fce3e7f31 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/engines/ray/pandas_on_ray/frame/partition.py | ckw017/modin | e6efaab24f133d6999901fecd8b7414fce3e7f31 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 30.65566 | 102 | 0.600708 |
abb9144f4d28f92434892ead87fa38e17eb6a1e1 | 1,902 | py | Python | app/star_class.py | MickeyPvX/nms_name_gen | eec7b82c6b150e19393958d8271c833dcd8522c5 | [
"MIT"
] | 1 | 2021-09-23T18:23:30.000Z | 2021-09-23T18:23:30.000Z | app/star_class.py | MickeyPvX/nms_name_gen | eec7b82c6b150e19393958d8271c833dcd8522c5 | [
"MIT"
] | null | null | null | app/star_class.py | MickeyPvX/nms_name_gen | eec7b82c6b150e19393958d8271c833dcd8522c5 | [
"MIT"
] | null | null | null | from .models.type_validator import TypeValidator
from .models.typed_list import TypedList
from utils.star_class_map import spectral_class_map, oddity_map
from config import NMSConfig
class StarClass(object):
config = TypeValidator(dict)
spectral_class_str = TypeValidator(str)
spectral_class = TypeValidat... | 39.625 | 99 | 0.643533 |
0d31680bb8a1bfd71b7813c911ce4e4b33db091b | 8,267 | py | Python | tests/unit/models/test_local_model.py | rasapala/OpenVINO-model-server | a7cd5c7fe6c2177aefbe2fc258eec1b9ff0dda2b | [
"Apache-2.0"
] | null | null | null | tests/unit/models/test_local_model.py | rasapala/OpenVINO-model-server | a7cd5c7fe6c2177aefbe2fc258eec1b9ff0dda2b | [
"Apache-2.0"
] | null | null | null | tests/unit/models/test_local_model.py | rasapala/OpenVINO-model-server | a7cd5c7fe6c2177aefbe2fc258eec1b9ff0dda2b | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 45.423077 | 80 | 0.591387 |
2968a495247a35c209e9a83449d3c5d982f64115 | 77 | py | Python | local.py | Dyavathrocky/rocky | 693833e61ce9317ab003ca61d4654c6b3806cd22 | [
"Apache-2.0"
] | null | null | null | local.py | Dyavathrocky/rocky | 693833e61ce9317ab003ca61d4654c6b3806cd22 | [
"Apache-2.0"
] | null | null | null | local.py | Dyavathrocky/rocky | 693833e61ce9317ab003ca61d4654c6b3806cd22 | [
"Apache-2.0"
] | null | null | null | #local vvaribale
def spam() :
eggs = 31337
spam()
print(eggs)
| 8.555556 | 17 | 0.558442 |
3f3f1d36aade4434135566bfc8a71e611751af55 | 850 | py | Python | test_significantQSOPairs.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | 2 | 2017-03-21T14:18:35.000Z | 2020-03-30T20:51:33.000Z | test_significantQSOPairs.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | null | null | null | test_significantQSOPairs.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
import significant_qso_pairs
__author__ = 'yishay'
class TestSignificantQSOPairs(TestCase):
def test_add_if_larger(self):
s = significant_qso_pairs.SignificantQSOPairs(5, dtype=int, initial_value=-1)
qso1_list = [11, 12, 13, 14, 15, 16, 17, 18, 1... | 32.692308 | 85 | 0.649412 |
2eeb7611317cb97c9c511f6c01ef38b530360071 | 309 | py | Python | lib/version.py | OleksandrBlack/electrum-safecoin | 71a383635f9f2c3b50649376daabb6ba610431c2 | [
"MIT"
] | null | null | null | lib/version.py | OleksandrBlack/electrum-safecoin | 71a383635f9f2c3b50649376daabb6ba610431c2 | [
"MIT"
] | null | null | null | lib/version.py | OleksandrBlack/electrum-safecoin | 71a383635f9f2c3b50649376daabb6ba610431c2 | [
"MIT"
] | 1 | 2020-01-31T22:01:23.000Z | 2020-01-31T22:01:23.000Z | ELECTRUM_VERSION = '3.3.3' # version of the client package
PROTOCOL_VERSION = '1.2' # protocol version requested
# The hash of the mnemonic seed must begin with this
SEED_PREFIX = '01' # Standard wallet
def seed_prefix(seed_type):
if seed_type == 'standard':
return SEED_PREFIX
| 28.090909 | 60 | 0.68932 |
daa5a53b4d97a40ef52aa453645b48b04e1d62bb | 592 | py | Python | AtC_Beg_Con_071-080/ABC075/B.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | AtC_Beg_Con_071-080/ABC075/B.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | AtC_Beg_Con_071-080/ABC075/B.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | import copy
H, W = map(int, input().split())
S = [input() for i in range(H)]
dd = ((-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1), (1, 0), (1, 1), (0, 1))
T = copy.deepcopy(S)
count = 0
for i in range(H):
for j in range(W):
if S[i][j] == '#':
continue
for dx, dy in dd:
nx = j +... | 25.73913 | 75 | 0.376689 |
0ba3f8547635b43b07f7b69462ecf39b43eaf2b5 | 852 | py | Python | kanban_backend/users/tests/test_drf_views.py | hamzabouissi/kanban_backend | 549d8c2711313011f3186b5b3a3ac969481df3f7 | [
"MIT"
] | null | null | null | kanban_backend/users/tests/test_drf_views.py | hamzabouissi/kanban_backend | 549d8c2711313011f3186b5b3a3ac969481df3f7 | [
"MIT"
] | null | null | null | kanban_backend/users/tests/test_drf_views.py | hamzabouissi/kanban_backend | 549d8c2711313011f3186b5b3a3ac969481df3f7 | [
"MIT"
] | null | null | null | import pytest
from django.test import RequestFactory
from kanban_backend.users.views import UserViewSet
from kanban_backend.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):
view = UserViewSet()
request... | 25.058824 | 67 | 0.629108 |
8972a6c2e4f63b97b90ae246df6ff13c11acad4f | 17,051 | py | Python | userbot/plugins/gtools.py | wdtgbot/TamilUserBot | e349ffddd99bf1007f14d8523b5936319290d134 | [
"MIT"
] | null | null | null | userbot/plugins/gtools.py | wdtgbot/TamilUserBot | e349ffddd99bf1007f14d8523b5936319290d134 | [
"MIT"
] | null | null | null | userbot/plugins/gtools.py | wdtgbot/TamilUserBot | e349ffddd99bf1007f14d8523b5936319290d134 | [
"MIT"
] | null | null | null | import asyncio
from telethon.events import ChatAction
from telethon.tl.functions.contacts import BlockRequest, UnblockRequest
from telethon.tl.types import MessageEntityMentionName
from userbot import CMD_HELP
from userbot.plugins.sql_helper.mute_sql import is_muted, mute, unmute
from userbot.utils import admin_cmd
... | 34.377016 | 99 | 0.555334 |
d42b672b3c938a43396e2d39aa7b3723d2a7ecac | 1,344 | py | Python | Chapter06/bookmarks/images/forms.py | sabin-web/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 628 | 2019-11-13T14:13:40.000Z | 2022-03-30T19:02:05.000Z | Chapter06/bookmarks/images/forms.py | HAKN1999/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 96 | 2020-04-17T17:35:33.000Z | 2022-02-17T09:25:06.000Z | Chapter06/bookmarks/images/forms.py | HAKN1999/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 782 | 2019-10-15T07:29:27.000Z | 2022-03-30T17:25:08.000Z | from urllib import request
from django import forms
from django.core.files.base import ContentFile
from django.utils.text import slugify
from .models import Image
class ImageCreateForm(forms.ModelForm):
class Meta:
model = Image
fields = ('title', 'url', 'description')
widgets = {
... | 32 | 72 | 0.567708 |
23f1566ac5ac1c3a01d36b6fbbbcaf5910f75fc8 | 599 | py | Python | setup_submodules.py | miriad/plotly.py | f083bea25691ff64a30008f46f77fc1edc11ad63 | [
"MIT"
] | 2 | 2019-11-08T07:01:11.000Z | 2019-11-17T10:10:49.000Z | setup_submodules.py | pythonthings/plotly.py | b770468d392bf89cbfc630e2c02bd54ec5db97a7 | [
"MIT"
] | null | null | null | setup_submodules.py | pythonthings/plotly.py | b770468d392bf89cbfc630e2c02bd54ec5db97a7 | [
"MIT"
] | null | null | null | import os
import shutil
import subprocess
here = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
# Init submodules
subprocess.check_output(["git", "submodule", "init"])
# Update submodules
subprocess.check_output(["git", "submodule", "update"])
# Replace mplexporter directo... | 24.958333 | 85 | 0.66778 |
21a77e36ea46941a87f4fd21c8e9cd4b755f014b | 2,068 | py | Python | review_project/ratings/forms.py | skylerbadge/ReviewUI | f2eddf565f53b3bac6fc34fcac953a0cee2c65e9 | [
"MIT"
] | null | null | null | review_project/ratings/forms.py | skylerbadge/ReviewUI | f2eddf565f53b3bac6fc34fcac953a0cee2c65e9 | [
"MIT"
] | null | null | null | review_project/ratings/forms.py | skylerbadge/ReviewUI | f2eddf565f53b3bac6fc34fcac953a0cee2c65e9 | [
"MIT"
] | null | null | null | from django import forms
from django.forms import Textarea
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from . import models
class ProfileForm(UserCreationForm):
about = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
class Meta:
... | 38.296296 | 133 | 0.665377 |
46fac31812861e9e0f563fcf0fdffad5de8077a8 | 29,789 | py | Python | posthog/test/test_event_model.py | bmann/posthog-foss | c794bb2666ce85cdc4b87940d2cd14604db8172e | [
"MIT"
] | 1 | 2020-12-08T04:04:52.000Z | 2020-12-08T04:04:52.000Z | posthog/test/test_event_model.py | yaoshuyin/posthog | 1835174c7b3015d0c47260dff98d4a752dc0abde | [
"MIT"
] | null | null | null | posthog/test/test_event_model.py | yaoshuyin/posthog | 1835174c7b3015d0c47260dff98d4a752dc0abde | [
"MIT"
] | null | null | null | from unittest.mock import call, patch
from posthog.models import Action, ActionStep, Element, ElementGroup, Event, Person, Team
from posthog.models.event import Selector, SelectorPart
from posthog.test.base import BaseTest
def filter_by_actions_factory(_create_event, _create_person, _get_events_for_action):
clas... | 45.134848 | 120 | 0.606465 |
7a2acee50594b8c6d3dc3c1e5d4618c84ec2f706 | 2,625 | py | Python | Podprostory/imports/vectors_creation.py | DavidDobas/AnimaceLinAlgebra | b54937602a3b44012d4ee4630b1e54d04869d342 | [
"MIT"
] | null | null | null | Podprostory/imports/vectors_creation.py | DavidDobas/AnimaceLinAlgebra | b54937602a3b44012d4ee4630b1e54d04869d342 | [
"MIT"
] | null | null | null | Podprostory/imports/vectors_creation.py | DavidDobas/AnimaceLinAlgebra | b54937602a3b44012d4ee4630b1e54d04869d342 | [
"MIT"
] | null | null | null | from manim import *
def create_vect(self, array, color, label, add=False):
"""
Creates vector and its label.
Parameters
----------
array : Union[list, numpy.ndarray]
Array of the vector
color : str
The color of the vector
label : MathTex
... | 35.472973 | 128 | 0.601905 |
db0562081887197d0d78e471f4f5d88b2f8a0fe5 | 2,306 | py | Python | dataset/imagenet_dataset.py | isabella232/ml-data-parameters | c2931c12d2c6100105c4dcc14df2797e39772098 | [
"AML"
] | 73 | 2019-11-18T15:56:04.000Z | 2022-01-13T02:36:01.000Z | dataset/imagenet_dataset.py | isabella232/ml-data-parameters | c2931c12d2c6100105c4dcc14df2797e39772098 | [
"AML"
] | null | null | null | dataset/imagenet_dataset.py | isabella232/ml-data-parameters | c2931c12d2c6100105c4dcc14df2797e39772098 | [
"AML"
] | 22 | 2019-11-04T20:23:23.000Z | 2022-03-26T11:50:46.000Z | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2019 Apple Inc. All Rights Reserved.
#
import torchvision.datasets as datasets
from PIL import Image
def pil_loader(path):
# open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835)
with open(path, 'rb') as... | 32.942857 | 107 | 0.611015 |
683954bf1b2152a6a8f104cb9738e737d30d433a | 369 | py | Python | quaint/util.py | breuleux/py-quaint | 67c822c16fc132db6606fc74d9b972f0ccc003ef | [
"BSD-3-Clause"
] | 1 | 2016-06-24T01:49:25.000Z | 2016-06-24T01:49:25.000Z | quaint/util.py | breuleux/py-quaint | 67c822c16fc132db6606fc74d9b972f0ccc003ef | [
"BSD-3-Clause"
] | null | null | null | quaint/util.py | breuleux/py-quaint | 67c822c16fc132db6606fc74d9b972f0ccc003ef | [
"BSD-3-Clause"
] | null | null | null |
def format_anchor(s):
s = s.lower().replace(' ', '-').replace('\n', '-')
s = s.replace('~', '').replace('_', '-')
s = s.replace('"', '')
return s
def dedent(code):
lines = code.split("\n")
lines2 = [line for line in lines if line]
nspaces = len(lines2[0]) - len(lines2[0].lstrip())
retu... | 28.384615 | 56 | 0.539295 |
fb93e30eb4cf9023249116433ff8535e87dc7455 | 685 | py | Python | puzzles/migrations/0024_auto_20210104_2026.py | gradut/cardboard | b3bb585f287506934a7016408dbce0d3fbe84e62 | [
"MIT"
] | 21 | 2019-11-19T21:50:50.000Z | 2021-01-24T05:51:23.000Z | puzzles/migrations/0024_auto_20210104_2026.py | gradut/cardboard | b3bb585f287506934a7016408dbce0d3fbe84e62 | [
"MIT"
] | 404 | 2019-11-25T01:15:44.000Z | 2021-11-22T15:06:53.000Z | puzzles/migrations/0024_auto_20210104_2026.py | gradut/cardboard | b3bb585f287506934a7016408dbce0d3fbe84e62 | [
"MIT"
] | 9 | 2022-01-02T22:18:06.000Z | 2022-01-20T10:52:56.000Z | # Generated by Django 3.1.4 on 2021-01-04 20:26
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("puzzles", "0023_auto_20201221_0030"),
]
operations = [
migrations.AddField(
model_name="puzzle",
... | 24.464286 | 68 | 0.583942 |
64ce4192517e04a890a26846b99e0b5434f024e7 | 14,536 | py | Python | troposphere/elasticloadbalancingv2.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | troposphere/elasticloadbalancingv2.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | troposphere/elasticloadbalancingv2.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
from . import AWSObject, AWSProperty, PropsDictType
from .validators import boolean, integer
from .validators.elasticloadbalancingv2 import TARGET_T... | 32.519016 | 185 | 0.674601 |
b4f87f295452dabf4061bc7c3ebc8cd8518fe993 | 11,893 | py | Python | main.py | ehsanik/dogTorch | 3a898862f6283e6603833991eeb62427216f2af7 | [
"MIT"
] | 74 | 2018-05-17T20:06:17.000Z | 2022-02-27T12:25:15.000Z | main.py | yanqi1811/lstm_dogTorch | 95f94e0aeab3c29930eea70bc0be8779760fb13f | [
"MIT"
] | 2 | 2018-09-17T23:10:28.000Z | 2019-06-05T22:35:13.000Z | main.py | ehsanik/dogTorch | 3a898862f6283e6603833991eeb62427216f2af7 | [
"MIT"
] | 13 | 2018-09-05T03:30:07.000Z | 2021-04-22T17:35:09.000Z | """
=================
Command line argument parser and loading the models.
=================
"""
import argparse
import datasets
import datetime
import logging
import models
import pprint
import os
import random
import sys
import torch
import pdb
from torch.autograd import Variable
from training import solver
def m... | 43.564103 | 91 | 0.63138 |
629db59a53241fd188cc3fee72f056a033f93ca4 | 455 | py | Python | mmdet/models/roi_heads/mask_heads/__init__.py | CityU-AIM-Group/HTD | 0be9fd844118c275abc6053b3cbd5ffb589e62ee | [
"MIT"
] | 5 | 2022-02-18T16:26:29.000Z | 2022-03-07T07:25:20.000Z | build/lib/mmdet/models/roi_heads/mask_heads/__init__.py | CityU-AIM-Group/HTD | 0be9fd844118c275abc6053b3cbd5ffb589e62ee | [
"MIT"
] | 1 | 2022-02-24T12:51:19.000Z | 2022-02-28T06:31:15.000Z | mmdet/models/roi_heads/mask_heads/__init__.py | CityU-AIM-Group/HTD | 0be9fd844118c275abc6053b3cbd5ffb589e62ee | [
"MIT"
] | null | null | null | from .coarse_mask_head import CoarseMaskHead
from .fcn_mask_head import FCNMaskHead
from .fused_semantic_head import FusedSemanticHead
from .grid_head import GridHead
from .htc_mask_head import HTCMaskHead
from .mask_point_head import MaskPointHead
from .maskiou_head import MaskIoUHead
from .d2det_head import D2DetHead... | 35 | 66 | 0.81978 |
3a6905c94131b3b4a09b2dbece27dc48d3dc6228 | 501 | py | Python | drlfads/utils/misc.py | ErickRosete/Deep-Reinforcement-Learning-for-Adapting-Dynamical-Systems | cfea4cb65b4e43f9e1e9d3bc3a4b193a9a6cf0f2 | [
"MIT"
] | 6 | 2021-02-12T22:25:54.000Z | 2022-02-13T11:10:08.000Z | drlfads/utils/misc.py | ErickRosete/Deep-Reinforcement-Learning-for-Adapting-Dynamical-Systems | cfea4cb65b4e43f9e1e9d3bc3a4b193a9a6cf0f2 | [
"MIT"
] | null | null | null | drlfads/utils/misc.py | ErickRosete/Deep-Reinforcement-Learning-for-Adapting-Dynamical-Systems | cfea4cb65b4e43f9e1e9d3bc3a4b193a9a6cf0f2 | [
"MIT"
] | null | null | null | def get_save_filename(prefix, cfg, it=0):
difficulty = '_' + cfg.env.settings.difficulty
noise = '_noise' if cfg.env.observation.with_noise else ''
tactile = '_tactile' if cfg.env.observation.with_tactile_sensor else ''
force = '_force' if cfg.env.observation.with_force else ''
rs = "_rs_" + str(it)... | 62.625 | 110 | 0.708583 |
5c7cb02a0faafad12df0b63c133003ca0fbfef00 | 2,677 | py | Python | test_libs/pyspec/eth2spec/test/helpers/block.py | sigp/consensus-specs | 2d13a3adec541259bf9bcc330b6d9f056b006081 | [
"CC0-1.0"
] | 1 | 2019-09-03T23:59:16.000Z | 2019-09-03T23:59:16.000Z | test_libs/pyspec/eth2spec/test/helpers/block.py | sigp/eth2.0-specs | 2d13a3adec541259bf9bcc330b6d9f056b006081 | [
"CC0-1.0"
] | 1 | 2022-01-20T22:50:52.000Z | 2022-01-20T22:50:52.000Z | test_libs/pyspec/eth2spec/test/helpers/block.py | sigp/eth2.0-specs | 2d13a3adec541259bf9bcc330b6d9f056b006081 | [
"CC0-1.0"
] | null | null | null | from copy import deepcopy
from eth2spec.test.helpers.keys import privkeys
from eth2spec.utils.bls import bls_sign, only_with_bls
from eth2spec.utils.ssz.ssz_impl import signing_root, hash_tree_root
# Fully ignore the function if BLS is off, beacon-proposer index calculation is slow.
@only_with_bls()
def sign_block(s... | 36.175676 | 97 | 0.697422 |
c2712f1633b20187a143ee00390ec1be2be14c85 | 3,094 | py | Python | meal_app/settings.py | Comcenn/Meal_Plan_API | e9e53f360447fb6227374959fc1357c3ceab2f1a | [
"MIT"
] | 1 | 2020-08-04T23:37:51.000Z | 2020-08-04T23:37:51.000Z | meal_app/settings.py | Comcenn/Meal_Plan_API | e9e53f360447fb6227374959fc1357c3ceab2f1a | [
"MIT"
] | null | null | null | meal_app/settings.py | Comcenn/Meal_Plan_API | e9e53f360447fb6227374959fc1357c3ceab2f1a | [
"MIT"
] | null | null | null | """
Django settings for meal_app project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 25.570248 | 91 | 0.695863 |
efcdc4b147df6e30766bcbb552d8a7da8cd32b1b | 4,660 | py | Python | rts/engine/compile_cmds.py | jedirv/ELF-OSU | 98bb2a68bbab5b6ac8925222a82738809db41f7d | [
"BSD-3-Clause"
] | 2 | 2019-07-15T00:18:52.000Z | 2021-02-09T22:12:45.000Z | rts/engine/compile_cmds.py | GaoFangshu/ELF-example | 8fbe6f0633c13378003282352f23cd08ca7a50f1 | [
"BSD-3-Clause"
] | null | null | null | rts/engine/compile_cmds.py | GaoFangshu/ELF-example | 8fbe6f0633c13378003282352f23cd08ca7a50f1 | [
"BSD-3-Clause"
] | 1 | 2019-11-01T02:20:55.000Z | 2019-11-01T02:20:55.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import os
import sys
imp... | 32.361111 | 127 | 0.584549 |
70e56b633d2995dd9914a8b2edd900424ca9f072 | 5,362 | py | Python | piqe_ocp_lib/tests/resources/test_ocp_base.py | vikasmulaje/piqe-ocp-lib | c7f98e2728db457d05b970d5bc5521d60271bca1 | [
"Apache-2.0"
] | null | null | null | piqe_ocp_lib/tests/resources/test_ocp_base.py | vikasmulaje/piqe-ocp-lib | c7f98e2728db457d05b970d5bc5521d60271bca1 | [
"Apache-2.0"
] | null | null | null | piqe_ocp_lib/tests/resources/test_ocp_base.py | vikasmulaje/piqe-ocp-lib | c7f98e2728db457d05b970d5bc5521d60271bca1 | [
"Apache-2.0"
] | null | null | null | import logging
from queue import Queue
from threading import Thread
from piqe_ocp_lib import __loggername__
from piqe_ocp_lib.api.resources import OcpBase
from piqe_ocp_lib.api.resources.ocp_base import Version
logger = logging.getLogger(__loggername__)
class TestOcpBase(object):
def test_init(self, get_kubecon... | 46.626087 | 119 | 0.700671 |
4bfca875283a28d7581502a78c3d970388a296f8 | 5,435 | py | Python | openstack_dashboard/dashboards/identity/users/tabs.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/identity/users/tabs.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/identity/users/tabs.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"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... | 34.617834 | 78 | 0.624655 |
435adb2d09bcb7705db9d1097654c9b3341ec0ef | 10,513 | py | Python | models/model.py | defaults/scribble | 37b08696debdd6d2d1a3b2bcd1912649e6871f88 | [
"MIT"
] | null | null | null | models/model.py | defaults/scribble | 37b08696debdd6d2d1a3b2bcd1912649e6871f88 | [
"MIT"
] | null | null | null | models/model.py | defaults/scribble | 37b08696debdd6d2d1a3b2bcd1912649e6871f88 | [
"MIT"
] | null | null | null | import json
import logging
import datetime
import types
import uuid
from datetime import datetime
import time
import webapp2_extras.appengine.auth.models
from google.appengine.ext import ndb
from webapp2_extras import security
from google.appengine.api import images
from google.appengine.ext import ndb
class Jsoni... | 34.133117 | 79 | 0.640255 |
9dc8b39980c22b503eb83e5a8f17308baca38766 | 1,086 | py | Python | tests/test_yacfg/files/test_paths.py | gaohoward/YamlConfiger | d5548ec6ca70e6646ea135454c503eff4da8a85e | [
"Apache-2.0"
] | null | null | null | tests/test_yacfg/files/test_paths.py | gaohoward/YamlConfiger | d5548ec6ca70e6646ea135454c503eff4da8a85e | [
"Apache-2.0"
] | 20 | 2020-11-16T16:40:04.000Z | 2022-03-28T19:16:53.000Z | tests/test_yacfg/files/test_paths.py | gaohoward/YamlConfiger | d5548ec6ca70e6646ea135454c503eff4da8a85e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.9375 | 74 | 0.774401 |
e0fa34c9103aaceeeb8ec1880d41cb8da2afb95a | 6,648 | py | Python | src/sentry/api/endpoints/organization_member_index.py | detouched/sentry | 1d3cc332c9ee1c2cf5ddaf1e850e14386c3684dd | [
"BSD-3-Clause"
] | 1 | 2018-12-04T12:57:00.000Z | 2018-12-04T12:57:00.000Z | src/sentry/api/endpoints/organization_member_index.py | detouched/sentry | 1d3cc332c9ee1c2cf5ddaf1e850e14386c3684dd | [
"BSD-3-Clause"
] | 1 | 2021-05-09T11:43:43.000Z | 2021-05-09T11:43:43.000Z | src/sentry/api/endpoints/organization_member_index.py | detouched/sentry | 1d3cc332c9ee1c2cf5ddaf1e850e14386c3684dd | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
from django.db import transaction, IntegrityError
from django.db.models import Q
from rest_framework import serializers
from rest_framework.response import Response
from django.conf import settings
from sentry.app import locks
from sentry import roles, features
from s... | 38.651163 | 120 | 0.632972 |
ae2387e278667ff31f8d49a47edd833fc1481ee1 | 1,353 | py | Python | tests/transform/test_unnester.py | akudan/purr | ca6a57217a2cd83fb267d06e8a77657e213f73ce | [
"MIT"
] | 4 | 2019-11-14T18:15:42.000Z | 2022-03-22T22:23:35.000Z | tests/transform/test_unnester.py | akudan/purr | ca6a57217a2cd83fb267d06e8a77657e213f73ce | [
"MIT"
] | 1 | 2020-01-17T22:33:53.000Z | 2020-01-29T21:53:51.000Z | tests/transform/test_unnester.py | akudan/purr | ca6a57217a2cd83fb267d06e8a77657e213f73ce | [
"MIT"
] | 1 | 2021-07-07T19:31:26.000Z | 2021-07-07T19:31:26.000Z | from etl.transform import unnester
import unittest
import datetime
from bson.json_util import ObjectId
class TestUnnester(unittest.TestCase):
def test_cast_number_text_to_double(self):
value_old = "2"
column_type = "double precision"
value_new = unnester.cast(value_old, column_type)
assert... | 31.465116 | 55 | 0.689579 |
664d64ea8dbb26f0c6177acd151a066d9ac92130 | 1,049 | py | Python | src/apps/datatables/models/draw_response.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | src/apps/datatables/models/draw_response.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | src/apps/datatables/models/draw_response.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | import json
class DrawResponse:
def __init__(self, draw):
self.draw = draw
self.records_total = 0
self.records_filtered = 0
self.data = []
self.query = ""
self.error = None
def to_json(self):
response = {}
response["draw"] = self.draw
resp... | 36.172414 | 198 | 0.632031 |
c7ac8b81413d6b8e088a11f5eb9f2e7972169806 | 2,339 | py | Python | FaceRecognition/face_recognition.py | BossLogic314/Machine-Learning | 34bb460bb6f2789c0010d43b8738fe01e6c3b62c | [
"Apache-2.0"
] | null | null | null | FaceRecognition/face_recognition.py | BossLogic314/Machine-Learning | 34bb460bb6f2789c0010d43b8738fe01e6c3b62c | [
"Apache-2.0"
] | null | null | null | FaceRecognition/face_recognition.py | BossLogic314/Machine-Learning | 34bb460bb6f2789c0010d43b8738fe01e6c3b62c | [
"Apache-2.0"
] | null | null | null | # Run this file only when some data is stored
import cv2
import sys
import os
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
# The name of the file where data is stored
file_name = "saved_data.npy"
# Checking if training data exists
if not os.path.exists(file_name):
print("Training data doe... | 27.517647 | 114 | 0.661821 |
102ef71d312ea56b44a2a70087b862a9f0ff5478 | 2,765 | py | Python | resources/Mocks.py | Eugene51-78/arm_prosthesis_raspberry | 9a80ffd29f4c027f6f5176faea079590b231ca6c | [
"MIT"
] | null | null | null | resources/Mocks.py | Eugene51-78/arm_prosthesis_raspberry | 9a80ffd29f4c027f6f5176faea079590b231ca6c | [
"MIT"
] | null | null | null | resources/Mocks.py | Eugene51-78/arm_prosthesis_raspberry | 9a80ffd29f4c027f6f5176faea079590b231ca6c | [
"MIT"
] | null | null | null | import random
'''
mocks instead of real interfaces
'''
def ADC_MOCK():
return random.randint(0, 65535)
def SPI_TELEMETRY_REQUEST_MOCK():
A = 0
B = random.randint(0, 65535)
C = random.randint(0, 65535)
D = random.randint(0, 65535)
E = random.randint(0, 65535)
F = random.randint(0, 65535)... | 35.909091 | 87 | 0.667631 |
1443f9f85c7e1231a1e0b02a47313c06580c8118 | 62,614 | py | Python | Lib/pdb.py | askervin/cpython | 001fee14e0f2ba5f41fb733adc69d5965925a094 | [
"CNRI-Python-GPL-Compatible"
] | 2 | 2019-05-26T16:03:33.000Z | 2019-06-15T10:18:13.000Z | Lib/pdb.py | askervin/cpython | 001fee14e0f2ba5f41fb733adc69d5965925a094 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/pdb.py | askervin/cpython | 001fee14e0f2ba5f41fb733adc69d5965925a094 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | #! /usr/bin/env python3
"""
The Python Debugger Pdb
=======================
To use the debugger in its simplest form:
>>> import pdb
>>> pdb.run('<a statement>')
The debugger's prompt is '(Pdb) '. This will stop in the first
function call in <a statement>.
Alternatively, if a statement terminated ... | 36.172155 | 80 | 0.571949 |
cef3e0c0dc97876cae42ddfb2da8f3d81590ed2f | 286 | py | Python | 746. Min Cost Climbing Stairs/solution1.py | zhoudaxia233/LeetCode | 66e8087e982f0517e22926a5574557ff006c9e4d | [
"MIT"
] | 3 | 2019-08-18T15:56:13.000Z | 2019-11-29T10:20:05.000Z | 746. Min Cost Climbing Stairs/solution1.py | zhoudaxia233/LeetCode | 66e8087e982f0517e22926a5574557ff006c9e4d | [
"MIT"
] | null | null | null | 746. Min Cost Climbing Stairs/solution1.py | zhoudaxia233/LeetCode | 66e8087e982f0517e22926a5574557ff006c9e4d | [
"MIT"
] | null | null | null | class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
n = len(cost)
dp = [None for _ in range(n+1)]
dp[0], dp[1] = 0, 0
for i in range(2, n+1):
dp[i] = min(dp[i-2] + cost[i-2], dp[i-1] + cost[i-1])
return dp[n]
| 31.777778 | 65 | 0.486014 |
bc16605de25f1282107af2ae25e4c2eb140810ce | 5,896 | py | Python | matchzoo/contrib/models/hbmp.py | baajur/MatchZoo | fe0ccdd82500d116a7f945539ed05566fce90434 | [
"Apache-2.0"
] | 2,209 | 2018-10-15T08:31:35.000Z | 2022-03-31T14:29:11.000Z | matchzoo/contrib/models/hbmp.py | baajur/MatchZoo | fe0ccdd82500d116a7f945539ed05566fce90434 | [
"Apache-2.0"
] | 398 | 2018-10-15T07:35:01.000Z | 2022-03-13T21:31:26.000Z | matchzoo/contrib/models/hbmp.py | baajur/MatchZoo | fe0ccdd82500d116a7f945539ed05566fce90434 | [
"Apache-2.0"
] | 535 | 2018-10-16T09:29:02.000Z | 2022-03-31T02:12:52.000Z | """HBMP model."""
import keras
import typing
from matchzoo.engine import hyper_spaces
from matchzoo.engine.param_table import ParamTable
from matchzoo.engine.param import Param
from matchzoo.engine.base_model import BaseModel
class HBMP(BaseModel):
"""
HBMP model.
Examples:
>>> model = HBMP()
... | 38.03871 | 79 | 0.60363 |
172bc634fa48ddf0f065fbcc1991cd3756cd7150 | 77 | py | Python | reviewbot/config/__init__.py | DiscordCodeReviewBot/CodeReviewBot | 239656ad4bb0064f257b0b9146c50901f1a6816d | [
"MIT"
] | null | null | null | reviewbot/config/__init__.py | DiscordCodeReviewBot/CodeReviewBot | 239656ad4bb0064f257b0b9146c50901f1a6816d | [
"MIT"
] | null | null | null | reviewbot/config/__init__.py | DiscordCodeReviewBot/CodeReviewBot | 239656ad4bb0064f257b0b9146c50901f1a6816d | [
"MIT"
] | null | null | null | from .config import CONFIG, LOGGER
__all__ = [
"CONFIG",
"LOGGER"
]
| 11 | 34 | 0.61039 |
564746f655148329abde7e95fe1210056e9fdcd9 | 6,343 | py | Python | motutils/via.py | smidm/motutils | 505d8359d4856c3cda7a3cf6acd4690c2dfe32d6 | [
"MIT"
] | 1 | 2022-01-06T19:02:21.000Z | 2022-01-06T19:02:21.000Z | motutils/via.py | smidm/motutils | 505d8359d4856c3cda7a3cf6acd4690c2dfe32d6 | [
"MIT"
] | null | null | null | motutils/via.py | smidm/motutils | 505d8359d4856c3cda7a3cf6acd4690c2dfe32d6 | [
"MIT"
] | null | null | null | import json
import random
import string
def via_json(video_filename, description=None):
"""
Create a dictionary to be saved as VIA json annotation file.
:param video_filename: relative video filename_or_buffer
:param description: annotation description
:return: dict
"""
json_template = ""... | 34.472826 | 110 | 0.566294 |
ec07035fd364222f99f17184cb1bedfcfab3336b | 642 | py | Python | gamestonk_terminal/discovery/spachero_api.py | aia/GamestonkTerminal-old | 6ce7966d805ed25c25756a79d43fbd96f0631fb4 | [
"MIT"
] | null | null | null | gamestonk_terminal/discovery/spachero_api.py | aia/GamestonkTerminal-old | 6ce7966d805ed25c25756a79d43fbd96f0631fb4 | [
"MIT"
] | null | null | null | gamestonk_terminal/discovery/spachero_api.py | aia/GamestonkTerminal-old | 6ce7966d805ed25c25756a79d43fbd96f0631fb4 | [
"MIT"
] | 2 | 2021-07-08T19:24:29.000Z | 2021-07-12T23:57:24.000Z | import argparse
import webbrowser
# ---------------------------------------------------- SPACHERO ----------------------------------------------------
def spachero(l_args):
parser = argparse.ArgumentParser(
prog="spachero",
description="""Great website for SPACs research. [Source: www.spachero.com]... | 27.913043 | 116 | 0.524922 |
cd54ad8760635d1fb7b05b29d16e6255c545c5f9 | 25,460 | py | Python | netket/vqs/mc/mc_state/state.py | wdphy16/netket | db73f0664b05d50ce059af5642e7f4bb6df7c13b | [
"Apache-2.0"
] | 352 | 2018-04-24T16:45:10.000Z | 2022-03-31T01:15:34.000Z | netket/vqs/mc/mc_state/state.py | wdphy16/netket | db73f0664b05d50ce059af5642e7f4bb6df7c13b | [
"Apache-2.0"
] | 947 | 2018-04-24T20:16:17.000Z | 2022-03-31T17:33:52.000Z | netket/vqs/mc/mc_state/state.py | tobiaswiener/netket | ab1fc406f7765e7191fc9ebbb01f766fa4c627a2 | [
"Apache-2.0"
] | 148 | 2018-04-25T02:44:20.000Z | 2022-03-11T11:42:34.000Z | # Copyright 2021 The NetKet 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 applicable ... | 37.386197 | 142 | 0.634721 |
0a48c0e7877cc911029ca656af046b3b0cb1ee40 | 10,558 | py | Python | AppServer/google/appengine/ext/deferred/deferred.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/google/appengine/ext/deferred/deferred.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/google/appengine/ext/deferred/deferred.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 31.993939 | 80 | 0.724569 |
5d063c4340471609b080056edfca320c4e8359b4 | 1,362 | py | Python | tests/generators/rewards/main.py | booleanfunction/eth2.0-specs | cf916dc147a5694e681bb52af7ebd2b156e1df78 | [
"CC0-1.0"
] | 1 | 2020-07-08T19:09:33.000Z | 2020-07-08T19:09:33.000Z | tests/generators/rewards/main.py | booleanfunction/eth2.0-specs | cf916dc147a5694e681bb52af7ebd2b156e1df78 | [
"CC0-1.0"
] | null | null | null | tests/generators/rewards/main.py | booleanfunction/eth2.0-specs | cf916dc147a5694e681bb52af7ebd2b156e1df78 | [
"CC0-1.0"
] | null | null | null | from typing import Iterable
from eth2spec.phase0 import spec as spec_phase0
from eth2spec.phase1 import spec as spec_phase1
from eth2spec.test.phase0.rewards import (
test_basic,
test_leak,
test_random,
)
from gen_base import gen_runner, gen_typing
from gen_from_tests.gen import generate_from_tests
from im... | 30.266667 | 76 | 0.711454 |
36e0934cc583d991be6fc5af3c1abb989cf080b6 | 398 | py | Python | app/__init__.py | mr-pagani/ADC-Questioner-API | e54f1cb8147d14f3e357c24dc2af2382f60bd1a4 | [
"Unlicense"
] | null | null | null | app/__init__.py | mr-pagani/ADC-Questioner-API | e54f1cb8147d14f3e357c24dc2af2382f60bd1a4 | [
"Unlicense"
] | 1 | 2019-01-15T14:42:36.000Z | 2019-01-15T14:42:36.000Z | app/__init__.py | mr-pagani/ADC-Questioner-API | e54f1cb8147d14f3e357c24dc2af2382f60bd1a4 | [
"Unlicense"
] | null | null | null | from flask import Flask
from instance.config import app_config
from .api.v1.views.meetups_endpoints import meetup
from .api.v1.views.questions_endpoints import question
def create_app(config):
'''function creating the flask app'''
app = Flask(__name__)
app.register_blueprint(meetup)
app.register_blue... | 26.533333 | 54 | 0.771357 |
863ec09308a51b287d97590a41cc35b2377bdbaf | 2,170 | py | Python | Contents/Libraries/Shared/rebulk/test/test_validators.py | jippo015/Sub-Zero.bundle | 734e0f7128c05c0f639e11e7dfc77daa1014064b | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/rebulk/test/test_validators.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/rebulk/test/test_validators.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name,len-as-condition
from functools import partial
from rebulk.pattern import StringPattern
from ..validators import chars_before, chars_after, chars_surround, validators
chars = ' _.'
left ... | 33.384615 | 100 | 0.707373 |
fa1cb5183d261f19f385c5e9ae82f682dcc036b5 | 608 | py | Python | trails/feeds/emergingthreatsbot.py | gitty8/maltrail | 3da04d0a1b46edb5a448189f02c63d4f26e65146 | [
"MIT"
] | 2 | 2021-04-06T06:53:00.000Z | 2021-04-24T23:11:03.000Z | trails/feeds/emergingthreatsbot.py | oandersonbsilva/maltrail | 8be811cf798c7562c81ab5a4d00e08e113f526a9 | [
"MIT"
] | null | null | null | trails/feeds/emergingthreatsbot.py | oandersonbsilva/maltrail | 8be811cf798c7562c81ab5a4d00e08e113f526a9 | [
"MIT"
] | 2 | 2020-09-22T11:37:34.000Z | 2020-11-05T19:36:07.000Z | #!/usr/bin/env python
"""
Copyright (c) 2014-2017 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import re
from core.common import retrieve_content
__url__ = "http://rules.emergingthreats.net/open/suricata/rules/botcc.rules"
__check__ = "CnC Server"
__info__ = "potential malware site... | 23.384615 | 76 | 0.692434 |
ad47fd84c453f4be96859d2fa523dfc3116f1a38 | 1,029 | py | Python | test/test_del_contact.py | pvserge/python_traning | 069148647f00b634e0817dc3a92c32f677cc5b1e | [
"Apache-2.0"
] | null | null | null | test/test_del_contact.py | pvserge/python_traning | 069148647f00b634e0817dc3a92c32f677cc5b1e | [
"Apache-2.0"
] | null | null | null | test/test_del_contact.py | pvserge/python_traning | 069148647f00b634e0817dc3a92c32f677cc5b1e | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
import random
import allure
def test_delete_random_contact(app, orm, check_ui):
with allure.step('Given a non-empty contact list'):
if len(orm.get_contact_list()) == 0:
app.contact.create(Contact(firstname="Del Contact"))
old_contacts = orm.get_contact... | 46.772727 | 127 | 0.710398 |
f2d437f53910f7a129938e58bae0b92bf0d01667 | 6,599 | py | Python | src/core/build/build_manager.py | openharmony-gitee-mirror/test_developertest | 49c7d7ade2ee54a3a49a306fedb06d1c845042db | [
"Apache-2.0"
] | null | null | null | src/core/build/build_manager.py | openharmony-gitee-mirror/test_developertest | 49c7d7ade2ee54a3a49a306fedb06d1c845042db | [
"Apache-2.0"
] | null | null | null | src/core/build/build_manager.py | openharmony-gitee-mirror/test_developertest | 49c7d7ade2ee54a3a49a306fedb06d1c845042db | [
"Apache-2.0"
] | 1 | 2021-09-13T11:13:51.000Z | 2021-09-13T11:13:51.000Z | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 38.590643 | 78 | 0.556145 |
274d98f3da090e29349d837b668e2415a7929ecb | 8,118 | py | Python | tests/test_schultz.py | Luke-Poeppel/decitala | dc5e26123605606014e32f44bde11a7f85cc93b1 | [
"MIT"
] | 6 | 2021-03-24T13:43:10.000Z | 2021-07-22T08:00:35.000Z | tests/test_schultz.py | Luke-Poeppel/decitala | dc5e26123605606014e32f44bde11a7f85cc93b1 | [
"MIT"
] | 177 | 2021-03-22T17:17:40.000Z | 2021-09-22T12:56:45.000Z | tests/test_schultz.py | Luke-Poeppel/decitala | dc5e26123605606014e32f44bde11a7f85cc93b1 | [
"MIT"
] | null | null | null | import doctest
import copy
from decitala.hm import schultz
from decitala.hm import contour
def test_doctests():
assert doctest.testmod(schultz, raise_on_error=True)
####################################################################################################
# Tools
def test_no_schultz_repetition():
c = [[1... | 30.86692 | 120 | 0.614191 |
38ce2d1da9acee8144b9243dc2aecb1a6efee290 | 217 | py | Python | sasquatch/__init__.py | tmacro/s4 | 58729b61f56ff928c8fe928fb02816e5025ad588 | [
"BSD-3-Clause"
] | 6 | 2018-12-04T01:13:10.000Z | 2019-06-18T23:25:59.000Z | sasquatch/__init__.py | tmacro/s4 | 58729b61f56ff928c8fe928fb02816e5025ad588 | [
"BSD-3-Clause"
] | 15 | 2018-12-01T00:13:41.000Z | 2021-06-01T23:05:08.000Z | sasquatch/__init__.py | tmacro/sasquatch | 58729b61f56ff928c8fe928fb02816e5025ad588 | [
"BSD-3-Clause"
] | null | null | null | import logging
__version__ = '0.0.1'
from . import cli
from .util.conf import config
from .util.log import setupLogging
setupLogging(config.meta.name, __version__, **config.logging._asdict())
from . import entry
| 16.692308 | 71 | 0.760369 |
2d61a536e291cb77e8f8caa2260b3daa83c72966 | 10,982 | py | Python | tensorflow/python/ops/linalg/linear_operator_toeplitz.py | Dynmi/tensorflow | 74f953df1b3a3e2f32ffdd0065322a0aa9df53e2 | [
"Apache-2.0"
] | 1 | 2020-08-15T02:54:36.000Z | 2020-08-15T02:54:36.000Z | tensorflow/python/ops/linalg/linear_operator_toeplitz.py | Dynmi/tensorflow | 74f953df1b3a3e2f32ffdd0065322a0aa9df53e2 | [
"Apache-2.0"
] | 3 | 2021-08-25T16:13:38.000Z | 2022-02-10T02:04:06.000Z | tensorflow/python/ops/linalg/linear_operator_toeplitz.py | Dynmi/tensorflow | 74f953df1b3a3e2f32ffdd0065322a0aa9df53e2 | [
"Apache-2.0"
] | 1 | 2021-11-07T12:48:44.000Z | 2021-11-07T12:48:44.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.362007 | 99 | 0.663176 |
a8a8c5b9295decf0d6eaa8545d1acbeea4c587cd | 1,861 | py | Python | code/version3.0/common/vision/datasets/_util.py | junzhin/Science_Research_Project | 39eab889b76ee87dc2182f238329157bc1390e58 | [
"MIT"
] | 17 | 2021-06-02T02:03:55.000Z | 2022-03-22T10:22:50.000Z | code/version3.0/common/vision/datasets/_util.py | junzhin/Science_Research_Project | 39eab889b76ee87dc2182f238329157bc1390e58 | [
"MIT"
] | 1 | 2021-12-01T15:13:42.000Z | 2021-12-02T01:45:18.000Z | code/version3.0/common/vision/datasets/_util.py | junzhin/Science_Research_Project | 39eab889b76ee87dc2182f238329157bc1390e58 | [
"MIT"
] | 1 | 2022-03-27T09:50:37.000Z | 2022-03-27T09:50:37.000Z | import os
from typing import List
from torchvision.datasets.utils import download_and_extract_archive
def download(root: str, file_name: str, archive_name: str, url_link: str):
"""
Download file from internet url link.
Args:
root (str) The directory to put downloaded files.
file_name: (str... | 42.295455 | 116 | 0.656636 |
0b44d8d3fdfaeb3d3415c0cf4c4e33ed9565768d | 2,987 | py | Python | BUILD/doc/source/examples/export_basetype_csv_with_explode_true_code.py | netsec/pytan | 29a3484d21cb90d8896275febd1c535e4f3cdc7e | [
"MIT"
] | 1 | 2019-01-29T21:22:06.000Z | 2019-01-29T21:22:06.000Z | BUILD/doc/source/examples/export_basetype_csv_with_explode_true_code.py | c1rdan/pytan | 5e537a6dcf4136e3b9c3905a39f073396e7f044f | [
"MIT"
] | null | null | null | BUILD/doc/source/examples/export_basetype_csv_with_explode_true_code.py | c1rdan/pytan | 5e537a6dcf4136e3b9c3905a39f073396e7f044f | [
"MIT"
] | null | null | null | # import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... | 32.467391 | 90 | 0.739203 |
ce762522a0071947fcbc18c083d06ea9a0e8fe15 | 2,978 | py | Python | libyiban/YiBanArticle.py | EZForever/libyiban | 16f4bb3a3d8a7362f0fe43b9ed40ff3bb2beea77 | [
"MIT"
] | null | null | null | libyiban/YiBanArticle.py | EZForever/libyiban | 16f4bb3a3d8a7362f0fe43b9ed40ff3bb2beea77 | [
"MIT"
] | null | null | null | libyiban/YiBanArticle.py | EZForever/libyiban | 16f4bb3a3d8a7362f0fe43b9ed40ff3bb2beea77 | [
"MIT"
] | null | null | null |
class YiBanArticle:
'''
Handles article operations.
User should not create YiBanArticle instances manually;
use YiBanGroup.get_articles() or YiBanGroup.new_article() instead.
'''
def __init__(self, account, puid, cid, aid):
'''
Initiate a new YiBanArticle instance.
... | 33.088889 | 87 | 0.527199 |
b6d02d72e91b6b3c0328b610dd4914417f759a36 | 19,181 | py | Python | paddle2onnx/op_mapper/detection/yolo_box.py | neonhuang/Paddle2ONNX | 96640ccbeea1ae4e628dde20b3dbb1c3b4ef2702 | [
"Apache-2.0"
] | 95 | 2019-09-27T14:26:59.000Z | 2020-12-08T01:20:28.000Z | paddle2onnx/op_mapper/detection/yolo_box.py | neonhuang/Paddle2ONNX | 96640ccbeea1ae4e628dde20b3dbb1c3b4ef2702 | [
"Apache-2.0"
] | 51 | 2018-04-04T22:39:30.000Z | 2019-08-28T20:19:14.000Z | paddle2onnx/op_mapper/detection/yolo_box.py | neonhuang/Paddle2ONNX | 96640ccbeea1ae4e628dde20b3dbb1c3b4ef2702 | [
"Apache-2.0"
] | 22 | 2019-09-03T08:50:04.000Z | 2020-12-02T11:05:42.000Z | # Copyright (c) 2020 PaddlePaddle 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 applic... | 37.832347 | 80 | 0.595642 |
07437e026d5beb2ae8f38e064bd916d852cce3f8 | 42,749 | py | Python | airflow/serialization/serialized_objects.py | fernandobugni/airflow | bc76126a9f6172a360fd4301eeb82372d000f70a | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2020-12-25T04:09:44.000Z | 2021-04-02T13:37:42.000Z | airflow/serialization/serialized_objects.py | sdwivedi565/airflow | 78e4d16d970dbcb599d9c7f8df2a1a4273649ae8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-12-28T04:01:29.000Z | 2021-12-28T04:05:00.000Z | airflow/serialization/serialized_objects.py | MatrixManAtYrService/airflow-challenge | cef498efe9f4818e5f8e85c179ca730e84b31f4a | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-23T22:09:17.000Z | 2020-12-23T22:09:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.74707 | 110 | 0.649699 |
a247ea7cacbe3d4bec83690e9793b94ce50d5f23 | 3,010 | py | Python | tests/test_rarfile.py | davide-romanini/unrar-cffi | ce0222166556fff40285261cf9b79b856579242c | [
"Apache-2.0"
] | 3 | 2020-04-21T21:32:54.000Z | 2021-06-17T20:08:54.000Z | tests/test_rarfile.py | davide-romanini/unrar-cffi | ce0222166556fff40285261cf9b79b856579242c | [
"Apache-2.0"
] | 6 | 2019-10-19T19:14:19.000Z | 2021-01-01T22:20:27.000Z | tests/test_rarfile.py | davide-romanini/unrar-cffi | ce0222166556fff40285261cf9b79b856579242c | [
"Apache-2.0"
] | 1 | 2020-04-23T04:25:52.000Z | 2020-04-23T04:25:52.000Z | from os.path import realpath, dirname, join
from pytest import fixture, raises
from unrar.cffi.rarfile import is_rarfile, RarFile, RarFileError
thisdir = realpath(dirname(__file__))
@fixture
def rar():
return RarFile(join(thisdir, 'test_rar.rar'))
@fixture
def rar_no_comment():
return RarFile(join(thisdir, '... | 29.509804 | 104 | 0.672093 |
10deb2ae5b4af040a3250c5d67d51d0b2e85f7d7 | 3,251 | py | Python | Source/FaceRecognition/Services/NewIdentitiesManager.py | robertkarol/ReDe-Multiagent-Face-Recognition-System | df17cebecc51b2fafb01e07a9bb68e9e4e04163a | [
"MIT"
] | null | null | null | Source/FaceRecognition/Services/NewIdentitiesManager.py | robertkarol/ReDe-Multiagent-Face-Recognition-System | df17cebecc51b2fafb01e07a9bb68e9e4e04163a | [
"MIT"
] | 7 | 2020-04-24T08:22:20.000Z | 2021-05-21T16:11:52.000Z | Source/FaceRecognition/Services/NewIdentitiesManager.py | robertkarol/ReDe-Multiagent-Face-Recognition-System | df17cebecc51b2fafb01e07a9bb68e9e4e04163a | [
"MIT"
] | 1 | 2020-04-26T15:05:07.000Z | 2020-04-26T15:05:07.000Z | from Services.DirectoryContentVersioner import DirectoryContentVersioner
from Services.RecognitionLocationsManager import RecognitionLocationsManager
from Utils.Singleton import SingletonPerKey
from multiprocessing import Lock
from os import path, mkdir, listdir
from typing import Iterable
class NewIdentitiesManager(... | 45.788732 | 116 | 0.702553 |
62567dfd2c42cd9dec9a3ace5ec8e97474808aa2 | 4,546 | py | Python | main.py | plibither8/ulauncher-vscode-recent | 4abe46f8975434c9a4d0aac5e3cfc2ceb4e035fb | [
"MIT"
] | 9 | 2021-08-29T08:50:40.000Z | 2022-01-30T12:09:04.000Z | main.py | mattalexx/ulauncher-vscode-recent | 4abe46f8975434c9a4d0aac5e3cfc2ceb4e035fb | [
"MIT"
] | 13 | 2021-08-29T08:44:34.000Z | 2022-02-10T17:26:46.000Z | main.py | plibither8/ulauncher-vscode-recent | 4abe46f8975434c9a4d0aac5e3cfc2ceb4e035fb | [
"MIT"
] | 8 | 2021-08-29T08:24:21.000Z | 2022-01-10T10:09:21.000Z | import os
import os.path
import json
import pathlib
from types import prepare_class
from ulauncher.api.client.Extension import Extension
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import (
KeywordQueryEvent,
ItemEnterEvent,
PreferencesEvent,
PreferencesUpdateEvent,
... | 30.716216 | 121 | 0.734932 |
6da53aa081b6c4fd601c4e2233008ed32d36dee9 | 220 | py | Python | pymarshaler/__init__.py | hgromer/pymarshal | 55870037e5082b0d53a216a0a7d2f33ee3920018 | [
"MIT"
] | 3 | 2020-11-07T13:23:19.000Z | 2020-11-08T11:03:31.000Z | pymarshaler/__init__.py | hgromer/pymarshal | 55870037e5082b0d53a216a0a7d2f33ee3920018 | [
"MIT"
] | 1 | 2020-11-08T11:01:23.000Z | 2020-11-08T14:01:44.000Z | pymarshaler/__init__.py | hgromer/pymarshall | 55870037e5082b0d53a216a0a7d2f33ee3920018 | [
"MIT"
] | null | null | null | __version__ = '0.4.0'
__all__ = ['Marshal', 'utils', 'arg_delegates', 'errors']
from pymarshaler import arg_delegates
from pymarshaler import errors
from pymarshaler import utils
from pymarshaler.marshal import Marshal
| 27.5 | 57 | 0.790909 |
f028a69f5bfe20e1108605dad9f1679a769f7487 | 3,297 | py | Python | mj_envs/mj_envs/utils/xml_utils.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | mj_envs/mj_envs/utils/xml_utils.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | mj_envs/mj_envs/utils/xml_utils.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | import xml.etree.ElementTree as ET
from xml.dom import minidom
import sys
def parse_xml_with_comments(xml_path: str):
"""
Parse XML while preserving comments.
Input:
xml_path: Path to XML file
Outputs:
tree : Parsed tree
"""
if sys.version_info[0]+0.1*sys.vers... | 31.701923 | 99 | 0.629663 |
d1d4e0abae4e0b1b0d1dd5f6e227510a89f7a1aa | 68,548 | py | Python | versioned_hdf5/tests/test_api.py | takluyver/versioned-hdf5 | 6fda5c803346e9be1dff459080566863f71cdc78 | [
"BSD-3-Clause"
] | null | null | null | versioned_hdf5/tests/test_api.py | takluyver/versioned-hdf5 | 6fda5c803346e9be1dff459080566863f71cdc78 | [
"BSD-3-Clause"
] | null | null | null | versioned_hdf5/tests/test_api.py | takluyver/versioned-hdf5 | 6fda5c803346e9be1dff459080566863f71cdc78 | [
"BSD-3-Clause"
] | null | null | null | import os
import itertools
from pytest import raises, mark
import h5py
import datetime
import numpy as np
from numpy.testing import assert_equal
from .helpers import setup
from ..backend import DEFAULT_CHUNK_SIZE
from ..api import VersionedHDF5File
from ..versions import TIMESTAMP_FMT
from ..wrappers import (InMem... | 39.350172 | 118 | 0.639289 |
591dcb9b173b1e44c42cfe3b6205e9e82ec612eb | 6,700 | py | Python | a10/a10/asvr/protocols/A10Keylime.py | JLenssen/AttestationEngine | a89fa1aee706dbe85092585be72592d405c6c7b4 | [
"BSD-3-Clause-Clear"
] | 7 | 2021-10-20T05:22:47.000Z | 2022-01-31T14:46:14.000Z | a10/a10/asvr/protocols/A10Keylime.py | JLenssen/AttestationEngine | a89fa1aee706dbe85092585be72592d405c6c7b4 | [
"BSD-3-Clause-Clear"
] | 15 | 2021-11-21T23:27:36.000Z | 2022-03-25T11:35:07.000Z | a10/a10/asvr/protocols/A10Keylime.py | Cyroxin/AttestationEngine | 4f20d7d364c72bb3a60fd711f55e1d206931d5d6 | [
"BSD-3-Clause-Clear"
] | 5 | 2021-12-08T20:55:34.000Z | 2022-03-29T11:41:33.000Z | #Copyright 2021 Nokia, Thore Sommer
#Licensed under the BSD 3-Clause Clear License.
#SPDX-License-Identifier: BSD-3-Clear
import random
import subprocess
import tempfile
import zlib
import requests
import string
import base64
import yaml
import a10.asvr.protocols.A10ProtocolBase
import a10.structures.constants
im... | 36.021505 | 130 | 0.620896 |
bd70f95734b70adecdf6515412e876fbaaf8215d | 342 | py | Python | yakutils/_random.py | philippeitis/yakutils | 4c96b9ec8ac7b454377d6b3404d151779b34c651 | [
"MIT-0"
] | null | null | null | yakutils/_random.py | philippeitis/yakutils | 4c96b9ec8ac7b454377d6b3404d151779b34c651 | [
"MIT-0"
] | null | null | null | yakutils/_random.py | philippeitis/yakutils | 4c96b9ec8ac7b454377d6b3404d151779b34c651 | [
"MIT-0"
] | null | null | null | """This module contains boilerplate random helpers."""
import random
from string import ascii_letters
from string import digits
__all__ = ["random_string"]
def random_string(n):
"""Generate a random alphanumeric string of size ``n``."""
symbols = ascii_letters + digits
return "".join(random.choice(symbol... | 26.307692 | 62 | 0.72807 |
5f2e9565bce4a70a5887c45d1008445caf317305 | 300 | py | Python | tests/conftest.py | rchildre3/fastuuid | d613378fbcd76369ca8f1a70c57cebd16b911dea | [
"BSD-3-Clause"
] | 73 | 2019-06-03T14:03:55.000Z | 2022-03-25T01:45:20.000Z | tests/conftest.py | rchildre3/fastuuid | d613378fbcd76369ca8f1a70c57cebd16b911dea | [
"BSD-3-Clause"
] | 10 | 2020-01-11T12:20:53.000Z | 2022-03-23T14:28:19.000Z | tests/conftest.py | rchildre3/fastuuid | d613378fbcd76369ca8f1a70c57cebd16b911dea | [
"BSD-3-Clause"
] | 8 | 2020-01-13T14:31:47.000Z | 2022-03-01T05:49:03.000Z | import os
from hypothesis import Verbosity, settings
settings.register_profile("ci", max_examples=2000)
settings.register_profile("dev", max_examples=100)
settings.register_profile("debug", max_examples=10, verbosity=Verbosity.verbose)
settings.load_profile(os.getenv(u'HYPOTHESIS_PROFILE', 'ci'))
| 33.333333 | 80 | 0.82 |
549f0d32d4b6b37f801dfd4db4243fb9493d002a | 3,077 | py | Python | venv/Lib/site-packages/geventwebsocket/resource.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 129 | 2015-01-06T11:02:25.000Z | 2022-03-15T03:48:18.000Z | venv/Lib/site-packages/geventwebsocket/resource.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 9 | 2021-08-14T01:27:36.000Z | 2021-08-24T18:10:18.000Z | venv/Lib/site-packages/geventwebsocket/resource.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 57 | 2015-01-13T03:49:55.000Z | 2022-01-13T09:47:11.000Z | import re
import warnings
from .protocols.base import BaseProtocol
from .exceptions import WebSocketError
try:
from collections import OrderedDict
except ImportError:
class OrderedDict:
pass
class WebSocketApplication(object):
protocol_class = BaseProtocol
def __init__(self, ws):
se... | 30.465347 | 80 | 0.618135 |
f2653538b7aafd37d26f5763cdad0b2e4f5e044c | 1,109 | py | Python | amnesia/modules/file/model.py | silenius/amnesia | ba5e3ac79a89da599c22206ad1fd17541855f74c | [
"BSD-2-Clause"
] | 4 | 2015-05-08T10:57:56.000Z | 2021-05-17T04:32:11.000Z | amnesia/modules/file/model.py | silenius/amnesia | ba5e3ac79a89da599c22206ad1fd17541855f74c | [
"BSD-2-Clause"
] | 6 | 2019-12-26T16:43:41.000Z | 2022-02-28T11:07:54.000Z | amnesia/modules/file/model.py | silenius/amnesia | ba5e3ac79a89da599c22206ad1fd17541855f74c | [
"BSD-2-Clause"
] | 1 | 2019-09-23T14:08:11.000Z | 2019-09-23T14:08:11.000Z | # -*- coding: utf-8 -*-
# pylint: disable=E1101
import os.path
from hashids import Hashids
from amnesia.modules.content import Content
class File(Content):
def feed(self, **kwargs):
for c in ('file_size', 'mime_id', 'original_name'):
if c in kwargs:
setattr(self, c, kwargs... | 25.790698 | 70 | 0.608656 |
464db288880d4f67f1dd6c84727d6a1294efb587 | 1,487 | py | Python | pcat2py/class/23259178-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/23259178-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/23259178-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
# 23259178-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... | 39.131579 | 164 | 0.60928 |
28e5d6ab221c98b85e0fb6baba31ae2914d305e3 | 11,073 | py | Python | yellowbrick/features/scatter.py | thekylesaurus/yellowbrick | 7447db6ccc30aea9f38d063162eab55e485dfa9d | [
"Apache-2.0"
] | null | null | null | yellowbrick/features/scatter.py | thekylesaurus/yellowbrick | 7447db6ccc30aea9f38d063162eab55e485dfa9d | [
"Apache-2.0"
] | null | null | null | yellowbrick/features/scatter.py | thekylesaurus/yellowbrick | 7447db6ccc30aea9f38d063162eab55e485dfa9d | [
"Apache-2.0"
] | null | null | null | # yellowbrick.features.scatter
# Implements a 2d scatter plot for feature analysis.
#
# Author: Nathan Danielsen <nathan.danielsen@gmail.com>
# Created: Fri Feb 26 19:40:00 2017 -0400
#
# For license information, see LICENSE.txt
#
# ID: scatter.py [fc94ec4] ndanielsen@users.noreply.github.com $
"""
Implements a 2D s... | 35.376997 | 90 | 0.587826 |
3c2f70f876a87ed997205254e4e1811e33fc9e1e | 1,270 | py | Python | book_sites/book/migrations/0035_auto_20180317_1320.py | Michelle-Hung/Books | 4f38307974cdae03f7f104e6ad1aa3d051979847 | [
"MIT"
] | null | null | null | book_sites/book/migrations/0035_auto_20180317_1320.py | Michelle-Hung/Books | 4f38307974cdae03f7f104e6ad1aa3d051979847 | [
"MIT"
] | null | null | null | book_sites/book/migrations/0035_auto_20180317_1320.py | Michelle-Hung/Books | 4f38307974cdae03f7f104e6ad1aa3d051979847 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-17 05:20
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | 31.75 | 116 | 0.615748 |
e7469fe41ace154cdd2b76613c69a98630149554 | 567 | py | Python | start-tag.py | greati/timewarrior-polybar | 07e5133158cdf7ce18fc1e593c4a1ff5f5401aa9 | [
"MIT"
] | 2 | 2021-10-04T09:05:17.000Z | 2022-03-17T07:38:17.000Z | start-tag.py | greati/timewarrior-polybar | 07e5133158cdf7ce18fc1e593c4a1ff5f5401aa9 | [
"MIT"
] | null | null | null | start-tag.py | greati/timewarrior-polybar | 07e5133158cdf7ce18fc1e593c4a1ff5f5401aa9 | [
"MIT"
] | null | null | null | import tkinter as ttk
import timew
timew = timew.TimeWarrior()
win = ttk.Tk()
win.title("Start tracking")
lbl = ttk.Label(win, text = "Tag: ").grid(column = 0, row = 0)
def click():
tag = name.get()
if tag is not None and tag != "":
timew.start(tags=[tag])
win.quit()
name = ttk.StringVar()
nam... | 28.35 | 110 | 0.652557 |
001277bb345486fa0948520f6a6d958044c6b2b6 | 16,699 | py | Python | perform_sdc.py | Promech2020/COVID_19_SDC_YOLOV4 | 7ba3d110f72f315d8ee2ec68db773d3d7d399774 | [
"MIT"
] | null | null | null | perform_sdc.py | Promech2020/COVID_19_SDC_YOLOV4 | 7ba3d110f72f315d8ee2ec68db773d3d7d399774 | [
"MIT"
] | null | null | null | perform_sdc.py | Promech2020/COVID_19_SDC_YOLOV4 | 7ba3d110f72f315d8ee2ec68db773d3d7d399774 | [
"MIT"
] | null | null | null | import time
import copy
import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
from absl import app, flags, logging
from absl.flags import FLAGS
import core.utils as utils
from c... | 38.655093 | 156 | 0.569974 |
fd487ca0aad29d5e5f98523aa7346a19a6ab0ea8 | 2,186 | py | Python | tests/tests_geomstats/test_full_rank_matrices.py | saltwater-tensor/geomstats | c1b6efb937c07a192866215d07cc747ab0e237d8 | [
"MIT"
] | null | null | null | tests/tests_geomstats/test_full_rank_matrices.py | saltwater-tensor/geomstats | c1b6efb937c07a192866215d07cc747ab0e237d8 | [
"MIT"
] | null | null | null | tests/tests_geomstats/test_full_rank_matrices.py | saltwater-tensor/geomstats | c1b6efb937c07a192866215d07cc747ab0e237d8 | [
"MIT"
] | null | null | null | """Unit tests for full rank matrices."""
import geomstats.backend as gs
from geomstats.geometry.full_rank_matrices import FullRankMatrices
from tests.conftest import Parametrizer, TestCase, TestData
class TestFullRankMatrices(TestCase, metaclass=Parametrizer):
cls = FullRankMatrices
class TestDataFullRankM... | 34.15625 | 88 | 0.515096 |
80d00caa0ad6320d279068d75ad2b3db267e4d09 | 34,426 | py | Python | tensorflow_transform/mappers_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tensorflow_transform/mappers_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tensorflow_transform/mappers_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.524684 | 80 | 0.541887 |
5c456b13196b3432f9b84ca9d550e33045eeb727 | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | Soham985/profiles-rest-api | 62ac2e144c4d7a60e7d1000e51f93d2f563190bd | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | Soham985/profiles-rest-api | 62ac2e144c4d7a60e7d1000e51f93d2f563190bd | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | Soham985/profiles-rest-api | 62ac2e144c4d7a60e7d1000e51f93d2f563190bd | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-03-26 07:23
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
ee90050d3dd3b054612e8ddba35225c88dd2af0a | 8,277 | py | Python | python/GafferSceneUI/SceneHierarchy.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneUI/SceneHierarchy.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneUI/SceneHierarchy.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 41.179104 | 139 | 0.732874 |
bf65c29a3990f55c41d96b7acfc52b0ac6e4c7b1 | 3,736 | py | Python | ckanext/dalrrd_emc_dcpr/model/dcpr_error_report.py | ricardogsilva/ckanext-dalrrd-emc-dcpr | 6e5417a881affb36212b156e320f761ce5291120 | [
"MIT"
] | null | null | null | ckanext/dalrrd_emc_dcpr/model/dcpr_error_report.py | ricardogsilva/ckanext-dalrrd-emc-dcpr | 6e5417a881affb36212b156e320f761ce5291120 | [
"MIT"
] | 99 | 2021-10-07T10:50:04.000Z | 2022-03-28T16:46:01.000Z | ckanext/dalrrd_emc_dcpr/model/dcpr_error_report.py | kartoza/ckanext-dalrrd-emc-dcpr | 6e5417a881affb36212b156e320f761ce5291120 | [
"MIT"
] | 2 | 2021-09-30T07:23:38.000Z | 2021-10-05T16:40:13.000Z | import datetime
from typing import Optional
from logging import getLogger
log = getLogger(__name__)
from sqlalchemy import orm, types, Column, Table, ForeignKey
from ckan.model import core, domain_object, meta, types as _types, Session, Package
dcpr_error_report_table = Table(
"dcpr_error_report",
meta.met... | 31.394958 | 87 | 0.661403 |
b435507b54398383c8051957b0bdf085c31b41d5 | 441 | py | Python | setup.py | rcbops-qe/monster | bb8b5ec3f0c4f383c17a8eb42859d803c4e907fe | [
"Apache-2.0"
] | 1 | 2015-02-04T13:22:14.000Z | 2015-02-04T13:22:14.000Z | setup.py | rcbops-qe/monster | bb8b5ec3f0c4f383c17a8eb42859d803c4e907fe | [
"Apache-2.0"
] | null | null | null | setup.py | rcbops-qe/monster | bb8b5ec3f0c4f383c17a8eb42859d803c4e907fe | [
"Apache-2.0"
] | 1 | 2015-08-09T17:06:17.000Z | 2015-08-09T17:06:17.000Z | import setuptools
import monster.info as info
setuptools.setup(
name=info.__appname__,
version=info.__version__,
author=info.__author__,
author_email=info.__email__,
description=info.__description__,
url=info.__url__,
packages=setuptools.find_packages(),
package_data={
'': ['*.y... | 22.05 | 46 | 0.646259 |
757560c1a9c4ce7a4059fa699f304d48d541d460 | 395 | py | Python | PersonalCV/asgi.py | kerusey/PersonalCV | d992f7bb8f45b257a294fac672af572869645a9a | [
"MIT"
] | null | null | null | PersonalCV/asgi.py | kerusey/PersonalCV | d992f7bb8f45b257a294fac672af572869645a9a | [
"MIT"
] | 5 | 2021-08-19T14:14:54.000Z | 2021-09-01T15:41:07.000Z | PersonalCV/asgi.py | kerusey/PersonalCV | d992f7bb8f45b257a294fac672af572869645a9a | [
"MIT"
] | 1 | 2021-08-22T18:34:14.000Z | 2021-08-22T18:34:14.000Z | """ASGI config for WebManager project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 26.333333 | 78 | 0.792405 |
59b762aac5f61c838b4d6ef9a6f67937b4e5e920 | 2,596 | py | Python | aliyun-python-sdk-alimt/setup.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-alimt/setup.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-alimt/setup.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"... | 30.541176 | 69 | 0.667951 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.