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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
be7cbbbb430f8bde030348aa8472c2c2dc1d743c | 146 | py | Python | shmlast/__init__.py | bluegenes/shmlast | fef7cdf0f56678be538e0d7e375f1da4c6c280f9 | [
"BSD-3-Clause"
] | 21 | 2016-04-12T12:16:40.000Z | 2020-12-09T06:10:08.000Z | shmlast/__init__.py | bluegenes/shmlast | fef7cdf0f56678be538e0d7e375f1da4c6c280f9 | [
"BSD-3-Clause"
] | 12 | 2016-06-09T04:33:23.000Z | 2020-10-05T21:55:49.000Z | shmlast/__init__.py | bluegenes/shmlast | fef7cdf0f56678be538e0d7e375f1da4c6c280f9 | [
"BSD-3-Clause"
] | 7 | 2016-06-09T04:23:58.000Z | 2020-09-30T23:55:30.000Z | #!/usr/bin/env python
from os.path import join, dirname
rel_path = dirname(__file__)
__version__ = open(join(rel_path, 'VERSION')).read().strip()
| 29.2 | 60 | 0.739726 |
f8bea6fd2399d8043aa8a5571df47161c713277e | 27,401 | py | Python | django/db/backends/base/base.py | jommerce/django | baf9604ed8fed3e6e7ddfaca2d83c377c81399ae | [
"BSD-3-Clause",
"0BSD"
] | 16 | 2019-08-10T12:24:06.000Z | 2020-05-21T09:11:14.000Z | django/db/backends/base/base.py | jommerce/django | baf9604ed8fed3e6e7ddfaca2d83c377c81399ae | [
"BSD-3-Clause",
"0BSD"
] | 12 | 2019-08-10T11:55:29.000Z | 2020-05-21T04:46:30.000Z | django/db/backends/base/base.py | jommerce/django | baf9604ed8fed3e6e7ddfaca2d83c377c81399ae | [
"BSD-3-Clause",
"0BSD"
] | 3 | 2019-08-20T13:29:34.000Z | 2020-01-30T22:05:10.000Z | import _thread
import copy
import datetime
import threading
import time
import warnings
from collections import deque
from contextlib import contextmanager
try:
import zoneinfo
except ImportError:
from backports import zoneinfo
from django.conf import settings
from django.core.exceptions import ImproperlyConf... | 35.539559 | 88 | 0.637641 |
cb11a73f21d3aa2fe8339212e1bc1f925ae3c2f5 | 19,328 | py | Python | viewer/main.py | Lukasz1928/DICOM-viewer | 778541d85c6e6a96e90c9d1050f3dec2b8387b5d | [
"MIT"
] | null | null | null | viewer/main.py | Lukasz1928/DICOM-viewer | 778541d85c6e6a96e90c9d1050f3dec2b8387b5d | [
"MIT"
] | null | null | null | viewer/main.py | Lukasz1928/DICOM-viewer | 778541d85c6e6a96e90c9d1050f3dec2b8387b5d | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import messagebox, ttk, scrolledtext
from tkinter.colorchooser import askcolor
from tkinter.simpledialog import askinteger
from viewer.command.command_executor import CommandExecutor
from viewer.dicom_utils.io import read_dicom, list_dicoms_from_dir
from viewer.dicom_utils.window impo... | 47.960298 | 120 | 0.645954 |
e712f68522d502cde822aefd9c219cea2965ddac | 93 | py | Python | cosplay_codex/costumes/admin.py | vetaylor/cosplay-codex | d57a5555e18ded974715d3908ff1f8bc8f100cc7 | [
"MIT"
] | null | null | null | cosplay_codex/costumes/admin.py | vetaylor/cosplay-codex | d57a5555e18ded974715d3908ff1f8bc8f100cc7 | [
"MIT"
] | null | null | null | cosplay_codex/costumes/admin.py | vetaylor/cosplay-codex | d57a5555e18ded974715d3908ff1f8bc8f100cc7 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Costume
admin.site.register(Costume)
| 13.285714 | 32 | 0.806452 |
d54d8bf2ce38b166813efa478bcbfe1971091f8f | 3,047 | py | Python | ddi_search_engine/Bio/EUtils/Mixins.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | 3 | 2015-06-08T17:58:54.000Z | 2022-03-10T18:49:44.000Z | Bio/EUtils/Mixins.py | eoc21/biopython | c0f8db8f55a506837c320459957a0ce99b0618b6 | [
"PostgreSQL"
] | null | null | null | Bio/EUtils/Mixins.py | eoc21/biopython | c0f8db8f55a506837c320459957a0ce99b0618b6 | [
"PostgreSQL"
] | 1 | 2019-08-19T22:05:14.000Z | 2019-08-19T22:05:14.000Z | """implements functionality shared between HistoryClient and DBIdsClient"""
# These are mixins and use methods implemented by the main classes.
import parse
class LinkMixin:
def prlinks(self,
db = "pubmed",
term = None,
field = None,
daterange = None... | 35.430233 | 76 | 0.440105 |
6b0ec59039a82ebd71da017f6de36c1811acba56 | 9,820 | py | Python | .venv/lib/python3.8/site-packages/numpy/core/_dtype.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | .venv/lib/python3.8/site-packages/numpy/core/_dtype.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | bot/lib/python3.7/site-packages/numpy/core/_dtype.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """
A place for code to be called from the implementation of np.dtype
String handling is much easier to do correctly in python.
"""
import numpy as np
_kind_to_stem = {
'u': 'uint',
'i': 'int',
'c': 'complex',
'f': 'float',
'b': 'bool',
'V': 'void',
'O': 'object',
'M': 'datetime',
... | 28.629738 | 81 | 0.617515 |
f62a92387c18169ab549e232ed1c88e4726f72bf | 9,928 | py | Python | py-faster-rcnn/lib/datasets/imdb.py | pierre-ecarlat/food_detection | c23f328d1b04c4a97bbfdaa49846507115bd2c7e | [
"BSD-2-Clause"
] | null | null | null | py-faster-rcnn/lib/datasets/imdb.py | pierre-ecarlat/food_detection | c23f328d1b04c4a97bbfdaa49846507115bd2c7e | [
"BSD-2-Clause"
] | null | null | null | py-faster-rcnn/lib/datasets/imdb.py | pierre-ecarlat/food_detection | c23f328d1b04c4a97bbfdaa49846507115bd2c7e | [
"BSD-2-Clause"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
import os.path as osp
import PIL
from utils.cython_bbox impor... | 38.48062 | 80 | 0.528102 |
6dc4d72afb9fcc248fed38a1a952d53586d99932 | 3,768 | py | Python | cnltk/tokenize/stanford.py | gouthambs/cnltk | ad122a150e7796bf535c49676dec9fac2db8a19c | [
"Apache-2.0"
] | null | null | null | cnltk/tokenize/stanford.py | gouthambs/cnltk | ad122a150e7796bf535c49676dec9fac2db8a19c | [
"Apache-2.0"
] | null | null | null | cnltk/tokenize/stanford.py | gouthambs/cnltk | ad122a150e7796bf535c49676dec9fac2db8a19c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the Stanford Tokenizer
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Steven Xu <xxu@student.unimelb.edu.au>
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals, print_function
import tempfi... | 33.345133 | 134 | 0.647028 |
4930c6292073da4d947aa30e9a7881ba0c74f014 | 13,176 | py | Python | ulora/ulora.py | qratz/uLoRa_v1.1 | da7e2d20304dda28810821a99847a3d86ac01646 | [
"MIT"
] | null | null | null | ulora/ulora.py | qratz/uLoRa_v1.1 | da7e2d20304dda28810821a99847a3d86ac01646 | [
"MIT"
] | null | null | null | ulora/ulora.py | qratz/uLoRa_v1.1 | da7e2d20304dda28810821a99847a3d86ac01646 | [
"MIT"
] | null | null | null | # Copyright 2015, 2016 Ideetron B.V.
#
# This program 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 your option) any later version.
#
# This program is distri... | 37.862069 | 123 | 0.628567 |
999b8eae8e970abbb2dd3749eea38e4e8252b4e1 | 4,090 | py | Python | in_silico_dataset/calc_roc.py | a-slide/nanocompore_paper_analyses | ca18e8d3e480ecd0d8d5506b2d55cfa35171de06 | [
"MIT"
] | 1 | 2021-01-26T17:41:10.000Z | 2021-01-26T17:41:10.000Z | in_silico_dataset/calc_roc.py | a-slide/nanocompore_paper_analyses | ca18e8d3e480ecd0d8d5506b2d55cfa35171de06 | [
"MIT"
] | null | null | null | in_silico_dataset/calc_roc.py | a-slide/nanocompore_paper_analyses | ca18e8d3e480ecd0d8d5506b2d55cfa35171de06 | [
"MIT"
] | null | null | null | import csv
from collections import *
from itertools import chain
import numpy as np
import sys
dataset = sys.argv[1]
datasets = [dataset]
# Basedire where nanocompore output is found
basedir="/hps/nobackup/enright/tom/in_silico_dataset/analysis/nanocompore/"
# Nucleotide tolerance to consider a peak a positive hit
tol... | 41.734694 | 155 | 0.587775 |
667205209a4ef4bc49e8d1dc1483568cbbc419dc | 263 | py | Python | src/test/tinc/tinctest/test/folder2/test_folder2.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tinctest/test/folder2/test_folder2.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tinctest/test/folder2/test_folder2.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | import unittest2 as unittest
import tinctest
from tinctest import TINCTestCase
@unittest.skip('mock test case for discovery tests')
class TINCTestCase2(TINCTestCase):
"""
@maintainer balasr3
"""
def test_folder2_sample(self):
pass
| 17.533333 | 52 | 0.711027 |
7790917e7d39e6bcaf30d02557337d5523054e10 | 12,795 | py | Python | tests/adapter/mongo/test_gene_handler.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | tests/adapter/mongo/test_gene_handler.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | tests/adapter/mongo/test_gene_handler.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | import pytest
from scout.models.hgnc_map import HgncGene
from scout.exceptions import IntegrityError
#################### HGNC gene tests ####################
def test_insert_gene(adapter, parsed_gene):
##GIVEN a empty adapter
assert sum(1 for i in adapter.all_genes()) == 0
##WHEN inserting a gene
... | 27.28145 | 73 | 0.607581 |
6e0bd6746606d47bad238d06816c6617c9c196fb | 1,548 | py | Python | cdad/cdadmap/management/commands/set_org_name_fk.py | NiJeLorg/CDADMap | 1f03dccf57951748155a0094a5aec3253183c412 | [
"MIT"
] | null | null | null | cdad/cdadmap/management/commands/set_org_name_fk.py | NiJeLorg/CDADMap | 1f03dccf57951748155a0094a5aec3253183c412 | [
"MIT"
] | null | null | null | cdad/cdadmap/management/commands/set_org_name_fk.py | NiJeLorg/CDADMap | 1f03dccf57951748155a0094a5aec3253183c412 | [
"MIT"
] | null | null | null | import sys,os
from django.core.management.base import BaseCommand, CommandError
from cdadmap.models import *
"""
Sets the foreign key in locationPanel from SurveyPanel and ContactPanel
"""
class Command(BaseCommand):
def set_location_fk(self):
for location in LocationPanel.objects.all(... | 34.4 | 107 | 0.685401 |
c951efd3d9f834391ad98ddd6454e76d9c800523 | 1,943 | py | Python | tensorflow/contrib/integrate/__init__.py | wangguizhu27/tensorflow1 | 3462966ac7d3884c2153b1655e8528a0f6bac0f4 | [
"Apache-2.0"
] | 65 | 2016-09-26T01:30:40.000Z | 2021-08-11T17:00:41.000Z | tensorflow/contrib/integrate/__init__.py | wangguizhu27/tensorflow1 | 3462966ac7d3884c2153b1655e8528a0f6bac0f4 | [
"Apache-2.0"
] | 5 | 2017-02-21T08:37:52.000Z | 2017-03-29T05:46:05.000Z | tensorflow/contrib/integrate/__init__.py | wangguizhu27/tensorflow1 | 3462966ac7d3884c2153b1655e8528a0f6bac0f4 | [
"Apache-2.0"
] | 11 | 2017-09-10T16:22:21.000Z | 2021-08-09T09:24:50.000Z | # Copyright 2016 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... | 29.439394 | 80 | 0.703551 |
badd4d51fc54a43f5a969546c6a1e59c85c38d60 | 11,990 | py | Python | server/tools/copy.py | Unifield/ufcheck | 842cbf4bc0526db9a16ff0ccbcc7bd68368ae178 | [
"MIT"
] | null | null | null | server/tools/copy.py | Unifield/ufcheck | 842cbf4bc0526db9a16ff0ccbcc7bd68368ae178 | [
"MIT"
] | null | null | null | server/tools/copy.py | Unifield/ufcheck | 842cbf4bc0526db9a16ff0ccbcc7bd68368ae178 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | 27.25 | 79 | 0.586322 |
642ea25d2aeb94d5b53493791a2edd7be6021730 | 3,748 | py | Python | snippets/data_structure/segment_tree.py | KATO-Hiro/Somen-Soupy | d9a3f44a3f4ab1a491b8fb2ef151966cce4804b1 | [
"CC0-1.0"
] | 1 | 2021-05-04T01:33:17.000Z | 2021-05-04T01:33:17.000Z | snippets/data_structure/segment_tree.py | KATO-Hiro/Somen-Soupy | d9a3f44a3f4ab1a491b8fb2ef151966cce4804b1 | [
"CC0-1.0"
] | 113 | 2019-06-08T11:50:10.000Z | 2022-03-24T04:49:55.000Z | snippets/data_structure/segment_tree.py | KATO-Hiro/Somen-Soupy | d9a3f44a3f4ab1a491b8fb2ef151966cce4804b1 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Usage:
#
# a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# st = SegTree(max, -1, a) # op, e, array
# st.set(0, 0) # a[0] = 0
# max_value = st.prod(pre_l, pre_r) # op(a[l], ..., a[r - 1]) # log(n)
import typing
# See:
# ac-library-python
# https://github.com/not522/ac-library-python/blob/... | 24.821192 | 76 | 0.447705 |
2470587f55a0f9141d06094c472fdaa654a13976 | 1,058 | py | Python | pyvisdk/do/host_new_network_connect_info.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_new_network_connect_info.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_new_network_connect_info.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostNewNetworkConnectInfo(vim, *args, **kwargs):
'''Network information for a network... | 31.117647 | 124 | 0.613422 |
d4cc8da707a69b3b9b9337399bf37f062a9c82f5 | 4,973 | py | Python | gym_electric_motor/envs/gym_dcm/dc_series_motor_env.py | zizai/gym-electric-motor | 48a0232edf3474e441453126df0f52dc391aed11 | [
"MIT"
] | null | null | null | gym_electric_motor/envs/gym_dcm/dc_series_motor_env.py | zizai/gym-electric-motor | 48a0232edf3474e441453126df0f52dc391aed11 | [
"MIT"
] | null | null | null | gym_electric_motor/envs/gym_dcm/dc_series_motor_env.py | zizai/gym-electric-motor | 48a0232edf3474e441453126df0f52dc391aed11 | [
"MIT"
] | null | null | null | from ...core import ElectricMotorEnvironment
from ...physical_systems.physical_systems import DcMotorSystem
from ...reference_generators.wiener_process_reference_generator import WienerProcessReferenceGenerator
from ...reward_functions import WeightedSumOfErrors
class DcSeriesMotorEnvironment(ElectricMotorEnvir... | 32.503268 | 112 | 0.603258 |
e0e052a41d53634c8787677d896fe30eb4bcd605 | 299 | py | Python | mumbletemps/urls.py | wengole/allianceauth-mumble-temp | 5d79dfb966335e0471b2844fd553d6b922ab3dff | [
"MIT"
] | null | null | null | mumbletemps/urls.py | wengole/allianceauth-mumble-temp | 5d79dfb966335e0471b2844fd553d6b922ab3dff | [
"MIT"
] | null | null | null | mumbletemps/urls.py | wengole/allianceauth-mumble-temp | 5d79dfb966335e0471b2844fd553d6b922ab3dff | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = "mumbletemps"
urlpatterns = [
path("", views.Index.as_view(), name="index"),
path("join/<link_ref>/", views.TempLinkLogin.as_view(), name="join"),
path("delete/<link_ref>/", views.DeleteTempLink.as_view(), name="delete"),
]
| 24.916667 | 78 | 0.675585 |
b16a4c452f99cba811224608a81f1bbd8e0ad2e7 | 1,069 | py | Python | cinemanio/api/tests/user.py | cinemanio/backend | c393dc8c2d59dc99aa2c3314d3372b6e2bf5497f | [
"MIT"
] | 4 | 2018-07-05T07:00:04.000Z | 2021-02-03T22:02:13.000Z | cinemanio/api/tests/user.py | cinemanio/backend | c393dc8c2d59dc99aa2c3314d3372b6e2bf5497f | [
"MIT"
] | 19 | 2018-09-03T23:27:49.000Z | 2020-02-12T00:09:02.000Z | cinemanio/api/tests/user.py | cinemanio/backend | c393dc8c2d59dc99aa2c3314d3372b6e2bf5497f | [
"MIT"
] | null | null | null | from cinemanio.api.helpers import global_id
from cinemanio.api.tests.base import AuthQueryBaseTestCase
class UserQueryTestCase(AuthQueryBaseTestCase):
me_query = '''
query Me {
me {
id
username
email
firstName
lastName
}
... | 33.40625 | 112 | 0.627689 |
2cad889dc8036272959c82bcbf1cd81b320b435f | 935 | py | Python | blender/arm/logicnode/array/LN_array_object.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/array/LN_array_object.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/array/LN_array_object.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class ObjectArrayNode(ArmLogicTreeNode):
"""Use to make an array of object elements."""
bl_idname = 'LNArrayObjectNode'
bl_label = 'Array Object'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
... | 34.62963 | 85 | 0.668449 |
f5a047aa69372217ad090230a4a90dd36e973692 | 324 | py | Python | todo/forms.py | talesmm14/To-Do-List-Using-Django | 9359f2d63543a57b7156637543a823f0306c40df | [
"MIT"
] | 1 | 2021-08-23T20:34:08.000Z | 2021-08-23T20:34:08.000Z | todo/forms.py | talesmm14/To-Do-List-Using-Django | 9359f2d63543a57b7156637543a823f0306c40df | [
"MIT"
] | null | null | null | todo/forms.py | talesmm14/To-Do-List-Using-Django | 9359f2d63543a57b7156637543a823f0306c40df | [
"MIT"
] | null | null | null | from todo.models import Task
from django import forms
class TaskForm(forms.ModelForm):
title = forms.CharField(widget=forms.TextInput(
attrs={'placeholder': 'Add new task...'}))
class Meta:
model = Task
fields = ('title',
'conclusion_at',
'concluded... | 21.6 | 51 | 0.580247 |
c065be4b747f3f68d09fd0c34d4ce04c529a28d1 | 2,508 | py | Python | lyapunov_reachability/common/utils.py | 62subinh/deeprl_safety_specification | 2ae7c4d1564f16539336bedc48110743ecd60935 | [
"MIT"
] | 3 | 2021-03-23T13:46:04.000Z | 2021-09-28T14:54:43.000Z | lyapunov_reachability/common/utils.py | 62subinh/deeprl_safety_specification | 2ae7c4d1564f16539336bedc48110743ecd60935 | [
"MIT"
] | null | null | null | lyapunov_reachability/common/utils.py | 62subinh/deeprl_safety_specification | 2ae7c4d1564f16539336bedc48110743ecd60935 | [
"MIT"
] | 1 | 2020-11-28T08:05:09.000Z | 2020-11-28T08:05:09.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import constraints
from torch.distributions.transforms import Transform
def conv2d_output_shape(size, kernel_size, stride, padding=0, dilation=1,):
return (size + 2 * padding - dilation * (kernel_size - 1) - 1) // stride +... | 34.833333 | 118 | 0.663477 |
d0aec35c7b851b95e8a8898626bfb8c5ce8baa43 | 368 | py | Python | examples/conftest.py | francois-vincent/simply | c3204b7df0598c100136986670da8bff935f2279 | [
"MIT"
] | null | null | null | examples/conftest.py | francois-vincent/simply | c3204b7df0598c100136986670da8bff935f2279 | [
"MIT"
] | null | null | null | examples/conftest.py | francois-vincent/simply | c3204b7df0598c100136986670da8bff935f2279 | [
"MIT"
] | null | null | null | # encoding: utf-8
def pytest_addoption(parser):
parser.addoption('--reset', action='store_true',
help="force remove image, ie force an image build or pull "
"(default: reuse existing image")
parser.addoption('--keep-running', action='store_true',
... | 30.666667 | 80 | 0.586957 |
0b2f4cb39ef100e55467afc1ec90b7644f9b5699 | 1,198 | py | Python | setup.py | kkristof200/selenium_chrome | 1bb1f2ac6c0254704607f6f28d80029546043c11 | [
"MIT"
] | 3 | 2021-07-27T05:22:42.000Z | 2022-03-21T10:55:32.000Z | setup.py | kkristof200/selenium_chrome | 1bb1f2ac6c0254704607f6f28d80029546043c11 | [
"MIT"
] | null | null | null | setup.py | kkristof200/selenium_chrome | 1bb1f2ac6c0254704607f6f28d80029546043c11 | [
"MIT"
] | 1 | 2021-11-24T07:34:35.000Z | 2021-11-24T07:34:35.000Z | import setuptools, os
readme_path = 'README.md'
if os.path.exists(readme_path):
with open(readme_path, 'r') as f:
long_description = f.read()
else:
long_description = 'selenium_chrome'
setuptools.setup(
name='selenium_chrome',
version='0.0.29',
author='Kristóf-Attila Kovács',
descript... | 30.717949 | 57 | 0.625209 |
6f60b55aab8f72dd5fec3cdf14be3d5f0a2a105e | 634 | py | Python | lama/lama_utils.py | zhengyima/CoLAKE | 708c06b8bae94186a54eb527ab11e0999b2ad03b | [
"MIT"
] | 73 | 2020-10-02T05:06:35.000Z | 2022-03-27T14:07:10.000Z | lama/lama_utils.py | zhengyima/CoLAKE | 708c06b8bae94186a54eb527ab11e0999b2ad03b | [
"MIT"
] | 17 | 2020-11-03T01:44:55.000Z | 2022-03-04T03:28:13.000Z | lama/lama_utils.py | zhengyima/CoLAKE | 708c06b8bae94186a54eb527ab11e0999b2ad03b | [
"MIT"
] | 19 | 2020-10-05T13:35:50.000Z | 2022-02-12T13:33:21.000Z | import os
import json
def load_file(filename):
data = []
with open(filename, "r", encoding='utf-8') as f:
for line in f.readlines():
data.append(json.loads(line))
return data
def parse_template(template, subject_label, object_label):
SUBJ_SYMBOL = "[X]"
OBJ_SYMBOL = "[Y]"
... | 26.416667 | 59 | 0.659306 |
38751cd73616edefa9295558b0ade469113b6ac3 | 7,129 | py | Python | tests/rsa/test_endpoint.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 65 | 2015-04-21T10:41:18.000Z | 2022-01-02T16:25:40.000Z | tests/rsa/test_endpoint.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 85 | 2015-01-20T14:23:52.000Z | 2022-02-19T17:08:46.000Z | tests/rsa/test_endpoint.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 32 | 2015-03-13T07:43:05.000Z | 2020-04-24T07:56:53.000Z | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the RSA endpoint description
:author: Thomas Calmant
"""
# Standard library
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
from typing import List
except ImportError:
pass
# Pelix
from pelix.framework import ... | 31.825893 | 86 | 0.58774 |
31eef4ffa135c1feaa7d47955e0f42065917b9f2 | 775 | py | Python | test/Driver/Inputs/crash-after-generating-pch.py | LynnKirby/swift | 11a8be196751f8f7c194bea83b5f4f8e6a7d5360 | [
"Apache-2.0"
] | 427 | 2018-05-29T14:21:02.000Z | 2022-03-16T03:17:54.000Z | test/Driver/Inputs/crash-after-generating-pch.py | LynnKirby/swift | 11a8be196751f8f7c194bea83b5f4f8e6a7d5360 | [
"Apache-2.0"
] | 153 | 2018-01-21T15:24:47.000Z | 2018-09-13T12:46:16.000Z | test/Driver/Inputs/crash-after-generating-pch.py | LynnKirby/swift | 11a8be196751f8f7c194bea83b5f4f8e6a7d5360 | [
"Apache-2.0"
] | 52 | 2018-07-19T19:57:32.000Z | 2022-03-11T16:05:38.000Z | #!/usr/bin/env python
# crash.py - Sends SIGKILL to self. -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for ... | 28.703704 | 78 | 0.72129 |
934e4cdf4b5f6f25cf967e67619542f081d4bc42 | 7,375 | py | Python | slogging.py | rscalzo/sami | 7ac5632e018cdf2384f5ff067c503177684f61c8 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T08:30:38.000Z | 2021-12-07T08:30:38.000Z | slogging.py | rscalzo/sami | 7ac5632e018cdf2384f5ff067c503177684f61c8 | [
"BSD-3-Clause"
] | null | null | null | slogging.py | rscalzo/sami | 7ac5632e018cdf2384f5ff067c503177684f61c8 | [
"BSD-3-Clause"
] | 3 | 2021-02-15T19:51:59.000Z | 2021-05-04T05:48:46.000Z | '''
slogging: the SAMI Logging utility
This provides a simple logging utility suitable for use in libraries, etc. It
was originally written for the SAMI Python Package by Andy Green, but has been
adapted for use elsewhere.
Generically, one only needs to add the following lines to the top of a file:
# Set up logg... | 33.071749 | 115 | 0.721763 |
bb694815d8e76606bb409ac072b6d4a3dafff058 | 2,124 | py | Python | nomenclature/validation.py | danielhuppmann/nomenclature-1 | d6f814bbe0d563b5748be6c67091669bc9fefa02 | [
"Apache-2.0"
] | 9 | 2021-06-10T15:11:23.000Z | 2022-02-02T16:22:01.000Z | nomenclature/validation.py | danielhuppmann/nomenclature-1 | d6f814bbe0d563b5748be6c67091669bc9fefa02 | [
"Apache-2.0"
] | 83 | 2021-06-22T09:04:29.000Z | 2022-03-21T16:29:54.000Z | nomenclature/validation.py | phackstock/nomenclature | ef7fa98aeba5c3ef9e0e4a53a0d41dd57487e826 | [
"Apache-2.0"
] | 3 | 2021-06-17T10:44:48.000Z | 2021-09-16T15:30:03.000Z | import logging
from pyam import IamDataFrame, to_list
# define logger for this script at logging level INFO
logger = logging.getLogger(__name__)
def log_error(name, lst):
"""Compile an error message and write to log"""
msg = f"The following items are not defined in the '{name}' codelist:"
logger.error("\... | 33.1875 | 86 | 0.604049 |
e82f4b6183aac5fbdd36b785b06080508dde9932 | 328 | py | Python | Backend/Invento_Manage/items/migrations/0005_remove_item_created_at.py | coffeebeanspoem/HACKTOBERFEST21-GTBIT-WEBDEV | 9c91f90ad9c1078c7dad58d8b0a5796aa8f35837 | [
"MIT"
] | null | null | null | Backend/Invento_Manage/items/migrations/0005_remove_item_created_at.py | coffeebeanspoem/HACKTOBERFEST21-GTBIT-WEBDEV | 9c91f90ad9c1078c7dad58d8b0a5796aa8f35837 | [
"MIT"
] | null | null | null | Backend/Invento_Manage/items/migrations/0005_remove_item_created_at.py | coffeebeanspoem/HACKTOBERFEST21-GTBIT-WEBDEV | 9c91f90ad9c1078c7dad58d8b0a5796aa8f35837 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-04 11:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('items', '0004_auto_20201204_1714'),
]
operations = [
migrations.RemoveField(
model_name='item',
name='created_at',
)... | 18.222222 | 47 | 0.591463 |
ffbf89778087d2964cd8a472ffb598c27106c336 | 6,847 | py | Python | Testes/exemplo2.py | Werberty/Projeto-CoppeliaSim | 2f60565f2e5e91d2d86e79576eb0f80a1106a18c | [
"MIT"
] | null | null | null | Testes/exemplo2.py | Werberty/Projeto-CoppeliaSim | 2f60565f2e5e91d2d86e79576eb0f80a1106a18c | [
"MIT"
] | null | null | null | Testes/exemplo2.py | Werberty/Projeto-CoppeliaSim | 2f60565f2e5e91d2d86e79576eb0f80a1106a18c | [
"MIT"
] | null | null | null | try:
import sim
except:
print ('--------------------------------------------------------------')
print ('"sim.py" could not be imported. This means very probably that')
print ('either "sim.py" or the remoteApi library could not be found.')
print ('Make sure both are in the same folder as this file,'... | 37.415301 | 124 | 0.651088 |
849ddcb96104643e88a968d02e6edfe22e5a088b | 2,253 | py | Python | test/lint/lint-tests.py | dunxen/bitcoin | 91a42d63efaff9a7eb955802b6d9f2c768d65db0 | [
"MIT"
] | 6 | 2017-07-10T02:31:56.000Z | 2019-07-24T21:06:46.000Z | test/lint/lint-tests.py | dunxen/bitcoin | 91a42d63efaff9a7eb955802b6d9f2c768d65db0 | [
"MIT"
] | 12 | 2021-12-14T01:00:25.000Z | 2022-03-24T01:49:23.000Z | test/lint/lint-tests.py | dunxen/bitcoin | 91a42d63efaff9a7eb955802b6d9f2c768d65db0 | [
"MIT"
] | 5 | 2017-11-12T11:01:04.000Z | 2019-09-24T13:01:16.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2018-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Check the test suite naming conventions
"""
import re
import subprocess
import sys
def grep_boos... | 25.602273 | 85 | 0.614736 |
f1f268df1596f69db2cd785cb0231acb4687db2c | 1,731 | py | Python | nislmigrate/migrators/security_migrator.py | ni/NI-SystemLink-Migration | dbce27627a2ea9b0121478ef64d9acfa2940a20d | [
"MIT"
] | null | null | null | nislmigrate/migrators/security_migrator.py | ni/NI-SystemLink-Migration | dbce27627a2ea9b0121478ef64d9acfa2940a20d | [
"MIT"
] | 9 | 2021-11-08T21:47:50.000Z | 2022-03-30T20:06:52.000Z | nislmigrate/migrators/security_migrator.py | ni/NI-SystemLink-Migration | dbce27627a2ea9b0121478ef64d9acfa2940a20d | [
"MIT"
] | null | null | null | from nislmigrate.facades.facade_factory import FacadeFactory
from nislmigrate.extensibility.migrator_plugin import MigratorPlugin
from nislmigrate.facades.mongo_configuration import MongoConfiguration
from nislmigrate.facades.mongo_facade import MongoFacade
from typing import Any, Dict
class SecurityMigrator(Migrator... | 36.829787 | 106 | 0.716349 |
8fad629f583e2a5e5a70651e27e1f11fd64b512e | 13,794 | py | Python | shap/maskers/_tabular.py | enjine-com/shap | f64086f44b53f8bea5caf13d0bf9112676dea643 | [
"MIT"
] | 2 | 2021-12-06T13:40:21.000Z | 2021-12-06T13:41:42.000Z | shap/maskers/_tabular.py | enjine-com/shap | f64086f44b53f8bea5caf13d0bf9112676dea643 | [
"MIT"
] | 3 | 2022-02-14T03:40:19.000Z | 2022-02-27T12:22:00.000Z | shap/maskers/_tabular.py | enjine-com/shap | f64086f44b53f8bea5caf13d0bf9112676dea643 | [
"MIT"
] | 1 | 2020-08-04T19:08:41.000Z | 2020-08-04T19:08:41.000Z | import logging
import pandas as pd
import numpy as np
from numba import jit
from .. import utils
from ..utils import safe_isinstance, MaskedModel
from ._masker import Masker
from .._serializable import Serializer, Deserializer
log = logging.getLogger('shap')
class Tabular(Masker):
""" A common base class for Ind... | 43.241379 | 133 | 0.635421 |
fd9aa76d5a6356c3cf3f5a8cf4d5da5fb6220e63 | 3,362 | py | Python | setup.py | anntzer/qtconsole | 202be75115735717bc3ebb7a61f3ae28dc992cf3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | anntzer/qtconsole | 202be75115735717bc3ebb7a61f3ae28dc992cf3 | [
"BSD-3-Clause"
] | 1 | 2021-02-23T17:26:06.000Z | 2021-02-23T17:26:06.000Z | setup.py | anntzer/qtconsole | 202be75115735717bc3ebb7a61f3ae28dc992cf3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# the name of the package
name = 'qtconsole'
#-----------------------------------------------------------------------------
# Minimal Python version sanity check
#-------------------------------... | 32.019048 | 83 | 0.500595 |
6015ce7622787e7314981d63fe19bb1e16604ce8 | 260 | py | Python | pehchaan/config/app.py | achillesrasquinha/pehchaan | 467f705347bed4756937de9510a225ba8aaa9313 | [
"MIT"
] | 35 | 2017-03-15T15:28:01.000Z | 2020-10-28T11:20:05.000Z | pehchaan/config/app.py | achillesrasquinha/pehchaan | 467f705347bed4756937de9510a225ba8aaa9313 | [
"MIT"
] | 1 | 2017-04-19T21:04:22.000Z | 2017-04-19T21:04:22.000Z | pehchaan/config/app.py | achillesrasquinha/pehchaan | 467f705347bed4756937de9510a225ba8aaa9313 | [
"MIT"
] | 13 | 2017-04-18T16:28:36.000Z | 2021-02-11T10:58:50.000Z | from pehchaan.config import BaseConfig
class AppConfig(BaseConfig):
NAME = 'pehchaan'
VERSION = (0, 1, 0)
WINDOW_WIDTH = 320
WINDOW_HEIGHT = 480
CANVAS_BACKGROUND_COLOR = '#000000'
| 23.636364 | 40 | 0.538462 |
0e3ccb25aecfff11f4d2c3178eb9b1ca0419fa6d | 157 | py | Python | pset_challenging_ext/exercises/p61.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 5 | 2019-04-08T20:05:37.000Z | 2019-12-04T20:48:45.000Z | pset_challenging_ext/exercises/p61.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 8 | 2019-04-15T15:16:05.000Z | 2022-02-12T10:33:32.000Z | pset_challenging_ext/exercises/p61.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 2 | 2019-04-10T00:14:42.000Z | 2020-02-26T20:35:21.000Z | """
Print a unicode string "hello world".
"""
"""Question:
Print a unicode string "hello world".
Hints:
Use u'strings' format to define unicode string.
""" | 15.7 | 47 | 0.694268 |
fb14cdad7b24d7cd5d923b76c6b04566dbe903b0 | 246 | py | Python | regular-expressions/Demos/counter_re.py | WebucatorTraining/classfiles-actionable-python | 930c154a6dbfa6c54768557a998b4dbafb43df38 | [
"MIT"
] | 2 | 2022-01-04T22:25:01.000Z | 2022-01-16T16:50:23.000Z | regular-expressions/Demos/counter_re.py | WebucatorTraining/classfiles-actionable-python | 930c154a6dbfa6c54768557a998b4dbafb43df38 | [
"MIT"
] | null | null | null | regular-expressions/Demos/counter_re.py | WebucatorTraining/classfiles-actionable-python | 930c154a6dbfa6c54768557a998b4dbafb43df38 | [
"MIT"
] | null | null | null | import re
from collections import Counter
with open('Declaration_of_Independence.txt') as f:
doi = f.read().upper()
word_list = [word for word in re.split('[^A-Z]', doi) if len(word) > 5]
c = Counter(word_list)
print(c.most_common(10)) | 24.6 | 71 | 0.691057 |
2d0a27c8a43e73737bce694b19b7959013ffe533 | 2,781 | py | Python | data_structures/double_linked_list.py | FrancescoBellini92/UDSAND_2 | f60e027c7205d5959a5796ba5fcb62140d20ac57 | [
"MIT"
] | null | null | null | data_structures/double_linked_list.py | FrancescoBellini92/UDSAND_2 | f60e027c7205d5959a5796ba5fcb62140d20ac57 | [
"MIT"
] | null | null | null | data_structures/double_linked_list.py | FrancescoBellini92/UDSAND_2 | f60e027c7205d5959a5796ba5fcb62140d20ac57 | [
"MIT"
] | null | null | null |
from data_structures.linked_list import *
class DoubleNode(Node):
def __init__(self, value):
super().__init__(value)
self.previous: DoubleNode = None
class DoublyLinkedList(LinkedList):
head: DoubleNode = None
tail: DoubleNode = None
_size: int = 0
def __init__(self, *args):
... | 27.264706 | 50 | 0.59475 |
a7aad828e94f8b09a6d53c41ceef0261c9cc4705 | 87 | py | Python | AUG16/10.py | Razdeep/PythonSnippets | 76f9313894f511c487a99bc38bdf0fe5e594caf5 | [
"MIT"
] | null | null | null | AUG16/10.py | Razdeep/PythonSnippets | 76f9313894f511c487a99bc38bdf0fe5e594caf5 | [
"MIT"
] | null | null | null | AUG16/10.py | Razdeep/PythonSnippets | 76f9313894f511c487a99bc38bdf0fe5e594caf5 | [
"MIT"
] | null | null | null | # greatest of three
def greatest(a,b,c):
return max(a,b,c)
print(greatest(2,4,3)) | 14.5 | 22 | 0.655172 |
1a48b7aeaba4a486e2f03e8d7b284127fe6b15b5 | 1,227 | py | Python | python/day_16.py | flandersen/rpi-advent-calendar-2019 | ecab1dc60597b03fd39e1204434a4a856af1bbd2 | [
"Unlicense"
] | null | null | null | python/day_16.py | flandersen/rpi-advent-calendar-2019 | ecab1dc60597b03fd39e1204434a4a856af1bbd2 | [
"Unlicense"
] | null | null | null | python/day_16.py | flandersen/rpi-advent-calendar-2019 | ecab1dc60597b03fd39e1204434a4a856af1bbd2 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
seg={'a':21, 'b':8, 'c':11, 'd':26, 'e':19, 'f':20, 'g':13}
for s in "abcdefg":
GPIO.setup(seg[s], GPIO.OUT, initial=0)
zif=[16, 12, 7, 6]
for z in zif:
GPIO.setup(z, GPIO.OUT, initial=1)
dp = 5
GPIO.setup(dp, GPIO.OUT, initial=0)... | 18.044118 | 59 | 0.473513 |
900edaa558b8e48d6ac951c3637d3b49e85e7adb | 67,270 | py | Python | src/acrtransfer/azext_acrtransfer/vendored_sdks/containerregistry/v2019_12_01_preview/aio/operations/_registries_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/acrtransfer/azext_acrtransfer/vendored_sdks/containerregistry/v2019_12_01_preview/aio/operations/_registries_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/acrtransfer/azext_acrtransfer/vendored_sdks/containerregistry/v2019_12_01_preview/aio/operations/_registries_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.808157 | 225 | 0.675368 |
ec286424687b8090784ff7848a93838f4c53b4dc | 3,880 | py | Python | sd_material_ui/IconButton.py | vikigenius/sd-material-ui | 8ccf4870fa7edc7947e0b9fa59bb457990bdb901 | [
"MIT"
] | 166 | 2018-01-04T18:09:35.000Z | 2022-03-10T00:09:59.000Z | sd_material_ui/IconButton.py | vikigenius/sd-material-ui | 8ccf4870fa7edc7947e0b9fa59bb457990bdb901 | [
"MIT"
] | 709 | 2017-12-02T15:29:43.000Z | 2022-03-21T10:41:05.000Z | sd_material_ui/IconButton.py | vikigenius/sd-material-ui | 8ccf4870fa7edc7947e0b9fa59bb457990bdb901 | [
"MIT"
] | 25 | 2018-05-25T20:42:58.000Z | 2021-11-05T13:33:18.000Z | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class IconButton(Component):
"""An IconButton component.
Material UI IconButton component
Keyword arguments:
- children (a list of or a singular dash component, string or number; optional): Used to pass ... | 73.207547 | 554 | 0.739948 |
5459b4d29fea526bdb6136ceebb83f5c8f2d1451 | 16,805 | py | Python | pegs/outputs.py | fls-bioinformatics-core/pegs | 8cc820215f618c7b96975b78b017f77bd4947529 | [
"BSD-3-Clause"
] | null | null | null | pegs/outputs.py | fls-bioinformatics-core/pegs | 8cc820215f618c7b96975b78b017f77bd4947529 | [
"BSD-3-Clause"
] | 15 | 2021-03-11T15:45:54.000Z | 2021-10-11T08:45:10.000Z | pegs/outputs.py | fls-bioinformatics-core/pegs | 8cc820215f618c7b96975b78b017f77bd4947529 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# outputs.py: functions for outputting result data
# Copyright (C) University of Manchester 2018-2021 Mudassar Iqbal, Peter Briggs
#
#######################################################################
# Constants
######################################################################... | 39.355972 | 83 | 0.582803 |
aa4dda63d021674282c83ec185316b15e61fb889 | 3,003 | py | Python | neutron/conf/policies/__init__.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | 1 | 2020-01-29T17:06:17.000Z | 2020-01-29T17:06:17.000Z | neutron/conf/policies/__init__.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | 5 | 2018-05-31T13:09:00.000Z | 2022-01-13T15:23:29.000Z | neutron/conf/policies/__init__.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | 2 | 2017-12-05T15:05:26.000Z | 2019-09-09T16:03:49.000Z | # 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
# d... | 36.621951 | 78 | 0.739594 |
61739ded37b9377c699d5a9e8387bbb105a1280a | 1,955 | py | Python | ooobuild/lo/sheet/cell_insert_mode.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/sheet/cell_insert_mode.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/sheet/cell_insert_mode.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 25.723684 | 148 | 0.675192 |
308804d3c20e0e1f6cac9600739114d473ad01df | 7,290 | py | Python | service.observatory/app/main.py | IslamAlam/JUMPING-JIVE-Geodetic-Observatory-Wettzell | 53fef7a673a4bcdebd249d11016e8f5b0a2a67e0 | [
"MIT"
] | null | null | null | service.observatory/app/main.py | IslamAlam/JUMPING-JIVE-Geodetic-Observatory-Wettzell | 53fef7a673a4bcdebd249d11016e8f5b0a2a67e0 | [
"MIT"
] | null | null | null | service.observatory/app/main.py | IslamAlam/JUMPING-JIVE-Geodetic-Observatory-Wettzell | 53fef7a673a4bcdebd249d11016e8f5b0a2a67e0 | [
"MIT"
] | null | null | null | import markdown
import os
import shelve
import sys
# Import the framework
from flask import Flask, g, Markup, render_template, request
from flask_restful import Resource, Api, reqparse
from bootstrap import Service
service = Service()
app = service.app
def get_db():
db = getattr(g, '_database', None)
if db... | 28.365759 | 88 | 0.636626 |
1e7548d3d3b8f8bbb4dac7a1b9ff69fd28a354ab | 777 | py | Python | warhammer/user/migrations/0001_initial.py | GevorgArtenyan/blog | bf15aeac48e7c9abf8201e52b7a153337cf3ce1d | [
"MIT"
] | null | null | null | warhammer/user/migrations/0001_initial.py | GevorgArtenyan/blog | bf15aeac48e7c9abf8201e52b7a153337cf3ce1d | [
"MIT"
] | null | null | null | warhammer/user/migrations/0001_initial.py | GevorgArtenyan/blog | bf15aeac48e7c9abf8201e52b7a153337cf3ce1d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-12-20 13:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 29.884615 | 121 | 0.646075 |
7e9d1bcdd02ffed757b25d60db214fd2b5fe791f | 305,104 | py | Python | sdk/lusid_asyncio/api/portfolio_groups_api.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/api/portfolio_groups_api.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/api/portfolio_groups_api.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3923
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility lib... | 62.662559 | 687 | 0.634918 |
e53c75a94c91753fc3345121b79d258b739e7194 | 853 | py | Python | doorbot/security/__init__.py | masom/doorbot-api-python | daad4bd279661bee268ae2584769f09e4a132982 | [
"MIT"
] | null | null | null | doorbot/security/__init__.py | masom/doorbot-api-python | daad4bd279661bee268ae2584769f09e4a132982 | [
"MIT"
] | null | null | null | doorbot/security/__init__.py | masom/doorbot-api-python | daad4bd279661bee268ae2584769f09e4a132982 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import bcrypt
import random
import uuid
safe_string_letters = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789'
def generate_api_token():
return str(uuid.uuid4())
def generate_password(length):
return generate_random_string(length)
def password_crypt(password):
return ... | 18.955556 | 78 | 0.695193 |
30fa9883899295707b8b58dc148fb87b3eab3fce | 662 | py | Python | 4.py | bm5w/pychal | 6a69d9fa2c85fdbf29b37646f86d363dab29128e | [
"MIT"
] | null | null | null | 4.py | bm5w/pychal | 6a69d9fa2c85fdbf29b37646f86d363dab29128e | [
"MIT"
] | null | null | null | 4.py | bm5w/pychal | 6a69d9fa2c85fdbf29b37646f86d363dab29128e | [
"MIT"
] | null | null | null | """Solution for python challenge #4:
http://www.pythonchallenge.com/pc/def/linkedlist.php"""
import urllib
def main(num=75635, count=0):
if count == 400:
return num
out = urllib.urlopen(("http://www.pythonchallenge.com/pc/def/"
"linkedlist.php?nothing={}").format(num))
te... | 26.48 | 67 | 0.584592 |
a127022c26faf1c6c7eb0a22f36bc6953d642278 | 513 | py | Python | bme280_test.py | radiolok/weatherstation | 0ed5bf1ed152f3bd8cc9794aef63e49a95258eb9 | [
"BSD-3-Clause"
] | 1 | 2021-04-08T15:06:32.000Z | 2021-04-08T15:06:32.000Z | bme280_test.py | radiolok/weatherstation | 0ed5bf1ed152f3bd8cc9794aef63e49a95258eb9 | [
"BSD-3-Clause"
] | null | null | null | bme280_test.py | radiolok/weatherstation | 0ed5bf1ed152f3bd8cc9794aef63e49a95258eb9 | [
"BSD-3-Clause"
] | null | null | null | import smbus2
import bme280
port = 1
address = 0x76
bus = smbus2.SMBus(port)
calibration_params = bme280.load_calibration_params(bus, address)
# the sample method will take a single reading and return a
# compensated_reading object
data = bme280.sample(bus, address, calibration_params)
# the compensated_reading cla... | 22.304348 | 65 | 0.80117 |
1c4e5e349b01e45179397f4a6e6562e49aa43f2d | 4,151 | py | Python | game/gui/playerHUD.py | grimfang/rising_reloaded | 5e83b248952dd13204f14d825a45d3da8d6d725b | [
"MIT"
] | 1 | 2016-08-03T16:01:57.000Z | 2016-08-03T16:01:57.000Z | game/gui/playerHUD.py | grimfang/rising_reloaded | 5e83b248952dd13204f14d825a45d3da8d6d725b | [
"MIT"
] | null | null | null | game/gui/playerHUD.py | grimfang/rising_reloaded | 5e83b248952dd13204f14d825a45d3da8d6d725b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Documentation: DebugConsole.py
this class provides a console and head-up-display for debuging informations
"""
__author__ = "Fireclaw the Fox"
__license__ = """
Simplified BSD (BSD 2-Clause) License.
See License.txt or http://opensource.org/licenses/BSD-2-Clause for mo... | 34.882353 | 80 | 0.619369 |
a2d62cd16bc11b9a789a27214a03396433b74ed0 | 1,714 | py | Python | deltatech_payment_to_statement/models/account_journal.py | NextERP-Romania/addons_extern | d08f428aeea4cda1890adfd250bc359bda0c33f3 | [
"Apache-2.0"
] | null | null | null | deltatech_payment_to_statement/models/account_journal.py | NextERP-Romania/addons_extern | d08f428aeea4cda1890adfd250bc359bda0c33f3 | [
"Apache-2.0"
] | null | null | null | deltatech_payment_to_statement/models/account_journal.py | NextERP-Romania/addons_extern | d08f428aeea4cda1890adfd250bc359bda0c33f3 | [
"Apache-2.0"
] | null | null | null | # © 2015-2020 Deltatech
# See README.rst file on addons root folder for license details
from odoo import fields, models
from odoo.tools.misc import formatLang
class AccountJournal(models.Model):
_inherit = "account.journal"
statement_sequence_id = fields.Many2one("ir.sequence", string="Statement Sequence"... | 40.809524 | 101 | 0.675613 |
e1a02b7891f5c330a25eab0d9df9871a9f0fb109 | 556 | py | Python | 13.py | naman-1/python-practice-problems | 8e06c10cb4ad7d37d4cb8c27a277b54b29fe63c5 | [
"MIT"
] | null | null | null | 13.py | naman-1/python-practice-problems | 8e06c10cb4ad7d37d4cb8c27a277b54b29fe63c5 | [
"MIT"
] | null | null | null | 13.py | naman-1/python-practice-problems | 8e06c10cb4ad7d37d4cb8c27a277b54b29fe63c5 | [
"MIT"
] | null | null | null | #Input a list of numbers and swap elements at the even location with the
#elements at the odd location.
def list1():
L1=int(input('enter no. of elements in list: '))
L2=[]
for i in range(L1):
L1_element=int(input('enter element: '))
L2.append(L1_element)
return L2
def swap(L2):... | 26.47619 | 74 | 0.544964 |
13c19cf66b133eadc65bf1b30ad8940a60f50cff | 10,681 | py | Python | androguard/decompiler/dad/basic_blocks.py | IOsipov/androguard | 13df1b45e93706eb20231626b0cd6bf15390f844 | [
"Apache-2.0"
] | 3 | 2018-11-08T05:33:40.000Z | 2019-03-15T14:57:00.000Z | androguard/decompiler/dad/basic_blocks.py | IOsipov/androguard | 13df1b45e93706eb20231626b0cd6bf15390f844 | [
"Apache-2.0"
] | 2 | 2016-09-06T01:07:59.000Z | 2017-02-20T13:53:58.000Z | androguard/decompiler/dad/basic_blocks.py | IOsipov/androguard | 13df1b45e93706eb20231626b0cd6bf15390f844 | [
"Apache-2.0"
] | 2 | 2016-11-28T14:30:51.000Z | 2018-10-15T12:46:51.000Z | # This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | 29.835196 | 78 | 0.613051 |
259146e9d9547b18038aa52119badf945df97252 | 7,620 | py | Python | Geometry/MuonCommonData/python/testMFXML_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Geometry/MuonCommonData/python/testMFXML_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Geometry/MuonCommonData/python/testMFXML_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
# This config was generated automatically using generate2026Geometry.py
# If you notice a mistake, please update the generating script, not just this config
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CM... | 60.96 | 97 | 0.734252 |
df716ab6d3838acf70da937bdae974bac37958a0 | 380 | py | Python | src/gui/menu/EditMenu.py | daavofficial/Aural | b4ef4170dcc27d87b2a08a9ae59383ea8099e024 | [
"MIT"
] | null | null | null | src/gui/menu/EditMenu.py | daavofficial/Aural | b4ef4170dcc27d87b2a08a9ae59383ea8099e024 | [
"MIT"
] | null | null | null | src/gui/menu/EditMenu.py | daavofficial/Aural | b4ef4170dcc27d87b2a08a9ae59383ea8099e024 | [
"MIT"
] | null | null | null | import dearpygui.dearpygui as dpg
from helpers.logger import Logger
from gui.utils import SaveInit
class EditMenu:
def __init__(self):
self.log = Logger("Aural.GUI.Menus.Edit", "gui.log")
with dpg.menu(label="Edit"):
dpg.add_menu_item(label="Save Window Configuration", callback=SaveIn... | 31.666667 | 83 | 0.694737 |
6038d7983f3695253a003db3ad7f1a2da4e67dfb | 191,724 | py | Python | airflow/models.py | ychantit/incubator-airflow | 11e670ddbce419489c798f26d3e94e7d3a00f5eb | [
"Apache-2.0"
] | 1 | 2021-10-11T11:12:59.000Z | 2021-10-11T11:12:59.000Z | airflow/models.py | ychantit/incubator-airflow | 11e670ddbce419489c798f26d3e94e7d3a00f5eb | [
"Apache-2.0"
] | null | null | null | airflow/models.py | ychantit/incubator-airflow | 11e670ddbce419489c798f26d3e94e7d3a00f5eb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 36.742813 | 90 | 0.59353 |
d9447af8cd590d4957406129ec284fe61a600adb | 1,267 | py | Python | regexlib/python_re_test_file/regexlib_1280.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | 1 | 2022-01-24T14:43:23.000Z | 2022-01-24T14:43:23.000Z | regexlib/python_re_test_file/regexlib_1280.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | regexlib/python_re_test_file/regexlib_1280.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | # 1280
# (((0*[1-9]|[12][0-9]|3[01])([-./])(0*[13578]|10|12)([-./])(\d{4}))|((0*[1-9]|[12][0-9]|30)([-./])(0*[469]|11)([-./])(\d{4}))|((0*[1-9]|1[0-9]|2[0-8])([-./])(02|2)([-./])(\d{4}))|((29)(\.|-|\/)(02|2)([-./])([02468][048]00))|((29)([-./])(02|2)([-./])([13579][26]00))|((29)([-./])(02|2)([-./])([0-9][0-9][0][48]))|... | 66.684211 | 425 | 0.415154 |
399fe7c2b99c3e3034dc84fc3355f19dfeb895ed | 6,122 | py | Python | gewittergefahr/scripts/plot_input_examples_pmm.py | dopplerchase/GewitterGefahr | 4415b08dd64f37eba5b1b9e8cc5aa9af24f96593 | [
"MIT"
] | 26 | 2018-10-04T01:07:35.000Z | 2022-01-29T08:49:32.000Z | gewittergefahr/scripts/plot_input_examples_pmm.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 4 | 2017-12-25T02:01:08.000Z | 2018-12-19T01:54:21.000Z | gewittergefahr/scripts/plot_input_examples_pmm.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 11 | 2017-12-10T23:05:29.000Z | 2022-01-29T08:49:33.000Z | """Plots PMM composite over many examples (storm objects).
PMM = probability-matched means
"""
import pickle
import os.path
import argparse
import numpy
from gewittergefahr.gg_utils import file_system_utils
from gewittergefahr.deep_learning import cnn
from gewittergefahr.deep_learning import model_interpretation
from... | 39.496774 | 80 | 0.786018 |
df1096df7b7491a5f9438645d2bbfb56ef1959ee | 318 | py | Python | Algorithms/Find Numbers with Even Number of Digits/solution.py | rawat9/leetcode | 936ced4a447c3eab7485d00b9eea480100da1ddb | [
"MIT"
] | null | null | null | Algorithms/Find Numbers with Even Number of Digits/solution.py | rawat9/leetcode | 936ced4a447c3eab7485d00b9eea480100da1ddb | [
"MIT"
] | null | null | null | Algorithms/Find Numbers with Even Number of Digits/solution.py | rawat9/leetcode | 936ced4a447c3eab7485d00b9eea480100da1ddb | [
"MIT"
] | null | null | null | class Solution:
def findNumbers(self, nums: list[int]) -> int:
digits = list(map(lambda x: len(str(x)), nums))
count = 0
for i in range(len(digits)):
if digits[i] % 2 == 0:
count += 1
return count
# Time Complexity = O(N), where N is the length of nums | 28.909091 | 55 | 0.531447 |
7dc76648f88ffadeaf6e61e8b655f99800e193df | 83,715 | py | Python | pyteomics/auxiliary/constants.py | donnyyy777/pyteomics | dc0cafb16823767457fa52342574e3fa1c61b970 | [
"Apache-2.0"
] | 47 | 2020-02-29T21:47:01.000Z | 2022-03-17T13:27:30.000Z | pyteomics/auxiliary/constants.py | donnyyy777/pyteomics | dc0cafb16823767457fa52342574e3fa1c61b970 | [
"Apache-2.0"
] | 53 | 2020-04-07T01:40:31.000Z | 2022-03-17T12:15:44.000Z | pyteomics/auxiliary/constants.py | donnyyy777/pyteomics | dc0cafb16823767457fa52342574e3fa1c61b970 | [
"Apache-2.0"
] | 23 | 2020-02-29T21:47:13.000Z | 2021-11-26T04:32:07.000Z | ### Bulky constants for other modules are defined below.
_nist_mass = {'Ac': {0: (227, 1.0),
206: (206.0145, 0.0),
207: (207.01195, 0.0),
208: (208.01155, 0.0),
209: (209.00949, 0.0),
210: (210.00944, 0.0),
211: (211.00773, 0.0),
212: (212.00781, 0.0),
213: (213.00661, 0.0),
214: (214.006902, 0.0),
... | 25.383566 | 70 | 0.520194 |
277deeb393a4febe94a03ece1d71101407281a34 | 27,032 | py | Python | src/main/python/lib/default/gtkgui/statusviews.py | emilybache/texttest-runner | 2d5c42b8d37699a2cbcb8f19af7c271d6ad1024a | [
"MIT"
] | null | null | null | src/main/python/lib/default/gtkgui/statusviews.py | emilybache/texttest-runner | 2d5c42b8d37699a2cbcb8f19af7c271d6ad1024a | [
"MIT"
] | null | null | null | src/main/python/lib/default/gtkgui/statusviews.py | emilybache/texttest-runner | 2d5c42b8d37699a2cbcb8f19af7c271d6ad1024a | [
"MIT"
] | null | null | null |
"""
Module for the various widgets that keep an overall view of the status or progress
of the current run/setup
"""
import gtk, gobject, pango, guiutils, plugins, os, logging
from ordereddict import OrderedDict
from copy import copy
#
# A class responsible for putting messages in the status bar.
# It is also respons... | 45.431933 | 156 | 0.638429 |
b1a9aa9754d4fc1b55e3c31b3169f67f372f4162 | 4,559 | py | Python | tables/__init__.py | stjordanis/PyTables | 4502aec62df02f5a49d73f0a03064fea3581d8d7 | [
"BSD-3-Clause"
] | null | null | null | tables/__init__.py | stjordanis/PyTables | 4502aec62df02f5a49d73f0a03064fea3581d8d7 | [
"BSD-3-Clause"
] | null | null | null | tables/__init__.py | stjordanis/PyTables | 4502aec62df02f5a49d73f0a03064fea3581d8d7 | [
"BSD-3-Clause"
] | 1 | 2021-12-16T21:56:24.000Z | 2021-12-16T21:56:24.000Z | """PyTables, hierarchical datasets in Python.
:URL: http://www.pytables.org/
PyTables is a package for managing hierarchical datasets and designed
to efficiently cope with extremely large amounts of data.
"""
# Necessary imports to get versions stored on the cython extension
from .utilsextension import (
get_p... | 31.881119 | 78 | 0.696644 |
b438bc561850b427aabb7b1e8c0596ed2e532ea8 | 341 | py | Python | Codeforces/CROC 2016 - Elimination Round (Rated Unofficial Edition)/Problem A/A.py | VastoLorde95/Competitive-Programming | 6c990656178fb0cd33354cbe5508164207012f24 | [
"MIT"
] | 170 | 2017-07-25T14:47:29.000Z | 2022-01-26T19:16:31.000Z | Codeforces/CROC 2016 - Elimination Round (Rated Unofficial Edition)/Problem A/A.py | navodit15/Competitive-Programming | 6c990656178fb0cd33354cbe5508164207012f24 | [
"MIT"
] | null | null | null | Codeforces/CROC 2016 - Elimination Round (Rated Unofficial Edition)/Problem A/A.py | navodit15/Competitive-Programming | 6c990656178fb0cd33354cbe5508164207012f24 | [
"MIT"
] | 55 | 2017-07-28T06:17:33.000Z | 2021-10-31T03:06:22.000Z | from math import *
from fractions import *
def solve():
s1 = raw_input()
s2 = raw_input()[::-1]
t1 = raw_input()
t2 = raw_input()[::-1]
x1 = s1 + s2
y1 = t1 + t2
x = ""
y = ""
for c in x1:
if c != 'X': x += c
for c in y1:
if c != 'X': y += c
if x in y+y or y in x+x:
print "YES"
else:
print "NO... | 12.62963 | 25 | 0.507331 |
54cbc2cbfd7a2a50e150f78fb3b5ec81f8eaebb4 | 49 | py | Python | anibot/__init__.py | iddqd0/anibot | 2f72bc6d624706078dece81aac6c215f1f559b9d | [
"MIT"
] | null | null | null | anibot/__init__.py | iddqd0/anibot | 2f72bc6d624706078dece81aac6c215f1f559b9d | [
"MIT"
] | null | null | null | anibot/__init__.py | iddqd0/anibot | 2f72bc6d624706078dece81aac6c215f1f559b9d | [
"MIT"
] | null | null | null | __all__ = ["RSS","Telegram","util","extractors"]
| 24.5 | 48 | 0.653061 |
6b0fb8a7ffc050a388d1f048d62c0deeda18ec7b | 2,049 | py | Python | sips/lines/bov/bov.py | AnandIJain/sip | 7eadee83a1bf5d447efd42ebab69197a4e73d52a | [
"MIT"
] | 5 | 2019-09-11T15:44:56.000Z | 2021-06-13T13:53:59.000Z | sips/lines/bov/bov.py | AnandIJain/sip | 7eadee83a1bf5d447efd42ebab69197a4e73d52a | [
"MIT"
] | 19 | 2019-09-26T21:17:24.000Z | 2020-05-03T06:35:33.000Z | sips/lines/bov/bov.py | anandijain/sip | 7eadee83a1bf5d447efd42ebab69197a4e73d52a | [
"MIT"
] | 2 | 2019-04-13T00:44:25.000Z | 2019-06-26T02:35:30.000Z | """
uses the bovada api to get json data for odds and scores
"""
import requests as r
import pandas as pd
import sips.h.grab as g
from sips.macros import bov as bm
from sips.lines.bov.utils import bov_utils as u
def lines(
sports: list, output="df", get_score=True, parse=True, all_mkts=False, verbo... | 24.392857 | 89 | 0.580283 |
d17bae4d2f5e94570f09e24f2d53af7b4e43b56f | 1,390 | py | Python | Python/longest-substring-with-at-least-k-repeating-characters.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 68 | 2018-01-13T07:15:37.000Z | 2022-02-20T12:58:24.000Z | Python/longest-substring-with-at-least-k-repeating-characters.py | pnandini/LeetCode | e746c3298be96dec8e160da9378940568ef631b1 | [
"MIT"
] | 1 | 2018-07-10T03:28:43.000Z | 2018-07-10T03:28:43.000Z | Python/longest-substring-with-at-least-k-repeating-characters.py | pnandini/LeetCode | e746c3298be96dec8e160da9378940568ef631b1 | [
"MIT"
] | 63 | 2017-04-10T03:38:25.000Z | 2022-03-17T23:24:51.000Z | # Time: O(26 * n) = O(n)
# Space: O(26) = O(1)
# Find the length of the longest substring T of a given string
# (consists of lowercase letters only) such that every character in T
# appears no less than k times.
#
# Example 1:
#
# Input:
# s = "aaabb", k = 3
#
# Output:
# 3
#
# The longest substring is "aaa", as 'a' ... | 24.821429 | 91 | 0.489209 |
9fe8c4f1b13179f5db2ea9412035f3b3a67b8b57 | 3,364 | py | Python | django_day04/django_day04/settings.py | maoxuelin083/Django-Study | 6eb332a97c898b11e6d1c1faf80dbb14f4f835c6 | [
"Apache-2.0"
] | null | null | null | django_day04/django_day04/settings.py | maoxuelin083/Django-Study | 6eb332a97c898b11e6d1c1faf80dbb14f4f835c6 | [
"Apache-2.0"
] | null | null | null | django_day04/django_day04/settings.py | maoxuelin083/Django-Study | 6eb332a97c898b11e6d1c1faf80dbb14f4f835c6 | [
"Apache-2.0"
] | null | null | null | """
Django settings for django_day04 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/
""... | 26.698413 | 92 | 0.659334 |
1040cd34c420e59a488d62d0df179636ab108bf8 | 729 | py | Python | mopo/urls.py | tuvokki/pico | 932afb64c689b396d30b7fa6f1bcf1df8958f7ec | [
"MIT"
] | null | null | null | mopo/urls.py | tuvokki/pico | 932afb64c689b396d30b7fa6f1bcf1df8958f7ec | [
"MIT"
] | null | null | null | mopo/urls.py | tuvokki/pico | 932afb64c689b396d30b7fa6f1bcf1df8958f7ec | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'mopo'
urlpatterns = [
# path('', views.index, name='index'),
path('', views.IndexView.as_view(), name='index'),
# # ex: /mopo/5/
# path('<int:quote_id>/', views.detail, name='detail'),
path('<int:pk>/', views.DetailView.as_view(), name='... | 34.714286 | 75 | 0.613169 |
caf508ea204400a135d5a8a5a611e610276d18d7 | 3,012 | py | Python | deepctr_torch/models/afm.py | zzz123xyz/DeepCTR-Torch | d6b880cc6b3761dbef90920a28182ef6737dd665 | [
"Apache-2.0"
] | 1 | 2021-06-08T11:18:48.000Z | 2021-06-08T11:18:48.000Z | deepctr_torch/models/afm.py | zzz123xyz/DeepCTR-Torch | d6b880cc6b3761dbef90920a28182ef6737dd665 | [
"Apache-2.0"
] | null | null | null | deepctr_torch/models/afm.py | zzz123xyz/DeepCTR-Torch | d6b880cc6b3761dbef90920a28182ef6737dd665 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Reference:
[1] Xiao J, Ye H, He X, et al. Attentional factorization machines: Learning the weight of feature interactions via attention networks[J]. arXiv preprint arXiv:1708.04617, 2017.
(https://arxiv.org/abs/1708.04617)
"""
import torch
... | 45.636364 | 180 | 0.668327 |
fc639c5429c4e59dae9e3532bd6125cf32400c4e | 4,538 | py | Python | tests/test_substitute.py | gitmoneyyy123/VintageEx | 4f81b8a6ef9d7ff0572bfa9728ad38ac0c8e7368 | [
"MIT"
] | 134 | 2015-01-09T22:23:51.000Z | 2022-03-17T16:25:14.000Z | tests/test_substitute.py | gitmoneyyy123/VintageEx | 4f81b8a6ef9d7ff0572bfa9728ad38ac0c8e7368 | [
"MIT"
] | 3 | 2015-12-16T08:15:30.000Z | 2020-08-18T05:49:41.000Z | tests/test_substitute.py | gitmoneyyy123/VintageEx | 4f81b8a6ef9d7ff0572bfa9728ad38ac0c8e7368 | [
"MIT"
] | 27 | 2015-01-21T18:22:34.000Z | 2019-09-01T12:26:21.000Z | import unittest
from vex.parsers.s_cmd import SubstituteLexer
from vex.parsers.parsing import RegexToken
from vex.parsers.parsing import Lexer
from vex.parsers.parsing import EOF
class TestRegexToken(unittest.TestCase):
def setUp(self):
self.token = RegexToken("f[o]+")
def testCanTestMem... | 31.082192 | 82 | 0.614588 |
4953573ee5f7406c3fc7770b6b47d6828e896b54 | 12,413 | py | Python | sdk/python/pulumi_aws_native/elasticloadbalancing/get_load_balancer.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/elasticloadbalancing/get_load_balancer.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/elasticloadbalancing/get_load_balancer.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 48.678431 | 512 | 0.726819 |
6f7f4c383a9e16c491bbd767ca5dfb33123335f5 | 10,650 | py | Python | tests/acceptance/test_base.py | yogorobot/aiocache | b2587e0a8e70334d2975879c4aeaf96f94c3f697 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_base.py | yogorobot/aiocache | b2587e0a8e70334d2975879c4aeaf96f94c3f697 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_base.py | yogorobot/aiocache | b2587e0a8e70334d2975879c4aeaf96f94c3f697 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import asyncio
from aiocache import RedisCache, SimpleMemoryCache, MemcachedCache
from aiocache.base import _Conn
from aiocache.backends.redis import AIOREDIS_MAJOR_VERSION
class TestCache:
"""
This class ensures that all caches behave the same way and have the minimum functionality.
To add... | 36.979167 | 94 | 0.66939 |
522167b49c69988d32ba0efe4b3a08e9d8a610eb | 68,116 | py | Python | tensorflow/python/training/checkpointable/util_test.py | datoslabs/tensorflow | 1945933a90fa12b8971b8560b5996311082273e1 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/checkpointable/util_test.py | datoslabs/tensorflow | 1945933a90fa12b8971b8560b5996311082273e1 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/checkpointable/util_test.py | datoslabs/tensorflow | 1945933a90fa12b8971b8560b5996311082273e1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 44.202466 | 101 | 0.712784 |
555abd2bb7317e0e4ca8b125d60a42a74466acdf | 1,538 | py | Python | plot_2dsin.py | nchaparr/Sam_Output_Anls | c6736f7863b36d09738ac95b7cbde19ba69526cf | [
"MIT"
] | null | null | null | plot_2dsin.py | nchaparr/Sam_Output_Anls | c6736f7863b36d09738ac95b7cbde19ba69526cf | [
"MIT"
] | 1 | 2015-04-18T14:47:49.000Z | 2015-05-01T21:51:44.000Z | plot_2dsin.py | nchaparr/Sam_Output_Anls | c6736f7863b36d09738ac95b7cbde19ba69526cf | [
"MIT"
] | null | null | null | from __future__ import division
from netCDF4 import Dataset
import glob,os.path
import numpy as np
from scipy.interpolate import UnivariateSpline
from matplotlib import cm
from matplotlib import ticker
import matplotlib.pyplot as plt
#import site
#site.addsitedir('/tera/phil/nchaparr/SAM2/sam_main/python')
#from Percen... | 23.661538 | 102 | 0.712614 |
c80b117143bb670140b901b1ef6fa5fc4dad25d3 | 1,508 | py | Python | tests/__init__.py | orenbenkiki/dynamake | 8416315e9be1aa72c33372e6b0566cce0fc3261a | [
"MIT"
] | null | null | null | tests/__init__.py | orenbenkiki/dynamake | 8416315e9be1aa72c33372e6b0566cce0fc3261a | [
"MIT"
] | null | null | null | tests/__init__.py | orenbenkiki/dynamake | 8416315e9be1aa72c33372e6b0566cce0fc3261a | [
"MIT"
] | null | null | null | """
Common utilities for tests.
"""
from dynamake import reset
from textwrap import dedent
from unittest import TestCase
import gc
import os
import shutil
import sys
import tempfile
# pylint: disable=missing-docstring
def undent(content: str) -> str:
content = dedent(content)
if content and content[0] == '... | 24.322581 | 62 | 0.64191 |
b0dcefde49378256d2bc15aa123dcad78ab509d3 | 14,513 | py | Python | pycfn_elasticsearch/vendored/botocore/loaders.py | elelsee/pycfn-elasticsearch | 74f644f5e508736bab8d45a8ac56e8edeb4e1ca9 | [
"Apache-2.0"
] | 4 | 2015-10-20T15:18:40.000Z | 2018-01-17T10:03:19.000Z | venv/lib/python2.7/site-packages/botocore/loaders.py | LockScreen/Backend | 42485a997f365172c7a63527f0df3b5707fd23f9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/botocore/loaders.py | LockScreen/Backend | 42485a997f365172c7a63527f0df3b5707fd23f9 | [
"MIT"
] | null | null | null | # Copyright 2012-2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | 37.308483 | 79 | 0.63419 |
ca9ea8ed2354189a1f32c0a91a122fb0e916befe | 2,801 | py | Python | gui/plugins/statistics_test.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 1 | 2016-02-13T15:40:20.000Z | 2016-02-13T15:40:20.000Z | gui/plugins/statistics_test.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 3 | 2020-09-11T12:54:50.000Z | 2020-09-11T12:55:01.000Z | gui/plugins/statistics_test.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Test the statistics viewer."""
from grr.gui import runtests_test
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
class TestStats(test_lib.GRRSeleniumTest... | 28.292929 | 75 | 0.661549 |
4b2329cf05547013dbbe0611f862e336e9fd5bbc | 6,123 | py | Python | gvbenchmark/cls/datasets/caltech.py | OpenGVLab/gv-benchmark | ffe1f7460b857c88276d52a1537cbc673002f1e4 | [
"Apache-2.0"
] | 106 | 2022-02-14T13:04:46.000Z | 2022-03-30T03:19:45.000Z | gvbenchmark/cls/datasets/caltech.py | OpenGVLab/gv-benchmark | ffe1f7460b857c88276d52a1537cbc673002f1e4 | [
"Apache-2.0"
] | 2 | 2022-03-08T07:19:18.000Z | 2022-03-29T15:45:09.000Z | gvbenchmark/cls/datasets/caltech.py | OpenGVLab/gv-benchmark | ffe1f7460b857c88276d52a1537cbc673002f1e4 | [
"Apache-2.0"
] | 2 | 2022-03-25T08:21:20.000Z | 2022-03-30T05:47:20.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import os
import numpy as np
from mmcls.core.evaluation.eval_metrics import calculate_confusion_matrix
from mmcls.datasets.base_dataset import BaseDataset
from mmcls.datasets.builder import DATASETS
from mmcls.models.losses import accuracy
def has_file_allowed_extensio... | 35.807018 | 78 | 0.565082 |
15c030748541489a12757a204dc9a2a131c33c43 | 4,993 | py | Python | chances/quantum/__init__.py | bjtho08/chances | ec713de1e11f7c2d9997507b07658df9f3369555 | [
"MIT"
] | 5 | 2018-10-09T11:00:39.000Z | 2021-07-19T06:21:29.000Z | chances/quantum/__init__.py | bjtho08/chances | ec713de1e11f7c2d9997507b07658df9f3369555 | [
"MIT"
] | 13 | 2019-02-09T10:53:06.000Z | 2019-09-26T21:37:05.000Z | chances/quantum/__init__.py | bjtho08/chances | ec713de1e11f7c2d9997507b07658df9f3369555 | [
"MIT"
] | 2 | 2019-03-07T10:05:01.000Z | 2019-09-25T12:29:07.000Z | # Copyright (c) 2012-2013 Luke Macken <lmacken@redhat.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, modif... | 32.00641 | 92 | 0.665532 |
dab72bda047690fdef408b615c02b124e8612ac8 | 2,647 | py | Python | src/data/make_unseen_data.py | yanaiela/demog-text-removal | f11b243c3f2f24f2179348c468b2caf76e7a3b23 | [
"MIT"
] | 42 | 2018-08-22T21:06:02.000Z | 2022-03-29T06:34:16.000Z | src/data/make_unseen_data.py | yanaiela/demog-text-removal | f11b243c3f2f24f2179348c468b2caf76e7a3b23 | [
"MIT"
] | 1 | 2020-08-04T11:06:35.000Z | 2020-08-04T11:18:03.000Z | src/data/make_unseen_data.py | yanaiela/demog-text-removal | f11b243c3f2f24f2179348c468b2caf76e7a3b23 | [
"MIT"
] | 7 | 2018-09-17T19:38:08.000Z | 2022-03-15T04:36:10.000Z | import sys
import sklearn.utils
from tqdm import tqdm
project = 'PATH/TO/PROJECT'
sys.path.insert(0, project + '/src/models')
from data_utils import get_data, CONF_LEVEL, normalize_text, to_file
from twitter_utils import happy, sad, MENTION
from data_handler import read_files
SEED = 16
df = get_data(project + '/p... | 27.010204 | 100 | 0.579902 |
3ef4010d5717a280eeb96e9b76630d243a69145d | 6,039 | py | Python | pkg/vtreat/cross_plan.py | jtanman/pyvtreat | 0bd14256e0f863ff03704fff78a8cd36481d5677 | [
"BSD-3-Clause"
] | null | null | null | pkg/vtreat/cross_plan.py | jtanman/pyvtreat | 0bd14256e0f863ff03704fff78a8cd36481d5677 | [
"BSD-3-Clause"
] | null | null | null | pkg/vtreat/cross_plan.py | jtanman/pyvtreat | 0bd14256e0f863ff03704fff78a8cd36481d5677 | [
"BSD-3-Clause"
] | null | null | null | import numpy
import numpy.random
import pandas
def support_indicator(n_rows, cross_plan):
"""return a vector indicating which rows had app assignments"""
support = numpy.full(n_rows, False, dtype=bool)
for ci in cross_plan:
support[ci["app"]] = True
return support
class CrossValidationPlan:
... | 34.907514 | 102 | 0.621295 |
9db9697f1bdcbe2da213756fbf7f3a2f33b042f0 | 282 | py | Python | app/manage.py | nkartha2/movies-to-watch | 4b2f3577f0d6a7bcdb8b64b0081bf1e27a923126 | [
"MIT"
] | null | null | null | app/manage.py | nkartha2/movies-to-watch | 4b2f3577f0d6a7bcdb8b64b0081bf1e27a923126 | [
"MIT"
] | 1 | 2020-04-18T21:19:52.000Z | 2020-04-18T21:19:52.000Z | app/manage.py | nkartha2/movies-to-watch | 4b2f3577f0d6a7bcdb8b64b0081bf1e27a923126 | [
"MIT"
] | 1 | 2020-04-12T16:54:53.000Z | 2020-04-12T16:54:53.000Z | from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from app import app, db
import os
app.config.from_object(os.environ['APP_SETTINGS'])
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run() | 20.142857 | 50 | 0.776596 |
493acdaccb7f006ff0c5932fc0ac8e0f6cdc3131 | 284 | py | Python | ch31/pseudoprivate.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2020-10-12T13:33:29.000Z | 2020-10-12T13:33:29.000Z | ch31/pseudoprivate.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | null | null | null | ch31/pseudoprivate.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2016-11-09T07:28:45.000Z | 2016-11-09T07:28:45.000Z | #!/usr/bin/env python
class C1:
def meth1(self): self.__X = 88
def meth2(self): print(self.__X)
class C2:
def metha(self): self.__X = 99
def methb(self): print(self.__X)
class C3(C1, C2): pass
I = C3()
I.meth1(); I.metha();
print(I.__dict__)
I.meth2(); I.methb();
| 16.705882 | 36 | 0.616197 |
9e9462af1db79b01415570b0d3da4c03b44b7a10 | 11,418 | py | Python | build_linear_mapping_joint2d.py | hanjiepan/multid_fri_public | 99a05b03f7d0bf6e57ce2fa806c857c60be5b837 | [
"MIT"
] | null | null | null | build_linear_mapping_joint2d.py | hanjiepan/multid_fri_public | 99a05b03f7d0bf6e57ce2fa806c857c60be5b837 | [
"MIT"
] | 1 | 2020-07-28T13:55:18.000Z | 2020-07-28T13:55:18.000Z | build_linear_mapping_joint2d.py | hanjiepan/multid_fri_public | 99a05b03f7d0bf6e57ce2fa806c857c60be5b837 | [
"MIT"
] | 1 | 2020-08-14T01:08:46.000Z | 2020-08-14T01:08:46.000Z | from __future__ import division
import numpy as np
from scipy import linalg
from utils_2d import periodic_sinc
def convmtx2_valid(H, M, N):
"""
2d convolution matrix with the boundary condition 'valid', i.e., only filter
within the given data block.
:param H: 2d filter
:param M: input signal dim... | 38.836735 | 105 | 0.635313 |
0857c51d3c501c081d80ec4c2c0cce9e1d0849e4 | 4,504 | py | Python | test/test_loaders.py | AlexGidiotis/Bayesian-Summarization | c74734bbe087965f77a1de1ad9461aacce81b927 | [
"MIT"
] | null | null | null | test/test_loaders.py | AlexGidiotis/Bayesian-Summarization | c74734bbe087965f77a1de1ad9461aacce81b927 | [
"MIT"
] | null | null | null | test/test_loaders.py | AlexGidiotis/Bayesian-Summarization | c74734bbe087965f77a1de1ad9461aacce81b927 | [
"MIT"
] | null | null | null | import json
import os
import tempfile
import unittest
import mock
from transformers import PegasusConfig, PegasusForConditionalGeneration, PreTrainedTokenizerFast
from src.common.loaders import init_loader, init_dataset, create_loader, load_datasets, load_model
def write_test_json(datafile, n):
with open(datafil... | 34.646154 | 115 | 0.598357 |
edf5b8ad64e6b11ab134bd9d491b2b352fb0f630 | 817 | py | Python | checkov/terraform/checks/resource/azure/PostgreSQLMinTLSVersion.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1 | 2022-02-20T21:20:39.000Z | 2022-02-20T21:20:39.000Z | checkov/terraform/checks/resource/azure/PostgreSQLMinTLSVersion.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/terraform/checks/resource/azure/PostgreSQLMinTLSVersion.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
class PostgreSQLMinTLSVersion(BaseResourceValueCheck):
def __init__(self):
name = "Ensure PostgreSQL is using the latest version of TLS encryp... | 37.136364 | 106 | 0.747858 |
b827ef2cad5fa0c550068e9afb993609b3f06cd5 | 827 | py | Python | routers/utils.py | federicoromeo/instagrapi-rest | 4385484d9ee4cd8f92fb381b466d0a95b024b63e | [
"MIT"
] | null | null | null | routers/utils.py | federicoromeo/instagrapi-rest | 4385484d9ee4cd8f92fb381b466d0a95b024b63e | [
"MIT"
] | null | null | null | routers/utils.py | federicoromeo/instagrapi-rest | 4385484d9ee4cd8f92fb381b466d0a95b024b63e | [
"MIT"
] | null | null | null | import json
from threading import local
from fastapi import APIRouter
import socket
router = APIRouter(
prefix="/utils",
tags=["utils"],
responses={404: {"description": "Not found"}}
)
# another implementation
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8",... | 23.628571 | 56 | 0.625151 |
7d39e688f4b29c080c98f5bb33f6537738867d75 | 3,575 | py | Python | app/tests/main/tests_template_helpers.py | madussault/FlaskyPress | 677bfbb3473a239c08d9e120e959d3e31c456964 | [
"MIT"
] | null | null | null | app/tests/main/tests_template_helpers.py | madussault/FlaskyPress | 677bfbb3473a239c08d9e120e959d3e31c456964 | [
"MIT"
] | null | null | null | app/tests/main/tests_template_helpers.py | madussault/FlaskyPress | 677bfbb3473a239c08d9e120e959d3e31c456964 | [
"MIT"
] | null | null | null | """Will test the template filters and globals loaded from the ``main``
blueprint.
To run this particular test file use the following command line:
nose2 -v app.tests.main.tests_template_helpers
"""
from app import db, create_app
import unittest
from unittest import TestCase
from config import Config
from app.tests.... | 35.75 | 79 | 0.631888 |
a9338b1809bd378c846a425c29e8ccdf2eb3532b | 2,075 | py | Python | packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setExceptionBreakpoints.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setExceptionBreakpoints.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setExceptionBreakpoints.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | """
Test lldb-vscode setBreakpoints request
"""
from __future__ import print_function
import unittest2
import vscode
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import lldbvscode_testcase
class TestVSCode_setExceptionBreakpoints(
lldbvsco... | 40.686275 | 105 | 0.713253 |
d4cd14e68b2a0df2f2b621cdb1eb46809afec1e4 | 12,731 | py | Python | level_two_utils/urban.py | jedavis82/scene_labeling | a5e819f801a4fa96a1f4b076fc2049519687b1de | [
"MIT"
] | null | null | null | level_two_utils/urban.py | jedavis82/scene_labeling | a5e819f801a4fa96a1f4b076fc2049519687b1de | [
"MIT"
] | null | null | null | level_two_utils/urban.py | jedavis82/scene_labeling | a5e819f801a4fa96a1f4b076fc2049519687b1de | [
"MIT"
] | null | null | null | from skfuzzy import control as ctrl
import skfuzzy as fuzz
import numpy as np
from fuzzy_utils import create_universes_membership_functions
class UrbanRules:
def __init__(self, show_sim_result=None):
prox, over, spat = create_universes_membership_functions()
self.__show_sim_result = show_sim_resul... | 63.338308 | 119 | 0.59956 |
6f0a5c8673a3fff81959e4b65e662131f8e9ea9a | 4,394 | py | Python | Elementary/5- work with csv files/Calculate_GPA_and_Sort_GPA.py | AlirezaMojtabavi/Python_Practice | c0128d6ce4cf172d93cc4e48861e7980e8e016a2 | [
"MIT"
] | null | null | null | Elementary/5- work with csv files/Calculate_GPA_and_Sort_GPA.py | AlirezaMojtabavi/Python_Practice | c0128d6ce4cf172d93cc4e48861e7980e8e016a2 | [
"MIT"
] | null | null | null | Elementary/5- work with csv files/Calculate_GPA_and_Sort_GPA.py | AlirezaMojtabavi/Python_Practice | c0128d6ce4cf172d93cc4e48861e7980e8e016a2 | [
"MIT"
] | 1 | 2020-11-14T07:19:26.000Z | 2020-11-14T07:19:26.000Z | import csv
from statistics import mean
from collections import OrderedDict
import operator
##------------------------------------Task 1 (GPA of each person, sorted by input sequence)--------------------
def Calculate_Average(input_file, output_file):
average = OrderedDict()
with open(input_file,'r') as f:
... | 31.84058 | 111 | 0.56782 |
07a00e81cb8ed3e32fa831ec5fb6415087e966cc | 59,718 | py | Python | psutil/tests/test_process.py | marza-animation-planet/psutil | e1ea2bccf8aea404dca0f79398f36f37217c45f6 | [
"BSD-3-Clause"
] | null | null | null | psutil/tests/test_process.py | marza-animation-planet/psutil | e1ea2bccf8aea404dca0f79398f36f37217c45f6 | [
"BSD-3-Clause"
] | null | null | null | psutil/tests/test_process.py | marza-animation-planet/psutil | e1ea2bccf8aea404dca0f79398f36f37217c45f6 | [
"BSD-3-Clause"
] | 1 | 2020-05-07T08:37:52.000Z | 2020-05-07T08:37:52.000Z | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for psutil.Process class."""
import collections
import errno
import getpass
import itertools
import os
import signal
impo... | 38.752758 | 79 | 0.573931 |
d7c18a461eca0d98f4ff6c3d886f4aa73d51fdb5 | 3,411 | py | Python | app/app/settings.py | ahanaf-islam/recipe-app-api | 68e4998350943d0b35d09814224e014b1801054c | [
"MIT"
] | null | null | null | app/app/settings.py | ahanaf-islam/recipe-app-api | 68e4998350943d0b35d09814224e014b1801054c | [
"MIT"
] | null | null | null | app/app/settings.py | ahanaf-islam/recipe-app-api | 68e4998350943d0b35d09814224e014b1801054c | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.455224 | 91 | 0.686309 |
fcaeebc978b8d69a25e56d5965f5526e9ac3c5a1 | 3,555 | py | Python | app/core/models.py | MuhammadTalhaPasha/BuilderApi | ceb3cec0c4a4c94e16e5f2cccb55efd0ca28ccec | [
"MIT"
] | null | null | null | app/core/models.py | MuhammadTalhaPasha/BuilderApi | ceb3cec0c4a4c94e16e5f2cccb55efd0ca28ccec | [
"MIT"
] | null | null | null | app/core/models.py | MuhammadTalhaPasha/BuilderApi | ceb3cec0c4a4c94e16e5f2cccb55efd0ca28ccec | [
"MIT"
] | null | null | null | import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
def userfile_file_path(instance, filename):
"""generate file_path for new userfile file"""
ext = filename.split('.')[-1]
#A... | 29.380165 | 82 | 0.64782 |
df3df2fd48fbeaffe34b08df897650112f429225 | 102,594 | py | Python | project/reports/election_prediction/pattern/db/__init__.py | vinceHardy/learning | 941e5979d471567411e7593c36617ef4a8e47f70 | [
"MIT"
] | 1 | 2017-06-26T11:28:05.000Z | 2017-06-26T11:28:05.000Z | project/reports/election_prediction/pattern/db/__init__.py | johnqoe/ntds_2016 | 2c207029e7c93807fe57b0a4ae098c8afe38a661 | [
"MIT"
] | null | null | null | project/reports/election_prediction/pattern/db/__init__.py | johnqoe/ntds_2016 | 2c207029e7c93807fe57b0a4ae098c8afe38a661 | [
"MIT"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | #### PATTERN | DB ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | 41.468876 | 139 | 0.559536 |
9e387b164af281ff8798aab9756a83536e79e0d0 | 57,393 | py | Python | server/tests-py/test_graphql_queries.py | prodeniser/graphql-engine | 80161e4208e23426f4330e23458ddda7f67a853f | [
"Apache-2.0",
"MIT"
] | null | null | null | server/tests-py/test_graphql_queries.py | prodeniser/graphql-engine | 80161e4208e23426f4330e23458ddda7f67a853f | [
"Apache-2.0",
"MIT"
] | null | null | null | server/tests-py/test_graphql_queries.py | prodeniser/graphql-engine | 80161e4208e23426f4330e23458ddda7f67a853f | [
"Apache-2.0",
"MIT"
] | null | null | null | import pytest
from validate import check_query_f, check_query, get_conf_f
from conftest import use_inherited_roles_fixtures
from context import PytestConf
# Mark that all tests in this module can be run as server upgrade tests
pytestmark = pytest.mark.allow_server_upgrade_test
usefixtures = pytest.mark.usefixtures
@... | 48.351306 | 127 | 0.753855 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.