hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c71bd63983d00aa5161a24349a0af33c353d0e7b | 1,152 | py | Python | scoring/urls.py | alextenczar/3-julian-alex | 9f2aa71769dd6eb6e7dd9e63236c3e7874f02de7 | [
"MIT"
] | null | null | null | scoring/urls.py | alextenczar/3-julian-alex | 9f2aa71769dd6eb6e7dd9e63236c3e7874f02de7 | [
"MIT"
] | 3 | 2021-06-09T19:34:38.000Z | 2022-02-10T12:25:27.000Z | scoring/urls.py | alextenczar/3-julian-alex | 9f2aa71769dd6eb6e7dd9e63236c3e7874f02de7 | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf.urls import url
import scoring.views
from scoring.views import *
from scoring.views.remove_all_data import remove_all_data
from scoring.views.display.display_top_projects import display_top_projects
#from .views import HomeListView
urlpatterns = [
# url(r'add/score/$'... | 48 | 100 | 0.765625 |
4f55df480d362f8e9409d541dcc65ab6a74ca401 | 1,929 | py | Python | setup.py | 0xh4di/impacket | a400ca15946c6c1f4d7a9dfc852032510b75816d | [
"Apache-1.1"
] | 2 | 2020-01-07T18:02:15.000Z | 2020-08-07T17:22:23.000Z | setup.py | 0xh4di/impacket | a400ca15946c6c1f4d7a9dfc852032510b75816d | [
"Apache-1.1"
] | null | null | null | setup.py | 0xh4di/impacket | a400ca15946c6c1f4d7a9dfc852032510b75816d | [
"Apache-1.1"
] | 1 | 2019-11-01T02:32:37.000Z | 2019-11-01T02:32:37.000Z | #!/usr/bin/env python
# $Id$
import glob
import os
import platform
import sys
from setuptools import setup
PACKAGE_NAME = "impacket"
if platform.system() != 'Darwin':
data_files = [(os.path.join('share', 'doc', PACKAGE_NAME), ['README.md', 'LICENSE']+glob.glob('doc/*'))]
else:
data_files = []
def read(fnam... | 37.823529 | 134 | 0.621047 |
29d2213a634f3e60b8f2fd50545371d1e8af192e | 10,286 | py | Python | trax/rl/policy_tasks.py | stephenjfox/trax | 918b1ce2ad63a24cb957ebc8e8ea0af1ee272666 | [
"Apache-2.0"
] | null | null | null | trax/rl/policy_tasks.py | stephenjfox/trax | 918b1ce2ad63a24cb957ebc8e8ea0af1ee272666 | [
"Apache-2.0"
] | null | null | null | trax/rl/policy_tasks.py | stephenjfox/trax | 918b1ce2ad63a24cb957ebc8e8ea0af1ee272666 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.110266 | 80 | 0.710286 |
6ba208341be1b5e7243d0d08c411f43ee9b1e220 | 295 | py | Python | icinga_notificator/functions/signals.py | pershinghar/icinga-notificator | 44ca598157d93f9a5410844acaefdec0bb1f11cf | [
"MIT"
] | 1 | 2019-10-05T15:30:14.000Z | 2019-10-05T15:30:14.000Z | icinga_notificator/functions/signals.py | pershinghar/icinga-notificator | 44ca598157d93f9a5410844acaefdec0bb1f11cf | [
"MIT"
] | null | null | null | icinga_notificator/functions/signals.py | pershinghar/icinga-notificator | 44ca598157d93f9a5410844acaefdec0bb1f11cf | [
"MIT"
] | 1 | 2020-08-19T13:32:40.000Z | 2020-08-19T13:32:40.000Z | #!/usr/bin/env/python3
#
# Signal functions used to control script
#
import logging
def signalHandler(sig, frame):
""" Simple function to handle singnals """
# can be improved
logging.debug("%s detected", sig)
logging.info("icinga-notificator exited (%s)", sig)
exit(0)
| 19.666667 | 55 | 0.667797 |
01630179b7428c4a319c851392b99f29c9884c7c | 3,019 | py | Python | src/pretix/plugins/sendmail/urls.py | Janfred/pretix | bdd9751f0e5c440d1c8b56c933db2288e4014f4c | [
"Apache-2.0"
] | 1,248 | 2015-04-24T13:32:06.000Z | 2022-03-29T07:01:36.000Z | src/pretix/plugins/sendmail/urls.py | Janfred/pretix | bdd9751f0e5c440d1c8b56c933db2288e4014f4c | [
"Apache-2.0"
] | 2,113 | 2015-02-18T18:58:16.000Z | 2022-03-31T11:12:32.000Z | src/pretix/plugins/sendmail/urls.py | Janfred/pretix | bdd9751f0e5c440d1c8b56c933db2288e4014f4c | [
"Apache-2.0"
] | 453 | 2015-05-13T09:29:06.000Z | 2022-03-24T13:39:16.000Z | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by ... | 54.890909 | 120 | 0.712488 |
a70f3a74a4dec848ed9c05f846a869080ec1a7df | 18,308 | py | Python | meta-refkit-core/lib/licensecheck.py | kraj/intel-iot-refkit | 04cd5afec0c41deeb5e1a48b43a0a31e708295c1 | [
"MIT"
] | 36 | 2017-02-20T04:04:28.000Z | 2022-02-17T05:36:33.000Z | meta-refkit-core/lib/licensecheck.py | kraj/intel-iot-refkit | 04cd5afec0c41deeb5e1a48b43a0a31e708295c1 | [
"MIT"
] | 284 | 2017-02-06T08:51:52.000Z | 2021-11-03T16:52:16.000Z | meta-refkit-core/lib/licensecheck.py | kraj/intel-iot-refkit | 04cd5afec0c41deeb5e1a48b43a0a31e708295c1 | [
"MIT"
] | 65 | 2017-02-03T12:36:16.000Z | 2021-02-18T11:00:46.000Z | #!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# This module offers an API to find out if an image contains any licensing
# conflicts if certain license classes (typically (LGPLv3)) are not allowed.
#
# There are several problems which we are trying to s... | 45.77 | 183 | 0.600448 |
318fc98a000ad1cd8ce2fb00a6b6b136a0ba16ad | 4,112 | py | Python | tests/build/test_build_case.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | tests/build/test_build_case.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | tests/build/test_build_case.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from pprint import pprint as pp
from scout.exceptions import (PedigreeError, ConfigError, IntegrityError)
from scout.build import build_case
def test_build_case(parsed_case, adapter, institute_obj, dummypanel_obj):
adapter.institute_collection.insert_one(institute_obj)
a... | 34.554622 | 99 | 0.705739 |
17fa3f0d77b2bfe2c6e37bfa862f80d4dee94911 | 33,077 | py | Python | packages/python/plotly/plotly/validators/densitymapbox/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/densitymapbox/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 5 | 2020-03-19T04:33:53.000Z | 2020-05-03T01:53:02.000Z | packages/python/plotly/plotly/validators/densitymapbox/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 4 | 2020-02-15T22:10:00.000Z | 2020-02-16T15:54:15.000Z | import _plotly_utils.basevalidators
class ZsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="zsrc", parent_name="densitymapbox", **kwargs):
super(ZsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit... | 36.549171 | 88 | 0.597999 |
97c9efe980bdfb38395c18902792715c663fc7ae | 2,601 | py | Python | Day25/day25.py | rnegrin90/AdventOfCode2017 | 2746d6c402cf00d1d5af353ffa9f9d44f6b1c7d1 | [
"MIT"
] | null | null | null | Day25/day25.py | rnegrin90/AdventOfCode2017 | 2746d6c402cf00d1d5af353ffa9f9d44f6b1c7d1 | [
"MIT"
] | null | null | null | Day25/day25.py | rnegrin90/AdventOfCode2017 | 2746d6c402cf00d1d5af353ffa9f9d44f6b1c7d1 | [
"MIT"
] | null | null | null | import re
from common import get_input
class Action:
def __init__(self, action):
write, direction, next_state = action
self.write = write
self.direction = direction
self.next_state = next_state
class State:
def __init__(self, name, zero, one):
self.name = name
... | 28.271739 | 109 | 0.605536 |
855b6d6a83e715294d29bd96722abf643354e650 | 919 | py | Python | starform/star.py | TommyDong1998/StarForm | d1c1ca704f3a72a043f1982a60000a99e386ad2e | [
"MIT"
] | 1 | 2021-04-04T22:11:19.000Z | 2021-04-04T22:11:19.000Z | starform/star.py | TommyDong1998/StarFormation | d1c1ca704f3a72a043f1982a60000a99e386ad2e | [
"MIT"
] | null | null | null | starform/star.py | TommyDong1998/StarFormation | d1c1ca704f3a72a043f1982a60000a99e386ad2e | [
"MIT"
] | null | null | null | class Star:
# Base class for a single action in a formation. Contains nodes this star point to.
def __init__(self):
self._nodes = []
self.params={"args":tuple(), "kwargs":{}}
def link(self, star2):
# Chain stars. Execution star.action() -> star2.action()
self._nodes.append(s... | 27.848485 | 87 | 0.583243 |
8126f34ccb9664d7f1cd9be12250ad22f1d5f2b5 | 9,938 | py | Python | others_code/evaluation_object.py | hosshonarvar/Image-Segmentation-others-code | de654a2a2a6a8e2f5d47861909760a07eb26c14e | [
"MIT"
] | 1 | 2021-06-29T05:05:43.000Z | 2021-06-29T05:05:43.000Z | others_code/evaluation_object.py | hosshonarvar/Image-Segmentation-others-code | de654a2a2a6a8e2f5d47861909760a07eb26c14e | [
"MIT"
] | null | null | null | others_code/evaluation_object.py | hosshonarvar/Image-Segmentation-others-code | de654a2a2a6a8e2f5d47861909760a07eb26c14e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 16:12:45 2017
This file is utilized to calculate the loss, accuracy, per_class_accuracy, and MOI(mean of intersection)
"""
import tensorflow as tf
import numpy as np
def cal_loss(logits, labels, num_classes):
if (num_classes is 12):
loss_weight = np.array(... | 41.58159 | 124 | 0.669451 |
798ade3500bc567c3fb9d96d87639c1868ce7230 | 3,069 | py | Python | src/SparseSC/utils/misc.py | microsoft/SparseSC | 4cf0a98858919d50c6127be782a145e49d96897e | [
"MIT"
] | 34 | 2019-05-14T11:05:58.000Z | 2022-02-04T19:16:21.000Z | src/SparseSC/utils/misc.py | Microsoft/SparseSC | f56880cbc42cf7d867390ab7d8a33f0618829f41 | [
"MIT"
] | 14 | 2019-01-16T18:57:01.000Z | 2019-04-17T16:50:23.000Z | src/SparseSC/utils/misc.py | Microsoft/SparseSC | f56880cbc42cf7d867390ab7d8a33f0618829f41 | [
"MIT"
] | 18 | 2019-05-14T11:06:01.000Z | 2021-09-13T12:30:58.000Z | # Allow capturing output
# Modified (to not capture stderr too) from https://stackoverflow.com/questions/5136611/
import contextlib
import sys
from .print_progress import it_progressbar, it_progressmsg
@contextlib.contextmanager
def capture():
STDOUT = sys.stdout
try:
sys.stdout = DummyFile()
... | 28.416667 | 105 | 0.610622 |
7a9f400054ce3a62c9e98c5c85dbfaa81f293670 | 2,816 | py | Python | tests/test_financiar.py | lucasmag/crowdfunding-blockchain | 3b033d853fc16c5e4b0a556ae0879d580ddf08ae | [
"MIT"
] | 1 | 2022-03-31T21:11:46.000Z | 2022-03-31T21:11:46.000Z | tests/test_financiar.py | lucasmag/crowdfunding-blockchain | 3b033d853fc16c5e4b0a556ae0879d580ddf08ae | [
"MIT"
] | null | null | null | tests/test_financiar.py | lucasmag/crowdfunding-blockchain | 3b033d853fc16c5e4b0a556ae0879d580ddf08ae | [
"MIT"
] | null | null | null | from datetime import datetime
import pytest
from brownie import Campanha, FabricaDeCampanhas, MockV3Aggregator, exceptions
from scripts.deploy import deploy_fabrica_de_campanhas
from scripts.helper import buscar_conta
from tests.decorators import pular_caso_rede_nao_local
@pular_caso_rede_nao_local
def test_financi... | 28.16 | 94 | 0.756037 |
c7484303f45e415467d302071b2d3fe32cf798b7 | 2,346 | py | Python | orders/migrations/0001_initial.py | Kaique425/ecommerce | 684988771ae7758a1e550092bf8fbd20f1b250e9 | [
"MIT"
] | null | null | null | orders/migrations/0001_initial.py | Kaique425/ecommerce | 684988771ae7758a1e550092bf8fbd20f1b250e9 | [
"MIT"
] | null | null | null | orders/migrations/0001_initial.py | Kaique425/ecommerce | 684988771ae7758a1e550092bf8fbd20f1b250e9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-09-16 23:10
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import localflavor.br.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('products', '0005_alter_product_slug'),
]
... | 49.914894 | 162 | 0.630009 |
eab461bffe828f23024f01fcee16cd0003e9c64e | 1,396 | py | Python | scripts/wasm-rebuild/docker-scripts/isolate_tests.py | MrChico/solidity | 5b4ea1eb895d5edc9a24ee5c6f96d8580eceec08 | [
"MIT"
] | null | null | null | scripts/wasm-rebuild/docker-scripts/isolate_tests.py | MrChico/solidity | 5b4ea1eb895d5edc9a24ee5c6f96d8580eceec08 | [
"MIT"
] | null | null | null | scripts/wasm-rebuild/docker-scripts/isolate_tests.py | MrChico/solidity | 5b4ea1eb895d5edc9a24ee5c6f96d8580eceec08 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import sys
import re
import os
import hashlib
from os.path import join, isfile
def extract_test_cases(path):
lines = open(path, 'rb').read().splitlines()
inside = False
delimiter = ''
tests = []
for l in lines:
if inside:
if l.strip().endswith(')' + delimite... | 24.928571 | 107 | 0.541547 |
6dd9440a8ef477b181b340ee08eb86103826ad3e | 2,589 | py | Python | setup.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 25 | 2017-07-25T12:44:55.000Z | 2020-09-30T22:16:50.000Z | setup.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 192 | 2017-11-29T08:57:03.000Z | 2022-03-29T18:44:41.000Z | setup.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 6 | 2019-02-01T18:49:33.000Z | 2020-07-26T08:18:46.000Z | from __future__ import print_function
import os
import subprocess
import shlex
from getpass import getuser
from distutils.command.build import build # type: ignore
from setuptools import (
find_packages,
setup,
Command
)
import numpy as np
CUSTOM_COMMANDS = [
shlex.split(command_line) for command... | 28.141304 | 83 | 0.659328 |
bfd6ff0405e3fa3e3cab6c227b9cd9363eecbad3 | 5,363 | py | Python | pkgs/nltk-3.2-py27_0/lib/python2.7/site-packages/nltk/misc/chomsky.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/nltk-3.2-py27_0/lib/python2.7/site-packages/nltk/misc/chomsky.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/nltk-3.2-py27_0/lib/python2.7/site-packages/nltk/misc/chomsky.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Chomsky random text generator, version 1.1, Raymond Hettinger, 2005/09/13
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440546
"""
CHOMSKY is an aid to writing linguistic papers in the style
of the great master. It is based on selected phrases taken
from actual books and articles written by Noam C... | 40.022388 | 80 | 0.726459 |
b078a4c7a13250985e350c91f13a52fa406e90de | 9,278 | py | Python | backend/tests/review/test_mergeinstructors.py | pennlabs/penn-courses | 6fd16c151e34a9660e883a41458a72cef6c1f8cd | [
"MIT"
] | 32 | 2019-04-02T19:02:48.000Z | 2022-03-05T17:32:52.000Z | backend/tests/review/test_mergeinstructors.py | pennlabs/penn-courses | 6fd16c151e34a9660e883a41458a72cef6c1f8cd | [
"MIT"
] | 281 | 2019-05-20T01:19:38.000Z | 2022-03-31T08:17:13.000Z | backend/tests/review/test_mergeinstructors.py | pennlabs/penn-courses | 6fd16c151e34a9660e883a41458a72cef6c1f8cd | [
"MIT"
] | 2 | 2020-04-27T20:53:02.000Z | 2021-09-26T16:40:28.000Z | from io import StringIO
from django.contrib.auth.models import User
from django.core import management
from django.db.models.functions import Lower
from django.test import TestCase
from courses.models import Instructor, Section
from courses.util import get_or_create_course_and_section
from review.management.commands.... | 42.559633 | 100 | 0.671804 |
9be821df5cd1baeb94c3be5ef7a82eb9d42b863f | 3,230 | py | Python | setup.py | yoyoasa/bplsqlparse | e068865284426ea85b1dc675c71049f18e5ba24d | [
"BSD-3-Clause"
] | 2 | 2019-10-25T06:28:06.000Z | 2019-10-25T06:28:07.000Z | setup.py | yoyoasa/bplsqlparse | e068865284426ea85b1dc675c71049f18e5ba24d | [
"BSD-3-Clause"
] | null | null | null | setup.py | yoyoasa/bplsqlparse | e068865284426ea85b1dc675c71049f18e5ba24d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com
#
# This setup script is part of python-bplsqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
import re
from setuptools import setup, find_packages
def get_version(... | 29.633028 | 79 | 0.634056 |
56e9cbfa88e0caf900a6cfa2e8a9a8c59f8db40d | 106,484 | py | Python | tests/dummy_data.py | chakki-works/typot | 8ed20fc2102acccc8703aae4d206d3906f5dca47 | [
"Apache-2.0"
] | 345 | 2017-05-30T10:04:54.000Z | 2022-02-18T07:49:39.000Z | tests/dummy_data.py | chakki-works/typot | 8ed20fc2102acccc8703aae4d206d3906f5dca47 | [
"Apache-2.0"
] | 4 | 2017-05-31T00:30:30.000Z | 2017-12-11T17:08:40.000Z | tests/dummy_data.py | chakki-works/typot | 8ed20fc2102acccc8703aae4d206d3906f5dca47 | [
"Apache-2.0"
] | 17 | 2017-06-05T10:40:32.000Z | 2020-04-20T09:03:39.000Z | pull_request_created = """
{
"action": "opened",
"number": 2,
"pull_request": {
"url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2",
"id": 122156051,
"html_url": "https://github.com/chakki-works/typot-demo/pull/2",
"diff_url": "https://github.com/chakki-works/typot-demo/pull/2.di... | 55.985279 | 125 | 0.653469 |
282a375e0c8373b47cb58bb41783ef1cfea3cba8 | 19,625 | py | Python | features/knowledgegraph.py | karafecho/icees-api | fc2b6865974075e42b88ccff96b3e9cc90da7596 | [
"MIT"
] | 1 | 2018-08-06T18:53:34.000Z | 2018-08-06T18:53:34.000Z | features/knowledgegraph.py | karafecho/icees-api | fc2b6865974075e42b88ccff96b3e9cc90da7596 | [
"MIT"
] | 1 | 2021-03-31T21:45:33.000Z | 2021-03-31T21:45:33.000Z | features/knowledgegraph.py | karafecho/icees-api | fc2b6865974075e42b88ccff96b3e9cc90da7596 | [
"MIT"
] | 1 | 2021-03-22T16:02:06.000Z | 2021-03-22T16:02:06.000Z | import json
import os
import datetime
import traceback
import itertools
from functools import reduce, partial
import re
import logging
from sqlalchemy import Table, Column, Integer, String, MetaData, create_engine, func, Sequence, between
from sqlalchemy.sql import select
import numpy as np
import inflection
from tx.fu... | 36.141805 | 192 | 0.612688 |
e86595a635f8cef138dfe7c23220292b48c5e932 | 2,338 | py | Python | src/gtk/toga_gtk/widgets/internal/rows/texticon.py | freespace/toga | 2ae96ddede34b5164b1be3d80a18aa87336f28f0 | [
"BSD-3-Clause"
] | 1,261 | 2019-03-31T16:28:47.000Z | 2022-03-31T09:01:23.000Z | src/gtk/toga_gtk/widgets/internal/rows/texticon.py | freespace/toga | 2ae96ddede34b5164b1be3d80a18aa87336f28f0 | [
"BSD-3-Clause"
] | 597 | 2019-04-02T20:02:42.000Z | 2022-03-30T10:28:47.000Z | src/gtk/toga_gtk/widgets/internal/rows/texticon.py | freakboy3742/toga | 3ae8b90fa397384d3df0378ca32449333494f282 | [
"BSD-3-Clause"
] | 318 | 2019-03-31T18:32:00.000Z | 2022-03-30T18:07:13.000Z | import html
from toga_gtk.libs import Gtk, Pango
from .base import HiddenButtonsRow
class TextIconRow(HiddenButtonsRow):
"""
Create a TextIconRow from a toga.sources.Row.
A reference to the original row is kept in self.toga_row, this is useful for comparisons.
"""
def __init__(self, factory: call... | 29.974359 | 103 | 0.636441 |
a99ae5cd4f2e91170f7655f3668b7ba3520fc087 | 1,515 | py | Python | app.py | gnmerritt/slack-translation-strings | 517b97d412a0e16e36dccfddce2071b5d756c23f | [
"MIT"
] | null | null | null | app.py | gnmerritt/slack-translation-strings | 517b97d412a0e16e36dccfddce2071b5d756c23f | [
"MIT"
] | null | null | null | app.py | gnmerritt/slack-translation-strings | 517b97d412a0e16e36dccfddce2071b5d756c23f | [
"MIT"
] | null | null | null | import random
import os
from threading import Thread
import requests
from flask import Flask, jsonify, request
app = Flask(__name__)
VERIFICATION_TOKEN = os.environ.get('V_TOKEN')
APP_TOKEN = os.environ.get('A_TOKEN')
CHANNEL = os.environ.get('A_IN_CHANNEL')
@app.route('/slack', methods=['POST'])
def pick_char():
... | 27.053571 | 93 | 0.631683 |
30ea244bac967a5be460320471025ad65e8ac5dd | 81,840 | py | Python | homeassistant/components/google_assistant/trait.py | cociweb/home-assistant_core | e2c7d1e31d6deb68724fb842893cc5c49d608d81 | [
"Apache-2.0"
] | 2 | 2021-07-30T19:15:52.000Z | 2021-07-30T19:16:00.000Z | homeassistant/components/google_assistant/trait.py | cociweb/home-assistant_core | e2c7d1e31d6deb68724fb842893cc5c49d608d81 | [
"Apache-2.0"
] | 74 | 2020-08-05T07:20:27.000Z | 2022-03-23T12:47:28.000Z | homeassistant/components/google_assistant/trait.py | marecabo/home-assistant | e33774a61e7fcc88aff752dfa4618dd26a746872 | [
"Apache-2.0"
] | 1 | 2021-07-30T19:16:02.000Z | 2021-07-30T19:16:02.000Z | """Implement the Google Smart Home traits."""
from __future__ import annotations
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
button,
camera,
cover,
fan,
group,
input_boolean,
input_select,
light,
lock,
media_player,
scen... | 35.049251 | 123 | 0.609335 |
32bfc60eeb94ccb83bcd3064ed0d5956779e4b66 | 11,524 | py | Python | venv/Lib/site-packages/gevent/libuv/_corecffi_build.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | 4 | 2022-01-07T13:37:33.000Z | 2022-03-31T03:21:17.000Z | venv/Lib/site-packages/gevent/libuv/_corecffi_build.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | 1 | 2022-01-27T04:21:58.000Z | 2022-01-27T04:21:58.000Z | venv/Lib/site-packages/gevent/libuv/_corecffi_build.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | # pylint: disable=no-member
# This module is only used to create and compile the gevent.libuv._corecffi module;
# nothing should be directly imported from it except `ffi`, which should only be
# used for `ffi.compile()`; programs should import gevent._corecfffi.
# However, because we are using "out-of-line" mode, it i... | 35.027356 | 110 | 0.672943 |
1352a4470681f97e6abff8a7cb6cf5d67e6dfa38 | 267 | py | Python | app1/templatetags/app1-tags.py | mohsenbjp/mysite | cb54c116fc684bb53b6fcb5f481d4f9c21f46455 | [
"MIT"
] | null | null | null | app1/templatetags/app1-tags.py | mohsenbjp/mysite | cb54c116fc684bb53b6fcb5f481d4f9c21f46455 | [
"MIT"
] | 3 | 2021-11-17T11:58:00.000Z | 2021-11-27T17:18:21.000Z | app1/templatetags/app1-tags.py | mohsenbjp/mysite | cb54c116fc684bb53b6fcb5f481d4f9c21f46455 | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
from blog.models import Post,Category
@register.inclusion_tag('app1/app1-latestpost.html')
def latestpost():
posts=Post.objects.filter(status=1).order_by('-published_date')[0:6]
return{'posts':posts}
| 29.666667 | 72 | 0.764045 |
d3f00d6ebd27cf88f742af98cf7bfa47a4fd2eb9 | 1,348 | py | Python | lib/surface/compute/snapshots/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/compute/snapshots/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/snapshots/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2014 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 requir... | 33.7 | 101 | 0.746291 |
dd5d856fdb181d44d62284ca1f73badcb8374866 | 563 | py | Python | tests/distributions/common.py | illyakaynov/tf2rl | 03e8212e3871537cdb43cb9576b0d4686ab558e9 | [
"MIT"
] | 1 | 2020-10-12T23:44:04.000Z | 2020-10-12T23:44:04.000Z | tests/distributions/common.py | illyakaynov/tf2rl | 03e8212e3871537cdb43cb9576b0d4686ab558e9 | [
"MIT"
] | null | null | null | tests/distributions/common.py | illyakaynov/tf2rl | 03e8212e3871537cdb43cb9576b0d4686ab558e9 | [
"MIT"
] | null | null | null | import unittest
class CommonDist(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.dim = 3
cls.batch_size = 4
cls.dist = None
def _skip_test_in_parent(self):
if self.dist is None:
return
else:
raise NotImplementedError
def test_... | 20.107143 | 37 | 0.62167 |
64737f4473db9ffc92b7d4388977b39b7e4c270d | 1,700 | py | Python | src/.ipynb_checkpoints/classes-checkpoint.py | jeffreyhwatson/terry_stops_project | 9aa82ee4c2148e7f675d6eea5ab24409d0f2b129 | [
"CC-BY-2.0"
] | 2 | 2021-09-25T03:00:55.000Z | 2021-09-25T03:45:37.000Z | src/classes.py | jeffreyhwatson/terry_stops_project | 9aa82ee4c2148e7f675d6eea5ab24409d0f2b129 | [
"CC-BY-2.0"
] | null | null | null | src/classes.py | jeffreyhwatson/terry_stops_project | 9aa82ee4c2148e7f675d6eea5ab24409d0f2b129 | [
"CC-BY-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing... | 38.636364 | 104 | 0.741176 |
2e9c62f2286cdcd56374bb460f92ef0085381407 | 1,020 | py | Python | Batch/Batch/src/batchJob.py | csbuja/browsecloud | da32017b6346026b4044d9a5f8efb0b00877e3a0 | [
"MIT"
] | 159 | 2019-06-30T17:51:29.000Z | 2022-03-24T10:01:32.000Z | Batch/Batch/src/batchJob.py | rbs-pli/browsecloud | da32017b6346026b4044d9a5f8efb0b00877e3a0 | [
"MIT"
] | 6 | 2019-08-12T04:04:28.000Z | 2022-03-02T04:57:15.000Z | Batch/Batch/src/batchJob.py | rbs-pli/browsecloud | da32017b6346026b4044d9a5f8efb0b00877e3a0 | [
"MIT"
] | 18 | 2019-07-01T05:22:58.000Z | 2020-12-22T09:02:07.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from jobStatus import JobStatus
class BatchJob():
def __init__(self, id_in: str, jobStatus_in, progress_in: int):
self.id = id_in
self.jobStatus = jobStatus_in
self.progress = progress_in
de... | 29.142857 | 103 | 0.65 |
4e197365a7098e6f08cdd253353c295d8b714e05 | 15,894 | py | Python | homeassistant/components/cover/template.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 37 | 2018-05-22T07:17:26.000Z | 2022-03-03T13:14:46.000Z | homeassistant/components/cover/template.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 125 | 2018-12-11T07:31:20.000Z | 2021-07-27T08:20:03.000Z | homeassistant/components/cover/template.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 8 | 2018-05-30T20:05:26.000Z | 2021-02-19T14:17:05.000Z | """
Support for covers which integrate with other components.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.template/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.component... | 38.115108 | 79 | 0.633069 |
c8fea39cf935add40923f9a379cf3844d01f3159 | 744 | py | Python | build/__init__.py | amagee/commandfrog | 3136c4447ca8a96fdbbfb837d61d42d63b5e19dc | [
"MIT"
] | null | null | null | build/__init__.py | amagee/commandfrog | 3136c4447ca8a96fdbbfb837d61d42d63b5e19dc | [
"MIT"
] | null | null | null | build/__init__.py | amagee/commandfrog | 3136c4447ca8a96fdbbfb837d61d42d63b5e19dc | [
"MIT"
] | null | null | null | import subprocess
from pathlib import Path
from functools import reduce
import operator
def build():
subprocess.run("rm -rf dist", cwd="commandfrog", check=True, shell=True)
operations = [p.stem for p in (Path("commandfrog") / "operations").glob("*.py")]
# This creates a binary in `commandfrog/dist/run`... | 26.571429 | 100 | 0.579301 |
92488c520eb6d4dbf4de2fe4924d448da4e562d8 | 603 | py | Python | mason/workflows/workflow_module.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 4 | 2021-04-12T17:49:34.000Z | 2022-01-23T19:54:29.000Z | mason/workflows/workflow_module.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 24 | 2021-04-30T18:40:25.000Z | 2021-05-12T20:52:06.000Z | mason/workflows/workflow_module.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 3 | 2021-04-12T19:40:43.000Z | 2021-09-07T21:56:36.000Z | from importlib import import_module
from typing import Union
from mason.engines.scheduler.models.dags.executed_dag_step import ExecutedDagStep
from mason.engines.scheduler.models.dags.failed_dag_step import FailedDagStep
from mason.engines.scheduler.models.dags.invalid_dag_step import InvalidDagStep
from mason.engines... | 46.384615 | 81 | 0.883914 |
6be5539d7fdfef0521c3f8a8f1415694ba2b42d3 | 9,104 | py | Python | py/probe/runtime_probe/probe_config_definition.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/probe/runtime_probe/probe_config_definition.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/probe/runtime_probe/probe_config_definition.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | # Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(yhong): Integrate the module with go/cros-probe.
import re
from cros.factory.probe.runtime_probe import probe_config_types
from cros.factory.util... | 49.210811 | 80 | 0.674209 |
8a437813b00d1d4c92055e202fe8d95650809726 | 35,476 | py | Python | fenics_concrete/material_problems/concrete_thermo_mechanical.py | BAMresearch/FenicsConcrete | 7a086d7767e20bd111cc7b05e5aa742d7e5ff47c | [
"MIT"
] | null | null | null | fenics_concrete/material_problems/concrete_thermo_mechanical.py | BAMresearch/FenicsConcrete | 7a086d7767e20bd111cc7b05e5aa742d7e5ff47c | [
"MIT"
] | 1 | 2022-03-24T15:24:53.000Z | 2022-03-24T15:24:53.000Z | fenics_concrete/material_problems/concrete_thermo_mechanical.py | BAMresearch/FenicsConcrete | 7a086d7767e20bd111cc7b05e5aa742d7e5ff47c | [
"MIT"
] | null | null | null | import dolfin as df
import numpy as np
import scipy.optimize
from fenics_concrete.material_problems.material_problem import MaterialProblem
from fenics_concrete.helpers import Parameters
from fenics_concrete.helpers import set_q
from fenics_concrete.helpers import LocalProjector
from fenics_concrete import experimen... | 44.234414 | 179 | 0.597474 |
fc1ad83a6e6dbd179e10c0a7f69239173589f295 | 9,729 | py | Python | scripts/labtainer-student/bin/CheckTars.py | jakuta-tech/Labtainers | f674204022ad5d13ad6bccaf02a14a283470d23f | [
"Apache-2.0"
] | null | null | null | scripts/labtainer-student/bin/CheckTars.py | jakuta-tech/Labtainers | f674204022ad5d13ad6bccaf02a14a283470d23f | [
"Apache-2.0"
] | null | null | null | scripts/labtainer-student/bin/CheckTars.py | jakuta-tech/Labtainers | f674204022ad5d13ad6bccaf02a14a283470d23f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''
This software was created by United States Government employees at
The Center for Cybersecurity and Cyber Operations (C3O)
at the Naval Postgraduate School NPS. Please note that within the
United States, copyright protection is not available for any works
created by United States Govern... | 44.62844 | 109 | 0.554322 |
cc41678e665055e67bcc002308a24c493bbdd7d7 | 47 | py | Python | fastweb/util/option.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | 123 | 2017-06-06T04:59:07.000Z | 2019-07-11T10:20:35.000Z | fastweb/util/option.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | null | null | null | fastweb/util/option.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | 2 | 2017-06-28T05:58:39.000Z | 2018-09-25T00:18:33.000Z | from fastweb.accesspoint import options, define | 47 | 47 | 0.87234 |
2c2141a918bcd49a76a6bd52fa90e1837c2cd680 | 756 | py | Python | staircase/core/accessor.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 25 | 2020-09-05T01:26:43.000Z | 2021-01-31T06:51:47.000Z | staircase/core/accessor.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 76 | 2020-03-03T22:26:19.000Z | 2021-07-09T09:29:38.000Z | staircase/core/accessor.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 10 | 2021-08-25T02:01:09.000Z | 2021-11-23T10:31:12.000Z | """
Taken from pandas.core.accessor.py, with minor adjustments.
"""
class CachedAccessor:
"""
Custom property-like object.
A descriptor for caching accessors.
Parameters
----------
name : str
Namespace that will be accessed under, e.g. ``sc.plot``.
accessor : cls
Class wit... | 25.2 | 75 | 0.613757 |
af76e4c30e059cbb020b01a66ee352682889c256 | 976 | py | Python | sastvd/helpers/tokenise.py | davidhin/linevd | 1fca96a1ae44efa3b2af645a01c50ca82add6ba3 | [
"MIT"
] | 13 | 2022-03-11T15:13:29.000Z | 2022-03-31T06:23:11.000Z | sastvd/helpers/tokenise.py | HickeyHsu/linevd | 1fca96a1ae44efa3b2af645a01c50ca82add6ba3 | [
"MIT"
] | 1 | 2022-03-24T22:55:38.000Z | 2022-03-30T02:39:55.000Z | sastvd/helpers/tokenise.py | HickeyHsu/linevd | 1fca96a1ae44efa3b2af645a01c50ca82add6ba3 | [
"MIT"
] | 3 | 2022-03-28T10:10:25.000Z | 2022-03-31T06:23:12.000Z | import re
def tokenise(s):
"""Tokenise according to IVDetect.
Tests:
s = "FooBar fooBar foo bar_blub23/x~y'z"
"""
spec_char = re.compile(r"[^a-zA-Z0-9\s]")
camelcase = re.compile(r".+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)")
spec_split = re.split(spec_char, s)
space_split ... | 27.111111 | 84 | 0.601434 |
1089c63198595d7ed049e8b93883586d7d7a6e36 | 5,198 | py | Python | frappe/build.py | Steggur/frappe | be95a19704dd3ac667f7ad64e1694dc5d59856fe | [
"MIT"
] | null | null | null | frappe/build.py | Steggur/frappe | be95a19704dd3ac667f7ad64e1694dc5d59856fe | [
"MIT"
] | null | null | null | frappe/build.py | Steggur/frappe | be95a19704dd3ac667f7ad64e1694dc5d59856fe | [
"MIT"
] | 1 | 2018-03-22T00:24:53.000Z | 2018-03-22T00:24:53.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from frappe.utils.minify import JavascriptMinify
"""
Build the `public` folders and setup languages
"""
import os, frappe, json, shutil, re
# from cssmin import cssmin
app_... | 28.718232 | 127 | 0.66641 |
3d3316871d7c4140320f9218f56228cf97b5cfac | 11,467 | py | Python | VL-T5/src/video/yc2c_data.py | ylsung/VL_adapter | 287409f383f89a11764fc45806864693a4d3e498 | [
"MIT"
] | 41 | 2021-12-14T02:50:16.000Z | 2022-03-30T07:41:19.000Z | VL-T5/src/video/yc2c_data.py | ylsung/VL_adapter | 287409f383f89a11764fc45806864693a4d3e498 | [
"MIT"
] | 1 | 2022-01-07T03:31:47.000Z | 2022-03-25T00:31:53.000Z | VL-T5/src/video/yc2c_data.py | ylsung/VL_adapter | 287409f383f89a11764fc45806864693a4d3e498 | [
"MIT"
] | 2 | 2021-12-14T03:10:18.000Z | 2022-03-29T04:59:23.000Z | from torch.utils.data import DataLoader, Dataset, Sampler
from pathlib import Path
from collections import defaultdict
import json
import pandas as pd
import random
from multiprocessing import Pool
import h5py
import pickle
import math
from tqdm import tqdm
import torch
import numpy as np
from copy import deepcopy
imp... | 30.825269 | 124 | 0.560042 |
25b8fd1cb69cc0bd4dfbe3ac7e4b9b2f5b7ab206 | 11,101 | py | Python | model/metrics.py | dimer116/YOLOv3-for-Particle-Tracking | db7e79101b32ea005270d3bf7d25bb91fdc04208 | [
"MIT"
] | null | null | null | model/metrics.py | dimer116/YOLOv3-for-Particle-Tracking | db7e79101b32ea005270d3bf7d25bb91fdc04208 | [
"MIT"
] | null | null | null | model/metrics.py | dimer116/YOLOv3-for-Particle-Tracking | db7e79101b32ea005270d3bf7d25bb91fdc04208 | [
"MIT"
] | 1 | 2021-05-21T08:13:07.000Z | 2021-05-21T08:13:07.000Z | import torch
import numpy as np
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cdist
import config
from tqdm import tqdm
from nms import nms
from detect_on_patches import run_on_patches
from utils import cells_to_bboxes
def rmse_xy(coord1, coord2):
xy_1 = coord1[0:2]... | 39.505338 | 166 | 0.665075 |
d8147e99615ce031f2b68bc0e5ae193b119ae7b5 | 791 | py | Python | var/spack/repos/builtin/packages/r-fda/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-fda/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-fda/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class RFda(RPackage):
"""These functions were developed to support functional data
analysis as described in Ramsa... | 37.666667 | 95 | 0.690265 |
2ccc1175c8dfb7afbfa4631306bfecaaf4e70451 | 4,472 | py | Python | sleap/rangelist.py | jens-k/sleap | 4e99ed037f1f7f41d9f15e2efaac638fc7e12b09 | [
"BSD-3-Clause-Clear"
] | null | null | null | sleap/rangelist.py | jens-k/sleap | 4e99ed037f1f7f41d9f15e2efaac638fc7e12b09 | [
"BSD-3-Clause-Clear"
] | null | null | null | sleap/rangelist.py | jens-k/sleap | 4e99ed037f1f7f41d9f15e2efaac638fc7e12b09 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Module with RangeList class for manipulating a list of range intervals.
This is used to cache the track occupancy so we can keep cache updating
when user manipulates tracks for a range of instances.
"""
from typing import List, Tuple
class RangeList:
"""
Class for manipulating a list of range intervals.... | 30.841379 | 85 | 0.567531 |
9e989fc8e825c7a8d1c163b1fe60576a4ce179a4 | 524 | py | Python | largest among three number.py | Max143/Python_programs | 5084900844d7f6c39a255a6cfb8fa5120a189026 | [
"MIT"
] | null | null | null | largest among three number.py | Max143/Python_programs | 5084900844d7f6c39a255a6cfb8fa5120a189026 | [
"MIT"
] | null | null | null | largest among three number.py | Max143/Python_programs | 5084900844d7f6c39a255a6cfb8fa5120a189026 | [
"MIT"
] | null | null | null | # program to find the largest among three numbers
x = int(input("Enter the first number : "))
y = int(input("Enter the second number : "))
z = int(input("Enter the third number : "))
def largest_num():
if x > y and x > z:
print("x is largest among three number.")
elif y > x and y >... | 21.833333 | 50 | 0.570611 |
fbce9eaced8bbff8915d25746e6819f3721564bf | 18,535 | py | Python | template_plot.py | lzx0014/STOPS | da73bb00cee53d2bc7b866dfdedc7ce014898c8c | [
"MIT"
] | null | null | null | template_plot.py | lzx0014/STOPS | da73bb00cee53d2bc7b866dfdedc7ce014898c8c | [
"MIT"
] | null | null | null | template_plot.py | lzx0014/STOPS | da73bb00cee53d2bc7b866dfdedc7ce014898c8c | [
"MIT"
] | 1 | 2022-03-02T21:28:53.000Z | 2022-03-02T21:28:53.000Z | import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
# plt.rc('text', usetex=True)
# plt.rcParams['text.latex.preamble'] = r'\usepackage{amsmath}'
# import os
# os.environ["PATH"] += os.pathsep + '/Library/TeX/texbin'
from deep_rl import *
IMG_DIR = 'C:/Users/xull/Desktop/DeepRL-MVPI/images'
def... | 32.12305 | 116 | 0.483086 |
306385f7cc35a93913744172cdcceed9c88b02de | 6,960 | py | Python | parser/manager/TweetManager.py | ApostolWario/SNTA_OSINT | 50d8237a557a8e808ea8ba9fd3af071293c4662b | [
"MIT"
] | null | null | null | parser/manager/TweetManager.py | ApostolWario/SNTA_OSINT | 50d8237a557a8e808ea8ba9fd3af071293c4662b | [
"MIT"
] | null | null | null | parser/manager/TweetManager.py | ApostolWario/SNTA_OSINT | 50d8237a557a8e808ea8ba9fd3af071293c4662b | [
"MIT"
] | null | null | null | import urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse, json, re, datetime, sys, \
http.cookiejar
from .. import models
from pyquery import PyQuery
from lxml import html
import requests
from bs4 import BeautifulSoup
from termcolor import colored
class TweetManager:
def __... | 41.183432 | 178 | 0.520546 |
39c1634dccd9c946f2ff13b17330be42d46d4497 | 1,209 | py | Python | ci/templatetags/range.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 29 | 2016-11-29T15:15:56.000Z | 2021-09-08T04:04:53.000Z | ci/templatetags/range.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 108 | 2016-11-29T17:29:00.000Z | 2022-03-21T21:00:10.000Z | ci/templatetags/range.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 11 | 2016-11-29T15:15:53.000Z | 2020-05-15T12:22:55.000Z |
# Copyright 2016 Battelle Energy Alliance, 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 agr... | 29.487805 | 74 | 0.680728 |
6e25b186af61158beed9700659877260c8883beb | 124 | py | Python | blocks/land_cover_classification/src/run.py | bmoska/land-cover-classification-demo | 2362913b586c8915086bb5ccc9bd17be15177954 | [
"MIT"
] | 1 | 2021-04-16T13:32:18.000Z | 2021-04-16T13:32:18.000Z | blocks/land_cover_classification/src/run.py | bmoska/land-cover-classification-demo | 2362913b586c8915086bb5ccc9bd17be15177954 | [
"MIT"
] | null | null | null | blocks/land_cover_classification/src/run.py | bmoska/land-cover-classification-demo | 2362913b586c8915086bb5ccc9bd17be15177954 | [
"MIT"
] | null | null | null | from land_cover_classification import LandCoverClassification
if __name__ == "__main__":
LandCoverClassification.run()
| 24.8 | 61 | 0.822581 |
ae3060268b874a2a1b7b57735b3972a1e1909155 | 5,083 | py | Python | simple/stile/assignment2-q5ii.py | feiooo/games-puzzles-algorithms | 66d97135d163fb04e820338068d9bd9e12d907e9 | [
"MIT"
] | null | null | null | simple/stile/assignment2-q5ii.py | feiooo/games-puzzles-algorithms | 66d97135d163fb04e820338068d9bd9e12d907e9 | [
"MIT"
] | null | null | null | simple/stile/assignment2-q5ii.py | feiooo/games-puzzles-algorithms | 66d97135d163fb04e820338068d9bd9e12d907e9 | [
"MIT"
] | null | null | null | # simple bfs program to solve sliding tile
from collections import deque
#from random import shuffle
from time import sleep, time
from sys import stdin
def int2chr(t): # nonneg int to single in '0123456789ABCDEFGHIJ...'
if t <= 9: return chr(t+ord('0'))
else: return chr(t-10 + ord('A'))
def chr2int(c): # chr... | 33.006494 | 91 | 0.577218 |
4b17d79693d45f2edb99d6c21adfb349fb3e262a | 999 | py | Python | setup.py | paulomach/mqtt2gpio | 95f57ecfb6561eaa9a5a9d50157814f182a09320 | [
"MIT"
] | null | null | null | setup.py | paulomach/mqtt2gpio | 95f57ecfb6561eaa9a5a9d50157814f182a09320 | [
"MIT"
] | null | null | null | setup.py | paulomach/mqtt2gpio | 95f57ecfb6561eaa9a5a9d50157814f182a09320 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="mqtt2gpio",
version="0.0.1",
author="Paulo Machado",
author_email="paulo.mach@gmail.com",
description="A very crude and direct mqtt to gpio write",
lon... | 27.75 | 71 | 0.61962 |
a5df36482e9f447883ecea9d677e09e0e66800cb | 7,913 | py | Python | pptx/oxml/chart/chart.py | mikebirdgeneau/python-pptx | ab86d39a643595ccc33f4644d584e35268cb4f22 | [
"MIT"
] | 1 | 2021-04-12T08:00:24.000Z | 2021-04-12T08:00:24.000Z | pptx/oxml/chart/chart.py | mikebirdgeneau/python-pptx | ab86d39a643595ccc33f4644d584e35268cb4f22 | [
"MIT"
] | null | null | null | pptx/oxml/chart/chart.py | mikebirdgeneau/python-pptx | ab86d39a643595ccc33f4644d584e35268cb4f22 | [
"MIT"
] | 3 | 2019-05-28T16:28:53.000Z | 2020-07-28T19:13:44.000Z | # encoding: utf-8
"""Custom element classes for top-level chart-related XML elements."""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from pptx.oxml import parse_xml
from pptx.oxml.chart.shared import CT_Title
from pptx.oxml.ns import nsdecls, qn
from pptx.oxml.simpletyp... | 31.031373 | 78 | 0.607102 |
5d142e02b661b8842cdb31ffb5d6033d92bc119f | 938 | py | Python | tests/addons.py | loriab/gau2grid | 100e18175a23b766e78b1e349dfafded7aa5e330 | [
"BSD-3-Clause"
] | null | null | null | tests/addons.py | loriab/gau2grid | 100e18175a23b766e78b1e349dfafded7aa5e330 | [
"BSD-3-Clause"
] | null | null | null | tests/addons.py | loriab/gau2grid | 100e18175a23b766e78b1e349dfafded7aa5e330 | [
"BSD-3-Clause"
] | null | null | null | import pytest
def _plugin_import(plug):
import sys
if sys.version_info >= (3, 4):
from importlib import util
plug_spec = util.find_spec(plug)
else:
import pkgutil
plug_spec = pkgutil.find_loader(plug)
if plug_spec is None:
return False
else:
return T... | 28.424242 | 116 | 0.690832 |
baa92a85e3cd8c7f9a592bf3bace8dcd4b1cd484 | 4,682 | py | Python | CLUE_Rock_Paper_Scissors/advanced/rps_crypto_chacha.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 665 | 2017-09-27T21:20:14.000Z | 2022-03-31T09:09:25.000Z | CLUE_Rock_Paper_Scissors/advanced/rps_crypto_chacha.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 641 | 2017-10-03T19:46:37.000Z | 2022-03-30T18:28:46.000Z | CLUE_Rock_Paper_Scissors/advanced/rps_crypto_chacha.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 734 | 2017-10-02T22:47:38.000Z | 2022-03-30T14:03:51.000Z | # Copyright (c) 2015 Hubert Kario (code from tlslite-ng library)
# Copyright (c) 2020 Kevin J. Walters (very minor CP tweaks)
# GNU Lesser General Public License, version 2.1
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
"""Pure Python implementation of ChaCha cipher
Implementation that follows RFC 75... | 30.206452 | 79 | 0.478855 |
ba0298a7bb0157d34c81b739bbf16f25b9160774 | 1,469 | py | Python | napari/layers/image/_image_slice_data.py | Zac-HD/napari | 102a7e8f845893c874d2b86f9371d41130100b89 | [
"BSD-3-Clause"
] | 1 | 2021-04-24T10:10:54.000Z | 2021-04-24T10:10:54.000Z | napari/layers/image/_image_slice_data.py | Zac-HD/napari | 102a7e8f845893c874d2b86f9371d41130100b89 | [
"BSD-3-Clause"
] | 17 | 2020-06-11T21:02:03.000Z | 2021-02-02T19:10:19.000Z | napari/layers/image/_image_slice_data.py | Zac-HD/napari | 102a7e8f845893c874d2b86f9371d41130100b89 | [
"BSD-3-Clause"
] | null | null | null | """ImageSliceData class.
"""
from typing import Optional, Tuple
import numpy as np
from ...types import ArrayLike
from ..base import Layer
class ImageSliceData:
"""The contents of an ImageSlice.
Parameters
----------
layer : Layer
The layer that contains the data.
indices : Tuple[Option... | 25.77193 | 74 | 0.6113 |
dd4515719a9fdf5f81888b16696e58683ea26054 | 487 | py | Python | molo/profiles/migrations/0021_remove_uuid_null.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | 25 | 2015-09-26T13:45:30.000Z | 2018-09-13T14:12:20.000Z | molo/profiles/migrations/0021_remove_uuid_null.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | 510 | 2015-05-29T09:30:44.000Z | 2018-12-11T09:08:11.000Z | molo/profiles/migrations/0021_remove_uuid_null.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | 5 | 2020-03-26T19:30:13.000Z | 2020-09-04T16:35:59.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-02 11:04
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('profiles', '0020_populate_uuid_values'),
]
operations = [
migra... | 22.136364 | 68 | 0.632444 |
8efb7e34ec6256962a89a3b298a1c102d0e5a6c9 | 1,541 | py | Python | tests/test_metadata_filters_from_config.py | robocorp/jupytext | 57c011db9055242bb59ca9dd1ee5ca4f7fab752b | [
"MIT"
] | 1 | 2021-12-27T16:26:14.000Z | 2021-12-27T16:26:14.000Z | tests/test_metadata_filters_from_config.py | huangyingw/mwouts_jupytext | b72d03f39920333eb312d675a1ecd0fa7c2b549f | [
"MIT"
] | null | null | null | tests/test_metadata_filters_from_config.py | huangyingw/mwouts_jupytext | b72d03f39920333eb312d675a1ecd0fa7c2b549f | [
"MIT"
] | null | null | null | import nbformat
from nbformat.v4.nbbase import new_notebook, new_markdown_cell
from jupytext.cli import jupytext as jupytext_cli
from jupytext.compare import compare, compare_notebooks
def test_metadata_filters_from_config(tmpdir):
cfg_file = tmpdir.join("jupytext.toml")
nb_file = tmpdir.join("notebook.ipynb"... | 31.44898 | 69 | 0.573005 |
8187efd769a87d281bc1ab77ea4b4b8bb0528ca5 | 19,069 | py | Python | scipy/optimize/zeros.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 39 | 2016-11-08T11:24:30.000Z | 2021-11-18T06:50:21.000Z | scipy/optimize/zeros.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 1 | 2015-09-30T05:26:54.000Z | 2016-03-22T15:09:56.000Z | scipy/optimize/zeros.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 13 | 2017-04-08T08:03:12.000Z | 2021-08-25T08:38:52.000Z | from __future__ import division, print_function, absolute_import
import warnings
from . import _zeros
from numpy import finfo, sign, sqrt
_iter = 100
_xtol = 1e-12
_rtol = finfo(float).eps * 2
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth']
CONVERGED = 'converged'
SIGNERR = 'sign error'
CONVERR = 'con... | 37.244141 | 80 | 0.620746 |
43ae3fe092175be20a3ccb12dbd73ed4aba778ba | 1,454 | py | Python | linux_binary_exploit/canary_bypass02/canary_bypass02_exploit_v01.py | greyshell/Penetration-Test | d73b0c6dc01833f69522ab2fc97d683c8b808fca | [
"MIT"
] | 13 | 2018-12-31T06:33:38.000Z | 2020-01-25T07:51:50.000Z | linux_binary_exploit/canary_bypass02/canary_bypass02_exploit_v01.py | greyshell/Penetration-Test | d73b0c6dc01833f69522ab2fc97d683c8b808fca | [
"MIT"
] | 1 | 2018-12-13T08:55:17.000Z | 2019-04-12T05:38:44.000Z | linux_binary_exploit/canary_bypass02/canary_bypass02_exploit_v01.py | greyshell/Penetration-Test | d73b0c6dc01833f69522ab2fc97d683c8b808fca | [
"MIT"
] | 4 | 2019-04-03T12:12:28.000Z | 2019-11-03T19:31:21.000Z | #!/usr/bin/env python3
# author: greyshell
from pwn import *
from pwn_utils import PwnUtils
def exploit(conn):
"""
interact with the binary with some valid input
"""
conn.recvuntil("name:\n") # receive bytes till name:
input_name = "A" * 23 # sendline() will add \n at the end
conn.sendline... | 25.964286 | 97 | 0.643741 |
8b855f66c905ebdf0c626cb20317269dca321624 | 5,306 | py | Python | tools/valgrind/common.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 2 | 2017-09-02T19:08:28.000Z | 2021-11-15T15:15:14.000Z | tools/valgrind/common.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | null | null | null | tools/valgrind/common.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T05:45:10.000Z | 2020-04-13T05:45:10.000Z | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import signal
import subprocess
import sys
import time
class NotImplementedError(Exception):
pass
class TimeoutError(Excep... | 33.1625 | 80 | 0.680173 |
95032c3d66297ed95afc364ca2f22262ae563e22 | 1,837 | py | Python | var/spack/repos/builtin/packages/rocprim/package.py | healther/spack | 389e9c11f6927ea27d629ed0e77ca0a52e402bc9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/rocprim/package.py | abouteiller/spack | 95f54195021d3d32dec75bed6d8dbbaeac3d921f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/rocprim/package.py | abouteiller/spack | 95f54195021d3d32dec75bed6d8dbbaeac3d921f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Rocprim(CMakePackage):
""" Radeon Open Compute Parallel Primitives Library"""
homepag... | 39.085106 | 105 | 0.658138 |
47688fc6d84482d1e985c9692b4ba306bad4ca1e | 843 | py | Python | salt/matchers/pillar_exact_match.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | salt/matchers/pillar_exact_match.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/matchers/pillar_exact_match.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
'''
This is the default pillar exact matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.utils.data # pylint: disable=3rd-party-module-not-gated
log = logging.getLogger(__name__)
def match(tgt, delimiter=':', opts=None):
'''
... | 29.068966 | 72 | 0.576512 |
49a77ac89b6804d8a8508f71b16094f6fd393f0b | 600 | py | Python | swaps/service/trade/post_batch_cancel_open_order.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | 1 | 2021-09-06T00:09:11.000Z | 2021-09-06T00:09:11.000Z | swaps/service/trade/post_batch_cancel_open_order.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | null | null | null | swaps/service/trade/post_batch_cancel_open_order.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | null | null | null | from swaps.connection.restapi_sync_client import RestApiSyncClient
from swaps.constant import *
from swaps.model.trade import *
from swaps.utils import *
class PostBatchCancelOpenOrderService:
def __init__(self, params):
self.params = params
def request(self, **kwargs):
channel = "/v1/order/... | 23.076923 | 109 | 0.706667 |
27bd9cc9992aa121cac4f57c4c11da2c23bb7106 | 28,233 | py | Python | Yank/tests/test_restraints.py | lilyminium/yank | aef24d9f413e646a3c4e65581198e0b67ae7a21b | [
"MIT"
] | 136 | 2015-02-16T12:24:02.000Z | 2022-03-17T11:15:11.000Z | Yank/tests/test_restraints.py | lilyminium/yank | aef24d9f413e646a3c4e65581198e0b67ae7a21b | [
"MIT"
] | 1,024 | 2015-01-08T22:13:51.000Z | 2022-03-25T19:33:33.000Z | Yank/tests/test_restraints.py | lilyminium/yank | aef24d9f413e646a3c4e65581198e0b67ae7a21b | [
"MIT"
] | 76 | 2015-01-12T23:58:00.000Z | 2022-03-19T23:33:17.000Z | #!/usr/bin/python
# =============================================================================================
# MODULE DOCSTRING
# =============================================================================================
"""
Test restraints module.
"""
# =====================================================... | 44.321821 | 181 | 0.651968 |
42194453f3b31b3bba101d8a9ffd8da653d8f200 | 3,607 | py | Python | parliament_lk/middlewares.py | prabod/CS4642-IR-Parliament.lk-Scraper | a0ce0f71f5747f62d25a0abc580fb7dd0fc39007 | [
"MIT"
] | null | null | null | parliament_lk/middlewares.py | prabod/CS4642-IR-Parliament.lk-Scraper | a0ce0f71f5747f62d25a0abc580fb7dd0fc39007 | [
"MIT"
] | null | null | null | parliament_lk/middlewares.py | prabod/CS4642-IR-Parliament.lk-Scraper | a0ce0f71f5747f62d25a0abc580fb7dd0fc39007 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class ParliamentLkSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# sc... | 34.682692 | 78 | 0.667036 |
fecda72a6a98ea431385dcff02f09ad0d73d53f6 | 1,508 | py | Python | metaci/views.py | abhishekalgo/metaci | cd62473b3fb85fb0f39623f9fb2850993ff708a5 | [
"BSD-3-Clause"
] | null | null | null | metaci/views.py | abhishekalgo/metaci | cd62473b3fb85fb0f39623f9fb2850993ff708a5 | [
"BSD-3-Clause"
] | null | null | null | metaci/views.py | abhishekalgo/metaci | cd62473b3fb85fb0f39623f9fb2850993ff708a5 | [
"BSD-3-Clause"
] | 1 | 2018-12-07T09:51:07.000Z | 2018-12-07T09:51:07.000Z | import os
import re
import subprocess
import sys
import django
from django.conf import settings
from django.views.generic.base import TemplateView
import cumulusci
class AboutView(TemplateView):
def get_context_data(self, **kwargs):
context = super(AboutView, self).get_context_data(**kwargs)
# d... | 28.45283 | 87 | 0.598143 |
8afa98b3b02c5afb493a1b79094df44d884f5a0c | 238 | py | Python | hw/hw12/tests/q1_6.py | ds-modules/Colab-demo | cccaff13633f8a5ec697cd4aeca9087f2feec2e4 | [
"BSD-3-Clause"
] | null | null | null | hw/hw12/tests/q1_6.py | ds-modules/Colab-demo | cccaff13633f8a5ec697cd4aeca9087f2feec2e4 | [
"BSD-3-Clause"
] | null | null | null | hw/hw12/tests/q1_6.py | ds-modules/Colab-demo | cccaff13633f8a5ec697cd4aeca9087f2feec2e4 | [
"BSD-3-Clause"
] | null | null | null | test = { 'name': 'q1_6',
'points': 1,
'suites': [{'cases': [{'code': '>>> # `k` should be an int;\n>>> type(k) == int\nTrue', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
| 59.5 | 193 | 0.495798 |
43b9c934db1e929d9ad8f13629fb0a8e0f26fba1 | 3,103 | py | Python | UnGastos/UnGastos/settings.py | Rdlenke/UnGastos | 6bb1ec456ad97d93a3805a7c39817dbbf5c413e3 | [
"MIT"
] | null | null | null | UnGastos/UnGastos/settings.py | Rdlenke/UnGastos | 6bb1ec456ad97d93a3805a7c39817dbbf5c413e3 | [
"MIT"
] | null | null | null | UnGastos/UnGastos/settings.py | Rdlenke/UnGastos | 6bb1ec456ad97d93a3805a7c39817dbbf5c413e3 | [
"MIT"
] | null | null | null | """
Django settings for UnGastos project.
Generated by 'django-admin startproject' using Django 2.1.2.
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
... | 25.644628 | 91 | 0.695778 |
a25edf4c49231a6352369fc63939411b70a6a432 | 569 | py | Python | pylonsapp/pylonsapp/controllers/owners.py | pombreda/formalchemy | 613f721c6da432a12ed94012fad8e337fb5af958 | [
"MIT"
] | 20 | 2015-01-25T13:54:08.000Z | 2021-03-09T16:54:53.000Z | pylonsapp/pylonsapp/controllers/owners.py | pombreda/formalchemy | 613f721c6da432a12ed94012fad8e337fb5af958 | [
"MIT"
] | 11 | 2015-02-05T16:36:19.000Z | 2020-11-13T11:41:19.000Z | pylonsapp/pylonsapp/controllers/owners.py | pombreda/formalchemy | 613f721c6da432a12ed94012fad8e337fb5af958 | [
"MIT"
] | 12 | 2015-02-19T14:06:21.000Z | 2021-07-30T08:44:45.000Z | import logging
from pylons import request, response, session, url, tmpl_context as c
from pylons.controllers.util import abort, redirect
from pylonsapp.lib.base import BaseController, render
from pylonsapp import model
from pylonsapp.model import meta
from formalchemy.ext.pylons.controller import RESTController
log... | 24.73913 | 70 | 0.785589 |
be8636abf7d8687d5a97d8e6b5e4f322ff491274 | 2,134 | py | Python | src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/azure_function_event_subscription_destination.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2022-03-22T15:02:32.000Z | 2022-03-22T15:02:32.000Z | src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/azure_function_event_subscription_destination.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2018-11-19T05:12:58.000Z | 2018-11-19T05:12:58.000Z | src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/azure_function_event_subscription_destination.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-06-03T19:31:10.000Z | 2021-06-03T19:31:10.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 ... | 43.55102 | 112 | 0.679944 |
0b2f50ff89bcb63b04bd94297e68ccc42699cc9e | 129 | py | Python | scripts/download_data.py | jgehunter/stock_price_prediction | 229a9b540409519fcbbfa0fcdd821df15fab0185 | [
"MIT"
] | null | null | null | scripts/download_data.py | jgehunter/stock_price_prediction | 229a9b540409519fcbbfa0fcdd821df15fab0185 | [
"MIT"
] | null | null | null | scripts/download_data.py | jgehunter/stock_price_prediction | 229a9b540409519fcbbfa0fcdd821df15fab0185 | [
"MIT"
] | null | null | null | import fire
from stock_price_prediction.download.ticker_download import GetData
if __name__ == "__main__":
fire.Fire(GetData) | 32.25 | 67 | 0.813953 |
87843280d8093799cf09713b826210ff3b4d25c7 | 615 | py | Python | pythonzoo/zoo/views.py | ppolanco01/Spring2018PythonZoo | 1ec9b6dd141870f8cd0f7aeaed7baee9d00c2285 | [
"MIT"
] | null | null | null | pythonzoo/zoo/views.py | ppolanco01/Spring2018PythonZoo | 1ec9b6dd141870f8cd0f7aeaed7baee9d00c2285 | [
"MIT"
] | null | null | null | pythonzoo/zoo/views.py | ppolanco01/Spring2018PythonZoo | 1ec9b6dd141870f8cd0f7aeaed7baee9d00c2285 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views import generic
from.models import Zoo, Exhibit, Animal
# Create your views here.
def aboutus(request):
return render(
request,
"zoo/aboutus.html",
context = { },
)
def contactus(request):
return render(
request,
... | 18.636364 | 44 | 0.666667 |
3599b77da9835b3451a89a7f610111bef5fa379b | 68,070 | py | Python | Tools/MassSpectrometry/PeakRationalizer.py | deaconjs/SPADE | da28cb927ae14f60aaf847591f81a86c9796d95e | [
"BSD-3-Clause"
] | 3 | 2017-09-26T03:09:14.000Z | 2022-03-20T11:12:34.000Z | Tools/MassSpectrometry/PeakRationalizer.py | deaconjs/SPADE | da28cb927ae14f60aaf847591f81a86c9796d95e | [
"BSD-3-Clause"
] | null | null | null | Tools/MassSpectrometry/PeakRationalizer.py | deaconjs/SPADE | da28cb927ae14f60aaf847591f81a86c9796d95e | [
"BSD-3-Clause"
] | 1 | 2020-01-15T03:05:36.000Z | 2020-01-15T03:05:36.000Z | # python imports
import string
import math
import os.path
import pickle
import sys
import copy
# dependency imports
sys.path.append(os.path.abspath('./Dependencies'))
sys.path.append(os.path.abspath('./Dependencies/pybwidget-0.1.2_1.7.0'))
sys.path.append(os.path.abspath('./Dependencies/pybwidget/bwidget'))
import bwid... | 62.564338 | 312 | 0.504554 |
bc43932ed29cbfca431620f76db985662cb4ce2e | 635 | py | Python | advanced/lychrel.py | rocket3989/ACCA2020 | 24ae77df2ca428cf761a987fb2bb2f1a35285804 | [
"MIT"
] | null | null | null | advanced/lychrel.py | rocket3989/ACCA2020 | 24ae77df2ca428cf761a987fb2bb2f1a35285804 | [
"MIT"
] | null | null | null | advanced/lychrel.py | rocket3989/ACCA2020 | 24ae77df2ca428cf761a987fb2bb2f1a35285804 | [
"MIT"
] | null | null | null | def isPali(n):
n = str(n)
for a, b in zip(n, reversed(n)):
if a != b:
return False
return True
while True:
N = int(input())
if N == 0: break
test = 0
while test < 100:
if isPali(N):
break
temp = N
rev = 0
whil... | 21.896552 | 53 | 0.434646 |
0744dc60c6fef803be3559a08227c306d3c240eb | 371 | py | Python | finmeter/sentiment/utils/cupy_utils.py | mikahama/FinMeter | fd1d3d8feb216e6247a1eeac3bac16a9dd235e66 | [
"Apache-2.0"
] | 5 | 2019-10-06T20:13:32.000Z | 2021-11-07T14:27:02.000Z | finmeter/sentiment/utils/cupy_utils.py | mikahama/FinMeter | fd1d3d8feb216e6247a1eeac3bac16a9dd235e66 | [
"Apache-2.0"
] | null | null | null | finmeter/sentiment/utils/cupy_utils.py | mikahama/FinMeter | fd1d3d8feb216e6247a1eeac3bac16a9dd235e66 | [
"Apache-2.0"
] | null | null | null | import numpy
try:
import cupy
except ImportError:
cupy = None
def get_cupy():
return cupy
def get_array_module(*args, **kwargs):
if cupy is not None:
return cupy.get_array_module(*args, **kwargs)
else:
return numpy
def asnumpy(x):
if cupy is not None:
return cupy.a... | 15.458333 | 53 | 0.625337 |
8e13a7c707dddeaced4a145f995b62bdcc9b063f | 416 | py | Python | exceptions.py | nultero/jetx | 91b6642600f11d1cd0a4964661462811086443f5 | [
"MIT"
] | null | null | null | exceptions.py | nultero/jetx | 91b6642600f11d1cd0a4964661462811086443f5 | [
"MIT"
] | null | null | null | exceptions.py | nultero/jetx | 91b6642600f11d1cd0a4964661462811086443f5 | [
"MIT"
] | null | null | null |
from sys import exit
def exc_handler(*args, case: str):
cases = {
"invalid fn": "is an unrecognized command"
}
j = " 🚀 jetx error:"
# todo
# dynamics for variadic args
if case in cases.keys():
if len(args) > 0:
s = f"{j} '{args[0]}' {cases[case]}"
els... | 16 | 50 | 0.473558 |
f7381d635f3c0ce2d25584e3dfa645a0f5a58cc1 | 45 | py | Python | easyfilemanager/__init__.py | RaphaelNanje/easyfilemanager | 29cb6ad90dc28de41478ce7ed768917051f0988a | [
"MIT"
] | null | null | null | easyfilemanager/__init__.py | RaphaelNanje/easyfilemanager | 29cb6ad90dc28de41478ce7ed768917051f0988a | [
"MIT"
] | null | null | null | easyfilemanager/__init__.py | RaphaelNanje/easyfilemanager | 29cb6ad90dc28de41478ce7ed768917051f0988a | [
"MIT"
] | null | null | null | from easyfilemanager.core import FileManager
| 22.5 | 44 | 0.888889 |
020ba6bc01ff63283b2005d89e0d8af4e13fbeab | 2,075 | py | Python | setup.py | MD-Studio/MDStudio_haddock | 7e6c04206eef9ad444ecf08ab52a92d69b6230f3 | [
"Apache-2.0"
] | null | null | null | setup.py | MD-Studio/MDStudio_haddock | 7e6c04206eef9ad444ecf08ab52a92d69b6230f3 | [
"Apache-2.0"
] | 1 | 2018-05-22T13:12:01.000Z | 2018-05-22T13:12:01.000Z | setup.py | MD-Studio/MDStudio_haddock | 7e6c04206eef9ad444ecf08ab52a92d69b6230f3 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# package: mdstudio_haddock
# file: setup.py
#
# Part of MDStudio HADDOCK, providing access to the HADDOCK web server for
# biomolecular docking.
#
# Copyright © 2019 Marc van Dijk, VU University Amsterdam, the Netherlands
#
# Licensed under the Apache License, Version 2.... | 36.403509 | 75 | 0.704096 |
b5bc077b7d661edae5012f71d0f40abbe8089297 | 10,661 | py | Python | server.py | ebidel/chromium-dashboard | 76e9d935869d4d48ad7062033b480237d302207d | [
"Apache-2.0"
] | null | null | null | server.py | ebidel/chromium-dashboard | 76e9d935869d4d48ad7062033b480237d302207d | [
"Apache-2.0"
] | 3 | 2017-03-16T11:56:53.000Z | 2019-02-27T22:50:27.000Z | server.py | ebidel/chromium-dashboard | 76e9d935869d4d48ad7062033b480237d302207d | [
"Apache-2.0"
] | 1 | 2017-09-03T01:23:23.000Z | 2017-09-03T01:23:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.184818 | 109 | 0.66354 |
dc0046384f4d475db624d52151dea4a558c000f0 | 6,834 | py | Python | SOURCES/olCheckLibs/olCheckLib.py | OL-GIT/CheckShot | 40688f4a52d28305d1f642be9317d1451ae8d9a7 | [
"MIT"
] | null | null | null | SOURCES/olCheckLibs/olCheckLib.py | OL-GIT/CheckShot | 40688f4a52d28305d1f642be9317d1451ae8d9a7 | [
"MIT"
] | 1 | 2021-07-16T16:06:19.000Z | 2021-07-16T16:06:19.000Z | SOURCES/olCheckLibs/olCheckLib.py | OL-GIT/CheckShot | 40688f4a52d28305d1f642be9317d1451ae8d9a7 | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
# ----------------------------------------
### LICENSE
# ----------------------------------------
# MIT License - Copyright (c) 2021 OL-GIT
# ----------------------------------------
# Various Checks
import os
import sys
myOS = (sys.platform)
if myOS == "cygwin":
pgmDir = "/cygdrive/e/OCR/P0... | 25.217712 | 83 | 0.507316 |
d87cbb15bb1addcd03b82a1530958bb7ad7a3f87 | 12,891 | py | Python | otp/login/TTAccount.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | otp/login/TTAccount.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | otp/login/TTAccount.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | from pandac.PandaModules import *
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
from direct.showbase import PythonUtil
from otp.otpbase import OTPLocalizer
import HTTPUtil
import RemoteValueSet
import copy
accountServer = base.config.GetString('account-server', '')
#accountServer ... | 38.026549 | 284 | 0.594523 |
5275d50e2ecc5cd050960b00cd3843a501f3c11c | 7,324 | py | Python | kuryr_kubernetes/controller/handlers/kuryrnetwork.py | openshift-bot/kuryr-kubernetes | 9577bf398b19c1305468dda749edac31d76d46ee | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/controller/handlers/kuryrnetwork.py | openshift-bot/kuryr-kubernetes | 9577bf398b19c1305468dda749edac31d76d46ee | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/controller/handlers/kuryrnetwork.py | openshift-bot/kuryr-kubernetes | 9577bf398b19c1305468dda749edac31d76d46ee | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 45.775 | 79 | 0.654697 |
9e355d933814a6976f1527a96b6405e1e9cc0dd1 | 58 | py | Python | med-cabinet-predictions/__init__.py | med-cabinet-5/data-science | e43495739da6266c0c76c2b4984c365f1a50789c | [
"MIT"
] | 1 | 2020-02-03T16:03:20.000Z | 2020-02-03T16:03:20.000Z | med-cabinet-predictions/__init__.py | med-cabinet-5/data-science | e43495739da6266c0c76c2b4984c365f1a50789c | [
"MIT"
] | null | null | null | med-cabinet-predictions/__init__.py | med-cabinet-5/data-science | e43495739da6266c0c76c2b4984c365f1a50789c | [
"MIT"
] | null | null | null | # imports
from .app import create_app
APP = create_app()
| 11.6 | 27 | 0.741379 |
5a5eeb78e48958fde9c9b340d523cfeb16661a6a | 2,661 | py | Python | lib/custom_layers.py | 1zong2/pggan | 8ae47a77df817d91634dfeeec8ab26b2888e407a | [
"MIT"
] | null | null | null | lib/custom_layers.py | 1zong2/pggan | 8ae47a77df817d91634dfeeec8ab26b2888e407a | [
"MIT"
] | 1 | 2022-03-16T09:30:18.000Z | 2022-03-20T08:37:07.000Z | lib/custom_layers.py | 1zong2/pggan | 8ae47a77df817d91634dfeeec8ab26b2888e407a | [
"MIT"
] | 1 | 2022-03-19T08:08:22.000Z | 2022-03-19T08:08:22.000Z | import math
import torch
import torch.nn as nn
from numpy import prod
def getLayerNormalizationFactor(x):
"""
Get per-layer normalization constant from He’s initializer
https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf
"""
size = x.weight.s... | 29.241758 | 110 | 0.538895 |
d6fb9f36db2530363fcfe8e84047830069cd3e31 | 6,578 | py | Python | ucsmsdk/mometa/bios/BiosVProfile.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 78 | 2015-11-30T14:10:05.000Z | 2022-02-13T00:29:08.000Z | ucsmsdk/mometa/bios/BiosVProfile.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 113 | 2015-11-20T09:42:46.000Z | 2022-03-16T16:53:29.000Z | ucsmsdk/mometa/bios/BiosVProfile.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 86 | 2015-12-12T08:22:18.000Z | 2022-01-23T03:56:34.000Z | """This module contains the general information for BiosVProfile ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class BiosVProfileConsts:
INT_ID_NONE = "none"
POLICY_OWNER_LOCAL = "local"
POLICY_OWNER_PENDING_POLIC... | 96.735294 | 3,037 | 0.732898 |
01806470228115708569066162a0601009e9786a | 9,891 | py | Python | download_data.py | melo-gonzo/StockDataDownload | 3471591eec2089dcb7f604c1db5ca2e010d9e9a2 | [
"Apache-2.0"
] | 72 | 2021-02-01T08:40:53.000Z | 2022-02-10T07:44:00.000Z | download_data.py | melo-gonzo/StockDataDownload | 3471591eec2089dcb7f604c1db5ca2e010d9e9a2 | [
"Apache-2.0"
] | 1 | 2021-02-03T13:51:21.000Z | 2021-02-04T07:49:37.000Z | download_data.py | melo-gonzo/StockDataDownload | 3471591eec2089dcb7f604c1db5ca2e010d9e9a2 | [
"Apache-2.0"
] | 13 | 2021-02-01T08:32:59.000Z | 2021-12-21T20:04:32.000Z | import re
import os
import time
import requests
import datetime
import argparse
import numpy as np
import multiprocessing
from functools import partial
def split_crumb_store(v):
if v is None:
return
return v.split(':')[2].strip('"')
def find_crumb_store(lines):
for l in lines:
if re.find... | 38.940945 | 132 | 0.625013 |
1d8f4d12beb96bfe56276edb482c463671e8bc01 | 1,614 | py | Python | add_unix_time.py | PlatonaM/lopco-merge-csv-worker | 36f8a1cc83d6f7b1e1e3ac19f3f73e91f86adec4 | [
"Apache-2.0"
] | null | null | null | add_unix_time.py | PlatonaM/lopco-merge-csv-worker | 36f8a1cc83d6f7b1e1e3ac19f3f73e91f86adec4 | [
"Apache-2.0"
] | null | null | null | add_unix_time.py | PlatonaM/lopco-merge-csv-worker | 36f8a1cc83d6f7b1e1e3ac19f3f73e91f86adec4 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2021 InfAI (CC SES)
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 wr... | 36.681818 | 131 | 0.688971 |
1a987a034983900774f514c8cbe08fd4f0cefd07 | 2,170 | py | Python | meraki/models/tuesday_model.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | 37 | 2019-04-24T14:01:33.000Z | 2022-01-28T01:37:21.000Z | meraki/models/tuesday_model.py | ankita66666666/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 10 | 2019-07-09T16:35:11.000Z | 2021-12-07T03:47:53.000Z | meraki/models/tuesday_model.py | ankita66666666/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 17 | 2019-04-30T23:53:21.000Z | 2022-02-07T22:57:44.000Z | # -*- coding: utf-8 -*-
"""
meraki
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
class TuesdayModel(object):
"""Implementation of the 'Tuesday' model.
The schedule object for Tuesday.
Attributes:
active (bool): Whether t... | 28.552632 | 95 | 0.55023 |
e4f7636b5ebc4a9f9ea1e394ee1c77261098f7bb | 970 | py | Python | list_range.py | CrazyJ36/python | 4cff6e7240672a273d978521bb511065f45d4312 | [
"MIT"
] | null | null | null | list_range.py | CrazyJ36/python | 4cff6e7240672a273d978521bb511065f45d4312 | [
"MIT"
] | null | null | null | list_range.py | CrazyJ36/python | 4cff6e7240672a273d978521bb511065f45d4312 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 'list(range(int)' creates A numbered list.
# Makes a int list with 6 items.
nums = list(range(6))
# Print the new list.
print("New list, 6 items:\n>>> nums = list(range(6))\n", nums)
# Print 2nd index position of nums list.
print("\nPrint list item at 2nd index position:")
print(">>> nums[2... | 32.333333 | 62 | 0.679381 |
277d80cbe0b220c0e339b3d4055607b00e4d2528 | 3,549 | py | Python | Xpense/settings.py | ronyyosef/Xpense | 9b7bf5785072dee5c95863130a3ea0eb9c2832db | [
"MIT"
] | null | null | null | Xpense/settings.py | ronyyosef/Xpense | 9b7bf5785072dee5c95863130a3ea0eb9c2832db | [
"MIT"
] | null | null | null | Xpense/settings.py | ronyyosef/Xpense | 9b7bf5785072dee5c95863130a3ea0eb9c2832db | [
"MIT"
] | null | null | null | """
Django settings for Xpense project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from pathlib ... | 27.726563 | 91 | 0.704142 |
2b77f838b89847ceb50880ba7b5cb5c7c06ffe5d | 12,495 | py | Python | docs/conf.py | renovate-bot/python-identity-toolkit | ccf9b1bc538d1a3de90fcefd66465b947198a1a7 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | renovate-bot/python-identity-toolkit | ccf9b1bc538d1a3de90fcefd66465b947198a1a7 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | renovate-bot/python-identity-toolkit | ccf9b1bc538d1a3de90fcefd66465b947198a1a7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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 agr... | 32.709424 | 88 | 0.706202 |
040aa899497e2aa02f213596ed3bc9c34fa76243 | 114 | py | Python | classtoolz/classtoolz/__init__.py | WallaceLiu/python_learn | ea8c4c20856a25491c756f74b3b572463ea7d7ea | [
"Apache-2.0"
] | 4 | 2016-02-11T15:54:48.000Z | 2021-02-06T00:32:20.000Z | classtoolz/classtoolz/__init__.py | WallaceLiu/python_learn | ea8c4c20856a25491c756f74b3b572463ea7d7ea | [
"Apache-2.0"
] | null | null | null | classtoolz/classtoolz/__init__.py | WallaceLiu/python_learn | ea8c4c20856a25491c756f74b3b572463ea7d7ea | [
"Apache-2.0"
] | 2 | 2015-10-03T20:24:38.000Z | 2017-03-13T21:58:58.000Z | from .slotted import Slotted
from .typed import Typed
from .immutable import Immutable
from .cached import Cached
| 22.8 | 32 | 0.824561 |
a8eba30a728a0a858abe16e36de463856e19be7d | 3,867 | py | Python | password_test.py | Jessevictor/PythonIP1 | fb600107f67a4e18333e527b9ce6cd5714d10134 | [
"Unlicense",
"MIT"
] | null | null | null | password_test.py | Jessevictor/PythonIP1 | fb600107f67a4e18333e527b9ce6cd5714d10134 | [
"Unlicense",
"MIT"
] | null | null | null | password_test.py | Jessevictor/PythonIP1 | fb600107f67a4e18333e527b9ce6cd5714d10134 | [
"Unlicense",
"MIT"
] | null | null | null | import unittest
from password import User
from password import Credentials
class TestClass(unittest.TestCase):
"""
A Test class that defines test cases for the User class.
"""
def setUp(self):
"""
Method that runs before each individual test methods run.
"""
self.new_use... | 35.477064 | 113 | 0.664081 |
7c16d13e59d3a27b08205b4b3cfa672fe5a129e6 | 80,856 | py | Python | pandas/tests/test_algos.py | dorothykiz1/pandas | 6033ed4b3383d874ee4a8a461724c0b8c2ca968d | [
"BSD-3-Clause"
] | 1 | 2022-03-29T01:38:03.000Z | 2022-03-29T01:38:03.000Z | pandas/tests/test_algos.py | dorothykiz1/pandas | 6033ed4b3383d874ee4a8a461724c0b8c2ca968d | [
"BSD-3-Clause"
] | 1 | 2022-03-18T01:26:58.000Z | 2022-03-18T01:26:58.000Z | pandas/tests/test_algos.py | dorothykiz1/pandas | 6033ed4b3383d874ee4a8a461724c0b8c2ca968d | [
"BSD-3-Clause"
] | 1 | 2022-03-25T21:54:40.000Z | 2022-03-25T21:54:40.000Z | from datetime import datetime
from itertools import permutations
import struct
import numpy as np
import pytest
from pandas._libs import (
algos as libalgos,
hashtable as ht,
)
import pandas.util._test_decorators as td
from pandas.core.dtypes.common import (
is_bool_dtype,
is_complex_dtype,
is_fl... | 34.702146 | 88 | 0.551919 |
080eec5be8283dedc491afecb6b381e3dbae21cc | 4,227 | py | Python | tests/performance/cv_performance.py | drunkcoding/efficient-nlp | 9509e0ef08016506280a7cfc600ea8e3778dea2d | [
"Apache-2.0"
] | null | null | null | tests/performance/cv_performance.py | drunkcoding/efficient-nlp | 9509e0ef08016506280a7cfc600ea8e3778dea2d | [
"Apache-2.0"
] | null | null | null | tests/performance/cv_performance.py | drunkcoding/efficient-nlp | 9509e0ef08016506280a7cfc600ea8e3778dea2d | [
"Apache-2.0"
] | null | null | null | from tqdm import tqdm
from torchvision import datasets, transforms
import torchvision.models as models
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from torch.profiler import profile, record_function, ProfilerActivity, schedule
import torch
import torch.cuda as cutorch
import... | 32.267176 | 127 | 0.609652 |
073e129d79a65231f457d3fdf1349eaad2ef4aa4 | 173 | py | Python | tools/old/ext.py | yuj09161/word | 8260c50998cf3f129b7da886163a218774dea029 | [
"MIT"
] | null | null | null | tools/old/ext.py | yuj09161/word | 8260c50998cf3f129b7da886163a218774dea029 | [
"MIT"
] | null | null | null | tools/old/ext.py | yuj09161/word | 8260c50998cf3f129b7da886163a218774dea029 | [
"MIT"
] | null | null | null | import os
for file in os.listdir():
name,ext=os.path.splitext(file)
print(name,ext)
if os.path.isfile(file) and ext=='.txt':
os.rename(file,name+'.csv') | 24.714286 | 44 | 0.630058 |
6d768611f47d025618bdecaebef9a6d419ef05a8 | 2,558 | py | Python | simublocks/simulation/plot.py | bentoavb/simublocks | 9d4a5600b8aecd2d188e9191d78789a1bd725ab8 | [
"MIT"
] | 2 | 2020-05-14T12:34:43.000Z | 2020-06-11T23:48:09.000Z | simublocks/simulation/plot.py | bentoavb/simublocks | 9d4a5600b8aecd2d188e9191d78789a1bd725ab8 | [
"MIT"
] | null | null | null | simublocks/simulation/plot.py | bentoavb/simublocks | 9d4a5600b8aecd2d188e9191d78789a1bd725ab8 | [
"MIT"
] | 1 | 2020-05-12T07:01:28.000Z | 2020-05-12T07:01:28.000Z | # MIT License
#
# Copyright (c) 2020 Anderson Vitor Bento
#
# 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... | 43.355932 | 136 | 0.595778 |
5aadc220bfebf610ed755a0f8c00e1d02c5ad8c5 | 5,776 | py | Python | pymodbus/datastore/context.py | etactica/pymodbus | eb51b4df4fa72d3ef5c5d14699b02456ef56203f | [
"W3C"
] | null | null | null | pymodbus/datastore/context.py | etactica/pymodbus | eb51b4df4fa72d3ef5c5d14699b02456ef56203f | [
"W3C"
] | null | null | null | pymodbus/datastore/context.py | etactica/pymodbus | eb51b4df4fa72d3ef5c5d14699b02456ef56203f | [
"W3C"
] | null | null | null | from pymodbus.exceptions import NoSuchSlaveException
from pymodbus.interfaces import IModbusSlaveContext
from pymodbus.datastore.store import ModbusSequentialDataBlock
from pymodbus.constants import Defaults
#---------------------------------------------------------------------------#
# Logging
#----------------------... | 37.751634 | 80 | 0.605609 |
efe5fa1c1f05589bd95ae813a1e2533c50e86981 | 5,310 | py | Python | CSA_SR.py | YiyongHuang/CSA-SR | 522e946df50b52d9d560e255c8ca4abf1a89501f | [
"MIT"
] | 6 | 2020-12-02T14:13:21.000Z | 2021-05-18T07:22:27.000Z | CSA_SR.py | YiyongHuang/CSA-SR | 522e946df50b52d9d560e255c8ca4abf1a89501f | [
"MIT"
] | 2 | 2020-12-02T14:20:27.000Z | 2021-05-17T07:18:42.000Z | CSA_SR.py | YiyongHuang/CSA-SR | 522e946df50b52d9d560e255c8ca4abf1a89501f | [
"MIT"
] | null | null | null | import torch
from torch import nn
from data_process import *
# from ConvGRU import SeqVLADModule
from ConvGRU_att import SeqVLADModule
from SLSTM import SLSTM
import math
from torch import Tensor
from torch.nn import Parameter
word_counts, unk_required = build_vocab(word_count_threshold=0)
word2id, id2word = word_to_i... | 42.48 | 108 | 0.622787 |
01231e72835bc3335360916fe43880f3d771e11c | 9,082 | py | Python | tiledb/fragment.py | TileDB-Inc/TileDB-Py | a5b0371d34020c17c351d560edb786d2224ad32f | [
"MIT"
] | 136 | 2018-02-26T05:17:24.000Z | 2022-03-29T22:59:31.000Z | tiledb/fragment.py | TileDB-Inc/TileDB-Py | a5b0371d34020c17c351d560edb786d2224ad32f | [
"MIT"
] | 578 | 2018-02-20T02:07:51.000Z | 2022-03-31T11:24:34.000Z | tiledb/fragment.py | TileDB-Inc/TileDB-Py | a5b0371d34020c17c351d560edb786d2224ad32f | [
"MIT"
] | 30 | 2018-03-22T04:13:43.000Z | 2022-03-26T13:24:43.000Z | import pprint
import warnings
import tiledb
from tiledb.main import PyFragmentInfo
"""
Retrieves information from all fragments for a given array.
"""
class FragmentInfoList:
"""
Class representing an ordered list of FragmentInfo objects.
:param uri: URIs of fragments
:param version: Fragment versi... | 35.20155 | 120 | 0.625963 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.