hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7552a5c8463043fa820ce8c7f0ef0a1a015f1c1 | 1,118 | py | Python | lab12/heap_hack/exp.py | leitianjian/CS323-Compilers | 0e4c2ef973dbdef866a6dba6671ade150189e884 | [
"MIT"
] | 33 | 2020-09-08T10:44:46.000Z | 2021-01-14T05:27:59.000Z | lab12/heap_hack/exp.py | leitianjian/CS323-Compilers | 0e4c2ef973dbdef866a6dba6671ade150189e884 | [
"MIT"
] | 7 | 2020-09-09T05:24:03.000Z | 2020-12-05T04:41:30.000Z | lab12/heap_hack/exp.py | leitianjian/CS323-Compilers | 0e4c2ef973dbdef866a6dba6671ade150189e884 | [
"MIT"
] | 29 | 2020-09-08T11:09:59.000Z | 2020-10-26T06:58:01.000Z | from pwn import *
# context.terminal = ['tmux', 'split', '-h']
# context.log_level = 'debug'
p = process('./hack')
# p = remote('127.0.0.1', 23455)
def addi(size, content):
p.sendlineafter('choice>', '1')
p.sendlineafter('size>', str(size))
p.sendlineafter('content>', content)
def deli(index):
p.sen... | 23.787234 | 59 | 0.647585 | from pwn import *
p = process('./hack')
def addi(size, content):
p.sendlineafter('choice>', '1')
p.sendlineafter('size>', str(size))
p.sendlineafter('content>', content)
def deli(index):
p.sendlineafter('choice>', '2')
p.sendlineafter('index>', str(index))
def modi(index, content):
p.sen... | true | true |
f7552b21948249bc4a17093ee31424279b0be5cc | 39,346 | py | Python | endpoints/openapi_generator.py | twanwv/endpoints-python | 545cfb0c8f24f0e9c20481fc98d2bf891a62d522 | [
"Apache-2.0"
] | 58 | 2016-09-01T16:40:33.000Z | 2020-12-13T14:54:19.000Z | endpoints/openapi_generator.py | twanwv/endpoints-python | 545cfb0c8f24f0e9c20481fc98d2bf891a62d522 | [
"Apache-2.0"
] | 148 | 2016-09-02T19:03:40.000Z | 2021-03-25T21:56:24.000Z | endpoints/openapi_generator.py | twanwv/endpoints-python | 545cfb0c8f24f0e9c20481fc98d2bf891a62d522 | [
"Apache-2.0"
] | 23 | 2016-09-01T22:06:40.000Z | 2022-03-19T14:24:51.000Z | # Copyright 2016 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... | 36.635009 | 106 | 0.677604 |
from __future__ import absolute_import
import hashlib
import json
import logging
import re
from . import api_exceptions
from . import message_parser
from . import message_types
from . import messages
from . import remote
from . import resource_container
from . import util
_logger = logging.getLogger(__... | true | true |
f7552bbfec29bc4266b24afb5841e8a2c68c8075 | 633 | py | Python | socialNetwork/manage.py | VictorNS69/blockchainProject | 937277c887ab079dc88dfde54f08b596ea5ad1c1 | [
"MIT"
] | null | null | null | socialNetwork/manage.py | VictorNS69/blockchainProject | 937277c887ab079dc88dfde54f08b596ea5ad1c1 | [
"MIT"
] | 20 | 2020-05-01T18:36:04.000Z | 2021-09-22T18:57:29.000Z | socialNetwork/manage.py | VictorNS69/blockchainProject | 937277c887ab079dc88dfde54f08b596ea5ad1c1 | [
"MIT"
] | 1 | 2020-05-01T19:26:10.000Z | 2020-05-01T19:26:10.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialNetwork.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ... | 28.772727 | 77 | 0.685624 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialNetwork.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "... | true | true |
f7552c5731a9f7104174ae3b0d9cfcce79a00ee8 | 89 | py | Python | utils/__init__.py | alexchungio/Intelligent-analysis-of-ecological-assets-compitetion-2021 | f7d37b4316f5092773a7dd1e6387614c783ca1e0 | [
"Apache-2.0"
] | 1 | 2021-03-02T01:56:35.000Z | 2021-03-02T01:56:35.000Z | utils/__init__.py | alexchungio/Intelligent-analysis-of-ecological-assets-compitetion-2021 | f7d37b4316f5092773a7dd1e6387614c783ca1e0 | [
"Apache-2.0"
] | null | null | null | utils/__init__.py | alexchungio/Intelligent-analysis-of-ecological-assets-compitetion-2021 | f7d37b4316f5092773a7dd1e6387614c783ca1e0 | [
"Apache-2.0"
] | null | null | null | from .metric import *
from .help import *
from .logs import *
from .lr_scheduler import * | 22.25 | 27 | 0.741573 | from .metric import *
from .help import *
from .logs import *
from .lr_scheduler import * | true | true |
f7552ca3417893497004403ca254ae46a8ad5bff | 84,761 | py | Python | inference/mcmc.py | DMGREENHOUSE/inference-tools | 4b007cdcb6ae31dad6a5edf6cb50b6a9120c27e7 | [
"MIT"
] | null | null | null | inference/mcmc.py | DMGREENHOUSE/inference-tools | 4b007cdcb6ae31dad6a5edf6cb50b6a9120c27e7 | [
"MIT"
] | null | null | null | inference/mcmc.py | DMGREENHOUSE/inference-tools | 4b007cdcb6ae31dad6a5edf6cb50b6a9120c27e7 | [
"MIT"
] | null | null | null | """
.. moduleauthor:: Chris Bowman <chris.bowman.physics@gmail.com>
"""
import sys
from warnings import warn
from copy import copy, deepcopy
from multiprocessing import Process, Pipe, Event, Pool
from time import time
from random import choice
import matplotlib.pyplot as plt
from numpy import array, arange, float64, ... | 36.804603 | 110 | 0.581258 |
import sys
from warnings import warn
from copy import copy, deepcopy
from multiprocessing import Process, Pipe, Event, Pool
from time import time
from random import choice
import matplotlib.pyplot as plt
from numpy import array, arange, float64, identity, linspace, zeros
from numpy import exp, log, mean, sqrt, argmax... | true | true |
f7552d2541e8703e6a8a6fc823de49b7e455241e | 7,116 | py | Python | src/nti/schema/fieldproperty.py | NextThought/nti.schema | a6defc2eee2853755df1384eea4e1f7caf9e0935 | [
"Apache-2.0"
] | null | null | null | src/nti/schema/fieldproperty.py | NextThought/nti.schema | a6defc2eee2853755df1384eea4e1f7caf9e0935 | [
"Apache-2.0"
] | 49 | 2016-07-29T12:49:11.000Z | 2021-05-08T11:14:55.000Z | src/nti/schema/fieldproperty.py | NextThought/nti.schema | a6defc2eee2853755df1384eea4e1f7caf9e0935 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Computed attributes based on schema fields.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# stdlib imports
import sys
from Acquisition import aq_base
from Acquisition.interfaces import IAcquirer
from... | 32.944444 | 96 | 0.679174 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from Acquisition import aq_base
from Acquisition.interfaces import IAcquirer
from zope.schema import interfaces as sch_interfaces
from zope.schema.fieldproperty import FieldProperty
from zope.sc... | true | true |
f7552d8988870d920ea57712947e93908b5c86b6 | 750 | py | Python | 2021/2021-09/#Day 6 - Beginner - Python Functions & Karel/#while loop.py | millennialseb/EDU_python | 806bb21f873170c29d45d5279af5bd83c8b27dc9 | [
"MIT"
] | 1 | 2021-09-10T23:39:55.000Z | 2021-09-10T23:39:55.000Z | 2021/2021-09/#Day 6 - Beginner - Python Functions & Karel/#while loop.py | millennialseb/EDU_python | 806bb21f873170c29d45d5279af5bd83c8b27dc9 | [
"MIT"
] | null | null | null | 2021/2021-09/#Day 6 - Beginner - Python Functions & Karel/#while loop.py | millennialseb/EDU_python | 806bb21f873170c29d45d5279af5bd83c8b27dc9 | [
"MIT"
] | null | null | null | #while loop
#Difference between for loop and while loop
#FOR LOOP: for item in the list_of_items:
# Do something to each item
#for number in range(a,b)
# print(number)
#WHILE LOOP: whuile something_is_true #Do someting repeatedly
#only when while loop is false the loop stops
#number_of_hurdles = 6
#while numbe... | 20.833333 | 68 | 0.745333 | true | true | |
f7552d8f968a6a05b060bbd06765d25feaad923c | 202 | py | Python | tests/covid/test_get_covid_period.py | ZachGeo/covidGR_API | 2f316337dda65bd33ac895df336481c3c2abe2c6 | [
"MIT"
] | null | null | null | tests/covid/test_get_covid_period.py | ZachGeo/covidGR_API | 2f316337dda65bd33ac895df336481c3c2abe2c6 | [
"MIT"
] | null | null | null | tests/covid/test_get_covid_period.py | ZachGeo/covidGR_API | 2f316337dda65bd33ac895df336481c3c2abe2c6 | [
"MIT"
] | null | null | null | import requests
url = 'http://127.0.0.1:5000/covidgr/2020-11-02/2020-11-03'
headers = {
'Content-type': 'application/json',
}
response = requests.get(url, headers=headers)
print(response.json())
| 18.363636 | 59 | 0.693069 | import requests
url = 'http://127.0.0.1:5000/covidgr/2020-11-02/2020-11-03'
headers = {
'Content-type': 'application/json',
}
response = requests.get(url, headers=headers)
print(response.json())
| true | true |
f7552daf51e74b5297963c073832d0f88667bd04 | 5,149 | py | Python | catalog/models.py | FrankCasanova/LibraryDjng | a4ad6bd72bbf4aa0595c39ca5d1094cfc17941b6 | [
"MIT"
] | null | null | null | catalog/models.py | FrankCasanova/LibraryDjng | a4ad6bd72bbf4aa0595c39ca5d1094cfc17941b6 | [
"MIT"
] | null | null | null | catalog/models.py | FrankCasanova/LibraryDjng | a4ad6bd72bbf4aa0595c39ca5d1094cfc17941b6 | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models.base import Model
from django.urls import reverse
import uuid #required for unique book instances
from django.contrib.auth.models import User
from datetime import date
# Create your models here.
class Genre(models.Model):
"""
Molde representing a book genre.... | 26.270408 | 111 | 0.565741 | from django.db import models
from django.db.models.base import Model
from django.urls import reverse
import uuid
from django.contrib.auth.models import User
from datetime import date
class Genre(models.Model):
name = models.CharField(
max_length=200,
)
def __str__(self):
r... | true | true |
f7552e0d1edb3f883a8635870463440f0fd4b1f8 | 239 | py | Python | test_primes.py | chapman-cs510-2017f/cw-04-alice_keith | afb2f8cdb0d49182b274b41cb3d51be6d8ba6813 | [
"MIT"
] | null | null | null | test_primes.py | chapman-cs510-2017f/cw-04-alice_keith | afb2f8cdb0d49182b274b41cb3d51be6d8ba6813 | [
"MIT"
] | null | null | null | test_primes.py | chapman-cs510-2017f/cw-04-alice_keith | afb2f8cdb0d49182b274b41cb3d51be6d8ba6813 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import primes
def test_primes():
assert primes.eratosthenes(60) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]
assert primes.eratosthenes(34) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] | 34.142857 | 102 | 0.594142 |
import primes
def test_primes():
assert primes.eratosthenes(60) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]
assert primes.eratosthenes(34) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] | true | true |
f7552e7032051abb494192993793fd859a7ec1f3 | 966 | py | Python | virtual/lib/python3.6/site-packages/django_celery_beat/migrations/0006_auto_20180210_1226.py | lorrainekamanda/NewsRestApi | 3be82ca066f26f7fde4e7a265c2e46dd4e86bd85 | [
"MIT"
] | null | null | null | virtual/lib/python3.6/site-packages/django_celery_beat/migrations/0006_auto_20180210_1226.py | lorrainekamanda/NewsRestApi | 3be82ca066f26f7fde4e7a265c2e46dd4e86bd85 | [
"MIT"
] | 2 | 2021-05-12T06:25:57.000Z | 2022-03-01T04:16:03.000Z | env/lib/python3.9/site-packages/django_celery_beat/migrations/0006_auto_20180210_1226.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-02-10 12:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_celery_beat', '0005_add_solarschedule_events_choices'),
]
operations = [
migrations.AlterField(
model_name='crontabschedul... | 31.16129 | 72 | 0.540373 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_celery_beat', '0005_add_solarschedule_events_choices'),
]
operations = [
migrations.AlterField(
model_name='crontabschedule',
name='day_of_month',
... | true | true |
f7552ed8dcfc9525513b59e0c6df787e30db08b2 | 3,687 | py | Python | tests/commands/test_test.py | franzbischoff/platformio-core | 9e0ded958ca4fe6a4dca9b15c128bd22d3603981 | [
"Apache-2.0"
] | 4,744 | 2016-11-28T14:37:47.000Z | 2022-03-31T12:35:56.000Z | tests/commands/test_test.py | franzbischoff/platformio-core | 9e0ded958ca4fe6a4dca9b15c128bd22d3603981 | [
"Apache-2.0"
] | 3,424 | 2016-11-27T22:45:41.000Z | 2022-03-31T21:40:03.000Z | tests/commands/test_test.py | franzbischoff/platformio-core | 9e0ded958ca4fe6a4dca9b15c128bd22d3603981 | [
"Apache-2.0"
] | 576 | 2016-12-01T18:48:22.000Z | 2022-03-30T02:27:35.000Z | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | 21.561404 | 87 | 0.647681 |
import os
import pytest
from platformio import proc
from platformio.commands.test.command import cli as cmd_test
def test_local_env():
result = proc.exec_command(
[
"platformio",
"test",
"-d",
os.path.join("examples", "unit-testing", "calcula... | true | true |
f7552efa73b8357fc30eedf38a2134fb60f2686d | 84,494 | py | Python | keras/layers/convolutional.py | mikezsx/dlstudy | 6572934f9a7c4ba498300186c2d297994c43900d | [
"MIT"
] | 3 | 2018-08-21T05:32:30.000Z | 2021-04-10T11:47:51.000Z | keras/layers/convolutional.py | candleinwindsteve/keras | 9eb7ecd3e525c9cff31ebd59a96794f212ca5e1e | [
"MIT"
] | null | null | null | keras/layers/convolutional.py | candleinwindsteve/keras | 9eb7ecd3e525c9cff31ebd59a96794f212ca5e1e | [
"MIT"
] | 1 | 2019-07-12T09:10:58.000Z | 2019-07-12T09:10:58.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .. import backend as K
from .. import activations
from .. import initializers
from .. import regularizers
from .. import constraints
from ..engine import Layer
from ..engine import InputSpec
from ..utils import conv_utils
from ..legacy import interfac... | 44.587863 | 123 | 0.570313 |
from __future__ import absolute_import
from .. import backend as K
from .. import activations
from .. import initializers
from .. import regularizers
from .. import constraints
from ..engine import Layer
from ..engine import InputSpec
from ..utils import conv_utils
from ..legacy import interfaces
from .pooling impo... | true | true |
f7552f0cdeaf5a23316a528e3e529bdff3cbb97b | 3,312 | py | Python | board.py | acninetyfive/blokus | 509fc993097b9fd527005c281fb61ea97e4a55af | [
"MIT"
] | null | null | null | board.py | acninetyfive/blokus | 509fc993097b9fd527005c281fb61ea97e4a55af | [
"MIT"
] | null | null | null | board.py | acninetyfive/blokus | 509fc993097b9fd527005c281fb61ea97e4a55af | [
"MIT"
] | null | null | null | import numpy as np
from piece import Piece
import time
from scipy.ndimage import convolve
class Board:
def __init__(self, size = 20, player_colors = [1,2,3,4]):
self.size = size
self.board = np.zeros((size,size), dtype = int)
self.start_squares = [[0,0], [0, size-1], [size-1, 0], [size-1, size-1]]
self.playe... | 30.953271 | 143 | 0.621075 | import numpy as np
from piece import Piece
import time
from scipy.ndimage import convolve
class Board:
def __init__(self, size = 20, player_colors = [1,2,3,4]):
self.size = size
self.board = np.zeros((size,size), dtype = int)
self.start_squares = [[0,0], [0, size-1], [size-1, 0], [size-1, size-1]]
self.playe... | true | true |
f7552f7f180ff7c3f413957bdc72d33c8707140f | 4,403 | py | Python | diofant/tests/geometry/test_point.py | rajkk1/diofant | 6b361334569e4ec2e8c7d30dc324387a4ad417c2 | [
"BSD-3-Clause"
] | null | null | null | diofant/tests/geometry/test_point.py | rajkk1/diofant | 6b361334569e4ec2e8c7d30dc324387a4ad417c2 | [
"BSD-3-Clause"
] | null | null | null | diofant/tests/geometry/test_point.py | rajkk1/diofant | 6b361334569e4ec2e8c7d30dc324387a4ad417c2 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from diofant import Float, I, Matrix, Rational, Symbol, pi, sqrt
from diofant.geometry import Line, Point
__all__ = ()
x = Symbol('x', real=True)
y = Symbol('y', real=True)
z = Symbol('z', real=True)
t = Symbol('t', real=True)
k = Symbol('k', real=True)
x1 = Symbol('x1', real=True)
x2 = Symbol('x2', r... | 30.79021 | 76 | 0.611856 | import pytest
from diofant import Float, I, Matrix, Rational, Symbol, pi, sqrt
from diofant.geometry import Line, Point
__all__ = ()
x = Symbol('x', real=True)
y = Symbol('y', real=True)
z = Symbol('z', real=True)
t = Symbol('t', real=True)
k = Symbol('k', real=True)
x1 = Symbol('x1', real=True)
x2 = Symbol('x2', r... | true | true |
f7552fa9643c58c9ef328179c8320db0dc024aab | 7,791 | py | Python | soccer/gameplay/tactics/advance_zone_midfielder.py | kasohrab/robocup-software | 73c92878baf960844b5a4b34c72804093f1ea459 | [
"Apache-2.0"
] | null | null | null | soccer/gameplay/tactics/advance_zone_midfielder.py | kasohrab/robocup-software | 73c92878baf960844b5a4b34c72804093f1ea459 | [
"Apache-2.0"
] | null | null | null | soccer/gameplay/tactics/advance_zone_midfielder.py | kasohrab/robocup-software | 73c92878baf960844b5a4b34c72804093f1ea459 | [
"Apache-2.0"
] | null | null | null | import main
import robocup
import behavior
import constants
import enum
import math
import composite_behavior
import skills.move
import evaluation.ball
import evaluation.passing_positioning
import evaluation.passing
import evaluation.shooting
import functools
import plays.Legacy.adaptive_formation
# 2 midfielder rel... | 41.005263 | 139 | 0.661147 | import main
import robocup
import behavior
import constants
import enum
import math
import composite_behavior
import skills.move
import evaluation.ball
import evaluation.passing_positioning
import evaluation.passing
import evaluation.shooting
import functools
import plays.Legacy.adaptive_formation
class AdvanceZone... | true | true |
f755309674d8433dd970d13f3cb91c28a251b20e | 2,279 | py | Python | tests/test_auth.py | vincentmuriuki/APIs_endpoints_fast_food_fast | 3fce102e96c067cee43745eb0aede2dbf5e99b0c | [
"MIT"
] | null | null | null | tests/test_auth.py | vincentmuriuki/APIs_endpoints_fast_food_fast | 3fce102e96c067cee43745eb0aede2dbf5e99b0c | [
"MIT"
] | null | null | null | tests/test_auth.py | vincentmuriuki/APIs_endpoints_fast_food_fast | 3fce102e96c067cee43745eb0aede2dbf5e99b0c | [
"MIT"
] | null | null | null | import json
from .entry import EntryClass
SIGNUP_URL = '/api/v1/auth/signup'
LOGIN_URL = '/api/v1/auth/login'
class TestAuth(EntryClass):
""" Add tests for Auth """
def test_user_registration(self):
""" Test user registration works correcty """
response = self.client.post(SIGNUP_URL,
... | 42.203704 | 116 | 0.569987 | import json
from .entry import EntryClass
SIGNUP_URL = '/api/v1/auth/signup'
LOGIN_URL = '/api/v1/auth/login'
class TestAuth(EntryClass):
def test_user_registration(self):
response = self.client.post(SIGNUP_URL,
data=json.dumps(self.user_data), content_type='applicati... | true | true |
f7553114c80bc40eb3a94b6dba563a4f5c12ae58 | 27,653 | py | Python | tests/test_rbfopt_utils.py | aerometu/rbfopt | 4aba6186aa7d49c10551601d77e2484f88ffee39 | [
"BSD-3-Clause"
] | 1 | 2020-03-07T08:26:13.000Z | 2020-03-07T08:26:13.000Z | tests/test_rbfopt_utils.py | aerometu/rbfopt | 4aba6186aa7d49c10551601d77e2484f88ffee39 | [
"BSD-3-Clause"
] | null | null | null | tests/test_rbfopt_utils.py | aerometu/rbfopt | 4aba6186aa7d49c10551601d77e2484f88ffee39 | [
"BSD-3-Clause"
] | null | null | null | """Test the module rbfopt_utils in RBFOpt.
This module contains unit tests for the module rbfopt_utils.
Licensed under Revised BSD license, see LICENSE.
(C) Copyright International Business Machines Corporation 2016.
"""
from __future__ import print_function
from __future__ import division
from __future__ import ab... | 49.030142 | 86 | 0.536904 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import math
import numpy as np
import rbfopt
import rbfopt.rbfopt_utils as ru
from rbfopt.rbfopt_settings import RbfoptSettings
class TestUtils(unittest.TestCase):
def setUp(self):
... | true | true |
f755311e6c953ceaab9fd5d80de189b559144f15 | 1,981 | py | Python | tests/core_test.py | ToThAc/cpi-breakdown | bab49eeefc5a9ed01270fc595cd88e60237e8e14 | [
"Apache-2.0"
] | 9 | 2017-11-03T15:59:14.000Z | 2022-01-03T03:40:04.000Z | tests/core_test.py | ToThAc/cpi-breakdown | bab49eeefc5a9ed01270fc595cd88e60237e8e14 | [
"Apache-2.0"
] | 7 | 2018-04-17T22:00:41.000Z | 2021-04-19T20:36:55.000Z | tests/core_test.py | ToThAc/cpi-breakdown | bab49eeefc5a9ed01270fc595cd88e60237e8e14 | [
"Apache-2.0"
] | 5 | 2017-11-03T16:06:00.000Z | 2021-10-04T20:20:18.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 IBM Corporation
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ... | 30.953125 | 72 | 0.689551 |
import unittest
import csv
from cpi import core
class CoreTests(unittest.TestCase):
def test_execute(self):
self.assertEqual(0, core.execute("cd"))
self.assertNotEqual(0, core.execute("foo_bar"))
def test_execute_stdout(self):
status, output = core.execute_stdout("cd")
sel... | true | true |
f75531c7631e458546c89ab91bdb658bbf4494f0 | 14,307 | py | Python | docs/imagestats/source/conf.py | spacetelescope/stsciutils | 85df1f215071a9c00a1e8cf3da823b5fedf8f2f2 | [
"BSD-3-Clause"
] | null | null | null | docs/imagestats/source/conf.py | spacetelescope/stsciutils | 85df1f215071a9c00a1e8cf3da823b5fedf8f2f2 | [
"BSD-3-Clause"
] | 1 | 2019-06-05T18:56:33.000Z | 2020-11-19T16:33:50.000Z | docs/imagestats/source/conf.py | spacetelescope/stsciutils | 85df1f215071a9c00a1e8cf3da823b5fedf8f2f2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# STSCI documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 22 17:25:41 2015.
#
# 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 file.
#
# All... | 32.589977 | 79 | 0.71168 |
import os
import sys
import datetime
import importlib
import sphinx
import stsci_rtd_theme
from distutils.version import LooseVersion
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
conf = ConfigParser()
sys.path.insert(0, os.path.abspath('.... | true | true |
f75531fef6d24724c9a6e5d1d6647fd6c9634d20 | 6,073 | py | Python | week2/get_nouns.py | osamamukhtar11/computational-creativity | c8d9a0e4025471590e3069afce61d1cac638814e | [
"MIT"
] | null | null | null | week2/get_nouns.py | osamamukhtar11/computational-creativity | c8d9a0e4025471590e3069afce61d1cac638814e | [
"MIT"
] | null | null | null | week2/get_nouns.py | osamamukhtar11/computational-creativity | c8d9a0e4025471590e3069afce61d1cac638814e | [
"MIT"
] | null | null | null | import re
import nltk
import random
import os
# Download Alice's Adventures in Wonderland if it is not yet present
def read_alice_in_wonderland():
alice_file = 'alice.txt'
alice_raw = None
if not os.path.isfile(alice_file):
from urllib import request
url = 'http://www.gutenberg.org/cache/e... | 35.51462 | 113 | 0.625556 | import re
import nltk
import random
import os
def read_alice_in_wonderland():
alice_file = 'alice.txt'
alice_raw = None
if not os.path.isfile(alice_file):
from urllib import request
url = 'http://www.gutenberg.org/cache/epub/19033/pg19033.txt'
response = request.urlopen(url)
... | true | true |
f755322e9ac2b4e75b3777a54d9f2dc60d7f0d2e | 1,934 | py | Python | keras_not_working/train.py | bgshin/rn | 5a0649533b5aba05556cc6f9607e28c95e3b9e55 | [
"Apache-2.0"
] | null | null | null | keras_not_working/train.py | bgshin/rn | 5a0649533b5aba05556cc6f9607e28c95e3b9e55 | [
"Apache-2.0"
] | null | null | null | keras_not_working/train.py | bgshin/rn | 5a0649533b5aba05556cc6f9607e28c95e3b9e55 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import keras.backend.tensorflow_backend as ktf
from keras.callbacks import ModelCheckpoint
from soclevr import load_all, Timer
import os
import argparse
import numpy as np
from model import RN, RN2
def run(attempt, gpunum):
os.environ["CUDA_VISIBLE_DEVICES"] = gpunum
def get_session(gp... | 33.929825 | 116 | 0.643744 | import tensorflow as tf
import keras.backend.tensorflow_backend as ktf
from keras.callbacks import ModelCheckpoint
from soclevr import load_all, Timer
import os
import argparse
import numpy as np
from model import RN, RN2
def run(attempt, gpunum):
os.environ["CUDA_VISIBLE_DEVICES"] = gpunum
def get_session(gp... | true | true |
f75533de7823b5974ab8f7cd4b933648dadb1905 | 1,481 | py | Python | src/convertRefSeqChromosomeNames.py | clb1/CreateCGDB | 280d82ca6d63c0386e458e710f000ca26402fd12 | [
"MIT"
] | null | null | null | src/convertRefSeqChromosomeNames.py | clb1/CreateCGDB | 280d82ca6d63c0386e458e710f000ca26402fd12 | [
"MIT"
] | null | null | null | src/convertRefSeqChromosomeNames.py | clb1/CreateCGDB | 280d82ca6d63c0386e458e710f000ca26402fd12 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import gzip
import sys
def readConversionFiles(chromosome_accessions):
accession_to_chrom = {}
ip = open(chromosome_accessions, 'r')
for line in ip:
if (line[0] != '#'):
fields = line.strip().split("\t")
if (fields[0] == "MT"):
chrom =... | 29.62 | 67 | 0.574612 |
import gzip
import sys
def readConversionFiles(chromosome_accessions):
accession_to_chrom = {}
ip = open(chromosome_accessions, 'r')
for line in ip:
if (line[0] != '#'):
fields = line.strip().split("\t")
if (fields[0] == "MT"):
chrom = "chrM"
e... | true | true |
f75534b57eb06254890ba1602ef00ae8f358488b | 1,008 | py | Python | src/data_collection/MatthiasWinkelmann_firstname_database.py | diabolical-ninja/AllTheNames | cdf8a181b80ee3250b76f30cd0b875368d60570c | [
"MIT"
] | null | null | null | src/data_collection/MatthiasWinkelmann_firstname_database.py | diabolical-ninja/AllTheNames | cdf8a181b80ee3250b76f30cd0b875368d60570c | [
"MIT"
] | null | null | null | src/data_collection/MatthiasWinkelmann_firstname_database.py | diabolical-ninja/AllTheNames | cdf8a181b80ee3250b76f30cd0b875368d60570c | [
"MIT"
] | null | null | null | """Firstnames Database from Github User MatthiasWinkelmann.
Source:
- https://github.com/MatthiasWinkelmann/firstname-database
"""
import sys
from pathlib import Path
import pandas as pd
sys.path.append(str(Path(__file__).parent.parent))
import utils as ut # noqa
names_url = "https://raw.githubusercontent.com... | 24.585366 | 115 | 0.729167 | import sys
from pathlib import Path
import pandas as pd
sys.path.append(str(Path(__file__).parent.parent))
import utils as ut
names_url = "https://raw.githubusercontent.com/MatthiasWinkelmann/firstname-database/master/firstnames.csv"
names_df = pd.read_csv(names_url, sep=";")
names_df = pd.melt(names_df, id_v... | true | true |
f755355079503d57710e9b489038d02e367061ff | 67,542 | py | Python | django/db/models/fields/related.py | shiviser/django | 525dc283a68c0d47f5eb2192cc4a20111d561ae0 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-08-03T20:08:11.000Z | 2017-08-03T20:08:11.000Z | django/db/models/fields/related.py | shiviser/django | 525dc283a68c0d47f5eb2192cc4a20111d561ae0 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/fields/related.py | shiviser/django | 525dc283a68c0d47f5eb2192cc4a20111d561ae0 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | import functools
import inspect
from functools import partial
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models import Q
from django.db.models.constants import LOOKUP_SEP
f... | 41.692593 | 119 | 0.587945 | import functools
import inspect
from functools import partial
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models import Q
from django.db.models.constants import LOOKUP_SEP
f... | true | true |
f75535cc003723a45f9e2437d31aae2f4b0ee8a3 | 1,793 | py | Python | KNN MODEL/knn.py | bitan1998/DSDA-PROJECT | 55c94f130bde487128e3b5c02d6f2c2622192766 | [
"MIT"
] | null | null | null | KNN MODEL/knn.py | bitan1998/DSDA-PROJECT | 55c94f130bde487128e3b5c02d6f2c2622192766 | [
"MIT"
] | 1 | 2019-03-31T05:48:31.000Z | 2019-03-31T05:48:31.000Z | KNN MODEL/knn.py | bitan1998/DSDA-PROJECT | 55c94f130bde487128e3b5c02d6f2c2622192766 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
names=['AGE','TB','DB','TP','Albumin','A/G','sgpt','sgot','ALKPHOS','GENDER']
dataset=pd.read_csv("Indian Liver Patient Dataset.csv")
##||REMOVING NAN FILES AS COLLEGE GAVE BAD DATASET||##
dataset1=dataset.dropna(subset = ['AGE','TB','DB','TP','Al... | 32.017857 | 113 | 0.737312 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
names=['AGE','TB','DB','TP','Albumin','A/G','sgpt','sgot','ALKPHOS','GENDER']
dataset=pd.read_csv("Indian Liver Patient Dataset.csv")
'Albumin','A/G','sgpt','sgot','ALKPHOS','GENDER'])
X=dataset1.iloc[:,:-1].values
y=dataset1.iloc[:,8].values
y... | true | true |
f755362e552cbcbf172cbd59eae733659b2f3bed | 6,455 | py | Python | library/policy_push.py | Forcepoint/fp-NGFW-SMC-ansible | 47cafea1bef162e75f3632b969e996d53d636374 | [
"Apache-2.0"
] | 5 | 2019-11-19T07:23:01.000Z | 2021-08-25T08:04:49.000Z | library/policy_push.py | Forcepoint/fp-NGFW-SMC-ansible | 47cafea1bef162e75f3632b969e996d53d636374 | [
"Apache-2.0"
] | 2 | 2020-03-24T20:30:32.000Z | 2020-09-15T09:02:44.000Z | library/policy_push.py | Forcepoint/fp-NGFW-SMC-ansible | 47cafea1bef162e75f3632b969e996d53d636374 | [
"Apache-2.0"
] | 3 | 2020-03-24T20:32:29.000Z | 2022-02-15T15:29:07.000Z | #!/usr/bin/python
# Copyright (c) 2017-2019 Forcepoint
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: policy_push
short_description: Deploy a policy to an engine
description:
- Each NGFW engine requires that an existi... | 30.023256 | 95 | 0.543919 |
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: policy_push
short_description: Deploy a policy to an engine
description:
- Each NGFW engine requires that an existing policy be deployed. In addition,
when making c... | true | true |
f755363f091a12f11df425ccaea3d7d7831090c2 | 2,048 | py | Python | examples/gw_examples/injection_examples/create_your_own_source_model.py | LBJ-Wade/bilby | b1e02f1dfae03d4939cae9c95eff300c22919689 | [
"MIT"
] | 31 | 2019-02-28T00:48:23.000Z | 2022-03-29T09:41:28.000Z | examples/gw_examples/injection_examples/create_your_own_source_model.py | LBJ-Wade/bilby | b1e02f1dfae03d4939cae9c95eff300c22919689 | [
"MIT"
] | 27 | 2020-11-03T14:36:49.000Z | 2021-07-23T20:23:30.000Z | examples/gw_examples/injection_examples/create_your_own_source_model.py | LBJ-Wade/bilby | b1e02f1dfae03d4939cae9c95eff300c22919689 | [
"MIT"
] | 32 | 2018-11-30T00:58:53.000Z | 2022-03-29T09:41:30.000Z | #!/usr/bin/env python
"""
A script to demonstrate how to use your own source model
"""
import bilby
import numpy as np
# First set up logging and some output directories and labels
outdir = 'outdir'
label = 'create_your_own_source_model'
sampling_frequency = 4096
duration = 1
# Here we define out source model - this... | 37.925926 | 80 | 0.737305 |
import bilby
import numpy as np
outdir = 'outdir'
label = 'create_your_own_source_model'
sampling_frequency = 4096
duration = 1
def sine_gaussian(f, A, f0, tau, phi0, geocent_time, ra, dec, psi):
arg = -(np.pi * tau * (f - f0))**2 + 1j * phi0
plus = np.sqrt(np.pi) * A * tau * np.exp(arg) / 2.
cross =... | true | true |
f755375ebc8e4ec6ff61a52fc0f517507c7cfaed | 621 | py | Python | Django/makeplan/user/migrations/0005_auto_20190704_1707.py | taoyan/python | 3fbb1e534ec91b33cd2ac690966d7253c2f5d757 | [
"MIT"
] | 1 | 2019-05-04T09:21:52.000Z | 2019-05-04T09:21:52.000Z | Django/makeplan/user/migrations/0005_auto_20190704_1707.py | taoyan/python | 3fbb1e534ec91b33cd2ac690966d7253c2f5d757 | [
"MIT"
] | 26 | 2020-07-18T02:02:54.000Z | 2022-02-26T10:49:58.000Z | Django/makeplan/user/migrations/0005_auto_20190704_1707.py | taoyan/python | 3fbb1e534ec91b33cd2ac690966d7253c2f5d757 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-07-04 09:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0004_auto_20190702_1359'),
]
operations = [
migrations.AlterField(... | 23.884615 | 63 | 0.595813 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0004_auto_20190702_1359'),
]
operations = [
migrations.AlterField(
model_name='userinfo',
name='mobile',
... | true | true |
f755379ad4c15133f9ec08f3678e9773f1be63c9 | 89 | py | Python | config/ngs_te_mapper2/ngs_te_mapper2_run.py | shunhuahan/mcclintock | 999f064847e824d41a76791c913e24454ef6cba8 | [
"Unlicense"
] | null | null | null | config/ngs_te_mapper2/ngs_te_mapper2_run.py | shunhuahan/mcclintock | 999f064847e824d41a76791c913e24454ef6cba8 | [
"Unlicense"
] | null | null | null | config/ngs_te_mapper2/ngs_te_mapper2_run.py | shunhuahan/mcclintock | 999f064847e824d41a76791c913e24454ef6cba8 | [
"Unlicense"
] | null | null | null |
# max length of junction read overlap to consider a target site duplication
MAX_TSD = 20 | 29.666667 | 75 | 0.797753 |
MAX_TSD = 20 | true | true |
f75537b022e23c7d579403fadf91396b38def1e7 | 1,117 | py | Python | setup.py | dwavesystems/migra | 205bb3bced8681e6b178275cbccad3d1fbc2029a | [
"Unlicense"
] | 3 | 2018-12-03T08:16:58.000Z | 2021-02-25T23:48:24.000Z | setup.py | dwavesystems/migra | 205bb3bced8681e6b178275cbccad3d1fbc2029a | [
"Unlicense"
] | null | null | null | setup.py | dwavesystems/migra | 205bb3bced8681e6b178275cbccad3d1fbc2029a | [
"Unlicense"
] | 6 | 2018-12-03T08:17:01.000Z | 2021-09-16T14:38:55.000Z | #!/usr/bin/env python
import io
from setuptools import setup, find_packages
readme = io.open("README.md").read()
setup(
name="migra",
version="1.0.1531741707",
url="https://github.com/djrobstep/migra",
description="Like diff but for PostgreSQL schemas",
long_description=readme,
long_descriptio... | 33.848485 | 70 | 0.648165 |
import io
from setuptools import setup, find_packages
readme = io.open("README.md").read()
setup(
name="migra",
version="1.0.1531741707",
url="https://github.com/djrobstep/migra",
description="Like diff but for PostgreSQL schemas",
long_description=readme,
long_description_content_type="text/... | true | true |
f75538ac7d559f9fbef4266aba1b23e60ec48c17 | 10,232 | py | Python | tests/18 - A.I 2/Sprites.py | stellazhang2115/Pyman | 39aa14d26b33dc500756d8772becc7b312973cd5 | [
"MIT"
] | 2 | 2021-01-04T22:35:08.000Z | 2021-12-15T06:08:05.000Z | tests/18 - A.I 2/Sprites.py | stellazhang2115/Pyman | 39aa14d26b33dc500756d8772becc7b312973cd5 | [
"MIT"
] | null | null | null | tests/18 - A.I 2/Sprites.py | stellazhang2115/Pyman | 39aa14d26b33dc500756d8772becc7b312973cd5 | [
"MIT"
] | 2 | 2020-05-06T03:17:29.000Z | 2021-12-10T00:47:25.000Z | import pygame, time, math
from pygame.locals import *
class Box(pygame.sprite.Sprite):
def __init__(self, x, y):
# Call the parent class constructor
pygame.sprite.Sprite.__init__(self)
# Get the main window's display
self.surface = pygame.display.get_surface()
... | 36.542857 | 115 | 0.530493 | import pygame, time, math
from pygame.locals import *
class Box(pygame.sprite.Sprite):
def __init__(self, x, y):
pygame.sprite.Sprite.__init__(self)
self.surface = pygame.display.get_surface()
# Create a 16x16 surface and fill it with the color RED
... | true | true |
f75538e0d75a3676a5592b2acc954daa847c371d | 5,107 | py | Python | hypercoref/python/common_components/commoncrawl.py | UKPLab/emnlp2021-hypercoref-cdcr | 205ebfc79d022c5db096fe218fd158a769a71415 | [
"Apache-2.0"
] | 5 | 2021-10-06T12:45:23.000Z | 2022-01-25T19:37:01.000Z | hypercoref/python/common_components/commoncrawl.py | UKPLab/emnlp2021-hypercoref-cdcr | 205ebfc79d022c5db096fe218fd158a769a71415 | [
"Apache-2.0"
] | null | null | null | hypercoref/python/common_components/commoncrawl.py | UKPLab/emnlp2021-hypercoref-cdcr | 205ebfc79d022c5db096fe218fd158a769a71415 | [
"Apache-2.0"
] | null | null | null | import pprint
from datetime import datetime
import cdx_toolkit
import pandas as pd
import tqdm
from typing import Optional
from python import *
from python.pipeline import GLOBAL, ComponentBase, DEVELOPMENT_MODE
class CommonCrawl(ComponentBase):
TIMESTAMP_FORMAT = "%Y%m%d%H%M%S" # applies to wayback machine a... | 39.589147 | 125 | 0.579009 | import pprint
from datetime import datetime
import cdx_toolkit
import pandas as pd
import tqdm
from typing import Optional
from python import *
from python.pipeline import GLOBAL, ComponentBase, DEVELOPMENT_MODE
class CommonCrawl(ComponentBase):
TIMESTAMP_FORMAT = "%Y%m%d%H%M%S"
DEFAULT_SIZE_ESTIMATE = 1... | true | true |
f7553a250585bb2ff140f8f50b55e67f8a7054e2 | 576 | py | Python | tronx/plugins/start.py | JayPatel1314/Tron | d8f2d799eea344c0d76f0fe758ce385c7ceceea7 | [
"MIT"
] | 4 | 2022-03-07T07:27:04.000Z | 2022-03-29T05:59:57.000Z | tronx/plugins/start.py | JayPatel1314/Tron | d8f2d799eea344c0d76f0fe758ce385c7ceceea7 | [
"MIT"
] | null | null | null | tronx/plugins/start.py | JayPatel1314/Tron | d8f2d799eea344c0d76f0fe758ce385c7ceceea7 | [
"MIT"
] | 3 | 2022-03-05T15:24:51.000Z | 2022-03-14T08:48:05.000Z | import time
from tronx import app
from pyrogram import filters
from pyrogram.types import Message
@app.bot.on_message(filters.command("start"))
async def send_response(_, m: Message):
await m.reply("How can i help you ?")
@app.bot.on_message(filters.new_chat_members & filters.group)
async def added_to_group_m... | 19.862069 | 77 | 0.722222 | import time
from tronx import app
from pyrogram import filters
from pyrogram.types import Message
@app.bot.on_message(filters.command("start"))
async def send_response(_, m: Message):
await m.reply("How can i help you ?")
@app.bot.on_message(filters.new_chat_members & filters.group)
async def added_to_group_m... | true | true |
f7553a2578c43ad2eb17faaccf23cbaf9913f977 | 3,767 | py | Python | train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/load_fully_quantified_cpmg_data.py | ciceklab/targeted_brain_tumor_margin_assessment | 2cf729019dfc1785992208a69c353a659c9b6448 | [
"MIT"
] | 1 | 2021-12-11T20:06:39.000Z | 2021-12-11T20:06:39.000Z | train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/load_fully_quantified_cpmg_data.py | ciceklab/targeted_brain_tumor_margin_assessment | 2cf729019dfc1785992208a69c353a659c9b6448 | [
"MIT"
] | null | null | null | train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/load_fully_quantified_cpmg_data.py | ciceklab/targeted_brain_tumor_margin_assessment | 2cf729019dfc1785992208a69c353a659c9b6448 | [
"MIT"
] | 2 | 2021-12-15T18:17:17.000Z | 2021-12-16T12:08:30.000Z | import pdb
import pickle
import pandas as pd
import os
import numpy as np
import sys
sys.path.insert(1,"../")
sys.path.insert(1,"../../")
sys.path.insert(1,"../../../")
from config_u import base
project_base_path = base
current_path = "scripts/cpmg/pathologic_classification/"
sys.path.insert(1, os.path.j... | 41.395604 | 98 | 0.755243 | import pdb
import pickle
import pandas as pd
import os
import numpy as np
import sys
sys.path.insert(1,"../")
sys.path.insert(1,"../../")
sys.path.insert(1,"../../../")
from config_u import base
project_base_path = base
current_path = "scripts/cpmg/pathologic_classification/"
sys.path.insert(1, os.path.j... | true | true |
f7553aa3a08802294cea72a7e6498ae7545ee763 | 3,432 | py | Python | Backend/core/users/migrations/0001_initial.py | Extraordinary01/freshnesecom | e16047d7f8a8d771125c4656351bae2b4389a1a6 | [
"MIT"
] | null | null | null | Backend/core/users/migrations/0001_initial.py | Extraordinary01/freshnesecom | e16047d7f8a8d771125c4656351bae2b4389a1a6 | [
"MIT"
] | null | null | null | Backend/core/users/migrations/0001_initial.py | Extraordinary01/freshnesecom | e16047d7f8a8d771125c4656351bae2b4389a1a6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-19 05:37
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0001_initial'),
]
op... | 63.555556 | 329 | 0.647727 |
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | true | true |
f7553acc2eea17b0fa16e1743b8be69989a81e59 | 276 | py | Python | apps/opencv_stitching_tool/opencv_stitching/megapix_downscaler.py | nowireless/opencv | 1fcc4c74fefee4f845c0d57799163a1cbf36f654 | [
"Apache-2.0"
] | 56,632 | 2016-07-04T16:36:08.000Z | 2022-03-31T18:38:14.000Z | apps/opencv_stitching_tool/opencv_stitching/megapix_downscaler.py | ShaolinDeng/opencv | 4b6047e746f06ce3e595c886cf6c0266498c6a67 | [
"Apache-2.0"
] | 13,593 | 2016-07-04T13:59:03.000Z | 2022-03-31T21:04:51.000Z | apps/opencv_stitching_tool/opencv_stitching/megapix_downscaler.py | ShaolinDeng/opencv | 4b6047e746f06ce3e595c886cf6c0266498c6a67 | [
"Apache-2.0"
] | 54,986 | 2016-07-04T14:24:38.000Z | 2022-03-31T22:51:18.000Z | from .megapix_scaler import MegapixScaler
class MegapixDownscaler(MegapixScaler):
@staticmethod
def force_downscale(scale):
return min(1.0, scale)
def set_scale(self, scale):
scale = self.force_downscale(scale)
super().set_scale(scale)
| 21.230769 | 43 | 0.695652 | from .megapix_scaler import MegapixScaler
class MegapixDownscaler(MegapixScaler):
@staticmethod
def force_downscale(scale):
return min(1.0, scale)
def set_scale(self, scale):
scale = self.force_downscale(scale)
super().set_scale(scale)
| true | true |
f7553b054df23601fa51060a5567b70f94e6771a | 2,130 | py | Python | export_serving_model.py | GT-AcerZhang/PaddlePaddle-Classification | 90ff2188aa0501637fe9e36ee9b5fdf57e4ad60a | [
"Apache-2.0"
] | 6 | 2021-01-19T08:22:02.000Z | 2021-11-29T06:08:15.000Z | export_serving_model.py | GT-AcerZhang/PaddlePaddle-Classification | 90ff2188aa0501637fe9e36ee9b5fdf57e4ad60a | [
"Apache-2.0"
] | null | null | null | export_serving_model.py | GT-AcerZhang/PaddlePaddle-Classification | 90ff2188aa0501637fe9e36ee9b5fdf57e4ad60a | [
"Apache-2.0"
] | 4 | 2020-09-17T11:11:56.000Z | 2021-04-12T14:01:49.000Z | import argparse
import os
from ppcls.modeling import architectures
import paddle.fluid as fluid
import paddle_serving_client.io as serving_io
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--model", type=str, default='ResNet50_vd')
parser.add_argument("-p", "--... | 32.272727 | 109 | 0.680282 | import argparse
import os
from ppcls.modeling import architectures
import paddle.fluid as fluid
import paddle_serving_client.io as serving_io
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--model", type=str, default='ResNet50_vd')
parser.add_argument("-p", "--... | true | true |
f7553c94f95e747cca079dc9bd7706973fde8662 | 2,400 | py | Python | src/rezgui/widgets/VariantToolsList.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | src/rezgui/widgets/VariantToolsList.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | src/rezgui/widgets/VariantToolsList.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
from Qt import QtCore, QtWidgets
from rezgui.objects.App import app
from rezgui.mixins.ContextViewMixin import ContextViewMixin
from rezgui.widgets.ToolWidget import ToolWidget
class VariantToolsList(QtWidgets.QTableWidget, ContextVie... | 33.333333 | 85 | 0.666667 |
from Qt import QtCore, QtWidgets
from rezgui.objects.App import app
from rezgui.mixins.ContextViewMixin import ContextViewMixin
from rezgui.widgets.ToolWidget import ToolWidget
class VariantToolsList(QtWidgets.QTableWidget, ContextViewMixin):
def __init__(self, context_model=None, parent=None):
super(... | true | true |
f7553caf9ae4ab1624c040063b2c795e83a3f6fd | 2,551 | py | Python | app/views/site.py | ferocious-ferret/throat | 27d6757703411e76d915f13101399021e7679898 | [
"MIT"
] | null | null | null | app/views/site.py | ferocious-ferret/throat | 27d6757703411e76d915f13101399021e7679898 | [
"MIT"
] | null | null | null | app/views/site.py | ferocious-ferret/throat | 27d6757703411e76d915f13101399021e7679898 | [
"MIT"
] | null | null | null | """ Miscellaneous site endpoints """
from peewee import SQL
from flask import Blueprint, redirect, url_for, abort, render_template
from flask_login import login_required
from .. import misc
from ..models import SiteLog, SubPost, SubLog, Sub, SubPostComment
from ..misc import engine
bp = Blueprint('site', __name__)
@... | 35.929577 | 112 | 0.643669 | from peewee import SQL
from flask import Blueprint, redirect, url_for, abort, render_template
from flask_login import login_required
from .. import misc
from ..models import SiteLog, SubPost, SubLog, Sub, SubPostComment
from ..misc import engine
bp = Blueprint('site', __name__)
@bp.route('/chat')
@login_required
def... | true | true |
f7553ccbd88a8910472c1198552eef237a028613 | 554 | py | Python | core/constants.py | natedileas/imsciutils | 4be7c803c6c0d67ab2f72960469e3c7398c3580b | [
"MIT"
] | null | null | null | core/constants.py | natedileas/imsciutils | 4be7c803c6c0d67ab2f72960469e3c7398c3580b | [
"MIT"
] | null | null | null | core/constants.py | natedileas/imsciutils | 4be7c803c6c0d67ab2f72960469e3c7398c3580b | [
"MIT"
] | null | null | null | import numpy as np
import cv2
# ------------------Standard Type Tables------------------
NUMPY_TYPES = (np.uint8,
np.int8,
np.uint16,
np.int16,
np.int32,
np.float32,
np.float64,
np.complex64,
np.compl... | 29.157895 | 58 | 0.409747 | import numpy as np
import cv2
NUMPY_TYPES = (np.uint8,
np.int8,
np.uint16,
np.int16,
np.int32,
np.float32,
np.float64,
np.complex64,
np.complex128)
CV2_INTERPOLATION_TYPES = (cv2.INTER_NEAREST,
... | true | true |
f7553e14a12f4e743147357a50bff29a9a951bfe | 3,351 | py | Python | server/djangobackend/settings.py | MNGARCIA085/agfzb-CloudAppDevelopment_Capstone | 44853cfe3c068dc9d41a1d98403051c9380f2551 | [
"Apache-2.0"
] | null | null | null | server/djangobackend/settings.py | MNGARCIA085/agfzb-CloudAppDevelopment_Capstone | 44853cfe3c068dc9d41a1d98403051c9380f2551 | [
"Apache-2.0"
] | null | null | null | server/djangobackend/settings.py | MNGARCIA085/agfzb-CloudAppDevelopment_Capstone | 44853cfe3c068dc9d41a1d98403051c9380f2551 | [
"Apache-2.0"
] | null | null | null | """
Django settings for djangobackend project.
Generated by 'django-admin startproject' using Django 3.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import ... | 26.179688 | 91 | 0.699493 | import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'ao5z(o(z@cvzodm99d32jkxa5e8a1!q_4sqss5-a%n6tg$#h$+'
DEBUG = True
APPEND_SLASH = True
ALLOWED_HOSTS = ["127.0.0.1","localhost"]
# Application definition
INSTALLED_APPS = [
'djangoapp.apps.DjangoappConfig... | true | true |
f7553e45d3e0e430cebdb63cc2f9eba5e447a8b9 | 24,850 | py | Python | nball4tree/main_training_process.py | awesome-archive/nball4tree | 62621d01671136771c6d720d19c01ea7eeef9a3f | [
"MIT"
] | null | null | null | nball4tree/main_training_process.py | awesome-archive/nball4tree | 62621d01671136771c6d720d19c01ea7eeef9a3f | [
"MIT"
] | null | null | null | nball4tree/main_training_process.py | awesome-archive/nball4tree | 62621d01671136771c6d720d19c01ea7eeef9a3f | [
"MIT"
] | null | null | null | import os
import copy
import time
import decimal
import operator
import numpy as np
from distutils.dir_util import copy_tree
from nball4tree.config import cgap, L0, R0, DIM, DECIMAL_PRECISION
from nball4tree.util_train import get_children
from nball4tree.util_vec import vec_norm, qsr_DC, qsr_DC_degree, qsr_P, qsr_P_deg... | 43.673111 | 128 | 0.568491 | import os
import copy
import time
import decimal
import operator
import numpy as np
from distutils.dir_util import copy_tree
from nball4tree.config import cgap, L0, R0, DIM, DECIMAL_PRECISION
from nball4tree.util_train import get_children
from nball4tree.util_vec import vec_norm, qsr_DC, qsr_DC_degree, qsr_P, qsr_P_deg... | true | true |
f7553ee6e8bf87e76c7848d34e5395cd2846867f | 345 | py | Python | MaiorMenorSeq.py | Wollacy/Python | afd6dadad290aee0698d4513cd9b168309df810c | [
"MIT"
] | null | null | null | MaiorMenorSeq.py | Wollacy/Python | afd6dadad290aee0698d4513cd9b168309df810c | [
"MIT"
] | null | null | null | MaiorMenorSeq.py | Wollacy/Python | afd6dadad290aee0698d4513cd9b168309df810c | [
"MIT"
] | null | null | null | ## Maior e Menor da Sequência
for c in range(1,6):
peso=float(input('Digite o peso da {}ª pessoa: '.format(c)))
if c == 1:
leve=peso
pesado=peso
if peso <= leve:
leve = peso
if peso >= pesado:
pesado = peso
print('='*30)
print('O mais pesado foi {}Kg'.format(pesado))
print('O mais lev... | 19.166667 | 62 | 0.6 | o=float(input('Digite o peso da {}ª pessoa: '.format(c)))
if c == 1:
leve=peso
pesado=peso
if peso <= leve:
leve = peso
if peso >= pesado:
pesado = peso
print('='*30)
print('O mais pesado foi {}Kg'.format(pesado))
print('O mais leve foi {}Kg'.format(leve)) | true | true |
f7553f0959f5c8ef2c46325ef73c2ffcc8c2b35e | 3,425 | py | Python | ppocr/data/imaug/iaa_augment.py | nan-wang/PaddleOCR | 31b06a2fd19f877a09acaf658387bd919c289b8e | [
"Apache-2.0"
] | 2 | 2021-12-30T07:23:20.000Z | 2022-01-31T01:26:06.000Z | ppocr/data/imaug/iaa_augment.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4 | 2021-04-27T09:52:43.000Z | 2022-01-25T03:11:38.000Z | ppocr/data/imaug/iaa_augment.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 1 | 2022-01-04T21:47:16.000Z | 2022-01-04T21:47:16.000Z | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.009346 | 89 | 0.576642 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import imgaug
import imgaug.augmenters as iaa
class AugmenterBuilder(object):
def __init__(self):
pass
def build(self,... | true | true |
f7553f3daf1f1c2ee784cd349047c6e5fb92cc70 | 4,054 | py | Python | __init__.py | alexenriquent/connector-github | 460885413c304f92977324559c04340730cf3641 | [
"Apache-2.0"
] | null | null | null | __init__.py | alexenriquent/connector-github | 460885413c304f92977324559c04340730cf3641 | [
"Apache-2.0"
] | null | null | null | __init__.py | alexenriquent/connector-github | 460885413c304f92977324559c04340730cf3641 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import aiohttp
from opsdroid.connector import Connector
from opsdroid.message import Message
_LOGGER = logging.getLogger(__name__)
GITHUB_API_URL = "https://api.github.com"
class ConnectorGitHub(Connector):
def __init__(self, config):
"""Setup the connector."""
logg... | 38.980769 | 95 | 0.560927 | import json
import logging
import aiohttp
from opsdroid.connector import Connector
from opsdroid.message import Message
_LOGGER = logging.getLogger(__name__)
GITHUB_API_URL = "https://api.github.com"
class ConnectorGitHub(Connector):
def __init__(self, config):
logging.debug("Loaded GitHub connector"... | true | true |
f7553f5df21bace57b5a8f0f672a05f28c43f627 | 518 | py | Python | env/lib/python3.8/site-packages/plotly/validators/waterfall/totals/marker/_color.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/waterfall/totals/marker/_color.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/waterfall/totals/marker/_color.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="waterfall.totals.marker", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | 32.375 | 82 | 0.631274 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="waterfall.totals.marker", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | true | true |
f7553fcd4681bb2f43b6d2a17c793625b70da012 | 4,669 | py | Python | lib/services/vnas/test/test_v2_api.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/vnas/test/test_v2_api.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/vnas/test/test_v2_api.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
vnas
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import ncloud_vnas
from ncloud_vnas.api.v2_api import V2Api # noqa: E501
from ncloud_vnas.rest import ApiException
class TestV2Api(unittest.TestCase)... | 37.95935 | 110 | 0.699722 |
from __future__ import absolute_import
import unittest
import ncloud_vnas
from ncloud_vnas.api.v2_api import V2Api
from ncloud_vnas.rest import ApiException
class TestV2Api(unittest.TestCase):
def setUp(self):
configuration = ncloud_vnas.Configuration()
configuration.access_key = "YOUR AC... | true | true |
f75541943a7c2c9b40e140af66050c9c3fd9094b | 1,760 | py | Python | models/encoder_cnn.py | sarrouti/VQG | eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b | [
"MIT"
] | 9 | 2020-08-08T17:48:08.000Z | 2022-03-06T06:51:50.000Z | models/encoder_cnn.py | sarrouti/VQG | eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b | [
"MIT"
] | 2 | 2020-07-04T03:08:36.000Z | 2021-03-22T09:16:21.000Z | models/encoder_cnn.py | sarrouti/VQG | eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b | [
"MIT"
] | 2 | 2020-07-24T02:29:42.000Z | 2021-11-21T20:02:22.000Z |
"""
Created on Tue Jun 23 20:15:11 2020
@author: sarroutim2
"""
"""Genearates a representation for an image input.
"""
import torch.nn as nn
import torch
import torchvision.models as models
class EncoderCNN(nn.Module):
"""Generates a representation for an image input.
"""
def __init__(self, output_si... | 30.877193 | 69 | 0.638636 |
import torch.nn as nn
import torch
import torchvision.models as models
class EncoderCNN(nn.Module):
def __init__(self, output_size):
super(EncoderCNN, self).__init__()
self.cnn = models.resnet50(pretrained=True)
for param in self.cnn.parameters():
param.requires_grad = Fals... | true | true |
f75541c4f16135dced6a6ed239cec8d72bdafbbb | 1,757 | py | Python | bomber_monkey/features/player/crunch.py | MonkeyPatchIo/bomber-monkey | 8a351ef1a0ef18e9d98ad72d7274c41f02c0ed1b | [
"MIT"
] | null | null | null | bomber_monkey/features/player/crunch.py | MonkeyPatchIo/bomber-monkey | 8a351ef1a0ef18e9d98ad72d7274c41f02c0ed1b | [
"MIT"
] | null | null | null | bomber_monkey/features/player/crunch.py | MonkeyPatchIo/bomber-monkey | 8a351ef1a0ef18e9d98ad72d7274c41f02c0ed1b | [
"MIT"
] | null | null | null | from typing import Optional
from bomber_monkey.features.board.board import Tiles, TileEffect, Cell
from bomber_monkey.features.physics.collision import Collision
from bomber_monkey.features.player.stronger import Stronger
from bomber_monkey.game_config import GameConfig
from python_ecs.ecs import System, Simulator, Co... | 35.14 | 98 | 0.645987 | from typing import Optional
from bomber_monkey.features.board.board import Tiles, TileEffect, Cell
from bomber_monkey.features.physics.collision import Collision
from bomber_monkey.features.player.stronger import Stronger
from bomber_monkey.game_config import GameConfig
from python_ecs.ecs import System, Simulator, Co... | true | true |
f75541e56a5a23b5b76560c4fd97dddf945320ea | 303 | py | Python | data/multilingual/Latn.PCD/Serif_8/pdf_to_json_test_Latn.PCD_Serif_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.PCD/Serif_8/pdf_to_json_test_Latn.PCD_Serif_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.PCD/Serif_8/pdf_to_json_test_Latn.PCD_Serif_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.PCD/Serif_8/udhr_Latn.PCD_Serif_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 30.3 | 73 | 0.811881 | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.PCD/Serif_8/udhr_Latn.PCD_Serif_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| true | true |
f75542b4ad7533416e439b45899d9b4f02665fbf | 2,138 | py | Python | events/migrations/0005_auto_20200428_1450.py | SaidAbdullahi/virtualmasjid-api | fbd6ea64b64a5868b65c46f8ec469bd0f52ad921 | [
"Apache-2.0"
] | null | null | null | events/migrations/0005_auto_20200428_1450.py | SaidAbdullahi/virtualmasjid-api | fbd6ea64b64a5868b65c46f8ec469bd0f52ad921 | [
"Apache-2.0"
] | 6 | 2021-02-08T21:01:09.000Z | 2021-06-04T23:11:13.000Z | events/migrations/0005_auto_20200428_1450.py | SaidAbdullahi/virtualmasjid-api | fbd6ea64b64a5868b65c46f8ec469bd0f52ad921 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-28 14:50
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('events', '0004_auto_20200428_1325'),
]
operations = [
migrations.RemoveIndex(
model_name='event',
... | 31.441176 | 136 | 0.560337 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('events', '0004_auto_20200428_1325'),
]
operations = [
migrations.RemoveIndex(
model_name='event',
name='events_even_venue_i_23b7d3_idx... | true | true |
f755431b6c691addaa9301e25a4a5d3f0e54ac0e | 5,193 | py | Python | chainermn/communicators/_memory_utility.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 2 | 2019-08-12T21:48:04.000Z | 2020-08-27T18:04:20.000Z | chainermn/communicators/_memory_utility.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | null | null | null | chainermn/communicators/_memory_utility.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | null | null | null | import ctypes
import mpi4py.MPI
import numpy as np
import chainer.backends
try:
import cupy as cp
_cupy_avail = True
except Exception:
_cupy_avail = False
class HostPinnedMemory(object):
def __init__(self):
if not _cupy_avail:
raise RuntimeError('HostPinnedMemory cannot be used:... | 30.368421 | 79 | 0.616022 | import ctypes
import mpi4py.MPI
import numpy as np
import chainer.backends
try:
import cupy as cp
_cupy_avail = True
except Exception:
_cupy_avail = False
class HostPinnedMemory(object):
def __init__(self):
if not _cupy_avail:
raise RuntimeError('HostPinnedMemory cannot be used:... | true | true |
f755434ad780195a842575a4a539cbed2ea1d365 | 28,591 | py | Python | tensorflow/python/eager/function.py | sjawabidgely/tensorflow | 6e5b295111c188cc05bb3c51efe920a4fbe93b03 | [
"Apache-2.0"
] | 22 | 2018-01-13T14:52:47.000Z | 2018-07-05T01:00:28.000Z | tensorflow/python/eager/function.py | worldveil/tensorflow | f5de234d7f601214443f371e90fbadc8f128bb9a | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/function.py | worldveil/tensorflow | f5de234d7f601214443f371e90fbadc8f128bb9a | [
"Apache-2.0"
] | 3 | 2018-01-20T06:47:34.000Z | 2018-05-07T19:14:34.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.070573 | 98 | 0.701305 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
import threading
import numpy as np
from tensorflow.core.framework import function_pb2
from tensorflow.python import pywrap_tensorflow
from tensorflow.pyth... | true | true |
f755445ce4bad388864e17c94a756c9456495b89 | 3,926 | py | Python | configs/lvis/mask_rcnn_r50_fpn_ga_max300_2x_lvis.py | wondervictor/lvis-mmdet | 68532eb6f4643ddf0179a4384c8c9e004a2c1d07 | [
"Apache-2.0"
] | 1 | 2021-04-24T17:01:30.000Z | 2021-04-24T17:01:30.000Z | configs/lvis/mask_rcnn_r50_fpn_ga_max300_2x_lvis.py | wondervictor/lvis-mmdet | 68532eb6f4643ddf0179a4384c8c9e004a2c1d07 | [
"Apache-2.0"
] | null | null | null | configs/lvis/mask_rcnn_r50_fpn_ga_max300_2x_lvis.py | wondervictor/lvis-mmdet | 68532eb6f4643ddf0179a4384c8c9e004a2c1d07 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/default_runtime.py'
]
model = dict(
pretrained='pretrained_model/resnet50-19c8e357.pth',
rpn_head=dict(
_delete_=True,
type='GARPNHead',
in_channels=256,
feat_channel... | 33.271186 | 94 | 0.597555 | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/default_runtime.py'
]
model = dict(
pretrained='pretrained_model/resnet50-19c8e357.pth',
rpn_head=dict(
_delete_=True,
type='GARPNHead',
in_channels=256,
feat_channel... | true | true |
f75544b65bd4c6a0ea761e96999c44891049e840 | 8,826 | py | Python | python_modules/dagster/dagster_tests/core_tests/test_pipeline_errors.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | 1 | 2019-07-15T17:34:04.000Z | 2019-07-15T17:34:04.000Z | python_modules/dagster/dagster_tests/core_tests/test_pipeline_errors.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/test_pipeline_errors.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | import sys
import pytest
from dagster import (
DagsterExecutionStepExecutionError,
DagsterInvariantViolationError,
DependencyDefinition,
EventMetadataEntry,
Failure,
InputDefinition,
Output,
OutputDefinition,
PipelineDefinition,
RunConfig,
SolidDefinition,
check,
ex... | 29.817568 | 100 | 0.675617 | import sys
import pytest
from dagster import (
DagsterExecutionStepExecutionError,
DagsterInvariantViolationError,
DependencyDefinition,
EventMetadataEntry,
Failure,
InputDefinition,
Output,
OutputDefinition,
PipelineDefinition,
RunConfig,
SolidDefinition,
check,
ex... | true | true |
f755471648c534b3a5a6043fe42a2c411896c7f4 | 15,373 | py | Python | cdmft/operators/hubbard.py | nikwitt/cdmft | ebca66c760e0f6618a0b475eeeb5ace3cd229a2c | [
"MIT"
] | 7 | 2019-05-02T13:19:33.000Z | 2021-11-17T14:06:55.000Z | cdmft/operators/hubbard.py | nikwitt/cdmft | ebca66c760e0f6618a0b475eeeb5ace3cd229a2c | [
"MIT"
] | null | null | null | cdmft/operators/hubbard.py | nikwitt/cdmft | ebca66c760e0f6618a0b475eeeb5ace3cd229a2c | [
"MIT"
] | 1 | 2021-04-14T15:05:50.000Z | 2021-04-14T15:05:50.000Z | import numpy as np, itertools as itt
from scipy.linalg import expm, inv
from pytriqs.operators import c as C, c_dag as CDag, n as N, dagger
from cdmft.gfoperations import sum
from cdmft.transformation import GfStructTransformationIndex
class Hubbard:
"""
meant as abstract class, realization needs self._c(s, ... | 38.528822 | 373 | 0.571326 | import numpy as np, itertools as itt
from scipy.linalg import expm, inv
from pytriqs.operators import c as C, c_dag as CDag, n as N, dagger
from cdmft.gfoperations import sum
from cdmft.transformation import GfStructTransformationIndex
class Hubbard:
def _c(self, spin, site, *args, **kwargs):
return C(sp... | true | true |
f755471789f289b4e5afe9a1c78075afbea9355d | 3,917 | py | Python | orchestrator/orchestrator_edep.py | yul69-cell/HELAO | a39372eb385ee93b711443d9cbd56c5ec737ff70 | [
"CC0-1.0"
] | null | null | null | orchestrator/orchestrator_edep.py | yul69-cell/HELAO | a39372eb385ee93b711443d9cbd56c5ec737ff70 | [
"CC0-1.0"
] | null | null | null | orchestrator/orchestrator_edep.py | yul69-cell/HELAO | a39372eb385ee93b711443d9cbd56c5ec737ff70 | [
"CC0-1.0"
] | null | null | null | import os
import sys
import time
from copy import copy
import matplotlib.pyplot as plt
import numpy as np
# from impedance.circuits import Randles, CustomCircuit
if __package__:
# can import directly in package mode
print("importing actions from package path")
else:
# interactive kernel mode requires path... | 27.391608 | 104 | 0.644115 | import os
import sys
import time
from copy import copy
import matplotlib.pyplot as plt
import numpy as np
if __package__:
print("importing actions from package path")
else:
cwd = os.getcwd()
pwd = os.path.dirname(cwd)
if os.path.basename(pwd) == "HELAO":
sys.path.insert(0, pwd)
... | true | true |
f7554780fe17c2ca86b75d4669b11b5a7853557e | 11,947 | py | Python | pdfminer/cmapdb.py | ciena-blueplanet/pdfminer.six | a8436994aa0da8bc5aaadaaf0c7fcd041aeb9d4f | [
"MIT"
] | 1 | 2018-05-01T20:26:11.000Z | 2018-05-01T20:26:11.000Z | pdfminer/cmapdb.py | ciena-blueplanet/pdfminer.six | a8436994aa0da8bc5aaadaaf0c7fcd041aeb9d4f | [
"MIT"
] | null | null | null | pdfminer/cmapdb.py | ciena-blueplanet/pdfminer.six | a8436994aa0da8bc5aaadaaf0c7fcd041aeb9d4f | [
"MIT"
] | 1 | 2020-05-18T04:06:04.000Z | 2020-05-18T04:06:04.000Z |
""" Adobe character mapping (CMap) support.
CMaps provide the mapping between character codes and Unicode
code-points to character ids (CIDs).
More information is available on the Adobe website:
http://opensource.adobe.com/wiki/display/cmap/CMap+Resources
"""
import sys
import os
import os.path
import gzip
try... | 27.52765 | 94 | 0.535113 |
import sys
import os
import os.path
import gzip
try:
import cPickle as pickle
except ImportError:
import pickle as pickle
import struct
import logging
from .psparser import PSStackParser
from .psparser import PSSyntaxError
from .psparser import PSEOF
from .psparser import PSLiteral
from .psparser import lite... | true | true |
f75547f762448e03c02144d59fcbb9a3971c1de7 | 23,049 | py | Python | lib/galaxy/tools/data_manager/manager.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2021-02-28T18:59:16.000Z | 2021-02-28T18:59:16.000Z | lib/galaxy/tools/data_manager/manager.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 12 | 2020-07-24T23:55:19.000Z | 2021-12-19T11:40:06.000Z | lib/galaxy/tools/data_manager/manager.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2019-01-16T22:21:54.000Z | 2019-01-16T22:21:54.000Z | import errno
import json
import logging
import os
from collections import OrderedDict
from six import string_types
from galaxy import util
from galaxy.tools.data import TabularToolDataTable
from galaxy.util.template import fill_template
log = logging.getLogger(__name__)
SUPPORTED_DATA_TABLE_TYPES = (TabularToolData... | 58.798469 | 321 | 0.623932 | import errno
import json
import logging
import os
from collections import OrderedDict
from six import string_types
from galaxy import util
from galaxy.tools.data import TabularToolDataTable
from galaxy.util.template import fill_template
log = logging.getLogger(__name__)
SUPPORTED_DATA_TABLE_TYPES = (TabularToolData... | true | true |
f75548e0a3b09248aa34b58a9c7a5bf303a04e73 | 5,267 | py | Python | src/test/utils/security/authorise/test_usergrouploader.py | narnikgamarnikus/program-y | 777b9a8a75ec787c037de9f11a8527875ff450b1 | [
"MIT"
] | null | null | null | src/test/utils/security/authorise/test_usergrouploader.py | narnikgamarnikus/program-y | 777b9a8a75ec787c037de9f11a8527875ff450b1 | [
"MIT"
] | null | null | null | src/test/utils/security/authorise/test_usergrouploader.py | narnikgamarnikus/program-y | 777b9a8a75ec787c037de9f11a8527875ff450b1 | [
"MIT"
] | null | null | null | import unittest
import os
from programy.utils.security.authorise.usergrouploader import UserGroupLoader
class UserGroupLoaderTests(unittest.TestCase):
def test_load_from_file(self):
loader = UserGroupLoader()
users_dict, groups_dict = loader.load_users_and_groups_from_file(os.path.dirname(__file... | 30.097143 | 133 | 0.56161 | import unittest
import os
from programy.utils.security.authorise.usergrouploader import UserGroupLoader
class UserGroupLoaderTests(unittest.TestCase):
def test_load_from_file(self):
loader = UserGroupLoader()
users_dict, groups_dict = loader.load_users_and_groups_from_file(os.path.dirname(__file... | true | true |
f755496bc0b84d328f855cac09f63defe965f009 | 2,189 | py | Python | core/menu.py | anir0y/phishme | f74a5b5f9349d027ebae74a5225bb4e8f50ce98e | [
"BSD-3-Clause"
] | 1 | 2020-08-10T11:58:03.000Z | 2020-08-10T11:58:03.000Z | core/menu.py | anir0y/phishme | f74a5b5f9349d027ebae74a5225bb4e8f50ce98e | [
"BSD-3-Clause"
] | null | null | null | core/menu.py | anir0y/phishme | f74a5b5f9349d027ebae74a5225bb4e8f50ce98e | [
"BSD-3-Clause"
] | null | null | null | from huepy import cyan, bold
menu_sites = {
"Social Media": {
"Facebook",
"Google",
"LinkedIn",
"Twitter",
"Instagram",
"Snapchat",
"FbRobotCaptcha",
"VK",
"Github",
},
"Others": {
"StackOverflow",
"Wordpress",
"Steam",
}
}
SF_PROMPT = cyan(" Phishme > ")
def colorize_option(chave, valor)... | 23.042105 | 71 | 0.65418 | from huepy import cyan, bold
menu_sites = {
"Social Media": {
"Facebook",
"Google",
"LinkedIn",
"Twitter",
"Instagram",
"Snapchat",
"FbRobotCaptcha",
"VK",
"Github",
},
"Others": {
"StackOverflow",
"Wordpress",
"Steam",
}
}
SF_PROMPT = cyan(" Phishme > ")
def colorize_option(chave, valor)... | true | true |
f75549c401a06865a2d31de815cf096097a72dba | 7,471 | py | Python | controllers/suggestions/suggest_offseason_event_review_controller.py | dc74089/the-blue-alliance | 2c47b6e8b61819eda4dcda5e0011cb2d5c7d3785 | [
"MIT"
] | null | null | null | controllers/suggestions/suggest_offseason_event_review_controller.py | dc74089/the-blue-alliance | 2c47b6e8b61819eda4dcda5e0011cb2d5c7d3785 | [
"MIT"
] | null | null | null | controllers/suggestions/suggest_offseason_event_review_controller.py | dc74089/the-blue-alliance | 2c47b6e8b61819eda4dcda5e0011cb2d5c7d3785 | [
"MIT"
] | null | null | null | from datetime import datetime
from difflib import SequenceMatcher
from consts.account_permissions import AccountPermissions
from consts.event_type import EventType
from controllers.suggestions.suggestions_review_base_controller import \
SuggestionsReviewBaseController
from database.event_query import EventListQuer... | 42.691429 | 265 | 0.660554 | from datetime import datetime
from difflib import SequenceMatcher
from consts.account_permissions import AccountPermissions
from consts.event_type import EventType
from controllers.suggestions.suggestions_review_base_controller import \
SuggestionsReviewBaseController
from database.event_query import EventListQuer... | true | true |
f7554ca859519e532e7ea817410e4edf21997e97 | 551 | py | Python | leetcode/jump_game.py | zhangao0086/Python-Algorithm | 981c875b2e0f30619bd3d44e1f2bd0c47d1464a2 | [
"MIT"
] | 3 | 2021-05-21T12:55:14.000Z | 2022-02-01T16:21:30.000Z | leetcode/jump_game.py | zhangao0086/Python-Algorithm | 981c875b2e0f30619bd3d44e1f2bd0c47d1464a2 | [
"MIT"
] | null | null | null | leetcode/jump_game.py | zhangao0086/Python-Algorithm | 981c875b2e0f30619bd3d44e1f2bd0c47d1464a2 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*-coding:utf-8-*-
__author__ = "Bannings"
from typing import List
class Solution:
def canJump(self, nums: List[int]) -> bool:
max_right = 0
for i in range(len(nums)):
if i > max_right: return False
max_right = max(nums[i] + i, max_right)
retur... | 27.55 | 51 | 0.591652 |
__author__ = "Bannings"
from typing import List
class Solution:
def canJump(self, nums: List[int]) -> bool:
max_right = 0
for i in range(len(nums)):
if i > max_right: return False
max_right = max(nums[i] + i, max_right)
return True
if __name__ == '__main__':
... | true | true |
f7554cd0ffc0a0c33f565f46d5054b64af7c6fbd | 25,637 | py | Python | cmasher/colormaps/redshift/redshift.py | cclauss/CMasher | 8ecaadd26e8a71bf7cf3ade493aef763612ff21b | [
"BSD-3-Clause"
] | 257 | 2019-11-16T09:41:30.000Z | 2022-03-27T09:37:18.000Z | cmasher/colormaps/redshift/redshift.py | cclauss/CMasher | 8ecaadd26e8a71bf7cf3ade493aef763612ff21b | [
"BSD-3-Clause"
] | 32 | 2019-12-08T23:01:42.000Z | 2022-03-04T16:55:42.000Z | cmasher/colormaps/redshift/redshift.py | cclauss/CMasher | 8ecaadd26e8a71bf7cf3ade493aef763612ff21b | [
"BSD-3-Clause"
] | 21 | 2020-01-09T16:04:29.000Z | 2022-01-02T19:41:16.000Z | # %% IMPORTS
# Package imports
from matplotlib.cm import register_cmap
from matplotlib.colors import ListedColormap
# All declaration
__all__ = ['cmap']
# Author declaration
__author__ = "Ellert van der Velden (@1313e)"
# Package declaration
__package__ = 'cmasher'
# %% GLOBALS AND DEFINITIONS
# Type of this color... | 47.475926 | 58 | 0.556266 |
from matplotlib.cm import register_cmap
from matplotlib.colors import ListedColormap
__all__ = ['cmap']
__author__ = "Ellert van der Velden (@1313e)"
__package__ = 'cmasher'
cm_type = 'diverging'
cm_data = [[0.57869284, 0.94700453, 0.95383509],
[0.57330096, 0.94244813, 0.95218584],
[... | true | true |
f7554e0a1275496841ef73a92152f003bb6d752d | 4,487 | py | Python | cluster_print_results.py | ombretta/3D-ResNets-PyTorch | a5b0f092c36c5256257ba854fbc50718c35244fb | [
"MIT"
] | null | null | null | cluster_print_results.py | ombretta/3D-ResNets-PyTorch | a5b0f092c36c5256257ba854fbc50718c35244fb | [
"MIT"
] | null | null | null | cluster_print_results.py | ombretta/3D-ResNets-PyTorch | a5b0f092c36c5256257ba854fbc50718c35244fb | [
"MIT"
] | 1 | 2020-12-22T11:24:38.000Z | 2020-12-22T11:24:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 30 17:00:15 2021
@author: ombretta
"""
import os
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import numpy as np
from matplotlib import pyplot as plt
import json
import sys
def main(dirs_dataset_filter="mnis... | 47.734043 | 128 | 0.609316 |
import os
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import numpy as np
from matplotlib import pyplot as plt
import json
import sys
def main(dirs_dataset_filter="mnist", more_discard_dirs=[],
filtering_criteria_models=["resnet_50", "resnet_34", "resnet_18",
... | true | true |
f7554e1cc7949691372d71409301e55a933b382d | 213 | py | Python | vehicle_management/vehicle_management/doctype/vehicle_make/test_vehicle_make.py | muirawachanga/vehicle | 1025f99ecab14d27485584f540e9630bfcb50c0f | [
"MIT"
] | null | null | null | vehicle_management/vehicle_management/doctype/vehicle_make/test_vehicle_make.py | muirawachanga/vehicle | 1025f99ecab14d27485584f540e9630bfcb50c0f | [
"MIT"
] | null | null | null | vehicle_management/vehicle_management/doctype/vehicle_make/test_vehicle_make.py | muirawachanga/vehicle | 1025f99ecab14d27485584f540e9630bfcb50c0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, stephen and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicleMake(unittest.TestCase):
pass
| 17.75 | 46 | 0.755869 |
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicleMake(unittest.TestCase):
pass
| true | true |
f755517932cc722aa63055ad06d61005a0033339 | 1,005 | py | Python | src/carts/migrations/0011_auto_20160613_1003.py | insta-code1/ecommerce | b32f8549bd1c518846a791c85d298db34023a01c | [
"MIT"
] | null | null | null | src/carts/migrations/0011_auto_20160613_1003.py | insta-code1/ecommerce | b32f8549bd1c518846a791c85d298db34023a01c | [
"MIT"
] | null | null | null | src/carts/migrations/0011_auto_20160613_1003.py | insta-code1/ecommerce | b32f8549bd1c518846a791c85d298db34023a01c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carts', '0010_cart_tax_percentage'),
]
operations = [
migrations.AlterField(
model_name='cart',
name... | 28.714286 | 86 | 0.59005 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carts', '0010_cart_tax_percentage'),
]
operations = [
migrations.AlterField(
model_name='cart',
name='subtotal',
... | true | true |
f75552aa7a4d414e8b906ef0f985611e49bd480d | 1,075 | py | Python | params.py | dblim/penang-covid19-r0 | e8720d516408cac1c74a47843213978fc0ede825 | [
"MIT"
] | 4 | 2021-07-12T10:49:10.000Z | 2021-08-03T15:06:04.000Z | params.py | dblim/penang-covid19 | e8720d516408cac1c74a47843213978fc0ede825 | [
"MIT"
] | null | null | null | params.py | dblim/penang-covid19 | e8720d516408cac1c74a47843213978fc0ede825 | [
"MIT"
] | 1 | 2021-08-03T15:04:58.000Z | 2021-08-03T15:04:58.000Z | """This file is where all our default parameters will be placed.
"""
# The number of days we use to calculate R_0
R0_WINDOW = 14
# The serial interval, an empirically measured number that is the number
# of days it takes a person who has just gotten COVID-19 to be come
# infections. Right now I have set that number t... | 37.068966 | 72 | 0.629767 |
R0_WINDOW = 14
SERIAL_INT = 5.2
TOTAL = False
| true | true |
f75552c6956880e65b4d53b7c050c5ac470d68cb | 1,804 | py | Python | q2_types/per_sample_sequences/__init__.py | thermokarst/q2-types | 4b6825406da8e4c69af461e0cc4563c315c8b1ae | [
"BSD-3-Clause"
] | null | null | null | q2_types/per_sample_sequences/__init__.py | thermokarst/q2-types | 4b6825406da8e4c69af461e0cc4563c315c8b1ae | [
"BSD-3-Clause"
] | null | null | null | q2_types/per_sample_sequences/__init__.py | thermokarst/q2-types | 4b6825406da8e4c69af461e0cc4563c315c8b1ae | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 48.756757 | 78 | 0.62694 |
import importlib
from ._format import (CasavaOneEightSingleLanePerSampleDirFmt,
CasavaOneEightLanelessPerSampleDirFmt,
FastqGzFormat, YamlFormat,
FastqManifestFormat, FastqAbsolutePathManifestFormat,
SingleLanePerSampleSing... | true | true |
f755543b9ea9a6a9226c09216b4558665cb434af | 559 | py | Python | Chapter 05/5.06/model.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | c6a045fbf5ba3ece5e8a02bbe33ac13bb57b2b8e | [
"MIT"
] | 120 | 2018-03-04T07:17:00.000Z | 2022-01-25T08:09:57.000Z | Chapter 05/5.06/model.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | c6a045fbf5ba3ece5e8a02bbe33ac13bb57b2b8e | [
"MIT"
] | 3 | 2019-03-24T09:32:43.000Z | 2020-07-28T07:35:49.000Z | Chapter 05/5.06/model.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | c6a045fbf5ba3ece5e8a02bbe33ac13bb57b2b8e | [
"MIT"
] | 81 | 2018-04-18T06:51:46.000Z | 2022-03-30T01:31:35.000Z | """
Code illustration: 5.06
@Tkinter GUI Application Development Blueprints
"""
class Model:
def __init__(self):
self.__play_list = []
@property
def play_list(self):
return self.__play_list
def get_file_to_play(self, file_index):
return self.__play_list[file_index]
def... | 19.964286 | 57 | 0.686941 |
class Model:
def __init__(self):
self.__play_list = []
@property
def play_list(self):
return self.__play_list
def get_file_to_play(self, file_index):
return self.__play_list[file_index]
def clear_play_list(self):
self.__play_list.clear()
def add_to_play_lis... | true | true |
f75555281ae043fc22e8e7d0343aebd3d8cd5512 | 7,701 | py | Python | book/trees/binary_heap.py | richardartoul/algos | d8cf1df8bd47070e56d4b2b5ceeb4550c6e5fb09 | [
"CC0-1.0"
] | null | null | null | book/trees/binary_heap.py | richardartoul/algos | d8cf1df8bd47070e56d4b2b5ceeb4550c6e5fb09 | [
"CC0-1.0"
] | null | null | null | book/trees/binary_heap.py | richardartoul/algos | d8cf1df8bd47070e56d4b2b5ceeb4550c6e5fb09 | [
"CC0-1.0"
] | 1 | 2020-05-28T21:53:51.000Z | 2020-05-28T21:53:51.000Z | """
We will begin our implementation of a binary heap with the constructor.
Since the entire binary heap can be represented by a single list, all
the constructor will do is initialize the list and an attribute
`current_size` to keep track of the current size of the heap.
The code below shows the Python code for the con... | 45.3 | 77 | 0.714323 |
class BinaryHeap(object):
def __init__(self):
self.items = [0]
def __len__(self):
return len(self.items) - 1
def percolate_up(self):
i = len(self)
while i // 2 > 0:
if self.items[i] < self.items[i // 2]:
self.items[i // 2], self.items[i] = \
... | true | true |
f7555549defb165255462876c3499b91199bc52e | 2,543 | py | Python | llc1_document_api/extensions.py | LandRegistry/llc1-document-api | ea115cd039dfbfe2e9421725e73c1f60e1e7518b | [
"MIT"
] | null | null | null | llc1_document_api/extensions.py | LandRegistry/llc1-document-api | ea115cd039dfbfe2e9421725e73c1f60e1e7518b | [
"MIT"
] | null | null | null | llc1_document_api/extensions.py | LandRegistry/llc1-document-api | ea115cd039dfbfe2e9421725e73c1f60e1e7518b | [
"MIT"
] | 1 | 2021-04-11T05:25:05.000Z | 2021-04-11T05:25:05.000Z | from flask_logconfig import LogConfig
import logging
import json
import traceback
from flask import g, ctx, request
from flask_sqlalchemy import SQLAlchemy
import collections
# Add custom log level for performance platform logs
PERFORMANCE_PLATFORM_LOG_LEVEL_NUM = 51
logging.addLevelName(PERFORMANCE_PLATFORM_LOG_LEVEL... | 31.7875 | 108 | 0.661817 | from flask_logconfig import LogConfig
import logging
import json
import traceback
from flask import g, ctx, request
from flask_sqlalchemy import SQLAlchemy
import collections
PERFORMANCE_PLATFORM_LOG_LEVEL_NUM = 51
logging.addLevelName(PERFORMANCE_PLATFORM_LOG_LEVEL_NUM, "PERFORMANCE_PLATFORM")
def performance_plat... | true | true |
f7555630868f576f0edc1d0235465e66df45c327 | 6,839 | py | Python | python/common/config_provider.py | dileepk588/aaa | b2177a59bbce036ac68ab61465f00cefc9126d9f | [
"MIT"
] | 34 | 2019-10-03T05:24:08.000Z | 2022-03-07T01:39:37.000Z | python/common/config_provider.py | dileepk588/aaa | b2177a59bbce036ac68ab61465f00cefc9126d9f | [
"MIT"
] | 8 | 2020-06-17T14:18:32.000Z | 2021-10-06T07:41:24.000Z | python/common/config_provider.py | dileepk588/aaa | b2177a59bbce036ac68ab61465f00cefc9126d9f | [
"MIT"
] | 27 | 2019-11-22T07:46:24.000Z | 2022-02-14T03:28:45.000Z | import optparse
import configparser
from os import environ, path
from pathlib import Path
from sys import argv
from common.bitmovin_argument import BitmovinArgument
class ConfigProvider(object):
_properties = {
"BITMOVIN_API_KEY":
BitmovinArgument("Your API key for the Bitmovin API.", True),
... | 38.638418 | 121 | 0.669542 | import optparse
import configparser
from os import environ, path
from pathlib import Path
from sys import argv
from common.bitmovin_argument import BitmovinArgument
class ConfigProvider(object):
_properties = {
"BITMOVIN_API_KEY":
BitmovinArgument("Your API key for the Bitmovin API.", True),
... | true | true |
f75556e30e8a3f525b60f581424c05095298c888 | 402 | py | Python | src/py_mancala/mancala.py | jgsogo/godot-python | 05dd80b9b5f1d099601489937ea4609fe9a2f8d2 | [
"MIT"
] | null | null | null | src/py_mancala/mancala.py | jgsogo/godot-python | 05dd80b9b5f1d099601489937ea4609fe9a2f8d2 | [
"MIT"
] | null | null | null | src/py_mancala/mancala.py | jgsogo/godot-python | 05dd80b9b5f1d099601489937ea4609fe9a2f8d2 | [
"MIT"
] | null | null | null |
class Mancala:
def __init__(self):
print("(python) Mancala::init")
self.state = 0
def get_state(self):
print("(python) Mancala::get_state")
self.state += 1
return "(python) current state: {!r}".format(self.state)
def play_position(self, value):
print("(pyth... | 26.8 | 74 | 0.594527 |
class Mancala:
def __init__(self):
print("(python) Mancala::init")
self.state = 0
def get_state(self):
print("(python) Mancala::get_state")
self.state += 1
return "(python) current state: {!r}".format(self.state)
def play_position(self, value):
print("(pyth... | true | true |
f75558e06efa7d6e0ed395316ca58c505c091d68 | 16,711 | py | Python | corehq/ex-submodules/couchforms/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/ex-submodules/couchforms/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/ex-submodules/couchforms/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import base64
import datetime
import hashlib
import logging
import time
import uuid
from django.db import models
from couchdbkit import ResourceNotFound
from couchdbkit.exceptions import PreconditionFailed
from dimagi.ext.couchdbkit import (
DocumentSchema,
DateTimeProperty,
StringProperty,
DictPrope... | 31.235514 | 105 | 0.643648 | import base64
import datetime
import hashlib
import logging
import time
import uuid
from django.db import models
from couchdbkit import ResourceNotFound
from couchdbkit.exceptions import PreconditionFailed
from dimagi.ext.couchdbkit import (
DocumentSchema,
DateTimeProperty,
StringProperty,
DictPrope... | true | true |
f755595a8ce382360ed4d597e0de319eb9b24bf2 | 2,773 | py | Python | tests/bindings/test_rid.py | curradium/godot-python | 11355dfd03a3dad80253b49c532fbb61a8b26d98 | [
"CC-BY-3.0"
] | null | null | null | tests/bindings/test_rid.py | curradium/godot-python | 11355dfd03a3dad80253b49c532fbb61a8b26d98 | [
"CC-BY-3.0"
] | null | null | null | tests/bindings/test_rid.py | curradium/godot-python | 11355dfd03a3dad80253b49c532fbb61a8b26d98 | [
"CC-BY-3.0"
] | null | null | null | import pytest
from godot import RID, Environment, Node
@pytest.fixture
def generate_obj():
objs = []
def _generate_obj(type):
obj = type.new()
objs.append(obj)
return obj
yield _generate_obj
for obj in objs:
obj.free()
def test_base():
v = RID()
assert typ... | 23.905172 | 82 | 0.634331 | import pytest
from godot import RID, Environment, Node
@pytest.fixture
def generate_obj():
objs = []
def _generate_obj(type):
obj = type.new()
objs.append(obj)
return obj
yield _generate_obj
for obj in objs:
obj.free()
def test_base():
v = RID()
assert typ... | true | true |
f75559de938cad3aa9c9af45daaaed88d2587b9c | 277 | py | Python | sonar/test_ipfs.py | bopopescu/smart_contracts7 | 40a487cb3843e86ab5e4cb50b1aafa2095f648cd | [
"Apache-2.0"
] | 171 | 2017-07-29T21:51:07.000Z | 2018-04-07T10:04:12.000Z | sonar/test_ipfs.py | bopopescu/smart_contracts7 | 40a487cb3843e86ab5e4cb50b1aafa2095f648cd | [
"Apache-2.0"
] | 36 | 2017-07-31T01:54:18.000Z | 2017-12-06T00:15:32.000Z | sonar/test_ipfs.py | bopopescu/smart_contracts7 | 40a487cb3843e86ab5e4cb50b1aafa2095f648cd | [
"Apache-2.0"
] | 63 | 2017-08-06T18:52:35.000Z | 2018-03-29T12:56:41.000Z | from sonar.ipfs import IPFS
def test_retrieval_of_stored_obj():
storage = IPFS(host='127.0.0.1', port=5001)
obj_to_store = {'foo': 'bar'}
address = storage.store(obj_to_store)
retrieved_obj = storage.retrieve(address)
assert retrieved_obj == obj_to_store
| 27.7 | 47 | 0.714801 | from sonar.ipfs import IPFS
def test_retrieval_of_stored_obj():
storage = IPFS(host='127.0.0.1', port=5001)
obj_to_store = {'foo': 'bar'}
address = storage.store(obj_to_store)
retrieved_obj = storage.retrieve(address)
assert retrieved_obj == obj_to_store
| true | true |
f7555a7dfcc22717e4b26716d1d8b9922bcfe96d | 5,408 | py | Python | onsen/settings.py | kikei/onsen | a1cd2771c2ceb9b0c8c1f2f91b1bddda7333840f | [
"Apache-2.0"
] | null | null | null | onsen/settings.py | kikei/onsen | a1cd2771c2ceb9b0c8c1f2f91b1bddda7333840f | [
"Apache-2.0"
] | null | null | null | onsen/settings.py | kikei/onsen | a1cd2771c2ceb9b0c8c1f2f91b1bddda7333840f | [
"Apache-2.0"
] | null | null | null | """
Django settings for onsen project.
Generated by 'django-admin startproject' using Django 1.9.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# B... | 26 | 95 | 0.620377 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'tjd$jgnwsom8i_z5q^-%4i#xsgq63@9$k3j2)%1ou^ezi23#7j'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f7555b16e661033a61522d8e2a9c79d32fb382f6 | 864 | py | Python | rh/apps/content/migrations/0019_remove_orhpaned_sections.py | rapidpro/chpro-microsite | 4e1d1210b49ec60ab0711d78235bf45eeb5c0275 | [
"BSD-3-Clause"
] | null | null | null | rh/apps/content/migrations/0019_remove_orhpaned_sections.py | rapidpro/chpro-microsite | 4e1d1210b49ec60ab0711d78235bf45eeb5c0275 | [
"BSD-3-Clause"
] | 108 | 2018-01-30T15:26:18.000Z | 2021-06-10T17:29:57.000Z | rh/apps/content/migrations/0019_remove_orhpaned_sections.py | rapidpro/chpro-microsite | 4e1d1210b49ec60ab0711d78235bf45eeb5c0275 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-04 22:51
from __future__ import unicode_literals
from django.db import migrations
def remove_orphaned_sections(apps, schema_editor):
Section = apps.get_model('content.Section')
IconCard = apps.get_model('content.IconCard')
PhotoCard = apps.g... | 30.857143 | 86 | 0.717593 |
from __future__ import unicode_literals
from django.db import migrations
def remove_orphaned_sections(apps, schema_editor):
Section = apps.get_model('content.Section')
IconCard = apps.get_model('content.IconCard')
PhotoCard = apps.get_model('content.PhotoCard')
for section in Section.objects.filter... | true | true |
f7555bdd4af0a3011f18ecc79f42c474a8083ec3 | 10,238 | py | Python | stomp/adapter/webstomp.py | Silberschleier/stomp.py | 175ed539f0a5985c8d6af183effd0cadb5ee4617 | [
"Apache-2.0"
] | null | null | null | stomp/adapter/webstomp.py | Silberschleier/stomp.py | 175ed539f0a5985c8d6af183effd0cadb5ee4617 | [
"Apache-2.0"
] | null | null | null | stomp/adapter/webstomp.py | Silberschleier/stomp.py | 175ed539f0a5985c8d6af183effd0cadb5ee4617 | [
"Apache-2.0"
] | null | null | null | """Provides the underlying transport functionality (for stomp message transmission) - (mostly) independent from the actual STOMP protocol
"""
import logging
import math
import random
import sys
import threading
import time
import re
from stomp.connect import BaseConnection
from stomp.protocol import Protocol11
from ... | 42.658333 | 137 | 0.64788 |
import logging
import math
import random
import sys
import threading
import time
import re
from stomp.connect import BaseConnection
from stomp.protocol import Protocol11
from stomp.backward import monotonic
from stomp.transport import BaseTransport
import stomp.exception as exception
import stomp.utils as utils
imp... | true | true |
f7555bdebfe28a2a9e8cd046b56155365155723c | 4,742 | py | Python | pysnmp/TPT-PORT-MAPPING-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/TPT-PORT-MAPPING-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/TPT-PORT-MAPPING-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module TPT-PORT-MAPPING-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPT-PORT-MAPPING-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:19:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | 115.658537 | 603 | 0.781316 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint = mibBuild... | true | true |
f7555be0c4d477c83c2f128541819ec3d79da0b8 | 1,680 | py | Python | dcr/scenario_utils/crypto.py | ce-bu/WALinuxAgent | ec0609d673fa31ee4ad803885a02dbb55411c77c | [
"Apache-2.0"
] | 423 | 2015-01-05T04:57:44.000Z | 2022-03-20T11:44:57.000Z | dcr/scenario_utils/crypto.py | ce-bu/WALinuxAgent | ec0609d673fa31ee4ad803885a02dbb55411c77c | [
"Apache-2.0"
] | 1,984 | 2015-01-07T03:20:12.000Z | 2022-03-31T09:46:24.000Z | dcr/scenario_utils/crypto.py | larohra/WALinuxAgent | bac602173d1fd68d198a4f8b05a911c5e93927f6 | [
"Apache-2.0"
] | 398 | 2015-01-07T14:49:32.000Z | 2022-03-14T08:42:57.000Z | import os
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
from dcr.scenario_utils.common_utils import random_alphanum
class OpenSshKey(object):
"""
Represents an OpenSSH key pair.
... | 28 | 77 | 0.689286 | import os
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
from dcr.scenario_utils.common_utils import random_alphanum
class OpenSshKey(object):
def __init__(self, public_key: bytes, priva... | true | true |
f7555d19951a01511f60961977a4014d17be5a48 | 1,850 | py | Python | dft_loihi/examples/1d/1d_multi_peak.py | mathisrichter/dft_loihi | a72da06c92db0b24dd5be4b4ab9bf04c7a68c50a | [
"MIT"
] | null | null | null | dft_loihi/examples/1d/1d_multi_peak.py | mathisrichter/dft_loihi | a72da06c92db0b24dd5be4b4ab9bf04c7a68c50a | [
"MIT"
] | null | null | null | dft_loihi/examples/1d/1d_multi_peak.py | mathisrichter/dft_loihi | a72da06c92db0b24dd5be4b4ab9bf04c7a68c50a | [
"MIT"
] | null | null | null | import nxsdk.net.net
from dft_loihi.visualization.plotting import Plotter
from dft_loihi.dft.field import Field
from dft_loihi.dft.kernel import MultiPeakKernel
from dft_loihi.inputs.simulated_input import GaussPiecewiseStaticInput
from dft_loihi.dft.util import connect
# set up the network
net = nxsdk.net.net.NxNet... | 30.327869 | 96 | 0.694595 | import nxsdk.net.net
from dft_loihi.visualization.plotting import Plotter
from dft_loihi.dft.field import Field
from dft_loihi.dft.kernel import MultiPeakKernel
from dft_loihi.inputs.simulated_input import GaussPiecewiseStaticInput
from dft_loihi.dft.util import connect
net = nxsdk.net.net.NxNet()
field_domain = [... | true | true |
f7555d7a2ebd6c4bc3bbfd8744c87f57ab1acb7e | 4,661 | py | Python | packages/w3af/w3af/core/data/parsers/doc/pdf.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | tools/w3af/w3af/core/data/parsers/doc/pdf.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | tools/w3af/w3af/core/data/parsers/doc/pdf.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | """
pdf.py
Copyright 2006 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hope that it will... | 32.823944 | 82 | 0.650075 | import StringIO
from pdfminer.converter import HTMLConverter
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFSyntaxError
from w3af.core.data.parsers.doc.baseparser import BaseParser
from w3af.core.data.parsers.doc.sgml import... | true | true |
f7555dd9225f780d3463b4c1042e3a13b7e0e789 | 1,043 | py | Python | research/views/procedure.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | null | null | null | research/views/procedure.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 36 | 2018-05-14T14:41:02.000Z | 2020-05-22T15:14:14.000Z | research/views/procedure.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 3 | 2019-05-07T07:09:05.000Z | 2019-08-30T15:40:47.000Z | from pylabber.views.defaults import DefaultsMixin
from research.filters.procedure_filter import ProcedureFilter
from research.models.procedure import Procedure
from research.serializers.procedure import (
ProcedureSerializer,
ProcedureItemsSerializer,
)
from rest_framework import viewsets
from rest_framework.de... | 32.59375 | 74 | 0.754554 | from pylabber.views.defaults import DefaultsMixin
from research.filters.procedure_filter import ProcedureFilter
from research.models.procedure import Procedure
from research.serializers.procedure import (
ProcedureSerializer,
ProcedureItemsSerializer,
)
from rest_framework import viewsets
from rest_framework.de... | true | true |
f755607f5e4cdb54b500897e13af3a7b5e1ccd2b | 2,931 | py | Python | examples/untag.py | matt-hayden/tagxon | c30bdf5db770cdc0ada32caed6ea895eac2f7a9d | [
"Unlicense"
] | null | null | null | examples/untag.py | matt-hayden/tagxon | c30bdf5db770cdc0ada32caed6ea895eac2f7a9d | [
"Unlicense"
] | null | null | null | examples/untag.py | matt-hayden/tagxon | c30bdf5db770cdc0ada32caed6ea895eac2f7a9d | [
"Unlicense"
] | null | null | null |
import collections
from contextlib import suppress
import json
import os, os.path
import string
import logging
logging.basicConfig(level=logging.DEBUG)
from logging import debug, info, warning, error, critical
panic=critical
from Sorter import parser, cli
from Sorter.Taxon import tag
tag_counts = collections.Coun... | 28.182692 | 85 | 0.668373 |
import collections
from contextlib import suppress
import json
import os, os.path
import string
import logging
logging.basicConfig(level=logging.DEBUG)
from logging import debug, info, warning, error, critical
panic=critical
from Sorter import parser, cli
from Sorter.Taxon import tag
tag_counts = collections.Coun... | true | true |
f7556083dd729aa66948d36ad00e22a1615558be | 3,945 | py | Python | mpexpertadjust.py | matteomattei/MPExpertAdjust | 759fc632c66f775110421ca62f4c107a557b2aa2 | [
"Apache-2.0"
] | null | null | null | mpexpertadjust.py | matteomattei/MPExpertAdjust | 759fc632c66f775110421ca62f4c107a557b2aa2 | [
"Apache-2.0"
] | null | null | null | mpexpertadjust.py | matteomattei/MPExpertAdjust | 759fc632c66f775110421ca62f4c107a557b2aa2 | [
"Apache-2.0"
] | 2 | 2017-10-17T09:34:19.000Z | 2019-10-14T18:58:17.000Z | #!/usr/bin/env python
import os, sys, csv, time
path = os.path.dirname(os.path.abspath(sys.argv[0]))
STANDARD_FILE=os.path.join(path,'defstd.csv')
STANDARD_NAME=0
STANDARD_ELEMENT=1
STANDARD_QTY=2
SAMPLE_NAME=0
SAMPLE_DATE=2
SAMPLE_ELEMENT=4
SAMPLE_QTY=9
def is_standard(label, element, standards):
"""Check if a la... | 32.336066 | 117 | 0.682383 |
import os, sys, csv, time
path = os.path.dirname(os.path.abspath(sys.argv[0]))
STANDARD_FILE=os.path.join(path,'defstd.csv')
STANDARD_NAME=0
STANDARD_ELEMENT=1
STANDARD_QTY=2
SAMPLE_NAME=0
SAMPLE_DATE=2
SAMPLE_ELEMENT=4
SAMPLE_QTY=9
def is_standard(label, element, standards):
for s in standards:
if label.strip(... | true | true |
f7556091f678a51fcb75bbfab954951e4b5c8cd4 | 6,232 | py | Python | dataset_v2.py | lzmisscc/pytorch-image-models | a32aa96d109292bfef00a631c501bd6c2bd44fdf | [
"Apache-2.0"
] | null | null | null | dataset_v2.py | lzmisscc/pytorch-image-models | a32aa96d109292bfef00a631c501bd6c2bd44fdf | [
"Apache-2.0"
] | null | null | null | dataset_v2.py | lzmisscc/pytorch-image-models | a32aa96d109292bfef00a631c501bd6c2bd44fdf | [
"Apache-2.0"
] | null | null | null | import json
import jsonlines
import tqdm
import random
import re
from random import shuffle
import PIL
from PIL import Image
import numpy as np
import os.path as osp
from torch.utils.data import Dataset
import lmdb
import cv2
import math
random.seed(100)
FLAG_TRAIN = True
train = 'data_v3/label_ensemble_clean_600w_100... | 29.535545 | 108 | 0.538832 | import json
import jsonlines
import tqdm
import random
import re
from random import shuffle
import PIL
from PIL import Image
import numpy as np
import os.path as osp
from torch.utils.data import Dataset
import lmdb
import cv2
import math
random.seed(100)
FLAG_TRAIN = True
train = 'data_v3/label_ensemble_clean_600w_100... | true | true |
f75561285af7852d805008d47c385022cb77ad3f | 1,531 | py | Python | setup.py | sffjunkie/ama | e05e98fb771ae783901516f882990fcc54ca0026 | [
"Apache-2.0"
] | 1 | 2019-03-21T09:50:20.000Z | 2019-03-21T09:50:20.000Z | setup.py | sffjunkie/ama | e05e98fb771ae783901516f882990fcc54ca0026 | [
"Apache-2.0"
] | null | null | null | setup.py | sffjunkie/ama | e05e98fb771ae783901516f882990fcc54ca0026 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009-2014, Simon Kennedy, sffjunkie+code@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.244898 | 98 | 0.67211 |
import io
import sys
import os.path
from setuptools import setup
import monkeypatch
def read(*names, **kwargs):
return io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8")
).read()
setup(name='ama',
version='0.2',
description=... | true | true |
f7556184ca5adbc935c9782a84f9c4ddeab2d577 | 23 | py | Python | src/server/physics/__init__.py | umbc-hackafe/bridgesim | 6075dbc3afa8b017f86c628757c3d6c329949546 | [
"MIT"
] | 6 | 2015-01-09T05:03:07.000Z | 2016-06-29T16:38:16.000Z | src/server/physics/__init__.py | umbc-hackafe/bridgesim | 6075dbc3afa8b017f86c628757c3d6c329949546 | [
"MIT"
] | 41 | 2015-01-05T03:40:58.000Z | 2015-01-21T18:17:37.000Z | src/server/physics/__init__.py | cnlohr/bridgesim | ff33b63db813eedfc8155c9fecda4c8f1c06ab60 | [
"MIT"
] | null | null | null | from .vectors import *
| 11.5 | 22 | 0.73913 | from .vectors import *
| true | true |
f75561a740ca41a1fc5f1f92084b941d610610c1 | 2,143 | py | Python | pennylane/drawer/utils.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | 539 | 2018-11-13T08:45:42.000Z | 2020-07-27T18:17:16.000Z | pennylane/drawer/utils.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | 588 | 2018-11-14T10:21:47.000Z | 2020-07-28T06:27:14.000Z | pennylane/drawer/utils.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | 165 | 2018-11-13T18:58:56.000Z | 2020-07-27T17:18:17.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 35.716667 | 90 | 0.719085 |
def default_wire_map(tape):
used_wires = {wire: None for op in tape for wire in op.wires}
return {wire: ind for ind, wire in enumerate(used_wires)}
def convert_wire_order(tape, wire_order=None, show_all_wires=False):
default = default_wire_map(tape)
if wire_order is None:
... | true | true |
f75562012e3722c184f18f5a909f262561b8ef4d | 2,934 | py | Python | src/face/face_detection.py | opticrd/facial-auth-api | a4656593d72ecc1ac006ceacd3285ca75dff3bd7 | [
"MIT"
] | 1 | 2022-03-22T12:43:46.000Z | 2022-03-22T12:43:46.000Z | src/face/face_detection.py | opticrd/facial-auth-api | a4656593d72ecc1ac006ceacd3285ca75dff3bd7 | [
"MIT"
] | 15 | 2021-11-09T01:52:32.000Z | 2022-03-09T19:13:52.000Z | src/face/face_detection.py | opticrd/facial-auth-api | a4656593d72ecc1ac006ceacd3285ca75dff3bd7 | [
"MIT"
] | 1 | 2022-03-29T07:03:41.000Z | 2022-03-29T07:03:41.000Z | from typing import Tuple
from typing import List
from typing import Optional
import math
import mediapipe as mp
import numpy as np
import cv2 as cv
mp_face_detection = mp.solutions.face_detection
mp_drawing = mp.solutions.drawing_utils
def _normalized_to_pixel_coordinates(
normalized_x: float, normalized_y: ... | 44.454545 | 141 | 0.640082 | from typing import Tuple
from typing import List
from typing import Optional
import math
import mediapipe as mp
import numpy as np
import cv2 as cv
mp_face_detection = mp.solutions.face_detection
mp_drawing = mp.solutions.drawing_utils
def _normalized_to_pixel_coordinates(
normalized_x: float, normalized_y: ... | true | true |
f755629790bb8cde966f4ceb680ec5a084e18788 | 9,889 | py | Python | custom_components/hacs/hacsbase/data.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | 1 | 2021-12-12T18:19:48.000Z | 2021-12-12T18:19:48.000Z | custom_components/hacs/hacsbase/data.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | null | null | null | custom_components/hacs/hacsbase/data.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | null | null | null | """Data handler for HACS."""
import asyncio
import os
from homeassistant.core import callback
from custom_components.hacs.helpers.classes.manifest import HacsManifest
from custom_components.hacs.helpers.functions.register_repository import (
register_repository,
)
from custom_components.hacs.helpers.functions.sto... | 42.995652 | 93 | 0.639498 | import asyncio
import os
from homeassistant.core import callback
from custom_components.hacs.helpers.classes.manifest import HacsManifest
from custom_components.hacs.helpers.functions.register_repository import (
register_repository,
)
from custom_components.hacs.helpers.functions.store import (
async_load_fr... | true | true |
f75562db0e3bfe345d78fa2ec33b58f65315ee2b | 4,145 | py | Python | training.py | inmaugarc/FutureSales | 87ef9a3c483efcb81741e9f56d4b5634281942a0 | [
"MIT"
] | null | null | null | training.py | inmaugarc/FutureSales | 87ef9a3c483efcb81741e9f56d4b5634281942a0 | [
"MIT"
] | null | null | null | training.py | inmaugarc/FutureSales | 87ef9a3c483efcb81741e9f56d4b5634281942a0 | [
"MIT"
] | null | null | null | """
This file is to train data with a machine learning model
"""
# Let's import libraries
import pickle
import pandas as pd
from xgboost import XGBRegressor
from sklearn import linear_model
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.model_selection import train_test_split
from s... | 34.831933 | 87 | 0.624367 |
import pickle
import pandas as pd
from xgboost import XGBRegressor
from sklearn import linear_model
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from preprocess import Preprocessor, build_dataset, s... | true | true |
f755632786c005897d81027d35adc490bdd335d1 | 3,835 | py | Python | scripts/train/submit-train.py | MartinMusiol1987/test | b1bb8eaddd5a156ab3f027ef585bb5365feaad1c | [
"MIT"
] | null | null | null | scripts/train/submit-train.py | MartinMusiol1987/test | b1bb8eaddd5a156ab3f027ef585bb5365feaad1c | [
"MIT"
] | null | null | null | scripts/train/submit-train.py | MartinMusiol1987/test | b1bb8eaddd5a156ab3f027ef585bb5365feaad1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Train a model remotely using Azure ML compute.
This will re-use the current python environment.
Argv:
output-dir: A folder to store any output to
kernel: Kernel type to be used in the algorithm
penalty: Penalty parameter of the error term
"""
import argparse
import sys
import az... | 34.863636 | 79 | 0.653716 |
import argparse
import sys
import azureml.core
from azureml.core import Experiment, Workspace
from azureml.train.sklearn import SKLearn
def submit(experiment_name: str,
compute_name: str,
kernal: str,
penalty: float):
print("This notebook was created using version 1.0.83 of th... | true | true |
f75563c9ed06394e366191f869155d4e999807bf | 5,245 | py | Python | simf/models/base.py | MartinJakomin/SIMF | e04110ddcaed887abc58084686d00f84fdc6a8c8 | [
"MIT"
] | 1 | 2021-01-22T05:15:30.000Z | 2021-01-22T05:15:30.000Z | simf/models/base.py | MartinJakomin/SIMF | e04110ddcaed887abc58084686d00f84fdc6a8c8 | [
"MIT"
] | null | null | null | simf/models/base.py | MartinJakomin/SIMF | e04110ddcaed887abc58084686d00f84fdc6a8c8 | [
"MIT"
] | null | null | null | import logging
import sys
import numpy as np
import scipy.sparse as sps
from simf.initialization import a_col, random_normal, bias_from_data, bias_zero
class BaseFactorization(object):
def __init__(self, max_iter=20, epsilon=0, regularization=0.02, learning_rate=0.01, init_method='random', bias=True... | 36.93662 | 121 | 0.567969 | import logging
import sys
import numpy as np
import scipy.sparse as sps
from simf.initialization import a_col, random_normal, bias_from_data, bias_zero
class BaseFactorization(object):
def __init__(self, max_iter=20, epsilon=0, regularization=0.02, learning_rate=0.01, init_method='random', bias=True... | true | true |
f75563f5ca4ba3ca1ad38b71398d2fbece183cbe | 15,711 | py | Python | edgelm/fairseq/models/text_to_speech/tts_transformer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | 1 | 2021-11-07T00:30:05.000Z | 2021-11-07T00:30:05.000Z | edgelm/fairseq/models/text_to_speech/tts_transformer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | edgelm/fairseq/models/text_to_speech/tts_transformer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | # 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 logging
from typing import List, Optional
import torch
from torch import nn
from fairseq.models import (FairseqEncoder, Fa... | 42.233871 | 105 | 0.625231 |
import logging
from typing import List, Optional
import torch
from torch import nn
from fairseq.models import (FairseqEncoder, FairseqEncoderDecoderModel,
FairseqIncrementalDecoder, register_model,
register_model_architecture)
from fairseq.modules... | true | true |
f75564162af059f60804ce8c2ecc8897f1d60329 | 1,081 | py | Python | packs/mailgun/actions/send_email.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 164 | 2015-01-17T16:08:33.000Z | 2021-08-03T02:34:07.000Z | packs/mailgun/actions/send_email.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 442 | 2015-01-01T11:19:01.000Z | 2017-09-06T23:26:17.000Z | packs/mailgun/actions/send_email.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 202 | 2015-01-13T00:37:40.000Z | 2020-11-07T11:30:10.000Z | import httplib
import requests
from st2actions.runners.pythonrunner import Action
__all__ = [
'SendEmailAction'
]
SEND_EMAIL_API_URL = 'https://api.mailgun.net/v2/%(domain)s/messages'
class SendEmailAction(Action):
def run(self, sender, recipient, subject, text=None, html=None):
if not text and no... | 25.139535 | 93 | 0.584644 | import httplib
import requests
from st2actions.runners.pythonrunner import Action
__all__ = [
'SendEmailAction'
]
SEND_EMAIL_API_URL = 'https://api.mailgun.net/v2/%(domain)s/messages'
class SendEmailAction(Action):
def run(self, sender, recipient, subject, text=None, html=None):
if not text and no... | true | true |
f755641ac68d78e2219c91953cbd7829211f9fbb | 23,632 | py | Python | qasync/__init__.py | ickby/qasync | 3a9330e48d1864f4c2b05af1286b5f617da6e72c | [
"BSD-2-Clause"
] | null | null | null | qasync/__init__.py | ickby/qasync | 3a9330e48d1864f4c2b05af1286b5f617da6e72c | [
"BSD-2-Clause"
] | null | null | null | qasync/__init__.py | ickby/qasync | 3a9330e48d1864f4c2b05af1286b5f617da6e72c | [
"BSD-2-Clause"
] | null | null | null | """
Implementation of the PEP 3156 Event-Loop with Qt.
Copyright (c) 2018 Gerard Marull-Paretas <gerard@teslabs.com>
Copyright (c) 2014 Mark Harviston <mark.harviston@gmail.com>
Copyright (c) 2014 Arve Knudsen <arve.knudsen@gmail.com>
BSD License
"""
__author__ = (
"Sam McCormack",
"Gerard Marull-Paretas <ge... | 32.372603 | 125 | 0.600584 |
__author__ = (
"Sam McCormack",
"Gerard Marull-Paretas <gerard@teslabs.com>, "
"Mark Harviston <mark.harviston@gmail.com>, "
"Arve Knudsen <arve.knudsen@gmail.com>",
)
__version__ = "0.13.0"
__url__ = "https://github.com/CabbageDevelopment/qasync"
__license__ = "BSD"
__all__ = ["QEventLoop", "QThreadEx... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.