hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13df30d351901d02b18ff47f7fcc1cdf57cf3412 | 198 | py | Python | bootstrap_modal_forms/forms.py | uhuntu/django-bootstrap-modal-forms | e725643ac6233c04763f886b67127c7df06e5d71 | [
"MIT"
] | null | null | null | bootstrap_modal_forms/forms.py | uhuntu/django-bootstrap-modal-forms | e725643ac6233c04763f886b67127c7df06e5d71 | [
"MIT"
] | null | null | null | bootstrap_modal_forms/forms.py | uhuntu/django-bootstrap-modal-forms | e725643ac6233c04763f886b67127c7df06e5d71 | [
"MIT"
] | null | null | null | from django import forms
from bootstrap_modal_forms.mixins import PopRequestMixin, CreateUpdateAjaxMixin
class BSModalForm(PopRequestMixin, CreateUpdateAjaxMixin, forms.ModelForm):
pass
| 28.285714 | 80 | 0.828283 |
de502f3c799701e9dc8774a83e9e6ac2d430b20a | 2,324 | py | Python | pai/pouw/verification/verifier_pb2_grpc.py | projectpai/pouw-main-iteration | e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e | [
"MIT"
] | 11 | 2020-06-22T05:31:18.000Z | 2022-03-29T16:50:21.000Z | pai/pouw/verification/verifier_pb2_grpc.py | AIIJJII/pouw-main-iteration | e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e | [
"MIT"
] | 3 | 2020-06-23T18:20:09.000Z | 2021-07-06T23:28:24.000Z | pai/pouw/verification/verifier_pb2_grpc.py | AIIJJII/pouw-main-iteration | e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e | [
"MIT"
] | 3 | 2020-09-02T11:03:16.000Z | 2022-03-29T16:50:00.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import verifier_pb2 as verifier__pb2
class VerifierStub(object):
"""definition of verifier service
"""
def __init__(self, channel):
"""Con... | 33.2 | 103 | 0.655336 |
fc4900986b8d537635259a1bfe79132c14ac863a | 3,283 | py | Python | captum/attr/_utils/class_summarizer.py | caraya10/captum | 258928905875c18e85a2413b3bb97def1bfb730a | [
"BSD-3-Clause"
] | 1 | 2022-01-05T14:17:48.000Z | 2022-01-05T14:17:48.000Z | captum/attr/_utils/class_summarizer.py | caraya10/captum | 258928905875c18e85a2413b3bb97def1bfb730a | [
"BSD-3-Clause"
] | null | null | null | captum/attr/_utils/class_summarizer.py | caraya10/captum | 258928905875c18e85a2413b3bb97def1bfb730a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
from typing import Any, Dict, List, Union, Optional
from torch import Tensor
from captum._utils.common import _format_tensor_into_tuples
from captum._utils.typing import TargetType, TensorOrTupleOfTensorsGeneric
from captum.attr._utils.stat import Stat
from c... | 34.925532 | 88 | 0.613768 |
8e384e762b8b98d591c63a726af3969628e0536c | 2,748 | py | Python | flask_oss.py | SailerNote/flask-oss | 5526beb2d5cd4fbb81e5648e1435192cf5a4634c | [
"Apache-2.0"
] | null | null | null | flask_oss.py | SailerNote/flask-oss | 5526beb2d5cd4fbb81e5648e1435192cf5a4634c | [
"Apache-2.0"
] | null | null | null | flask_oss.py | SailerNote/flask-oss | 5526beb2d5cd4fbb81e5648e1435192cf5a4634c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import oss2
import oss2.exceptions
logger = logging.getLogger("flask_oss")
class FlaskOSS(object):
def __init__(self, app=None):
if app is not None:
self.init_app(a... | 30.533333 | 85 | 0.593886 |
ec4b6c4e2a2d1b00d27dc3bb5623131bffd82cc9 | 2,163 | py | Python | tests/example/models.py | elpatiostudio/wagtail_cache_block | 88bfe456668903321810c48e00a8bfb9d7abe848 | [
"BSD-3-Clause"
] | 4 | 2020-03-21T19:54:29.000Z | 2020-12-01T11:24:29.000Z | tests/example/models.py | elpatiostudio/wagtail_cache_block | 88bfe456668903321810c48e00a8bfb9d7abe848 | [
"BSD-3-Clause"
] | 1 | 2021-03-08T18:43:23.000Z | 2021-03-08T18:43:23.000Z | tests/example/models.py | elpatiostudio/wagtail_cache_block | 88bfe456668903321810c48e00a8bfb9d7abe848 | [
"BSD-3-Clause"
] | 4 | 2020-03-19T13:31:43.000Z | 2021-12-24T03:05:31.000Z | from wagtail.admin.edit_handlers import (FieldPanel, InlinePanel,
MultiFieldPanel, PageChooserPanel,
StreamFieldPanel)
from wagtail.core.fields import RichTextField, StreamField
from wagtail.core.models import Orderable, Page
from taggit... | 30.464789 | 79 | 0.562644 |
f2f3bb590615bc5b943c67814f0f09aa2fcb8e8d | 121 | py | Python | projecture/tests/test_projecture.py | diszgaurav/projecture | afbdaa55e9476fa0fd0b914969087ed2a7ca694b | [
"MIT"
] | 1 | 2016-05-04T17:26:59.000Z | 2016-05-04T17:26:59.000Z | projecture/tests/test_projecture.py | diszgaurav/projecture | afbdaa55e9476fa0fd0b914969087ed2a7ca694b | [
"MIT"
] | null | null | null | projecture/tests/test_projecture.py | diszgaurav/projecture | afbdaa55e9476fa0fd0b914969087ed2a7ca694b | [
"MIT"
] | null | null | null | import projecture
def test_list_projects():
lp = projecture.list_projects()
assert True == isinstance(lp, list)
| 20.166667 | 39 | 0.727273 |
02b3a3628b1e61d9e4fa47bdfdbbf9fdad1451f1 | 8,972 | py | Python | lib/synchronizer.py | PrettyBoyHelios/electrum | 00cc7332f8547e21785e31f76786e4887322403e | [
"MIT"
] | null | null | null | lib/synchronizer.py | PrettyBoyHelios/electrum | 00cc7332f8547e21785e31f76786e4887322403e | [
"MIT"
] | null | null | null | lib/synchronizer.py | PrettyBoyHelios/electrum | 00cc7332f8547e21785e31f76786e4887322403e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 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... | 41.730233 | 94 | 0.649354 |
4ed57258c00c9e7c55904926f1a91436820006bb | 897 | py | Python | setup_new_service.py | sellpy/stockholm-ai | 187bda91d6bc5cfef89083b15836ec18e819a1b8 | [
"MIT"
] | 2 | 2018-03-26T16:31:38.000Z | 2018-03-28T08:55:07.000Z | setup_new_service.py | sellpy/stockholm-ai | 187bda91d6bc5cfef89083b15836ec18e819a1b8 | [
"MIT"
] | null | null | null | setup_new_service.py | sellpy/stockholm-ai | 187bda91d6bc5cfef89083b15836ec18e819a1b8 | [
"MIT"
] | null | null | null | import os
import subprocess
from aws_helpers import create_repository, setup_elb, create_ecs_service, deregister_old_taskdefinitions
version = 1
service_path = 'services.dev.sellpy.net'
service = "stockholm-ai"
env = "dev"
cluster = "microservices"
load_balancer_name = "sellpy-services"
# Create an image repository f... | 30.931034 | 104 | 0.759197 |
6178e2eab604c1ede0b22f9dc268fff459d4283f | 7,151 | py | Python | legacy/v1midiSort.py | montoyamoraga/midi-files-sort | 6c99632bc9f7f0b4319d0514bd259b5e7075f2a6 | [
"MIT"
] | null | null | null | legacy/v1midiSort.py | montoyamoraga/midi-files-sort | 6c99632bc9f7f0b4319d0514bd259b5e7075f2a6 | [
"MIT"
] | null | null | null | legacy/v1midiSort.py | montoyamoraga/midi-files-sort | 6c99632bc9f7f0b4319d0514bd259b5e7075f2a6 | [
"MIT"
] | null | null | null | # Python script for TODO
# December 2021
# runs on Python 3.x on Mac OS 12.0.1
################
# import modules
################
# sys for command line arguments
import sys
# os for listing files and directories
import os
# shutil for copy and paste files
import shutil
# Path for creating new directories and file... | 29.187755 | 154 | 0.687177 |
130f90736e0c65db554f011d25bc2829a0d805e2 | 4,992 | py | Python | tools/scripts/plot_crossover.py | leroyjvargis/workflows | 4d5c3a11c678c10cd0c8b7e043f66e4e62cc790b | [
"Apache-2.0"
] | 558 | 2020-04-27T12:05:39.000Z | 2022-03-28T15:20:22.000Z | tools/scripts/plot_crossover.py | leroyjvargis/workflows | 4d5c3a11c678c10cd0c8b7e043f66e4e62cc790b | [
"Apache-2.0"
] | 103 | 2020-04-27T21:44:55.000Z | 2022-03-29T21:36:10.000Z | tools/scripts/plot_crossover.py | leroyjvargis/workflows | 4d5c3a11c678c10cd0c8b7e043f66e4e62cc790b | [
"Apache-2.0"
] | 61 | 2020-04-22T11:02:14.000Z | 2022-03-14T19:32:17.000Z | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020-2021 Micron Technology, Inc. All rights reserved.
from bokeh.plotting import figure, output_file, save, gridplot
from bokeh.layouts import layout, column, row
from bokeh.models import Div
import os, re
import argparse
import threading
from lib.tree_shape i... | 28.689655 | 122 | 0.616186 |
0a949ea738fd0c265344fb2ea1a4cf520dbe72b5 | 2,806 | py | Python | src/models/craft/basenet/vgg16_bn.py | gregbugaj/marie-ai | f51a74f19ab5d7231c9f8a426284feff1671b974 | [
"MIT"
] | 4 | 2021-09-23T22:38:48.000Z | 2022-01-19T12:03:02.000Z | src/models/craft/basenet/vgg16_bn.py | gregbugaj/marie-icr | f51a74f19ab5d7231c9f8a426284feff1671b974 | [
"MIT"
] | 17 | 2021-12-22T16:37:21.000Z | 2022-03-16T16:07:34.000Z | src/models/craft/basenet/vgg16_bn.py | gregbugaj/marie-ai | f51a74f19ab5d7231c9f8a426284feff1671b974 | [
"MIT"
] | null | null | null | from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.init as init
from torchvision import models
from torchvision.models.vgg import model_urls
def init_weights(modules):
for m in modules:
if isinstance(m, nn.Conv2d):
init.xavier_uniform_(m.weight.data)
... | 37.413333 | 99 | 0.596222 |
0e88dd75bcb736e7db91d8bcfcab95c00acfed1c | 766 | py | Python | source_code/5-2-scrapy.py | linzexinmasterchief/easy-scraping-tutorial | e52c45d27ffce90a7bfe12ea1da09f049e052099 | [
"MIT"
] | 2 | 2020-05-16T07:47:45.000Z | 2020-05-16T07:48:48.000Z | source_code/5-2-scrapy.py | ept106354026/easy-scraping-tutorial | e52c45d27ffce90a7bfe12ea1da09f049e052099 | [
"MIT"
] | null | null | null | source_code/5-2-scrapy.py | ept106354026/easy-scraping-tutorial | e52c45d27ffce90a7bfe12ea1da09f049e052099 | [
"MIT"
] | 1 | 2018-04-06T07:05:29.000Z | 2018-04-06T07:05:29.000Z | import scrapy
class MofanSpider(scrapy.Spider):
name = "mofan"
start_urls = [
'https://morvanzhou.github.io/',
]
# unseen = set()
# seen = set() # we don't need these two as scrapy will deal with them automatically
def parse(self, response):
yield { # return some resu... | 31.916667 | 106 | 0.592689 |
2fc583575db05e93ce3bf5fdbcce33169a48a365 | 13,340 | py | Python | conans/client/conf/config_installer.py | Wonders11/conan | 28ec09f6cbf1d7e27ec27393fd7bbc74891e74a8 | [
"MIT"
] | 1 | 2022-01-21T05:31:13.000Z | 2022-01-21T05:31:13.000Z | conans/client/conf/config_installer.py | Wonders11/conan | 28ec09f6cbf1d7e27ec27393fd7bbc74891e74a8 | [
"MIT"
] | null | null | null | conans/client/conf/config_installer.py | Wonders11/conan | 28ec09f6cbf1d7e27ec27393fd7bbc74891e74a8 | [
"MIT"
] | null | null | null | import json
import os
import shutil
from datetime import datetime
from dateutil.tz import gettz
from contextlib import contextmanager
from six.moves.urllib.parse import urlparse
from conans import load
from conans.client import tools
from conans.client.cache.remote_registry import load_registry_txt, migrate_registry... | 39.820896 | 101 | 0.646027 |
281e8904bc28e4498beeae42ea02e5b7e7094e8d | 2,649 | py | Python | tests/bugs/core_5982_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_5982_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_5982_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_5982
# title: error read permission for BLOB field, when it is input/output procedure`s parametr
# decription:
# Confirmed bug on WI-V3.0.4.33034 and WI-T4.0.0.1340.
# Checked on:
# 4.0.0.1421: OK, 2.098s.
# ... | 24.302752 | 100 | 0.606644 |
48bed9c05770daf890ce08b614fe89d098ecbc78 | 13,971 | py | Python | journalsdb.py | Impactstory/jump-api | e9c048694905e4606b68ae4650696a134bd5a349 | [
"MIT"
] | null | null | null | journalsdb.py | Impactstory/jump-api | e9c048694905e4606b68ae4650696a134bd5a349 | [
"MIT"
] | null | null | null | journalsdb.py | Impactstory/jump-api | e9c048694905e4606b68ae4650696a134bd5a349 | [
"MIT"
] | null | null | null | # coding: utf-8
import datetime
import argparse
import simplejson as json
from cached_property import cached_property
from time import time
# import requests
from psycopg2 import sql
from psycopg2.extras import execute_values
from enum import Enum
from app import db
from app import get_db_cursor
from util import elap... | 37.861789 | 144 | 0.680839 |
9bcbd33fcaed5f2e1c5fac75f18a910da399b0ab | 2,739 | py | Python | pbpl/compton/extrude_vrml.py | ucla-pbpl/pbpl-compton | a5afcdffc778f61a4726d7c5a231af2bca466900 | [
"MIT"
] | 2 | 2019-09-24T23:52:58.000Z | 2020-06-03T20:59:33.000Z | pbpl/compton/extrude_vrml.py | ucla-pbpl/pbpl-compton | a5afcdffc778f61a4726d7c5a231af2bca466900 | [
"MIT"
] | null | null | null | pbpl/compton/extrude_vrml.py | ucla-pbpl/pbpl-compton | a5afcdffc778f61a4726d7c5a231af2bca466900 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys, os
import argparse
from argparse import RawDescriptionHelpFormatter
import numpy as np
import re as regex
def add_bool_arg(parser, name, default=False, help=None):
group = parser.add_mutually_exclusive_group(required=False)
group.add_argument('--' + name, action='store_true', ... | 33.402439 | 70 | 0.608251 |
d623525629006fa2cc7549cadc49bdef29f0026e | 1,546 | py | Python | tests/integration_tests/test_suite.py | raineydavid/mindsdb | 4e2458825bad43440067376d1d747db646d07bf3 | [
"MIT"
] | null | null | null | tests/integration_tests/test_suite.py | raineydavid/mindsdb | 4e2458825bad43440067376d1d747db646d07bf3 | [
"MIT"
] | null | null | null | tests/integration_tests/test_suite.py | raineydavid/mindsdb | 4e2458825bad43440067376d1d747db646d07bf3 | [
"MIT"
] | null | null | null | from run_example import run_example
from generated_data_tests import *
import multiprocessing
import os
# Run the generated data tests
for backend in ['ludwig', 'lightwood']:
test_one_label_prediction_wo_strings(backend)
test_timeseries(backend)
test_multilabel_prediction(backend)
test_one_label_predi... | 28.62963 | 81 | 0.61837 |
18e32f821a1882d8d685d1602a851ce5092c6da5 | 14,260 | py | Python | mne/cuda.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | null | null | null | mne/cuda.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | null | null | null | mne/cuda.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from scipy.fftpack import fft, ifft
from .utils import sizeof_fmt, logger, get_config
# Support CUDA for FFTs; requires scikits.cuda and pycuda
_cuda_capable = False
_multiply_inplace_c128 = _halve_c128 = _real_c128 = No... | 38.75 | 79 | 0.58878 |
9aa959a27bd1ff733e2993fdd530a3c8b4d58b95 | 179 | py | Python | tools.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | null | null | null | tools.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | null | null | null | tools.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | 1 | 2020-12-27T01:55:19.000Z | 2020-12-27T01:55:19.000Z | import requests
def get_html_to_file(url:str, fname: str):
resp = requests.get(url)
resp.raise_for_status()
f = open(fname, "w")
f.write(resp.text)
f.close() | 19.888889 | 42 | 0.648045 |
e78eb5498fbaab2ee69f1fa96924cffb24117d06 | 658 | py | Python | CodeWars/reflection.py | SabariVig/python-programs | 682f11df8157d4a070c294eded341f86845e38a8 | [
"MIT"
] | null | null | null | CodeWars/reflection.py | SabariVig/python-programs | 682f11df8157d4a070c294eded341f86845e38a8 | [
"MIT"
] | 1 | 2018-07-11T10:49:29.000Z | 2018-07-11T10:51:25.000Z | CodeWars/reflection.py | SabariVig/python-programs | 682f11df8157d4a070c294eded341f86845e38a8 | [
"MIT"
] | null | null | null | ################## CODE WARS KATA ##################
#KYU LEVEL : 6
#KATA TITLE : Framed Reflection
#KATA LINK : https://www.codewars.com/kata/framed-reflection/train/python
#####################################################
def mirror(text):
q=[]
text=text.split()
q.append("*"*(len(text[0])+4))
for i... | 24.37037 | 75 | 0.428571 |
c8ca6dc58b440770b67528e46f34aceb958aa7f3 | 540 | py | Python | ch6/exercises/many_users.py | hewittaj/python_crash_course | 52a3341eec79c2eb6c7f9f1cb7f0806c3b2d61aa | [
"MIT"
] | null | null | null | ch6/exercises/many_users.py | hewittaj/python_crash_course | 52a3341eec79c2eb6c7f9f1cb7f0806c3b2d61aa | [
"MIT"
] | null | null | null | ch6/exercises/many_users.py | hewittaj/python_crash_course | 52a3341eec79c2eb6c7f9f1cb7f0806c3b2d61aa | [
"MIT"
] | null | null | null | users = {
'aeinstein': {
'first': 'albert',
'last': 'einstein',
'location': 'princeton',
},
'mcurie': {
'first': 'marie',
'last': 'curie',
'location': 'paris',
}
}
for username, user_info in users.items():
pr... | 25.714286 | 59 | 0.492593 |
deb1a632f467ea3e0f90c69af4b0cb0e28670f51 | 10,497 | py | Python | datasets/static_detmot.py | anonymous4669/MOTR | c60d8108f169668e65d59e833d0052ba043c2a4d | [
"MIT"
] | null | null | null | datasets/static_detmot.py | anonymous4669/MOTR | c60d8108f169668e65d59e833d0052ba043c2a4d | [
"MIT"
] | null | null | null | datasets/static_detmot.py | anonymous4669/MOTR | c60d8108f169668e65d59e833d0052ba043c2a4d | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------
# Copyright (c) 2021 4669 (for eccv submission only). All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from Deformable DETR (https://github.com/fundamentalvision/Deformable-DETR)
# Copyri... | 41.988 | 124 | 0.592836 |
c59e3bc41c902f15b9f3348bd84e333cef7df67b | 1,458 | py | Python | 8a/app/main/views.py | fredsonchaves07/flask-course | 4e9a3a94c3c49595c1d810794ba7533499811b58 | [
"MIT"
] | 1 | 2021-01-05T01:29:22.000Z | 2021-01-05T01:29:22.000Z | 8a/app/main/views.py | fredsonchaves07/flask-course | 4e9a3a94c3c49595c1d810794ba7533499811b58 | [
"MIT"
] | null | null | null | 8a/app/main/views.py | fredsonchaves07/flask-course | 4e9a3a94c3c49595c1d810794ba7533499811b58 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import render_template, session, redirect, url_for, current_app
from . import main
from .forms import NameForm
from .. import db
from ..models import User
@main.route('/', methods=['GET', 'POST'])
def index():
form = NameForm()
if form.validate_on_submit():
u... | 28.588235 | 74 | 0.515775 |
309386312de56b30b7b1d3b06ce13e47c99e3b13 | 5,476 | py | Python | weaviate/gql/aggregate.py | ooxoo-bv/weaviate-python-client | f646a5c16b1c0cc7940b3ffa17a71efb6e96063a | [
"BSD-3-Clause"
] | 14 | 2019-11-04T14:18:21.000Z | 2022-03-31T09:11:51.000Z | weaviate/gql/aggregate.py | ooxoo-bv/weaviate-python-client | f646a5c16b1c0cc7940b3ffa17a71efb6e96063a | [
"BSD-3-Clause"
] | 91 | 2019-11-04T11:26:42.000Z | 2022-03-22T10:22:44.000Z | weaviate/gql/aggregate.py | ooxoo-bv/weaviate-python-client | f646a5c16b1c0cc7940b3ffa17a71efb6e96063a | [
"BSD-3-Clause"
] | 7 | 2021-05-14T14:53:42.000Z | 2022-03-31T15:09:55.000Z | """
GraphQL `Aggregate` command.
"""
import json
from typing import List, Optional
from weaviate.connect import Connection
from weaviate.util import _capitalize_first_letter
from .filter import Where, GraphQL
class AggregateBuilder(GraphQL):
"""
AggregateBuilder class used to aggregate Weaviate objects.
""... | 27.796954 | 99 | 0.496348 |
f8668f4c0e56e2ec28528994aad4910ff6b21ad0 | 14,333 | py | Python | tfx/orchestration/portable/mlmd/execution_lib.py | dhruvesh09/tfx | dc99696cc87752a4e79d4aff85d42f93e06943f1 | [
"Apache-2.0"
] | 1 | 2019-10-02T18:03:55.000Z | 2019-10-02T18:03:55.000Z | tfx/orchestration/portable/mlmd/execution_lib.py | dhruvesh09/tfx | dc99696cc87752a4e79d4aff85d42f93e06943f1 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/mlmd/execution_lib.py | dhruvesh09/tfx | dc99696cc87752a4e79d4aff85d42f93e06943f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. 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... | 38.842818 | 93 | 0.748901 |
dba37b157e26a9173b655af3a2974754b0f6c757 | 19,978 | py | Python | appenv.py | gocept/batou | 4d239996f464c406cde82c48155e5b8273a9063d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | appenv.py | gocept/batou | 4d239996f464c406cde82c48155e5b8273a9063d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | appenv.py | gocept/batou | 4d239996f464c406cde82c48155e5b8273a9063d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python3
# appenv - a single file 'application in venv bootstrapping and updating
# mechanism for python-based (CLI) applications
# Assumptions:
#
# - the appenv file is placed in a repo with the name of the application
# - the name of the application/file is an entrypoint XXX
# - python3.... | 38.717054 | 79 | 0.588147 |
4ce52645b34e30690290d320f8c60c591374fe8d | 749 | py | Python | my_site/my_site/urls.py | bobruk76/D3 | b720f97e70b257b447cec2a6526b7dce01788fed | [
"MIT"
] | null | null | null | my_site/my_site/urls.py | bobruk76/D3 | b720f97e70b257b447cec2a6526b7dce01788fed | [
"MIT"
] | 5 | 2021-03-30T13:41:55.000Z | 2021-09-22T19:15:53.000Z | my_site/my_site/urls.py | bobruk76/D3 | b720f97e70b257b447cec2a6526b7dce01788fed | [
"MIT"
] | null | null | null | """my_site URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 34.045455 | 77 | 0.708945 |
b5bacc890b75efe5cb27c2944c105fcdd8835e33 | 5,115 | py | Python | lib/galaxy/managers/configuration.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | lib/galaxy/managers/configuration.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 7 | 2016-12-07T22:19:37.000Z | 2019-01-30T15:04:26.000Z | lib/galaxy/managers/configuration.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | """
Serializers for Galaxy config file data: ConfigSerializer for all users
and a more expanded set of data for admin in AdminConfigSerializer.
Used by both the API and bootstrapped data.
"""
# TODO: this is a bit of an odd duck. It uses the serializer structure from managers
# but doesn't have a model like them. It... | 50.643564 | 120 | 0.579863 |
d168308ca3b3756d79f49c1e0daf99e7f01a6e5c | 2,744 | py | Python | test/unitTests/nodeTests/testSignalNode.py | pieter-hendriks/STL-monitoring | 114b73b1f4b0687b11b8842b3c4a1c8af7b0d9df | [
"MIT"
] | null | null | null | test/unitTests/nodeTests/testSignalNode.py | pieter-hendriks/STL-monitoring | 114b73b1f4b0687b11b8842b3c4a1c8af7b0d9df | [
"MIT"
] | null | null | null | test/unitTests/nodeTests/testSignalNode.py | pieter-hendriks/STL-monitoring | 114b73b1f4b0687b11b8842b3c4a1c8af7b0d9df | [
"MIT"
] | null | null | null | import unittest
from stl.signals import SignalList, Signal, BooleanSignal
from .helpers import getCosSignal, getShiftedCosSignal
from stl.tree import SignalNode
# SignalNode is a node on the tree returning a given signal name from the signal list.
class SignalNodeTest(unittest.TestCase):
def setUp(self):
pass
d... | 41.575758 | 113 | 0.761297 |
973f959247022b2c9c322120fcb34b5266a289be | 1,005 | py | Python | saleor/dashboard/category/filters.py | prayjourney/saleor | 0ec214a3deb606a951a268f7f83e659857be4dd7 | [
"BSD-3-Clause"
] | 1 | 2020-10-24T14:25:53.000Z | 2020-10-24T14:25:53.000Z | saleor/dashboard/category/filters.py | prayjourney/saleor | 0ec214a3deb606a951a268f7f83e659857be4dd7 | [
"BSD-3-Clause"
] | 1 | 2022-02-10T08:13:42.000Z | 2022-02-10T08:13:42.000Z | saleor/dashboard/category/filters.py | dotslash227/foodezmn-ecommerce | 4a49053d7dd4386f01d52cb76a8f9bd64470888f | [
"BSD-3-Clause"
] | 1 | 2020-09-29T14:21:31.000Z | 2020-09-29T14:21:31.000Z | from django.utils.translation import pgettext_lazy
from django_filters import CharFilter, OrderingFilter
from ...core.filters import SortedFilterSet
from ...product.models import Category
SORT_BY_FIELDS = {
'name': pgettext_lazy('Category list sorting option', 'name'),
'description': pgettext_lazy(
'C... | 33.5 | 77 | 0.697512 |
f2d0913d305c968b2bf671b9e96f61ae7d8d9665 | 1,518 | py | Python | backend/battle/battles/base_stats.py | DeborahAlmeida/pokebattle | c8cf741eaca2372cd3aca02709c65b12e237fe11 | [
"MIT"
] | null | null | null | backend/battle/battles/base_stats.py | DeborahAlmeida/pokebattle | c8cf741eaca2372cd3aca02709c65b12e237fe11 | [
"MIT"
] | 5 | 2021-04-08T17:52:40.000Z | 2021-08-16T13:46:15.000Z | backend/battle/battles/base_stats.py | DeborahAlmeida/pokebattle | c8cf741eaca2372cd3aca02709c65b12e237fe11 | [
"MIT"
] | null | null | null | from pokemon.helpers import get_pokemon_from_api
from battle.models import PokemonTeam
def get_total_point_pokemon(data_pokemons):
pokemon_first = get_pokemon_from_api(data_pokemons[0])
pokemon_second = get_pokemon_from_api(data_pokemons[1])
pokemon_third = get_pokemon_from_api(data_pokemons[2])
all_p... | 27.107143 | 74 | 0.685112 |
461b27e94c0d540e9da66c956bfa168c243f9eb6 | 3,181 | py | Python | homeassistant/components/knx/switch.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/knx/switch.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/knx/switch.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """Support for KNX/IP switches."""
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_ADDRESS, CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from . import ATTR_DISCOVER_DEVICES... | 32.131313 | 78 | 0.696322 |
f2220076f0a329081039b67b512d1ff8389332ee | 613 | py | Python | apps/home/urls.py | naisyahisa/keagat | d9a02ef57cc48482ee79b31a43a41c03a59e1144 | [
"MIT"
] | null | null | null | apps/home/urls.py | naisyahisa/keagat | d9a02ef57cc48482ee79b31a43a41c03a59e1144 | [
"MIT"
] | null | null | null | apps/home/urls.py | naisyahisa/keagat | d9a02ef57cc48482ee79b31a43a41c03a59e1144 | [
"MIT"
] | 1 | 2022-02-13T06:58:54.000Z | 2022-02-13T06:58:54.000Z | from django.urls import path, re_path
from django.conf import settings
from django.conf.urls.static import static
from apps.home import views
urlpatterns = [
# The home page
path('', views.index, name='home'),
path('inbox/', views.helpdesk_inbox, name='inbox'),
# Matches any html file
re_path(r'^.... | 29.190476 | 82 | 0.712887 |
0038f4bbf3dedc9d832daa9824f0ed57fc0c4879 | 32,001 | py | Python | tensorflow/python/kernel_tests/reader_ops_test.py | dongjiewhu/tensorflow | fac9b8830e967bb5dd9adc61f86a9b354c31744d | [
"Apache-2.0"
] | 1 | 2017-06-28T10:56:40.000Z | 2017-06-28T10:56:40.000Z | tensorflow/python/kernel_tests/reader_ops_test.py | LaiPeter/tensorflow | 08ed32dbb9e8f67eec9efce3807b5bdb3933eb2f | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/reader_ops_test.py | LaiPeter/tensorflow | 08ed32dbb9e8f67eec9efce3807b5bdb3933eb2f | [
"Apache-2.0"
] | 2 | 2017-07-16T13:54:08.000Z | 2018-05-21T09:02:34.000Z | # Copyright 2015 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... | 35.321192 | 88 | 0.640761 |
265452f9d0098d6703590198e5a30cdf5327d653 | 523 | py | Python | app/quickbooks/urls.py | jaydhanani99/recko | d569f34593e18691602f0618f0388fe0da2b86e0 | [
"MIT"
] | null | null | null | app/quickbooks/urls.py | jaydhanani99/recko | d569f34593e18691602f0618f0388fe0da2b86e0 | [
"MIT"
] | null | null | null | app/quickbooks/urls.py | jaydhanani99/recko | d569f34593e18691602f0618f0388fe0da2b86e0 | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from quickbooks import views
router = DefaultRouter(trailing_slash=False)
router.register('quickbooks', views.QuickbooksViewSet)
app_name = 'quickbooks'
urlpatterns = [
path('', include(router.urls)),
path('quickbooks/aut... | 34.866667 | 114 | 0.793499 |
0c4e94e07091396142d2395faba2e7c1299cd641 | 2,907 | py | Python | bot.py | Borahb/Allie | 7f467e8499bab0962773ec98717fe4a659404093 | [
"MIT"
] | null | null | null | bot.py | Borahb/Allie | 7f467e8499bab0962773ec98717fe4a659404093 | [
"MIT"
] | null | null | null | bot.py | Borahb/Allie | 7f467e8499bab0962773ec98717fe4a659404093 | [
"MIT"
] | null | null | null | #importing libraries
import pickle
import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import numpy as np
from keras.models import load_model
import json
import random
import discord
import requests
import nest_asyncio
nest_asyncio.apply()
#Dependencies
model = load_model('chatbot_mo... | 27.951923 | 96 | 0.645683 |
5a32293a6df798fd749f83ee0ac0d2634618ab4a | 426 | py | Python | oppgavefem.py | NicoDerp/sannsynlighet | 427d0016bfc136efe5d69227ceb33520b2008fa5 | [
"Apache-2.0"
] | null | null | null | oppgavefem.py | NicoDerp/sannsynlighet | 427d0016bfc136efe5d69227ceb33520b2008fa5 | [
"Apache-2.0"
] | null | null | null | oppgavefem.py | NicoDerp/sannsynlighet | 427d0016bfc136efe5d69227ceb33520b2008fa5 | [
"Apache-2.0"
] | null | null | null | from random import randint
antallkast = 10000 # Øk for mer nøyaktighet
myntsum = 0
for i in range(antallkast):
s = sum([randint(0,1) for _ in range(3)]) # Antall kronestykker som ble mynt ut av de tre kronestrykkene
if s==2: # Sjekker om 2 ut av 3 kronestykker ble mynt
myntsum += 1
relativ_frekvens = myntsum / an... | 32.769231 | 105 | 0.744131 |
6d17b10b67797d206aa9538677a50a7a95cd9d26 | 713 | py | Python | scripts/solve_farmer.py | SmilingHeretic/paradigm-ctf-2021-solutions-brownie | adb7fb543be4ee6062246675cfd4eb3b5ef594dc | [
"MIT"
] | null | null | null | scripts/solve_farmer.py | SmilingHeretic/paradigm-ctf-2021-solutions-brownie | adb7fb543be4ee6062246675cfd4eb3b5ef594dc | [
"MIT"
] | null | null | null | scripts/solve_farmer.py | SmilingHeretic/paradigm-ctf-2021-solutions-brownie | adb7fb543be4ee6062246675cfd4eb3b5ef594dc | [
"MIT"
] | null | null | null | from brownie import (
network,
accounts,
config,
interface,
FarmerSetup,
CompDaiFarmer,
CompFaucet
)
from scripts.helpful_scripts import (
get_account,
check_solution
)
from web3 import Web3
def main():
deployer = get_account(index=0)
attacker = get_account(index=1)
# ... | 22.28125 | 85 | 0.661992 |
9994defd486a3b4e16cc34a03d10446564ea1cf0 | 2,347 | py | Python | swagger_server/models/legacy_model.py | cropsinsilico/cis-apiserver | d93986c4da685c33485ebff41596427e14899fdc | [
"BSD-3-Clause"
] | null | null | null | swagger_server/models/legacy_model.py | cropsinsilico/cis-apiserver | d93986c4da685c33485ebff41596427e14899fdc | [
"BSD-3-Clause"
] | null | null | null | swagger_server/models/legacy_model.py | cropsinsilico/cis-apiserver | d93986c4da685c33485ebff41596427e14899fdc | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class LegacyModel(Model):
"""NOTE: This class is auto generated by the swagger... | 24.705263 | 80 | 0.581594 |
85cbc6a8dd3fe57c66d2c19749461f8d3b0f9744 | 1,423 | py | Python | tests/handler_console_test.py | ricshaw/NiftyNet | 8bd7516fbadff9871414360c81eab6e8bf332048 | [
"Apache-2.0"
] | 1 | 2018-12-27T03:39:00.000Z | 2018-12-27T03:39:00.000Z | tests/handler_console_test.py | ricshaw/NiftyNet | 8bd7516fbadff9871414360c81eab6e8bf332048 | [
"Apache-2.0"
] | 9 | 2020-11-13T19:08:08.000Z | 2022-02-10T02:25:56.000Z | tests/handler_console_test.py | ricshaw/NiftyNet | 8bd7516fbadff9871414360c81eab6e8bf332048 | [
"Apache-2.0"
] | 1 | 2019-03-21T18:12:38.000Z | 2019-03-21T18:12:38.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import tensorflow as tf
from tests.application_driver_test import get_initialised_driver
from niftynet.engine.application_iteration import IterationMessage
from niftynet.engine.signal import GRAPH_CREATED, SESS_STARTED, ITER_FINISHED
clas... | 37.447368 | 77 | 0.709065 |
3ba55542ec4f1261e6215b97302f6ffcc78f10a3 | 4,758 | py | Python | quati/reporter.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | 2 | 2021-01-30T21:20:36.000Z | 2021-01-30T22:15:07.000Z | quati/reporter.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | null | null | null | quati/reporter.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | 1 | 2021-01-18T23:12:18.000Z | 2021-01-18T23:12:18.000Z | import logging
from quati.stats import BestValueEpoch
logger = logging.getLogger(__name__)
def get_line_bar(template_head):
line_head = list('-' * len(template_head.strip()))
bar_indexes = [i for i, c in enumerate(template_head) if c == '|']
for i in bar_indexes:
line_head[i] = '+'
return ''... | 38.682927 | 77 | 0.568306 |
f2d670bc9c0cc47ab9a6a16f2f56213f0ce89e4a | 1,805 | py | Python | 2020/d04/d04.py | pravin/advent-2016 | ecb0f72b9152c13e9c05d3ed2510bf7b8aa0907c | [
"Apache-2.0"
] | null | null | null | 2020/d04/d04.py | pravin/advent-2016 | ecb0f72b9152c13e9c05d3ed2510bf7b8aa0907c | [
"Apache-2.0"
] | null | null | null | 2020/d04/d04.py | pravin/advent-2016 | ecb0f72b9152c13e9c05d3ed2510bf7b8aa0907c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
passports = []
data = {}
with open('input.txt') as fp:
for line in fp:
if line.strip() == '':
passports.append(data)
data = {}
continue
kv_pairs = line.split()
for kv in kv_pairs:
k, v = kv.split(':')
data[k]... | 25.069444 | 77 | 0.482548 |
05d27941a0b8989b31015820bdfc98f6f43b01c2 | 719 | py | Python | tests/test_utils/test_time_series.py | phil-lo/pyportlib | 96f8531c0c18c58d3476832de9d4c9b2c9285f62 | [
"MIT"
] | 2 | 2021-11-18T21:40:02.000Z | 2021-12-13T21:01:18.000Z | tests/test_utils/test_time_series.py | phil-lo/PortfolioCore | 3fbe7460c809a80e48615e934990dcd2d1f5003b | [
"CC0-1.0"
] | 1 | 2022-01-24T21:10:09.000Z | 2022-01-24T21:10:09.000Z | tests/test_utils/test_time_series.py | phil-lo/PortfolioCore | 3fbe7460c809a80e48615e934990dcd2d1f5003b | [
"CC0-1.0"
] | null | null | null | import pandas as pd
from pyportlib.utils.time_series import remove_leading_zeroes, remove_consecutive_zeroes
class TestTimeSeries:
def test_remove_leading_zeroes(self):
s = pd.Series(data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1])
result = remove_leading_zeroes(s)
asser... | 26.62963 | 88 | 0.589708 |
a8146e29ddf2a1f39d2c1c1271c461267d7f4e82 | 2,486 | py | Python | code/vocabulary.py | tremol/knausj_talon | 6af8b27fa27682f5354d89f03a8dcfa9d1a7ba1a | [
"MIT"
] | null | null | null | code/vocabulary.py | tremol/knausj_talon | 6af8b27fa27682f5354d89f03a8dcfa9d1a7ba1a | [
"MIT"
] | null | null | null | code/vocabulary.py | tremol/knausj_talon | 6af8b27fa27682f5354d89f03a8dcfa9d1a7ba1a | [
"MIT"
] | null | null | null | from talon import Module
from .user_settings import bind_list_to_csv, bind_word_map_to_csv
mod = Module()
mod.list("vocabulary", desc="additional vocabulary words")
# Default words that will need to be capitalized (particularly under w2l).
# NB. These defaults and those later in this file are ONLY used when
# auto-c... | 29.247059 | 89 | 0.695897 |
0cd2ac1b5fb0af5583e66c931817ccd7ce8b7f71 | 7,792 | py | Python | tests/test_global_observation.py | null-pi/flatland-challenge | babc6895551f96da1c1b6bea6953db498cfa8644 | [
"MIT"
] | null | null | null | tests/test_global_observation.py | null-pi/flatland-challenge | babc6895551f96da1c1b6bea6953db498cfa8644 | [
"MIT"
] | 1 | 2020-09-04T13:57:01.000Z | 2020-09-09T19:21:33.000Z | tests/test_global_observation.py | null-pi/flatland-challenge | babc6895551f96da1c1b6bea6953db498cfa8644 | [
"MIT"
] | null | null | null | import numpy as np
from flatland.envs.agent_utils import EnvAgent, RailAgentStatus
from flatland.envs.observations import GlobalObsForRailEnv
from flatland.envs.rail_env import RailEnv, RailEnvActions
from flatland.envs.rail_generators import sparse_rail_generator
from flatland.envs.schedule_generators import sparse_s... | 61.354331 | 120 | 0.51694 |
4ed81cc27a82e442cd42a4597145398257609877 | 2,090 | py | Python | Plugins.Operators.py | islamamer666/Wikibooks_ETL_Pipeline | 5317cee7fe9e01638f78d348387ae9f20c4d5d4e | [
"MIT"
] | null | null | null | Plugins.Operators.py | islamamer666/Wikibooks_ETL_Pipeline | 5317cee7fe9e01638f78d348387ae9f20c4d5d4e | [
"MIT"
] | null | null | null | Plugins.Operators.py | islamamer666/Wikibooks_ETL_Pipeline | 5317cee7fe9e01638f78d348387ae9f20c4d5d4e | [
"MIT"
] | null | null | null | from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class DataQualityOperator(BaseOperator):
ui_color = '#89DA59'
@apply_defaults
def __init__(self,
redshift_conn_id="",
... | 37.321429 | 96 | 0.592344 |
d4f7c77584a95f4b02d2bc7ba246f27f37abd2fd | 1,849 | py | Python | anuvaad-etl/anuvaad-extractor/document-processor/word-detector/craft/src/utilities/request_parse.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-extractor/document-processor/word-detector/craft/src/utilities/request_parse.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-extractor/document-processor/word-detector/craft/src/utilities/request_parse.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | import src.utilities.app_context as app_context
from anuvaad_auditor.loghandler import log_exception
import copy
import json
import config
def log_error(method):
def wrapper(*args, **kwargs):
try:
output = method(*args, **kwargs)
return output
except Exception as e:
... | 22.82716 | 118 | 0.63656 |
d7b08861066df4b9ec7dbf353fe69d5399159682 | 4,950 | py | Python | src/kayako/objects/department.py | iXsystems/kayako-python-api-library | 5c43ae331904eac1a66301e2f40d29a4e52fd49d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/kayako/objects/department.py | iXsystems/kayako-python-api-library | 5c43ae331904eac1a66301e2f40d29a4e52fd49d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/kayako/objects/department.py | iXsystems/kayako-python-api-library | 5c43ae331904eac1a66301e2f40d29a4e52fd49d | [
"BSD-2-Clause-FreeBSD"
] | 8 | 2018-04-10T19:28:53.000Z | 2022-02-05T18:56:07.000Z | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2011, Evan Leis
#
# Distributed under the terms of the Lesser GNU General Public License (LGPL)
#-----------------------------------------------------------------------------
'''
Created on May 5, 2011... | 38.372093 | 158 | 0.62101 |
1bccdf3808bb1cc265b532f98f3a28ad8d3688b9 | 2,640 | py | Python | pfrock-plugins/pfrock-static-plugin/pfrock_static_plugin/handlers/files.py | knightliao/pfrock | 33587f11caeeccc11d0b8219b4e02df153905486 | [
"Apache-2.0"
] | 62 | 2016-02-24T10:47:17.000Z | 2019-04-27T01:36:56.000Z | pfrock-plugins/pfrock-static-plugin/pfrock_static_plugin/handlers/files.py | knightliao/pfrock | 33587f11caeeccc11d0b8219b4e02df153905486 | [
"Apache-2.0"
] | 1 | 2019-04-19T12:13:21.000Z | 2021-08-10T09:16:09.000Z | pfrock-plugins/pfrock-static-plugin/pfrock_static_plugin/handlers/files.py | knightliao/pfrock | 33587f11caeeccc11d0b8219b4e02df153905486 | [
"Apache-2.0"
] | 24 | 2016-03-01T14:59:29.000Z | 2019-09-02T08:12:00.000Z | #!/usr/bin/env python
# coding=utf8
from tornado.web import os
from pfrock_static_plugin.handlers import ROUTER_HEADER, ROUTER_STATIC_FILES, ROUTER_STATIC_FILE
from pfrock_static_plugin.handlers.file import FrockStaticFileHandler
from pfrock_static_plugin.handlers.utils.rule import VariableRuleParser
ROUTER_STATIC_FI... | 32.195122 | 117 | 0.620076 |
35e659874251dd171b7e0ecd4850185aa5f20fa4 | 10,638 | py | Python | pronunciation.py | jmdict-kindle/jmdict-kindle | ec3acc655b51ee79743ee10d39ecbc93b61c0081 | [
"MIT"
] | 9 | 2022-01-23T02:09:14.000Z | 2022-03-19T03:28:47.000Z | pronunciation.py | jmdict-kindle/jmdict-kindle | ec3acc655b51ee79743ee10d39ecbc93b61c0081 | [
"MIT"
] | 6 | 2022-01-22T08:52:47.000Z | 2022-02-09T08:42:41.000Z | pronunciation.py | jmdict-kindle/jmdict-kindle | ec3acc655b51ee79743ee10d39ecbc93b61c0081 | [
"MIT"
] | 1 | 2022-03-04T17:23:14.000Z | 2022-03-04T17:23:14.000Z | import csv
from html import escape
import sys
hiragana = (
"がぎぐげござじずぜぞだぢづでどばびぶべぼぱぴぷぺぽ"
"あいうえおかきくけこさしすせそたちつてと"
"なにぬねのはひふへほまみむめもやゆよらりるれろ"
"わをんぁぃぅぇぉゃゅょっ"
)
katakana = (
"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"
"アイウエオカキクケコサシスセソタチツテト"
"ナニヌネノハヒフヘホマミムメモヤユヨラリルレロ"
"ワヲンァィゥェォャュョッ"
)
hiragana = [ord(char) for c... | 40.448669 | 187 | 0.461083 |
172ba22545f3be08c0129b9a8230506254b800cd | 4,034 | py | Python | json_to_yaml.py | ascdso2020/ascdso-devops-python-tools | a5cfe0579f7c52ac861c92044b3d7215af0b8918 | [
"MIT"
] | null | null | null | json_to_yaml.py | ascdso2020/ascdso-devops-python-tools | a5cfe0579f7c52ac861c92044b3d7215af0b8918 | [
"MIT"
] | null | null | null | json_to_yaml.py | ascdso2020/ascdso-devops-python-tools | a5cfe0579f7c52ac861c92044b3d7215af0b8918 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2019-12-19 17:54:21 +0000 (Thu, 19 Dec 2019)
#
# https://github.com/HariSekhon/DevOps-Python-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and opt... | 31.515625 | 119 | 0.618741 |
eb92c900fc9829c9316c06788ff01e987508921b | 7,776 | py | Python | models/modules/spade_modules/base_spade_distiller_modules.py | NguyenHoangAn0511/gan-compression | 6512c067d4adebc7451635991418b54ab76dd711 | [
"BSD-3-Clause"
] | 1,005 | 2020-03-20T04:13:59.000Z | 2022-03-30T01:16:45.000Z | models/modules/spade_modules/base_spade_distiller_modules.py | shadow2496/gan-compression | 9f3a2b51bedca040cc7d31c60ca71a77138f2c81 | [
"BSD-3-Clause"
] | 94 | 2020-03-20T08:36:57.000Z | 2022-03-12T00:20:02.000Z | models/modules/spade_modules/base_spade_distiller_modules.py | shadow2496/gan-compression | 9f3a2b51bedca040cc7d31c60ca71a77138f2c81 | [
"BSD-3-Clause"
] | 147 | 2020-03-20T04:49:35.000Z | 2022-03-23T10:44:25.000Z | import copy
import os
import torch
from torch import nn
from models import networks
from models.modules.loss import GANLoss, VGGLoss
from models.modules.spade_modules.spade_model_modules import SPADEModelModules
from models.modules.super_modules import SuperConv2d
from utils import util
class BaseSPADEDistillerModu... | 46.285714 | 115 | 0.631044 |
c928426a5aad118124ad03b82ebfaa70844cd770 | 126 | py | Python | tests/ocd_backend/__init__.py | ngi-nix/poliscoops | 491d12f83a44afbb4f1ee525b29ae70dc564e0f7 | [
"CC-BY-4.0"
] | 6 | 2020-04-08T08:23:07.000Z | 2021-12-05T09:56:14.000Z | tests/ocd_backend/__init__.py | ngi-nix/poliscoops | 491d12f83a44afbb4f1ee525b29ae70dc564e0f7 | [
"CC-BY-4.0"
] | 65 | 2020-04-07T08:16:31.000Z | 2022-02-19T00:18:24.000Z | tests/ocd_backend/__init__.py | openstate/coronalert | 9aa24cc0ea75b85e9bda0cfcd6ff592a2c61c95e | [
"CC-BY-4.0"
] | 1 | 2021-08-03T09:49:14.000Z | 2021-08-03T09:49:14.000Z | # from .extractors import *
# from .items import *
# from .transformers import *
# from .loaders import *
from .misc import *
| 21 | 29 | 0.698413 |
3d4a70338b6096fbcf2d0026913847cd72c3bcdb | 3,905 | gyp | Python | chromium/third_party/WebKit/Source/wtf/wtf_tests.gyp | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | null | null | null | chromium/third_party/WebKit/Source/wtf/wtf_tests.gyp | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | null | null | null | chromium/third_party/WebKit/Source/wtf/wtf_tests.gyp | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 33.376068 | 97 | 0.596927 |
4942995ade816d865252aee3699bd61f4c14f725 | 15,546 | py | Python | tests/hazmat/primitives/utils.py | thatch/cryptography | 0bdcf3d62bcb2051f82a39daf46cc67e43a8f465 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/primitives/utils.py | thatch/cryptography | 0bdcf3d62bcb2051f82a39daf46cc67e43a8f465 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/primitives/utils.py | thatch/cryptography | 0bdcf3d62bcb2051f82a39daf46cc67e43a8f465 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import binascii
import itertools
import os
import pytest
from cryptogra... | 32.866808 | 79 | 0.680368 |
60b7fe5b1f843c8d6d2b4280c12bb90064593f0d | 3,498 | py | Python | flags/conditions/conditions.py | edomora97/django-flags | fb22253d77ad0a8dbcee4ebfb78b185348e0c5cf | [
"CC0-1.0"
] | null | null | null | flags/conditions/conditions.py | edomora97/django-flags | fb22253d77ad0a8dbcee4ebfb78b185348e0c5cf | [
"CC0-1.0"
] | null | null | null | flags/conditions/conditions.py | edomora97/django-flags | fb22253d77ad0a8dbcee4ebfb78b185348e0c5cf | [
"CC0-1.0"
] | null | null | null | import re
from distutils.util import strtobool
from django.contrib.auth import get_user_model
from django.utils import dateparse, timezone
from flags.conditions.registry import register
from flags.conditions.validators import (
validate_boolean,
validate_date,
validate_parameter,
validate_path_re,
... | 28.439024 | 78 | 0.707547 |
a041c8ec0934db7d21e1413266fe0e3a7bd739bc | 645 | py | Python | tests/staticfile.py | movermeyer/tangelo | 470034ee9b3d7a01becc1ce5fddc7adc1d5263ef | [
"Apache-2.0"
] | 40 | 2015-01-09T02:56:33.000Z | 2019-03-01T05:34:13.000Z | tests/staticfile.py | movermeyer/tangelo | 470034ee9b3d7a01becc1ce5fddc7adc1d5263ef | [
"Apache-2.0"
] | 98 | 2015-01-05T12:51:29.000Z | 2019-01-23T20:16:48.000Z | tests/staticfile.py | movermeyer/tangelo | 470034ee9b3d7a01becc1ce5fddc7adc1d5263ef | [
"Apache-2.0"
] | 21 | 2015-01-05T19:11:49.000Z | 2020-08-19T04:16:16.000Z | import nose
import requests
import fixture
@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_static_file():
r = requests.get(fixture.url("static_file"))
print r.text
assert r.ok
assert r.status_code == 200
assert r.text == "Infinite Diversity in Infinite Combinations\n"
a... | 30.714286 | 68 | 0.717829 |
ce85b8e61eb53f4c86bb47cdb1cdc330392f0539 | 1,510 | py | Python | alipay/aop/api/domain/AlipayCommerceIotDapplyRefundCreateModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayCommerceIotDapplyRefundCreateModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayCommerceIotDapplyRefundCreateModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayCommerceIotDapplyRefundCreateModel(object):
def __init__(self):
self._asset_apply_order_id = None
self._memo = None
@property
def asset_apply_order_id... | 26.964286 | 91 | 0.621192 |
14bc882dcf240935ad849e179ae0e9bc3d5de861 | 545 | py | Python | forest-example/classify_user.py | RedisLabs/spark-redis-ml | c43b817f170cdf3f2f5e2c6a92327294241bf0c3 | [
"BSD-3-Clause"
] | 70 | 2016-10-26T15:48:40.000Z | 2020-06-09T02:50:08.000Z | forest-example/classify_user.py | RedisLabs/spark-redis-ml | c43b817f170cdf3f2f5e2c6a92327294241bf0c3 | [
"BSD-3-Clause"
] | 5 | 2017-02-04T01:46:55.000Z | 2017-07-17T09:54:41.000Z | forest-example/classify_user.py | RedisLabs/spark-redis-ml | c43b817f170cdf3f2f5e2c6a92327294241bf0c3 | [
"BSD-3-Clause"
] | 15 | 2016-11-02T14:59:03.000Z | 2020-06-10T03:17:40.000Z | #!/usr/bin/python
import operator
import redis
config = {"host":"localhost", "port":6379}
r = redis.StrictRedis(**config)
user_profile = r.get("user-1-profile")
results = {}
for i in range(1, 11):
results[i] = r.execute_command("ML.FOREST.RUN", "movie-{}".format(i), user_profile)
print "Movies sorted by scores... | 23.695652 | 87 | 0.691743 |
697743be8b299d77e75d6342d55ad94de4e7724c | 6,305 | py | Python | antispam/ext/anti_mass_mention.py | 11Tuvork28/DPY-Anti-Spam | 8efe58b264460611baab9153d0799ffa390acaa0 | [
"MIT"
] | null | null | null | antispam/ext/anti_mass_mention.py | 11Tuvork28/DPY-Anti-Spam | 8efe58b264460611baab9153d0799ffa390acaa0 | [
"MIT"
] | null | null | null | antispam/ext/anti_mass_mention.py | 11Tuvork28/DPY-Anti-Spam | 8efe58b264460611baab9153d0799ffa390acaa0 | [
"MIT"
] | null | null | null | import logging
import datetime
import typing
from dataclasses import dataclass, asdict
import discord
from antispam.exceptions import UserNotFound
from antispam.base_extension import BaseExtension
from antispam.ext.user_tracking import UserTracking
log = logging.getLogger(__name__)
@dataclass
class MassMentionPun... | 29.881517 | 116 | 0.589532 |
ffc50ab1a5eb96c6c45b068613b71abe225a494d | 255 | py | Python | PYTHON/Desafios Python - Mundo 1/024B.py | FR7/Meus-Projetos | 1c8e1a91eaf143cccdc10f0e7edd013d910de474 | [
"MIT"
] | null | null | null | PYTHON/Desafios Python - Mundo 1/024B.py | FR7/Meus-Projetos | 1c8e1a91eaf143cccdc10f0e7edd013d910de474 | [
"MIT"
] | null | null | null | PYTHON/Desafios Python - Mundo 1/024B.py | FR7/Meus-Projetos | 1c8e1a91eaf143cccdc10f0e7edd013d910de474 | [
"MIT"
] | null | null | null | #Crie um programa que leia o nome de uma cidade e diga se ela começa ou não com o nome: "Santo".
cidade = str(input("Informe o nome da sua cidade: ")).strip().upper()
print("A cidade {} começa com o nome Santo?: {}".format(cidade, 'SANTO'in cidade[:5])) | 51 | 96 | 0.686275 |
3472820a8e4d39d6c2d54e10e94a830488991a10 | 4,153 | py | Python | discord/team.py | FrankKeller/discord.py | ed9f940c01490b94ee5d958ff105041a6e5d260c | [
"MIT"
] | null | null | null | discord/team.py | FrankKeller/discord.py | ed9f940c01490b94ee5d958ff105041a6e5d260c | [
"MIT"
] | 1 | 2020-01-21T16:21:11.000Z | 2020-01-21T16:21:11.000Z | discord/team.py | FrankKeller/discord.py | ed9f940c01490b94ee5d958ff105041a6e5d260c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 32.960317 | 104 | 0.659764 |
b1bb475e972655ff870c987bf364ac2b82d09edf | 512 | py | Python | pypersonalfin/utils/amount.py | guilhermebruzzi/pypersonalfin | 180619b36ed28e90b2891a9b2b9b4708d22cbdc8 | [
"MIT"
] | 1 | 2021-12-05T17:51:00.000Z | 2021-12-05T17:51:00.000Z | pypersonalfin/utils/amount.py | guilhermebruzzi/pypersonalfin | 180619b36ed28e90b2891a9b2b9b4708d22cbdc8 | [
"MIT"
] | null | null | null | pypersonalfin/utils/amount.py | guilhermebruzzi/pypersonalfin | 180619b36ed28e90b2891a9b2b9b4708d22cbdc8 | [
"MIT"
] | 1 | 2021-02-21T20:07:18.000Z | 2021-02-21T20:07:18.000Z | from .locale import is_brazil
def amount_to_str(amount, locale=None, include_currency=True):
float_amount = amount / 100.0
# Fallback to US amount
float_amount_str = "{:.2f}".format(float_amount)
if is_brazil(locale):
float_amount_str = float_amount_str.replace('.', ',')
if include_cu... | 26.947368 | 62 | 0.675781 |
c87a527f93d3f42c2bd6be702fdfef4efe5bb298 | 8,392 | py | Python | src/datasets/transforms.py | somritabanerjee/speedplusbaseline | 5913c611d8c182ad8070abcf5f1baffc554dfd90 | [
"MIT"
] | 11 | 2021-10-21T07:19:05.000Z | 2022-03-27T09:26:03.000Z | src/datasets/transforms.py | somritabanerjee/speedplusbaseline | 5913c611d8c182ad8070abcf5f1baffc554dfd90 | [
"MIT"
] | 2 | 2021-11-12T09:49:41.000Z | 2022-03-06T03:15:00.000Z | src/datasets/transforms.py | somritabanerjee/speedplusbaseline | 5913c611d8c182ad8070abcf5f1baffc554dfd90 | [
"MIT"
] | 3 | 2021-12-22T03:10:02.000Z | 2022-02-03T09:41:47.000Z | '''
MIT License
Copyright (c) 2021 SLAB Group
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, di... | 34.393443 | 83 | 0.617612 |
7ff0af30c0944c63bfe54db72999fa9aa7b3a9a6 | 2,220 | py | Python | scripts/visualization/stake.py | francescodisalvo05/portfolio_analysis | 1145d5b0307acde50a9b1be6be62483b16c70f34 | [
"MIT"
] | null | null | null | scripts/visualization/stake.py | francescodisalvo05/portfolio_analysis | 1145d5b0307acde50a9b1be6be62483b16c70f34 | [
"MIT"
] | null | null | null | scripts/visualization/stake.py | francescodisalvo05/portfolio_analysis | 1145d5b0307acde50a9b1be6be62483b16c70f34 | [
"MIT"
] | null | null | null | from math import pi
from typing import Dict, Text
import pandas as pd
from bokeh.layouts import gridplot, column
from bokeh.models import Div, HoverTool
from bokeh.palettes import Category20c
from bokeh.plotting import figure
from bokeh.transform import cumsum
from scripts.constants.constants import TOOLS
HEIGHT = 5... | 31.714286 | 94 | 0.581081 |
ac446b5ccc92b6f8c61217111375e67604fd653a | 34,229 | py | Python | kvmagent/kvmagent/plugins/localstorage.py | zstackio/zstack-utility | 919d686d46c68836cbcad51ab0b8bf53bc88abda | [
"ECL-2.0",
"Apache-2.0"
] | 55 | 2017-02-10T07:55:21.000Z | 2021-09-01T00:59:36.000Z | kvmagent/kvmagent/plugins/localstorage.py | zstackio/zstack-utility | 919d686d46c68836cbcad51ab0b8bf53bc88abda | [
"ECL-2.0",
"Apache-2.0"
] | 106 | 2017-02-13T09:58:27.000Z | 2022-02-15T09:51:48.000Z | kvmagent/kvmagent/plugins/localstorage.py | zstackio/zstack-utility | 919d686d46c68836cbcad51ab0b8bf53bc88abda | [
"ECL-2.0",
"Apache-2.0"
] | 68 | 2017-02-13T11:02:01.000Z | 2021-12-16T11:02:01.000Z | __author__ = 'frank'
import os
import os.path
import traceback
import zstacklib.utils.uuidhelper as uuidhelper
from kvmagent import kvmagent
from kvmagent.plugins.imagestore import ImageStoreClient
from zstacklib.utils import jsonobject
from zstacklib.utils import linux
from zstacklib.utils import shell
from zstackli... | 40.080796 | 235 | 0.668381 |
c2d88515894b5e90e7a57a065e97a1510061bc94 | 3,404 | py | Python | src/eiffel_graphql_api/graphql/schemas/union.py | magnusbaeck/eiffel-graphql-api | c0cd0dc3fdad7787988599974ace2a4cebf70844 | [
"Apache-2.0"
] | null | null | null | src/eiffel_graphql_api/graphql/schemas/union.py | magnusbaeck/eiffel-graphql-api | c0cd0dc3fdad7787988599974ace2a4cebf70844 | [
"Apache-2.0"
] | null | null | null | src/eiffel_graphql_api/graphql/schemas/union.py | magnusbaeck/eiffel-graphql-api | c0cd0dc3fdad7787988599974ace2a4cebf70844 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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.apac... | 34.734694 | 101 | 0.709166 |
e4f73305ec93a76ab8f972b47e474d19ff369e02 | 296 | py | Python | py_game_1/text.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | 1 | 2021-03-22T20:45:06.000Z | 2021-03-22T20:45:06.000Z | py_game_1/text.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | py_game_1/text.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | import pygame
class Text:
def __init__(self,screen,color):
self.screen = screen
self.color = color
def display(self,text,x,y):
font = pygame.font.Font('freesansbold.ttf', 25)
text = font.render(text, True, self.color)
self.screen.blit(text, (x,y))
| 29.6 | 55 | 0.618243 |
d8dafcad3365e3f7b37b808609e557883f39d86f | 21,764 | py | Python | env/Lib/site-packages/lightbulb/checks.py | AtharvVohra/iseakai-d-bot | 1257372bb5ab388a87a63a458aa6b173097227d3 | [
"Apache-2.0"
] | null | null | null | env/Lib/site-packages/lightbulb/checks.py | AtharvVohra/iseakai-d-bot | 1257372bb5ab388a87a63a458aa6b173097227d3 | [
"Apache-2.0"
] | null | null | null | env/Lib/site-packages/lightbulb/checks.py | AtharvVohra/iseakai-d-bot | 1257372bb5ab388a87a63a458aa6b173097227d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © tandemdude 2020-present
#
# This file is part of Lightbulb.
#
# Lightbulb is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | 40.081031 | 115 | 0.699228 |
e6b114c0c5ca510c50d907cabceb1e73f7e73f46 | 481 | py | Python | leave/migrations/0004_auto_20200810_1107.py | mathemartins/solitonEMS | be593a1de735a2d60288e3c3ef3cf50d554ebfce | [
"Unlicense",
"MIT"
] | null | null | null | leave/migrations/0004_auto_20200810_1107.py | mathemartins/solitonEMS | be593a1de735a2d60288e3c3ef3cf50d554ebfce | [
"Unlicense",
"MIT"
] | null | null | null | leave/migrations/0004_auto_20200810_1107.py | mathemartins/solitonEMS | be593a1de735a2d60288e3c3ef3cf50d554ebfce | [
"Unlicense",
"MIT"
] | 1 | 2021-01-05T20:27:40.000Z | 2021-01-05T20:27:40.000Z | # Generated by Django 3.0.7 on 2020-08-10 08:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leave', '0003_leaveplan_description'),
]
operations = [
migrations.AlterField(
model_name='leaveplan',
name='approva... | 25.315789 | 132 | 0.598753 |
8e59adc6d7dedbbc4dfd7d02a62b80720de877f9 | 4,057 | py | Python | tasks/data_visualization/src/plotting.py | rongfang323/policy-data-analyzer | 73a03089753a26fe5e7031c5c68ba887428246a9 | [
"FTL",
"RSA-MD"
] | null | null | null | tasks/data_visualization/src/plotting.py | rongfang323/policy-data-analyzer | 73a03089753a26fe5e7031c5c68ba887428246a9 | [
"FTL",
"RSA-MD"
] | null | null | null | tasks/data_visualization/src/plotting.py | rongfang323/policy-data-analyzer | 73a03089753a26fe5e7031c5c68ba887428246a9 | [
"FTL",
"RSA-MD"
] | null | null | null | from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scprep
import phate
def visualize_embeddings_2D(embs, numeric_labels, tsne_perplexity, pca_k_n_comps=None, seed=69420):
df = pd.DataFrame()
... | 38.638095 | 122 | 0.639882 |
132db73b42d39412b7073e9389cae6e4335cf400 | 3,750 | py | Python | pyreach/force_torque_sensor.py | google-research/pyreach | f91753ce7a26e77e122eb02a9fdd5a1ce3ce0159 | [
"Apache-2.0"
] | 13 | 2021-09-01T01:10:22.000Z | 2022-03-05T10:01:52.000Z | pyreach/force_torque_sensor.py | google-research/pyreach | f91753ce7a26e77e122eb02a9fdd5a1ce3ce0159 | [
"Apache-2.0"
] | null | null | null | pyreach/force_torque_sensor.py | google-research/pyreach | f91753ce7a26e77e122eb02a9fdd5a1ce3ce0159 | [
"Apache-2.0"
] | 6 | 2021-09-20T21:17:53.000Z | 2022-03-14T18:42:48.000Z | # Copyright 2021 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 or agreed to in writing, ... | 32.051282 | 80 | 0.674133 |
0e87428680f0b63e97751dddd9af768249c3f6dc | 8,013 | py | Python | tests/integration/prepare/test_prepare_esa_sentinel_l1.py | jaysnm/eo-datasets | e381d53efb208467406dd9e071d4bc2484c5bb5a | [
"Apache-2.0"
] | null | null | null | tests/integration/prepare/test_prepare_esa_sentinel_l1.py | jaysnm/eo-datasets | e381d53efb208467406dd9e071d4bc2484c5bb5a | [
"Apache-2.0"
] | null | null | null | tests/integration/prepare/test_prepare_esa_sentinel_l1.py | jaysnm/eo-datasets | e381d53efb208467406dd9e071d4bc2484c5bb5a | [
"Apache-2.0"
] | null | null | null | import datetime
import shutil
from pathlib import Path
import pytest
from eodatasets3.prepare import sentinel_l1c_prepare
from tests.common import check_prepare_outputs
DATASET_PATH: Path = Path(__file__).parent.parent / (
"data/esa_s2_l1c/S2B_MSIL1C_20201011T000249_N0209_R030_T55HFA_20201011T011446.zip"
)
@py... | 39.865672 | 106 | 0.541994 |
552e059cc6add9214e44bc559624c6ea75469bda | 523 | py | Python | web/mooctracker/projects/models.py | Jaaga/mooc-tracker | b7be270d24fa2608042064dc87ae13740893bade | [
"MIT"
] | null | null | null | web/mooctracker/projects/models.py | Jaaga/mooc-tracker | b7be270d24fa2608042064dc87ae13740893bade | [
"MIT"
] | 1 | 2020-06-05T17:43:59.000Z | 2020-06-05T17:43:59.000Z | web/mooctracker/projects/models.py | Jaaga/mooc-tracker | b7be270d24fa2608042064dc87ae13740893bade | [
"MIT"
] | 2 | 2015-02-25T10:46:20.000Z | 2016-10-28T11:24:32.000Z | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length = 200)
url = models.URLField(default=None, blank=True, null = True, max_length=400)
project_description = models.TextField(default=None, blank=True, null = True, max_length=2000)
project_site_url = models.URLFi... | 47.545455 | 96 | 0.76673 |
da4a7a33acfec7ebe0305b550e165536b1ff5f7f | 20,077 | py | Python | extra_foam/gui/plot_widgets/graphics_widgets.py | zhujun98/EXtra-foam | 680d6d7fd4afdcbc41eb8e440feac54b6cecab33 | [
"BSD-3-Clause"
] | null | null | null | extra_foam/gui/plot_widgets/graphics_widgets.py | zhujun98/EXtra-foam | 680d6d7fd4afdcbc41eb8e440feac54b6cecab33 | [
"BSD-3-Clause"
] | null | null | null | extra_foam/gui/plot_widgets/graphics_widgets.py | zhujun98/EXtra-foam | 680d6d7fd4afdcbc41eb8e440feac54b6cecab33 | [
"BSD-3-Clause"
] | null | null | null | """
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: Jun Zhu <jun.zhu@xfel.eu>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
import warnings
from itertools import chain
import numpy as ... | 32.278135 | 78 | 0.603128 |
22be8a018a8d6ecaad942508e30d55e2c249bc6f | 3,435 | py | Python | manual_requeue.py | davidh83110/aws_sqs-dead-letter-queue-lambda-requeue | 8bbe41908be726345bb4236c7d41f38656770459 | [
"MIT"
] | null | null | null | manual_requeue.py | davidh83110/aws_sqs-dead-letter-queue-lambda-requeue | 8bbe41908be726345bb4236c7d41f38656770459 | [
"MIT"
] | null | null | null | manual_requeue.py | davidh83110/aws_sqs-dead-letter-queue-lambda-requeue | 8bbe41908be726345bb4236c7d41f38656770459 | [
"MIT"
] | 1 | 2021-04-27T08:23:30.000Z | 2021-04-27T08:23:30.000Z | import boto3
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
class DLQ:
def __init__(self, queue_name):
self.sqs = boto3.resource('sqs')
self.dead_letter_queue_name = queue_name
def get_queue(self, queue_name):
queue = self.sqs.get_queue_by_name... | 32.102804 | 110 | 0.546143 |
55c3298d05d61422bd5aae5d56a9127b5d1703e6 | 5,254 | py | Python | skyportal/handlers/api/internal/standards.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 52 | 2018-11-02T00:53:21.000Z | 2022-03-08T16:03:52.000Z | skyportal/handlers/api/internal/standards.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 1,944 | 2017-04-27T18:51:20.000Z | 2022-03-31T20:17:44.000Z | skyportal/handlers/api/internal/standards.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 63 | 2017-05-13T01:40:47.000Z | 2022-03-12T11:32:11.000Z | import ast
from baselayer.app.access import auth_or_token
from baselayer.app.env import load_env
from ...base import BaseHandler
from ....utils.offset import get_formatted_standards_list
_, cfg = load_env()
class StandardsHandler(BaseHandler):
@auth_or_token
def get(self):
"""
---
d... | 35.986301 | 93 | 0.538257 |
fe93174a3b3cc44579de174ceb0e98adba3d4a6a | 813 | py | Python | cherrymusicclient/client.py | endlesscoil/cherrymusicclient | 07b0ef3ede11b7e26f41f944ee923760ab32ff5b | [
"MIT"
] | null | null | null | cherrymusicclient/client.py | endlesscoil/cherrymusicclient | 07b0ef3ede11b7e26f41f944ee923760ab32ff5b | [
"MIT"
] | null | null | null | cherrymusicclient/client.py | endlesscoil/cherrymusicclient | 07b0ef3ede11b7e26f41f944ee923760ab32ff5b | [
"MIT"
] | null | null | null | import logging
from .api import api
from .library import Playlist
class CherryMusicClient(object):
def __init__(self):
self.log = logging.getLogger(self.__class__.__name__)
self.playlists = []
self.current_playlist = None
def login(self, username, password):
return api.login(username, password)
def logo... | 19.829268 | 55 | 0.726937 |
2b8bfa9d640f6aebc8b1000a8698a617a06e557e | 6,520 | py | Python | src/programy/clients/polling/telegram/client.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | null | null | null | src/programy/clients/polling/telegram/client.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | null | null | null | src/programy/clients/polling/telegram/client.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 4 | 2019-04-01T15:42:23.000Z | 2020-11-05T08:14:27.000Z | """
Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... | 40.246914 | 120 | 0.713957 |
574e0c3168f73cf449f339edebba4a6383b10a85 | 372 | py | Python | 40/40.py | xiaomiwujiecao/effectivePythonNote | 772e81864b171dcc19b6bcb1b31fc61bcfa1b9fe | [
"MIT"
] | null | null | null | 40/40.py | xiaomiwujiecao/effectivePythonNote | 772e81864b171dcc19b6bcb1b31fc61bcfa1b9fe | [
"MIT"
] | null | null | null | 40/40.py | xiaomiwujiecao/effectivePythonNote | 772e81864b171dcc19b6bcb1b31fc61bcfa1b9fe | [
"MIT"
] | null | null | null | # encoding=utf-8
def my_coroutine():
while True:
received = yield
print('Received:',received)
it = my_coroutine()
next(it)
it.send('First')
it.send('Second')
def minimize():
current = yield
while True:
value = yield current
current = min(value,current)
it = minimize()
next(it)
print(it.send(10))
prin... | 13.285714 | 30 | 0.672043 |
433ae9442e060be775bf195be63f071cd7e20a65 | 33,475 | py | Python | jsl/jsengine/parser/__init__.py | thodges314/angular2 | 8600ef4193e5f6d84f391bfd29008653c7ffab38 | [
"MIT"
] | null | null | null | jsl/jsengine/parser/__init__.py | thodges314/angular2 | 8600ef4193e5f6d84f391bfd29008653c7ffab38 | [
"MIT"
] | null | null | null | jsl/jsengine/parser/__init__.py | thodges314/angular2 | 8600ef4193e5f6d84f391bfd29008653c7ffab38 | [
"MIT"
] | null | null | null | # vim: sw=4 ts=4 et
import unittest
from jsengine.tokenizer import tok
from jsengine import tokenizer
from jsengine import JSSyntaxError
from _constants_kind import kind
from _constants_op import op
from jsengine.structs import *
_VERSIONS = [
"default",
"1.0",
"1.1",
"1.2",
"1.... | 36.150108 | 96 | 0.569709 |
dd8d9e83c2d6068fa8faa82e5cac75deb4e7d5d4 | 19,291 | py | Python | homeassistant/components/roon/media_player.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/roon/media_player.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/roon/media_player.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """MediaPlayer platform for Roon integration."""
import logging
from roonapi import split_media_path
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
SUPPORT_BROWSE_MEDIA,
SUPPORT_GROUPING,
SUPPORT_NEXT_T... | 33.375433 | 98 | 0.610958 |
7ffd976dc565f47b9c9880aa852c49064f174a73 | 1,129 | py | Python | lpot/experimental/data/dataloaders/dataloader.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | lpot/experimental/data/dataloaders/dataloader.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | lpot/experimental/data/dataloaders/dataloader.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 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
#
# Unl... | 37.633333 | 74 | 0.73605 |
8e3579bb5678a733a058296f692bad4d7f15938b | 13,235 | py | Python | t61codec.py | exhuma/t61codec | 544a3d476817420576b97a6e35e92a0affff15ac | [
"MIT"
] | null | null | null | t61codec.py | exhuma/t61codec | 544a3d476817420576b97a6e35e92a0affff15ac | [
"MIT"
] | null | null | null | t61codec.py | exhuma/t61codec | 544a3d476817420576b97a6e35e92a0affff15ac | [
"MIT"
] | null | null | null | """
Python Character Mapping Codec for T61
See https://en.wikipedia.org/wiki/ITU_T.61
"""
# pylint: disable=invalid-name, no-member, redefined-builtin
import codecs
from typing import Tuple
try:
import importlib.metadata as imlib
except ImportError:
import importlib_metadata as imlib # type: ignore
__ver... | 35.867209 | 83 | 0.575595 |
7f9ac49e7f23db27c2501d747fe413da99b30d19 | 4,521 | py | Python | exps/example/yolox_voc/yolox_voc_s.py | newsun-boki/yolox-openvino-video-infer | caef7ab1ef881be9dcb4091685e8e4afd0a9b05a | [
"Apache-2.0"
] | null | null | null | exps/example/yolox_voc/yolox_voc_s.py | newsun-boki/yolox-openvino-video-infer | caef7ab1ef881be9dcb4091685e8e4afd0a9b05a | [
"Apache-2.0"
] | null | null | null | exps/example/yolox_voc/yolox_voc_s.py | newsun-boki/yolox-openvino-video-infer | caef7ab1ef881be9dcb4091685e8e4afd0a9b05a | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import os
import torch
import torch.distributed as dist
from yolox.data import get_yolox_datadir
from yolox.exp import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
self.num_classes = 5
self.depth = 0.33
self.width = 0.50
... | 32.06383 | 89 | 0.592126 |
17809cc3cc66049e718ecbcd34960bfec211e0f3 | 1,956 | py | Python | araig_calculators/src/comparators/edge_detector.py | ipa320/araig_test_stack | c704a4a4ac55f4113ff7ccd72aede0695e78a709 | [
"Apache-2.0"
] | null | null | null | araig_calculators/src/comparators/edge_detector.py | ipa320/araig_test_stack | c704a4a4ac55f4113ff7ccd72aede0695e78a709 | [
"Apache-2.0"
] | 52 | 2021-01-14T11:02:14.000Z | 2022-01-19T17:26:36.000Z | araig_calculators/src/comparators/edge_detector.py | ipa320/araig_test_stack | c704a4a4ac55f4113ff7ccd72aede0695e78a709 | [
"Apache-2.0"
] | 1 | 2021-01-27T14:33:00.000Z | 2021-01-27T14:33:00.000Z | #!/usr/bin/env python
import rospy
import threading
from std_msgs.msg import Float64
from araig_msgs.msg import BoolStamped
from base_classes.base_calculator import BaseCalculator
"""Compare bool from a topic, publish and latch a level shift
pub_list = {"out_high": "BoolStamped", "out_low": "BoolStamped"}
sub... | 36.90566 | 77 | 0.607362 |
d11235935f448b11e5ae5edad174a18684b9dd9f | 83,166 | py | Python | qnarre/models/perceiver.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/models/perceiver.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/models/perceiver.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2022 Quantapix 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 l... | 35.754944 | 134 | 0.615564 |
5bff93a0dbeafa219f3fca6a16660be815dcc395 | 3,434 | py | Python | mail_fetch.py | Edison-Hsu/12306Calendar | e4303db3777508c6be90fdbcf372f2437121e570 | [
"MIT"
] | 6 | 2020-11-02T10:08:51.000Z | 2022-01-18T06:41:34.000Z | mail_fetch.py | Edison-Hsu/12306Calendar | e4303db3777508c6be90fdbcf372f2437121e570 | [
"MIT"
] | null | null | null | mail_fetch.py | Edison-Hsu/12306Calendar | e4303db3777508c6be90fdbcf372f2437121e570 | [
"MIT"
] | 4 | 2020-11-18T14:53:41.000Z | 2022-01-18T06:41:36.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from calendar_generate import CalendarGenerate
from calendar_resovle import CalendarResovle
from mail_resovle import MailResovle
import poplib, os, re
class MailFetch:
def __init__(self, user_email, password, pop3_server):
if len(pop3_server) == 0:
... | 36.147368 | 123 | 0.598719 |
9234b02d346326610ecb07d024d57dd6febf877b | 80 | py | Python | openpay/__init__.py | openpaygithub/PythonSDK | 13fe155fe9c9f72c3ba575e6ee65e3bba16037b7 | [
"MIT"
] | null | null | null | openpay/__init__.py | openpaygithub/PythonSDK | 13fe155fe9c9f72c3ba575e6ee65e3bba16037b7 | [
"MIT"
] | 3 | 2021-03-31T18:59:15.000Z | 2021-12-13T19:54:07.000Z | openpay/__init__.py | openpaygithub/PythonSDK | 13fe155fe9c9f72c3ba575e6ee65e3bba16037b7 | [
"MIT"
] | 1 | 2019-01-22T13:37:58.000Z | 2019-01-22T13:37:58.000Z | from .new_checkout import (Client, Merchant)
__all__ = ['Client', 'Merchant']
| 16 | 44 | 0.7125 |
557f782d9278ed5990bdd031ed182cea881bd3ca | 5,371 | py | Python | tests/test_magicgraph.py | dihuang0220/magic-graph-py3 | 391abb36491a1b8e3160a27da55cce0e2eaa098e | [
"BSD-3-Clause"
] | 2 | 2019-07-15T20:16:22.000Z | 2019-07-16T02:56:01.000Z | tests/test_magicgraph.py | dihuang0220/magic-graph-py3 | 391abb36491a1b8e3160a27da55cce0e2eaa098e | [
"BSD-3-Clause"
] | null | null | null | tests/test_magicgraph.py | dihuang0220/magic-graph-py3 | 391abb36491a1b8e3160a27da55cce0e2eaa098e | [
"BSD-3-Clause"
] | null | null | null | import unittest
import magicgraph
import random
from magicgraph.generators import clique
class TestDiGraph(unittest.TestCase):
def test_nodes(self):
network = clique(5)
self.assertEqual(set(range(1, 6)).difference(network.nodes()), set())
def test_adjacency_iter(self):
network = clique(3)
self... | 27.685567 | 117 | 0.62372 |
d5ee8accb3ceb5651bbda2a61b3db10f7d81f641 | 39 | py | Python | my_plugin/tests/__init__.py | FragmentedPacket/test-cookiecutter | 61b8b723a3081a5981ff63b56628f07b0d9fbc7b | [
"Apache-2.0"
] | null | null | null | my_plugin/tests/__init__.py | FragmentedPacket/test-cookiecutter | 61b8b723a3081a5981ff63b56628f07b0d9fbc7b | [
"Apache-2.0"
] | null | null | null | my_plugin/tests/__init__.py | FragmentedPacket/test-cookiecutter | 61b8b723a3081a5981ff63b56628f07b0d9fbc7b | [
"Apache-2.0"
] | null | null | null | """Unit tests for my_plugin plugin."""
| 19.5 | 38 | 0.692308 |
88632c3cc304ecf70bbdf83fc62bd1ee2b3012d7 | 4,826 | py | Python | pytorch_toolkit/person_reidentification/main.py | AnastasiaaSenina/openvino_training_extensions | 267425d64372dff5b9083dc0ca6abfc305a71449 | [
"Apache-2.0"
] | 1 | 2020-02-09T15:50:49.000Z | 2020-02-09T15:50:49.000Z | pytorch_toolkit/person_reidentification/main.py | AnastasiaaSenina/openvino_training_extensions | 267425d64372dff5b9083dc0ca6abfc305a71449 | [
"Apache-2.0"
] | null | null | null | pytorch_toolkit/person_reidentification/main.py | AnastasiaaSenina/openvino_training_extensions | 267425d64372dff5b9083dc0ca6abfc305a71449 | [
"Apache-2.0"
] | null | null | null | """
MIT License
Copyright (c) 2018 Kaiyang Zhou
"""
"""
Copyright (c) 2019 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
... | 34.719424 | 108 | 0.717157 |
1573d001d141534c722978352c920b2749e72a3d | 7,114 | py | Python | mmdet/core/data_structures/instance_data.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | mmdet/core/data_structures/instance_data.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | mmdet/core/data_structures/instance_data.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import itertools
import numpy as np
import torch
from .general_data import GeneralData
class InstanceData(GeneralData):
"""Data structure for instance-level annnotations or predictions.
Subclass of :class:`GeneralData`. All value in `data_fields`
... | 37.640212 | 110 | 0.480461 |
40ed75d540a6a729d708798eb27aee454687e0e7 | 1,710 | py | Python | sdk/core/azure-core/azure/core/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | sdk/core/azure-core/azure/core/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/core/azure-core/azure/core/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 38.863636 | 90 | 0.702339 |
c63cff1ef99441b5def867eaff65a6fc9ab6b093 | 1,850 | py | Python | main.py | emppu-dev/encrypt-decrypt | 84800b51d9033603d57b8f7455ee96b91be03e8b | [
"MIT"
] | null | null | null | main.py | emppu-dev/encrypt-decrypt | 84800b51d9033603d57b8f7455ee96b91be03e8b | [
"MIT"
] | null | null | null | main.py | emppu-dev/encrypt-decrypt | 84800b51d9033603d57b8f7455ee96b91be03e8b | [
"MIT"
] | null | null | null | from cryptography.fernet import Fernet
import json
import os
print("[1] - Encrypt")
print("[2] - Decrypt")
print("[3] - Key options")
valinta = str(input("emppu.cc @> "))
with open('config.json') as f:
config = json.load(f)
key = config.get('key')
if valinta == "1":
os.system("cls")
print("Encrypt")
... | 23.125 | 53 | 0.558919 |
6f404c73e58333c647cf2860c473e5931bda9de0 | 734 | py | Python | consoleproxy/setup.py | mchtech/zstack-utility | 18c7947b083b70b2b23f7f21992ca0ef09ac7e75 | [
"Apache-2.0"
] | null | null | null | consoleproxy/setup.py | mchtech/zstack-utility | 18c7947b083b70b2b23f7f21992ca0ef09ac7e75 | [
"Apache-2.0"
] | null | null | null | consoleproxy/setup.py | mchtech/zstack-utility | 18c7947b083b70b2b23f7f21992ca0ef09ac7e75 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
import sys, os
version = '3.0.0'
setup(name='consoleproxy',
version=version,
description="zstack console proxy agent",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords... | 27.185185 | 95 | 0.619891 |
011e5d2af6936449eaca4f5f863b78187b91981b | 865 | py | Python | archives/histograma01.py | LBarros77/Python | 283b383d9d14c8d7b907b80f03f7cdc5dbd1e8af | [
"MIT"
] | null | null | null | archives/histograma01.py | LBarros77/Python | 283b383d9d14c8d7b907b80f03f7cdc5dbd1e8af | [
"MIT"
] | null | null | null | archives/histograma01.py | LBarros77/Python | 283b383d9d14c8d7b907b80f03f7cdc5dbd1e8af | [
"MIT"
] | null | null | null | '''
Pasos:
Pida al usuario el nombre del archivo de entrada.
Lea el archivo (si es posible) y cuente todas las letras latinas (las letras mayúsculas y minúsculas se tratan como iguales).
Imprima un histograma simple en orden alfabético (solo se deben presentar recuentos distintos de cero).
Questión:
Crea un archivo de... | 27.03125 | 125 | 0.623121 |
2454b7c04d349f13c69b131e9e7993585ea817a8 | 6,795 | py | Python | repodata_tools/tokens.py | conda-forge/repodata-tools | 6792fa3cc9bb52cbaf6a7ac5c63539c859cab19c | [
"BSD-3-Clause"
] | 1 | 2021-06-16T19:11:30.000Z | 2021-06-16T19:11:30.000Z | repodata_tools/tokens.py | conda-forge/repodata-tools | 6792fa3cc9bb52cbaf6a7ac5c63539c859cab19c | [
"BSD-3-Clause"
] | 3 | 2021-03-23T13:32:15.000Z | 2022-03-01T10:49:51.000Z | repodata_tools/tokens.py | conda-forge/repodata-tools | 6792fa3cc9bb52cbaf6a7ac5c63539c859cab19c | [
"BSD-3-Clause"
] | 1 | 2021-07-02T13:08:32.000Z | 2021-07-02T13:08:32.000Z | import time
import base64
import os
import io
import sys
from contextlib import redirect_stdout, redirect_stderr
import github
import click
import jwt
import requests
from cryptography.hazmat.backends import default_backend
from nacl import encoding, public
def _encrypt_github_secret(public_key, secret_value):
"... | 28.792373 | 87 | 0.552759 |
7c93a5a47180b92c73f50e5ae838d567ca54f54f | 1,718 | py | Python | optimization.py | morenoh149/deeplearning | 4460f97ca2e75a9060bd947fac20986c62f25272 | [
"MIT"
] | 122 | 2016-10-25T14:13:08.000Z | 2021-10-10T08:28:44.000Z | optimization.py | Andijenny/deeplearning | 24d2dc9f9710bc74a1b7a9300c59fad2d63767d3 | [
"MIT"
] | null | null | null | optimization.py | Andijenny/deeplearning | 24d2dc9f9710bc74a1b7a9300c59fad2d63767d3 | [
"MIT"
] | 31 | 2016-11-11T00:53:47.000Z | 2021-05-25T15:42:07.000Z | import itertools
import math
import numpy as np
def run_iterations(iterator, max_iterations, abs_tol=1e-20):
""" Run iterative optimization method such as gradient descent. Stop early if cost doesn't change. """
previous_cost = None
limited_iterator = itertools.islice(iterator, max_iterations)
for i,... | 26.430769 | 106 | 0.604191 |
18f1ad66ed3a7dd04dd3702999e2a6633538085d | 940 | py | Python | mqueue/tests/test_admin.py | synw/django-mqueue | 02d68baba29ab33d71d4238b850d44a637fec04a | [
"MIT"
] | 29 | 2016-04-24T11:57:52.000Z | 2022-03-22T17:12:36.000Z | mqueue/tests/test_admin.py | synw/django-mqueue | 02d68baba29ab33d71d4238b850d44a637fec04a | [
"MIT"
] | 4 | 2016-11-02T13:23:03.000Z | 2021-07-23T12:42:03.000Z | mqueue/tests/test_admin.py | synw/django-mqueue | 02d68baba29ab33d71d4238b850d44a637fec04a | [
"MIT"
] | 5 | 2016-05-22T12:34:48.000Z | 2020-03-13T10:54:46.000Z | from django.contrib import admin
from .base import MqueueBaseTest
from mqueue.models import MEvent
from mqueue.admin import link_to_object, link_to_object_admin, MEventAdmin
class MqueueTestAdmin(MqueueBaseTest):
def test_admin(self):
instance, _ = MEvent.objects.get_or_create(
name="Event nam... | 36.153846 | 80 | 0.656383 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.