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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7c1d13f88c58a68331858cd82f62795bc6b19393 | 58 | py | Python | maior.py | Viictorreiss/pythonmarathon | 8e1b948e887cf0237ccf7edf0a168f062e937d15 | [
"MIT"
] | null | null | null | maior.py | Viictorreiss/pythonmarathon | 8e1b948e887cf0237ccf7edf0a168f062e937d15 | [
"MIT"
] | null | null | null | maior.py | Viictorreiss/pythonmarathon | 8e1b948e887cf0237ccf7edf0a168f062e937d15 | [
"MIT"
] | null | null | null | nums = input().split()
nums.sort()
print(nums[-1], end="") | 19.333333 | 23 | 0.603448 |
70ebe702f6e9552335c07c46fcc167c95608f747 | 740 | py | Python | variation/translators/genomic_deletion_range.py | cancervariants/variant-normalization | e89a9f8366a659c82b2042aeb7effe339851bfb4 | [
"MIT"
] | 1 | 2022-01-19T18:17:49.000Z | 2022-01-19T18:17:49.000Z | variation/translators/genomic_deletion_range.py | cancervariants/variation-normalization | 9c8fbab1562591ae9445d82ddd15df29f1ea1f5a | [
"MIT"
] | 99 | 2021-06-07T12:50:34.000Z | 2022-03-23T13:38:29.000Z | variation/translators/genomic_deletion_range.py | cancervariants/variant-normalization | e89a9f8366a659c82b2042aeb7effe339851bfb4 | [
"MIT"
] | null | null | null | """Module for Genomic Deletion Range Translation."""
from variation.translators.translator import Translator
from variation.schemas.classification_response_schema import ClassificationType
from variation.schemas.token_response_schema import \
GenomicDeletionRangeToken
class GenomicDeletionRange(Translator):
"... | 41.111111 | 79 | 0.774324 |
0367c377269c1efb094da07565bc22022e92190c | 4,131 | py | Python | registration/migrations/0003_auto_20210630_1711.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 8 | 2019-08-27T20:08:22.000Z | 2021-07-23T22:49:47.000Z | registration/migrations/0003_auto_20210630_1711.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 73 | 2020-03-11T18:07:29.000Z | 2022-03-28T18:07:47.000Z | registration/migrations/0003_auto_20210630_1711.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 4 | 2020-02-22T19:44:17.000Z | 2022-03-08T09:42:45.000Z | # Generated by Django 3.2.4 on 2021-06-30 16:11
import ckeditor.fields
import common.files.upload
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('registration', '0002_alter_us... | 72.473684 | 2,139 | 0.556524 |
54cde32ad438fd525b5e8abfc41724451baa5b79 | 9,625 | py | Python | config/main.py | ArtiomOn/pull_bot | 1f9db9e38beb1be4ac3a16e36775c73b412ceab4 | [
"MIT"
] | null | null | null | config/main.py | ArtiomOn/pull_bot | 1f9db9e38beb1be4ac3a16e36775c73b412ceab4 | [
"MIT"
] | null | null | null | config/main.py | ArtiomOn/pull_bot | 1f9db9e38beb1be4ac3a16e36775c73b412ceab4 | [
"MIT"
] | null | null | null | import logging
import os
import dotenv
import requests
from aiogram import types, Bot, Dispatcher
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.utils import executor
from aiogram.utils.exceptions import BotBlocked
from youtubesearchpython import *
from services.converter import convert_ogg... | 47.181373 | 114 | 0.643117 |
efd6adbe98d2f0eb2bed2131dbb4624aa38ee8ee | 835 | py | Python | satchmo/shop/management/commands/satchmo_copy_templates.py | sankroh/satchmo | e48df0c2a4be4ce14785d0a5d6dd1e516c57a838 | [
"BSD-3-Clause"
] | 1 | 2016-05-09T12:21:04.000Z | 2016-05-09T12:21:04.000Z | satchmo/shop/management/commands/satchmo_copy_templates.py | sankroh/satchmo | e48df0c2a4be4ce14785d0a5d6dd1e516c57a838 | [
"BSD-3-Clause"
] | null | null | null | satchmo/shop/management/commands/satchmo_copy_templates.py | sankroh/satchmo | e48df0c2a4be4ce14785d0a5d6dd1e516c57a838 | [
"BSD-3-Clause"
] | null | null | null | from django.core.management.base import NoArgsCommand
import os
import shutil
import string
class Command(NoArgsCommand):
help = "Copy the satchmo template directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
template_src = os.path.join(satchmo.__path__... | 37.954545 | 89 | 0.651497 |
4151c9965ab20ef67a807f364b7fe047bd4eecdf | 279 | py | Python | pytest/testdata/tests/module.py | drew-512/gpython | 12886a2728c232f1fef7b758a1d0f4ff1934e522 | [
"BSD-3-Clause"
] | 65 | 2018-08-01T21:11:57.000Z | 2018-08-19T08:58:34.000Z | pytest/testdata/tests/module.py | drew-512/gpython | 12886a2728c232f1fef7b758a1d0f4ff1934e522 | [
"BSD-3-Clause"
] | 3 | 2018-08-04T10:09:53.000Z | 2018-08-20T18:52:08.000Z | pytest/testdata/tests/module.py | drew-512/gpython | 12886a2728c232f1fef7b758a1d0f4ff1934e522 | [
"BSD-3-Clause"
] | 3 | 2018-08-02T19:57:46.000Z | 2018-08-03T03:40:31.000Z | # Copyright 2022 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from libtest import testFunc
doc="module"
assert True
assert not False
assert testFunc() is None
doc="finished"
| 21.461538 | 61 | 0.767025 |
08b842211820218fba67a461ac3d4ec558c50c0e | 524 | py | Python | src/models/group.py | suneettipirneni/hackathon-2021-backend | 18df5ce348303900cefa21cc88cc56e1b07dc562 | [
"MIT"
] | null | null | null | src/models/group.py | suneettipirneni/hackathon-2021-backend | 18df5ce348303900cefa21cc88cc56e1b07dc562 | [
"MIT"
] | null | null | null | src/models/group.py | suneettipirneni/hackathon-2021-backend | 18df5ce348303900cefa21cc88cc56e1b07dc562 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
src.models.group
~~~~~~~~~~~~~~~~
Model definition for Groups
Classes:
Group
"""
from datetime import datetime
from src import db
from src.models import BaseDocument
from src.models.hacker import Hacker
class Group(BaseDocument):
name = db.StringField(unique=... | 21.833333 | 53 | 0.677481 |
213576c8fac157ffcd29d25e3b7c3996a9f00f63 | 2,316 | py | Python | test/test_evaluate/test_namespace_package.py | asmeurer/jedi | 93500c3f72519cc2f0414efeeec46395f45e4905 | [
"MIT"
] | 239 | 2018-04-20T06:58:32.000Z | 2022-03-22T18:06:08.000Z | test/test_evaluate/test_namespace_package.py | asmeurer/jedi | 93500c3f72519cc2f0414efeeec46395f45e4905 | [
"MIT"
] | 10 | 2018-12-09T13:49:06.000Z | 2021-07-03T00:38:53.000Z | test/test_evaluate/test_namespace_package.py | asmeurer/jedi | 93500c3f72519cc2f0414efeeec46395f45e4905 | [
"MIT"
] | 99 | 2018-07-20T09:16:13.000Z | 2022-03-20T11:58:56.000Z | import jedi
import sys
from os.path import dirname, join
def test_namespace_package():
sys.path.insert(0, join(dirname(__file__), 'namespace_package/ns1'))
sys.path.insert(1, join(dirname(__file__), 'namespace_package/ns2'))
try:
# goto definition
assert jedi.Script('from pkg import ns1_fi... | 41.357143 | 77 | 0.57772 |
2fc3fae454fbfb0ed4d198cf78caf157ca51caa4 | 266 | py | Python | vvlab/agents/__init__.py | LampV/Reinforcement-Learning | 0652b9e8c2de428d3508074c6fd640cc14f84a2c | [
"MIT"
] | 3 | 2019-12-26T11:46:21.000Z | 2020-09-02T10:59:46.000Z | vvlab/agents/__init__.py | LampV/Reinforcement-Learning | 0652b9e8c2de428d3508074c6fd640cc14f84a2c | [
"MIT"
] | 13 | 2021-04-05T13:10:25.000Z | 2022-03-12T00:51:15.000Z | vvlab/agents/__init__.py | LampV/Reinforcement-Learning | 0652b9e8c2de428d3508074c6fd640cc14f84a2c | [
"MIT"
] | 3 | 2020-09-28T01:26:37.000Z | 2020-10-14T06:15:53.000Z | #!/usr/bin/env python
# coding=utf-8
"""
@author: Jiawei Wu
@create time: 2019-12-06 23:16
@edit time: 2020-11-23 17:29
@FilePath: /vvlab/vvlab/agents/__init__.py
"""
from .DDPG_base import DDPGBase
from .DQN_base import DQNBase
from .Linear_base import LinearBase | 20.461538 | 42 | 0.744361 |
df5498ab247245ed638f96e30811e09ecfaa3cdf | 2,000 | py | Python | mkt/langpacks/migrations/0002_auto_20150824_0820.py | diox/zamboni | 3d3bebdffe034a5cd97a66cedc32a598264c2e42 | [
"BSD-3-Clause"
] | null | null | null | mkt/langpacks/migrations/0002_auto_20150824_0820.py | diox/zamboni | 3d3bebdffe034a5cd97a66cedc32a598264c2e42 | [
"BSD-3-Clause"
] | null | null | null | mkt/langpacks/migrations/0002_auto_20150824_0820.py | diox/zamboni | 3d3bebdffe034a5cd97a66cedc32a598264c2e42 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('langpacks', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='langpack',
name='la... | 95.238095 | 1,618 | 0.601 |
0103e2a34ad9f2ddfdbc797d7146e4e21673ab98 | 1,878 | py | Python | rurina4/node/node.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina4/node/node.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina4/node/node.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | from nodes.camera import get_active_camera
from constants import MAX_ALPHA
from ._node import _Node
class Node(_Node):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@property
def rscalex(self):
if get_active_camera():
return self.fscalex * get_active_c... | 21.837209 | 76 | 0.604366 |
696bcf6803bbd4519fe6883eafddf5eeb4fa94a2 | 708 | py | Python | config.py | jiazhuangle/goalkeeper | cbae3ce79ebe3e869ea37fc451a196fee43bfb1c | [
"MIT"
] | 2 | 2019-07-18T07:32:36.000Z | 2019-07-18T07:34:16.000Z | config.py | jiazhuangle/goalkeeper | cbae3ce79ebe3e869ea37fc451a196fee43bfb1c | [
"MIT"
] | null | null | null | config.py | jiazhuangle/goalkeeper | cbae3ce79ebe3e869ea37fc451a196fee43bfb1c | [
"MIT"
] | 1 | 2019-07-19T02:45:01.000Z | 2019-07-19T02:45:01.000Z | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///'... | 35.4 | 71 | 0.711864 |
720958b46420153e7293d5f3fa3b09b8217949d8 | 2,029 | py | Python | global_custom/custom/python/purchase_order.py | KaviyaPeriyasamy/global_custom | 06952896ab06c265907153ad0d8bc467cefb9e1a | [
"MIT"
] | null | null | null | global_custom/custom/python/purchase_order.py | KaviyaPeriyasamy/global_custom | 06952896ab06c265907153ad0d8bc467cefb9e1a | [
"MIT"
] | null | null | null | global_custom/custom/python/purchase_order.py | KaviyaPeriyasamy/global_custom | 06952896ab06c265907153ad0d8bc467cefb9e1a | [
"MIT"
] | null | null | null | from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
import frappe
def make_custom_fields(update=True):
custom_fields = {
"Purchase Order": [
{
"fieldname": "po_itemwise_rate_details",
"label": "Itemwise Rate Details",
... | 33.262295 | 146 | 0.598324 |
d4844f461bc0589ed91db14c0b664d80f976cb8f | 5,308 | py | Python | LoliBot/cogs/reddit.py | Aiyumii/KawaiiSoup | 929f1d58183e01993ca9f7a4647433231e65c3ad | [
"MIT"
] | null | null | null | LoliBot/cogs/reddit.py | Aiyumii/KawaiiSoup | 929f1d58183e01993ca9f7a4647433231e65c3ad | [
"MIT"
] | null | null | null | LoliBot/cogs/reddit.py | Aiyumii/KawaiiSoup | 929f1d58183e01993ca9f7a4647433231e65c3ad | [
"MIT"
] | null | null | null | from discord.ext.commands import bot
from lxml import html
import random
import requests
from bs4 import BeautifulSoup
from LoliBot import checks
# Warning, this cog sucks so much but hopefully it works and doesn't break the bot too much. Just lazily edited old code and bodged it into this one.
# There is redundant ... | 31.040936 | 156 | 0.673323 |
d6481a1794d2afe953ce98de8290f4da0e3e5fad | 1,450 | py | Python | OscopeBootstrap/create_edge_network_represention.py | alexisboukouvalas/OscoNet | f100d1ccfe8f7dad050a3082773a4b6383a4994a | [
"MIT"
] | 1 | 2020-09-03T10:00:44.000Z | 2020-09-03T10:00:44.000Z | OscopeBootstrap/create_edge_network_represention.py | alexisboukouvalas/OscoNet | f100d1ccfe8f7dad050a3082773a4b6383a4994a | [
"MIT"
] | 1 | 2022-02-10T02:22:05.000Z | 2022-02-10T02:22:05.000Z | OscopeBootstrap/create_edge_network_represention.py | alexisboukouvalas/OscoNet | f100d1ccfe8f7dad050a3082773a4b6383a4994a | [
"MIT"
] | 1 | 2019-09-25T16:44:30.000Z | 2019-09-25T16:44:30.000Z | import numpy as np
import pandas as pd
def create_edge_network_representation(adjMatrixBootstrap, weight_matrix, gene_names):
"""
CreateEdgeNetwork - Create Edge file.
This is needed before hypothesis test q-value derived adjacency matrix
can be consumed by R network analysis code.
... | 41.428571 | 101 | 0.673793 |
0237da15cf45b0c84a96b64a94ed68199720e602 | 1,421 | py | Python | setup.py | Super-Breatook/conffey | 40bb3690abebec7eef0c62e49ab14197e97d8e11 | [
"BSD-3-Clause"
] | 1 | 2020-08-09T03:33:14.000Z | 2020-08-09T03:33:14.000Z | setup.py | Super-Breatook/conffey | 40bb3690abebec7eef0c62e49ab14197e97d8e11 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Super-Breatook/conffey | 40bb3690abebec7eef0c62e49ab14197e97d8e11 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
from conffey import __version__
def read_requirements(filename):
res = []
for line in open(filename).read().splitlines():
if not line.startswith('#'):
res.append(line.strip())
return res
setup(
name='conffey',
version=__version__,
description=... | 31.577778 | 70 | 0.627727 |
2fbe52fdad814cbc96431985f30395dbc0d9e4df | 954 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/WGL/DL/stereo_control.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 3 | 2019-04-01T11:03:04.000Z | 2019-12-31T02:17:15.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/WGL/DL/stereo_control.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 1 | 2021-04-15T18:46:45.000Z | 2021-04-15T18:46:45.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/WGL/DL/stereo_control.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 1 | 2018-06-07T22:31:11.000Z | 2018-06-07T22:31:11.000Z | '''OpenGL extension DL.stereo_control
This module customises the behaviour of the
OpenGL.raw.WGL.DL.stereo_control to provide a more
Python-friendly API
Overview (from the spec)
The stereo extension provides an interface for manipulating the
emitter signal from the video adapter used to drive lcd shutter
gla... | 32.896552 | 71 | 0.803983 |
04f4dfd4dfe2776034347b348473703bddbfb974 | 845 | py | Python | mmlab_api/api_detectron2/alt_detectron2.py | quantran14/hatdieu-api | 56b63dce14c4010ff81c05f36da9643d571daa54 | [
"MIT"
] | 2 | 2020-01-24T10:38:30.000Z | 2020-07-17T08:20:38.000Z | mmlab_api/api_detectron2/alt_detectron2.py | quantran14/hatdieu-api | 56b63dce14c4010ff81c05f36da9643d571daa54 | [
"MIT"
] | 14 | 2020-06-05T20:22:33.000Z | 2022-03-12T00:10:39.000Z | mmlab_api/api_detectron2/alt_detectron2.py | quantran14/hatdieu-api | 56b63dce14c4010ff81c05f36da9643d571daa54 | [
"MIT"
] | 1 | 2020-07-20T01:37:22.000Z | 2020-07-20T01:37:22.000Z | import torch
from detectron2.config import get_cfg
def setup_cfg_for_predict(config_file, weights_file=None, confidence_threshold=None, cpu=False):
"""
load config from file. These model train/val using COCO dataset 2017
"""
cfg = get_cfg()
cfg.merge_from_file(config_file)
if confidence_t... | 30.178571 | 96 | 0.71716 |
e1e16ef96e3ed102b9f4ae835ea67aaebce58df1 | 72 | py | Python | src/secml/ml/classifiers/pytorch/tests/__init__.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 63 | 2020-04-20T16:31:16.000Z | 2022-03-29T01:05:35.000Z | src/secml/ml/classifiers/pytorch/tests/__init__.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 5 | 2020-04-21T11:31:39.000Z | 2022-03-24T13:42:56.000Z | src/secml/ml/classifiers/pytorch/tests/__init__.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 8 | 2020-04-21T09:16:42.000Z | 2022-02-23T16:28:43.000Z | from .c_classifier_pytorch_testcases import CClassifierPyTorchTestCases
| 36 | 71 | 0.930556 |
32cdfbb4fa7e3a7fae6a5ea945f70ffeb71f7392 | 695 | py | Python | app/schemas/telegram.py | germainlefebvre4/cryptobot-api | 6b8f10554bbb50ac669c8f8a87414c9292fc9d7b | [
"MIT"
] | null | null | null | app/schemas/telegram.py | germainlefebvre4/cryptobot-api | 6b8f10554bbb50ac669c8f8a87414c9292fc9d7b | [
"MIT"
] | 8 | 2021-09-28T12:55:38.000Z | 2022-01-05T22:45:20.000Z | app/schemas/telegram.py | germainlefebvre4/cryptobot-api | 6b8f10554bbb50ac669c8f8a87414c9292fc9d7b | [
"MIT"
] | null | null | null | from typing import Optional
from datetime import date, datetime
from pydantic import BaseModel
from app.schemas.user import User
class TelegramBase(BaseModel):
client_id: str
token: str
class TelegramCreate(TelegramBase):
client_id: str
token: str
class TelegramUpdate(BaseModel):
client_id: s... | 15.108696 | 37 | 0.713669 |
148277284f462db6d31a6675c6f933f800c684ad | 15,973 | py | Python | tests/test_crawler.py | danrneal/nyt-bestsellers-crawler | a7d6ad77c46f479f5ec032963a61ebc1d34c2828 | [
"MIT"
] | null | null | null | tests/test_crawler.py | danrneal/nyt-bestsellers-crawler | a7d6ad77c46f479f5ec032963a61ebc1d34c2828 | [
"MIT"
] | null | null | null | tests/test_crawler.py | danrneal/nyt-bestsellers-crawler | a7d6ad77c46f479f5ec032963a61ebc1d34c2828 | [
"MIT"
] | null | null | null | import datetime
import json
import unittest
from unittest.mock import mock_open, patch
import crawler
@patch('requests.get')
@patch('crawler.datetime')
@patch('builtins.print')
@patch('time.sleep')
class ApiCallTest(unittest.TestCase):
def setUp(self):
crawler.API_CALLS = []
def test_requests_page(
... | 35.654018 | 80 | 0.560508 |
7430a48352436caefd11e079771fc100a8bf50d1 | 151 | py | Python | Pointer/main.py | goigarg/Algorithm-Practice | aef93dd1ff3d9a476aae72e8dfcae209ebddd4f6 | [
"MIT"
] | null | null | null | Pointer/main.py | goigarg/Algorithm-Practice | aef93dd1ff3d9a476aae72e8dfcae209ebddd4f6 | [
"MIT"
] | null | null | null | Pointer/main.py | goigarg/Algorithm-Practice | aef93dd1ff3d9a476aae72e8dfcae209ebddd4f6 | [
"MIT"
] | null | null | null | # x will not change when y is
x = 5
y = x
y = 6 # re-assigning what li POINTS TO, does not
# change the value of the ORIGINAL variable x
print(x)
| 13.727273 | 49 | 0.668874 |
0169671bdb1447bc1e793dc860aa55d41e5cb487 | 5,336 | py | Python | ckeditor/views.py | xmedia-systems/django-ckeditor | 62c3426d93f66628a524803c7d7a42c34511d4e5 | [
"BSD-3-Clause"
] | null | null | null | ckeditor/views.py | xmedia-systems/django-ckeditor | 62c3426d93f66628a524803c7d7a42c34511d4e5 | [
"BSD-3-Clause"
] | null | null | null | ckeditor/views.py | xmedia-systems/django-ckeditor | 62c3426d93f66628a524803c7d7a42c34511d4e5 | [
"BSD-3-Clause"
] | null | null | null | import os
import re
from urlparse import urlparse, urlunparse, urljoin
from datetime import datetime
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from urllib import pathname2url
try:
from PIL impor... | 30.666667 | 94 | 0.683096 |
1a2a8d4fea90df89c39b53953b64dbda47b05b64 | 1,669 | py | Python | cmd_manager/filters.py | OrangeChannel/Tsuzuru-Bot | ac410708680f1f148ba52c323b41b70d3ec250dc | [
"MIT"
] | null | null | null | cmd_manager/filters.py | OrangeChannel/Tsuzuru-Bot | ac410708680f1f148ba52c323b41b70d3ec250dc | [
"MIT"
] | null | null | null | cmd_manager/filters.py | OrangeChannel/Tsuzuru-Bot | ac410708680f1f148ba52c323b41b70d3ec250dc | [
"MIT"
] | null | null | null | import asyncio
import random
from utils import punish_user
from config.globals import *
from handle_messages import private_msg, delete_user_message
def is_ex_bot_channel(message):
if message.channel.id == EX_BOT_CHANNEL:
return True
asyncio.ensure_future(private_msg(message, "Stop using this command ... | 33.38 | 117 | 0.744158 |
9d0f4070cefa9fab51bc9908565b051a50a61ce3 | 14,024 | py | Python | irekua_database/models/items/items.py | CONABIO-audio/irekua-database | abaf3eb3c5273cdb973c7ac1b921ab2f9759042c | [
"BSD-4-Clause"
] | null | null | null | irekua_database/models/items/items.py | CONABIO-audio/irekua-database | abaf3eb3c5273cdb973c7ac1b921ab2f9759042c | [
"BSD-4-Clause"
] | 18 | 2019-10-31T21:41:42.000Z | 2022-03-12T00:03:54.000Z | irekua_database/models/items/items.py | IslasGECI/irekua-database | abaf3eb3c5273cdb973c7ac1b921ab2f9759042c | [
"BSD-4-Clause"
] | 1 | 2021-05-06T19:38:21.000Z | 2021-05-06T19:38:21.000Z | import os
import mimetypes
from django.conf import settings
from django.db.models import JSONField
from django.core.exceptions import ValidationError
from django.utils import timezone
from pytz import timezone as pytz_timezone
from django.db import models
from django.core.validators import MaxValueValidator, MinValueV... | 32.689977 | 103 | 0.628066 |
8ef5c58b6413ce7cee81fa3db7ed485ea2b448c4 | 737 | py | Python | scripts/tests/test_calculate_scarp_profile.py | mshodge/sparta | d64197d4f141269ef011525a78da5acde9d04aca | [
"MIT"
] | null | null | null | scripts/tests/test_calculate_scarp_profile.py | mshodge/sparta | d64197d4f141269ef011525a78da5acde9d04aca | [
"MIT"
] | 1 | 2022-03-02T12:16:15.000Z | 2022-03-02T12:16:15.000Z | scripts/tests/test_calculate_scarp_profile.py | mshodge/sparta | d64197d4f141269ef011525a78da5acde9d04aca | [
"MIT"
] | null | null | null | import pytest
from scripts.calculate_scarp_profile import calculate_scarp_profile
from scripts.tests.utils.create_data import create_profile_for_calculating_scarp_morphology
def test_height():
df, crest, base = create_profile_for_calculating_scarp_morphology()
height, width, slope = calculate_scarp_profile(df... | 38.789474 | 91 | 0.776119 |
9d4cea8ffd617ba2a73be5cfa50bf53e1c226b59 | 2,076 | py | Python | docs/source/conf.py | kristianeschenburg/curibio.sdk | 17881eb43895cc8cb8fa89092eb9a52ef734c483 | [
"MIT"
] | null | null | null | docs/source/conf.py | kristianeschenburg/curibio.sdk | 17881eb43895cc8cb8fa89092eb9a52ef734c483 | [
"MIT"
] | 106 | 2020-05-29T14:21:10.000Z | 2021-11-10T00:44:00.000Z | docs/source/conf.py | kristianeschenburg/curibio.sdk | 17881eb43895cc8cb8fa89092eb9a52ef734c483 | [
"MIT"
] | 1 | 2021-07-01T16:26:49.000Z | 2021-07-01T16:26:49.000Z | # -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from typing import List
# -- Path setup ----------------------... | 32.4375 | 79 | 0.658478 |
d94f369aba7ad4469b5b073419a2a068fb5ffaab | 147 | py | Python | virtual/bin/django-admin.py | BrendaMwiza/Gallery-app | 5dacf1bc46b406a0adf48ea37a8c8d6fc48d5979 | [
"MIT"
] | null | null | null | virtual/bin/django-admin.py | BrendaMwiza/Gallery-app | 5dacf1bc46b406a0adf48ea37a8c8d6fc48d5979 | [
"MIT"
] | 2 | 2021-06-08T20:27:21.000Z | 2021-09-08T01:20:46.000Z | virtual/bin/django-admin.py | BrendaMwiza/Gallery-app | 5dacf1bc46b406a0adf48ea37a8c8d6fc48d5979 | [
"MIT"
] | null | null | null | #!/home/mwiza/gallery/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 24.5 | 42 | 0.782313 |
e1d5e850779e64a0b236a61f3c991e0db23b75a0 | 3,879 | py | Python | z_art/data_visual/app.py | PeaceLaced/tda-art | 94ad9e8aa3d1183bc511a0ec9cc4e7656d1d8ac0 | [
"MIT"
] | 8 | 2021-12-02T03:24:37.000Z | 2022-01-31T20:48:19.000Z | z_art/data_visual/app.py | PeaceLaced/tda-art | 94ad9e8aa3d1183bc511a0ec9cc4e7656d1d8ac0 | [
"MIT"
] | null | null | null | z_art/data_visual/app.py | PeaceLaced/tda-art | 94ad9e8aa3d1183bc511a0ec9cc4e7656d1d8ac0 | [
"MIT"
] | 1 | 2022-01-11T03:22:20.000Z | 2022-01-11T03:22:20.000Z | # -*- coding: utf-8 -*-
'''
https://github.com/theo-brown/dash-examples/blob/7dbd25c758b370dbbbae454cb147d64ea0ea2d95/basic-realtime-plot.py
'''
import dash
import plotly.express as px
import plotly.graph_objects as go
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import ... | 34.633929 | 112 | 0.603506 |
1b34764e3e953f9ea24f51c1284a434cbbefed20 | 224 | py | Python | news/admin.py | Krasivaya/The-Moringa-Trribune4 | 4cf6b027125ab9091d87cfed9987acf8ab56b1e5 | [
"MIT"
] | null | null | null | news/admin.py | Krasivaya/The-Moringa-Trribune4 | 4cf6b027125ab9091d87cfed9987acf8ab56b1e5 | [
"MIT"
] | 6 | 2020-06-05T23:52:11.000Z | 2022-03-12T00:03:42.000Z | news/admin.py | Krasivaya/The-Moringa-Trribune4 | 4cf6b027125ab9091d87cfed9987acf8ab56b1e5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Article,tags
class ArticleAdmin(admin.ModelAdmin):
filter_horizontal = ('tags',)
# admin.site.register(Editor)
admin.site.register(Article)
admin.site.register(tags) | 24.888889 | 37 | 0.785714 |
2876997cc5f5d4a376fe8bebeb999d3f9903678c | 5,484 | py | Python | last_tcp.py | tszdanger/NUS_ALL | 2b38cce6c0aeebed4bbd211e3e29565c66084cf6 | [
"MIT"
] | 1 | 2020-03-14T15:58:44.000Z | 2020-03-14T15:58:44.000Z | last_tcp.py | tszdanger/NUS_ALL | 2b38cce6c0aeebed4bbd211e3e29565c66084cf6 | [
"MIT"
] | null | null | null | last_tcp.py | tszdanger/NUS_ALL | 2b38cce6c0aeebed4bbd211e3e29565c66084cf6 | [
"MIT"
] | null | null | null | '''
这是可以用的!
'''
from __future__ import print_function
from socket import *
import os
import paho.mqtt.client as mqtt
import time
import wave
import numpy as np
from keras.models import load_model
import pyaudio
from PIL import Image
from imageai.Detection import ObjectDetection
import sy... | 30.131868 | 254 | 0.590627 |
aa0d84716f97be0ca06f395767b9b69e12886074 | 12,521 | py | Python | l5kit/l5kit/visualization/visualizer/zarr_utils.py | Aspirisha/l5kit | 40ed7576f803e83fc3f0714e6458635f9f6bfe60 | [
"Apache-2.0"
] | null | null | null | l5kit/l5kit/visualization/visualizer/zarr_utils.py | Aspirisha/l5kit | 40ed7576f803e83fc3f0714e6458635f9f6bfe60 | [
"Apache-2.0"
] | null | null | null | l5kit/l5kit/visualization/visualizer/zarr_utils.py | Aspirisha/l5kit | 40ed7576f803e83fc3f0714e6458635f9f6bfe60 | [
"Apache-2.0"
] | 1 | 2021-07-20T15:23:16.000Z | 2021-07-20T15:23:16.000Z | from typing import List, Tuple
import numpy as np
from l5kit.data import ChunkedDataset
from l5kit.data.filter import (filter_agents_by_frames, filter_agents_by_labels, filter_tl_faces_by_frames,
filter_tl_faces_by_status)
from l5kit.data.labels import PERCEPTION_LABELS
from l5kit.data.... | 49.686508 | 116 | 0.625349 |
a6f57a10c990d08e1496a4f7d07bc693ba942642 | 65,145 | py | Python | localstack/utils/cloudformation/template_deployer.py | kokizzu/localstack | 2080d292bd27816dc67b35c5ec58eb1272be40d7 | [
"Apache-2.0"
] | null | null | null | localstack/utils/cloudformation/template_deployer.py | kokizzu/localstack | 2080d292bd27816dc67b35c5ec58eb1272be40d7 | [
"Apache-2.0"
] | null | null | null | localstack/utils/cloudformation/template_deployer.py | kokizzu/localstack | 2080d292bd27816dc67b35c5ec58eb1272be40d7 | [
"Apache-2.0"
] | null | null | null | import base64
import copy
import json
import logging
import re
import traceback
from typing import Dict, Optional
import botocore
from moto.ec2.utils import generate_route_id
from localstack import config
from localstack.constants import FALSE_STRINGS, S3_STATIC_WEBSITE_HOSTNAME, TEST_AWS_ACCOUNT_ID
from localstack.s... | 38.823004 | 120 | 0.622197 |
bb9556d288b7e77860413533bc99b34e24455841 | 3,036 | py | Python | contrib/linearize/linearize-hashes.py | meowmeowchain/meowmeowcoin | 26c661f64bdcc699175144fb912ff6972d36cd96 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | meowmeowchain/meowmeowcoin | 26c661f64bdcc699175144fb912ff6972d36cd96 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | meowmeowchain/meowmeowcoin | 26c661f64bdcc699175144fb912ff6972d36cd96 | [
"MIT"
] | 1 | 2018-02-26T11:05:26.000Z | 2018-02-26T11:05:26.000Z | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pri... | 26.631579 | 90 | 0.682477 |
a0bd7e1c90130c106c7622c7e4ea10b9889aa391 | 6,808 | py | Python | platform/gsutil/gslib/tests/test_defacl.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | null | null | null | platform/gsutil/gslib/tests/test_defacl.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | null | null | null | platform/gsutil/gslib/tests/test_defacl.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:04:47.000Z | 2020-07-24T20:04:47.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 42.55 | 78 | 0.679201 |
1243712865aea1f6df050a46ddf79fa365460087 | 8,549 | py | Python | varconlib/scripts/modify_stars.py | DBerke/varconlib | 4771cf315c8fa76e1982612f3ac520c0cec098d8 | [
"MIT"
] | null | null | null | varconlib/scripts/modify_stars.py | DBerke/varconlib | 4771cf315c8fa76e1982612f3ac520c0cec098d8 | [
"MIT"
] | null | null | null | varconlib/scripts/modify_stars.py | DBerke/varconlib | 4771cf315c8fa76e1982612f3ac520c0cec098d8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 5 11:58:04 2021
@author: dberke
Make changes to the data in star.Star objects, up to rebuilding them entirely.
"""
import argparse
from functools import partial
from glob import glob
from json.decoder import JSONDecodeError
import lzma
from multi... | 34.059761 | 80 | 0.608375 |
880b446c4003ff94b4356e5d4ea4c6a9a1cf066a | 371 | py | Python | ocm_test_case/users/urls.py | DivinytyToffee/ocm_test_case | 448d1651f963bb9a65045e8683f074a2b1d85229 | [
"MIT"
] | null | null | null | ocm_test_case/users/urls.py | DivinytyToffee/ocm_test_case | 448d1651f963bb9a65045e8683f074a2b1d85229 | [
"MIT"
] | 5 | 2022-02-28T23:35:24.000Z | 2022-03-31T23:30:17.000Z | ocm_test_case/users/urls.py | DivinytyToffee/ocm_test_case | 448d1651f963bb9a65045e8683f074a2b1d85229 | [
"MIT"
] | null | null | null | from django.urls import path
from ocm_test_case.users.views import (
user_detail_view,
user_redirect_view,
user_update_view,
)
app_name = "users"
urlpatterns = [
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~update/", view=user_update_view, name="update"),
path("<str:use... | 24.733333 | 66 | 0.706199 |
aeb0431f2ee9a66395cfa2ff579b0b6cd2498014 | 4,044 | py | Python | util/visualizer.py | megvii-research/GeneGAN | 8a1ba544481978c6f5513e7eed5f11622ad3976f | [
"MIT"
] | 5 | 2021-08-08T17:28:00.000Z | 2022-02-18T03:20:56.000Z | util/visualizer.py | megvii-research/GeneGAN | 8a1ba544481978c6f5513e7eed5f11622ad3976f | [
"MIT"
] | null | null | null | util/visualizer.py | megvii-research/GeneGAN | 8a1ba544481978c6f5513e7eed5f11622ad3976f | [
"MIT"
] | 2 | 2021-08-15T15:38:25.000Z | 2021-08-15T21:21:30.000Z | import numpy as np
import os
import time
from . import util
from torch.utils.tensorboard import SummaryWriter
class Visualizer:
"""This class includes several functions that can display/save images and print/save logging information.
It uses a Python library 'tensorboard' for display.
"""
def __init... | 39.262136 | 110 | 0.598417 |
7b20270728d12baecc14f1dc7130a8f2b25d381b | 3,628 | py | Python | test/student/test_record_student.py | StoDevX/stograde | 5b4cd58724e8e5218c7a7f2cc2d4f788e71a7931 | [
"MIT"
] | 7 | 2016-08-05T00:41:11.000Z | 2019-08-22T11:12:10.000Z | test/student/test_record_student.py | StoDevX/cs251-toolkit | a40f358289d67cce7b24fd557230079fae830b7d | [
"MIT"
] | 145 | 2016-08-04T01:07:11.000Z | 2019-09-09T22:07:13.000Z | test/student/test_record_student.py | stograde/stograde | 17d901a86ff80d20e9f7f798bd27375de34eccb7 | [
"MIT"
] | 3 | 2017-02-06T21:52:46.000Z | 2019-02-18T10:35:01.000Z | import logging
import os
import pytest
from stograde.common import chdir
from stograde.process_assignment.record_result import RecordResult
from stograde.process_assignment.submission_warnings import SubmissionWarnings
from stograde.process_file.file_result import FileResult
from stograde.specs.file_options import Fi... | 43.190476 | 113 | 0.62624 |
86d083a311efe73e7b0541eb8369fee4937f3325 | 49,175 | py | Python | python/proton/_handlers.py | rabih-mourad/qpid-proton | 22a8e50a03520491502988da899762d41d788568 | [
"Apache-2.0"
] | null | null | null | python/proton/_handlers.py | rabih-mourad/qpid-proton | 22a8e50a03520491502988da899762d41d788568 | [
"Apache-2.0"
] | null | null | null | python/proton/_handlers.py | rabih-mourad/qpid-proton | 22a8e50a03520491502988da899762d41d788568 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 34.29219 | 114 | 0.619319 |
3e2b4f818744de59dd95708803bd50673636ee81 | 10,698 | py | Python | subrepos/wtsi-hgi.python-sequencescape-db/sequencescape/tests/sqlalchemy/test_mappers.py | wtsi-hgi/openstack-tenant-cleanup | d998016f44c54666f76f90d8d3efa90e12730fff | [
"MIT"
] | null | null | null | subrepos/wtsi-hgi.python-sequencescape-db/sequencescape/tests/sqlalchemy/test_mappers.py | wtsi-hgi/openstack-tenant-cleanup | d998016f44c54666f76f90d8d3efa90e12730fff | [
"MIT"
] | 7 | 2016-03-03T13:29:44.000Z | 2016-03-15T14:30:48.000Z | subrepos/wtsi-hgi.python-sequencescape-db/sequencescape/tests/sqlalchemy/test_mappers.py | wtsi-hgi/openstack-tenant-cleanup | d998016f44c54666f76f90d8d3efa90e12730fff | [
"MIT"
] | null | null | null | import unittest
from abc import abstractmethod, ABCMeta
from typing import List
from sequencescape._sqlalchemy.database_connector import SQLAlchemyDatabaseConnector
from sequencescape._sqlalchemy.mappers import SQLAlchemyMapper, SQLAlchemySampleMapper, SQLAlchemyStudyMapper, \
SQLAlchemyLibraryMapper, SQLAlchemyWe... | 37.536842 | 121 | 0.726117 |
a6e2a2e24a8ec8af55ae83a67cb8f6215db9f2d9 | 6,351 | py | Python | tests/test_tocdirective.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 2,109 | 2020-05-02T23:47:18.000Z | 2022-03-31T22:16:54.000Z | tests/test_tocdirective.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 1,158 | 2020-04-29T18:07:02.000Z | 2022-03-31T21:50:57.000Z | tests/test_tocdirective.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 360 | 2020-04-29T14:44:49.000Z | 2022-03-31T09:26:23.000Z | import os
import shutil
from pathlib import Path
import pytest
import sphinx
from bs4 import BeautifulSoup
from click.testing import CliRunner
from TexSoup import TexSoup
from jupyter_book.cli.main import build
path_tests = Path(__file__).parent.resolve()
path_books = path_tests.joinpath("books")
path_root = path_te... | 32.403061 | 88 | 0.636593 |
d6ae6c9571c6389e45ea0d359b35250b90312c03 | 1,248 | py | Python | qutip-doc/guide/scripts/floquet_ex1.py | quantshah/quantshah.github.io | d32f33f4090cd356671950701dd3cb58798bf9bf | [
"MIT"
] | null | null | null | qutip-doc/guide/scripts/floquet_ex1.py | quantshah/quantshah.github.io | d32f33f4090cd356671950701dd3cb58798bf9bf | [
"MIT"
] | null | null | null | qutip-doc/guide/scripts/floquet_ex1.py | quantshah/quantshah.github.io | d32f33f4090cd356671950701dd3cb58798bf9bf | [
"MIT"
] | null | null | null | from qutip import *
from scipy import *
delta = 0.2 * 2*pi; eps0 = 1.0 * 2*pi
A = 0.5 * 2*pi; omega = 1.0 * 2*pi
T = (2*pi)/omega
tlist = linspace(0.0, 10 * T, 101)
psi0 = basis(2,0)
H0 = - delta/2.0 * sigmax() - eps0/2.0 * sigmaz()
H1 = A/2.0 * sigmaz()
args = {'w': omega}
H = [H0, [H1, lambda t,args:... | 32.842105 | 81 | 0.64984 |
24def60c6b00ec03f01337726625b7c6cdbf1e0a | 9,226 | py | Python | datasets/Frey.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | datasets/Frey.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | datasets/Frey.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | """
Module for managing Frey faces dataset
"""
import numpy as np
import os.path
import urllib.request
from .ImageDataset import ImageDataset ## TODO Check wiythout point
from scipy.io import loadmat
import pdb
class Frey(ImageDataset):
"""
This class manage the dataset Frey faces, properties of the da... | 39.09322 | 127 | 0.483525 |
96f3d3c26446d1cb4e5c8d751818e51692e17317 | 2,840 | py | Python | silver/models/transactions/codes.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 222 | 2017-01-15T10:30:57.000Z | 2022-03-08T20:34:46.000Z | silver/models/transactions/codes.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 141 | 2017-01-11T10:56:49.000Z | 2021-10-12T11:51:00.000Z | silver/models/transactions/codes.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 76 | 2017-01-10T13:50:27.000Z | 2022-03-25T21:37:00.000Z | # Copyright (c) 2017 Presslabs SRL
#
# 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 writ... | 36.883117 | 95 | 0.669014 |
405888c552be25abc64027e896c8e0c698577202 | 8,459 | py | Python | tests/integration/test_lost_part/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 8,629 | 2016-06-14T21:03:01.000Z | 2019-09-23T07:46:38.000Z | tests/integration/test_lost_part/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 4,335 | 2016-06-15T12:58:31.000Z | 2019-09-23T11:18:43.000Z | tests/integration/test_lost_part/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 1,700 | 2016-06-15T09:25:11.000Z | 2019-09-23T11:16:38.000Z | #!/usr/bin/env python3
import pytest
import time
import ast
import random
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance("node1", with_zookeeper=True)
node2 = cluster.add_instance("node2", with_zook... | 32.786822 | 153 | 0.642866 |
d791c148d21ea31024a77e6c77d768a1b716bcea | 22,369 | py | Python | optable_submission/optable_package/optable/dataset/table.py | pfnet-research/KDD-Cup-AutoML-5 | 54202eb6aa414316a70faa8e07a68e1c8ca7bd1b | [
"MIT"
] | 18 | 2019-07-22T06:35:37.000Z | 2021-03-20T08:37:56.000Z | optable_submission/optable_package/optable/dataset/table.py | pfnet-research/KDD-Cup-AutoML-5 | 54202eb6aa414316a70faa8e07a68e1c8ca7bd1b | [
"MIT"
] | 1 | 2020-03-22T21:06:57.000Z | 2020-03-22T21:06:57.000Z | optable_submission/optable_package/optable/dataset/table.py | pfnet-research/KDD-Cup-AutoML-5 | 54202eb6aa414316a70faa8e07a68e1c8ca7bd1b | [
"MIT"
] | 11 | 2019-07-23T04:06:08.000Z | 2020-05-12T08:44:01.000Z | import collections
import threading
import gc
import traceback
import pandas as pd
import numpy as np
from optable.dataset import feature_types
from optable import _core
class Table(object):
"""avalble for only automl data frame
"""
def __init__(self, df, time_col=None, label_encoders={}, min_time=None)... | 38.042517 | 79 | 0.534758 |
5d9df367fff50523716450c1d4ba55a310094bb2 | 1,657 | py | Python | buhayra/getpaths.py | jmigueldelgado/buhayra | 7236be088f3c3600cfd76650e1f80e0630653fe1 | [
"MIT"
] | 5 | 2018-04-24T20:30:50.000Z | 2021-11-20T15:15:18.000Z | buhayra/getpaths.py | jmigueldelgado/buhayra | 7236be088f3c3600cfd76650e1f80e0630653fe1 | [
"MIT"
] | 50 | 2018-04-12T11:02:46.000Z | 2021-02-05T10:22:33.000Z | buhayra/getpaths.py | jmigueldelgado/buhayra | 7236be088f3c3600cfd76650e1f80e0630653fe1 | [
"MIT"
] | 2 | 2018-04-06T16:05:16.000Z | 2021-08-25T15:34:20.000Z | from os.path import expanduser,exists
import sys
import socket
import os
from buhayra.location import *
### add your hostname and things will run smoothly
if socket.gethostname()=='vouga':
home = {
'home' : expanduser("~"),
'scratch' : os.path.join(expanduser("~"), 'scratch')}
elif socket.gethostna... | 29.070175 | 84 | 0.630054 |
80ce87ed5499a8b624b033430c91c0db8a3d4e99 | 1,149 | py | Python | src/templates/v0.1.9/modules/pyldavis/scripts/zip.py | whatevery1says/we1s-templates | ce16ae4a39e3286ed7d9bf4a95bff001ac2d123e | [
"MIT"
] | null | null | null | src/templates/v0.1.9/modules/pyldavis/scripts/zip.py | whatevery1says/we1s-templates | ce16ae4a39e3286ed7d9bf4a95bff001ac2d123e | [
"MIT"
] | null | null | null | src/templates/v0.1.9/modules/pyldavis/scripts/zip.py | whatevery1says/we1s-templates | ce16ae4a39e3286ed7d9bf4a95bff001ac2d123e | [
"MIT"
] | null | null | null | """zip.py.
Create zip archives of one or more dfr-browsers.
Last update: 2020-07-25
"""
# Python imports
import os
import re
import shutil
from IPython.display import display, HTML
# Zip function
def zip(models=None):
"""Zip pyLDAvis visualizations to the current directory.
The `models` parameter takes... | 31.054054 | 116 | 0.638816 |
143fe1d59c184d30bd16cb56cfe46cc191970ff8 | 33,743 | py | Python | mmdet/models/dense_heads/fcos_reid_head_focal_sub_triqueue3.py | CvlabAssignment/AlignPS | 297f4166921d2095f9381e38e04129a103069406 | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/fcos_reid_head_focal_sub_triqueue3.py | CvlabAssignment/AlignPS | 297f4166921d2095f9381e38e04129a103069406 | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/fcos_reid_head_focal_sub_triqueue3.py | CvlabAssignment/AlignPS | 297f4166921d2095f9381e38e04129a103069406 | [
"Apache-2.0"
] | null | null | null | import re
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import Scale, normal_init
from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
from mmdet.core import distance2bbox, force_fp32, multi_apply, multiclass_nms, multiclass_nms_reid
from ..builder import HEADS, build_lo... | 45.537112 | 134 | 0.568207 |
9f58820fd1300eddcc367e67674e3f152e8d0857 | 2,111 | py | Python | marmot/features/phrase/tests/test_pos_feature_extractor.py | qe-team/marmot | 38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff | [
"0BSD"
] | 19 | 2015-08-21T13:06:37.000Z | 2021-07-26T09:56:29.000Z | marmot/features/phrase/tests/test_pos_feature_extractor.py | qe-team/marmot | 38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff | [
"0BSD"
] | 36 | 2015-01-13T13:01:07.000Z | 2016-06-22T06:59:59.000Z | marmot/features/phrase/tests/test_pos_feature_extractor.py | qe-team/marmot | 38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff | [
"0BSD"
] | 8 | 2015-12-11T16:41:47.000Z | 2019-04-08T16:28:40.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from marmot.features.phrase.pos_feature_extractor import POSFeatureExtractor
# test a class which extracts source and target token count features, and the source/target token count ratio
class POSFeatureExtractorTests(unittest.TestCase):
def setUp(self):... | 37.696429 | 109 | 0.582662 |
ed53da4819086fdaf0a557682d7c4be0c58e4721 | 65,787 | py | Python | n2vc/n2vc_juju_conn.py | TCSOSM-20/N2VC | d99f3f2f67d693c30494be7ad19b97f3f5528961 | [
"Apache-2.0"
] | null | null | null | n2vc/n2vc_juju_conn.py | TCSOSM-20/N2VC | d99f3f2f67d693c30494be7ad19b97f3f5528961 | [
"Apache-2.0"
] | null | null | null | n2vc/n2vc_juju_conn.py | TCSOSM-20/N2VC | d99f3f2f67d693c30494be7ad19b97f3f5528961 | [
"Apache-2.0"
] | null | null | null | ##
# Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U.
# This file is part of OSM
# 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.or... | 35.909934 | 98 | 0.553787 |
73bd1f775f1fc4631196b6923d52f00882d3e8bd | 843 | py | Python | tests/constraints/test_faulting_stress_measurement.py | pnnl/SOSAT | 610f99e0bb80f2f5e7836e7e3b6b816e029838bb | [
"BSD-3-Clause"
] | null | null | null | tests/constraints/test_faulting_stress_measurement.py | pnnl/SOSAT | 610f99e0bb80f2f5e7836e7e3b6b816e029838bb | [
"BSD-3-Clause"
] | 1 | 2021-03-22T18:59:05.000Z | 2021-03-22T18:59:05.000Z | tests/constraints/test_faulting_stress_measurement.py | pnnl/SOSAT | 610f99e0bb80f2f5e7836e7e3b6b816e029838bb | [
"BSD-3-Clause"
] | null | null | null | import pytest
from scipy.stats import uniform
import numpy as np
import matplotlib.pyplot as plt
from SOSAT import StressState
from SOSAT.constraints import StressMeasurement
from SOSAT.constraints import FaultConstraint
# depth in meters
depth = 1228.3
# density in kg/m^3
avg_overburden_density = 2580.0
# pore press... | 26.34375 | 67 | 0.737841 |
6f132afe4146d6ef0a382bfd930b3131f9013b47 | 41 | py | Python | src/models/__init__.py | atgmello/ml-challenge-2020 | 2bf3fc81b96059a2d1e813e6784e21b66760df3b | [
"MIT"
] | 5 | 2020-12-17T13:20:18.000Z | 2021-05-09T01:28:19.000Z | src/models/__init__.py | atgmello/ml-challenge-2020 | 2bf3fc81b96059a2d1e813e6784e21b66760df3b | [
"MIT"
] | null | null | null | src/models/__init__.py | atgmello/ml-challenge-2020 | 2bf3fc81b96059a2d1e813e6784e21b66760df3b | [
"MIT"
] | null | null | null | from .challenge_metric import ndcg_score
| 20.5 | 40 | 0.878049 |
76d6d589708476da6e71807b0c4b7ed621bf6ad1 | 266 | py | Python | myerp/custom/doctype/property_setter/property_setter.py | smthakor1979/MyERP | b05c44ae0054072f2a410381069215d287e7f0ba | [
"MIT"
] | null | null | null | myerp/custom/doctype/property_setter/property_setter.py | smthakor1979/MyERP | b05c44ae0054072f2a410381069215d287e7f0ba | [
"MIT"
] | null | null | null | myerp/custom/doctype/property_setter/property_setter.py | smthakor1979/MyERP | b05c44ae0054072f2a410381069215d287e7f0ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, suresh thakor and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PropertySetter(Document):
pass
| 24.181818 | 52 | 0.778195 |
aaa03234cb6e86de9d7f6a547e73d4d182386741 | 5,367 | py | Python | dataset_reader_v2.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | dataset_reader_v2.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | dataset_reader_v2.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import Dataset
import matplotlib.image as mpimg
from matplotlib import pyplot as plt
from skimage.transform import rescale, resize
import scipy.io
import h5py
import tables
from torch.utils.data import DataLoader
def kron(... | 31.385965 | 137 | 0.505124 |
61c27d56b8f63ab62b4595fe987b77a9f2b357ee | 775 | py | Python | crawling_scraping/chapter02/save_sqlite3.py | mmakmo/python | 74c577f8d688de62b6e6574ea1457a322450ae64 | [
"MIT"
] | null | null | null | crawling_scraping/chapter02/save_sqlite3.py | mmakmo/python | 74c577f8d688de62b6e6574ea1457a322450ae64 | [
"MIT"
] | null | null | null | crawling_scraping/chapter02/save_sqlite3.py | mmakmo/python | 74c577f8d688de62b6e6574ea1457a322450ae64 | [
"MIT"
] | null | null | null | import sqlite3
conn = sqlite3.connect('top_cities.db')
c = conn.cursor()
c.execute('DROP TABLE IF EXISTS cities')
c.execute('''
CREATE TABLE cities (
rank integer,
city text,
population integer
)
''')
c.execute('INSERT INTO cities VALUES (?, ?, ?)', (1, '上海', 24150000))
c.execute('INS... | 25.833333 | 118 | 0.614194 |
49b4e788c06559c0cae74d0cbc80a5167b7f6293 | 1,782 | py | Python | test/modules/md/test_741_setup_errors.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 2,529 | 2015-01-02T11:52:53.000Z | 2022-03-30T19:54:27.000Z | test/modules/md/test_741_setup_errors.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 133 | 2015-04-21T05:50:45.000Z | 2022-03-30T14:23:40.000Z | test/modules/md/test_741_setup_errors.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 1,113 | 2015-01-01T14:47:02.000Z | 2022-03-29T16:47:18.000Z | # test ACME error responses and their processing
import os
import pytest
from .md_conf import MDConf
from .md_env import MDTestEnv
@pytest.mark.skipif(condition=not MDTestEnv.has_acme_server(),
reason="no ACME test server configured")
class TestSetupErrors:
@pytest.fixture(autouse=True, sco... | 36.367347 | 88 | 0.657688 |
3dbe9b22c2a6c7662cbd5d53f840709ef2551e35 | 3,862 | py | Python | src/vision/process_frame_util.py | CornellDataScience/self-driving-car | 449044840abdeed9f547a16cd192950e23ba189c | [
"MIT"
] | 3 | 2021-09-29T21:15:25.000Z | 2021-11-11T20:57:07.000Z | src/vision/process_frame_util.py | CornellDataScience/self-driving-car | 449044840abdeed9f547a16cd192950e23ba189c | [
"MIT"
] | 44 | 2021-09-28T05:38:43.000Z | 2022-03-31T21:29:48.000Z | src/vision/process_frame_util.py | CornellDataScience/self-driving-car | 449044840abdeed9f547a16cd192950e23ba189c | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import math
def get_features(frame):
orb = cv2.ORB_create()
# Replacement for orb.detect(frame, None) Gives many more points
pts = cv2.goodFeaturesToTrack(
np.mean(frame, axis=2).astype(np.uint8), 3000, qualityLevel=0.01, minDistance=7
)
# print("pts: ", al... | 30.171875 | 99 | 0.606163 |
f002c88ce3873b7bdae2bd5e9a946b7d0dfbf75f | 1,862 | py | Python | src/sardana/sardanavalue.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/sardanavalue.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/sardanavalue.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 30.52459 | 91 | 0.619764 |
89924655132eaf8c956b9196e0548e13577be0c7 | 21,912 | py | Python | ep_clustering/kalman_filter/_kalman_filter.py | aicherc/EP_Collapsed_Gibbs | 3b2e8c3addeab2343837b9e86e9cb57b00798b9a | [
"MIT"
] | 1 | 2019-12-14T01:14:56.000Z | 2019-12-14T01:14:56.000Z | ep_clustering/kalman_filter/_kalman_filter.py | aicherc/EP_Collapsed_Gibbs | 3b2e8c3addeab2343837b9e86e9cb57b00798b9a | [
"MIT"
] | null | null | null | ep_clustering/kalman_filter/_kalman_filter.py | aicherc/EP_Collapsed_Gibbs | 3b2e8c3addeab2343837b9e86e9cb57b00798b9a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Likelihood Objects for Gibbs Sampler
"""
# Import Modules
import numpy as np
# Author Information
__author__ = "Christopher Aicher"
class KalmanFilter(object):
""" Kalman Filter Object
N - dimension of state vector
T - number of time points
Args:
y (N by T ndarr... | 34.947368 | 94 | 0.550612 |
d58ffe0b469ae75cb515a71731bb472f9a1c0fcf | 1,028 | py | Python | my_awesome_project/users/admin.py | CoderSaty/my_awesome_project | 0be26e70e1974d3d58d37f760634380a6a170692 | [
"MIT"
] | null | null | null | my_awesome_project/users/admin.py | CoderSaty/my_awesome_project | 0be26e70e1974d3d58d37f760634380a6a170692 | [
"MIT"
] | 16 | 2022-01-25T11:25:04.000Z | 2022-03-31T11:26:21.000Z | my_awesome_project/users/admin.py | CoderSaty/my_awesome_project | 0be26e70e1974d3d58d37f760634380a6a170692 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from my_awesome_project.users.forms import UserAdminChangeForm, UserAdminCreationForm
User = get_user_model()
@admin.register(Use... | 29.371429 | 85 | 0.569066 |
e2abbee5eade9f93305f197db136a68143e31b13 | 10,103 | py | Python | train.py | ihsangkcl/RFM | a3a549add23863bf76f2a9629f73a4bb4d9682a1 | [
"Apache-2.0"
] | null | null | null | train.py | ihsangkcl/RFM | a3a549add23863bf76f2a9629f73a4bb4d9682a1 | [
"Apache-2.0"
] | null | null | null | train.py | ihsangkcl/RFM | a3a549add23863bf76f2a9629f73a4bb4d9682a1 | [
"Apache-2.0"
] | 1 | 2022-01-19T20:25:37.000Z | 2022-01-19T20:25:37.000Z | import torch
from utils.utils import data_prefetcher_two, cal_fam, setup_seed, calRes
from pretrainedmodels import xception
import utils.datasets_profiles as dp
from torch.utils.data import DataLoader
from torch.optim import Adam
import numpy as np
import argparse
import random
import time
np.set_printoptio... | 37.418519 | 204 | 0.558349 |
c7b9172b4bfc356c1d80589467ef26fa3deeaa8c | 2,198 | py | Python | backend/routes/organisation/route.py | amooabeebadesina/nuxt-netlify | edaf0c78ecc85e296452537ad82372c02239253e | [
"MIT"
] | null | null | null | backend/routes/organisation/route.py | amooabeebadesina/nuxt-netlify | edaf0c78ecc85e296452537ad82372c02239253e | [
"MIT"
] | null | null | null | backend/routes/organisation/route.py | amooabeebadesina/nuxt-netlify | edaf0c78ecc85e296452537ad82372c02239253e | [
"MIT"
] | null | null | null | from typing import List
from fastapi import APIRouter, HTTPException, Response, status, Depends
from odmantic import ObjectId
from database.database_methods import Database
from models.organisation.model import Job, JobResponse, JobDetails
from utilities.validate_session import validate_org_session
job_router = APIR... | 31.855072 | 113 | 0.695177 |
f6eb55081a75b770b658c51ee4dc5b294719dd7e | 5,477 | py | Python | pde/fields/tests/test_tensorial.py | noah-ziethen/py-pde | b88e86439290c31284a4ac665a8e9ff34d08b494 | [
"MIT"
] | null | null | null | pde/fields/tests/test_tensorial.py | noah-ziethen/py-pde | b88e86439290c31284a4ac665a8e9ff34d08b494 | [
"MIT"
] | null | null | null | pde/fields/tests/test_tensorial.py | noah-ziethen/py-pde | b88e86439290c31284a4ac665a8e9ff34d08b494 | [
"MIT"
] | null | null | null | '''
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
'''
import numpy as np
import pytest
from .test_generic import iter_grids
from ..tensorial import Tensor2Field
from ..base import FieldBase
from ...grids import UnitGrid, CartesianGrid
def test_tensors():
""" test some tensor calculations """
grid... | 34.23125 | 78 | 0.607267 |
86dc7abdc6e9a6e22a581a2b0ad7208329c4e565 | 3,721 | py | Python | src/util/args.py | xavihart/pixel-nerf | 1009af6a66f1f1a513120d1737e21e6a93ec6c64 | [
"BSD-2-Clause"
] | 1 | 2021-12-14T15:42:12.000Z | 2021-12-14T15:42:12.000Z | src/util/args.py | xavihart/pixel-nerf | 1009af6a66f1f1a513120d1737e21e6a93ec6c64 | [
"BSD-2-Clause"
] | null | null | null | src/util/args.py | xavihart/pixel-nerf | 1009af6a66f1f1a513120d1737e21e6a93ec6c64 | [
"BSD-2-Clause"
] | null | null | null | import sys
import os
import argparse
from pyhocon import ConfigFactory
def parse_args(
callback=None,
training=False,
default_conf="conf/default_mv.conf",
default_expname="example",
default_data_format="dvr",
default_num_epochs=100,
default_lr=1e-4,
default_gamma=1.00,
default_da... | 32.929204 | 97 | 0.649019 |
9006ce18bba659bad8fd7eb81726085dda59b4e4 | 174 | py | Python | gettingstarted/wsgi.py | Daniil-7/Tatem-Avto-Saransk | b348322e10217cdaea873eabfd5c37dd413f54dc | [
"MIT"
] | null | null | null | gettingstarted/wsgi.py | Daniil-7/Tatem-Avto-Saransk | b348322e10217cdaea873eabfd5c37dd413f54dc | [
"MIT"
] | null | null | null | gettingstarted/wsgi.py | Daniil-7/Tatem-Avto-Saransk | b348322e10217cdaea873eabfd5c37dd413f54dc | [
"MIT"
] | null | null | null | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gettingstarted.settings")
application = get_wsgi_application()
| 24.857143 | 74 | 0.83908 |
badecb0eed443c9ef7e550973cf1c5d3c49800ab | 33,249 | py | Python | mmdet/models/dense_heads/cascade_rpn_head.py | hokmund/mmdetection | 7d49b7b535456929333d71a543159a00d7ae2faf | [
"Apache-2.0"
] | 94 | 2021-03-07T01:34:35.000Z | 2022-03-05T15:47:41.000Z | mmdet/models/dense_heads/cascade_rpn_head.py | hokmund/mmdetection | 7d49b7b535456929333d71a543159a00d7ae2faf | [
"Apache-2.0"
] | 13 | 2021-10-09T07:08:17.000Z | 2022-01-06T05:53:45.000Z | mmdet/models/dense_heads/cascade_rpn_head.py | hokmund/mmdetection | 7d49b7b535456929333d71a543159a00d7ae2faf | [
"Apache-2.0"
] | 19 | 2021-06-08T14:04:07.000Z | 2022-01-17T20:06:42.000Z | from __future__ import division
import copy
import warnings
import torch
import torch.nn as nn
from mmcv import ConfigDict
from mmcv.ops import DeformConv2d, batched_nms
from mmcv.runner import BaseModule, ModuleList
from mmdet.core import (RegionAssigner, build_assigner, build_sampler,
images... | 42.301527 | 79 | 0.552618 |
d7b3828e372a6c55bc2d9e7aff06c0f7cd79fa9b | 4,571 | py | Python | vnpy/trader/app/ctaStrategy/strategy/strategyDoubleMa.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 18 | 2019-02-21T05:42:41.000Z | 2022-03-31T10:17:51.000Z | vnpy/trader/app/ctaStrategy/strategy/strategyDoubleMa.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 1 | 2018-06-12T10:08:24.000Z | 2018-06-12T10:08:24.000Z | vnpy/trader/app/ctaStrategy/strategy/strategyDoubleMa.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 5 | 2017-12-20T09:57:17.000Z | 2021-08-01T19:47:14.000Z | # encoding: UTF-8
"""
这里的Demo是一个最简单的双均线策略实现
"""
from __future__ import division
from vnpy.trader.vtConstant import EMPTY_STRING, EMPTY_FLOAT
from vnpy.trader.app.ctaStrategy.ctaTemplate import (CtaTemplate,
BarGenerator,
... | 30.072368 | 86 | 0.429009 |
5b6255b2c504e6bb2c61221dc40eaff55dee5413 | 1,431 | py | Python | templatebot/__main__.py | PascalRoose/tgbot-template | 72c87679e1598629a2739c06d7e69030ddbfd4f6 | [
"MIT"
] | null | null | null | templatebot/__main__.py | PascalRoose/tgbot-template | 72c87679e1598629a2739c06d7e69030ddbfd4f6 | [
"MIT"
] | null | null | null | templatebot/__main__.py | PascalRoose/tgbot-template | 72c87679e1598629a2739c06d7e69030ddbfd4f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from telegram.ext import messagequeue as mq
from telegram.utils import helpers
from telegram.utils.request import Request
from .utils.conf import settings, DIRS, MEMKEY
from .utils.log import init_logger
from .utils.tg import MQBot, get_updater, ... | 33.27907 | 90 | 0.732355 |
2186665e6b4529941795a1bac30cd465f9d7b74e | 6,279 | py | Python | examples/QKD/qkd_eqsn.py | pritamsinha2304/QuNetSim | 65a7486d532816724b5c98cfdcc0910404bfe0e2 | [
"MIT"
] | 61 | 2020-02-15T00:59:20.000Z | 2022-03-08T10:29:23.000Z | examples/QKD/qkd_eqsn.py | pritamsinha2304/QuNetSim | 65a7486d532816724b5c98cfdcc0910404bfe0e2 | [
"MIT"
] | 50 | 2020-01-28T12:18:50.000Z | 2021-12-16T21:38:19.000Z | examples/QKD/qkd_eqsn.py | pritamsinha2304/QuNetSim | 65a7486d532816724b5c98cfdcc0910404bfe0e2 | [
"MIT"
] | 27 | 2020-01-21T12:59:28.000Z | 2022-02-21T14:23:00.000Z | import numpy as np
import random
import time
from qunetsim.components import Host
from qunetsim.components import Network
from qunetsim.objects import Qubit
from qunetsim.objects import Logger
from qunetsim.backends import EQSNBackend
Logger.DISABLED = True
wait_time = 10
# !! Warning: this Crypto algorithm is rea... | 30.480583 | 96 | 0.629877 |
f7caf3e9b395602c33812d4dab7e428005a17d7d | 85 | py | Python | backend/metric/ulca-metric-api/src/services/__init__.py | agupta54/ulca | c1f570ac254ce2ac73f40c49716458f4f7cbaee2 | [
"MIT"
] | 3 | 2022-01-12T06:51:51.000Z | 2022-02-23T18:54:33.000Z | backend/metric/ulca-metric-api/src/services/__init__.py | agupta54/ulca | c1f570ac254ce2ac73f40c49716458f4f7cbaee2 | [
"MIT"
] | 6 | 2021-08-31T19:21:26.000Z | 2022-01-03T05:53:42.000Z | backend/metric/ulca-metric-api/src/services/__init__.py | agupta54/ulca | c1f570ac254ce2ac73f40c49716458f4f7cbaee2 | [
"MIT"
] | 8 | 2021-08-12T08:07:49.000Z | 2022-01-25T04:40:51.000Z | from .metriccronjob import CronProcessor
from .mismatchcron import AlertCronProcessor | 42.5 | 44 | 0.894118 |
5acecf2be0f1820422b92530928b5c26dfadcb89 | 3,271 | py | Python | backend/migrations/versions/6680bd9737cf_.py | kzagorulko/flower-system | 7203862e6366ac08c7be939ef443aa274c04ec63 | [
"MIT"
] | 3 | 2020-10-26T08:54:43.000Z | 2021-05-29T09:55:34.000Z | backend/migrations/versions/6680bd9737cf_.py | kzagorulko/flower-system | 7203862e6366ac08c7be939ef443aa274c04ec63 | [
"MIT"
] | 28 | 2020-10-25T10:20:54.000Z | 2021-02-04T10:51:57.000Z | backend/migrations/versions/6680bd9737cf_.py | kzagorulko/flower-system | 7203862e6366ac08c7be939ef443aa274c04ec63 | [
"MIT"
] | 1 | 2020-11-12T10:07:07.000Z | 2020-11-12T10:07:07.000Z | """added roles, more fields for users
Revision ID: 6680bd9737cf
Revises: 498f307695d6
Create Date: 2020-11-01 15:01:10.385506
"""
from alembic import op
import sqlalchemy as sa
from uuid import uuid4
# revision identifiers, used by Alembic.
revision = '6680bd9737cf'
down_revision = '498f307695d6'
branch_labels = No... | 29.736364 | 72 | 0.602874 |
663a6bd89833d89ea6568a4458d8a2e14abd8641 | 4,037 | py | Python | pearll/models/encoders.py | LondonNode/Anvil | bc50fd7b16af36051157814e2548a98e787b03de | [
"MIT"
] | 13 | 2022-01-17T14:43:05.000Z | 2022-03-10T04:05:36.000Z | pearll/models/encoders.py | LondonNode/Anvil | bc50fd7b16af36051157814e2548a98e787b03de | [
"MIT"
] | 3 | 2022-02-24T18:29:12.000Z | 2022-03-22T11:09:07.000Z | pearll/models/encoders.py | LondonNode/Anvil | bc50fd7b16af36051157814e2548a98e787b03de | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Type
import numpy as np
import torch as T
from gym import spaces
from pearll.common.type_aliases import Tensor
from pearll.common.utils import to_numpy
from pearll.models.utils import preprocess_inputs
class IdentityEncoder(T.nn.Module):
"""This encoder passes the input ... | 32.296 | 110 | 0.640822 |
eec19b0a270d0368a67155f95545f6cb4a27c586 | 232 | py | Python | deepCoral/config.py | Fassial/Air-Writing-with-TL | 9b9047c5bd5aef3a869e2d5166be1c0cf0c5ccf0 | [
"MIT"
] | 1 | 2021-06-16T16:45:01.000Z | 2021-06-16T16:45:01.000Z | deepCoral/config.py | Fassial/Air-Writing-with-TL | 9b9047c5bd5aef3a869e2d5166be1c0cf0c5ccf0 | [
"MIT"
] | null | null | null | deepCoral/config.py | Fassial/Air-Writing-with-TL | 9b9047c5bd5aef3a869e2d5166be1c0cf0c5ccf0 | [
"MIT"
] | 1 | 2020-04-21T01:31:26.000Z | 2020-04-21T01:31:26.000Z | CFG = {
"datapath": "../dataset",
"kwargs": {"n_workers": 4},
"batch_size": 20,
"n_epoches": 20,
"lr": 1e-3,
"momentum": .9,
"log_interval": 10,
"l2_decay": 0,
"lambda": 10,
"backbone": "naive_cnnblstm",
"n_class": 31
}
| 15.466667 | 30 | 0.573276 |
ec32317fc34abfe3179a308b772cda01e15661a5 | 1,421 | py | Python | chapter_5/py_5_11_merge_sort.py | kfrime/algo-in-python | e017dd20385fd9ea2086a72698fbfcb7d706dd86 | [
"MIT"
] | null | null | null | chapter_5/py_5_11_merge_sort.py | kfrime/algo-in-python | e017dd20385fd9ea2086a72698fbfcb7d706dd86 | [
"MIT"
] | null | null | null | chapter_5/py_5_11_merge_sort.py | kfrime/algo-in-python | e017dd20385fd9ea2086a72698fbfcb7d706dd86 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
5.11 归并排序
"""
from __future__ import print_function
def merge_sort(alist):
"""
归并排序是一种递归算法,不断将列表拆分为一半。
如果列表为空或有一个项,则按定义(基本情况)进行排序。
如果列表有多个项,我们分割列表,并递归调用两个半部分的合并排序。
一旦对这两半排序完成,就执行合并操作。
合并是获取两个较小的排序列表并将它们组合成单个排序的新列表的过程。
O(nlog^n)
"""
print("Splitting ",... | 20.3 | 57 | 0.508797 |
bcfb66caf5352bd01b439eb7f7f07d216623919a | 6,533 | py | Python | src/finmag/util/versions.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 10 | 2018-03-24T07:43:17.000Z | 2022-03-26T10:42:27.000Z | src/finmag/util/versions.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 21 | 2018-03-26T15:08:53.000Z | 2021-07-10T16:11:14.000Z | src/finmag/util/versions.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 7 | 2018-04-09T11:50:48.000Z | 2021-06-10T09:23:25.000Z | import os
import re
import sh
import sys
import logging
import finmag
logger = logging.getLogger('finmag')
def get_linux_issue():
try:
f = open("/etc/issue")
except IOError:
logger.error("Can't read /etc/issue -- this is odd?")
raise RuntimeError("Cannot establish linux version")
i... | 31.109524 | 91 | 0.651462 |
2042b01c1eb81f3808555cd623e984970ef80393 | 1,717 | py | Python | model/user.py | maximatorrus/automated_testing_python | 259f0c9a94bbe81b6a8d2076aeed66054c73ea45 | [
"Apache-2.0"
] | null | null | null | model/user.py | maximatorrus/automated_testing_python | 259f0c9a94bbe81b6a8d2076aeed66054c73ea45 | [
"Apache-2.0"
] | null | null | null | model/user.py | maximatorrus/automated_testing_python | 259f0c9a94bbe81b6a8d2076aeed66054c73ea45 | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class User:
def __init__(self, firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None,
address=None, telephone=None, mobile=None, work=None, fax=None, email_=None, email2=None, email3=None,
homepage=None, byear=None, ayear... | 35.770833 | 119 | 0.624927 |
e301612a559918174491b08498c275178d00627b | 6,832 | py | Python | bert_onnx.py | MatRazor/ONNXRuntime_tutorial_collection | 9fe46311896391f769a51cc4d07814e6bfafd8ee | [
"MIT"
] | 2 | 2021-03-12T16:29:03.000Z | 2021-07-24T17:07:14.000Z | bert_onnx.py | MatRazor/ONNXRuntime_tutorial_collection | 9fe46311896391f769a51cc4d07814e6bfafd8ee | [
"MIT"
] | null | null | null | bert_onnx.py | MatRazor/ONNXRuntime_tutorial_collection | 9fe46311896391f769a51cc4d07814e6bfafd8ee | [
"MIT"
] | 1 | 2021-11-11T18:36:25.000Z | 2021-11-11T18:36:25.000Z | # %%
## Most part of the code taken from https://github.com/microsoft/onnxruntime/blob/master/onnxruntime/python/tools/transformers/notebooks/PyTorch_Bert-Squad_OnnxRuntime_CPU.ipynb
import os
import requests
from transformers import BertConfig, BertForQuestionAnswering, BertTokenizer
from transformers.data.proc... | 39.264368 | 178 | 0.604508 |
e9dbc3bb63cc70147aea01926500fb2d7b65b029 | 956 | py | Python | migrations/versions/f6e9c6582972_initial_migration.py | Meziu/srb2_highscores | 9d2805309b523c74186ead71aeabdb754c8b5746 | [
"Unlicense"
] | 1 | 2020-05-21T13:30:54.000Z | 2020-05-21T13:30:54.000Z | migrations/versions/f6e9c6582972_initial_migration.py | Meziu/srb2_highscores | 9d2805309b523c74186ead71aeabdb754c8b5746 | [
"Unlicense"
] | 24 | 2020-05-20T21:34:22.000Z | 2021-05-03T18:29:03.000Z | migrations/versions/f6e9c6582972_initial_migration.py | Meziu/srb2_highscores | 9d2805309b523c74186ead71aeabdb754c8b5746 | [
"Unlicense"
] | 7 | 2020-05-20T15:57:20.000Z | 2021-05-03T17:01:49.000Z | """Initial migration.
Revision ID: f6e9c6582972
Revises:
Create Date: 2020-06-17 20:17:27.108433
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f6e9c6582972'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
... | 26.555556 | 88 | 0.675732 |
703f941c469ea74cbd1f6cf3056e0e412618a4f5 | 2,947 | py | Python | admixtureworkflow.py | janneengestoft/birc-project | 95b201648a851efaab1682388e8bb617752b4812 | [
"MIT"
] | null | null | null | admixtureworkflow.py | janneengestoft/birc-project | 95b201648a851efaab1682388e8bb617752b4812 | [
"MIT"
] | null | null | null | admixtureworkflow.py | janneengestoft/birc-project | 95b201648a851efaab1682388e8bb617752b4812 | [
"MIT"
] | null | null | null | from gwf import Workflow, AnonymousTarget
from scripts.modpath import modpath
gwf = Workflow()
# Chromosome and group to perform admixture analysis on
vcffile = '../../../../primatediversity/data/PG_baboons_pananu3_23_2_2021/output.filtered.snps.chr7.removed.AB.pass.vep.vcf.gz'
chr = '7'
pop = 'females'
popfile = 'fe... | 24.558333 | 127 | 0.620631 |
1b53918df9199a440d6a3e0547020f598785d17d | 5,450 | py | Python | scrape_mars.py | Areej32/webscraping | 5431e1830287804e5ae857cef4bd00546b75683b | [
"ADSL"
] | null | null | null | scrape_mars.py | Areej32/webscraping | 5431e1830287804e5ae857cef4bd00546b75683b | [
"ADSL"
] | null | null | null | scrape_mars.py | Areej32/webscraping | 5431e1830287804e5ae857cef4bd00546b75683b | [
"ADSL"
] | null | null | null | # Scrape Web Data about Mars and Return one Library to collect all the scrape data
# Dependencies
from bs4 import BeautifulSoup as bs
import requests
import pandas as pd
from splinter import Browser
from splinter.exceptions import ElementDoesNotExist
import time
# Define scrape function
def scrape():
... | 20.335821 | 170 | 0.66789 |
17a5d64261a56bf5aad08882c39fcb29af627714 | 3,944 | py | Python | explainable_ai/util/fig_plotter.py | banna88/Configuration-Space-Reduction | 3d061deaf2cb06597037bb085b4769483e42fd53 | [
"MIT"
] | null | null | null | explainable_ai/util/fig_plotter.py | banna88/Configuration-Space-Reduction | 3d061deaf2cb06597037bb085b4769483e42fd53 | [
"MIT"
] | null | null | null | explainable_ai/util/fig_plotter.py | banna88/Configuration-Space-Reduction | 3d061deaf2cb06597037bb085b4769483e42fd53 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import pandas as pd
from ast import literal_eval
import json
import numpy as np
import matplotlib.patches as mpatches
from sklearn.preprocessing import StandardScaler, MinMaxScaler, MaxAbsScaler
version = 'v1' # v1, v2
def plot_learning_vs_no_learning():
plt.figure()
plt_ind... | 32.595041 | 91 | 0.540061 |
1d09abce70057b11a403ddcbda399d9f444807cc | 3,293 | py | Python | gym_bot_app/tasks/did_not_train_updater.py | raascode/GymBot | 10ea5ef7639d41bd243761a85507c2509427dc99 | [
"Apache-2.0"
] | 8 | 2018-12-02T10:15:19.000Z | 2022-01-27T09:03:26.000Z | gym_bot_app/tasks/did_not_train_updater.py | raascode/GymBot | 10ea5ef7639d41bd243761a85507c2509427dc99 | [
"Apache-2.0"
] | 4 | 2021-02-10T02:20:38.000Z | 2021-10-19T20:54:21.000Z | gym_bot_app/tasks/did_not_train_updater.py | raascode/GymBot | 10ea5ef7639d41bd243761a85507c2509427dc99 | [
"Apache-2.0"
] | 9 | 2018-07-27T09:05:43.000Z | 2022-01-24T12:18:38.000Z | from datetime import time, timedelta, datetime
from typing import List
from telegram import ParseMode
from telegram.ext import CallbackQueryHandler
from gym_bot_app.models import Trainee, Group
from gym_bot_app.tasks import Task
from gym_bot_app.utils import get_trainees_that_selected_today_and_did_not_train_yet
from... | 43.328947 | 118 | 0.711509 |
24d69ee2d4c36a119c9007a9fb07364a5e29c403 | 344 | py | Python | Python/Algorithm/FunctionValidanting.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 148 | 2017-08-03T01:49:27.000Z | 2022-03-26T10:39:30.000Z | Python/Algorithm/FunctionValidanting.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 3 | 2017-11-23T19:52:05.000Z | 2020-04-01T00:44:40.000Z | Python/Algorithm/FunctionValidanting.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 59 | 2017-08-03T01:49:19.000Z | 2022-03-31T23:24:38.000Z | def pedeChute():
while True:
try:
chute = int(input("chute: "))
if chute == 0:
return chute
except:
pass
def jogo():
while True:
#algo aqui
chute = pedeChute() #sempre será válido
#algo aqui
#https://pt.stackov... | 20.235294 | 47 | 0.482558 |
b18f8d784adf9c64137c910b0deb3f8526254810 | 2,725 | py | Python | docker/package/package_generator.py | serokell/tezos-packaging | 74397ce01721a3366043895710b229f1d53a5504 | [
"Apache-2.0",
"MIT"
] | 43 | 2019-12-12T11:54:15.000Z | 2022-03-08T01:10:36.000Z | docker/package/package_generator.py | serokell/tezos-packaging | 74397ce01721a3366043895710b229f1d53a5504 | [
"Apache-2.0",
"MIT"
] | 226 | 2019-12-10T13:39:22.000Z | 2022-03-30T12:30:17.000Z | docker/package/package_generator.py | serokell/tezos-packaging | 74397ce01721a3366043895710b229f1d53a5504 | [
"Apache-2.0",
"MIT"
] | 11 | 2020-08-11T09:25:05.000Z | 2022-03-05T15:51:46.000Z | # SPDX-FileCopyrightText: 2020 TQ Tezos <https://tqtezos.com/>
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ
import os, shutil, argparse
from .fedora import build_fedora_package
from .packages import packages
from .ubuntu import build_ubuntu_package
is_ubuntu = None
is_source = None
package_to_build = None
source_a... | 23.09322 | 83 | 0.616147 |
aee0523670b853d2509a9968d763f4058261652c | 15,419 | py | Python | .history/src/Simulador_20200711171005.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200711171005.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200711171005.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix, lil_matrix
class S... | 40.153646 | 170 | 0.651858 |
bd7d3f20ccbd0581bf494538eef0d62bb3f12c4a | 2,519 | py | Python | tools/c7n_gcp/tests/test_gcp_storage.py | dnouri/cloud-custodian | 4e8b3b45f60731df942ffe6b61645416d7a67daa | [
"Apache-2.0"
] | 1 | 2020-09-07T21:10:29.000Z | 2020-09-07T21:10:29.000Z | tools/c7n_gcp/tests/test_gcp_storage.py | dnouri/cloud-custodian | 4e8b3b45f60731df942ffe6b61645416d7a67daa | [
"Apache-2.0"
] | 1 | 2021-02-10T02:20:45.000Z | 2021-02-10T02:20:45.000Z | tools/c7n_gcp/tests/test_gcp_storage.py | dnouri/cloud-custodian | 4e8b3b45f60731df942ffe6b61645416d7a67daa | [
"Apache-2.0"
] | 1 | 2021-10-15T11:29:54.000Z | 2021-10-15T11:29:54.000Z | # Copyright 2019 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import time
from gcp_common import BaseTest
class BucketTest(BaseTest):
def test_bucket_query(self):
project_id = 'cloud-custodian'
factory = self.replay_flight_data('bucket... | 38.753846 | 90 | 0.616118 |
f64682d3a903f6073a2f0e8588812417574d7c8c | 2,685 | py | Python | apps/search/src/search/search_controller.py | vsosrc/hue | d8bc236d8d622759fa5988ff32246e4c750e7503 | [
"Apache-2.0"
] | null | null | null | apps/search/src/search/search_controller.py | vsosrc/hue | d8bc236d8d622759fa5988ff32246e4c750e7503 | [
"Apache-2.0"
] | null | null | null | apps/search/src/search/search_controller.py | vsosrc/hue | d8bc236d8d622759fa5988ff32246e4c750e7503 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -- coding: utf-8 --
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (th... | 27.680412 | 96 | 0.700931 |
a982299d94cd2afc01eeceb33dd70f04c8f1b198 | 18,746 | py | Python | wagtail/images/models.py | simo97/wagtail | ef404c775559722b9ad6be61a2cc6d6ca6ed8f69 | [
"BSD-3-Clause"
] | null | null | null | wagtail/images/models.py | simo97/wagtail | ef404c775559722b9ad6be61a2cc6d6ca6ed8f69 | [
"BSD-3-Clause"
] | null | null | null | wagtail/images/models.py | simo97/wagtail | ef404c775559722b9ad6be61a2cc6d6ca6ed8f69 | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import os.path
from collections import OrderedDict
from contextlib import contextmanager
from io import BytesIO
from django.conf import settings
from django.core import checks
from django.core.files import File
from django.db import models
from django.forms.utils import flatatt
from django.urls import r... | 34.208029 | 111 | 0.616505 |
675a302cf444d9735bc54159b5fce1527384a630 | 663 | py | Python | fsdet/config/defaults.py | wz940216/few-shot-object-detection-custom | 66277921a9c38b0f0d55a4f0d07c54363b17070b | [
"Apache-2.0"
] | 4 | 2021-08-01T01:11:43.000Z | 2021-11-01T07:14:18.000Z | fsdet/config/defaults.py | wz940216/few-shot-object-detection-custom | 66277921a9c38b0f0d55a4f0d07c54363b17070b | [
"Apache-2.0"
] | null | null | null | fsdet/config/defaults.py | wz940216/few-shot-object-detection-custom | 66277921a9c38b0f0d55a4f0d07c54363b17070b | [
"Apache-2.0"
] | 1 | 2021-07-12T08:19:23.000Z | 2021-07-12T08:19:23.000Z | from detectron2.config import CfgNode as CN
from detectron2.config.defaults import _C
# adding additional default values built on top of the default values in detectron2
_CC = _C
# FREEZE Parameters
_CC.MODEL.BACKBONE.FREEZE = False
_CC.MODEL.PROPOSAL_GENERATOR.FREEZE = False
_CC.MODEL.ROI_HEADS.FREEZE_FEAT = False
... | 30.136364 | 83 | 0.80543 |
ef49c704b88afc03df0a6e9c6612cb725ce5b0f6 | 61 | py | Python | src/timeatlas/metadata/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 10 | 2020-08-25T09:23:02.000Z | 2021-01-12T14:00:35.000Z | src/timeatlas/metadata/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 140 | 2020-06-30T11:59:47.000Z | 2021-08-23T20:58:43.000Z | src/timeatlas/metadata/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | null | null | null | from .metadata import Metadata
__all__ = [
'Metadata'
]
| 10.166667 | 30 | 0.672131 |
7618b04373475ca406b4ebe19fdcfabbc188a6e7 | 529 | py | Python | mmdet/version.py | ccw1996/mmdetection | 6b87ac22b8d9dea8cc28b9ce84909e6c311e6268 | [
"Apache-2.0"
] | 2 | 2021-11-27T03:30:42.000Z | 2022-01-01T05:14:18.000Z | mmdet/version.py | Bella-ing/mmdetection | 70f6d9cfade4a2f0b198e4f64776521d181b28be | [
"Apache-2.0"
] | 1 | 2020-05-20T08:13:44.000Z | 2020-05-20T08:13:44.000Z | mmdet/version.py | Bella-ing/mmdetection | 70f6d9cfade4a2f0b198e4f64776521d181b28be | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
__version__ = '2.22.0'
short_version = __version__
def parse_version_info(version_str):
version_info = []
for x in version_str.split('.'):
if x.isdigit():
version_info.append(int(x))
elif x.find('rc') != -1:
patch_version... | 26.45 | 56 | 0.642722 |
a18d9e84e9e9123d545f3da558d943e975bcfa2a | 2,323 | py | Python | accounts/webService/userAPI.py | vahidtwo/simpleSocialSite | 40d971f04b7127811b7e277ddb3068fb451e9574 | [
"MIT"
] | 1 | 2020-05-16T16:14:51.000Z | 2020-05-16T16:14:51.000Z | accounts/webService/userAPI.py | vahidtwo/simpleSocialSite | 40d971f04b7127811b7e277ddb3068fb451e9574 | [
"MIT"
] | 5 | 2021-03-18T23:21:18.000Z | 2022-01-13T02:10:19.000Z | accounts/webService/userAPI.py | vahidtwo/simpleSocialSite | 40d971f04b7127811b7e277ddb3068fb451e9574 | [
"MIT"
] | null | null | null | from django.http import JsonResponse
from rest_framework.parsers import FileUploadParser
from rest_framework.status import (
HTTP_400_BAD_REQUEST, HTTP_200_OK, HTTP_404_NOT_FOUND
)
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from accounts.models import User
from acco... | 39.372881 | 100 | 0.754628 |
5c46ff58add2dce689de09d41ce6de546ad3db41 | 465 | py | Python | Typing/exa.py | simone-trubian/blog-posts | 85a80df1f8ef85e796470656838792f29c80c3a8 | [
"BSD-3-Clause"
] | null | null | null | Typing/exa.py | simone-trubian/blog-posts | 85a80df1f8ef85e796470656838792f29c80c3a8 | [
"BSD-3-Clause"
] | null | null | null | Typing/exa.py | simone-trubian/blog-posts | 85a80df1f8ef85e796470656838792f29c80c3a8 | [
"BSD-3-Clause"
] | null | null | null | from typing import Tuple, TypeVar
# This will Fail!
def incBoth(x: int, y:int) -> (int, int):
return(x + 1, y + 1)
#def incBoth(x: int, y:int) -> Tuple[int, int]:
# return(x + 1, y + 1)
Pair = Tuple[int, int]
Num = TypeVar('Num', int, float, complex)
def incPair(x: int, y:int) -> Pair:
return(x + 1, y +... | 18.6 | 47 | 0.55914 |
411a19b63653dcbabb4faa1cf86122114b7af75b | 2,226 | py | Python | sensor_callbacks.py | motorox/sensors-raspi | dc8ba50bd5deb2afdc2381c4fbf915cd66819603 | [
"MIT"
] | null | null | null | sensor_callbacks.py | motorox/sensors-raspi | dc8ba50bd5deb2afdc2381c4fbf915cd66819603 | [
"MIT"
] | 1 | 2018-05-16T08:38:59.000Z | 2018-05-16T08:38:59.000Z | sensor_callbacks.py | motorox/sensors-raspi | dc8ba50bd5deb2afdc2381c4fbf915cd66819603 | [
"MIT"
] | null | null | null | import time
from sensor_utils import calcAccel, calcGyro, calcHum, calcMagn, calcTmpTarget
class SensorCallbacks:
data = {}
def __init__(self, addr):
self.data['addr'] = addr
self.data['keys'] = 0
def tmp007(self, v):
objT = (v[1]<<8)+v[0]
ambT = (v[3]<<8)+v[2]
#p... | 29.289474 | 78 | 0.478437 |
f1ad5862a439dba9506139c01d07126ec3e546b5 | 1,013 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py | jlant/cookiecutter-pyproj | ad5895f65b7e6e2541f8aee7498c125a0c144e62 | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py | jlant/cookiecutter-pyproj | ad5895f65b7e6e2541f8aee7498c125a0c144e62 | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py | jlant/cookiecutter-pyproj | ad5895f65b7e6e2541f8aee7498c125a0c144e62 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Click command line interface for {{ cookiecutter.project_slug }}.
Notes
-----
Click is a great Python package for creating nice command line interfaces.
Please see `Click documentation <http://click.pocoo.org/>`_.
"""
import sys
import click
import {{cookiecutter.project_slug}}
@click.c... | 25.974359 | 91 | 0.685094 |
1630f80e291bd8ee2f184901062605f46466ccd8 | 3,552 | py | Python | siam_tracker/models/alexnet.py | songheony/SPM-Tracker | 41fd91ec42cf9072fe44d45c5bb68993f28a12ad | [
"MIT"
] | 32 | 2019-08-30T09:50:03.000Z | 2021-10-12T08:36:25.000Z | siam_tracker/models/alexnet.py | songheony/SPM-Tracker | 41fd91ec42cf9072fe44d45c5bb68993f28a12ad | [
"MIT"
] | 3 | 2019-09-05T09:45:52.000Z | 2020-12-02T02:42:08.000Z | siam_tracker/models/alexnet.py | songheony/SPM-Tracker | 41fd91ec42cf9072fe44d45c5bb68993f28a12ad | [
"MIT"
] | 16 | 2019-09-10T09:04:53.000Z | 2021-09-13T12:44:47.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from math import ceil
from torch import nn
from collections import OrderedDict
from .base import BackBoneCNN, NetworkInfo
class AlexNetConv(BackBoneCNN):
"""
The standard AlexNet convolutional backbone.
For mor... | 50.742857 | 96 | 0.560811 |
04acc1265af3116ae378f05cee69520a7bf29133 | 6,936 | py | Python | backend/falling_brook_31504/settings.py | crowdbotics-apps/falling-brook-31504 | 6b71c01e67f9716a207c77fc15ce7a96723d9de5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/falling_brook_31504/settings.py | crowdbotics-apps/falling-brook-31504 | 6b71c01e67f9716a207c77fc15ce7a96723d9de5 | [
"FTL",
"AML",
"RSA-MD"
] | 7 | 2021-10-18T03:00:36.000Z | 2021-10-18T03:00:44.000Z | backend/falling_brook_31504/settings.py | crowdbotics-apps/falling-brook-31504 | 6b71c01e67f9716a207c77fc15ce7a96723d9de5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for falling_brook_31504 project.
Generated by 'django-admin startproject' using Django 2.2.2.
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/
"""
... | 29.641026 | 112 | 0.731257 |
be411d7942432939d76dc1f79faf68059457c4e9 | 7,042 | py | Python | demo/demo.py | ChenRIT/Essentia | 8309d52b1e46562646129dc0c481897fa352bff4 | [
"Apache-2.0"
] | null | null | null | demo/demo.py | ChenRIT/Essentia | 8309d52b1e46562646129dc0c481897fa352bff4 | [
"Apache-2.0"
] | null | null | null | demo/demo.py | ChenRIT/Essentia | 8309d52b1e46562646129dc0c481897fa352bff4 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append('./scripts/essentia')
import json
import flask
import networkx as nx
from networkx.readwrite import json_graph
# from scripts.fsa import *
# from scripts.generate_word_alignment import *
# from scripts.preprocessing import create_valid_groups
from generate_word_alignment import nlp, make_ali... | 35.928571 | 128 | 0.596279 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.