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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f2d208be1a78efe8eacf96ba6b5a771eff3d0725 | 1,087 | py | Python | src/galaxy_parser/errors.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | 2 | 2019-12-24T10:45:37.000Z | 2022-03-04T00:47:14.000Z | src/galaxy_parser/errors.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | 2 | 2019-10-31T17:42:36.000Z | 2020-03-24T18:20:41.000Z | src/galaxy_parser/errors.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Union
from pathlib import Path
class RepositoryNotFound(Exception):
"""Specified repository cannot be cloned."""
def __init__(self, repo_path: 'Union[str, Path]'):
self.path = repo_path
def __str__(self):
retu... | 24.155556 | 101 | 0.647654 |
28a6ae495ba2b3b1770deb58e8d7133109bdcd3c | 2,054 | py | Python | test/idiom/predictor/mem_idiom2.py | SnowOnion/maple | 14b2769a07473f9eca6ea1bc7f57bbefe1db46f4 | [
"Apache-2.0"
] | 58 | 2015-03-18T07:37:05.000Z | 2022-01-17T18:15:28.000Z | test/idiom/predictor/mem_idiom2.py | SnowOnion/maple | 14b2769a07473f9eca6ea1bc7f57bbefe1db46f4 | [
"Apache-2.0"
] | 7 | 2015-08-26T16:22:52.000Z | 2021-04-01T05:24:39.000Z | test/idiom/predictor/mem_idiom2.py | SnowOnion/maple | 14b2769a07473f9eca6ea1bc7f57bbefe1db46f4 | [
"Apache-2.0"
] | 24 | 2015-03-18T07:35:06.000Z | 2022-02-23T14:01:57.000Z | """Copyright 2011 The University of Michigan
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 writi... | 32.603175 | 72 | 0.683057 |
487d621a6ab131eb653466543e2d012335b96254 | 594 | py | Python | n2v/tests/test_methods/test_wy/test_neon_wy.py | VHchavez/n2v | ce4c5259f7b55731669b69b66e09fcec1940283a | [
"BSD-3-Clause"
] | 2 | 2021-09-16T12:30:51.000Z | 2021-12-22T00:55:43.000Z | n2v/tests/test_methods/test_wy/test_neon_wy.py | VHchavez/n2v | ce4c5259f7b55731669b69b66e09fcec1940283a | [
"BSD-3-Clause"
] | 26 | 2021-01-13T21:50:54.000Z | 2022-02-17T01:02:11.000Z | n2v/tests/test_methods/test_wy/test_neon_wy.py | wasserman-group/n2v | 029c2f4e06eee440d7586a7e784677cde614aac8 | [
"BSD-3-Clause"
] | 3 | 2021-01-12T18:03:04.000Z | 2021-04-22T19:08:49.000Z | import n2v
import psi4
import pytest
psi4.set_options({"save_jk" : True})
psi4.set_memory(int(2.50e9))
@pytest.fixture
def wfn():
Ne = psi4.geometry(
"""
0 1
Ne
noreorient
nocom
units bohr
symmetry c1
""" )
psi4.set_options({"reference" : "rhf"})
wfn = psi4.properties("... | 19.16129 | 96 | 0.649832 |
09116399ea51bbca2ae8e5d40720c0fadcabb097 | 664 | py | Python | uqcsbot/utils/command_utils.py | antdon/uqcsbot-discord | 81611cf37e1eb4649eaaeb202c49a75ccc6e797f | [
"MIT"
] | 7 | 2021-07-24T08:50:56.000Z | 2022-03-23T02:52:29.000Z | uqcsbot/utils/command_utils.py | antdon/uqcsbot-discord | 81611cf37e1eb4649eaaeb202c49a75ccc6e797f | [
"MIT"
] | 22 | 2021-07-24T12:09:37.000Z | 2022-03-11T00:44:50.000Z | uqcsbot/utils/command_utils.py | antdon/uqcsbot-discord | 81611cf37e1eb4649eaaeb202c49a75ccc6e797f | [
"MIT"
] | 5 | 2021-07-24T06:03:51.000Z | 2021-11-18T01:25:28.000Z | from random import choice
from functools import wraps
from typing import Callable
from discord.ext import commands
LOADING_REACTS = ["⏰", "🕰️", "⏲️", "🕖", "🕔", "🕥"]
def loading_status(command_fn: Callable):
@wraps(command_fn) # Important to preserve name because `command` uses it
async def wrapper(self, ... | 33.2 | 78 | 0.670181 |
2c27ceb359e14eaa4df8b737d502b3942f0a731f | 336 | py | Python | src/stk/ea/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | src/stk/ea/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | src/stk/ea/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | from .crossover import * # noqa
from .evolutionary_algorithm import * # noqa
from .fitness_calculators import * # noqa
from .fitness_normalizers import * # noqa
from .generation import * # noqa
from .molecule_records import * # noqa
from .mutation import * # noqa
from .plotters import * # noqa
from .selection i... | 33.6 | 45 | 0.732143 |
7ddbce83aedc8b9c557e7864eb807b738b8c1756 | 3,084 | py | Python | tests/artificial.py | fungibit/chainscan | 961355dbe1910397c491508720b989251a0a4e80 | [
"MIT"
] | 6 | 2017-10-25T17:11:56.000Z | 2019-07-08T18:24:59.000Z | tests/artificial.py | fungibit/chainscan | 961355dbe1910397c491508720b989251a0a4e80 | [
"MIT"
] | 15 | 2017-01-31T06:11:16.000Z | 2017-12-14T18:07:02.000Z | tests/artificial.py | fungibit/chainscan | 961355dbe1910397c491508720b989251a0a4e80 | [
"MIT"
] | 1 | 2021-08-22T21:52:17.000Z | 2021-08-22T21:52:17.000Z | """
Code for generating artificial block data in the format of a blk.dat file,
which includes forks. Used for testing.
"""
import datetime
from chainscan.block import deserialize_block
from chainscan.defs import MAGIC
MAGIC = MAGIC.to_bytes(4, 'little')
FORKED_NONCE = 0xffffffff
block_counter = 0
def make_block(h... | 29.941748 | 108 | 0.615759 |
9b797121b858448b9fdc4894d7e0a741c2c70590 | 12,753 | py | Python | module/direct_links.py | sensianhermes/SENSIUSERBOT | 51473a0a98861192901fb5cc3dc297447a821daa | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2022-02-27T16:12:25.000Z | 2022-03-28T07:39:29.000Z | module/direct_links.py | sensianhermes/SENSIUSERBOT | 51473a0a98861192901fb5cc3dc297447a821daa | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | module/direct_links.py | sensianhermes/SENSIUSERBOT | 51473a0a98861192901fb5cc3dc297447a821daa | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 6 | 2022-03-11T20:17:36.000Z | 2022-03-28T01:29:13.000Z | # Copyright (C) 2021 Catuserbot <https://github.com/sandy1709/catuserbot>
# Ported by @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot & t.me/Lunatic0de
import ast
import json
import re
import urllib.parse
from os import popen
from secrets import choice
import request... | 35.32687 | 156 | 0.582451 |
83809fe03f78512c0f7258472d22324121fd2528 | 2,877 | py | Python | fec/version/v6_2/SL.py | h4ck3rm1k3/FEC-Field-Documentation | c2f1f36e14c67ac3656c09f801b9f595d3e9f92e | [
"Unlicense"
] | 1 | 2016-06-13T23:54:31.000Z | 2016-06-13T23:54:31.000Z | fec/version/v8_0/SL.py | h4ck3rm1k3/FEC-Field-Documentation | c2f1f36e14c67ac3656c09f801b9f595d3e9f92e | [
"Unlicense"
] | null | null | null | fec/version/v8_0/SL.py | h4ck3rm1k3/FEC-Field-Documentation | c2f1f36e14c67ac3656c09f801b9f595d3e9f92e | [
"Unlicense"
] | 1 | 2019-07-03T10:35:19.000Z | 2019-07-03T10:35:19.000Z | import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER COMMITTEE ID', 'number': '2'},
{'name': 'TRANSACTION ID NUMBER', 'number': '3'},
... | 58.714286 | 79 | 0.492179 |
ad6dd9a6fb42d4fa21a8f4a034eb5d988c350f50 | 1,881 | py | Python | ResNet/utils/concat_datasets.py | ryanmclark/ece_285_final_project_v2 | 71c1243fc2df15873c9a9bf1f482c0d4974bc83d | [
"MIT"
] | null | null | null | ResNet/utils/concat_datasets.py | ryanmclark/ece_285_final_project_v2 | 71c1243fc2df15873c9a9bf1f482c0d4974bc83d | [
"MIT"
] | null | null | null | ResNet/utils/concat_datasets.py | ryanmclark/ece_285_final_project_v2 | 71c1243fc2df15873c9a9bf1f482c0d4974bc83d | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 5 15:08:55 2018
@author: ryanclark
Header:
This file concats the torch dataset objects for the train, test, and validate datasets into
a single dataset object. This is to allow K-Folds cross validation and random batch pulling
for the CNNs. The fu... | 28.5 | 91 | 0.753323 |
3133df436c368226a0adcf857fadce2f6e56e4f8 | 6,076 | py | Python | test_widerface.py | miliadis/retinaface-tf2 | 8c6ac60a894fdecbc0566c4073f30e20addcedb9 | [
"MIT"
] | null | null | null | test_widerface.py | miliadis/retinaface-tf2 | 8c6ac60a894fdecbc0566c4073f30e20addcedb9 | [
"MIT"
] | null | null | null | test_widerface.py | miliadis/retinaface-tf2 | 8c6ac60a894fdecbc0566c4073f30e20addcedb9 | [
"MIT"
] | null | null | null | from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import os
import pathlib
import numpy as np
import tensorflow as tf
from modules.models import RetinaFaceModel
from modules.utils import (set_memory_growth, load_yaml, draw_bbox_landm,
pad_input_image, recover_pad_o... | 35.741176 | 79 | 0.584924 |
b6270fcaaae7b6dd9ebf9db7efd6a593a54348a3 | 10,064 | py | Python | src/pressroom/migrations/0007_auto__add_field_article_modified__add_field_article_created__add_field.py | znick/django-pressroom | dd486d326d8cf5ab4610148e95857f5e915fe258 | [
"BSD-3-Clause"
] | null | null | null | src/pressroom/migrations/0007_auto__add_field_article_modified__add_field_article_created__add_field.py | znick/django-pressroom | dd486d326d8cf5ab4610148e95857f5e915fe258 | [
"BSD-3-Clause"
] | null | null | null | src/pressroom/migrations/0007_auto__add_field_article_modified__add_field_article_created__add_field.py | znick/django-pressroom | dd486d326d8cf5ab4610148e95857f5e915fe258 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Article.modified'
db.add_column('pressroom_article', 'modified',
self.... | 63.696203 | 215 | 0.5782 |
44c0f9e10416ff718b154e882e88b8575e53c31c | 100 | py | Python | string/multiply.py | ZeddShi/alg-py | f491dbf92bf7ddf0ac159d1ccfa1f716e458699f | [
"MIT"
] | null | null | null | string/multiply.py | ZeddShi/alg-py | f491dbf92bf7ddf0ac159d1ccfa1f716e458699f | [
"MIT"
] | null | null | null | string/multiply.py | ZeddShi/alg-py | f491dbf92bf7ddf0ac159d1ccfa1f716e458699f | [
"MIT"
] | null | null | null | def multiply(num1: str, num2: str) -> str:
if num1 == '0' or num2 == '0':
return 0
| 20 | 42 | 0.49 |
55adf3c6cdce48ef8f11b2c16db59bd3fe6d0d37 | 4,838 | py | Python | tests/blog/test_blog.py | kamlesh577/django-blog | 81fc7a75b1021a67a08e9c9a3bed064098cfa85a | [
"MIT"
] | null | null | null | tests/blog/test_blog.py | kamlesh577/django-blog | 81fc7a75b1021a67a08e9c9a3bed064098cfa85a | [
"MIT"
] | null | null | null | tests/blog/test_blog.py | kamlesh577/django-blog | 81fc7a75b1021a67a08e9c9a3bed064098cfa85a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from playwright.page import Page
from blog.models import Comment, Newsletter
def test_create_post(page: Page, live_server):
page.click("text=Create Post")
assert page.url == f"{live_server.url}/posts/create/"
page.fill('input[name="title"]', "testing")
page.fill('t... | 42.438596 | 76 | 0.652336 |
142d368262b1d54024afcd8888edc4e166a9aede | 4,922 | py | Python | src/d00_utils/utils.py | 18rberry/Operationalizing-Equity-Tiebreaker-in-SF | 59fe12157e5408e3c2485738dc8da21d4ac8b31c | [
"RSA-MD"
] | null | null | null | src/d00_utils/utils.py | 18rberry/Operationalizing-Equity-Tiebreaker-in-SF | 59fe12157e5408e3c2485738dc8da21d4ac8b31c | [
"RSA-MD"
] | null | null | null | src/d00_utils/utils.py | 18rberry/Operationalizing-Equity-Tiebreaker-in-SF | 59fe12157e5408e3c2485738dc8da21d4ac8b31c | [
"RSA-MD"
] | null | null | null | import numpy as np
import pandas as pd
def get_group_value(x: pd.Series):
"""
Get single value from pandas.Series with constant values.
:param x: pandas.Series
:return: single value
"""
return x.iloc[0]
def get_label(x, solution_set, block_idx=None):
"""
Function that transforms inde... | 34.661972 | 94 | 0.586144 |
8cbc8948bd549e20c12aa703b7a5987146619fed | 1,319 | py | Python | snake.py | JaredsGames/Snake | ff0ae856455e974e891586d37361a283f1783580 | [
"MIT"
] | null | null | null | snake.py | JaredsGames/Snake | ff0ae856455e974e891586d37361a283f1783580 | [
"MIT"
] | null | null | null | snake.py | JaredsGames/Snake | ff0ae856455e974e891586d37361a283f1783580 | [
"MIT"
] | null | null | null | """
Main driver code for Snake
"""
# Jared Dyreson
# CPSC 386-01
# 2021-11-29
# jareddyreson@csu.fullerton.edu
# @JaredDyreson
#
# Lab 00-04
#
# Some filler text
#
import pygame
import random
import sys
import time
import functools
import typing
from Snake.Difficulty import Difficulty
from S... | 21.274194 | 70 | 0.664139 |
a1b7822530287030566c4921d6d32e4542d58343 | 28 | py | Python | solthiruthi/__init__.py | msathia/open-tamil | 8e98a584dcf56ac8fe7529464114151f7357c746 | [
"MIT"
] | 1 | 2020-05-20T13:54:24.000Z | 2020-05-20T13:54:24.000Z | solthiruthi/__init__.py | AasaiAlangaram/open-tamil | 6679c60148f0dddc287a892b8c9aaf8a159e99f0 | [
"MIT"
] | null | null | null | solthiruthi/__init__.py | AasaiAlangaram/open-tamil | 6679c60148f0dddc287a892b8c9aaf8a159e99f0 | [
"MIT"
] | null | null | null | # (C) 2015 Muthiah Annamalai | 28 | 28 | 0.75 |
0e3611b15fd062e1be0da586d45ce7b3a7bc14b6 | 1,824 | py | Python | rpython/jit/tl/targettlc.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/jit/tl/targettlc.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/jit/tl/targettlc.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | from __future__ import print_function
import time
import py
py.path.local(__file__)
from rpython.jit.tl.tlc import interp, interp_nonjit, ConstantPool
from rpython.jit.backend.hlinfo import highleveljitinfo
def entry_point(args):
"""Main entry point of the stand-alone executable:
takes a list of strings and r... | 28.5 | 73 | 0.66557 |
4c19dd11abc7c6bc11d874e67f4735e8056869c0 | 3,569 | py | Python | tests/test_orientationd.py | loftwah/MONAI | 37fb3e779121e6dc74127993df102fc91d9065f8 | [
"Apache-2.0"
] | 1 | 2020-04-23T13:05:29.000Z | 2020-04-23T13:05:29.000Z | tests/test_orientationd.py | tranduyquockhanh/MONAI | 37fb3e779121e6dc74127993df102fc91d9065f8 | [
"Apache-2.0"
] | null | null | null | tests/test_orientationd.py | tranduyquockhanh/MONAI | 37fb3e779121e6dc74127993df102fc91d9065f8 | [
"Apache-2.0"
] | 1 | 2021-09-20T12:10:01.000Z | 2021-09-20T12:10:01.000Z | # Copyright 2020 MONAI Consortium
# 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, s... | 45.177215 | 120 | 0.607173 |
86e0e82d4f019d8de6b152a41e1807da984c93a5 | 604 | py | Python | experiments/chat/DjangoHotwireDemo/asgi.py | blopker/turbo-django | fa5555b9b16c54e08947a0fb540f3ad66e860c55 | [
"MIT"
] | 11 | 2020-12-24T11:00:39.000Z | 2021-12-23T12:02:41.000Z | experiments/chat/DjangoHotwireDemo/asgi.py | blopker/turbo-django | fa5555b9b16c54e08947a0fb540f3ad66e860c55 | [
"MIT"
] | null | null | null | experiments/chat/DjangoHotwireDemo/asgi.py | blopker/turbo-django | fa5555b9b16c54e08947a0fb540f3ad66e860c55 | [
"MIT"
] | 2 | 2020-12-24T12:24:20.000Z | 2021-02-13T12:12:30.000Z | """
ASGI config for DjangoHotwireDemo project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
from channels.routing impo... | 27.454545 | 78 | 0.796358 |
d82119076385b2e280e4a9b36ca873f6a332b87a | 165 | py | Python | tests/regressiontests/bug8245/admin.py | kix/django | 5262a288df07daa050a0e17669c3f103f47a8640 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.5/tests/regressiontests/bug8245/admin.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.5/tests/regressiontests/bug8245/admin.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from __future__ import absolute_import
from django.contrib import admin
from .models import Story
admin.site.register(Story)
raise Exception("Bad admin module")
| 16.5 | 38 | 0.812121 |
ed830536e116280c53c4af4b3ebe864b94724a13 | 3,693 | py | Python | egg/nest/nest.py | Daetheys/Lazimpa | 21f4f4ebcdfa8b6a775b64673dd3001763c91cf1 | [
"MIT"
] | 15 | 2020-09-23T08:24:33.000Z | 2022-02-09T14:32:49.000Z | egg/nest/nest.py | Daetheys/Lazimpa | 21f4f4ebcdfa8b6a775b64673dd3001763c91cf1 | [
"MIT"
] | null | null | null | egg/nest/nest.py | Daetheys/Lazimpa | 21f4f4ebcdfa8b6a775b64673dd3001763c91cf1 | [
"MIT"
] | 5 | 2021-03-05T16:54:45.000Z | 2022-03-31T13:33:58.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pathlib
import argparse
import time
import importlib
from egg.nest.common import sweep
if __name__ == '__main__':
from egg.nest.wra... | 44.493976 | 138 | 0.656377 |
16ed5c9e8b7870e90e431c9d31a3fba0e3dc21e0 | 2,245 | py | Python | paddlex/__init__.py | wangyuan111/PaddleX | bb62f5c91e2565756f96e56510603b1ac44df75a | [
"Apache-2.0"
] | null | null | null | paddlex/__init__.py | wangyuan111/PaddleX | bb62f5c91e2565756f96e56510603b1ac44df75a | [
"Apache-2.0"
] | null | null | null | paddlex/__init__.py | wangyuan111/PaddleX | bb62f5c91e2565756f96e56510603b1ac44df75a | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 31.619718 | 141 | 0.722049 |
5cca2c245eac063e8300ae65bdb94666d18ed48c | 9,424 | py | Python | ios/ElectronCash/electroncash_gui/ios_native/amountedit.py | proteanx/DeLight | 3edeb2ce4e823f7822fd7c0420d13f217bae5937 | [
"MIT"
] | 174 | 2018-09-30T12:47:10.000Z | 2022-03-05T15:03:38.000Z | ios/ElectronCash/electroncash_gui/ios_native/amountedit.py | proteanx/DeLight | 3edeb2ce4e823f7822fd7c0420d13f217bae5937 | [
"MIT"
] | 1,478 | 2018-09-24T09:30:13.000Z | 2022-03-29T15:48:17.000Z | ios/ElectronCash/electroncash_gui/ios_native/amountedit.py | proteanx/DeLight | 3edeb2ce4e823f7822fd7c0420d13f217bae5937 | [
"MIT"
] | 159 | 2018-09-24T12:56:47.000Z | 2022-03-28T23:52:17.000Z | #
# This file is:
# Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com>
#
# MIT License
#
from electroncash.i18n import _
from .custom_objc import *
from .uikit_bindings import *
from . import utils
from . import gui
from decimal import Decimal
from electroncash.util import format_satoshis_plain, format_sat... | 36.246154 | 149 | 0.610144 |
3eaaed3ec71e055c276c2cbd6a89f82bda70f721 | 1,367 | py | Python | server/src/main.py | vishalsjsu/SmartAlert | a551563a024f18fab9efe26664f34dedc9234011 | [
"MIT"
] | null | null | null | server/src/main.py | vishalsjsu/SmartAlert | a551563a024f18fab9efe26664f34dedc9234011 | [
"MIT"
] | null | null | null | server/src/main.py | vishalsjsu/SmartAlert | a551563a024f18fab9efe26664f34dedc9234011 | [
"MIT"
] | 1 | 2019-03-23T15:56:59.000Z | 2019-03-23T15:56:59.000Z | #!/usr/bin/python
import socket
import sys
import pyfcm as fcm
from thread import *
from constants import *
from logger import get_logger
sys.path.append(CONFIG_FILE_PATH)
from config import *
log = get_logger(logFileName="socketServer.log")
con = get_mongo_connection()
db = get_app_db(con)
fcm_service = fcm.FCMNoti... | 21.030769 | 108 | 0.676664 |
0c5de18d3b613891c38a4171b893627b4c556e0b | 5,505 | py | Python | laserchicken/io/ply_read.py | eEcoLiDAR/eEcoLiDAR | f5c4e772e4893f7242ed0b10aa17ac7e693a55a0 | [
"Apache-2.0"
] | 20 | 2018-07-05T22:21:47.000Z | 2022-03-01T00:24:36.000Z | laserchicken/io/ply_read.py | ElsevierSoftwareX/SOFTX_2019_325 | dcc8b5a9661664957fdfab4a5089cb5bfadc92ca | [
"Apache-2.0"
] | 104 | 2017-09-07T08:06:49.000Z | 2018-04-16T09:17:18.000Z | laserchicken/io/ply_read.py | vishalbelsare/laserchicken | 961d970e636e6eac3dfb969c36df9a5131ffd3d1 | [
"Apache-2.0"
] | 8 | 2020-02-13T08:55:36.000Z | 2021-07-28T16:04:08.000Z | import ast
import json
import numpy as np
from json.decoder import JSONDecodeError
from struct import unpack, calcsize
from laserchicken.io.utils import convert_to_short_type, convert_to_single_character_type
def read(path):
"""
Read point cloud data from a ply file.
:param path: path to the ply file
... | 35.063694 | 115 | 0.643597 |
47f48c88ecbb5c01a8de684f9256027e042959fa | 453 | py | Python | problems/test_0559_dfs.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0559_dfs.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0559_dfs.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | class Node:
"""
# Definition for a Node.
"""
def __init__(self, val, children):
self.val = val
self.children = children
# O(V) time. O(depth) space. Recursive DFS.
class Solution:
def maxDepth(self, root):
"""
:type root: Node
:rtype: int
"""
... | 20.590909 | 95 | 0.547461 |
ddbfea9ecad42b448b0fa70e981b2341df8749ad | 3,418 | py | Python | colcon_export_command/xml/models/project.py | maciejmatuszak/colcon-export-command | a7747996cbff25d8611306a9c1987cea3966271e | [
"Apache-2.0"
] | null | null | null | colcon_export_command/xml/models/project.py | maciejmatuszak/colcon-export-command | a7747996cbff25d8611306a9c1987cea3966271e | [
"Apache-2.0"
] | null | null | null | colcon_export_command/xml/models/project.py | maciejmatuszak/colcon-export-command | a7747996cbff25d8611306a9c1987cea3966271e | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class Env:
class Meta:
name = "env"
name: Optional[str] = field(
default=None,
metadata={
"type": "Attribute",
}
)
value: Optional[str] = field(
default=None,
... | 20.224852 | 89 | 0.510532 |
0ff87c28814060ce055bd90965aa89bca6389b7c | 3,791 | py | Python | sins/systems/asc/model.py | fgnt/sins | 80517a51dd6cedb3df98d61d9d0586a1f96d9e28 | [
"MIT"
] | 7 | 2020-04-09T07:43:52.000Z | 2022-03-10T02:09:28.000Z | sins/systems/asc/model.py | fgnt/sins | 80517a51dd6cedb3df98d61d9d0586a1f96d9e28 | [
"MIT"
] | null | null | null | sins/systems/asc/model.py | fgnt/sins | 80517a51dd6cedb3df98d61d9d0586a1f96d9e28 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from padertorch.contrib.je.modules.conv import CNN2d, CNN1d
from padertorch.contrib.je.modules.hybrid import CRNN
from sins.systems.eval import fscore
from torch import nn
from torchvision.utils import make_grid
class MultinomialClassifier(CRNN):
"""
>>> cnn = MultinomialClassi... | 35.429907 | 95 | 0.549195 |
50177263ab82ec82cbddbc6d8898f74ea1347560 | 73 | py | Python | bigsql/err.py | wabscale/bigsql | 9ac9efc9747765a05d9161df5de725a8895ac759 | [
"MIT"
] | 1 | 2021-07-02T15:39:21.000Z | 2021-07-02T15:39:21.000Z | bigsql/err.py | wabscale/bigsql | 9ac9efc9747765a05d9161df5de725a8895ac759 | [
"MIT"
] | null | null | null | bigsql/err.py | wabscale/bigsql | 9ac9efc9747765a05d9161df5de725a8895ac759 | [
"MIT"
] | null | null | null | import pymysql.err
class big_ERROR(pymysql.err.IntegrityError):
pass | 18.25 | 44 | 0.794521 |
931a033d293070d297b305d332ae0d6a64bf05a4 | 434 | py | Python | string/14.longest-common-prefix.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | string/14.longest-common-prefix.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | string/14.longest-common-prefix.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=14 lang=python3
#
# [14] Longest Common Prefix
#
from typing import List
class Solution:
def longestCommonPrefix(self, strs: List[str]) -> str:
if not strs:
return ""
if len(strs) == 1:
return strs[0]
ans = strs[0]
fo... | 19.727273 | 59 | 0.495392 |
19db4c2ddcb2eec3797c1ec4d3d8c70662f3d17b | 15,051 | py | Python | airbyte-integrations/connectors/source-salesforce/unit_tests/unit_test.py | LuisMunozVillarreal/airbyte | 3d469083cacd3d8657269fc568a60d91246dcd2a | [
"MIT"
] | 1 | 2022-02-21T07:55:09.000Z | 2022-02-21T07:55:09.000Z | airbyte-integrations/connectors/source-salesforce/unit_tests/unit_test.py | LuisMunozVillarreal/airbyte | 3d469083cacd3d8657269fc568a60d91246dcd2a | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-salesforce/unit_tests/unit_test.py | LuisMunozVillarreal/airbyte | 3d469083cacd3d8657269fc568a60d91246dcd2a | [
"MIT"
] | 1 | 2022-03-28T17:22:22.000Z | 2022-03-28T17:22:22.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from unittest.mock import Mock
import pytest
import requests_mock
from airbyte_cdk.models import SyncMode
from requests.exceptions import HTTPError
from source_salesforce.api import Salesforce
from source_salesforce.source import SourceSalesforce
from sourc... | 41.46281 | 139 | 0.660554 |
1d0d26b8368ca6b0c0ada9929a19451a1680b316 | 8,233 | py | Python | doc/conf.py | bernardoduarte/searchgrid | 60c72960493593aec8806b302cd3396f69ab1184 | [
"BSD-3-Clause"
] | 37 | 2017-08-04T14:36:32.000Z | 2021-11-02T12:08:51.000Z | doc/conf.py | bernardoduarte/searchgrid | 60c72960493593aec8806b302cd3396f69ab1184 | [
"BSD-3-Clause"
] | 14 | 2017-08-06T12:14:42.000Z | 2020-02-19T17:06:26.000Z | doc/conf.py | bernardoduarte/searchgrid | 60c72960493593aec8806b302cd3396f69ab1184 | [
"BSD-3-Clause"
] | 3 | 2017-10-17T15:25:08.000Z | 2020-02-16T13:29:48.000Z | # -*- coding: utf-8 -*-
#
# project-template documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 18 14:44:12 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fi... | 30.951128 | 79 | 0.719786 |
dcb507de990802c07fd64ba4d6578fb3738e1430 | 10,755 | py | Python | bin/assets/scripts/unet3Plus/drishtiML.py | nci/drish | 89cd8b740239c5b2c8222dffd4e27432fde170a1 | [
"MIT"
] | 118 | 2016-11-01T06:01:44.000Z | 2022-03-30T05:20:19.000Z | bin/assets/scripts/unet3Plus/drishtiML.py | nci/drish | 89cd8b740239c5b2c8222dffd4e27432fde170a1 | [
"MIT"
] | 56 | 2016-09-30T09:29:36.000Z | 2022-03-31T17:15:32.000Z | bin/assets/scripts/unet3Plus/drishtiML.py | nci/drish | 89cd8b740239c5b2c8222dffd4e27432fde170a1 | [
"MIT"
] | 28 | 2016-07-31T23:48:51.000Z | 2021-05-25T05:32:47.000Z | import os
import sys
import numpy as np
from myutils import get_patches,reconstruct_from_patches
import tensorflow as tf
import blosc2
sys.path.append('unet_collection')
from unet_collection import unet3_plus_2d, losses
UINT8 = 1
MAXVALUE = 255
DTYPE = np.uint8
#-------
def updateMaskFile(maskfile, Seg) :
print... | 29.225543 | 82 | 0.488052 |
9a25658b5a51d65f6732449ed27e8a6dfc296abb | 8,141 | py | Python | src/ebay_rest/api/sell_analytics/models/cycle.py | craiga/ebay_rest | a0be2677c65a787e9566df848ffa3ad0c309a9d9 | [
"MIT"
] | null | null | null | src/ebay_rest/api/sell_analytics/models/cycle.py | craiga/ebay_rest | a0be2677c65a787e9566df848ffa3ad0c309a9d9 | [
"MIT"
] | null | null | null | src/ebay_rest/api/sell_analytics/models/cycle.py | craiga/ebay_rest | a0be2677c65a787e9566df848ffa3ad0c309a9d9 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Seller Service Metrics API
The <i>Analytics API</i> provides data and information about a seller and their eBay business. <br><br>The resources and methods in this API let sellers review information on their listing performance, metrics on their customer service performance, and details... | 48.171598 | 1,212 | 0.666503 |
bf6c6f353c515953ee143fa99791e9a8955f96e3 | 2,387 | py | Python | crypt/solve_small_e.py | ozuma/ctf-tools | b1d8b166ec154c8122d97237212efb96e9a44d51 | [
"MIT"
] | 1 | 2021-03-28T16:23:35.000Z | 2021-03-28T16:23:35.000Z | crypt/solve_small_e.py | ozuma/ctf-tools | b1d8b166ec154c8122d97237212efb96e9a44d51 | [
"MIT"
] | null | null | null | crypt/solve_small_e.py | ozuma/ctf-tools | b1d8b166ec154c8122d97237212efb96e9a44d51 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# RSA: Low Public Exponent Attack
import gmpy2
import binascii
# Public Exponent
e = 3
# n = p(prime number) * q(prime number)
n = 1615765684321463054078226051959887884233678317734892901740763321135213636796075462401950274602405095138589898087428337758445013281488966866073355710771864671726991918... | 91.807692 | 1,010 | 0.942187 |
65fff3da9a9ca594c7433635ad14b78d3d37b9a4 | 494 | py | Python | src/aturan_calendar_web/converters.py | c17r/aturan-calendar-web | d31a23dce119b6e76a9a1d396e6ed23b60a525f6 | [
"MIT"
] | null | null | null | src/aturan_calendar_web/converters.py | c17r/aturan-calendar-web | d31a23dce119b6e76a9a1d396e6ed23b60a525f6 | [
"MIT"
] | 6 | 2020-02-24T19:16:02.000Z | 2021-09-21T12:39:53.000Z | src/aturan_calendar_web/converters.py | c17r/aturan-calendar-web | d31a23dce119b6e76a9a1d396e6ed23b60a525f6 | [
"MIT"
] | 1 | 2022-01-11T06:03:49.000Z | 2022-01-11T06:03:49.000Z | from datetime import datetime
from werkzeug.routing import BaseConverter, ValidationError
class DateConverter(BaseConverter):
"""Extracts a ISO8601 date from path and validates it"""
regex = r'\d{4}-\d{2}-\d{2}'
def to_python(self, value):
try:
return datetime.strptime(value, '%Y-%m-... | 27.444444 | 62 | 0.643725 |
9fd372fb137450e7936b7a151bd7b7bf8bd59cc1 | 1,648 | py | Python | qadil/Tokens.py | FunByJohn/QaDiL | 9e22bb061c5a2c32473c7ab3aa9b9cce4e98c963 | [
"MIT"
] | 7 | 2021-05-31T08:27:09.000Z | 2022-03-20T22:05:28.000Z | qadil/Tokens.py | FunByJohn/QaDiL | 9e22bb061c5a2c32473c7ab3aa9b9cce4e98c963 | [
"MIT"
] | 12 | 2021-06-05T20:37:11.000Z | 2022-02-13T16:38:52.000Z | qadil/Tokens.py | FunByJohn/QaDiL | 9e22bb061c5a2c32473c7ab3aa9b9cce4e98c963 | [
"MIT"
] | 2 | 2021-06-10T08:26:46.000Z | 2021-12-25T02:04:32.000Z | import re
class TokenType:
def __init__(self, name, rege=None):
self.name = name
if rege:
self.rege = re.compile(rege)
class Token:
SYMBOL = TokenType('SYMBOL', r'&')
BEGINENV = TokenType('BEGINENV', r'\\begin\{([A-Za-z\*]+)\}')
CONTROLSEQ = TokenType('CONTROLSEQ', r'\\(\... | 28.912281 | 96 | 0.57585 |
3935829efa0b45f20e3dd40d46176ee4c5d3ebf6 | 1,991 | py | Python | jax/experimental/sparse/util.py | VolodyaCO/jax | 4d148999404a572ebac6dd1b58f2d93f73245360 | [
"Apache-2.0"
] | 1 | 2020-12-07T14:55:41.000Z | 2020-12-07T14:55:41.000Z | jax/experimental/sparse/util.py | VolodyaCO/jax | 4d148999404a572ebac6dd1b58f2d93f73245360 | [
"Apache-2.0"
] | 10 | 2022-01-03T23:12:58.000Z | 2022-03-29T11:09:35.000Z | jax/experimental/sparse/util.py | SaturdayGenfo/jax | 84dcfcd7e52471f1ac1955d108255467e7950820 | [
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.639344 | 85 | 0.722752 |
9a6c1b95eb5bdea79020b06628b9aecefd3340be | 1,276 | py | Python | hammer/identification/lambdas/rds-public-snapshots-identification/initiate_to_desc_rds_public_snapshots.py | MrBakalo/hammer | 3d2143e5288c4272f6aae701668da32026099d9b | [
"Apache-2.0"
] | null | null | null | hammer/identification/lambdas/rds-public-snapshots-identification/initiate_to_desc_rds_public_snapshots.py | MrBakalo/hammer | 3d2143e5288c4272f6aae701668da32026099d9b | [
"Apache-2.0"
] | 3 | 2021-05-20T20:29:51.000Z | 2022-02-26T09:28:08.000Z | hammer/identification/lambdas/rds-public-snapshots-identification/initiate_to_desc_rds_public_snapshots.py | MrBakalo/hammer | 3d2143e5288c4272f6aae701668da32026099d9b | [
"Apache-2.0"
] | null | null | null | import os
import logging
from library.logger import set_logging
from library.config import Config
from library.aws.utility import Sns
def lambda_handler(event, context):
""" Lambda handler to initiate to find public RDS snapshots """
set_logging(level=logging.INFO)
logging.debug("Initiating public RDS s... | 34.486486 | 93 | 0.655956 |
c39776334a8a24757febfc12504143f5b8d0898b | 2,632 | py | Python | docs/conf.py | tonyleidong/OptimalFlow | f2aaddaa083673f0343a579899ad0db7ee294707 | [
"MIT"
] | 23 | 2020-08-30T18:40:08.000Z | 2022-02-28T11:36:29.000Z | docs/conf.py | tonyleidong/optimalflow | 8c38b2f6681ba8754f4d3aeb0785d55e8d8310ba | [
"MIT"
] | null | null | null | docs/conf.py | tonyleidong/optimalflow | 8c38b2f6681ba8754f4d3aeb0785d55e8d8310ba | [
"MIT"
] | 10 | 2020-09-08T17:17:13.000Z | 2022-02-07T03:07:28.000Z | # 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
# -- Path setup --------------------------------------------------------------
# If ex... | 32.9 | 79 | 0.678191 |
fc5d368363dc7d12caf6c3a60f650b8df99ac08c | 12,952 | py | Python | test/unit/test_cache.py | massmutual/dbt | c2dd4f54fd5d04bbf8c93abbdc50956e2a530f88 | [
"Apache-2.0"
] | null | null | null | test/unit/test_cache.py | massmutual/dbt | c2dd4f54fd5d04bbf8c93abbdc50956e2a530f88 | [
"Apache-2.0"
] | 1 | 2019-02-14T20:10:46.000Z | 2019-02-19T13:06:38.000Z | test/unit/test_cache.py | massmutual/dbt | c2dd4f54fd5d04bbf8c93abbdc50956e2a530f88 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from dbt.adapters.cache import RelationsCache
from dbt.adapters.default.relation import DefaultRelation
from multiprocessing.dummy import Pool as ThreadPool
import dbt.exceptions
import random
import time
def make_relation(schema, identifier):
return DefaultRelation.create(schema=sc... | 39.487805 | 79 | 0.591569 |
6d90f9a0d4cd0d2e0e1dcfab0a38f0ebe3c01103 | 20,010 | py | Python | egs/puebla_nahuatl/asr1/local/data_prep.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | egs/puebla_nahuatl/asr1/local/data_prep.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | egs/puebla_nahuatl/asr1/local/data_prep.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import os
import re
import shutil
import string
import sys
from argparse import ArgumentParser
from xml.dom.minidom import parse
s = "".join(chr(c) for c in range(sys.maxunicode + 1))
ws = "".join(re.findall(r"\s", s))
outtab = " " * len(ws)
trantab = str.maketrans(ws, outtab)
delset = string.... | 35.796064 | 88 | 0.512944 |
a866828feacc9c2d7298458147b03b63f0d63da8 | 362 | py | Python | setup.py | TimSC/PyFeatureTrack | 11668181e56fb9472a0c8db291c88546e7fae0cf | [
"BSD-2-Clause"
] | 33 | 2015-02-24T18:23:11.000Z | 2022-03-08T09:55:02.000Z | setup.py | Nestart/PyFeatureTrack | 11668181e56fb9472a0c8db291c88546e7fae0cf | [
"BSD-2-Clause"
] | 1 | 2017-03-08T21:07:33.000Z | 2017-06-04T21:58:01.000Z | setup.py | Nestart/PyFeatureTrack | 11668181e56fb9472a0c8db291c88546e7fae0cf | [
"BSD-2-Clause"
] | 15 | 2016-06-29T08:55:58.000Z | 2020-06-04T03:01:39.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("goodFeaturesUtils", ["goodFeaturesUtils.pyx"]),
Extension("trackFeaturesUtils", ["trackFeaturesUtils.pyx"])... | 27.846154 | 77 | 0.759669 |
c974c0c59a5310b96dfd047dfee067ff996e8a44 | 5,731 | py | Python | ietf/legacy_router.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2015-09-02T19:53:12.000Z | 2015-09-02T19:53:12.000Z | ietf/legacy_router.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/legacy_router.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | class LegacyRouter(object):
def db_for_read(self, model, **hints):
if model._meta.db_table in legacy_tables:
return 'legacy'
return None
def db_for_write(self, model, **hints):
if model._meta.db_table in legacy_tables:
raise Exception("You can't write to the lega... | 25.135965 | 92 | 0.668644 |
dca293de145a27bb24ef9a418541afa94b8510cc | 19,743 | py | Python | tests/util/test_util.py | jonathangreen/simplified-server-core | e8f305c1f886f00c4b835a9a65be214e4c4cd8e5 | [
"Apache-2.0"
] | null | null | null | tests/util/test_util.py | jonathangreen/simplified-server-core | e8f305c1f886f00c4b835a9a65be214e4c4cd8e5 | [
"Apache-2.0"
] | null | null | null | tests/util/test_util.py | jonathangreen/simplified-server-core | e8f305c1f886f00c4b835a9a65be214e4c4cd8e5 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""Test functionality of util/ that doesn't have its own module."""
from collections import defaultdict
from money import Money
from ...model import (
Identifier,
Edition
)
from ...testing import DatabaseTest
from ...util import (
Bigrams,
english_bigrams,
MetadataSimilarity,
... | 44.167785 | 863 | 0.617079 |
40c56464be012cdad29ac4c69317f6a6a17d15b1 | 739 | py | Python | config_example.py | Jirka-Mayer/BachelorThesis | 4f0f7fac207ffa59ec6b6e10cf16844aa2ddd61f | [
"MIT"
] | 4 | 2020-10-23T12:47:28.000Z | 2021-03-04T14:24:02.000Z | config_example.py | Jirka-Mayer/BachelorThesis | 4f0f7fac207ffa59ec6b6e10cf16844aa2ddd61f | [
"MIT"
] | null | null | null | config_example.py | Jirka-Mayer/BachelorThesis | 4f0f7fac207ffa59ec6b6e10cf16844aa2ddd61f | [
"MIT"
] | 1 | 2021-09-06T06:14:28.000Z | 2021-09-06T06:14:28.000Z | import os
# name of the model that will be used in training and validation
MODEL_NAME = "unnamed"
# how many threads to use for training and inference
NUM_THREADS = 1
# path to the primus dataset as downloaded from:
# https://grfia.dlsi.ua.es/primus/
PRIMUS_PATH = os.path.expanduser(
'~/Data/primusCalvoRizoAppli... | 28.423077 | 66 | 0.760487 |
b683fe590a51b99cff7148146a65709d5a963cea | 508 | py | Python | leonardo/module/nav/widget/simplelink/models.py | timgates42/django-leonardo | c155f97fee9e2be1e0f508d47a1c205028253ecc | [
"BSD-3-Clause"
] | 102 | 2015-04-30T12:27:14.000Z | 2021-10-31T18:21:16.000Z | leonardo/module/nav/widget/simplelink/models.py | timgates42/django-leonardo | c155f97fee9e2be1e0f508d47a1c205028253ecc | [
"BSD-3-Clause"
] | 158 | 2015-04-30T22:42:34.000Z | 2019-09-07T15:37:22.000Z | leonardo/module/nav/widget/simplelink/models.py | timgates42/django-leonardo | c155f97fee9e2be1e0f508d47a1c205028253ecc | [
"BSD-3-Clause"
] | 64 | 2015-05-10T12:00:39.000Z | 2021-07-29T19:47:27.000Z |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from leonardo.module.nav.forms import NavigationForm
from leonardo.module.web.models import Page, Widget
class SimpleLinkWidget(Widget):
feincms_item_editor_form = NavigationForm
page = models.ForeignKey(Page, verbose_name=... | 28.222222 | 55 | 0.738189 |
acb5b61f23aaf0fa0b529f0af604506824e8205b | 3,013 | py | Python | tcfcli/cmds/local/invoke/cli.py | Juliiii/scfcli | 1ae5acdc7a01cd5547870c91713027f389384ab7 | [
"Apache-2.0"
] | 1 | 2019-11-01T05:59:45.000Z | 2019-11-01T05:59:45.000Z | tcfcli/cmds/local/invoke/cli.py | Juliiii/scfcli | 1ae5acdc7a01cd5547870c91713027f389384ab7 | [
"Apache-2.0"
] | null | null | null | tcfcli/cmds/local/invoke/cli.py | Juliiii/scfcli | 1ae5acdc7a01cd5547870c91713027f389384ab7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import click
from tcfcli.common.operation_msg import Operation
from tcfcli.cmds.local.common.invoke_context import InvokeContext
from tcfcli.cmds.local.common.options import invoke_common_options
from tcfcli.common.user_exceptions import UserException
from tcfcli.help.message import LocalHelp a... | 39.644737 | 117 | 0.654829 |
d0cd3ec36b1b3b731b12bc26e6d1b5f7c311aa8f | 1,002 | py | Python | testinfra/backend/local.py | degibenz/testinfra | 3105cea40116b389f9185901f78e3c6db4ebfb18 | [
"Apache-2.0"
] | null | null | null | testinfra/backend/local.py | degibenz/testinfra | 3105cea40116b389f9185901f78e3c6db4ebfb18 | [
"Apache-2.0"
] | null | null | null | testinfra/backend/local.py | degibenz/testinfra | 3105cea40116b389f9185901f78e3c6db4ebfb18 | [
"Apache-2.0"
] | 1 | 2020-09-22T14:51:06.000Z | 2020-09-22T14:51:06.000Z | # coding: utf-8
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... | 31.3125 | 74 | 0.709581 |
ff9ee28415f6dd135cf50936824328ade15f95b0 | 533 | py | Python | authc/urls.py | swatprotocol/SWAT | d6e2e3ecd132d12fda6d437566c44b49665d6acd | [
"MIT"
] | null | null | null | authc/urls.py | swatprotocol/SWAT | d6e2e3ecd132d12fda6d437566c44b49665d6acd | [
"MIT"
] | null | null | null | authc/urls.py | swatprotocol/SWAT | d6e2e3ecd132d12fda6d437566c44b49665d6acd | [
"MIT"
] | null | null | null |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^participate/$', views.participate, name='participate'),
url(r'^check_fp/$', views.check_fp, name='check_fp'),
url(r'^canvas/$', views.canvas, name='canvas'),
url(r'^update_canvas/$... | 29.611111 | 92 | 0.682927 |
0821fffa265d6d91a0be24a09012f6f1a77a70ee | 6,848 | py | Python | tournament_test_multi.py | ahmfrz/Tournament | 103b6cf0dde49ba7e8519dd78fdc52dcf14a49a6 | [
"MIT"
] | null | null | null | tournament_test_multi.py | ahmfrz/Tournament | 103b6cf0dde49ba7e8519dd78fdc52dcf14a49a6 | [
"MIT"
] | null | null | null | tournament_test_multi.py | ahmfrz/Tournament | 103b6cf0dde49ba7e8519dd78fdc52dcf14a49a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Test cases for tournament.py
# These tests are not exhaustive, but they should cover the majority of cases.
#
# If you do add any of the extra credit options, be sure to add/modify these test cases
# as appropriate to account for your module's added functionality.
from tournament_multi import... | 41.50303 | 175 | 0.640625 |
f902b2b62dfa6458b7c24869ce0493a07e128c35 | 11,323 | py | Python | neutron/notifiers/nova.py | mihaibroc/neutron | dfb7c826d0846970bac00003cea98c9f6bd8f0b8 | [
"Apache-2.0"
] | null | null | null | neutron/notifiers/nova.py | mihaibroc/neutron | dfb7c826d0846970bac00003cea98c9f6bd8f0b8 | [
"Apache-2.0"
] | null | null | null | neutron/notifiers/nova.py | mihaibroc/neutron | dfb7c826d0846970bac00003cea98c9f6bd8f0b8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 OpenStack Foundation.
# 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... | 41.937037 | 79 | 0.611322 |
7c8fd84295924d8d9412a0d4033c9b28355674ea | 309 | py | Python | core/analysis/identification/hashes/__init__.py | iAbdullahMughal/d-scan | 4cebc74e410dde556cb95fdd7dd49e1d5a6fe9bf | [
"MIT"
] | 6 | 2019-03-27T08:20:10.000Z | 2020-01-19T11:44:59.000Z | core/analysis/identification/hashes/__init__.py | iAbdullahMughal/dscan | 4cebc74e410dde556cb95fdd7dd49e1d5a6fe9bf | [
"MIT"
] | null | null | null | core/analysis/identification/hashes/__init__.py | iAbdullahMughal/dscan | 4cebc74e410dde556cb95fdd7dd49e1d5a6fe9bf | [
"MIT"
] | 2 | 2019-05-14T17:32:42.000Z | 2019-09-19T03:45:30.000Z | __author__ = 'Muhammad Abdullah Mughal'
__website__ = 'https://www.iabdullahmughal.com'
__twitter__ = '@iabdullahmughal'
from core.analysis.identification.hashes.fuzzy_hash import FuzzyHash
from core.analysis.identification.hashes.calculate_hash import CalculateHash
__all__ = ['FuzzyHash', 'CalculateHash']
| 38.625 | 76 | 0.822006 |
cf539c45e84260bfa8eb2a58d75cad09cbc15cd3 | 579 | py | Python | lib/psql.py | AlexDyukov/pytest_example | 5e24855646b4afb23dabfca15549825fe8182005 | [
"MIT"
] | null | null | null | lib/psql.py | AlexDyukov/pytest_example | 5e24855646b4afb23dabfca15549825fe8182005 | [
"MIT"
] | 1 | 2021-01-02T17:46:41.000Z | 2021-01-02T17:46:41.000Z | lib/psql.py | AlexDyukov/pytest_example | 5e24855646b4afb23dabfca15549825fe8182005 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import psycopg2
from psycopg2 import pool
def create_pool(url, conn_limit):
pool = psycopg2.pool.ThreadedConnectionPool(
minconn = 1,
maxconn = conn_limit,
dsn = url
)
return pool
def execute_sql(pool, sql, params):
connection = pool.getco... | 19.965517 | 69 | 0.635579 |
ef74adad65ea3c7cc689ff61ca56da54a5201899 | 7,960 | py | Python | python/ray/workflow/recovery.py | daobook/ray | af9f1ef4dc160e0671206556b387f8017f3c3930 | [
"Apache-2.0"
] | 33 | 2020-05-27T14:25:24.000Z | 2022-03-22T06:11:30.000Z | python/ray/workflow/recovery.py | daobook/ray | af9f1ef4dc160e0671206556b387f8017f3c3930 | [
"Apache-2.0"
] | 115 | 2021-01-19T04:40:50.000Z | 2022-03-26T07:09:00.000Z | python/ray/workflow/recovery.py | daobook/ray | af9f1ef4dc160e0671206556b387f8017f3c3930 | [
"Apache-2.0"
] | 5 | 2020-08-06T15:53:07.000Z | 2022-02-09T03:31:31.000Z | from typing import List, Any, Union, Dict, Callable, Tuple, Optional
import ray
from ray.workflow import workflow_context
from ray.workflow import serialization
from ray.workflow.common import (Workflow, StepID, WorkflowRef,
WorkflowExecutionResult)
from ray.workflow import storage
fro... | 40.20202 | 78 | 0.665075 |
01c7c576d0f99a35c4831a4b20da0e2513eb0a78 | 707 | py | Python | pyfo/tests/unittests/models/gaussmodels/run_mvn.py | bradleygramhansen/pyfo | 559678080f27e7d9f3f194a0c28e9e8bfe71a7f3 | [
"MIT"
] | 3 | 2018-06-11T09:16:13.000Z | 2019-03-08T05:22:43.000Z | pyfo/tests/unittests/models/gaussmodels/run_mvn.py | bradleygramhansen/pyfo | 559678080f27e7d9f3f194a0c28e9e8bfe71a7f3 | [
"MIT"
] | null | null | null | pyfo/tests/unittests/models/gaussmodels/run_mvn.py | bradleygramhansen/pyfo | 559678080f27e7d9f3f194a0c28e9e8bfe71a7f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ..inference.dhmc import DHMCSampler as dhmc
from ..utils.eval_stats import *
from tests.unittests.models import model
dhmc_ = dhmc(model)
burn_in = 10 ** 3
n_sample = 10 ** 3
stepsize_range = [0.03,0.15]
n_step_range = [10, 20]
stats = dhmc_.sample(n_samples=n_samp... | 28.28 | 112 | 0.727016 |
37f82674d84573ac54239e3b9f4d347caefb030a | 1,795 | py | Python | utils/BKAR.py | thanhhoangvan/BKAR | 74745a0584c3fc18ad6184f374f9b0c2c5713ccd | [
"Apache-2.0"
] | null | null | null | utils/BKAR.py | thanhhoangvan/BKAR | 74745a0584c3fc18ad6184f374f9b0c2c5713ccd | [
"Apache-2.0"
] | 1 | 2022-02-28T05:40:23.000Z | 2022-02-28T05:41:01.000Z | utils/BKAR.py | BKAR-Jetson-Self-driving-vehicle/BKAR | 893d428983de294c9f5e4fecb7138463bc3838e6 | [
"Apache-2.0"
] | null | null | null | #!../venv/bin/python3
# -*- coding: utf-8 -*-
"""
+============================================================+
- Tác Giả: Hoàng Thành
- Viện Toán Ứng dụng và Tin học(SAMI - HUST)
- Email: thanh.hoangvan051199@gmail.com
- Github: https://github.com/thanhhoangvan
+======================================================... | 23.618421 | 124 | 0.533705 |
63722264c25dc013c3d637490c2b299e83e89de0 | 104,399 | py | Python | pandas/tests/test_categorical.py | bmu/pandas | 549b72f07ffdeb6d54b2865c90d95a256e4231ad | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tests/test_categorical.py | bmu/pandas | 549b72f07ffdeb6d54b2865c90d95a256e4231ad | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tests/test_categorical.py | bmu/pandas | 549b72f07ffdeb6d54b2865c90d95a256e4231ad | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=E1101,E1103,W0232
from datetime import datetime
from pandas.compat import range, lrange, u
import os
import pickle
import re
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
from pandas import Categorical, Index, Series, DataFrame, PeriodInde... | 39.292059 | 132 | 0.558703 |
d42916a18390039a2f26cc26365f1e24b429d226 | 9,957 | py | Python | api/system/menu_info.py | wuxh123/my_bottle | 06cd7cda43b5d7db7522f76e65631510dada1329 | [
"Apache-2.0"
] | 3 | 2019-02-28T06:44:56.000Z | 2022-03-23T12:26:42.000Z | code/api/system/menu_info.py | kadycui/BottleAdmin | 427a0fa8a63680b49565d131f3f4f6aac228efad | [
"MIT"
] | null | null | null | code/api/system/menu_info.py | kadycui/BottleAdmin | 427a0fa8a63680b49565d131f3f4f6aac228efad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import json
from bottle import delete, get, post, put
from common import convert_helper, string_helper, web_helper, log_helper
from common.string_helper import string
from common.except_helper import exception_handling
from logic import menu_info_logic, positions_logic, _common_log... | 33.982935 | 134 | 0.608517 |
683b07630d6482e891228d2f2d4ceafa427a55d9 | 4 | py | Python | helloworld.py | sahanasbrmnym/sfi-git | a3889f2b01417d2b1e58850ea0332f89447cc646 | [
"MIT"
] | null | null | null | helloworld.py | sahanasbrmnym/sfi-git | a3889f2b01417d2b1e58850ea0332f89447cc646 | [
"MIT"
] | null | null | null | helloworld.py | sahanasbrmnym/sfi-git | a3889f2b01417d2b1e58850ea0332f89447cc646 | [
"MIT"
] | null | null | null | CZ
| 1.333333 | 2 | 0.5 |
5f4b39c3817109ecd3349a395b723be48d4a5f5f | 1,796 | py | Python | demo/person/project/routers.py | giovannifarlley/ms--fastapi-template | 5bbd6903305db07cc18330ec86fb04ca518e9dab | [
"MIT"
] | 24 | 2021-03-07T13:00:35.000Z | 2022-02-11T03:41:51.000Z | demo/person/project/routers.py | giovannifarlley/ms--fastapi-template | 5bbd6903305db07cc18330ec86fb04ca518e9dab | [
"MIT"
] | 2 | 2021-05-15T01:05:17.000Z | 2021-08-13T13:53:57.000Z | demo/person/project/routers.py | giovannifarlley/ms--fastapi-template | 5bbd6903305db07cc18330ec86fb04ca518e9dab | [
"MIT"
] | 4 | 2021-04-27T12:18:33.000Z | 2021-10-03T23:43:23.000Z | from fastapi import FastAPI
from elasticapm.contrib.starlette import ElasticAPM
from project.infrastructure.open_api.open_api_schema import Schema
from project.infrastructure.drivers.apm.adapter import ApmAdapter
from project.resources.lifecheck.controller import router as life_check_api
from project.resources.person.p... | 32.654545 | 93 | 0.773385 |
e7d038a42b20af8cae79fd38261888a36d1954b7 | 1,007 | py | Python | clean_unicode.py | kwoodham/sublime | ed3dcd7b0a22938d1d7de2d55db3cc2960ed117f | [
"CC-BY-4.0"
] | 1 | 2015-08-04T11:43:34.000Z | 2015-08-04T11:43:34.000Z | clean_unicode.py | kwoodham/sublime | ed3dcd7b0a22938d1d7de2d55db3cc2960ed117f | [
"CC-BY-4.0"
] | null | null | null | clean_unicode.py | kwoodham/sublime | ed3dcd7b0a22938d1d7de2d55db3cc2960ed117f | [
"CC-BY-4.0"
] | null | null | null | import sublime_plugin
import sublime
# See https://www.ascii.cl/htmlcodes.htm
# 23 Oct 2017
# Revised 29 June 2020
class CleanUnicodeCommand(sublime_plugin.TextCommand):
def run(self, edit):
a = {}
a[ 169] = "(C)"
a[ 174] = "(R)"
a[8211] = "--"
a[8212] = "--"
a[8... | 27.972222 | 85 | 0.467726 |
54567d417d2f649ae076b45452df7a8c7caa3ac8 | 480 | py | Python | tech_notes_code/recompilation/test/test_tf2.py | Paperspace/tutorials | 8e20ffb687080c44e75dabea594d2b57acc53713 | [
"MIT"
] | null | null | null | tech_notes_code/recompilation/test/test_tf2.py | Paperspace/tutorials | 8e20ffb687080c44e75dabea594d2b57acc53713 | [
"MIT"
] | null | null | null | tech_notes_code/recompilation/test/test_tf2.py | Paperspace/tutorials | 8e20ffb687080c44e75dabea594d2b57acc53713 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
from pathlib import Path
import pytest
from examples_tests.test_util import SubProcessChecker
working_path = Path(__file__).parent.parent
class TestRecompilation(SubProcessChecker):
@pytest.mark.category1
@pytest.mark.ipus(1)
def test_tf2_recomp... | 25.263158 | 56 | 0.695833 |
b337eae2bc03b16fa098bbc4b78634b6056f777e | 11,221 | py | Python | signalling/simple-server.py | makelinux/gstwebrtc-demos | 1981ef164358caad5c0dc552d7d19c84a1608498 | [
"BSD-2-Clause"
] | 1 | 2021-09-29T08:18:00.000Z | 2021-09-29T08:18:00.000Z | signalling/simple-server.py | boddob/gstwebrtc-demos | 3fd0aafbc08b611a101caf08baafe2e034ba3cb3 | [
"BSD-2-Clause"
] | null | null | null | signalling/simple-server.py | boddob/gstwebrtc-demos | 3fd0aafbc08b611a101caf08baafe2e034ba3cb3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Example 1-1 call signalling server
#
# Copyright (C) 2017 Centricular Ltd.
#
# Author: Nirbheek Chauhan <nirbheek@centricular.com>
#
import os
import sys
import ssl
import logging
import asyncio
import websockets
import argparse
import http
from concurrent.futures._base import TimeoutError... | 39.097561 | 133 | 0.587292 |
9234fc7cdc877c3dad98fa7c6a0c9062cc348fe4 | 993 | py | Python | Leetcode/RemoveDuplicatesfromSortedListII.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | null | null | null | Leetcode/RemoveDuplicatesfromSortedListII.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | 1 | 2019-09-24T22:04:03.000Z | 2019-09-24T22:04:03.000Z | Leetcode/RemoveDuplicatesfromSortedListII.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def deleteDuplicates(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
if head is None:
return hea... | 26.131579 | 39 | 0.503525 |
069e1f031f6a78dc37a38d3f4b590e50c34fc2a1 | 5,263 | py | Python | tests/diff_treediff.py | jposi/regulations-parser | 220a8167bdcfa0a48b64208c6831c60a23869cd5 | [
"CC0-1.0"
] | 1 | 2017-03-21T05:11:19.000Z | 2017-03-21T05:11:19.000Z | tests/diff_treediff.py | jposi/regulations-parser | 220a8167bdcfa0a48b64208c6831c60a23869cd5 | [
"CC0-1.0"
] | null | null | null | tests/diff_treediff.py | jposi/regulations-parser | 220a8167bdcfa0a48b64208c6831c60a23869cd5 | [
"CC0-1.0"
] | null | null | null | #vim: set encoding=utf-8
from unittest import TestCase
from regparser.tree import reg_text, struct
from regparser.diff import treediff
class TreeDiffTest(TestCase):
def test_build_hash(self):
title = u"Regulation Title"
sect1_title = u"§ 204.1 Best Section"
sect1 = u"(a) I believe this is... | 39.571429 | 80 | 0.553867 |
dba5e81e5d56d40278f417e56b0853e7e2ec042f | 1,093 | py | Python | helpers/logger.py | malloryw/ApexIntentionActions | 6f52a1637f8d8d7ae459b5967488016c2a5c4a4b | [
"Apache-2.0"
] | 3 | 2017-08-22T15:21:23.000Z | 2018-04-25T12:49:34.000Z | helpers/logger.py | malloryw/ApexIntentionActions | 6f52a1637f8d8d7ae459b5967488016c2a5c4a4b | [
"Apache-2.0"
] | 1 | 2018-08-10T06:58:49.000Z | 2018-08-10T06:58:49.000Z | helpers/logger.py | malloryw/ApexIntentionActions | 6f52a1637f8d8d7ae459b5967488016c2a5c4a4b | [
"Apache-2.0"
] | 1 | 2018-08-09T22:48:53.000Z | 2018-08-09T22:48:53.000Z | import sublime
class Logger(object):
def __init__(self, name):
self.name = name
def debug(self, *messages):
settings = sublime.load_settings('SmartApexPrefs.sublime-settings')
debug_mode = settings.get("debug")
if not debug_mode:
return
self._out('DEBUG', ... | 24.840909 | 79 | 0.57548 |
1afaf21f03cf649c472f8476d0203243d26cc685 | 9,959 | py | Python | 1-grid-world/1-policy-iteration/environment.py | donghyun-daniel/RL-kr | 13c8df80aaa6468861348f3e3d4bfe4ec36323f1 | [
"MIT"
] | null | null | null | 1-grid-world/1-policy-iteration/environment.py | donghyun-daniel/RL-kr | 13c8df80aaa6468861348f3e3d4bfe4ec36323f1 | [
"MIT"
] | null | null | null | 1-grid-world/1-policy-iteration/environment.py | donghyun-daniel/RL-kr | 13c8df80aaa6468861348f3e3d4bfe4ec36323f1 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import Button
import time
import numpy as np
from PIL import ImageTk, Image
PhotoImage = ImageTk.PhotoImage
UNIT = 100 # 픽셀 수
HEIGHT = 5 # 그리드월드 세로
WIDTH = 5 # 그리드월드 가로
TRANSITION_PROB = 1
POSSIBLE_ACTIONS = [0, 1, 2, 3] # 좌, 우, 상, 하
ACTIONS = [(-1, 0), (1, 0), (0, -1), (0, 1)] #... | 40.64898 | 85 | 0.550758 |
0ecc86111873cbcdd6f486e7630c4895524b88c9 | 415 | py | Python | app_api/migrations/0002_auto_20200322_0929.py | lbb4511/storyhub | 2649d746ca245a1d180f0b668e78fb5595c6d700 | [
"Apache-2.0"
] | 2 | 2020-04-23T01:09:58.000Z | 2020-04-23T08:15:14.000Z | app_api/migrations/0002_auto_20200322_0929.py | kisskillkiss/MrDoc | 402993c9aa766db5490da40a90505e562e85fa71 | [
"MIT"
] | 8 | 2021-03-30T13:59:00.000Z | 2022-01-13T02:59:59.000Z | app_api/migrations/0002_auto_20200322_0929.py | kisskillkiss/MrDoc | 402993c9aa766db5490da40a90505e562e85fa71 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.11 on 2020-03-22 09:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_api', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='usertoken',
name='token',
... | 21.842105 | 87 | 0.607229 |
905d40bda024fee3c94d4c9506a2a67204d4bb82 | 3,572 | py | Python | site/source/get_api_items.py | rhysd/emscripten | c01dd844f5a55c2c5e26402af54bb28173260174 | [
"MIT"
] | null | null | null | site/source/get_api_items.py | rhysd/emscripten | c01dd844f5a55c2c5e26402af54bb28173260174 | [
"MIT"
] | null | null | null | site/source/get_api_items.py | rhysd/emscripten | c01dd844f5a55c2c5e26402af54bb28173260174 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2015 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
#
# This script gets all the API items defined ... | 34.346154 | 145 | 0.630179 |
3854aebd38ebca30525a009271ba0e3eed9663f9 | 2,520 | py | Python | slurmjob.py | FunctionLab/flib | 071731175350abcb894ded799956ab0ad83e5c2b | [
"BSD-3-Clause"
] | 2 | 2016-08-28T02:48:46.000Z | 2016-09-27T12:42:57.000Z | slurmjob.py | FunctionLab/flib | 071731175350abcb894ded799956ab0ad83e5c2b | [
"BSD-3-Clause"
] | 4 | 2016-09-26T20:41:09.000Z | 2017-03-24T15:13:09.000Z | slurmjob.py | FunctionLab/flib | 071731175350abcb894ded799956ab0ad83e5c2b | [
"BSD-3-Clause"
] | 3 | 2016-09-27T12:42:59.000Z | 2017-12-04T22:52:13.000Z | import sys
from subprocess import Popen, PIPE
class SLURMJob:
"""
Job for working with SLURM at Princeton
"""
def __init__(self, name='', queue='default', nodes=1, ppn=1,
walltime = '01:00:00', mail='a', addr=None,
cwd = True, command = None, array=None, depends=None,... | 35 | 85 | 0.560714 |
8f96bd126fc981fa90128cf271786707ccf5111e | 54 | py | Python | app/models/__init__.py | TylerOBrien/Whiskpy | 54c13eecbb790309df7e16ea11e9ffdaf86f5d01 | [
"MIT"
] | null | null | null | app/models/__init__.py | TylerOBrien/Whiskpy | 54c13eecbb790309df7e16ea11e9ffdaf86f5d01 | [
"MIT"
] | null | null | null | app/models/__init__.py | TylerOBrien/Whiskpy | 54c13eecbb790309df7e16ea11e9ffdaf86f5d01 | [
"MIT"
] | null | null | null | from .user import User
from .message import Message | 27 | 28 | 0.777778 |
24b7df43cc652d4ff5fa39494af49e9662b1cf51 | 271 | py | Python | 2020/02/part1.py | Welzin/advent-of-code | f588b96210d762a057a2d6818927994c46f0bfc7 | [
"CC0-1.0"
] | null | null | null | 2020/02/part1.py | Welzin/advent-of-code | f588b96210d762a057a2d6818927994c46f0bfc7 | [
"CC0-1.0"
] | null | null | null | 2020/02/part1.py | Welzin/advent-of-code | f588b96210d762a057a2d6818927994c46f0bfc7 | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python3
import re
fd = open("input", "r")
valid = 0
for line in fd.readlines() :
least, max, char, string = re.search(r"(\d+)-(\d+) (.): (.*)", line).groups()
if int(least) <= string.count(char) <= int(max) :
valid += 1
print(valid)
| 16.9375 | 81 | 0.546125 |
d61c15d756d511e9d2662d57bdcc587de4d2bfba | 300 | py | Python | watermark/updater/__init__.py | BoboTiG/watermark-me | 46b94e8cc1d85f4b049fb93d05842bd5ed01af91 | [
"MIT"
] | null | null | null | watermark/updater/__init__.py | BoboTiG/watermark-me | 46b94e8cc1d85f4b049fb93d05842bd5ed01af91 | [
"MIT"
] | 29 | 2020-01-05T17:07:49.000Z | 2021-06-02T05:57:30.000Z | watermark/updater/__init__.py | BoboTiG/watermark-gui | 6da7a85d52ada5a5a22cd7e324055ace6104957c | [
"MIT"
] | 1 | 2020-04-06T14:44:57.000Z | 2020-04-06T14:44:57.000Z | """
GUI to watermark your pictures with text and/or another picture.
This module is maintained by Mickaël Schoentgen <contact@tiger-222.fr>.
You can always get the latest version of this module at:
https://github.com/BoboTiG/watermark-me
If that URL should fail, try contacting the author.
"""
| 30 | 71 | 0.763333 |
3534437a0905f2969db0a57c19b1b89c66a33c91 | 656 | py | Python | test/test_timer.py | apgeorg/thyme | 47bf312c27f76c6392370a499a23738dcae6ad17 | [
"MIT"
] | 1 | 2019-12-05T07:00:40.000Z | 2019-12-05T07:00:40.000Z | test/test_timer.py | apgeorg/thyme | 47bf312c27f76c6392370a499a23738dcae6ad17 | [
"MIT"
] | null | null | null | test/test_timer.py | apgeorg/thyme | 47bf312c27f76c6392370a499a23738dcae6ad17 | [
"MIT"
] | null | null | null | import unittest
from thym.thym.timer import Timer
class TestTimer(unittest.TestCase):
def timeout(self, name):
print("Timeout: " + name)
def test_init(self):
t = Timer(1, self.timeout, oneshot=True, args=["test_init"])
self.assertIsNotNone(t)
def test_start(self):
t = Tim... | 25.230769 | 69 | 0.615854 |
d8baf812ab531eeb19c3dde16f15142d20157c95 | 856 | py | Python | examples/magic8.py | Bakkom/micropython | a92ca9b1f907c07a01116b0eb464ca4743a28bf1 | [
"MIT"
] | 594 | 2015-10-20T07:09:10.000Z | 2022-03-26T23:17:53.000Z | examples/magic8.py | Bakkom/micropython | a92ca9b1f907c07a01116b0eb464ca4743a28bf1 | [
"MIT"
] | 666 | 2015-10-20T09:18:14.000Z | 2022-03-25T12:30:10.000Z | examples/magic8.py | Bakkom/micropython | a92ca9b1f907c07a01116b0eb464ca4743a28bf1 | [
"MIT"
] | 325 | 2015-10-20T08:46:18.000Z | 2022-02-25T12:21:15.000Z | # Magic 8 ball by Nicholas Tollervey. February 2016.
#
# Ask a question then shake.
#
# This program has been placed into the public domain.
from microbit import *
import random
answers = [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes, definitely",
"You may rely on it",
"As I ... | 21.948718 | 54 | 0.610981 |
14e8b7e7d283070c2e59e47d1811cf8d7f758573 | 1,012 | py | Python | examples/assets/shaders/10_Pipelines/compile.py | BobLChen/VulkanDemos | 78abfef10ff0138ed88c23ddfed4d98ce956e38e | [
"MIT"
] | 596 | 2019-07-30T03:07:57.000Z | 2022-03-31T07:45:20.000Z | examples/assets/shaders/9_LoadMesh/compile.py | BobLChen/VulkanSamples | 78abfef10ff0138ed88c23ddfed4d98ce956e38e | [
"MIT"
] | 9 | 2019-07-28T08:48:41.000Z | 2022-03-31T07:53:50.000Z | examples/assets/shaders/9_LoadMesh/compile.py | BobLChen/VulkanSamples | 78abfef10ff0138ed88c23ddfed4d98ce956e38e | [
"MIT"
] | 79 | 2019-08-05T03:05:01.000Z | 2022-03-31T07:45:22.000Z | # coding: utf-8
import os
import sys
def IsExe(path):
return os.path.isfile(path) and os.access(path, os.X_OK)
def FindGlslang():
exeName = "glslangvalidator"
if os.name == "nt":
exeName += ".exe"
for exeDir in os.environ["PATH"].split(os.pathsep):
fullPath = os.path.join(exeDir... | 24.095238 | 103 | 0.631423 |
4a1d677a429e18afaed2304a8942a2c0d7951777 | 748 | py | Python | tradearn/products/migrations/0001_initial.py | didils/tradmarkearn | a2a49314639a419db1b7b414319745c81fcc26e1 | [
"MIT"
] | null | null | null | tradearn/products/migrations/0001_initial.py | didils/tradmarkearn | a2a49314639a419db1b7b414319745c81fcc26e1 | [
"MIT"
] | null | null | null | tradearn/products/migrations/0001_initial.py | didils/tradmarkearn | a2a49314639a419db1b7b414319745c81fcc26e1 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-04-06 07:16
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField... | 29.92 | 114 | 0.586898 |
3dd76988f5a0b9ab2c514c42af2e4ef6d7c80ff3 | 1,128 | py | Python | src/radical/ensemblemd/multi_cluster_environment.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | src/radical/ensemblemd/multi_cluster_environment.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | src/radical/ensemblemd/multi_cluster_environment.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""TODO: Docstring.
"""
__author__ = "Ole Weider <ole.weidner@rutgers.edu>"
__copyright__ = "Copyright 2014, http://radical.rutgers.edu"
__license__ = "MIT"
from radical.ensemblemd.engine import Engine
from radical.ensemblemd.exceptions import TypeError
from radical.ensemblemd.execution_pa... | 30.486486 | 80 | 0.560284 |
59b7f103b5e1154299e61e9ae131b5c6f94ace11 | 2,832 | py | Python | ggpy/cruft/autocode/SentenceDomainModels.py | hobson/ggpy | 4e6e6e876c3a4294cd711647051da2d9c1836b60 | [
"MIT"
] | 1 | 2015-01-26T19:07:45.000Z | 2015-01-26T19:07:45.000Z | ggpy/cruft/autocode/SentenceDomainModels.py | hobson/ggpy | 4e6e6e876c3a4294cd711647051da2d9c1836b60 | [
"MIT"
] | null | null | null | ggpy/cruft/autocode/SentenceDomainModels.py | hobson/ggpy | 4e6e6e876c3a4294cd711647051da2d9c1836b60 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
""" generated source for module SentenceDomainModels """
# package: org.ggp.base.util.gdl.model
import java.util.Collection
import java.util.List
import java.util.Map
import java.util.Set
import org.ggp.base.util.gdl.GdlUtils
import org.ggp.base.util.gdl.grammar.GdlConstant
import org.ggp.ba... | 31.120879 | 93 | 0.683263 |
b1f01c44359d7f72a8fde161eca6cea4f426796f | 2,516 | py | Python | venv/lib/python2.7/site-packages/ansible/plugins/connection/iocage.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | venv/lib/python2.7/site-packages/ansible/plugins/connection/iocage.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | venv/lib/python2.7/site-packages/ansible/plugins/connection/iocage.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | # Based on jail.py
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2016, Stephan Lohse <dev-github@ploek.org>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (a... | 31.45 | 92 | 0.647854 |
aceed2479058450dd37830c8b4dbebe6d4077be2 | 4,992 | py | Python | Dataset.py | bmahlbrand/Learning-to-Generate-Chairs-with-Convolutional-Neural-Networks | 122d975a67f683d72718a60febbde351764db8a6 | [
"MIT"
] | 6 | 2018-11-02T16:45:36.000Z | 2021-06-30T14:11:59.000Z | Dataset.py | bmahlbrand/Learning-to-Generate-Chairs-with-Convolutional-Neural-Networks | 122d975a67f683d72718a60febbde351764db8a6 | [
"MIT"
] | 1 | 2020-04-10T09:49:20.000Z | 2020-04-10T09:49:20.000Z | Dataset.py | bmahlbrand/Learning-to-Generate-Chairs-with-Convolutional-Neural-Networks | 122d975a67f683d72718a60febbde351764db8a6 | [
"MIT"
] | 5 | 2018-11-29T00:01:08.000Z | 2021-11-08T12:21:52.000Z | import os
import re
import numpy as np
from numpy import newaxis
import pandas
from skimage import io
from matplotlib import pyplot as plt
import pandas as pd
import torch
from torch.utils import data
from torchvision import transforms
import torchvision.transforms.functional as F
from utils.fs_utils import get_all_f... | 31.796178 | 119 | 0.596354 |
73c61dd01f394232470d3096a4e6235bf8fb50a3 | 303 | py | Python | cart/forms.py | revanth-reddy/raitubazaar | 8013b1158fdd511f5bc0389194237e6cfa54f635 | [
"MIT"
] | 1 | 2019-06-19T11:12:19.000Z | 2019-06-19T11:12:19.000Z | cart/forms.py | revanth-reddy/Raitubazaar | 8013b1158fdd511f5bc0389194237e6cfa54f635 | [
"MIT"
] | 13 | 2020-02-12T00:18:24.000Z | 2022-03-11T23:51:15.000Z | cart/forms.py | revanth-reddy/Raitubazaar | 8013b1158fdd511f5bc0389194237e6cfa54f635 | [
"MIT"
] | 1 | 2019-09-07T11:53:35.000Z | 2019-09-07T11:53:35.000Z | from django import forms
PRODUCT_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 26)]
class CartAddProductForm(forms.Form):
quantity = forms.TypedChoiceField(choices=PRODUCT_QUANTITY_CHOICES, coerce=int)
update = forms.BooleanField(required=False, initial=False, widget=forms.HiddenInput)
| 30.3 | 88 | 0.775578 |
4f0e276af71b0834eb752d0943c8c0321fabc135 | 73 | py | Python | Bonsucesso/Semana 05/Exemplo014/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | 2 | 2022-03-25T02:04:11.000Z | 2022-03-25T09:26:44.000Z | Bonsucesso/Semana 05/Exemplos de Sala de aula/Exemplo014/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | null | null | null | Bonsucesso/Semana 05/Exemplos de Sala de aula/Exemplo014/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | null | null | null |
valor = [7, 5]
soma = valor[0] + valor[1]
print(soma)
print(valor) | 6.636364 | 26 | 0.575342 |
e4d029e9750861b60cbafb97fa4f520467ac1ad2 | 381 | py | Python | Python_basic/3.hano.py | HKCM/Python | cf5f6e5daedd8c57cf6432c8927e2615297bc1a8 | [
"Apache-2.0"
] | null | null | null | Python_basic/3.hano.py | HKCM/Python | cf5f6e5daedd8c57cf6432c8927e2615297bc1a8 | [
"Apache-2.0"
] | null | null | null | Python_basic/3.hano.py | HKCM/Python | cf5f6e5daedd8c57cf6432c8927e2615297bc1a8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
def hano(num,origin="A",proxy="B",target="C"):
'''
汉诺塔大家应该知道
把环从A柱移动到C柱,需要经过B柱的转换
这个例子主要是递归操作
'''
if num == 1:
print(origin,'-->',target)
else:
hano(num-1,origin,target,proxy)
print(origin,'-->',target)
hano(num-1... | 21.166667 | 46 | 0.55643 |
cd0528f82ea38a692871e12a3723fda4803a0675 | 9,745 | py | Python | panda/api/users.py | higs4281/panda | 133baa47882a289773a30c9656e2ea4efe569387 | [
"MIT"
] | 72 | 2015-02-12T22:28:11.000Z | 2022-01-20T08:35:31.000Z | panda/api/users.py | higs4281/panda | 133baa47882a289773a30c9656e2ea4efe569387 | [
"MIT"
] | 24 | 2015-01-12T21:52:35.000Z | 2021-12-13T19:39:46.000Z | panda/api/users.py | higs4281/panda | 133baa47882a289773a30c9656e2ea4efe569387 | [
"MIT"
] | 31 | 2015-01-09T19:20:19.000Z | 2021-10-20T01:21:23.000Z | #!/usr/bin/env python
from django.conf import settings
from django.conf.urls.defaults import url
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import email_re
from django.utils.translation import ugettext_lazy as _
from tastypie import fields
from tastypie import http
from tastypie.... | 35.565693 | 180 | 0.627091 |
b660eee3586b81e3dafb83fe4ae582d59a2807a2 | 2,698 | py | Python | pephub/main.py | pepkit/pephub | a135a5ab4b4e987e0f6d49124d8be7c5f274829f | [
"BSD-2-Clause"
] | null | null | null | pephub/main.py | pepkit/pephub | a135a5ab4b4e987e0f6d49124d8be7c5f274829f | [
"BSD-2-Clause"
] | 20 | 2018-10-09T01:11:18.000Z | 2022-02-16T22:06:08.000Z | pephub/main.py | pepkit/pephub | a135a5ab4b4e987e0f6d49124d8be7c5f274829f | [
"BSD-2-Clause"
] | null | null | null | import sys
import logmuse
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.staticfiles import StaticFiles
try: from pephub.db import load_data_tree
except: from .db import load_data_tree
# set up global pep storage
global _PEP_STORES # the object in memory ... | 24.089286 | 94 | 0.716457 |
2fe1f4ee572840ea0eb64a5b8052d2f294d8460f | 3,430 | py | Python | frille-lang/lib/python3.6/site-packages/wasabi/markdown.py | frillecode/CDS-spring-2021-language | a0b2116044cd20d4a34b98f23bd2663256c90c5d | [
"MIT"
] | 339 | 2018-11-17T18:16:38.000Z | 2022-03-31T15:42:57.000Z | frille-lang/lib/python3.6/site-packages/wasabi/markdown.py | frillecode/CDS-spring-2021-language | a0b2116044cd20d4a34b98f23bd2663256c90c5d | [
"MIT"
] | 11 | 2019-05-04T13:16:38.000Z | 2022-03-23T01:23:21.000Z | frille-lang/lib/python3.6/site-packages/wasabi/markdown.py | frillecode/CDS-spring-2021-language | a0b2116044cd20d4a34b98f23bd2663256c90c5d | [
"MIT"
] | 25 | 2018-11-25T13:32:22.000Z | 2022-03-21T08:09:32.000Z | # coding: utf8
from __future__ import unicode_literals, print_function
class MarkdownRenderer:
"""Simple helper for generating raw Markdown."""
def __init__(self, no_emoji=False):
"""Initialize the renderer.
no_emoji (bool): Don't show emoji in titles etc.
"""
self.data = []
... | 32.056075 | 86 | 0.540816 |
de221fadc42a0cb63e57564577f2447aa01b8dde | 4,907 | py | Python | buildhat/distance.py | mutesplash/python-build-hat | a9047ec01dfb9b4b4ee480df273d34d9c026b62c | [
"MIT"
] | null | null | null | buildhat/distance.py | mutesplash/python-build-hat | a9047ec01dfb9b4b4ee480df273d34d9c026b62c | [
"MIT"
] | null | null | null | buildhat/distance.py | mutesplash/python-build-hat | a9047ec01dfb9b4b4ee480df273d34d9c026b62c | [
"MIT"
] | null | null | null | """Distance sensor handling functionality"""
from threading import Condition
from .devices import Device
from .exc import DistanceSensorError
class DistanceSensor(Device):
"""Distance sensor
:param port: Port of device
:raises DeviceError: Occurs if there is no distance sensor attached to port
"""
... | 29.208333 | 101 | 0.606073 |
6b0bdeee43b224f8f3989c07c4b2c11cf4d3ca16 | 23,476 | py | Python | scripts/cyp2b6/b37/bin/snv_def_modules.py | twesigomwedavid/CypGen | 0febf576e26da1884b4d8e9f79542bf1b01e969e | [
"MIT"
] | 3 | 2020-08-03T16:52:30.000Z | 2021-06-30T16:59:17.000Z | scripts/cyp2b6/hg38/bin/snv_def_modules.py | twesigomwedavid/CypGen | 0febf576e26da1884b4d8e9f79542bf1b01e969e | [
"MIT"
] | null | null | null | scripts/cyp2b6/hg38/bin/snv_def_modules.py | twesigomwedavid/CypGen | 0febf576e26da1884b4d8e9f79542bf1b01e969e | [
"MIT"
] | 2 | 2020-10-14T10:18:22.000Z | 2020-12-16T18:03:15.000Z | #!/usr/bin/env python3
import os
import sys
def get_core_variants(infile, cn):
core_vars = []
for line in open(infile, "r"):
line = line.strip()
core_vars.append(line)
core_vars = ";".join(sorted(core_vars))
if int(cn) == 1:
core_vars = core_vars.replace("~0/1", "~1/1")
... | 42.683636 | 194 | 0.462558 |
1bc893fc05997be56e391492f6f1288f9c7dc4ad | 16,935 | py | Python | userbot/modules/animasi4.py | nmiabdfhmy/Zelda-Ubot | ec04aabae4bc10a8d7460376a9cfb1f3f2ccb017 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-12-27T02:23:24.000Z | 2021-12-28T06:25:39.000Z | userbot/modules/animasi4.py | nmiabdfhmy/Zelda-Ubot | ec04aabae4bc10a8d7460376a9cfb1f3f2ccb017 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/animasi4.py | nmiabdfhmy/Zelda-Ubot | ec04aabae4bc10a8d7460376a9cfb1f3f2ccb017 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2021-12-27T02:23:06.000Z | 2022-02-05T08:33:06.000Z | from time import sleep
from userbot import CMD_HELP, bot
from userbot.events import register
from telethon import events
import asyncio
@register(outgoing=True, pattern="^.sayang$")
async def koc(e):
if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"):
await e.edit("I LOVEE YOUUU 💕")
... | 37.633333 | 113 | 0.354119 |
46a65afa5cadf85e551d3c69c4e2fbb87cce7a03 | 7,216 | py | Python | data_loader.py | uw-loci/demo_wsi_superres | 38283031eee4823d332fae1b6b32b5da33fb957f | [
"MIT"
] | 10 | 2020-04-03T14:41:23.000Z | 2021-12-15T01:55:35.000Z | data_loader.py | uw-loci/demo_wsi_superres | 38283031eee4823d332fae1b6b32b5da33fb957f | [
"MIT"
] | null | null | null | data_loader.py | uw-loci/demo_wsi_superres | 38283031eee4823d332fae1b6b32b5da33fb957f | [
"MIT"
] | 2 | 2021-02-08T14:27:30.000Z | 2021-04-08T04:53:18.000Z | from __future__ import print_function, division
import os, glob, random
import torch
import pandas as pd
from skimage import io, transform, img_as_float, color, img_as_ubyte, exposure
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, ... | 42.447059 | 159 | 0.63179 |
69323282bcf7075d87179731256b408b9cdfe77d | 2,289 | py | Python | CarletonCourses/DFAtoNFA.py | ganewman42/CodeSamples | 48b9f8fa3eec0f81a8b472bbaeae9cd9a53e6657 | [
"MIT"
] | null | null | null | CarletonCourses/DFAtoNFA.py | ganewman42/CodeSamples | 48b9f8fa3eec0f81a8b472bbaeae9cd9a53e6657 | [
"MIT"
] | null | null | null | CarletonCourses/DFAtoNFA.py | ganewman42/CodeSamples | 48b9f8fa3eec0f81a8b472bbaeae9cd9a53e6657 | [
"MIT"
] | null | null | null | #Simple program to convert a DFA (deterministic finite automaton) to an NFA (nondeterministic finite automatom)
#by Grace Newman, 4/15/2014 for a complexity course
def main():
#power set function courtesy of Josh Davis, each subset is ordered to match the order of X
def powerSet(X):
if len(X) == 0:
... | 36.919355 | 114 | 0.545216 |
d1b0a32bda5ad2d597c4ee3ac7401efbfb6d9d62 | 1,524 | py | Python | nomadgram/users/urls.py | syoung19940/nomadgram | 8556ac51d6ee6c49079086d6785accf440758037 | [
"MIT"
] | null | null | null | nomadgram/users/urls.py | syoung19940/nomadgram | 8556ac51d6ee6c49079086d6785accf440758037 | [
"MIT"
] | 13 | 2020-06-05T18:23:55.000Z | 2022-03-03T22:32:50.000Z | nomadgram/users/urls.py | syoung19940/nomadgram | 8556ac51d6ee6c49079086d6785accf440758037 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = "users"
urlpatterns = [
path(
'login/facebook/',
view = views.FacebookLogin.as_view(),
name='fb_login'
),
path(
"explore",
view = views.ExploreUser.as_view(),
name = "explore_user"
),
path(
... | 23.446154 | 79 | 0.544619 |
9c32c0e96f689732865d0f021b9f7fa372d0c3f4 | 1,262 | py | Python | clsz/metrics.py | pmacg/clsz-hermitian-clustering | 525fe35d9a363aa1fd30e527bf4033e52d19be54 | [
"MIT"
] | 2 | 2021-07-02T07:45:04.000Z | 2021-09-17T12:36:53.000Z | clsz/metrics.py | pmacg/clsz-hermitian-clustering | 525fe35d9a363aa1fd30e527bf4033e52d19be54 | [
"MIT"
] | null | null | null | clsz/metrics.py | pmacg/clsz-hermitian-clustering | 525fe35d9a363aa1fd30e527bf4033e52d19be54 | [
"MIT"
] | null | null | null | """Provide methods for computing the cut imbalance metric associated with the CLSZ algorithm."""
import networkx as nx
def networkx_directed_cut_size(graph, set_s, set_t=None):
"""
Compute the cut size between sets S and T in a directed networkx graph.
If T is not given, assume it is the complement of S.... | 37.117647 | 98 | 0.68225 |
cc73e18b8b96a93ff0d008a83f7ae796d6deec00 | 832 | py | Python | pmdarima/utils/__init__.py | dbanda/pmdarima | ee4802bff8fa5a57b706d4cbb978236dece727fe | [
"MIT"
] | null | null | null | pmdarima/utils/__init__.py | dbanda/pmdarima | ee4802bff8fa5a57b706d4cbb978236dece727fe | [
"MIT"
] | null | null | null | pmdarima/utils/__init__.py | dbanda/pmdarima | ee4802bff8fa5a57b706d4cbb978236dece727fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Author: Taylor Smith <taylor.smith@alkaline-ml.com>
from .array import *
from .metaestimators import *
from .visualization import *
from .wrapped import *
def get_callable(key, dct):
"""Get the callable mapped by a key from a dictionary. This is
necessary for pickling (so we don't... | 24.470588 | 73 | 0.600962 |
c13673dd13c1cc6b16ab7967aa99a5c0240e88bc | 1,313 | py | Python | utest/test/api/test_accessing_keywod_methods.py | sateesh-voleti/selenium-python | 14ed29d4aecf50d65fc6046fdc7adf0cdeb703ad | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-02-29T18:13:51.000Z | 2020-02-29T18:13:51.000Z | utest/test/api/test_accessing_keywod_methods.py | sateesh-voleti/selenium-python | 14ed29d4aecf50d65fc6046fdc7adf0cdeb703ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/test/api/test_accessing_keywod_methods.py | sateesh-voleti/selenium-python | 14ed29d4aecf50d65fc6046fdc7adf0cdeb703ad | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-06-22T06:13:27.000Z | 2019-06-22T06:13:27.000Z | import unittest
from SeleniumLibrary import SeleniumLibrary
class KeywordsMethodsTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.selib = SeleniumLibrary()
def test_kw_with_method_name(self):
self.assertTrue(self.selib.keywords['add_cookie'])
self.assertTrue(self.... | 39.787879 | 76 | 0.722011 |
880b1d5a2ba7a0a577f2c64e3bf93c916c690d0f | 521 | py | Python | python/dnd-character/dnd_character.py | guillaume-martin/exercism | 7008c31668bb8cc1d386421c665341568339c380 | [
"MIT"
] | null | null | null | python/dnd-character/dnd_character.py | guillaume-martin/exercism | 7008c31668bb8cc1d386421c665341568339c380 | [
"MIT"
] | null | null | null | python/dnd-character/dnd_character.py | guillaume-martin/exercism | 7008c31668bb8cc1d386421c665341568339c380 | [
"MIT"
] | null | null | null | import random
class Character:
abilities = ['strength', 'dexterity', 'constitution', 'intelligence',
'wisdom', 'charisma']
def __init__(self):
for ability in self.abilities:
setattr(self, ability, self.ability())
self.hitpoints = 10 + modifier(self.constituti... | 22.652174 | 74 | 0.59501 |
e16b86f11f604819bf3360ffb587c5e75aa0867c | 4,124 | py | Python | accounts/api/views.py | AliBigdeli/Django-CBV-DRF-ViewSet-TodoApp | 4eab2a69da17698438dec1ac0016c37092fe791c | [
"MIT"
] | 3 | 2021-09-29T05:16:34.000Z | 2021-11-08T12:55:12.000Z | accounts/api/views.py | AliBigdeli/Django-CBV-DRF-ViewSet-TodoApp | 4eab2a69da17698438dec1ac0016c37092fe791c | [
"MIT"
] | null | null | null | accounts/api/views.py | AliBigdeli/Django-CBV-DRF-ViewSet-TodoApp | 4eab2a69da17698438dec1ac0016c37092fe791c | [
"MIT"
] | null | null | null | from rest_framework.response import Response
from .serializers import LoginSerializer, RegisterSerializer, EmptySerializer
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from rest_framework import status
from rest_framework import viewsets
from django.core.except... | 33.803279 | 78 | 0.653249 |
fc92d44d82883c83fa1a2025f570cd9116045557 | 523 | py | Python | netvisor_api_client/requests/dimension.py | tristen-tooming/netvisor-api-client | 37c974dc1e6acf1d0bde7e6298b23ca4d14ffd69 | [
"MIT"
] | null | null | null | netvisor_api_client/requests/dimension.py | tristen-tooming/netvisor-api-client | 37c974dc1e6acf1d0bde7e6298b23ca4d14ffd69 | [
"MIT"
] | null | null | null | netvisor_api_client/requests/dimension.py | tristen-tooming/netvisor-api-client | 37c974dc1e6acf1d0bde7e6298b23ca4d14ffd69 | [
"MIT"
] | null | null | null | from .base import Request, ListRequest
from ..responses.dimensions import CreateDimensionResponse, DimensionListResponse
from ..schemas.dimensions import CreateDimensionItemSchema
class DimensionsListRequest(ListRequest):
method = 'GET'
uri = 'DimensionList.nv'
response_cls = DimensionListResponse
class... | 26.15 | 81 | 0.780115 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.