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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3ad7c48b81c35fb3323f8e6ce0b41a1a4c8f05 | 973 | py | Python | shikshastudio/worklist/migrations/0001_initial.py | I-ArchanaDash/shikshastudio | 71c5631fa19c90d419a6f31335f07195dbccb124 | [
"Apache-2.0"
] | null | null | null | shikshastudio/worklist/migrations/0001_initial.py | I-ArchanaDash/shikshastudio | 71c5631fa19c90d419a6f31335f07195dbccb124 | [
"Apache-2.0"
] | null | null | null | shikshastudio/worklist/migrations/0001_initial.py | I-ArchanaDash/shikshastudio | 71c5631fa19c90d419a6f31335f07195dbccb124 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.9 on 2022-02-02 12:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 33.551724 | 141 | 0.63001 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c3ad9b85e444c0be6a54d60a231c91985be3569 | 6,496 | py | Python | LearningSafeSets/Validation/Validation.py | alexliniger/AdversarialRoadModel | 14157760687c22acc8b91c39128875005ada7563 | [
"Apache-2.0"
] | 20 | 2020-07-17T06:32:32.000Z | 2022-03-27T03:24:26.000Z | LearningSafeSets/Validation/Validation.py | alexliniger/AdversarialRoadModel | 14157760687c22acc8b91c39128875005ada7563 | [
"Apache-2.0"
] | null | null | null | LearningSafeSets/Validation/Validation.py | alexliniger/AdversarialRoadModel | 14157760687c22acc8b91c39128875005ada7563 | [
"Apache-2.0"
] | 7 | 2020-07-19T07:16:01.000Z | 2022-01-22T22:58:02.000Z | ## Copyright 2020 Alexander Liniger
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
## Unless required by applicable law or agreed to in ... | 35.113514 | 119 | 0.552032 | true | true | |
1c3ada5c5ef2fa17cd168410a01d8ba068d9d078 | 12,479 | py | Python | var/spack/repos/builtin/packages/ascent/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-08-20T06:55:11.000Z | 2018-08-20T06:55:11.000Z | var/spack/repos/builtin/packages/ascent/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/ascent/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-12T19:27:17.000Z | 2020-03-12T19:27:17.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import socket
import os
import llnl.util.tty as tty
from os import environ as env
def cmake_cache_... | 37.362275 | 79 | 0.494671 |
from spack import *
import socket
import os
import llnl.util.tty as tty
from os import environ as env
def cmake_cache_entry(name, value):
return 'set({0} "{1}" CACHE PATH "")\n\n'.format(name, value)
class Ascent(Package):
homepage = "https://github.com/Alpine-DAV/ascent"
git = "https://git... | true | true |
1c3ada6ac0274750c25dfe121fdcff9e5ebfe0aa | 8,426 | py | Python | linear_dynamical_systems/arma.py | kiss2u/google-research | 2cd66234656f9e2f4218ed90a2d8aa9cf3139093 | [
"Apache-2.0"
] | 7 | 2020-03-15T12:14:07.000Z | 2021-12-01T07:01:09.000Z | linear_dynamical_systems/arma.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | linear_dynamical_systems/arma.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2020-06-15T03:06:53.000Z | 2021-08-06T16:38:33.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.283186 | 80 | 0.693805 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import numpy as np
from statsmodels.regression.linear_model import OLS
from statsmodels.tools import sm_exceptions
from statsmodels.tools.tools import add_constant
from statsmod... | true | true |
1c3ada899ff98335f4fbfabd64f32248e2f9b294 | 13,121 | py | Python | lib/libsnmp/snmpmanager.py | tamihiro/libsnmp | 537bb916dcc27e9e94eeae29b210b3a327586dc1 | [
"MIT"
] | null | null | null | lib/libsnmp/snmpmanager.py | tamihiro/libsnmp | 537bb916dcc27e9e94eeae29b210b3a327586dc1 | [
"MIT"
] | null | null | null | lib/libsnmp/snmpmanager.py | tamihiro/libsnmp | 537bb916dcc27e9e94eeae29b210b3a327586dc1 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# $Id$
# $Revision$
#
# libsnmp - a Python SNMP library
# Copyright (c) 2003 Justin Warren <daedalus@eigenmagic.com>
#
## An snmpmanager understands SNMPv1 and SNMPv2c messages
## and so it can encode and decode both.
from future import standard_library
from builtins impo... | 34.258486 | 124 | 0.604908 | from __future__ import unicode_literals
ses()
import socket
import select
import logging
import queue
import time
import os
import asyncore
import sys
from libsnmp import debug
from libsnmp import asynrole
from libsnmp import rfc1157
from libsnmp import rfc1905
from libsnmp import v1
from libsnmp import v2
l... | true | true |
1c3adc6658ccf330715b06712be972a88383fdc5 | 2,820 | py | Python | src/super_gradients/examples/cifar10_training_torch_objects/cifar10_training_torch_objects_example.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 308 | 2021-12-30T10:14:30.000Z | 2022-03-30T19:05:31.000Z | src/super_gradients/examples/cifar10_training_torch_objects/cifar10_training_torch_objects_example.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 24 | 2022-01-10T08:05:37.000Z | 2022-03-30T18:49:06.000Z | src/super_gradients/examples/cifar10_training_torch_objects/cifar10_training_torch_objects_example.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 26 | 2021-12-31T06:04:07.000Z | 2022-03-21T09:51:44.000Z |
"""
Cifar10 training with SuperGradients training with the following initialized torch objects:
DataLoaders
Optimizers
Networks (nn.Module)
Schedulers
Loss functions
Main purpose is to demonstrate training in SG with minimal abstraction and maximal flexibility
"""
from super_gradients import SgM... | 40.869565 | 125 | 0.750709 |
from super_gradients import SgModel
from super_gradients.training.metrics.classification_metrics import Accuracy, Top5
from super_gradients.training import MultiGPUMode
from torch.optim import ASGD
from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau
from torch.nn import CrossEntropyLoss
from super_gra... | true | true |
1c3ae01f7d275d8c9a138cfb38421b60adf5332c | 1,701 | py | Python | app/core/migrations/0001_initial.py | elieish/recipe-api-django | 19e3dff1111b2e570925c7b263363994258eaf22 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | elieish/recipe-api-django | 19e3dff1111b2e570925c7b263363994258eaf22 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | elieish/recipe-api-django | 19e3dff1111b2e570925c7b263363994258eaf22 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-08 11:32
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... | 50.029412 | 266 | 0.637272 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField... | true | true |
1c3ae19661cdaf6cd25142e916f8ec09fd4b7223 | 4,289 | py | Python | experiments/compare_fuzzers/plot.py | TCatshoek/lstar | 042b0ae3a0627db7a412c828f3752a9c30928ec1 | [
"MIT"
] | 2 | 2019-10-15T11:28:12.000Z | 2021-01-28T15:14:09.000Z | experiments/compare_fuzzers/plot.py | TCatshoek/lstar | 042b0ae3a0627db7a412c828f3752a9c30928ec1 | [
"MIT"
] | null | null | null | experiments/compare_fuzzers/plot.py | TCatshoek/lstar | 042b0ae3a0627db7a412c828f3752a9c30928ec1 | [
"MIT"
] | null | null | null | from afl.utils import AFLUtils
from libfuzzer.utils import CorpusUtils
from suls.rerssoconnector import RERSSOConnector
from pathlib import Path
import re
import matplotlib.pyplot as plt
def check_reached_afl(problem, problemset, rers_basepath, afl_basepath):
rers_path = f"{rers_basepath}/{problemset}/{problem}/{p... | 34.869919 | 101 | 0.717183 | from afl.utils import AFLUtils
from libfuzzer.utils import CorpusUtils
from suls.rerssoconnector import RERSSOConnector
from pathlib import Path
import re
import matplotlib.pyplot as plt
def check_reached_afl(problem, problemset, rers_basepath, afl_basepath):
rers_path = f"{rers_basepath}/{problemset}/{problem}/{p... | true | true |
1c3ae21e16af0fc8d249ed3c8d2c07ae69ce6afd | 12,402 | py | Python | openstackclient/tests/identity/v3/test_service.py | citrix-openstack-build/python-openstackclient | ad59b03be6af9da31230689af268139b12b548e7 | [
"Apache-2.0"
] | null | null | null | openstackclient/tests/identity/v3/test_service.py | citrix-openstack-build/python-openstackclient | ad59b03be6af9da31230689af268139b12b548e7 | [
"Apache-2.0"
] | null | null | null | openstackclient/tests/identity/v3/test_service.py | citrix-openstack-build/python-openstackclient | ad59b03be6af9da31230689af268139b12b548e7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Nebula Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 30.322738 | 77 | 0.584261 |
import copy
from openstackclient.identity.v3 import service
from openstackclient.tests import fakes
from openstackclient.tests.identity.v3 import fakes as identity_fakes
from openstackclient.tests.identity.v3 import test_identity
class TestService(test_identity.TestIdentityv3):
def setUp(self):
... | true | true |
1c3ae2fdc195c31175e0e67fa1831a524cc4bcbf | 1,634 | py | Python | test/test_driver.py | bunyk/pss | d903f187b69ea2282b79b730454a041dd0c5f007 | [
"Unlicense"
] | null | null | null | test/test_driver.py | bunyk/pss | d903f187b69ea2282b79b730454a041dd0c5f007 | [
"Unlicense"
] | null | null | null | test/test_driver.py | bunyk/pss | d903f187b69ea2282b79b730454a041dd0c5f007 | [
"Unlicense"
] | null | null | null | import os, sys
import unittest
sys.path.insert(0, '.')
sys.path.insert(0, '..')
from psslib.driver import pss_run
from test.utils import path_to_testdir, MockOutputFormatter
class TestDriver(unittest.TestCase):
# Just basic sanity tests for pss_run
# Do all the heavy testing in test_pssmain.py, because it al... | 32.68 | 79 | 0.591799 | import os, sys
import unittest
sys.path.insert(0, '.')
sys.path.insert(0, '..')
from psslib.driver import pss_run
from test.utils import path_to_testdir, MockOutputFormatter
class TestDriver(unittest.TestCase):
testdir1 = path_to_testdir('testdir1')
def setUp(self):
self.of = Moc... | true | true |
1c3ae327a71e2763888b0d8ab69b22d08995a16e | 16,508 | py | Python | src/vulkan/util/gen_enum_to_str.py | SoftReaper/Mesa-Renoir-deb | 8d1de1f66058d62b41fe55d36522efea2bdf996d | [
"MIT"
] | null | null | null | src/vulkan/util/gen_enum_to_str.py | SoftReaper/Mesa-Renoir-deb | 8d1de1f66058d62b41fe55d36522efea2bdf996d | [
"MIT"
] | null | null | null | src/vulkan/util/gen_enum_to_str.py | SoftReaper/Mesa-Renoir-deb | 8d1de1f66058d62b41fe55d36522efea2bdf996d | [
"MIT"
] | null | null | null | # Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dist... | 33.967078 | 104 | 0.62182 |
import argparse
import functools
import os
import re
import textwrap
import xml.etree.ElementTree as et
from mako.template import Template
COPYRIGHT = textwrap.dedent(u"""\
* Copyright © 2017 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a... | true | true |
1c3ae3292a9ef709a84f051cbd22878be2751be2 | 318 | py | Python | codewars/find_next_square.py | tarcisioallyson/python_exercise | be5257c5cce7c0c2b573ece2308e3b5b03c22fac | [
"Unlicense"
] | null | null | null | codewars/find_next_square.py | tarcisioallyson/python_exercise | be5257c5cce7c0c2b573ece2308e3b5b03c22fac | [
"Unlicense"
] | null | null | null | codewars/find_next_square.py | tarcisioallyson/python_exercise | be5257c5cce7c0c2b573ece2308e3b5b03c22fac | [
"Unlicense"
] | null | null | null | def find_next_square(sq):
import math
# Return the next square if sq is a square, -1 otherwise
root = int(math.sqrt(sq))
if root**2 == sq:
sq += 1
while int(math.sqrt(sq))**2 != sq:
sq+=1
return sq
else:
return -1
print(find_next_square(81)) | 24.461538 | 61 | 0.528302 | def find_next_square(sq):
import math
root = int(math.sqrt(sq))
if root**2 == sq:
sq += 1
while int(math.sqrt(sq))**2 != sq:
sq+=1
return sq
else:
return -1
print(find_next_square(81)) | true | true |
1c3ae33aa7f08c8da33f8b3ce0bb608fedfe42c9 | 208 | py | Python | self_driving/data_collection/util.py | cclauss/self_driving_pi_car | 7dbb67b837b58ddc492ac5ea0822d69dfe6e2d34 | [
"MIT"
] | 724 | 2018-11-19T16:29:38.000Z | 2022-01-27T19:52:13.000Z | self_driving/data_collection/util.py | cclauss/self_driving_pi_car | 7dbb67b837b58ddc492ac5ea0822d69dfe6e2d34 | [
"MIT"
] | 5 | 2018-02-17T19:24:38.000Z | 2018-02-17T19:31:42.000Z | self_driving/data_collection/util.py | cclauss/self_driving_pi_car | 7dbb67b837b58ddc492ac5ea0822d69dfe6e2d34 | [
"MIT"
] | 69 | 2018-03-02T13:08:43.000Z | 2022-01-13T07:44:27.000Z | import time
def get_date():
"""
Gives you the date in form:
year-month-day-hours-minutes-second
:return: current date
:rtype: str
"""
return time.strftime('%Y-%m-%d-%H-%-M-%S')
| 16 | 46 | 0.581731 | import time
def get_date():
return time.strftime('%Y-%m-%d-%H-%-M-%S')
| true | true |
1c3ae481e79889fb0480f81200581ce4ee128173 | 3,017 | py | Python | Supersegment/temp.py | XDZhelheim/TrafficDataAnalysis | a73dde10f91fb88af3a7b2edd7a04adaa5ea57f5 | [
"MIT"
] | null | null | null | Supersegment/temp.py | XDZhelheim/TrafficDataAnalysis | a73dde10f91fb88af3a7b2edd7a04adaa5ea57f5 | [
"MIT"
] | null | null | null | Supersegment/temp.py | XDZhelheim/TrafficDataAnalysis | a73dde10f91fb88af3a7b2edd7a04adaa5ea57f5 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import geopandas as gp
from shapely.geometry import Polygon, MultiLineString, Point
import shapely.wkt as wkt
import supersegment
# def randrange(n, vmin, vmax):
# '''
# Helper function to make an array of random numbers having shape (n, )
... | 28.196262 | 141 | 0.616175 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import geopandas as gp
from shapely.geometry import Polygon, MultiLineString, Point
import shapely.wkt as wkt
import supersegment
# Helper function to make an array of random numbers having shape (n, )
# with each number distributed Unifo... | true | true |
1c3ae5f91f3ac2db9f56eb3b957a29a5ef0be04c | 6,978 | py | Python | layers/output_utils.py | Priyashbhugra/yolact | ef871057f2768dcb13e6d9636d49402c9862fcd4 | [
"MIT"
] | null | null | null | layers/output_utils.py | Priyashbhugra/yolact | ef871057f2768dcb13e6d9636d49402c9862fcd4 | [
"MIT"
] | null | null | null | layers/output_utils.py | Priyashbhugra/yolact | ef871057f2768dcb13e6d9636d49402c9862fcd4 | [
"MIT"
] | null | null | null | """ Contains functions used to sanitize and prepare the output of Yolact. """
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import cv2
from data import cfg, mask_type, MEANS, STD, activation_func
from utils.augmentations import Resize
from utils import timer
from .box_utils im... | 36.34375 | 171 | 0.586271 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import cv2
from data import cfg, mask_type, MEANS, STD, activation_func
from utils.augmentations import Resize
from utils import timer
from .box_utils import crop, sanitize_coordinates
def postprocess(det_output, w, h, batch_idx=0... | true | true |
1c3ae671fe4a260122c3b70b182bc81814715e39 | 952 | py | Python | test/test_face_snap_with_registered_face_snaps.py | vtpl1/vtpl_api | d289c92254deb040de925205c583de69802a1c6b | [
"MIT"
] | null | null | null | test/test_face_snap_with_registered_face_snaps.py | vtpl1/vtpl_api | d289c92254deb040de925205c583de69802a1c6b | [
"MIT"
] | null | null | null | test/test_face_snap_with_registered_face_snaps.py | vtpl1/vtpl_api | d289c92254deb040de925205c583de69802a1c6b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Engine api
Engine APIs # noqa: E501
The version of the OpenAPI document: 1.0.4
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import vtpl_api
from vtpl_api.models.face_snap_with_registered_face_snaps import FaceSnapWith... | 23.8 | 118 | 0.737395 |
from __future__ import absolute_import
import unittest
import vtpl_api
from vtpl_api.models.face_snap_with_registered_face_snaps import FaceSnapWithRegisteredFaceSnaps
from vtpl_api.rest import ApiException
class TestFaceSnapWithRegisteredFaceSnaps(unittest.TestCase):
def setUp(self):
pass
d... | true | true |
1c3ae6bccaf5257f5a744f1daf9e4187c5f864e2 | 2,120 | py | Python | examples/clustering/profile.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | examples/clustering/profile.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | examples/clustering/profile.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 25.542169 | 81 | 0.686792 |
from examples.connect import FLAVOR_NAME
from examples.connect import IMAGE_NAME
from examples.connect import NETWORK_NAME
from examples.connect import SERVER_NAME
def list_profiles(conn):
print("List Profiles:")
for profile in conn.clustering.profiles():
print(profile.to_dict())
fo... | true | true |
1c3ae7fee60b1eade0c55933724255ed28cf901e | 695 | py | Python | PythonExercicios/ex003.py | gabjohann/python_3 | 380cb622669ed82d6b22fdd09d41f02f1ad50a73 | [
"MIT"
] | null | null | null | PythonExercicios/ex003.py | gabjohann/python_3 | 380cb622669ed82d6b22fdd09d41f02f1ad50a73 | [
"MIT"
] | null | null | null | PythonExercicios/ex003.py | gabjohann/python_3 | 380cb622669ed82d6b22fdd09d41f02f1ad50a73 | [
"MIT"
] | null | null | null | # Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo
# e todas as informações possíveis sobre ele.
n = input('Digite algo: ')
print('O tipo primitivo é: ', type(n))
print('É alfanumérico? ', n.isalnum())
print('É alfabético? ', n.isalpha())
print('É decimal? ', n.isdecimal())
print('É um... | 38.611111 | 83 | 0.683453 |
n = input('Digite algo: ')
print('O tipo primitivo é: ', type(n))
print('É alfanumérico? ', n.isalnum())
print('É alfabético? ', n.isalpha())
print('É decimal? ', n.isdecimal())
print('É um dígito? ', n.isdigit())
print('É um identificador? ', n.isidentifier())
print('É possível ser impresso? ', n.isprintable())
pri... | true | true |
1c3ae8082e261353f40972c2e8e73000e45ed5c9 | 2,358 | py | Python | bacteria_archaea/marine/marine_prok_biomass_estimate.py | yinonbaron/biomass_distribution | 783a8d2f59754bde9b0ea802512b131abbe7d8a0 | [
"MIT"
] | 1 | 2021-05-17T13:55:48.000Z | 2021-05-17T13:55:48.000Z | bacteria_archaea/marine/marine_prok_biomass_estimate.py | yinonbaron/biomass_distribution | 783a8d2f59754bde9b0ea802512b131abbe7d8a0 | [
"MIT"
] | null | null | null | bacteria_archaea/marine/marine_prok_biomass_estimate.py | yinonbaron/biomass_distribution | 783a8d2f59754bde9b0ea802512b131abbe7d8a0 | [
"MIT"
] | 2 | 2018-01-10T08:53:35.000Z | 2021-05-17T13:55:50.000Z |
# coding: utf-8
# # Estimating the total biomass of marine archaea and bacteria
#
# We use our best estimates for the total number of marine prokaryotes, the carbon content of marine prokaryotes and the fraction of marine archaea and bacteria out of the total population of marine prokaryotes to estimate the total bi... | 50.170213 | 271 | 0.772265 |
ay.float_format = '{:,.1e}'.format
import sys
sys.path.insert(0, '../../statistics_helper')
from CI_helper import *
results = pd.read_excel('marine_prok_biomass_estimate.xlsx')
results.head()
total_arch_biomass = results['Value'][0]*results['Value'][1]*(1+results['Value'][4])*1e-15*results['Value'][2]
t... | true | true |
1c3ae8b8efd54b0337cb7ca549f48d80cbe99ef7 | 14,957 | py | Python | libs/groupdocs_conversion_cloud/models/image_convert_options.py | rocketbot-cl/pdf2word | e46f6f574f69aa744e300baf4802e426b71bf9b2 | [
"MIT"
] | null | null | null | libs/groupdocs_conversion_cloud/models/image_convert_options.py | rocketbot-cl/pdf2word | e46f6f574f69aa744e300baf4802e426b71bf9b2 | [
"MIT"
] | null | null | null | libs/groupdocs_conversion_cloud/models/image_convert_options.py | rocketbot-cl/pdf2word | e46f6f574f69aa744e300baf4802e426b71bf9b2 | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="ImageConvertOptions.py">
# Copyright (c) 2003-2019 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a co... | 30.902893 | 259 | 0.586949 |
import pprint
import re
import six
from groupdocs_conversion_cloud.models import ConvertOptions
class ImageConvertOptions(ConvertOptions):
swagger_types = {
'width': 'int',
'height': 'int',
'horizontal_resolution': 'int',
'vertical_resolution': 'int',... | true | true |
1c3ae9c8efd453aecda98026cf65208b789b948b | 15,510 | py | Python | lib/click/parser.py | sangwo/dubhacks2019 | 0074ef9cdfaf25b84ce40bbb97872b07167ad83f | [
"MIT"
] | 6,140 | 2016-05-23T16:09:35.000Z | 2022-03-30T19:00:46.000Z | lib/click/parser.py | sangwo/dubhacks2019 | 0074ef9cdfaf25b84ce40bbb97872b07167ad83f | [
"MIT"
] | 1,384 | 2016-07-08T22:26:41.000Z | 2022-03-24T16:39:43.000Z | lib/click/parser.py | sangwo/dubhacks2019 | 0074ef9cdfaf25b84ce40bbb97872b07167ad83f | [
"MIT"
] | 5,110 | 2016-05-27T13:45:18.000Z | 2022-03-31T18:40:42.000Z | # -*- coding: utf-8 -*-
"""
click.parser
~~~~~~~~~~~~
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting and a lot more).
The pla... | 36.238318 | 79 | 0.573823 |
import re
from collections import deque
from .exceptions import UsageError, NoSuchOption, BadOptionUsage, \
BadArgumentUsage
def _unpack_args(args, nargs_spec):
args = deque(args)
nargs_spec = deque(nargs_spec)
rv = []
spos = None
def _fetch(c):
try:
if spos is None:
... | true | true |
1c3aea34398d990c72f1835b9334fa867f54d7a3 | 778 | py | Python | resources/models/permissions.py | suutari-ai/respa | a944b1c13f855eaf5f883687b5fd025ece7c8176 | [
"MIT"
] | null | null | null | resources/models/permissions.py | suutari-ai/respa | a944b1c13f855eaf5f883687b5fd025ece7c8176 | [
"MIT"
] | 1 | 2020-06-12T08:58:58.000Z | 2020-06-12T08:58:58.000Z | resources/models/permissions.py | suutari-ai/respa | a944b1c13f855eaf5f883687b5fd025ece7c8176 | [
"MIT"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
RESOURCE_PERMISSIONS = (
('can_approve_reservation', _('Can approve reservation')),
('can_make_reservations', _('Can make reservations')),
('can_modify_reservations', _('Can modify reservations')),
('can_ignore_opening_hours', _('Can make reservat... | 55.571429 | 92 | 0.755784 | from django.utils.translation import ugettext_lazy as _
RESOURCE_PERMISSIONS = (
('can_approve_reservation', _('Can approve reservation')),
('can_make_reservations', _('Can make reservations')),
('can_modify_reservations', _('Can modify reservations')),
('can_ignore_opening_hours', _('Can make reservat... | true | true |
1c3aeb68614708930a0e9fc9b8eb3b15910cd971 | 22,517 | py | Python | reference-architecture/vmware-ansible/add-node.py | vshn/openshift-ansible-contrib | ac7708a97691e36bf9066d98ff0a2217280aa903 | [
"Apache-2.0"
] | null | null | null | reference-architecture/vmware-ansible/add-node.py | vshn/openshift-ansible-contrib | ac7708a97691e36bf9066d98ff0a2217280aa903 | [
"Apache-2.0"
] | 2 | 2018-01-31T15:45:57.000Z | 2018-02-01T22:07:33.000Z | reference-architecture/vmware-ansible/add-node.py | vshn/openshift-ansible-contrib | ac7708a97691e36bf9066d98ff0a2217280aa903 | [
"Apache-2.0"
] | 2 | 2018-01-31T14:56:15.000Z | 2018-01-31T21:55:20.000Z | #!/usr/bin/env python
# vim: sw=4 ts=4 et
import argparse, click, fileinput, iptools, os, six, sys, yaml, textwrap
from argparse import RawTextHelpFormatter
from collections import defaultdict
from six.moves import configparser
from time import time
from shutil import copyfile
try:
import json
except ImportError:... | 43.892788 | 388 | 0.584225 |
import argparse, click, fileinput, iptools, os, six, sys, yaml, textwrap
from argparse import RawTextHelpFormatter
from collections import defaultdict
from six.moves import configparser
from time import time
from shutil import copyfile
try:
import json
except ImportError:
import simplejson as json
class VM... | false | true |
1c3aed124f5136bd609625cf41cf4529ddb81b12 | 7,619 | py | Python | lib/Config.py | limebox/sublime-sdf | a315a0226b9fa3df938434b5c67e2f47f2a388d3 | [
"MIT"
] | 3 | 2017-10-12T19:11:44.000Z | 2021-08-24T18:51:38.000Z | lib/Config.py | limebox/sublime-sdf | a315a0226b9fa3df938434b5c67e2f47f2a388d3 | [
"MIT"
] | 10 | 2018-04-20T06:31:58.000Z | 2021-07-10T02:46:24.000Z | lib/Config.py | limebox/sublime-sdf | a315a0226b9fa3df938434b5c67e2f47f2a388d3 | [
"MIT"
] | null | null | null | class Config():
config_object = {
"cli_arguments": {
"adddependencies": "-p \"[PROJECT_FOLDER]\" -all",
"deploy": "-np -p \"[PROJECT_FOLDER]\"",
"importbundle": "-p \"[PROJECT_FOLDER]\"",
"importconfiguration": "-p \"[PROJECT_FOLDER]\"", # FEATURES:ALL_FEATURES",
"importfiles": "-p \"[PROJECT_FO... | 22.675595 | 163 | 0.60861 | class Config():
config_object = {
"cli_arguments": {
"adddependencies": "-p \"[PROJECT_FOLDER]\" -all",
"deploy": "-np -p \"[PROJECT_FOLDER]\"",
"importbundle": "-p \"[PROJECT_FOLDER]\"",
"importconfiguration": "-p \"[PROJECT_FOLDER]\"",
"importfiles": "-p \"[PROJECT_FOLDER]\" -excludepropertie... | true | true |
1c3aed1dcedbba4d6e31e8cb158888ac54b0db5e | 871 | py | Python | certbot-apache/certbot_apache/_internal/override_arch.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | 5 | 2021-01-26T08:47:29.000Z | 2021-01-30T00:42:12.000Z | certbot-apache/certbot_apache/_internal/override_arch.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | 2 | 2019-11-20T07:08:26.000Z | 2020-11-05T23:31:48.000Z | certbot-apache/certbot_apache/_internal/override_arch.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | 1 | 2020-10-28T05:49:43.000Z | 2020-10-28T05:49:43.000Z | """ Distribution specific override class for Arch Linux """
import zope.interface
from certbot import interfaces
from certbot_apache._internal import configurator
@zope.interface.provider(interfaces.IPluginFactory)
class ArchConfigurator(configurator.ApacheConfigurator):
"""Arch Linux specific ApacheConfigurator... | 30.034483 | 63 | 0.661309 | import zope.interface
from certbot import interfaces
from certbot_apache._internal import configurator
@zope.interface.provider(interfaces.IPluginFactory)
class ArchConfigurator(configurator.ApacheConfigurator):
OS_DEFAULTS = dict(
server_root="/etc/httpd",
vhost_root="/etc/httpd/conf",
... | true | true |
1c3aed720ff3c84f8575b631665ae385013da9c9 | 12,656 | py | Python | sdks/python/apache_beam/dataframe/expressions.py | bipinupd/beam | fffb85a35df6ae3bdb2934c077856f6b27559aa7 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/dataframe/expressions.py | bipinupd/beam | fffb85a35df6ae3bdb2934c077856f6b27559aa7 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/dataframe/expressions.py | bipinupd/beam | fffb85a35df6ae3bdb2934c077856f6b27559aa7 | [
"Apache-2.0"
] | 1 | 2020-04-29T20:09:40.000Z | 2020-04-29T20:09:40.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 33.930295 | 89 | 0.680547 |
import contextlib
import random
import threading
from typing import Any
from typing import Callable
from typing import Iterable
from typing import Optional
from typing import TypeVar
from apache_beam.dataframe import partitionings
class Session(object):
def __init__(self, bindings=None):
self._... | true | true |
1c3aee424e7fc8070086b9ea865864c2f4fcc382 | 3,031 | py | Python | python/sfm_global.py | teguhkhg/3dv_tutorial_py | 5e7bc614c5a71cd9d125b1bd8767b0b502ef9241 | [
"Beerware"
] | 2 | 2020-12-15T06:33:45.000Z | 2021-02-16T22:53:48.000Z | python/sfm_global.py | teguhkhg/3dv_tutorial_py | 5e7bc614c5a71cd9d125b1bd8767b0b502ef9241 | [
"Beerware"
] | null | null | null | python/sfm_global.py | teguhkhg/3dv_tutorial_py | 5e7bc614c5a71cd9d125b1bd8767b0b502ef9241 | [
"Beerware"
] | null | null | null | import numpy as np
import g2o
import cv2
import glob
from bundle_adjustment import MonoBA
# def makeNoisyPoints(Xs, xs, )
class Frame(object):
def __init__(self):
pass
class Mappoint(object):
def __init__(self):
pass
class Measurement(object):
def __init__(self):
pass
class Cov... | 28.866667 | 117 | 0.571429 | import numpy as np
import g2o
import cv2
import glob
from bundle_adjustment import MonoBA
class Frame(object):
def __init__(self):
pass
class Mappoint(object):
def __init__(self):
pass
class Measurement(object):
def __init__(self):
pass
class CovisibilityGraph(object):
def... | true | true |
1c3aef1a22edb2ebc2b9b274684f2b269d3324c2 | 4,634 | py | Python | chalice/app.py | viswanath-puttagunta/aws-cheatsheet | 2425eb15a6a1a22e9679c218d69b2f4e9c277a75 | [
"Apache-2.0"
] | null | null | null | chalice/app.py | viswanath-puttagunta/aws-cheatsheet | 2425eb15a6a1a22e9679c218d69b2f4e9c277a75 | [
"Apache-2.0"
] | null | null | null | chalice/app.py | viswanath-puttagunta/aws-cheatsheet | 2425eb15a6a1a22e9679c218d69b2f4e9c277a75 | [
"Apache-2.0"
] | null | null | null | from chalice import Chalice, BadRequestError
from chalice import NotFoundError
from chalice import CORSConfig
import json
import boto3
from botocore.exceptions import ClientError
'''
Commands that worked
http ${GATEWAY}/cities/seattle
http -v ${GATEWAY}/objects/mykey X-Api-Key:${APIKEY}
echo '{"name":"Viswanath"}' | h... | 31.739726 | 131 | 0.630125 | from chalice import Chalice, BadRequestError
from chalice import NotFoundError
from chalice import CORSConfig
import json
import boto3
from botocore.exceptions import ClientError
app = Chalice(app_name='khelloworld')
app.debug = True
CITIES_TO_STATE = {
'seattle': 'WA',
'portland': 'OR'
}
S3 = boto3.client(... | true | true |
1c3aefa8b340ce2d1addc68b0b56285e80ee1ddd | 730 | py | Python | main/management/commands/strava_update.py | cablespaghetti/running-club-challenge | 46bc289084c5c089154f456ac2b8901924653ead | [
"MIT"
] | null | null | null | main/management/commands/strava_update.py | cablespaghetti/running-club-challenge | 46bc289084c5c089154f456ac2b8901924653ead | [
"MIT"
] | null | null | null | main/management/commands/strava_update.py | cablespaghetti/running-club-challenge | 46bc289084c5c089154f456ac2b8901924653ead | [
"MIT"
] | null | null | null | import logging
import sys
from django.core.management.base import BaseCommand
from main.models import Athlete
from main.strava import update_user_strava_activities
from stravalib.exc import RateLimitExceeded
logger = logging.getLogger()
class Command(BaseCommand):
help = 'Gets any new athlete activities from St... | 30.416667 | 99 | 0.680822 | import logging
import sys
from django.core.management.base import BaseCommand
from main.models import Athlete
from main.strava import update_user_strava_activities
from stravalib.exc import RateLimitExceeded
logger = logging.getLogger()
class Command(BaseCommand):
help = 'Gets any new athlete activities from St... | true | true |
1c3af011d6321136b8938fe7837075da6815aaca | 5,798 | py | Python | direct/src/showutil/Rope.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | direct/src/showutil/Rope.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/direct/showutil/Rope.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 1 | 2021-04-09T00:02:59.000Z | 2021-04-09T00:02:59.000Z | from panda3d.core import *
class Rope(NodePath):
"""
This class defines a NURBS curve whose control vertices are
defined based on points relative to one or more nodes in space, so
that the "rope" will animate as the nodes move around. It uses
the C++ RopeNode class to achieve fancy rendering effe... | 39.175676 | 91 | 0.606588 | from panda3d.core import *
class Rope(NodePath):
showRope = ConfigVariableBool('show-rope', True, \
"Set this to false to deactivate the display of ropes.")
def __init__(self, name = 'Rope'):
self.ropeNode = RopeNode(name)
self.curve = NurbsCurveEvaluator()
self.ropeNode.setCur... | true | true |
1c3af0a9f97c74c950a5a9ea22723d4bcb881eca | 10,372 | py | Python | Jumpscale/core/PlatformTypes.py | Dinaamagdy/jumpscale_core | dec5d42e368ab2b5b2e40837b71d27a59cb501ab | [
"Apache-2.0"
] | null | null | null | Jumpscale/core/PlatformTypes.py | Dinaamagdy/jumpscale_core | dec5d42e368ab2b5b2e40837b71d27a59cb501ab | [
"Apache-2.0"
] | null | null | null | Jumpscale/core/PlatformTypes.py | Dinaamagdy/jumpscale_core | dec5d42e368ab2b5b2e40837b71d27a59cb501ab | [
"Apache-2.0"
] | null | null | null | from Jumpscale import j
import sys
import os
import platform
# import re
# def _useELFtrick(file):
# fd = os.open(file, os.O_RDONLY)
# out = os.read(fd, 5)
# if out[0:4] != "\x7fELF":
# result = 0 # ELF trick fails...
# elif out[4] == '\x01':
# result = 32
# elif out[4] == '\x02'... | 34.573333 | 111 | 0.56209 | from Jumpscale import j
import sys
import os
import platform
application.jsbase_get_class()
class PlatformTypes(JSBASE):
def __init__(self):
self.__jslocation__ = "j.core.platformtype"
JSBASE.__init__(self)
self._myplatform = None
self._platformParents = {}
self._p... | true | true |
1c3af165e3c85db39d0dd8c954af057b250efa94 | 40,450 | py | Python | chromewhip/protocol/debugger.py | Cosive/chromewhip | 3179aeeea898c20c8ba4fbb3926c7c696dfee165 | [
"MIT"
] | null | null | null | chromewhip/protocol/debugger.py | Cosive/chromewhip | 3179aeeea898c20c8ba4fbb3926c7c696dfee165 | [
"MIT"
] | 1 | 2022-01-26T02:10:57.000Z | 2022-02-07T21:07:18.000Z | chromewhip/protocol/debugger.py | Cosive/chromewhip | 3179aeeea898c20c8ba4fbb3926c7c696dfee165 | [
"MIT"
] | null | null | null | # noinspection PyPep8
# noinspection PyArgumentList
"""
AUTO-GENERATED BY `scripts/generate_protocol.py` using `data/browser_protocol.json`
and `data/js_protocol.json` as inputs! Please do not modify this file.
"""
import logging
from typing import Any, Optional, Union
from chromewhip.helpers import PayloadMixin, Ba... | 36.873291 | 130 | 0.548925 |
import logging
from typing import Any, Optional, Union
from chromewhip.helpers import PayloadMixin, BaseEvent, ChromeTypeBase
log = logging.getLogger(__name__)
from chromewhip.protocol import runtime as Runtime
BreakpointId = str
CallFrameId = str
class Location(ChromeTypeBase):
def __init__(self,
... | true | true |
1c3af1a5253375ac01aa65d1cf0b3648005c610f | 3,475 | py | Python | nuitka/nodes/FunctionAttributeNodes.py | sthagen/Nuitka-Nuitka | 023dc76eeafd9c53ee2a51931474ddd98a3ba083 | [
"Apache-2.0"
] | null | null | null | nuitka/nodes/FunctionAttributeNodes.py | sthagen/Nuitka-Nuitka | 023dc76eeafd9c53ee2a51931474ddd98a3ba083 | [
"Apache-2.0"
] | null | null | null | nuitka/nodes/FunctionAttributeNodes.py | sthagen/Nuitka-Nuitka | 023dc76eeafd9c53ee2a51931474ddd98a3ba083 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 34.405941 | 88 | 0.721439 |
from .ExpressionBases import (
CompileTimeConstantExpressionBase,
ExpressionChildHavingBase,
)
from .NodeBases import SideEffectsFromChildrenMixin
from .NodeMakingHelpers import makeConstantReplacementNode
class ExpressionFunctionQualnameRef(CompileTimeConstantExpressionBase):
kind = "E... | true | true |
1c3af21cc1494b3e7e8c52b4d2bce3b10af9c0f5 | 1,308 | py | Python | darkknight/models.py | fusionbox/django-darkknight | ae3d06f8c92120c45c5e18f6dd31950262f661ed | [
"BSD-2-Clause"
] | 3 | 2016-05-23T20:43:40.000Z | 2021-07-08T22:11:57.000Z | darkknight/models.py | fusionbox/django-darkknight | ae3d06f8c92120c45c5e18f6dd31950262f661ed | [
"BSD-2-Clause"
] | 1 | 2018-04-13T01:12:01.000Z | 2018-04-13T17:43:45.000Z | darkknight/models.py | fusionbox/django-darkknight | ae3d06f8c92120c45c5e18f6dd31950262f661ed | [
"BSD-2-Clause"
] | 2 | 2016-11-27T22:35:03.000Z | 2017-09-16T03:55:50.000Z | import os.path
import uuid
from django.db import models
from django.core.signing import Signer
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from OpenSSL import crypto
pk_signer = Signer('CSR PK')
# must be a top-level function to be serializable in migrations
def g... | 26.693878 | 96 | 0.733945 | import os.path
import uuid
from django.db import models
from django.core.signing import Signer
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from OpenSSL import crypto
pk_signer = Signer('CSR PK')
def generate_uuid():
return uuid.uuid4().hex
class SSLKey(mode... | true | true |
1c3af43fb511853ff61c8fae924b0d3c70187d2e | 1,706 | py | Python | toontown/ai/DistributedAprilToonsMgr.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/ai/DistributedAprilToonsMgr.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/ai/DistributedAprilToonsMgr.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from direct.distributed.DistributedObject import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase.AprilToonsGlobals import *
from toontown.toonbase import ToontownGlobals
class DistributedAprilToonsMgr(DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCatego... | 38.772727 | 107 | 0.697538 | from direct.distributed.DistributedObject import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase.AprilToonsGlobals import *
from toontown.toonbase import ToontownGlobals
class DistributedAprilToonsMgr(DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCatego... | true | true |
1c3af4ceae6c70494adf33983ad96e4c321ed51d | 552 | py | Python | Tests/image_tests/renderpasses/test_GBufferRT.py | Nuclearfossil/Falcor | 667dc68a51bbaf87a2a063f4f0ef8928990ed203 | [
"BSD-3-Clause"
] | 62 | 2022-02-04T10:34:29.000Z | 2022-03-31T19:41:20.000Z | Tests/image_tests/renderpasses/test_GBufferRT.py | Nuclearfossil/Falcor | 667dc68a51bbaf87a2a063f4f0ef8928990ed203 | [
"BSD-3-Clause"
] | 1 | 2021-02-18T16:38:38.000Z | 2021-02-18T16:38:38.000Z | Tests/image_tests/renderpasses/test_GBufferRT.py | fromasmtodisasm/Falcor | 300aee1d7a9609e427f07e8887fd9bcb377426b0 | [
"BSD-3-Clause"
] | 4 | 2022-02-04T16:08:30.000Z | 2022-03-09T09:39:41.000Z | from helpers import render_frames
from graphs.GBufferRT import GBufferRT as g
from falcor import *
m.addGraph(g)
m.loadScene('Arcade/Arcade.fscene')
ctx = locals()
# default
render_frames(ctx, 'default', frames=[1,16,64])
# enable depth-of-field
m.scene.camera.focalDistance = 3.0
m.scene.camera.apertureRadius = 0.1
... | 25.090909 | 84 | 0.762681 | from helpers import render_frames
from graphs.GBufferRT import GBufferRT as g
from falcor import *
m.addGraph(g)
m.loadScene('Arcade/Arcade.fscene')
ctx = locals()
render_frames(ctx, 'default', frames=[1,16,64])
m.scene.camera.focalDistance = 3.0
m.scene.camera.apertureRadius = 0.1
render_frames(ctx, 'dof', frames... | true | true |
1c3af52ad959cebe5559db5b7752747028e20cf2 | 4,399 | py | Python | sdk/python/pulumi_azure_nextgen/recoveryservices/get_replication_recovery_services_provider.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/recoveryservices/get_replication_recovery_services_provider.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/recoveryservices/get_replication_recovery_services_provider.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 34.912698 | 185 | 0.643555 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
__all__ = [
'GetReplicationRecoveryServicesProviderResult',
'AwaitableGetReplicationRecoveryServicesProviderResult',
'get_replication_r... | true | true |
1c3af52ea76f81bce8055804eeaef5872fe35d37 | 30 | py | Python | pybot/plugins/api/__init__.py | harikrishnana2021/operationcode-pybot | 6e78e069c274281d50dcb71b98b9f485afb012fc | [
"MIT"
] | null | null | null | pybot/plugins/api/__init__.py | harikrishnana2021/operationcode-pybot | 6e78e069c274281d50dcb71b98b9f485afb012fc | [
"MIT"
] | null | null | null | pybot/plugins/api/__init__.py | harikrishnana2021/operationcode-pybot | 6e78e069c274281d50dcb71b98b9f485afb012fc | [
"MIT"
] | null | null | null | from .plugin import APIPlugin
| 15 | 29 | 0.833333 | from .plugin import APIPlugin
| true | true |
1c3af727a745fe5abf6fe52f3e5a1d0d832e4f48 | 11,756 | py | Python | tests/loggers/test_tensorboard.py | mathemusician/pytorch-lightning | 15fa5389387b3a220bc044dd30eb0be1e8f64944 | [
"Apache-2.0"
] | 3,469 | 2019-03-31T03:09:16.000Z | 2020-01-13T15:06:31.000Z | tests/loggers/test_tensorboard.py | mathemusician/pytorch-lightning | 15fa5389387b3a220bc044dd30eb0be1e8f64944 | [
"Apache-2.0"
] | 524 | 2019-04-02T12:33:39.000Z | 2020-01-14T02:53:33.000Z | tests/loggers/test_tensorboard.py | mathemusician/pytorch-lightning | 15fa5389387b3a220bc044dd30eb0be1e8f64944 | [
"Apache-2.0"
] | 365 | 2019-04-02T22:14:04.000Z | 2020-01-13T17:21:54.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.884273 | 113 | 0.68986 |
import logging
import operator
import os
from argparse import Namespace
from unittest import mock
import numpy as np
import pytest
import torch
import yaml
from pytorch_lightning import Trainer
from pytorch_lightning.loggers import TensorBoardLogger
from pytorch_lightning.utilities.imports import _compar... | true | true |
1c3af7863bed29b416a3e11a298c516cddaa8b47 | 407 | py | Python | nicos_virt_mlz/biodiff/setups/shutter.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_virt_mlz/biodiff/setups/shutter.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_virt_mlz/biodiff/setups/shutter.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
description = 'Shutter setup'
group = 'lowlevel'
devices = dict(
gammashutter = device('nicos.devices.generic.ManualSwitch',
description = 'Gamma shutter (virtual)',
states = ['open', 'closed'],
),
photoshutter = device('nicos.devices.generic.ManualSwitch',
... | 25.4375 | 63 | 0.60688 |
description = 'Shutter setup'
group = 'lowlevel'
devices = dict(
gammashutter = device('nicos.devices.generic.ManualSwitch',
description = 'Gamma shutter (virtual)',
states = ['open', 'closed'],
),
photoshutter = device('nicos.devices.generic.ManualSwitch',
description = 'Photo sh... | true | true |
1c3af82d4aa6de435bc8f76fa7dbf08b70fa5380 | 5,756 | py | Python | inferbeddings/nli/disan/general.py | issca/inferbeddings | 80492a7aebcdcac21e758514c8af403d77e8594a | [
"MIT"
] | 33 | 2017-07-25T14:31:00.000Z | 2019-03-06T09:18:00.000Z | inferbeddings/nli/disan/general.py | issca/inferbeddings | 80492a7aebcdcac21e758514c8af403d77e8594a | [
"MIT"
] | 1 | 2017-08-22T13:49:30.000Z | 2017-08-22T13:49:30.000Z | inferbeddings/nli/disan/general.py | issca/inferbeddings | 80492a7aebcdcac21e758514c8af403d77e8594a | [
"MIT"
] | 9 | 2017-10-05T08:50:45.000Z | 2019-04-18T12:40:56.000Z | # -*- coding: utf-8 -*-
import tensorflow as tf
from functools import reduce
from operator import mul
VERY_BIG_NUMBER = 1e30
VERY_SMALL_NUMBER = 1e-30
VERY_POSITIVE_NUMBER = VERY_BIG_NUMBER
VERY_NEGATIVE_NUMBER = -VERY_BIG_NUMBER
def get_last_state(rnn_out_put, mask): # correct
'''
get_last_state of rnn ou... | 37.620915 | 107 | 0.653753 |
import tensorflow as tf
from functools import reduce
from operator import mul
VERY_BIG_NUMBER = 1e30
VERY_SMALL_NUMBER = 1e-30
VERY_POSITIVE_NUMBER = VERY_BIG_NUMBER
VERY_NEGATIVE_NUMBER = -VERY_BIG_NUMBER
def get_last_state(rnn_out_put, mask):
rnn_out_put_flatten = flatten(rnn_out_put, 2)
mask_flatten =... | true | true |
1c3af8b980375785b361c0078e3e12131203e9fc | 5,121 | py | Python | detection/configs/sparse_rcnn_pvt_v2_b2_fpn_300_proposals_crop_mstrain_480-800_3x_coco.py | cclauss/PVT | cceb465b7dfb2b7a48b39074a14a04dedab427e8 | [
"Apache-2.0"
] | 1,056 | 2021-02-24T03:26:56.000Z | 2022-03-31T01:57:48.000Z | detection/configs/sparse_rcnn_pvt_v2_b2_fpn_300_proposals_crop_mstrain_480-800_3x_coco.py | youngwanLEE/PVT | 61d92c2a704bb35f6247e5fe957d7c9a08ed28f0 | [
"Apache-2.0"
] | 85 | 2021-02-26T02:58:29.000Z | 2022-03-15T08:32:00.000Z | detection/configs/sparse_rcnn_pvt_v2_b2_fpn_300_proposals_crop_mstrain_480-800_3x_coco.py | youngwanLEE/PVT | 61d92c2a704bb35f6247e5fe957d7c9a08ed28f0 | [
"Apache-2.0"
] | 173 | 2021-02-25T02:21:41.000Z | 2022-03-19T04:36:22.000Z | _base_ = [
'_base_/datasets/coco_detection.py',
'_base_/schedules/schedule_1x.py',
'_base_/default_runtime.py'
]
num_stages = 6
num_proposals = 300
model = dict(
type='SparseRCNN',
# pretrained='pretrained/pvt_v2_b2.pth',
pretrained='https://github.com/whai362/PVT/releases/download/v2/pvt_v2_b2.... | 38.503759 | 85 | 0.507909 | _base_ = [
'_base_/datasets/coco_detection.py',
'_base_/schedules/schedule_1x.py',
'_base_/default_runtime.py'
]
num_stages = 6
num_proposals = 300
model = dict(
type='SparseRCNN',
pretrained='https://github.com/whai362/PVT/releases/download/v2/pvt_v2_b2.pth',
backbone=dict(
type='p... | true | true |
1c3afa472f2951ad9c8d105d75fd9458ae8aeedd | 50,638 | py | Python | tests/helpers/test_template.py | dcramer/home-assistant | c1936f6fe4b28a3899c31524027c06e7b31a050b | [
"Apache-2.0"
] | 1 | 2020-01-03T03:35:49.000Z | 2020-01-03T03:35:49.000Z | tests/helpers/test_template.py | pickerin/home-assistant | 4bf15a07a34c24e9c4939cd05ea2c86d8a013b2f | [
"Apache-2.0"
] | 5 | 2021-02-08T20:54:44.000Z | 2022-03-12T00:48:52.000Z | tests/helpers/test_template.py | pickerin/home-assistant | 4bf15a07a34c24e9c4939cd05ea2c86d8a013b2f | [
"Apache-2.0"
] | null | null | null | """Test Home Assistant template helper methods."""
from datetime import datetime
import math
import random
from unittest.mock import patch
import pytest
import pytz
from homeassistant.components import group
from homeassistant.const import (
LENGTH_METERS,
MASS_GRAMS,
MATCH_ALL,
PRESSURE_PA,
TEMP_... | 28.03876 | 88 | 0.570481 | from datetime import datetime
import math
import random
from unittest.mock import patch
import pytest
import pytz
from homeassistant.components import group
from homeassistant.const import (
LENGTH_METERS,
MASS_GRAMS,
MATCH_ALL,
PRESSURE_PA,
TEMP_CELSIUS,
VOLUME_LITERS,
)
from homeassistant.ex... | true | true |
1c3afb5ff9d4981f9d2a60625c92fcfd2930c52c | 327 | py | Python | controller/recipe/service.py | StykMartin/poc-controller | 6deb6be12e72837a9f4e40d13899a267f1c6a088 | [
"MIT"
] | 1 | 2021-12-17T16:58:39.000Z | 2021-12-17T16:58:39.000Z | controller/recipe/service.py | StykMartin/poc-controller | 6deb6be12e72837a9f4e40d13899a267f1c6a088 | [
"MIT"
] | 3 | 2021-11-28T08:58:39.000Z | 2021-12-20T19:01:36.000Z | controller/recipe/service.py | StykMartin/poc-controller | 6deb6be12e72837a9f4e40d13899a267f1c6a088 | [
"MIT"
] | 1 | 2021-12-19T05:10:41.000Z | 2021-12-19T05:10:41.000Z | # Proxy to Beaker Server
from typing import Any, Dict, Tuple
def get_recipe(recipe_id: int) -> Dict[str, Any]:
return {"recipe_id": recipe_id}
def get_recipe_watchdog(recipe_id: int) -> int:
return recipe_id
def post_recipe_watchdog(recipe_id: int, seconds: int) -> Tuple[int, int]:
return recipe_id, s... | 21.8 | 74 | 0.721713 |
from typing import Any, Dict, Tuple
def get_recipe(recipe_id: int) -> Dict[str, Any]:
return {"recipe_id": recipe_id}
def get_recipe_watchdog(recipe_id: int) -> int:
return recipe_id
def post_recipe_watchdog(recipe_id: int, seconds: int) -> Tuple[int, int]:
return recipe_id, seconds
| true | true |
1c3afc82812398389454280db5bc7d765bef91ec | 5,745 | py | Python | funowl/general_definitions.py | hsolbrig/funowl | 9345591e6c6cdf246fb8f4b0fcdae0b904c2a45d | [
"CC0-1.0"
] | 23 | 2019-05-24T05:27:25.000Z | 2022-02-18T16:37:17.000Z | funowl/general_definitions.py | cmungall/funowl | 67ccb3ece369b1c889341403430120c33cb5a572 | [
"CC0-1.0"
] | 22 | 2019-11-04T21:03:33.000Z | 2022-03-11T19:38:15.000Z | funowl/general_definitions.py | cmungall/funowl | 67ccb3ece369b1c889341403430120c33cb5a572 | [
"CC0-1.0"
] | 5 | 2019-10-07T13:28:14.000Z | 2021-12-20T08:28:58.000Z | """
nonNegativeInteger := a nonempty finite sequence of digits between 0 and 9
quotedString := a finite sequence of characters in which " (U+22) and \\ (U+5C) occur only in pairs of the form \\" (U+5C, U+22) and \\ (U+5C, U+5C), enclosed in a pair of " (U+22) characters
languageTag := @ (U+40) followed a nonempty seque... | 42.555556 | 191 | 0.662489 | from typing import Optional, ClassVar, Set
import bcp47
import rdflib
import rfc3987
from rdflib import BNode, URIRef, Graph, Literal
from rdflib.namespace import is_ncname, XSD
from funowl.base.fun_owl_base import FunOwlBase, FunOwlRoot
from funowl.terminals.Terminals import PNAME_NS, PNAME_LN, BLANK_NODE_LABEL, QUO... | true | true |
1c3afd51a20bfdb1b868bd870ca6f23018628fae | 18,995 | py | Python | dautils/nb.py | diabloxenon/dautils | 064307b0fd9bbca2adcc7df5c6a0289954c74d58 | [
"MIT"
] | null | null | null | dautils/nb.py | diabloxenon/dautils | 064307b0fd9bbca2adcc7df5c6a0289954c74d58 | [
"MIT"
] | null | null | null | dautils/nb.py | diabloxenon/dautils | 064307b0fd9bbca2adcc7df5c6a0289954c74d58 | [
"MIT"
] | null | null | null | """ IPython/Jupyter notebook widgets and utilities. """
from IPython.display import display
from IPython.display import Math
# from IPython.html import widgets : DEPRECATED OPTION
import ipywidgets as widgets
from dautils import collect
from dautils import conf
from dautils import ts
from dautils import log_api
import ... | 31.08838 | 79 | 0.59621 | from IPython.display import display
from IPython.display import Math
import ipywidgets as widgets
from dautils import collect
from dautils import conf
from dautils import ts
from dautils import log_api
import matplotlib as mpl
from matplotlib.colors import rgb2hex
import pprint
from matplotlib.colors import ColorConve... | true | true |
1c3afe002948062303b2fdb2338c03553fc6ecf1 | 2,763 | py | Python | mqtt_pi0_client/list_control.py | hengying/mqtt_at_home | ed1cc5dd0a57cc46e57ec5edeb48ae1d019ebae5 | [
"BSD-3-Clause"
] | null | null | null | mqtt_pi0_client/list_control.py | hengying/mqtt_at_home | ed1cc5dd0a57cc46e57ec5edeb48ae1d019ebae5 | [
"BSD-3-Clause"
] | null | null | null | mqtt_pi0_client/list_control.py | hengying/mqtt_at_home | ed1cc5dd0a57cc46e57ec5edeb48ae1d019ebae5 | [
"BSD-3-Clause"
] | null | null | null |
from layer import Layer
from button_enum import *
from event import *
BIAS_Y = -2
class ListControl(Layer):
def __init__(self, holder, name, labels):
super().__init__(holder, name)
self._labels = labels
self._current_item = 0
self._top_item = 0
def handle_event(self, event):... | 44.564516 | 93 | 0.564966 |
from layer import Layer
from button_enum import *
from event import *
BIAS_Y = -2
class ListControl(Layer):
def __init__(self, holder, name, labels):
super().__init__(holder, name)
self._labels = labels
self._current_item = 0
self._top_item = 0
def handle_event(self, event):... | true | true |
1c3afe5cfc45a414c8c4351a3aecf2ce63bcb80e | 751 | py | Python | 200. Number of Islands/solution.py | alexwhyy/leetcode | 41664aa48137677d2f98817b9c512d76f13c525f | [
"MIT"
] | null | null | null | 200. Number of Islands/solution.py | alexwhyy/leetcode | 41664aa48137677d2f98817b9c512d76f13c525f | [
"MIT"
] | null | null | null | 200. Number of Islands/solution.py | alexwhyy/leetcode | 41664aa48137677d2f98817b9c512d76f13c525f | [
"MIT"
] | null | null | null | class Solution:
def traverse(self, grid, y, x):
grid[y][x] = "0"
if y - 1 >= 0 and grid[y - 1][x] == "1":
self.traverse(grid, y - 1, x)
if x + 1 < len(grid[0]) and grid[y][x + 1] == "1":
self.traverse(grid, y, x + 1)
if y + 1 < len(grid) and grid[y + 1][x] == ... | 37.55 | 58 | 0.423435 | class Solution:
def traverse(self, grid, y, x):
grid[y][x] = "0"
if y - 1 >= 0 and grid[y - 1][x] == "1":
self.traverse(grid, y - 1, x)
if x + 1 < len(grid[0]) and grid[y][x + 1] == "1":
self.traverse(grid, y, x + 1)
if y + 1 < len(grid) and grid[y + 1][x] == ... | true | true |
1c3afea626267efe957e1bdf8d89b5b62b7b2996 | 11,343 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/network/a10/a10_virtual_server.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/network/a10/a10_virtual_server.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/network/a10/a10_virtual_server.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>,
# Eric Chou <ericc@a10networks.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = t... | 38.979381 | 138 | 0.627876 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: a10_virtual_server
version_added: 1.8
short_descrip... | true | true |
1c3afeb4753bda4fbff9b2dcc854e5d06db45765 | 1,054 | py | Python | python36/dxa/sn_random_numbers.py | luckyzflQ/py4fix | 03c17eeab201f9510789b328609273205db75d41 | [
"CNRI-Python"
] | 1 | 2018-09-10T18:51:14.000Z | 2018-09-10T18:51:14.000Z | python3/dxa/sn_random_numbers.py | ioancw/py4fi | bbf7b41d375e4f7b0344bc9b1e97d7910ad1e6ec | [
"CNRI-Python"
] | 2 | 2020-10-27T19:44:15.000Z | 2020-11-03T23:55:36.000Z | python3/dxa/sn_random_numbers.py | ioancw/py4fi | bbf7b41d375e4f7b0344bc9b1e97d7910ad1e6ec | [
"CNRI-Python"
] | 2 | 2019-03-05T15:03:15.000Z | 2019-12-27T19:09:41.000Z | import numpy as np
def sn_random_numbers(shape, antithetic=True, moment_matching=True,
fixed_seed=False):
''' Returns an array of shape shape with (pseudo)random numbers
that are standard normally distributed.
Parameters
==========
shape : tuple (o, n, m)
generati... | 29.277778 | 80 | 0.591082 | import numpy as np
def sn_random_numbers(shape, antithetic=True, moment_matching=True,
fixed_seed=False):
if fixed_seed:
np.random.seed(1000)
if antithetic:
ran = np.random.standard_normal((shape[0], shape[1], int(shape[2] / 2)))
ran = np.concatenate((ran, -ran), a... | true | true |
1c3b00055fe866bbbd99dcd71c94fc7e0edbc356 | 396 | py | Python | src/blog/migrations/0009_auto_20200804_1509.py | SleepNoMore/django_blog_site | d23397e1595c488c424ed7eb46d1f844afd8178e | [
"MIT"
] | null | null | null | src/blog/migrations/0009_auto_20200804_1509.py | SleepNoMore/django_blog_site | d23397e1595c488c424ed7eb46d1f844afd8178e | [
"MIT"
] | null | null | null | src/blog/migrations/0009_auto_20200804_1509.py | SleepNoMore/django_blog_site | d23397e1595c488c424ed7eb46d1f844afd8178e | [
"MIT"
] | null | null | null | # Generated by Django 3.0.9 on 2020-08-04 13:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0008_auto_20200804_1508'),
]
operations = [
migrations.AlterField(
model_name='post',
name='category',
... | 20.842105 | 63 | 0.60101 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0008_auto_20200804_1508'),
]
operations = [
migrations.AlterField(
model_name='post',
name='category',
field=models.CharField(blank=True, max_l... | true | true |
1c3b0039b51ce776822a9b608112c4ba7e849670 | 7,997 | py | Python | django/utils/http.py | blaze33/django | 2f6d887bd0a110e3a662ac1d056d6cdabf38632b | [
"BSD-3-Clause"
] | null | null | null | django/utils/http.py | blaze33/django | 2f6d887bd0a110e3a662ac1d056d6cdabf38632b | [
"BSD-3-Clause"
] | 1 | 2016-02-19T00:22:18.000Z | 2016-02-19T00:22:18.000Z | django/utils/http.py | blaze33/django | 2f6d887bd0a110e3a662ac1d056d6cdabf38632b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from email.utils import formatdate
fro... | 34.769565 | 84 | 0.654996 | from __future__ import unicode_literals
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError:
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from email.utils import formatdate
from django.u... | true | true |
1c3b00ee71b0bffd223e0576b49eb93ff93b66a5 | 1,194 | py | Python | email/app.py | vivekbhanu18/MASK_RCNN | 0fe43b5638a062f6fc42cd1a9598f45cb06b99b3 | [
"MIT"
] | null | null | null | email/app.py | vivekbhanu18/MASK_RCNN | 0fe43b5638a062f6fc42cd1a9598f45cb06b99b3 | [
"MIT"
] | null | null | null | email/app.py | vivekbhanu18/MASK_RCNN | 0fe43b5638a062f6fc42cd1a9598f45cb06b99b3 | [
"MIT"
] | null | null | null | # importing libraries
from flask import Flask
from flask_mail import Mail, Message
from flask import Flask, render_template, request,url_for, redirect
app = Flask(__name__)
mail = Mail(app) # instantiate the mail class
# configuration of mail
app.config['MAIL_SERVER']='smtp.gmail.com'
app.config['MAIL_PORT'] = ... | 30.615385 | 119 | 0.643216 |
from flask import Flask
from flask_mail import Mail, Message
from flask import Flask, render_template, request,url_for, redirect
app = Flask(__name__)
mail = Mail(app)
app.config['MAIL_SERVER']='smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = 'bhanuvivek9705@gmail.com'
app.config['MA... | true | true |
1c3b0189e79fc7f49f9e191f628922ea18e6c04e | 1,367 | py | Python | maize/types/unfinished_header_block.py | denern/maize-blockchain | b8639899f44b03232dda90c706d061e5e1158ca3 | [
"Apache-2.0"
] | 14 | 2021-07-21T19:45:05.000Z | 2022-02-09T04:29:51.000Z | maize/types/unfinished_header_block.py | denern/maize-blockchain | b8639899f44b03232dda90c706d061e5e1158ca3 | [
"Apache-2.0"
] | 9 | 2021-07-24T09:30:46.000Z | 2021-12-05T19:51:29.000Z | maize/types/unfinished_header_block.py | denern/maize-blockchain | b8639899f44b03232dda90c706d061e5e1158ca3 | [
"Apache-2.0"
] | 5 | 2021-10-04T17:33:47.000Z | 2022-03-15T08:37:51.000Z | from dataclasses import dataclass
from typing import List, Optional
from maize.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock
from maize.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished
from maize.types.blockchain_format.vdf import VDFProof
from maize.types.end_of_s... | 40.205882 | 104 | 0.792977 | from dataclasses import dataclass
from typing import List, Optional
from maize.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock
from maize.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished
from maize.types.blockchain_format.vdf import VDFProof
from maize.types.end_of_s... | true | true |
1c3b01a302a11cf5e166c2f86c0e9660fd8d7353 | 1,693 | py | Python | tests/web/test_flask.py | mikkoi/py-healthcheck | ca86da28c26d7b1a4adda90dfff870f0326bc9ff | [
"MIT"
] | 85 | 2017-02-09T18:11:38.000Z | 2022-01-30T17:19:09.000Z | tests/web/test_flask.py | mikkoi/py-healthcheck | ca86da28c26d7b1a4adda90dfff870f0326bc9ff | [
"MIT"
] | 16 | 2017-03-29T21:41:08.000Z | 2021-07-06T08:24:57.000Z | tests/web/test_flask.py | mikkoi/py-healthcheck | ca86da28c26d7b1a4adda90dfff870f0326bc9ff | [
"MIT"
] | 26 | 2017-02-07T22:49:26.000Z | 2022-02-18T11:01:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import flask
from healthcheck import HealthCheck, EnvironmentDump
class BasicHealthCheckTest(unittest.TestCase):
def setUp(self):
self.path = '/h'
self.app = flask.Flask(__name__)
self.hc = self._hc()
self.client = se... | 25.268657 | 73 | 0.632014 |
import unittest
import flask
from healthcheck import HealthCheck, EnvironmentDump
class BasicHealthCheckTest(unittest.TestCase):
def setUp(self):
self.path = '/h'
self.app = flask.Flask(__name__)
self.hc = self._hc()
self.client = self.app.test_client()
self.app.add_u... | true | true |
1c3b0308475be21dbb6cbfba0ce3411666d1d13f | 6,312 | py | Python | python/raspberrypi/DFRobot_4DIO_S.py | cdjq/DFRobot_4DIO_S | d278e935ab5f217198e3d2ff3964454e9aa3d89b | [
"MIT"
] | null | null | null | python/raspberrypi/DFRobot_4DIO_S.py | cdjq/DFRobot_4DIO_S | d278e935ab5f217198e3d2ff3964454e9aa3d89b | [
"MIT"
] | null | null | null | python/raspberrypi/DFRobot_4DIO_S.py | cdjq/DFRobot_4DIO_S | d278e935ab5f217198e3d2ff3964454e9aa3d89b | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
'''
@file DFRobot_4DIO_S.py
@brief DFRobot_4DIO_S libary for raspberry.
@copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
@licence The MIT License (MIT)
@author [fengli](li.feng@dfrobot.com)
@version V1.0
@date 2021-07-21
@https://github.com/DFRobot... | 31.718593 | 84 | 0.637516 |
from DFRobot_RTU import *
class DFRobot_4DIO_S(DFRobot_RTU):
REG_4DIO_DEVICE_PID = 0x00
REG_4DIO_DEVICE_VID = 0x01
REG_4DIO_DEVICE_ADRR = 0x02
REG_4DIO_UART_CONFIG1 = 0x03
REG_4DIO_UART_CONFIG2 = 0x04
BEEP = 0X00
DIO_1 = 0X01
DIO_2 = 0X02
DIO_3 = 0X03
D... | true | true |
1c3b03e56fa1ffe917a51782c729d303e6974a4a | 3,496 | py | Python | docs/conf.py | sbslee/dokdo | a528a830b3347c39e1dc415b0f3e2c6ad60b0a1d | [
"MIT"
] | 23 | 2020-11-01T21:55:30.000Z | 2021-12-05T14:03:05.000Z | docs/conf.py | sbslee/dokdo | a528a830b3347c39e1dc415b0f3e2c6ad60b0a1d | [
"MIT"
] | 25 | 2020-11-25T23:24:23.000Z | 2022-03-30T04:40:45.000Z | docs/conf.py | sbslee/dokdo | a528a830b3347c39e1dc415b0f3e2c6ad60b0a1d | [
"MIT"
] | 7 | 2020-11-27T06:46:47.000Z | 2021-09-25T03:26:07.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 27.100775 | 83 | 0.641876 |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../'))
project = 'dokdo'
copyright = '2020, Seung-been "Steven" Lee'
author = 'Seung-been "Steven" Lee'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.linkcode',
... | true | true |
1c3b064445f3e0a09a6d3b4b622259737fb43e8d | 5,717 | py | Python | ceilometer/tests/functional/api/v2/test_list_events_scenarios.py | redhat-openstack/ceilometer | 9e503d7068889e52e9144079de331ed51676e535 | [
"Apache-2.0"
] | 1 | 2016-03-10T06:55:45.000Z | 2016-03-10T06:55:45.000Z | ceilometer/tests/functional/api/v2/test_list_events_scenarios.py | redhat-openstack/ceilometer | 9e503d7068889e52e9144079de331ed51676e535 | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/functional/api/v2/test_list_events_scenarios.py | redhat-openstack/ceilometer | 9e503d7068889e52e9144079de331ed51676e535 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | 35.955975 | 78 | 0.500437 |
import datetime
import mock
from oslo_utils import timeutils
import six
from ceilometer.publisher import utils
from ceilometer import sample
from ceilometer.tests import db as tests_db
from ceilometer.tests.functional.api import v2
class TestListEvents(v2.FunctionalTest,
tests_db... | true | true |
1c3b0668bca9636afcc439e2353bcb34470133fc | 81 | py | Python | demo/bug/apps.py | valbendan/django-ninja-demo | 806071b82e55b5034a13cc1674520a9743f94963 | [
"MIT"
] | null | null | null | demo/bug/apps.py | valbendan/django-ninja-demo | 806071b82e55b5034a13cc1674520a9743f94963 | [
"MIT"
] | 3 | 2021-03-30T13:43:20.000Z | 2021-06-10T19:39:51.000Z | demo/bug/apps.py | valbendan/django-ninja-demo | 806071b82e55b5034a13cc1674520a9743f94963 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class BugConfig(AppConfig):
name = 'bug'
| 13.5 | 33 | 0.728395 | from django.apps import AppConfig
class BugConfig(AppConfig):
name = 'bug'
| true | true |
1c3b067e5ceed6737730ff58e1ac4790a027212a | 444 | py | Python | arc/arc017/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | arc/arc017/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | arc/arc017/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
def is_prime(x):
for i in range(2, int(math.sqrt(x)) + 1):
... | 18.5 | 53 | 0.617117 | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
def is_prime(x):
for i in range(2, int(math.sqrt(x)) + 1):
... | true | true |
1c3b06f168230558a536abf144a7eeef74c0d92d | 68 | py | Python | Practice/Python/EyeAndIdentity.py | avantikasharma/HackerRank-Solutions | a980859ac352688853fcbcf3c7ec6d95685f99ea | [
"MIT"
] | 1 | 2018-07-08T15:44:15.000Z | 2018-07-08T15:44:15.000Z | Practice/Python/EyeAndIdentity.py | avantikasharma/HackerRank-Solutions | a980859ac352688853fcbcf3c7ec6d95685f99ea | [
"MIT"
] | null | null | null | Practice/Python/EyeAndIdentity.py | avantikasharma/HackerRank-Solutions | a980859ac352688853fcbcf3c7ec6d95685f99ea | [
"MIT"
] | 2 | 2018-08-10T06:49:34.000Z | 2020-10-01T04:50:59.000Z | import numpy
N,M=map(int,input().split())
print(numpy.eye(N,M,k=0))
| 17 | 28 | 0.676471 | import numpy
N,M=map(int,input().split())
print(numpy.eye(N,M,k=0))
| true | true |
1c3b087880b70328bf06a6fb67b73e768fcfddb8 | 11,821 | py | Python | resolwe_bio/tools/samplehcluster.py | dblenkus/resolwe-bio | 5077a162f454576dbe1bc41e97923bde49420261 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/tools/samplehcluster.py | dblenkus/resolwe-bio | 5077a162f454576dbe1bc41e97923bde49420261 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/tools/samplehcluster.py | dblenkus/resolwe-bio | 5077a162f454576dbe1bc41e97923bde49420261 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Hierarchical clustering of samples."""
import argparse
import json
import numpy as np
import pandas as pd
import resdk
from resolwe_runtime_utils import error, warning
from scipy.cluster.hierarchy import dendrogram, linkage
from scipy.stats import spearmanr, zscore
def parse_args():
""... | 35.821212 | 98 | 0.602825 |
import argparse
import json
import numpy as np
import pandas as pd
import resdk
from resolwe_runtime_utils import error, warning
from scipy.cluster.hierarchy import dendrogram, linkage
from scipy.stats import spearmanr, zscore
def parse_args():
parser = argparse.ArgumentParser(description="Hierarchical cluster... | true | true |
1c3b08af7c3dc096936c3528aa09cebaf722275b | 1,980 | py | Python | house_price_mlp.py | starcroce/tf_dl_cookbook | 65c0cb9c9df230e551df5f04c5e2345dcbe53552 | [
"MIT"
] | null | null | null | house_price_mlp.py | starcroce/tf_dl_cookbook | 65c0cb9c9df230e551df5f04c5e2345dcbe53552 | [
"MIT"
] | null | null | null | house_price_mlp.py | starcroce/tf_dl_cookbook | 65c0cb9c9df230e551df5f04c5e2345dcbe53552 | [
"MIT"
] | 1 | 2019-01-02T06:42:36.000Z | 2019-01-02T06:42:36.000Z | import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.layers as layers
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
boston = datasets.load_boston()
df = pd.DataFrame(boston.data, columns... | 33 | 84 | 0.717677 | import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.layers as layers
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
boston = datasets.load_boston()
df = pd.DataFrame(boston.data, columns... | true | true |
1c3b0913d27b99b70bf2d48e73a0e8605d912f7e | 277 | py | Python | whyis/blueprint/nanopub/__init__.py | tolulomo/whyis | eb50ab3301eb7efd27a1a3f6fb2305dedd910397 | [
"Apache-2.0"
] | 31 | 2018-05-30T02:41:23.000Z | 2021-10-17T01:25:20.000Z | whyis/blueprint/nanopub/__init__.py | tolulomo/whyis | eb50ab3301eb7efd27a1a3f6fb2305dedd910397 | [
"Apache-2.0"
] | 115 | 2018-04-07T00:59:11.000Z | 2022-03-02T03:06:45.000Z | whyis/blueprint/nanopub/__init__.py | tolulomo/whyis | eb50ab3301eb7efd27a1a3f6fb2305dedd910397 | [
"Apache-2.0"
] | 25 | 2018-04-07T00:49:55.000Z | 2021-09-28T14:29:18.000Z | from .nanopub_blueprint import nanopub_blueprint
from .delete_nanopub import delete_nanopub as __delete_nanopub
from .get_nanopub import get_nanopub as __get_nanopub
from .post_nanopub import post_nanopub as __post_nanopub
from .put_nanopub import put_nanopub as __put_nanopub
| 46.166667 | 62 | 0.880866 | from .nanopub_blueprint import nanopub_blueprint
from .delete_nanopub import delete_nanopub as __delete_nanopub
from .get_nanopub import get_nanopub as __get_nanopub
from .post_nanopub import post_nanopub as __post_nanopub
from .put_nanopub import put_nanopub as __put_nanopub
| true | true |
1c3b09d840e3ffbc3af67b126048f4eaf366fa05 | 11,294 | py | Python | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | import os
import random
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from numpy.lib.arraysetops import isin
import torch
import yaml
from grave import plot_network, use_attributes
from tabulate import tabulate
from cogdl import oagbert
from cogdl.data import Grap... | 36.668831 | 118 | 0.600673 | import os
import random
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from numpy.lib.arraysetops import isin
import torch
import yaml
from grave import plot_network, use_attributes
from tabulate import tabulate
from cogdl import oagbert
from cogdl.data import Grap... | true | true |
1c3b09daa52dd6908eb9f534be81ec1437d867aa | 18,070 | py | Python | tests/unit/scm/test_git.py | larsmelcher/dvc | 71bae7e4affbc5f37aceb9412dd60822201a942d | [
"Apache-2.0"
] | 1 | 2019-10-04T13:46:03.000Z | 2019-10-04T13:46:03.000Z | tests/unit/scm/test_git.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | 32 | 2021-10-21T17:14:55.000Z | 2022-03-31T17:18:19.000Z | tests/unit/scm/test_git.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from dvc.scm.base import SCMError
# Behaves the same as SCM but will test against all supported Git backends.
# tmp_dir.scm will still contain a default SCM instance.
@pytest.fixture(params=["gitpython", "dulwich", "pygit2"])
def git(tmp_dir, scm, request):
from dvc.scm.git import Git
... | 30.994854 | 78 | 0.603154 | import os
import pytest
from dvc.scm.base import SCMError
@pytest.fixture(params=["gitpython", "dulwich", "pygit2"])
def git(tmp_dir, scm, request):
from dvc.scm.git import Git
git_ = Git(os.fspath(tmp_dir), backends=[request.param])
git_.test_backend = request.param
yield git_
git_.close()
... | true | true |
1c3b0a5e82ed0aa464b3dca8e0a8d8ba63c5bbca | 1,347 | py | Python | curtains/stepper_driver.py | KevinMidboe/curtains_avantGarde | ad991518fd5465c479c2257a3f58d07d9038d59f | [
"MIT"
] | null | null | null | curtains/stepper_driver.py | KevinMidboe/curtains_avantGarde | ad991518fd5465c479c2257a3f58d07d9038d59f | [
"MIT"
] | null | null | null | curtains/stepper_driver.py | KevinMidboe/curtains_avantGarde | ad991518fd5465c479c2257a3f58d07d9038d59f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: KevinMidboe
# @Date: 2017-08-25 16:04:49
# @Last Modified by: KevinMidboe
# @Last Modified time: 2017-08-25 17:34:07
from time import sleep
import RPi.GPIO as gpio
class Stepper:
# Initiate stepper
# Pins = [pin1, pin2, pin3, pin4]
def __init__(self, pi... | 19.521739 | 59 | 0.646622 |
from time import sleep
import RPi.GPIO as gpio
class Stepper:
def __init__(self, pins):
self.pins = pins
gpio.setmode(gpio.BCM)
for pin in self.pins:
gpio.setup(pin, gpio.OUT)
gpio.output(pin, False)
def cleanGPIO(self):
gpio.cleanup()
def rotate(self, l, n=1):
return l[n:] + l[:n]
... | true | true |
1c3b0b21cd525f8bf44163e71c6a22d31c564b40 | 5,240 | py | Python | marconi/openstack/common/cache/_backends/memory.py | andrew-vant/marconi | 9afe7ba27efe597cca8baac77fd0aa387c75001a | [
"Apache-2.0"
] | null | null | null | marconi/openstack/common/cache/_backends/memory.py | andrew-vant/marconi | 9afe7ba27efe597cca8baac77fd0aa387c75001a | [
"Apache-2.0"
] | null | null | null | marconi/openstack/common/cache/_backends/memory.py | andrew-vant/marconi | 9afe7ba27efe597cca8baac77fd0aa387c75001a | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 31.566265 | 78 | 0.589885 |
import collections
from marconi.openstack.common.cache import backends
from marconi.openstack.common import lockutils
from marconi.openstack.common import timeutils
class MemoryBackend(backends.BaseCache):
def __init__(self, parsed_url, options=None):
super(MemoryBackend, self).__init__(pa... | true | true |
1c3b0be6de73d7cc06657e6f2db94f3125f6786a | 38 | py | Python | tests/dataframe_creation_test.py | mmutiso/dea | 6c497b05ef2e957b610a2f9390a3d55d69bcaa7d | [
"Apache-2.0"
] | null | null | null | tests/dataframe_creation_test.py | mmutiso/dea | 6c497b05ef2e957b610a2f9390a3d55d69bcaa7d | [
"Apache-2.0"
] | 1 | 2022-01-01T17:33:13.000Z | 2022-01-01T17:33:13.000Z | tests/dataframe_creation_test.py | mmutiso/dea | 6c497b05ef2e957b610a2f9390a3d55d69bcaa7d | [
"Apache-2.0"
] | null | null | null | def test_default():
assert True
| 12.666667 | 20 | 0.657895 | def test_default():
assert True
| true | true |
1c3b0c024441448637d709c8de20e8cccda5be38 | 108 | py | Python | whatpulse/config.py | beenotung/whatpulse | 56d2e16b989f8b0be80f41134ab82688bf90bdd9 | [
"MIT"
] | 33 | 2016-02-01T15:17:18.000Z | 2021-09-04T21:21:59.000Z | whatpulse/config.py | beenotung/whatpulse | 56d2e16b989f8b0be80f41134ab82688bf90bdd9 | [
"MIT"
] | 9 | 2016-05-30T12:48:52.000Z | 2020-08-12T23:36:10.000Z | whatpulse/config.py | beenotung/whatpulse | 56d2e16b989f8b0be80f41134ab82688bf90bdd9 | [
"MIT"
] | 8 | 2016-02-01T15:14:37.000Z | 2020-09-23T09:42:29.000Z | client_version = '2.8.1'
type_os = 'linux' # windows, linux, macos
__all__ = ["client_version", "type_os"]
| 21.6 | 41 | 0.685185 | client_version = '2.8.1'
type_os = 'linux'
__all__ = ["client_version", "type_os"]
| true | true |
1c3b0d2fb3fb9e1f8591c15f4f718e00532f5e15 | 1,456 | py | Python | paper_result/MINet/bicon/train/utils/tensor_ops.py | Zyun-Y/BiconNets | f5ea85dc58550969b99a2ccccccd8133dda4358c | [
"MIT"
] | 9 | 2021-03-02T05:16:03.000Z | 2022-02-01T07:47:00.000Z | paper_result/MINet/bicon/train/utils/tensor_ops.py | Zyun-Y/BiconNets | f5ea85dc58550969b99a2ccccccd8133dda4358c | [
"MIT"
] | null | null | null | paper_result/MINet/bicon/train/utils/tensor_ops.py | Zyun-Y/BiconNets | f5ea85dc58550969b99a2ccccccd8133dda4358c | [
"MIT"
] | 2 | 2021-08-10T07:30:01.000Z | 2021-11-22T03:01:50.000Z | # -*- coding: utf-8 -*-
import torch.nn.functional as F
def cus_sample(feat, **kwargs):
"""
:param feat: 输入特征
:param kwargs: size或者scale_factor
"""
assert len(kwargs.keys()) == 1 and list(kwargs.keys())[0] in ["size", "scale_factor"]
return F.interpolate(feat, **kwargs, mode="bilinear", align... | 25.103448 | 93 | 0.570055 |
import torch.nn.functional as F
def cus_sample(feat, **kwargs):
assert len(kwargs.keys()) == 1 and list(kwargs.keys())[0] in ["size", "scale_factor"]
return F.interpolate(feat, **kwargs, mode="bilinear", align_corners=False)
def upsample_add(*xs):
y = xs[-1]
for x in xs[:-1]:
y = y + F.int... | true | true |
1c3b0de3f094a179e48a574a148643a328b237d7 | 2,449 | py | Python | olea/packages/json_api/json_api/conditions.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 2 | 2020-06-18T03:25:52.000Z | 2020-06-18T07:33:45.000Z | olea/packages/json_api/json_api/conditions.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 15 | 2021-01-28T07:11:04.000Z | 2021-05-24T07:11:37.000Z | olea/packages/json_api/json_api/conditions.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict
class BaseCondition():
def gen_schema(self, field_type, schema) -> Dict[str, Any]:
pass
class AnyValue(BaseCondition):
def gen_schema(self, field_type, schema):
return schema
class Regex(BaseCondition):
def __init__(self, pattern):
self.pattern = pa... | 26.333333 | 91 | 0.588812 | from typing import Any, Dict
class BaseCondition():
def gen_schema(self, field_type, schema) -> Dict[str, Any]:
pass
class AnyValue(BaseCondition):
def gen_schema(self, field_type, schema):
return schema
class Regex(BaseCondition):
def __init__(self, pattern):
self.pattern = pa... | true | true |
1c3b0e3649ccf6bc24793ef5e8f21581e122af57 | 6,443 | py | Python | stylebank/datasets.py | ncassereau-idris/stylebank | 2884d5eb8175622a03684ee621fd44736a431e82 | [
"MIT"
] | null | null | null | stylebank/datasets.py | ncassereau-idris/stylebank | 2884d5eb8175622a03684ee621fd44736a431e82 | [
"MIT"
] | null | null | null | stylebank/datasets.py | ncassereau-idris/stylebank | 2884d5eb8175622a03684ee621fd44736a431e82 | [
"MIT"
] | null | null | null | # /usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from hydra.utils import to_absolute_path
import torch
import torch.distributed as dist
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torchvision.transforms.functional as TF
from torchvisi... | 30.535545 | 79 | 0.624864 |
import logging
from hydra.utils import to_absolute_path
import torch
import torch.distributed as dist
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torchvision.transforms.functional as TF
from torchvision.io import read_image
import torchvision.tr... | true | true |
1c3b0eb236deebcb953e7906a54e6acab54f1c15 | 2,500 | py | Python | tests/events.py | msabramo/chaperone | 9ff2c3a5b9c6820f8750320a564ea214042df06f | [
"Apache-2.0"
] | 186 | 2015-07-22T00:08:04.000Z | 2021-11-05T21:51:09.000Z | tests/events.py | msabramo/chaperone | 9ff2c3a5b9c6820f8750320a564ea214042df06f | [
"Apache-2.0"
] | 24 | 2015-07-27T15:30:14.000Z | 2021-09-11T21:19:37.000Z | tests/events.py | msabramo/chaperone | 9ff2c3a5b9c6820f8750320a564ea214042df06f | [
"Apache-2.0"
] | 26 | 2016-01-11T21:02:30.000Z | 2021-08-31T11:09:25.000Z | from prefix import *
from chaperone.cutil.events import EventSource
class handlers:
def __init__(self):
self.results = list()
def handler1(self, val):
self.results.append("handler1:" + val)
def handler2(self, val):
self.results.append("handler2:" + val)
def handler3(sel... | 39.0625 | 162 | 0.614 | from prefix import *
from chaperone.cutil.events import EventSource
class handlers:
def __init__(self):
self.results = list()
def handler1(self, val):
self.results.append("handler1:" + val)
def handler2(self, val):
self.results.append("handler2:" + val)
def handler3(sel... | true | true |
1c3b0f72301a9ab5af61f59e6bbc9d5259041a3d | 1,302 | py | Python | djangocms_file/migrations/0006_migrate_to_filer.py | crydotsnake/djangocms-file | 044bc86545493493227d2393cea475e23759478c | [
"BSD-3-Clause"
] | 25 | 2015-10-24T20:37:23.000Z | 2020-09-24T12:02:35.000Z | djangocms_file/migrations/0006_migrate_to_filer.py | crydotsnake/djangocms-file | 044bc86545493493227d2393cea475e23759478c | [
"BSD-3-Clause"
] | 40 | 2015-03-23T16:17:34.000Z | 2020-09-02T08:30:44.000Z | djangocms_file/migrations/0006_migrate_to_filer.py | crydotsnake/djangocms-file | 044bc86545493493227d2393cea475e23759478c | [
"BSD-3-Clause"
] | 17 | 2015-08-18T17:41:03.000Z | 2020-02-11T23:42:00.000Z | import django.db.models.deletion
from django.db import migrations, models
import filer.fields.file
def migrate_to_filer(apps, schema_editor):
# Because filer is polymorphic, Djangos migration can't handle
from filer.models import File
FileInstance = apps.get_model('djangocms_file', 'File')
plugins = ... | 30.27907 | 176 | 0.615207 | import django.db.models.deletion
from django.db import migrations, models
import filer.fields.file
def migrate_to_filer(apps, schema_editor):
from filer.models import File
FileInstance = apps.get_model('djangocms_file', 'File')
plugins = FileInstance.objects.all()
for plugin in plugins: # prag... | true | true |
1c3b0f88c705ffdd66629d61b72914e4eb0d5a7a | 43,116 | py | Python | lights.py | caj380/lifx-lan-gui | 610f1cea7c915dd6d9c2d5108a1c5a19309527f2 | [
"MIT"
] | null | null | null | lights.py | caj380/lifx-lan-gui | 610f1cea7c915dd6d9c2d5108a1c5a19309527f2 | [
"MIT"
] | null | null | null | lights.py | caj380/lifx-lan-gui | 610f1cea7c915dd6d9c2d5108a1c5a19309527f2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
if sys.version_info < (3, 3):
sys.stdout.write("Sorry, This module requires Python 3.3 (or higher), not Python 2.x. You are using Python {0}.{1}\n".format(sys.version_info[0],sys.version_info[1]))
sys.exit(1)
from appJar import gui
import os
import time
import binascii
im... | 34.548077 | 347 | 0.618193 |
import sys
if sys.version_info < (3, 3):
sys.stdout.write("Sorry, This module requires Python 3.3 (or higher), not Python 2.x. You are using Python {0}.{1}\n".format(sys.version_info[0],sys.version_info[1]))
sys.exit(1)
from appJar import gui
import os
import time
import binascii
import lifxlan
import co... | true | true |
1c3b0fd15cdb829b31c47e897d0ef87b98cab386 | 3,472 | py | Python | IoTSocketServer/iot_logger.py | senceryazici/iot-socket-application-nodemcu | 41449fbfd345bca40ea140011a33b34fe00a3029 | [
"MIT"
] | null | null | null | IoTSocketServer/iot_logger.py | senceryazici/iot-socket-application-nodemcu | 41449fbfd345bca40ea140011a33b34fe00a3029 | [
"MIT"
] | null | null | null | IoTSocketServer/iot_logger.py | senceryazici/iot-socket-application-nodemcu | 41449fbfd345bca40ea140011a33b34fe00a3029 | [
"MIT"
] | null | null | null | import logging
import time
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
# The background is set with 40 plus the number of the color, and the foreground with 30
# These are the sequences need to get colored ouput
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def formatter_... | 33.066667 | 107 | 0.635657 | import logging
import time
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def formatter_message(message, use_color=True):
if use_color:
message = message.replace("$RESET", RESET_SEQ).replace("$BOLD", BOLD_SEQ)
e... | true | true |
1c3b101548134ebcc6df1626e2c04c463e13c2e3 | 405 | py | Python | backend/quadrict_30065/wsgi.py | crowdbotics-apps/quadrict-30065 | f214ef8583b95ead2dcb36eb652a60ace7670a3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/quadrict_30065/wsgi.py | crowdbotics-apps/quadrict-30065 | f214ef8583b95ead2dcb36eb652a60ace7670a3b | [
"FTL",
"AML",
"RSA-MD"
] | 13 | 2021-08-30T01:19:08.000Z | 2021-10-05T18:55:12.000Z | backend/quadrict_30065/wsgi.py | crowdbotics-apps/quadrict-30065 | f214ef8583b95ead2dcb36eb652a60ace7670a3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for quadrict_30065 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'quadrict_30065.settings')
application = get_wsgi_application()
| true | true |
1c3b102f0650f6539202d916746b5ca4a49f734e | 4,773 | py | Python | 04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py | hustcxl/tensorflow_cookbook | 26673fe74eb9c9eb0824e2dfdf5ef3090bf09a57 | [
"MIT"
] | 93 | 2018-05-27T08:07:02.000Z | 2022-02-28T11:18:08.000Z | 04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py | tensorzhangzheng/tensorflow_cookbook | 4f57ea4ad79c8111fb29bad3da5d151858c6a050 | [
"MIT"
] | null | null | null | 04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py | tensorzhangzheng/tensorflow_cookbook | 4f57ea4ad79c8111fb29bad3da5d151858c6a050 | [
"MIT"
] | 75 | 2018-06-22T08:02:03.000Z | 2022-03-10T14:38:44.000Z | # Linear Support Vector Machine: Soft Margin
# ----------------------------------
#
# This function shows how to use TensorFlow to
# create a soft margin SVM
#
# We will use the iris data, specifically:
# x1 = Sepal Length
# x2 = Petal Width
# Class 1 : I. setosa
# Class -1: not I. setosa
#
# We know here that x and ... | 29.645963 | 106 | 0.691599 |
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from sklearn import datasets
from tensorflow.python.framework import ops
ops.reset_default_graph()
np.random.seed(7)
tf.set_random_seed(7)
sess = tf.Session()
iris = datasets.load_iris()
x_vals = np.array([[x[0], x[3]] for ... | true | true |
1c3b10e4010c29804569e7af288359aa014a8e66 | 662 | py | Python | sila_cetoni/motioncontrol/axis/sila/axis_service/generated/axissystemcontrolservice/__init__.py | CETONI-Software/sila_cetoni_motioncontrol | d216c7f673eabe9fdba7833fd476330a5b0ef782 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:39:52.000Z | 2022-03-08T13:39:52.000Z | sila_cetoni/motioncontrol/axis/sila/axis_service/generated/axissystemcontrolservice/__init__.py | CETONI-Software/sila_cetoni_motioncontrol | d216c7f673eabe9fdba7833fd476330a5b0ef782 | [
"BSD-3-Clause"
] | null | null | null | sila_cetoni/motioncontrol/axis/sila/axis_service/generated/axissystemcontrolservice/__init__.py | CETONI-Software/sila_cetoni_motioncontrol | d216c7f673eabe9fdba7833fd476330a5b0ef782 | [
"BSD-3-Clause"
] | null | null | null | # Generated by sila2.code_generator; sila2.__version__: 0.8.0
from .axissystemcontrolservice_base import AxisSystemControlServiceBase
from .axissystemcontrolservice_client import AxisSystemControlServiceClient
from .axissystemcontrolservice_feature import AxisSystemControlServiceFeature
from .axissystemcontrolservice_t... | 34.842105 | 77 | 0.833837 |
from .axissystemcontrolservice_base import AxisSystemControlServiceBase
from .axissystemcontrolservice_client import AxisSystemControlServiceClient
from .axissystemcontrolservice_feature import AxisSystemControlServiceFeature
from .axissystemcontrolservice_types import (
ClearFaultState_Responses,
DisableAxisS... | true | true |
1c3b113d2ea69701dba48af5b1f804af8611acd0 | 416 | py | Python | filestorage/migrations/0002_auto_20200618_1223.py | AlexGolovaschenko/OwenAgriculture | 4d393da3736d0a71b1d25b720ed16af38013b682 | [
"Apache-2.0"
] | null | null | null | filestorage/migrations/0002_auto_20200618_1223.py | AlexGolovaschenko/OwenAgriculture | 4d393da3736d0a71b1d25b720ed16af38013b682 | [
"Apache-2.0"
] | 7 | 2021-03-19T03:36:56.000Z | 2022-01-13T02:44:37.000Z | filestorage/migrations/0002_auto_20200618_1223.py | AlexGolovaschenko/OwenAgriculture | 4d393da3736d0a71b1d25b720ed16af38013b682 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-18 09:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filestorage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='file',
name='file',
f... | 21.894737 | 91 | 0.59375 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filestorage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='file',
name='file',
field=models.FileField(upload_to='filestorage/%Y... | true | true |
1c3b11844b45ea5660db5b77a3b02ff5a2712589 | 11,063 | py | Python | numpy/__init__.py | ruppysuppy/numpy | a89f3ebaec7441f4ba5e30eb07206c2a7269778e | [
"BSD-3-Clause"
] | 2 | 2022-02-02T05:40:47.000Z | 2022-03-05T11:04:24.000Z | numpy/__init__.py | ruppysuppy/numpy | a89f3ebaec7441f4ba5e30eb07206c2a7269778e | [
"BSD-3-Clause"
] | null | null | null | numpy/__init__.py | ruppysuppy/numpy | a89f3ebaec7441f4ba5e30eb07206c2a7269778e | [
"BSD-3-Clause"
] | null | null | null | """
NumPy
=====
Provides
1. An array object of arbitrary homogeneous items
2. Fast mathematical operations over arrays
3. Linear Algebra, Fourier Transforms, Random Number Generation
How to use the documentation
----------------------------
Documentation is available in two forms: docstrings provided
with the c... | 35.687097 | 104 | 0.65823 | import sys
import warnings
from ._globals import ModuleDeprecationWarning, VisibleDeprecationWarning
from ._globals import _NoValue
# procedure itself in a reliable manner.
try:
__NUMPY_SETUP__
except NameError:
__NUMPY_SETUP__ = False
if __NUMPY_SETUP__:
sys.stderr.write('Running from numpy source dire... | true | true |
1c3b11e76c61005bee3f7ce49c5ed0618c32d9a9 | 8,309 | py | Python | tests/core/contracts/test_contract_constructor.py | ConnorMac/web3.py | c7fb8c91a93ce82286922440e236721719d50a98 | [
"MIT"
] | null | null | null | tests/core/contracts/test_contract_constructor.py | ConnorMac/web3.py | c7fb8c91a93ce82286922440e236721719d50a98 | [
"MIT"
] | null | null | null | tests/core/contracts/test_contract_constructor.py | ConnorMac/web3.py | c7fb8c91a93ce82286922440e236721719d50a98 | [
"MIT"
] | null | null | null | import pytest
from eth_utils import (
decode_hex,
)
TEST_ADDRESS = '0x16D9983245De15E7A9A73bC586E01FF6E08dE737'
EXPECTED_DATA_A = 1234
EXPECTED_DATA_B = (b'abcd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
def test_contr... | 39.379147 | 96 | 0.736912 | import pytest
from eth_utils import (
decode_hex,
)
TEST_ADDRESS = '0x16D9983245De15E7A9A73bC586E01FF6E08dE737'
EXPECTED_DATA_A = 1234
EXPECTED_DATA_B = (b'abcd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
def test_contr... | true | true |
1c3b11ea2dde509958ffa5d9fd6bbe510a6e9170 | 2,327 | py | Python | autotest/gdrivers/ngsgeoid.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | 1 | 2018-12-19T14:08:20.000Z | 2018-12-19T14:08:20.000Z | autotest/gdrivers/ngsgeoid.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | null | null | null | autotest/gdrivers/ngsgeoid.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | 1 | 2019-11-01T15:17:09.000Z | 2019-11-01T15:17:09.000Z | #!/usr/bin/env pytest
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for NGSGEOID driver.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
##############################################... | 42.309091 | 147 | 0.629996 | true | true | |
1c3b125f2097520071768470165b007e704b4733 | 1,597 | py | Python | package/spack-py-functools32/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-py-functools32/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-py-functools32/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 44.361111 | 89 | 0.678147 | true | true | |
1c3b127d4fb57402793e5f094a3c33d525524685 | 3,950 | py | Python | networkx/algorithms/tree/tests/test_coding.py | ChrisKeefe/networkx | 66cc88193e5be96f866adac2ef4ccdbe55bab335 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T18:55:32.000Z | 2021-12-10T18:55:32.000Z | networkx/algorithms/tree/tests/test_coding.py | Reed-CompBio/networkx | c266c4b29699290333dff5440e3c9e3029ec0341 | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/tree/tests/test_coding.py | Reed-CompBio/networkx | c266c4b29699290333dff5440e3c9e3029ec0341 | [
"BSD-3-Clause"
] | null | null | null | """Unit tests for the :mod:`~networkx.algorithms.tree.coding` module."""
from itertools import product
import pytest
import networkx as nx
from networkx.utils import nodes_equal, edges_equal
class TestPruferSequence:
"""Unit tests for the Prüfer sequence encoding and decoding
functions.
"""
def tes... | 34.955752 | 74 | 0.587342 | from itertools import product
import pytest
import networkx as nx
from networkx.utils import nodes_equal, edges_equal
class TestPruferSequence:
def test_nontree(self):
with pytest.raises(nx.NotATree):
G = nx.cycle_graph(3)
nx.to_prufer_sequence(G)
def test_null_graph(self):
... | true | true |
1c3b1290a5f5a149f55700f326f5cd4656d70e80 | 507 | py | Python | photos/urls.py | Alvin-21/gallery | c121fb50581328cde082459c5adab27df9d57ed6 | [
"Unlicense"
] | null | null | null | photos/urls.py | Alvin-21/gallery | c121fb50581328cde082459c5adab27df9d57ed6 | [
"Unlicense"
] | null | null | null | photos/urls.py | Alvin-21/gallery | c121fb50581328cde082459c5adab27df9d57ed6 | [
"Unlicense"
] | null | null | null | from django.urls import path, re_path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
re_path(r'^$', views.index, name='homepage'),
re_path(r'^image/(\d+)', views.view_image, name='image'),
re_path(r'^categories/', views.search_categories, nam... | 36.214286 | 80 | 0.731755 | from django.urls import path, re_path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
re_path(r'^$', views.index, name='homepage'),
re_path(r'^image/(\d+)', views.view_image, name='image'),
re_path(r'^categories/', views.search_categories, nam... | true | true |
1c3b1312076676887ced2aceae880c7d66ff9ffb | 7,212 | py | Python | scripts/eda_script.py | Sukriti1312/DSCI-522_City_of_A-Stars_310 | 3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad | [
"MIT"
] | null | null | null | scripts/eda_script.py | Sukriti1312/DSCI-522_City_of_A-Stars_310 | 3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad | [
"MIT"
] | 47 | 2020-01-17T00:42:37.000Z | 2020-02-13T00:09:00.000Z | scripts/eda_script.py | Sukriti1312/DSCI-522_City_of_A-Stars_310 | 3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad | [
"MIT"
] | 3 | 2020-01-17T01:22:59.000Z | 2020-01-18T23:42:32.000Z | # author: A. Muhammad
# date: 2020-02-01
'''This script performs EDA on the students performance datasets
for portuguese and math students and outputs necessary tables and
figures to path provided.
Usage: eda_script.py --file_path=<file_path> --results_path=<results_path>
Example:
python scripts/eda_script.py -... | 35.009709 | 106 | 0.57848 |
import pandas as pd
import numpy as np
from docopt import docopt
import altair as alt
import re
import os
opt = docopt(__doc__)
def test_function():
file_path_check = re.match("([A-Za-z]+[.]{1}[A-Za-z]+)", opt["--file_path"])
out_path_check = re.match("([A-Za-z]+[.]{1}[A-Za-z]+)", opt["--results_path"])... | true | true |
1c3b13ee68807c4a9242c0e6b8c68380acb5bdd8 | 4,522 | py | Python | userbot/modules/snips.py | hanuraiga/gabot-3 | 31885f3f1f0c57548fa709f4523818925bf4e2ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-08-12T11:59:48.000Z | 2019-08-12T11:59:48.000Z | userbot/modules/snips.py | arraqueen/userbot | 0e405f2d6b20ceed8e5edd6e77980081d61bc5b7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/snips.py | arraqueen/userbot | 0e405f2d6b20ceed8e5edd6e77980081d61bc5b7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-03-26T10:48:43.000Z | 2020-03-26T10:48:43.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module containing commands for keeping global notes. """
from userbot.events import register
from userbot im... | 35.328125 | 109 | 0.610128 |
from userbot.events import register
from userbot import CMD_HELP, BOTLOG_CHATID
@register(outgoing=True,
pattern=r"\$\w*",
ignore_unsafe=True,
disable_errors=True)
async def on_snip(event):
try:
from userbot.modules.sql_helper.snips_sql import get_snip
except Attribu... | true | true |
1c3b152240d277003e63796921f3238bacc0ddb1 | 109 | py | Python | addmoneyMatt.py | rkelly07/dkekeg | bfface42939c825641d2c5135d91d628ea079ad7 | [
"MIT"
] | null | null | null | addmoneyMatt.py | rkelly07/dkekeg | bfface42939c825641d2c5135d91d628ea079ad7 | [
"MIT"
] | null | null | null | addmoneyMatt.py | rkelly07/dkekeg | bfface42939c825641d2c5135d91d628ea079ad7 | [
"MIT"
] | null | null | null | import DBAccessor
dbaccessor = DBAccessor.DBAccessor()
dbaccessor.updateBalance("172 165 182 203",1000.00)
| 18.166667 | 51 | 0.798165 | import DBAccessor
dbaccessor = DBAccessor.DBAccessor()
dbaccessor.updateBalance("172 165 182 203",1000.00)
| true | true |
1c3b15dce145b18cc68dcfe927d12d0d41f8ac84 | 9,921 | py | Python | piecrust/configuration.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | piecrust/configuration.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | piecrust/configuration.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | import re
import logging
import collections
import collections.abc
import yaml
from yaml.constructor import ConstructorError
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
logger = logging.getLogger(__name__)
default_allowed_types = (dict, list, tuple, float, ... | 30.62037 | 87 | 0.602056 | import re
import logging
import collections
import collections.abc
import yaml
from yaml.constructor import ConstructorError
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
logger = logging.getLogger(__name__)
default_allowed_types = (dict, list, tuple, float, ... | true | true |
1c3b15ea2713c8f46b54b18b22d0365b0ad1f460 | 62,964 | py | Python | sympy/integrals/manualintegrate.py | ricopicone/sympy | de27c97214d540247a35c8215c7920e9a46b54ed | [
"BSD-3-Clause"
] | 2 | 2019-02-05T19:20:24.000Z | 2019-04-23T13:24:38.000Z | sympy/integrals/manualintegrate.py | ricopicone/sympy | de27c97214d540247a35c8215c7920e9a46b54ed | [
"BSD-3-Clause"
] | null | null | null | sympy/integrals/manualintegrate.py | ricopicone/sympy | de27c97214d540247a35c8215c7920e9a46b54ed | [
"BSD-3-Clause"
] | 1 | 2019-10-15T10:55:42.000Z | 2019-10-15T10:55:42.000Z | """Integration method that emulates by-hand techniques.
This module also provides functionality to get the steps used to evaluate a
particular integral, in the ``integral_steps`` function. This will return
nested namedtuples representing the integration rules used. The
``manualintegrate`` function computes the integra... | 37.998793 | 136 | 0.596373 | from __future__ import print_function, division
from collections import namedtuple, defaultdict
import sympy
from sympy.core.compatibility import reduce, Mapping, iterable
from sympy.core.containers import Dict
from sympy.core.logic import fuzzy_not
from sympy.functions.elementary.trigonometric import TrigonometricF... | true | true |
1c3b16400ef2d32f5767944d9dafca6e9323cbf2 | 1,528 | py | Python | vendor/github.com/elastic/beats/metricbeat/scripts/fields_collector.py | PPACI/krakenbeat | e75ec8f006164acb8a57d0c9609bebe534955813 | [
"Apache-2.0"
] | 3 | 2018-01-04T19:15:26.000Z | 2020-02-20T03:35:27.000Z | vendor/github.com/elastic/beats/metricbeat/scripts/fields_collector.py | PPACI/krakenbeat | e75ec8f006164acb8a57d0c9609bebe534955813 | [
"Apache-2.0"
] | null | null | null | vendor/github.com/elastic/beats/metricbeat/scripts/fields_collector.py | PPACI/krakenbeat | e75ec8f006164acb8a57d0c9609bebe534955813 | [
"Apache-2.0"
] | 1 | 2020-10-11T14:57:48.000Z | 2020-10-11T14:57:48.000Z | import os
# Collects fields for all modules and metricset
def collect():
base_dir = "module"
path = os.path.abspath("module")
# yml file
fields_yml = ""
# Iterate over all modules
for module in sorted(os.listdir(base_dir)):
module_fields = path + "/" + module + "/_... | 28.296296 | 91 | 0.522906 | import os
def collect():
base_dir = "module"
path = os.path.abspath("module")
fields_yml = ""
for module in sorted(os.listdir(base_dir)):
module_fields = path + "/" + module + "/_meta/fields.yml"
if os.path.isfile(module_fields) == False:
... | true | true |
1c3b1647485da720eaeab997c19ab32646c50bab | 1,501 | py | Python | main.py | ajp-A/altsniffer | 6a45a4a8b63aaa05610f3414d4fdd5f0bea90f86 | [
"MIT"
] | null | null | null | main.py | ajp-A/altsniffer | 6a45a4a8b63aaa05610f3414d4fdd5f0bea90f86 | [
"MIT"
] | null | null | null | main.py | ajp-A/altsniffer | 6a45a4a8b63aaa05610f3414d4fdd5f0bea90f86 | [
"MIT"
] | null | null | null | import beautifulsoup4 as bs4
import requests as rq
html_site = rq.get("https://www.poxnora.com/trader/listtrades.do?service=trader/listtrades.do")
soup = BeautifulSoup(html_site, 'html.parser')
if __name__ == '__main__':
main()
"""from bs4 import BeautifulSoup
from os import path
from sys import exit
import pan... | 30.02 | 95 | 0.660893 | import beautifulsoup4 as bs4
import requests as rq
html_site = rq.get("https://www.poxnora.com/trader/listtrades.do?service=trader/listtrades.do")
soup = BeautifulSoup(html_site, 'html.parser')
if __name__ == '__main__':
main()
| true | true |
1c3b16c69b0c5704668f2afab4edc623fff685bf | 5,324 | py | Python | tests/index_test.py | DubeySandeep/pending-review-notification | 353fa74d98eeb6c8386818273a2fe02af39d6b9d | [
"Apache-2.0"
] | null | null | null | tests/index_test.py | DubeySandeep/pending-review-notification | 353fa74d98eeb6c8386818273a2fe02af39d6b9d | [
"Apache-2.0"
] | null | null | null | tests/index_test.py | DubeySandeep/pending-review-notification | 353fa74d98eeb6c8386818273a2fe02af39d6b9d | [
"Apache-2.0"
] | 1 | 2021-10-20T16:24:04.000Z | 2021-10-20T16:24:04.000Z | """Unit test for the index.py file."""
import unittest
from datetime import datetime, timedelta, timezone
import json
from unittest.mock import patch, mock_open
import requests_mock
from src import index
from src import github_services
class ModuleIntegerationTest(unittest.TestCase):
"""Integeration test for th... | 35.493333 | 79 | 0.523666 |
import unittest
from datetime import datetime, timedelta, timezone
import json
from unittest.mock import patch, mock_open
import requests_mock
from src import index
from src import github_services
class ModuleIntegerationTest(unittest.TestCase):
def setUp(self):
self.orgName = 'orgName'
self.rep... | true | true |
1c3b16d7582cd20af1931a5780603ab312df1df6 | 5,335 | py | Python | sinergym/utils/evaluation.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 23 | 2021-10-30T15:42:24.000Z | 2022-03-29T13:27:39.000Z | sinergym/utils/evaluation.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 93 | 2021-09-30T09:05:31.000Z | 2022-03-31T18:11:57.000Z | sinergym/utils/evaluation.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 7 | 2021-11-24T10:28:42.000Z | 2022-03-04T14:11:29.000Z | """Custom policy evaluations for Evaluation Callbacks."""
from typing import Any, Callable, Dict, Optional, Union
import gym
import numpy as np
from stable_baselines3.common import base_class
from stable_baselines3.common.vec_env import VecEnv
def evaluate_policy(model: "base_class.BaseAlgorithm",
... | 50.809524 | 141 | 0.56926 |
from typing import Any, Callable, Dict, Optional, Union
import gym
import numpy as np
from stable_baselines3.common import base_class
from stable_baselines3.common.vec_env import VecEnv
def evaluate_policy(model: "base_class.BaseAlgorithm",
env: Union[gym.Env,
VecE... | true | true |
1c3b17069c9737cf2b01ab0b39710f8ac86971f0 | 1,091 | py | Python | src/agents/util/agent_credentials.py | MelleStarke/MAS_B06 | fbedc7459006c0915428f0122d923dd41b57b51e | [
"MIT"
] | null | null | null | src/agents/util/agent_credentials.py | MelleStarke/MAS_B06 | fbedc7459006c0915428f0122d923dd41b57b51e | [
"MIT"
] | null | null | null | src/agents/util/agent_credentials.py | MelleStarke/MAS_B06 | fbedc7459006c0915428f0122d923dd41b57b51e | [
"MIT"
] | null | null | null | sender = ("masb6-sender@01337.io", "sender-pass")
receiver = ("masb6-receiver@01337.io", "receiver-pass")
pra = ("masb6-pra@01337.io", "pra-pass")
kma = ("masb6-kma@01337.io", "kma-pass")
ca = ("masb6-ca@01337.io", "ca-pass")
oaa = ("masb6-oaa@01337.io", "oaa-pass")
ssa = ("masb6-ssa@01337.... | 40.407407 | 100 | 0.55912 | sender = ("masb6-sender@01337.io", "sender-pass")
receiver = ("masb6-receiver@01337.io", "receiver-pass")
pra = ("masb6-pra@01337.io", "pra-pass")
kma = ("masb6-kma@01337.io", "kma-pass")
ca = ("masb6-ca@01337.io", "ca-pass")
oaa = ("masb6-oaa@01337.io", "oaa-pass")
ssa = ("masb6-ssa@01337.... | true | true |
1c3b170fd3f62bce27b92d5cb1ef3d235cf983ae | 454 | py | Python | manage.py | sladebot/traffiko-data | 459d13185057666a2dbee22031e3ecc549ff5e37 | [
"MIT"
] | null | null | null | manage.py | sladebot/traffiko-data | 459d13185057666a2dbee22031e3ecc549ff5e37 | [
"MIT"
] | null | null | null | manage.py | sladebot/traffiko-data | 459d13185057666a2dbee22031e3ecc549ff5e37 | [
"MIT"
] | null | null | null | # This file starts the WSGI web application.
# - Heroku starts gunicorn, which loads Procfile, which starts manage.py
# - Developers can run it from the command line: python runserver.py
from main import manager, server
# Start a development web server, processing extra command line parameters. E.g.:
# - python manag... | 34.923077 | 81 | 0.751101 |
from main import manager, server
if __name__ == "__main__":
manager.add_command("runserver", server)
manager.run()
| true | true |
1c3b1735c55d3fa7f817015dbdaa357c535f0a45 | 5,087 | py | Python | 25_clock_signal.py | KanegaeGabriel/advent-of-code-2016 | 68a46604ebae7d96a196c1fcf2666f1e74ee2999 | [
"MIT"
] | null | null | null | 25_clock_signal.py | KanegaeGabriel/advent-of-code-2016 | 68a46604ebae7d96a196c1fcf2666f1e74ee2999 | [
"MIT"
] | null | null | null | 25_clock_signal.py | KanegaeGabriel/advent-of-code-2016 | 68a46604ebae7d96a196c1fcf2666f1e74ee2999 | [
"MIT"
] | null | null | null | ################################
# --- Day 25: Clock Signal --- #
################################
import AOCUtils
class VM:
def __init__(self, program):
self.program = program[:]
self.pc = 0
self.registers = {"a": 0, "b": 0, "c": 0, "d": 0}
self.lastOutput = 1
self.output... | 42.041322 | 103 | 0.244348 | = self.lastOutput:
break
self.lastOutput = xVal
self.outputLength += 1
if self.outputLength > 100:
self.loops = True
break
self.pc += 1
| true | true |
1c3b196bf441c75de9b48e2bfc9dfd8364686b6a | 2,579 | py | Python | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to u... | 38.492537 | 100 | 0.705312 |
import os
import json
import time
import json_tricks
from ..common import init_logger, env_args
_sysdir = os.environ['NNI_SYS_DIR']
if not os.path.exists(os.path.join(_sysdir, '.nni')):
os.makedirs(os.path.join(_sysdir, '.nni'))
_metric_file = open(os.path.join(_sysdir, '.nni', 'metrics'), 'wb... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.