hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
035d45eb041a8f2b950bda66bdc5693e0f66963a | 1,725 | py | Python | devel/simulate_mcmc_memory_leak_lightcone.py | debanjan-cosmo/21cmFAST | b9f396ea5605440be419b7cf005fc4286ef1fd00 | [
"MIT"
] | 1 | 2022-03-29T20:07:30.000Z | 2022-03-29T20:07:30.000Z | devel/simulate_mcmc_memory_leak_lightcone.py | debanjan-cosmo/21cmFAST | b9f396ea5605440be419b7cf005fc4286ef1fd00 | [
"MIT"
] | null | null | null | devel/simulate_mcmc_memory_leak_lightcone.py | debanjan-cosmo/21cmFAST | b9f396ea5605440be419b7cf005fc4286ef1fd00 | [
"MIT"
] | null | null | null | """Simple script to simulate an MCMC-like routine to check for memory leaks."""
import os
import psutil
import tracemalloc
from py21cmfast import run_lightcone
tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
PROCESS = psutil.Process(os.getpid())
oldmem = 0
def trace_print():
"""Print a trace of memor... | 26.136364 | 96 | 0.586667 | """Simple script to simulate an MCMC-like routine to check for memory leaks."""
import numpy as np
import os
import psutil
import tracemalloc
from py21cmfast import initial_conditions, perturb_field, run_lightcone
tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
PROCESS = psutil.Process(os.getpid())
oldmem ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 22 |
ad72fa5c56092c85b61b042a9e69520b634d6a38 | 2,563 | py | Python | src/gamesbyexample/alphabetizequiz.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 736 | 2018-09-24T10:29:27.000Z | 2022-03-20T21:28:20.000Z | src/gamesbyexample/alphabetizequiz.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 11 | 2019-03-26T06:55:47.000Z | 2021-03-23T03:00:35.000Z | src/gamesbyexample/alphabetizequiz.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 205 | 2018-12-07T11:58:13.000Z | 2022-03-26T02:06:58.000Z | """Alphabetize Quiz, by Al Sweigart al@inventwithpython.com
A time-based quiz game to see how fast you can alphabetize letters.
This and other games are available at https://nostarch.com/XX
Tags: short, game, word"""
__version__ = 0
import time
# Set up the constants:
# (!) Try changing these constants:
QUESTION_SIZE ... | 34.635135 | 72 | 0.65158 | """Alphabetize Quiz, by Al Sweigart al@inventwithpython.com
A time-based quiz game to see how fast you can alphabetize letters.
This and other games are available at https://nostarch.com/XX
Tags: short, game, word"""
__version__ = 0
import random, time
# Set up the constants:
# (!) Try changing these constants:
QUESTI... | 0 | 0 | 0 | 0 | 0 | 1,546 | 0 | 8 | 23 |
e7f99b88e0bfc786bf830a28d11f541f62c5cbbb | 6,053 | py | Python | recordlinkage/datasets/external.py | LuciaBaldassini/recordlinkage | 8892d917caf82131ddce3ad2559570b2a0caca02 | [
"BSD-3-Clause"
] | 641 | 2016-05-03T14:44:55.000Z | 2022-03-29T19:59:42.000Z | recordlinkage/datasets/external.py | LuciaBaldassini/recordlinkage | 8892d917caf82131ddce3ad2559570b2a0caca02 | [
"BSD-3-Clause"
] | 143 | 2015-11-23T10:58:41.000Z | 2022-03-24T00:18:00.000Z | recordlinkage/datasets/external.py | LuciaBaldassini/recordlinkage | 8892d917caf82131ddce3ad2559570b2a0caca02 | [
"BSD-3-Clause"
] | 126 | 2016-09-29T20:04:25.000Z | 2022-03-25T12:52:25.000Z |
# The function get_data_home() and clear_data_home() are based on
# SciKit-Learn https://git.io/fjT70. See the 3-clause BSD license.
from os import environ
import shutil
from pathlib import Path
import pandas
def get_data_home(data_home=None):
"""Return the path of the Record Linkage data folder.
This f... | 31.041026 | 77 | 0.663803 |
# The function get_data_home() and clear_data_home() are based on
# SciKit-Learn https://git.io/fjT70. See the 3-clause BSD license.
from io import BytesIO
from os import environ
import shutil
from pathlib import Path
from urllib.request import urlopen
import zipfile
import pandas
def get_data_home(data_home=No... | 0 | 0 | 0 | 0 | 0 | 1,284 | 0 | 7 | 113 |
da441d0efdd1706e89b0da9e8f9ea0f6b020d8ad | 1,210 | py | Python | validation/cross_validation_predict.py | CS3244-Project/DrQA | b989d146b574208ae5b510070a210dcfc68e2300 | [
"BSD-3-Clause"
] | null | null | null | validation/cross_validation_predict.py | CS3244-Project/DrQA | b989d146b574208ae5b510070a210dcfc68e2300 | [
"BSD-3-Clause"
] | null | null | null | validation/cross_validation_predict.py | CS3244-Project/DrQA | b989d146b574208ae5b510070a210dcfc68e2300 | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
if __name__ == "__main__":
args = sys.argv
cmd = " ".join(args[1:-2])
dataset, model_dir = args[-2], args[-1]
for fold_dir in os.listdir(model_dir):
data_fold_dir = os.path.join(data_dir, fold_dir)
model_fold_dir = os.path.join(model_dir, fold_dir)
try:
predict(model_fold_dir, data_... | 33.611111 | 87 | 0.7 | import sys
import subprocess
import os
def predict(model_fold_dir, data_fold_dir, cmd, verbose=True):
for model_data in os.listdir(model_fold_dir):
m_model = re.match(r".*\.mdl$", model_data)
if m_model:
for data in data_fold_dir:
m_dev = re.match(r".*_dev\.json", data)
if m_dev:
model_path = os.p... | 0 | 0 | 0 | 0 | 0 | 736 | 0 | -4 | 45 |
6197b073e1f10c341e776a87ce5a24c94074d175 | 9,939 | py | Python | src/amuse/ext/evrard_test.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | src/amuse/ext/evrard_test.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | src/amuse/ext/evrard_test.py | rieder/amuse | 3ac3b6b8f922643657279ddee5c8ab3fc0440d5e | [
"Apache-2.0"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z | """
initial conditions for the SPH evrard collapse test
"""
"""
Create an evrard gas sphere with approximately the given number of particles.
Returns a set of particles with equal mass and specific internal energy.
Positions are randomly distributed to fit an evrard gas distribution model
(density propor... | 36.141818 | 110 | 0.621089 | """
initial conditions for the SPH evrard collapse test
"""
import numpy
from math import *
from amuse.units import nbody_system
from amuse.units import units
from amuse.datamodel import Particles
from amuse.datamodel import ParticlesWithUnitsConverted
from amuse.ext.sobol import i4_sobol_generate
class uniform_ra... | 0 | 892 | 0 | 7,244 | 0 | 332 | 0 | 85 | 398 |
6ab6e58ce94c881b144a45f0b7080de6207ea2cb | 1,207 | py | Python | packaging/ansible-runner-service-project/project/roles/ovirt-ova-external-data/callback_plugins/ovaqueryplugin.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 347 | 2015-01-20T14:13:21.000Z | 2022-03-31T17:53:11.000Z | packaging/ansible-runner-service-project/project/roles/ovirt-ova-external-data/callback_plugins/ovaqueryplugin.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 128 | 2015-05-22T19:14:32.000Z | 2022-03-31T08:11:18.000Z | packaging/ansible-runner-service-project/project/roles/ovirt-ova-external-data/callback_plugins/ovaqueryplugin.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 202 | 2015-01-04T06:20:49.000Z | 2022-03-08T15:30:08.000Z | #
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import
__metaclass__ = type
| 28.069767 | 75 | 0.695112 | #
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import
from ansible.plugins.callback import CallbackBase
__metaclass__ = type
class CallbackModule(CallbackBase):
"""
This callback module prints the output of the single task of the
ovirt-ova-external-... | 0 | 0 | 0 | 1,001 | 0 | 0 | 0 | 28 | 46 |
ce3b962b941f24c00176910342cfc1d9e701a1ca | 221 | py | Python | toolbox/geohash/lib/util.py | nziehn/toolbox-geohash | d397a02cbf0932d3a6463dcc47dfc177c8e35033 | [
"MIT"
] | 1 | 2021-11-21T12:31:38.000Z | 2021-11-21T12:31:38.000Z | toolbox/geohash/lib/util.py | nziehn/toolbox-geohash | d397a02cbf0932d3a6463dcc47dfc177c8e35033 | [
"MIT"
] | null | null | null | toolbox/geohash/lib/util.py | nziehn/toolbox-geohash | d397a02cbf0932d3a6463dcc47dfc177c8e35033 | [
"MIT"
] | null | null | null |
EARTH_RADIUS = 6371
| 13.8125 | 53 | 0.61086 | import math as _math
EARTH_RADIUS = 6371
def rad2deg(x):
return x * 360 / (2 * _math.pi)
def deg2rad(x):
return x * 2 * _math.pi / 360
def angle(a, b):
return _math.acos(a.dot(b) / a.length / b.length) | 0 | 0 | 0 | 0 | 0 | 107 | 0 | -1 | 91 |
bd0cdc70c79b9659e73b75d7705d797c5df11c74 | 807 | py | Python | osrm/utils.py | ecotner/osrm-api | 1607a0ccdac0b507b2b892ced78f6af8a7b33a5d | [
"MIT"
] | null | null | null | osrm/utils.py | ecotner/osrm-api | 1607a0ccdac0b507b2b892ced78f6af8a7b33a5d | [
"MIT"
] | null | null | null | osrm/utils.py | ecotner/osrm-api | 1607a0ccdac0b507b2b892ced78f6af8a7b33a5d | [
"MIT"
] | null | null | null | # conversions from other unit to meters
DIST_CONVERSIONS = {
"m": 1.0,
"meter": 1.0,
"km": 1000.0,
"kilometer": 1000.0,
"mi": 1609.34,
"mile": 1609.34,
"foot": 0.3048,
"ft": 0.3048,
}
# conversions from other unit to seconds
TIME_CONVERSIONS = {
"s": 1.0,
"sec": 1.0,
"second... | 20.692308 | 63 | 0.570012 | # conversions from other unit to meters
DIST_CONVERSIONS = {
"m": 1.0,
"meter": 1.0,
"km": 1000.0,
"kilometer": 1000.0,
"mi": 1609.34,
"mile": 1609.34,
"foot": 0.3048,
"ft": 0.3048,
}
# conversions from other unit to seconds
TIME_CONVERSIONS = {
"s": 1.0,
"sec": 1.0,
"second... | 0 | 0 | 0 | 0 | 0 | 217 | 0 | 0 | 46 |
0f9e9c30dbded943ec80a0ca694a28794c032fa0 | 466 | py | Python | expression/forms.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | expression/forms.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | expression/forms.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | from django import forms
from django.forms.models import modelform_factory, ALL_FIELDS
from .models import CuffDiffFile
EXPRESSION_WIDGETS = {'name': forms.TextInput(),
'sample_1': forms.TextInput(),
'sample_2': forms.TextInput()}
cdf_model = modelform_factory(CuffDiffFile,... | 33.285714 | 90 | 0.733906 | from django import forms
from django.forms.models import modelform_factory, ALL_FIELDS
from library.forms import ROFormMixin
from .models import CuffDiffFile
EXPRESSION_WIDGETS = {'name': forms.TextInput(),
'sample_1': forms.TextInput(),
'sample_2': forms.TextInput()}
cdf_... | 0 | 0 | 0 | 37 | 0 | 0 | 0 | 16 | 45 |
719138893722c81f6ce6e738654f05e0542a64bc | 3,019 | py | Python | kisee/identity_provider.py | FGuillet/kisee | 74660c36ed08277639eac5cd904b2e1b188fd148 | [
"MIT"
] | 8 | 2019-03-25T09:26:07.000Z | 2021-12-04T07:05:56.000Z | kisee/identity_provider.py | FGuillet/kisee | 74660c36ed08277639eac5cd904b2e1b188fd148 | [
"MIT"
] | 8 | 2019-07-17T12:24:17.000Z | 2021-07-05T13:16:45.000Z | kisee/identity_provider.py | FGuillet/kisee | 74660c36ed08277639eac5cd904b2e1b188fd148 | [
"MIT"
] | 2 | 2019-07-16T13:45:33.000Z | 2021-04-07T14:22:01.000Z | """Abstract class representing an identity provider
"""
from importlib import import_module
from typing import Type
def import_idp(dotted_path: str) -> Type[IdentityProvider]:
"""Import a dotted module path and return the attribute/class
designated by the last name in the path. Raise ImportError if the
... | 32.815217 | 86 | 0.675389 | """Abstract class representing an identity provider
"""
from abc import ABC, abstractmethod
from importlib import import_module
from typing import AsyncContextManager, Optional, Type
class ProviderError(Exception):
"""Any error raised by an IdentityProvider, like:
"Username too short", "Password too weak", ..... | 0 | 989 | 0 | 1,060 | 0 | 0 | 0 | 45 | 114 |
66eda84772c7b4c5b37a35ad2efb3aee806a5d6d | 2,280 | py | Python | Gem/DelayedFileOutput.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | Gem/DelayedFileOutput.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | Gem/DelayedFileOutput.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2017 Amit Green. All rights reserved.
#
| 24.255319 | 94 | 0.448246 | #
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Gem.DelayedFileOutput')
def gem():
require_gem('Gem.Path')
require_gem('Gem.StringOutput')
from Gem import create_StringOutput
class DelayedFileOutput(Object):
__slots__ = ((
'path', # String... | 0 | 2,197 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
a648489f66c6b63ffb0384451b74fd78e27641a7 | 19,894 | py | Python | FunctionalFeatures.py | DonCammne/OpenSeesPyAssistant | f380f0f2a2f3d1336320bd8d26fa5efe00a12134 | [
"MIT"
] | null | null | null | FunctionalFeatures.py | DonCammne/OpenSeesPyAssistant | f380f0f2a2f3d1336320bd8d26fa5efe00a12134 | [
"MIT"
] | null | null | null | FunctionalFeatures.py | DonCammne/OpenSeesPyAssistant | f380f0f2a2f3d1336320bd8d26fa5efe00a12134 | [
"MIT"
] | null | null | null | """Module with useful functions (discretise curves, ID conventions, etc) \n
Carmine Schipani, 2021
"""
import math
import numpy as np
import matplotlib.pyplot as plt
def ProgressingPercentage(max_iter, i: int, next_step: int, step = 10):
"""
Function that shows the progressing percentage of an iterative process.
... | 41.359667 | 167 | 0.71896 | """Module with useful functions (discretise curves, ID conventions, etc) \n
Carmine Schipani, 2021
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from openseespy.opensees import *
from OpenSeesPyAssistant.ErrorHandling import *
from OpenSeesPyAssistant.Units import *
def ProgressingPercentage(max... | 0 | 0 | 0 | 1,143 | 0 | 899 | 0 | 56 | 112 |
f11dc9bcc2bb08967f6443f0da5ccf5bf353bd99 | 228 | py | Python | fcc/ast/statements/__init__.py | za-creature/fcc | 8d395e1573b8c797a7175ce6efd8037bb5ab785e | [
"Unlicense"
] | 1 | 2015-02-19T16:28:17.000Z | 2015-02-19T16:28:17.000Z | fcc/ast/statements/__init__.py | za-creature/fcc | 8d395e1573b8c797a7175ce6efd8037bb5ab785e | [
"Unlicense"
] | null | null | null | fcc/ast/statements/__init__.py | za-creature/fcc | 8d395e1573b8c797a7175ce6efd8037bb5ab785e | [
"Unlicense"
] | null | null | null | # coding=utf-8
from __future__ import absolute_import, unicode_literals, division
| 32.571429 | 66 | 0.780702 | # coding=utf-8
from __future__ import absolute_import, unicode_literals, division
from fcc.ast.statements.conditional import * # noqa
from fcc.ast.statements.base import * # noqa
from fcc.ast.statements.loop import * # noqa
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 91 |
0a8a81126913cb572c5dbe107d60d3fd2f125526 | 6,044 | py | Python | metropolis/utils/geo.py | mapillary/metropolis_sdk | 4d25e0687d192e1f64707a9474a4b0896e430c01 | [
"Apache-2.0"
] | 8 | 2021-10-20T04:38:14.000Z | 2022-01-31T16:46:48.000Z | metropolis/utils/geo.py | mapillary/metropolis_sdk | 4d25e0687d192e1f64707a9474a4b0896e430c01 | [
"Apache-2.0"
] | 2 | 2021-12-22T01:52:06.000Z | 2022-01-22T08:46:48.000Z | metropolis/utils/geo.py | mapillary/metropolis_sdk | 4d25e0687d192e1f64707a9474a4b0896e430c01 | [
"Apache-2.0"
] | 2 | 2021-10-30T12:51:12.000Z | 2022-02-12T16:00:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This code originally from https://github.com/mapillary/OpenSfM/blob/main/opensfm/geo.py
import numpy as np
WGS84_a = 6378137.0
WGS84_b = 6356752.314245
def ecef_from_lla(lat, lon, alt):
"""
Compute ECEF XYZ from latitude, longitude and altitude.
All ... | 30.525253 | 89 | 0.544838 | # Copyright (c) Facebook, Inc. and its affiliates.
# This code originally from https://github.com/mapillary/OpenSfM/blob/main/opensfm/geo.py
import numpy as np
WGS84_a = 6378137.0
WGS84_b = 6356752.314245
def ecef_from_lla(lat, lon, alt):
"""
Compute ECEF XYZ from latitude, longitude and altitude.
All ... | 0 | 0 | 0 | 725 | 0 | 0 | 0 | 0 | 23 |
4d05592f9528b23541cbc5057dede1cb764f4ad1 | 138 | py | Python | experiments/galileo2/led.py | rbanffy/pingo | b448d5eecae17b82aafd708c2594dae6d4194d84 | [
"MIT"
] | null | null | null | experiments/galileo2/led.py | rbanffy/pingo | b448d5eecae17b82aafd708c2594dae6d4194d84 | [
"MIT"
] | 1 | 2021-03-20T05:17:03.000Z | 2021-03-20T05:17:03.000Z | experiments/galileo2/led.py | rbanffy/pingo | b448d5eecae17b82aafd708c2594dae6d4194d84 | [
"MIT"
] | null | null | null | import pyupm_grove as grove
import time
led = grove.GroveLed(2)
for x in range(0, 5):
led.on()
time.sleep(1)
led.off()
time.sleep(1)
| 13.8 | 27 | 0.688406 | import pyupm_grove as grove
import time
led = grove.GroveLed(2)
for x in range(0, 5):
led.on()
time.sleep(1)
led.off()
time.sleep(1)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
03872dca5b00d2c711e5a2558a46f9029ea25443 | 1,258 | py | Python | dnaSequence/test_returnFirstString.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | 1 | 2021-03-22T20:45:06.000Z | 2021-03-22T20:45:06.000Z | dnaSequence/test_returnFirstString.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | dnaSequence/test_returnFirstString.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | """
Do Not Edit this file. You may and are encouraged to look at it for reference.
"""
import unittest
if __name__ == '__main__':
unittest.main()
| 39.3125 | 117 | 0.710652 | """
Do Not Edit this file. You may and are encouraged to look at it for reference.
"""
import unittest
import dnaSequencing
class TestReturnFirstString(unittest.TestCase):
def test001_returnFirstStringExists(self):
self.assertTrue('returnFirstString' in dir(dnaSequencing),
'Functi... | 0 | 0 | 0 | 1,062 | 0 | 0 | 0 | -1 | 45 |
26a1a3ffb5966b12241a3c8fea99206ae82722e1 | 638 | py | Python | backend/api/services/adminActions.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | b88ca3608e16a1bae72cd7c8cfc212db74d1b2c0 | [
"W3C-20150513"
] | 1 | 2021-04-08T22:02:44.000Z | 2021-04-08T22:02:44.000Z | backend/api/services/adminActions.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | b88ca3608e16a1bae72cd7c8cfc212db74d1b2c0 | [
"W3C-20150513"
] | 79 | 2021-02-06T22:55:52.000Z | 2021-04-15T20:24:56.000Z | backend/api/services/adminActions.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | b88ca3608e16a1bae72cd7c8cfc212db74d1b2c0 | [
"W3C-20150513"
] | 4 | 2021-02-14T15:13:15.000Z | 2021-04-17T06:21:11.000Z |
# models
# move request info to Author table with generated url
# args
# ModelAdmin
# request
# queryset (selected requests)
# return
# None
accept_signup_request.short_description = "allow them to be on server" | 30.380952 | 144 | 0.710031 | from django.contrib.auth.hashers import make_password
# models
from ..models.author import Author
# move request info to Author table with generated url
# args
# ModelAdmin
# request
# queryset (selected requests)
# return
# None
def accept_signup_request(ModelAdmin, request, queryset):
f... | 0 | 0 | 0 | 0 | 0 | 288 | 0 | 45 | 66 |
fae213509880025593ebe56bdae7f1fb69c9cecd | 1,544 | py | Python | Adabas/demo/stck1.py | flavio-casacurta/Nat2Py | fdbff807e436628b49710f65d12cc108fb824b7f | [
"MIT"
] | 1 | 2021-05-09T11:43:20.000Z | 2021-05-09T11:43:20.000Z | Adabas/demo/stck1.py | flavio-casacurta/Nat2Py | fdbff807e436628b49710f65d12cc108fb824b7f | [
"MIT"
] | 1 | 2021-09-14T07:27:08.000Z | 2021-09-15T16:50:17.000Z | Adabas/demo/stck1.py | flavio-casacurta/Nat2Py | fdbff807e436628b49710f65d12cc108fb824b7f | [
"MIT"
] | 2 | 2019-11-04T18:36:34.000Z | 2021-04-25T12:45:52.000Z | """stck1.py - Demo of stck module
stck.py does IBM/390 and other timestamp conversions
$Date: 2008-09-01 14:51:03 +0200 (Mon, 01 Sep 2008) $
$Rev: 81 $
"""
# Copyright 2004-2008 Software AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | 25.311475 | 75 | 0.73057 | """stck1.py - Demo of stck module
stck.py does IBM/390 and other timestamp conversions
$Date: 2008-09-01 14:51:03 +0200 (Mon, 01 Sep 2008) $
$Rev: 81 $
"""
# Copyright 2004-2008 Software AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 23 |
c86c46b7117a14fa94dfd05918ae65b5ea5e2cab | 9,508 | py | Python | q_learning_algorithm/snake.py | anzemur/smart-snake | 67c1e3708f18d0d59c4f1a1385b32de4f9adfa0e | [
"MIT"
] | 7 | 2019-01-08T18:33:49.000Z | 2021-11-10T19:42:50.000Z | q_learning_algorithm/snake.py | anzemur/smart-snake | 67c1e3708f18d0d59c4f1a1385b32de4f9adfa0e | [
"MIT"
] | null | null | null | q_learning_algorithm/snake.py | anzemur/smart-snake | 67c1e3708f18d0d59c4f1a1385b32de4f9adfa0e | [
"MIT"
] | 2 | 2019-01-08T18:34:23.000Z | 2022-03-22T12:18:57.000Z | # The base game is written with the help of Python Tutorials: https://pythonspot.com/snake-with-pygame/
from snake_agent import snakeAgent
WINDOW_W = 880
WINDOW_H = 880
HUMAN = 0
AGENT_Q = 1
NEURAL_NETWORK = 2
if __name__ == "__main__" :
agent = snakeAgent()
theApp = App()
theApp.on_execute() | 29.076453 | 170 | 0.511885 | # The base game is written with the help of Python Tutorials: https://pythonspot.com/snake-with-pygame/
from pygame.locals import *
from random import randint
from snake_agent import snakeAgent
import pygame
import time
WINDOW_W = 880
WINDOW_H = 880
HUMAN = 0
AGENT_Q = 1
NEURAL_NETWORK = 2
class Apple:
x = 0
... | 0 | 0 | 0 | 9,015 | 0 | 0 | 0 | -7 | 185 |
833aef2e110d64785ab59e5a8044de396fbc1bf6 | 456 | py | Python | writeups/2020/utctf/nittaku-3-star-premium/solve.py | welchbj/ctf | fd4e2cea692b134163cc9bd66c2b4796bdefed8c | [
"MIT"
] | 65 | 2019-10-07T01:29:16.000Z | 2022-03-18T14:20:40.000Z | writeups/2020/utctf/nittaku-3-star-premium/solve.py | welchbj/ctf | fd4e2cea692b134163cc9bd66c2b4796bdefed8c | [
"MIT"
] | null | null | null | writeups/2020/utctf/nittaku-3-star-premium/solve.py | welchbj/ctf | fd4e2cea692b134163cc9bd66c2b4796bdefed8c | [
"MIT"
] | 12 | 2020-05-04T01:16:53.000Z | 2022-01-02T14:33:41.000Z | #!/usr/bin/env python3
TARGET = '3.88.183.122'
NULL_DATA = b'\x00' * 48
data = b''
i = 1
while True:
pkt = IP(
dst=TARGET
) / ICMP(
type='echo-request',
id=0x1337,
seq=i
) / NULL_DATA
resp = sr1(pkt)
resp_data = resp[Raw].load.rstrip(b'\n\x00')
if not resp_dat... | 15.2 | 48 | 0.532895 | #!/usr/bin/env python3
from scapy.all import *
TARGET = '3.88.183.122'
NULL_DATA = b'\x00' * 48
data = b''
i = 1
while True:
pkt = IP(
dst=TARGET
) / ICMP(
type='echo-request',
id=0x1337,
seq=i
) / NULL_DATA
resp = sr1(pkt)
resp_data = resp[Raw].load.rstrip(b'\n\x... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 23 |
09ecde831e2c87e8caf9daf0e5b2cf3babfdc3ce | 190 | py | Python | unileaks/task6.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | unileaks/task6.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | unileaks/task6.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | #
assert mutated_string('asd', 'dsa') == True | 31.666667 | 58 | 0.757895 | # Определить является ли одна строка перестановкой другой
def mutated_string(original, mutated):
return sorted(original) == sorted(mutated)
assert mutated_string('asd', 'dsa') == True | 98 | 0 | 0 | 0 | 0 | 64 | 0 | 0 | 23 |
dbfb2565f073ee8c0d15dff0fb86d5ab4cbfb200 | 14,746 | py | Python | generative_try/Fractal/fractal_utils.py | pascal-winter/generative-try | c65aa7a9a67c7c86743023cc894e3b139a984ce0 | [
"MIT"
] | null | null | null | generative_try/Fractal/fractal_utils.py | pascal-winter/generative-try | c65aa7a9a67c7c86743023cc894e3b139a984ce0 | [
"MIT"
] | null | null | null | generative_try/Fractal/fractal_utils.py | pascal-winter/generative-try | c65aa7a9a67c7c86743023cc894e3b139a984ce0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: d0t451
@date: 2019/4/17
@desc: fractal utils
"""
import math
import os
import cv2 as cv
import numpy as np
#
def screen_coordinate_to_fx_coordinate(screen_x, screen_y, screen_width, screen_height, fx_short_axis_length=4):
"""
:param screen_x:
:para... | 32.988814 | 136 | 0.625186 | # -*- coding: utf-8 -*-
"""
@author: d0t451
@date: 2019/4/17
@desc: fractal utils
"""
import math
import os
import time
from functools import wraps
import cv2 as cv
import numpy as np
# 用时装饰器
def decorator_used_time(f):
@wraps(f)
def wrapped_function(*args, **kwargs):
start = time.perf_co... | 1,671 | 5,972 | 0 | 0 | 0 | 1,390 | 0 | -4 | 314 |
1eab70c6747da20c54cc740c68da0f94b4bb992f | 3,974 | py | Python | yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py | FedericoRessi/yardstick | 8f30859f699f3476512b1184ac343d20c50a138b | [
"Apache-2.0"
] | null | null | null | yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py | FedericoRessi/yardstick | 8f30859f699f3476512b1184ac343d20c50a138b | [
"Apache-2.0"
] | null | null | null | yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py | FedericoRessi/yardstick | 8f30859f699f3476512b1184ac343d20c50a138b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# 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 app... | 43.195652 | 75 | 0.621792 | # Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# 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 app... | 0 | 0 | 0 | 3,087 | 0 | 0 | 0 | 48 | 68 |
f88220fbf29facfbdcb649059126d6f156360fb7 | 10,255 | py | Python | airflow/utils.py | isabella232/Airflow-1 | c926783bcad5ab1470d95e5ab392c6f3e71765b9 | [
"Apache-2.0"
] | 1 | 2019-05-29T02:41:42.000Z | 2019-05-29T02:41:42.000Z | airflow/utils.py | lyft/Airflow | c926783bcad5ab1470d95e5ab392c6f3e71765b9 | [
"Apache-2.0"
] | 1 | 2021-02-23T23:00:39.000Z | 2021-02-23T23:00:39.000Z | airflow/utils.py | isabella232/Airflow-1 | c926783bcad5ab1470d95e5ab392c6f3e71765b9 | [
"Apache-2.0"
] | 2 | 2018-08-31T06:39:31.000Z | 2020-12-19T10:28:17.000Z | from datetime import datetime
import imp
import logging
import os
from airflow import settings
def resetdb():
'''
Clear out the database
'''
from airflow import models
logging.info("Dropping tables that exist")
models.Base.metadata.drop_all(settings.engine)
initdb()
def json_ser(ob... | 30.703593 | 79 | 0.618918 | from copy import copy
from datetime import datetime, timedelta
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from functools import wraps
import imp
import inspect
import logging
import os
import re
import smtplib
from sqlalchemy import event, exc
from sqlalchemy.pool import Pool
... | 0 | 2,088 | 0 | 534 | 0 | 4,636 | 0 | 71 | 481 |
0cfce688dff5b06a1c78794999189df0424d4a84 | 1,948 | py | Python | main.py | fourjr/random-paragraph-generator | a3c5281eaa95ea860ad8ad4561928ada0c1d40ec | [
"Unlicense"
] | 1 | 2020-08-11T16:33:00.000Z | 2020-08-11T16:33:00.000Z | main.py | fourjr/random-paragraph-generator | a3c5281eaa95ea860ad8ad4561928ada0c1d40ec | [
"Unlicense"
] | null | null | null | main.py | fourjr/random-paragraph-generator | a3c5281eaa95ea860ad8ad4561928ada0c1d40ec | [
"Unlicense"
] | null | null | null | import math
import random
import string
import sys
try:
LIMIT = int(sys.argv[1])
except IndexError:
LIMIT = 200
except ValueError as e:
raise RuntimeError('invalid number') from e
with open('wordlist.txt', encoding='utf8') as f:
words = f.read().splitlines()
for i in words:
if any(j in i for j i... | 26.324324 | 94 | 0.549281 | import math
import random
import string
import sys
try:
LIMIT = int(sys.argv[1])
except IndexError:
LIMIT = 200
except ValueError as e:
raise RuntimeError('invalid number') from e
with open('wordlist.txt', encoding='utf8') as f:
words = f.read().splitlines()
for i in words:
if any(j in i for j i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ac0a5cd9048c852c44e9a1507c14330310989e3 | 1,161 | py | Python | config.example.py | Fy-/FyPress | be357134969797f92b94db77c9e3aa863c0094fe | [
"MIT"
] | 70 | 2016-06-07T10:17:02.000Z | 2021-06-23T05:36:03.000Z | config.example.py | Fy-/FyPress | be357134969797f92b94db77c9e3aa863c0094fe | [
"MIT"
] | 10 | 2016-06-24T08:17:54.000Z | 2020-07-24T07:34:39.000Z | config.example.py | Fy-/FyPress | be357134969797f92b94db77c9e3aa863c0094fe | [
"MIT"
] | 15 | 2016-06-16T20:40:55.000Z | 2019-08-06T02:45:52.000Z | # -*- coding: UTF-8 -*-
import os
del os
| 21.109091 | 61 | 0.524548 | # -*- coding: UTF-8 -*-
import os
class Config(object):
### BASE ###
BASE_DIR = os.path.dirname(__file__)
### KEYS ###
CSRF_SESSION_KEY = "secretkeylol"
### CSRF ###
CSRF_ENABLED = True
SECRET_KEY = "secretkeygglol"
### Folders ###
THEME_FOLDER = os.path.join(BAS... | 0 | 0 | 0 | 1,061 | 0 | 0 | 0 | 0 | 50 |
1a3df2ec4e2d8b6f416e186b6f9358b31cb5e725 | 26,044 | py | Python | Fusion/VGmesh/VGmesh.py | hueyke/VGmesh | f92ac7aabecb4e81e4be1b1eb13a49153de8f857 | [
"MIT"
] | null | null | null | Fusion/VGmesh/VGmesh.py | hueyke/VGmesh | f92ac7aabecb4e81e4be1b1eb13a49153de8f857 | [
"MIT"
] | null | null | null | Fusion/VGmesh/VGmesh.py | hueyke/VGmesh | f92ac7aabecb4e81e4be1b1eb13a49153de8f857 | [
"MIT"
] | null | null | null | #Author-Chun-Yu Ke
#Description-Creates a VGmesh component.
import adsk.core, adsk.fusion, adsk.cam
# Globals
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
_units = 'mm'
# Command inputs
_deltaAngle = adsk.core.DropDownCommandInput.cast(None)
_outerRadius = adsk.core.ValueCommandIn... | 45.611208 | 177 | 0.623637 | #Author-Chun-Yu Ke
#Description-Creates a VGmesh component.
import adsk.core, adsk.fusion, adsk.cam, traceback
import math
import time
# Globals
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
_units = 'mm'
# Command inputs
_deltaAngle = adsk.core.DropDownCommandInput.cast(None)
_out... | 0 | 0 | 0 | 11,126 | 0 | 13,193 | 0 | -9 | 267 |
b90ce3285a6af7ccfc0a59fb4f682b60b14708a2 | 2,493 | py | Python | update-toolchain.py | henrique-morbin-ifood/swift-syntax | edb79cf1e98919263e1011c1619d2283767ef2c6 | [
"Apache-2.0"
] | null | null | null | update-toolchain.py | henrique-morbin-ifood/swift-syntax | edb79cf1e98919263e1011c1619d2283767ef2c6 | [
"Apache-2.0"
] | 1 | 2019-08-07T20:57:33.000Z | 2019-08-07T20:57:33.000Z | update-toolchain.py | akkyie/swift-syntax | edb79cf1e98919263e1011c1619d2283767ef2c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import os
BUILD_SCRIPT = os.path.dirname(os.path.abspath(__file__)) + '/build-script.py'
if __name__ == '__main__':
main()
| 31.556962 | 79 | 0.683915 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import tempfile
import errno
import platform
import shutil
BUILD_SCRIPT = os.path.dirname(os.path.abspath(__file__)) + '/build-script.py'
def printerr(message):
print(message, file=sys.stderr)
def ... | 0 | 0 | 0 | 0 | 0 | 2,015 | 0 | -50 | 339 |
dda50aa63d70264e3cdcaaa7ed141fbfef027c2b | 1,926 | py | Python | youtube_api/youtube_api_utils.py | richardARPANET/youtube-data-api | 73ff31ab6f7819debb8b8bf8259db1d8ae00b13a | [
"MIT"
] | null | null | null | youtube_api/youtube_api_utils.py | richardARPANET/youtube-data-api | 73ff31ab6f7819debb8b8bf8259db1d8ae00b13a | [
"MIT"
] | null | null | null | youtube_api/youtube_api_utils.py | richardARPANET/youtube-data-api | 73ff31ab6f7819debb8b8bf8259db1d8ae00b13a | [
"MIT"
] | 1 | 2021-06-23T02:20:38.000Z | 2021-06-23T02:20:38.000Z | import json
import datetime
'''
This contains utilities used by other functions in the YoutubeDataApi class, as well as a few convenience functions for data analysis.
'''
__all__ = [
'_chunker',
'_load_response',
'parse_yt_datetime',
'get_upload_playlist_id',
'get_liked_playlist_id',
]
def _load_... | 25.342105 | 134 | 0.681724 | import sys
import json
import datetime
import requests
import re
import signal
from urllib.parse import urlparse
from urllib.parse import parse_qs
'''
This contains utilities used by other functions in the YoutubeDataApi class, as well as a few convenience functions for data analysis.
'''
__all__ = [
'_chunker',... | 0 | 0 | 0 | 428 | 143 | 0 | 0 | -13 | 202 |
ae2c41222fde5b863f43cd18486672d8240f77ae | 1,795 | py | Python | hashbrowns/_random/__init__.py | dezmondgoff/hashbrowns | 271ca022b2e0aa230fa4bf1d98437599cdbe4c83 | [
"MIT"
] | null | null | null | hashbrowns/_random/__init__.py | dezmondgoff/hashbrowns | 271ca022b2e0aa230fa4bf1d98437599cdbe4c83 | [
"MIT"
] | 1 | 2020-02-12T18:56:03.000Z | 2020-02-12T18:56:03.000Z | hashbrowns/_random/__init__.py | dezmondgoff/hashbrowns | 271ca022b2e0aa230fa4bf1d98437599cdbe4c83 | [
"MIT"
] | 1 | 2020-02-12T18:35:50.000Z | 2020-02-12T18:35:50.000Z | """
================================
Random Number Generators for LSH
================================
==============================================================================
Utility functions
==============================================================================
sample_indices Sets of uniformly d... | 38.191489 | 99 | 0.533148 | """
================================
Random Number Generators for LSH
================================
==============================================================================
Utility functions
==============================================================================
sample_indices Sets of uniformly d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 74 |
92cf5679a1bdc3db3666fb0c49ba81116f127992 | 731 | py | Python | src/python/Problem078.py | mchrzanowski/ProjectEuler | 06a24cadbd2c38fb42c3935779fc7ffb6de4e1b5 | [
"MIT"
] | null | null | null | src/python/Problem078.py | mchrzanowski/ProjectEuler | 06a24cadbd2c38fb42c3935779fc7ffb6de4e1b5 | [
"MIT"
] | null | null | null | src/python/Problem078.py | mchrzanowski/ProjectEuler | 06a24cadbd2c38fb42c3935779fc7ffb6de4e1b5 | [
"MIT"
] | null | null | null | '''
Created on Feb 24, 2012
@author: mchrzanowski
'''
from time import time
SUM_LIMIT = 10 ** 6
LIMIT = 6 * 10 ** 4 # found through trial and error
if __name__ == '__main__':
start = time()
main()
end = time()
print "Runtime:", end - start, "seconds." | 21.5 | 91 | 0.521204 | '''
Created on Feb 24, 2012
@author: mchrzanowski
'''
from time import time
SUM_LIMIT = 10 ** 6
LIMIT = 6 * 10 ** 4 # found through trial and error
def main():
numberOfWays = [0 for i in xrange(LIMIT + 1)]
numberOfWays[0] = 1 # start it off
solution = 0
for i in xrange(1, LIMI... | 0 | 0 | 0 | 0 | 0 | 433 | 0 | 0 | 23 |
bcbc7c6ac9820a6f4f7ce5a285951215e6b5f234 | 14,394 | py | Python | Ssense.py | McGuire00/Ssense | b7a6cf639d78c7683caf8635a5fd935146d61eb7 | [
"MIT"
] | 7 | 2021-03-21T09:12:33.000Z | 2022-01-08T02:06:13.000Z | Ssense.py | McGuire00/Ssense | b7a6cf639d78c7683caf8635a5fd935146d61eb7 | [
"MIT"
] | 6 | 2021-03-18T21:16:05.000Z | 2021-09-04T02:49:23.000Z | Ssense.py | McGuire00/Ssense | b7a6cf639d78c7683caf8635a5fd935146d61eb7 | [
"MIT"
] | 1 | 2021-03-18T13:46:11.000Z | 2021-03-18T13:46:11.000Z | import random
# Hard code checkout details at the bottom
# must have Ssense account
# clear cart before running bot otherwise you will get an error
# account may get flagged if ran too many times
# only works with shoes so far
# memberBlockedContactSsense response on checkout means Ssense blocked your account
size... | 47.820598 | 235 | 0.541476 | import requests
from bs4 import BeautifulSoup as bs
from datetime import datetime
import json
import sys
import time
import random
# Hard code checkout details at the bottom
# must have Ssense account
# clear cart before running bot otherwise you will get an error
# account may get flagged if ran too many times
# onl... | 0 | 0 | 0 | 13,278 | 0 | 109 | 0 | -15 | 178 |
c9eb9e164b0e8513600209a32259083aea6175ff | 8,192 | py | Python | cloudpassage/scan.py | joshuaguite/cloudpassage-halo-python-sdk | ab8775377c9e99ed89d335ee44a92553fce49eb7 | [
"BSD-3-Clause"
] | null | null | null | cloudpassage/scan.py | joshuaguite/cloudpassage-halo-python-sdk | ab8775377c9e99ed89d335ee44a92553fce49eb7 | [
"BSD-3-Clause"
] | null | null | null | cloudpassage/scan.py | joshuaguite/cloudpassage-halo-python-sdk | ab8775377c9e99ed89d335ee44a92553fce49eb7 | [
"BSD-3-Clause"
] | null | null | null | """Scan and CveException classes"""
import cloudpassage.sanity as sanity
| 35.008547 | 79 | 0.58252 | """Scan and CveException classes"""
import cloudpassage.sanity as sanity
from .utility import Utility as utility
from .exceptions import CloudPassageValidation
from .http_helper import HttpHelper
class Scan(object):
"""Initializing the Scan class:
Args:
session (:class:`cloudpassage.HaloSession`): T... | 0 | 0 | 0 | 7,971 | 0 | 0 | 0 | 57 | 89 |
c96abfa4dab42d4fd05a8ab73bf4a0fb7e2e2d68 | 949 | py | Python | emp_ide/ide.py | EasyMicroPython/EMP-IDE-OFFLINE | 65a3592ce21a54ff0145e3177d692d0baae7c2c5 | [
"MIT"
] | 6 | 2019-02-12T07:17:09.000Z | 2021-06-28T13:41:51.000Z | emp_ide/ide.py | EasyMicroPython/EMP-IDE-OFFLINE | 65a3592ce21a54ff0145e3177d692d0baae7c2c5 | [
"MIT"
] | 4 | 2019-04-09T14:20:19.000Z | 2021-05-27T13:51:56.000Z | emp_ide/ide.py | EasyMicroPython/EMP-IDE-OFFLINE | 65a3592ce21a54ff0145e3177d692d0baae7c2c5 | [
"MIT"
] | 2 | 2020-01-09T10:45:19.000Z | 2021-01-13T07:41:47.000Z | from flask import Flask
app = Flask(__name__, static_folder='static')
if __name__ == '__main__':
main()
| 21.568182 | 100 | 0.651212 | from flask import Flask
from flask import render_template
from flask import url_for
import threading
import sys
import os
import webbrowser
import time
import fire
app = Flask(__name__, static_folder='static')
@app.route('/')
def index():
return render_template('index.html')
def wsb(device, port):
time.sle... | 0 | 48 | 0 | 0 | 0 | 554 | 0 | -36 | 268 |
a625e750c62ffcc0ac5619572d404058a14e3316 | 447 | py | Python | src/pyplayer/sleepmanager.py | jaquielajoie/pyplayer | 6e8c2f4450ca671f6c6a19a9eb234756603e351f | [
"Apache-2.0"
] | 1 | 2021-07-19T01:28:37.000Z | 2021-07-19T01:28:37.000Z | src/pyplayer/sleepmanager.py | jaquielajoie/pyplayer | 6e8c2f4450ca671f6c6a19a9eb234756603e351f | [
"Apache-2.0"
] | null | null | null | src/pyplayer/sleepmanager.py | jaquielajoie/pyplayer | 6e8c2f4450ca671f6c6a19a9eb234756603e351f | [
"Apache-2.0"
] | null | null | null | """
==========================================
Title: PyPlayer SleepManager
Author: @jaquielajoie
Date: 17 July 2021
Liscence: Apache 2.0
==========================================
"""
"""
SleepManager is a child of MarkovPlayer
This class quantizes sleep times according to BPM
"""
| 18.625 | 52 | 0.543624 | """
==========================================
Title: PyPlayer SleepManager
Author: @jaquielajoie
Date: 17 July 2021
Liscence: Apache 2.0
==========================================
"""
import time
"""
SleepManager is a child of MarkovPlayer
This class quantizes sleep times according to BPM
"""
class SleepM... | 0 | 0 | 0 | 117 | 0 | 0 | 0 | -10 | 46 |
703bec93b889cccbec86b4c869833afa5b2fadc6 | 2,834 | py | Python | videocapture.py | colanicy/opencvforpython-example | e61e499f5bdb0c406acecc8e4eb4ea9864ff06ff | [
"MIT"
] | 1 | 2017-09-25T03:02:50.000Z | 2017-09-25T03:02:50.000Z | videocapture.py | colanicy/opencvforpython-example | e61e499f5bdb0c406acecc8e4eb4ea9864ff06ff | [
"MIT"
] | null | null | null | videocapture.py | colanicy/opencvforpython-example | e61e499f5bdb0c406acecc8e4eb4ea9864ff06ff | [
"MIT"
] | null | null | null | #-*-coding:utf-8-*-
import cv2
import matplotlib.pyplot as plt
import sys
import copy
camID = 0
capture = cv2.VideoCapture(camID)
cv2.namedWindow("camera",1)
#set FRAME_WIDTH,FRAME_HEIGHT
'''
43
43
videocaptureset
videocapture640480
'''
print capture.set(3,640)
print capture.set(4,480)
if n... | 35.873418 | 130 | 0.761468 | #-*-coding:utf-8-*-
import cv2
import matplotlib.pyplot as plt
import sys
import copy
camID = 0
capture = cv2.VideoCapture(camID)
cv2.namedWindow("camera",1)
#set FRAME_WIDTH,FRAME_HEIGHT
'''
设置摄像机分辨率的问题。
最小分辨率,宽度为4,高度为3。
以此类推应该为4的倍数或3的倍数。
你可以通过videocapture成员函数set来设置,摄像机的分辨率。
videocapture默认的情况下为64... | 224 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
02067fb90b31e75634b574bc25725b26b585b4a4 | 1,946 | py | Python | lollipop/type_registry.py | maximkulkin/zephyr | 7ee5a4f88ef24314912b5a03136b0bf9772713bb | [
"MIT"
] | 36 | 2016-07-31T16:23:55.000Z | 2021-11-28T01:36:19.000Z | lollipop/type_registry.py | maximkulkin/lollipop | 7ee5a4f88ef24314912b5a03136b0bf9772713bb | [
"MIT"
] | 17 | 2016-07-28T23:58:31.000Z | 2022-01-15T06:26:18.000Z | lollipop/type_registry.py | maximkulkin/zephyr | 7ee5a4f88ef24314912b5a03136b0bf9772713bb | [
"MIT"
] | 11 | 2016-08-01T20:21:30.000Z | 2022-01-15T06:14:52.000Z |
__all__ = [
'TypeRegistry',
]
| 27.027778 | 80 | 0.605858 | from lollipop.types import Type
__all__ = [
'TypeRegistry',
]
class TypeRef(Type):
def __init__(self, get_type):
super(TypeRef, self).__init__()
self._get_type = get_type
self._inner_type = None
@property
def inner_type(self):
if self._inner_type is None:
... | 0 | 131 | 0 | 1,699 | 0 | 0 | 0 | 10 | 68 |
b72234f61a6254bb6e6b5052bfc8780bde2305e1 | 9,543 | py | Python | Lib/site-packages/pandas_ml/skaccessors/metrics.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pandas_ml/skaccessors/metrics.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pandas_ml/skaccessors/metrics.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python
from pandas_ml.core.accessor import (_attach_methods, _wrap_target_pred_func, _wrap_target_pred_noargs)
import pandas_ml.util as util
# y_true and y_pred
_classification_methods = ['accuracy_score', 'classification_report',
'hamming_loss', 'jaccard_similarity_score',... | 35.608209 | 99 | 0.580949 | #!/usr/bin/env python
from pandas_ml.core.accessor import (_AccessorMethods, _attach_methods,
_wrap_target_pred_func,
_wrap_target_pred_noargs)
import pandas_ml.util as util
class MetricsMethods(_AccessorMethods):
"""
Accessor to ``skl... | 0 | 76 | 0 | 8,099 | 0 | 0 | 0 | 92 | 23 |
30edfb09bf859886d5b7492a09c3555a9ff3f322 | 1,744 | py | Python | evaluation/fid/fid_example.py | pedroryzewski/TCC | ba5167928d5a14dc0c6e144d0927c050090950a6 | [
"MIT"
] | null | null | null | evaluation/fid/fid_example.py | pedroryzewski/TCC | ba5167928d5a14dc0c6e144d0927c050090950a6 | [
"MIT"
] | null | null | null | evaluation/fid/fid_example.py | pedroryzewski/TCC | ba5167928d5a14dc0c6e144d0927c050090950a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import numpy as np
import fid
import tensorflow as tf
import h5py
import json
tf.app.flags.DEFINE_string('image_folder','',"""Path where to load the images """)
tf.app.flags.DEFI... | 37.913043 | 143 | 0.756881 | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import os
import glob
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import numpy as np
import fid
from scipy.misc import imread
import tensorflow as tf
import h5py
import json
tf.app.flags.DEFINE_string('image_folder','',"""Path where... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 44 |
6cf006ed74e035d8d00158c75a607dd20f9489ab | 828 | py | Python | HackerRank/surfaceArea.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | HackerRank/surfaceArea.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | HackerRank/surfaceArea.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null |
grid = [[1,3,4], [2,2,3], [1,2,4]]
print(surfaceArea(grid))
| 33.12 | 91 | 0.595411 | def surfaceArea(A):
totalSurfaceArea = 0
for i in range(0, len(A)):
for j in range(0, len(A[0])):
totalSurfaceArea += 2
totalSurfaceArea += getSurroundingSurfaceArea(i, j, A)
return totalSurfaceArea
def getSurroundingSurfaceArea(i, j, A):
surroundingarea = 0
curr... | 0 | 0 | 0 | 0 | 0 | 721 | 0 | 0 | 45 |
2accee33aa379745ea1d0d32ff48cc9cd5834dd6 | 218 | py | Python | pin_passcode/urls.py | mbi/django-pin-passcode | d4ed4d95dd53906b2d95c789f7acbf2eb8f3c95f | [
"MIT"
] | 1 | 2015-02-17T22:40:36.000Z | 2015-02-17T22:40:36.000Z | pin_passcode/urls.py | mbi/django-pin-passcode | d4ed4d95dd53906b2d95c789f7acbf2eb8f3c95f | [
"MIT"
] | null | null | null | pin_passcode/urls.py | mbi/django-pin-passcode | d4ed4d95dd53906b2d95c789f7acbf2eb8f3c95f | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
url(r'pin/$', 'pin_passcode.views.form', name='pin_form'),
url(r'pin/auth$', 'pin_passcode.views.auth', name='pin_auth'),
)
| 24.222222 | 66 | 0.665138 | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'pin/$', 'pin_passcode.views.form', name='pin_form'),
url(r'pin/auth$', 'pin_passcode.views.auth', name='pin_auth'),
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
afd606faed38ebbbfad17f65a6cf299fd5616dcd | 1,097 | py | Python | tests/fahrenheit_from_test.py | deepspaceghost/deme | 324741ee8e6ef30de5116f6018966829302796ed | [
"MIT"
] | null | null | null | tests/fahrenheit_from_test.py | deepspaceghost/deme | 324741ee8e6ef30de5116f6018966829302796ed | [
"MIT"
] | 6 | 2021-07-09T16:56:28.000Z | 2022-03-12T00:58:06.000Z | tests/fahrenheit_from_test.py | deepspaceghost/demeter.py | 324741ee8e6ef30de5116f6018966829302796ed | [
"MIT"
] | 1 | 2021-06-01T23:49:44.000Z | 2021-06-01T23:49:44.000Z | def fahrenheit_from(celsius: int):
"""
This function takes the celsius, multiplies, divides, and adds to
convert it to fahrenheit, rounds the number to digits, and sends the
final number as a string.
"""
fahrenheit = float(celsius) * 9 / 5 + 32
fahrenheit = round(fahrenheit, 3)
... | 26.756098 | 73 | 0.642662 | def fahrenheit_from(celsius: int):
"""
This function takes the celsius, multiplies, divides, and adds to
convert it to fahrenheit, rounds the number to digits, and sends the
final number as a string.
"""
fahrenheit = float(celsius) * 9 / 5 + 32
fahrenheit = round(fahrenheit, 3)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b05589ad0f9c30e8df5ee640687faaac63b79d6d | 2,896 | py | Python | src/lhtml.py | drohmer/lhtml | 44a9306e15d7ae0d270af9a80cf9c21cc13b39ea | [
"MIT"
] | null | null | null | src/lhtml.py | drohmer/lhtml | 44a9306e15d7ae0d270af9a80cf9c21cc13b39ea | [
"MIT"
] | null | null | null | src/lhtml.py | drohmer/lhtml | 44a9306e15d7ae0d270af9a80cf9c21cc13b39ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import argparse
meta_default = {
'wrap-auto': False,
'add_title_id': False,
'title': 'Webpage',
'css': [],
'js': [],
'wrap-custom-pre': '',
'wrap-custom-post': '',
'directory_include': [os.getcwd()+'/'],
}
if __name__== '__main__':
parser = argparse.Argu... | 25.182609 | 105 | 0.67576 | #!/usr/bin/env python3
import os
import argparse
import re
import lhtmlLib
meta_default = {
'wrap-auto': False,
'add_title_id': False,
'title': 'Webpage',
'css': [],
'js': [],
'wrap-custom-pre': '',
'wrap-custom-post': '',
'directory_include': [os.getcwd()+'/'],
}
def read_yaml(text_in):
_... | 0 | 0 | 0 | 0 | 0 | 1,455 | 0 | -18 | 91 |
5759fe8e2aff60caa0c1517f34551e600bebcab2 | 2,134 | py | Python | src/plugins/public.py | sh1nra-dx/cyberelf-2722 | 59c13ffa83d846c679a9a079531f12bbe16435d4 | [
"MIT"
] | null | null | null | src/plugins/public.py | sh1nra-dx/cyberelf-2722 | 59c13ffa83d846c679a9a079531f12bbe16435d4 | [
"MIT"
] | null | null | null | src/plugins/public.py | sh1nra-dx/cyberelf-2722 | 59c13ffa83d846c679a9a079531f12bbe16435d4 | [
"MIT"
] | null | null | null | from nonebot import on_command, on_notice
help = on_command('help')
poke = on_notice(rule=_group_poke, priority=10, block=True)
| 25.105882 | 112 | 0.619025 | import random
import re
from PIL import Image
from nonebot import on_command, on_message, on_notice, require, get_driver, on_regex
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Message, Event, Bot
from src.libraries.maimaidx.image import *
from random import randint
from src.libraries.dbutil i... | 816 | 1,168 | 176 | 0 | 0 | 0 | 0 | 132 | 246 |
2a718ce1e89a6d2406ce5a4268c0a73c0a93885b | 26,227 | py | Python | tests/package_info.py | gaborbernat/pipx | d5ab566f4a1c83d6d3bca735b4a6ccd9bbce64f1 | [
"MIT"
] | 1 | 2020-12-11T08:05:54.000Z | 2020-12-11T08:05:54.000Z | tests/package_info.py | gaborbernat/pipx | d5ab566f4a1c83d6d3bca735b4a6ccd9bbce64f1 | [
"MIT"
] | null | null | null | tests/package_info.py | gaborbernat/pipx | d5ab566f4a1c83d6d3bca735b4a6ccd9bbce64f1 | [
"MIT"
] | null | null | null | import sys
from typing import Any, Dict
WIN = sys.platform.startswith("win")
# Versions of all packages possibly used in our tests
# Only apply _exe_if_win to entry_points, NOT scripts
PKG: Dict[str, Dict[str, Any]] = {
"ansible": {
"spec": "ansible==2.9.13",
"apps": [
"ansible",
... | 32.062347 | 90 | 0.435925 | import sys
from typing import Any, Dict
WIN = sys.platform.startswith("win")
def _exe_if_win(apps):
app_strings = []
app_strings = [f"{app}.exe" if WIN else app for app in apps]
return app_strings
# Versions of all packages possibly used in our tests
# Only apply _exe_if_win to entry_points, NOT script... | 0 | 0 | 0 | 0 | 0 | 110 | 0 | 0 | 23 |
c17b740f93ea6899b85b3a4188c5c57850d8836c | 9,992 | py | Python | torch_geometric/nn/conv/sage_conv.py | giannipele/pytorch_geometric | 187d49dcce53a630e36c85c53138345f5bfdc876 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/sage_conv.py | giannipele/pytorch_geometric | 187d49dcce53a630e36c85c53138345f5bfdc876 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/sage_conv.py | giannipele/pytorch_geometric | 187d49dcce53a630e36c85c53138345f5bfdc876 | [
"MIT"
] | null | null | null | from __future__ import division
#import laf
| 37.007407 | 115 | 0.583867 | from __future__ import division
import torch
import torch.nn.functional as F
from torch.nn import Parameter
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import add_remaining_self_loops
from torch_geometric.laf import ElementAggregationLayer, FractionalElementAggregationLayer, ScatterAgg... | 0 | 0 | 0 | 9,500 | 0 | 0 | 0 | 175 | 269 |
c33f211669a36a2afc0840f014d474bb444dec0f | 7,487 | py | Python | tests/test_temperature/test_extension_array.py | domdfcoding/si_unit_pandas | 6912d775f88dcfb9112199a57c14b6ce6a979d0e | [
"BSD-3-Clause"
] | null | null | null | tests/test_temperature/test_extension_array.py | domdfcoding/si_unit_pandas | 6912d775f88dcfb9112199a57c14b6ce6a979d0e | [
"BSD-3-Clause"
] | 19 | 2020-12-21T18:26:24.000Z | 2022-01-16T11:47:58.000Z | tests/test_temperature/test_extension_array.py | domdfcoding/si_unit_pandas | 6912d775f88dcfb9112199a57c14b6ce6a979d0e | [
"BSD-3-Clause"
] | null | null | null | # 3rd party
import numpy # type: ignore
# this package
_non_empty_sets = [
{1},
{1, 2},
{1, 2, 3},
{1, 2, 3, 4},
{1, 2, 3, 4, 5},
]
_non_empty_lists = [
[1],
[1, 2],
[1, 2, 3],
[1, 2, 3, 4],
[1, 2, 3, 4, 5],
]
_non_empty_tuples = [
(1, ),
(1, 2),
(1, 2, 3),
(1, 2, 3, 4),
(1, 2, 3,... | 36.169082 | 112 | 0.700147 | # 3rd party
import numpy # type: ignore
import pytest
# this package
from si_unit_pandas import CelsiusType, TemperatureArray
_non_empty_sets = [
{1},
{1, 2},
{1, 2, 3},
{1, 2, 3, 4},
{1, 2, 3, 4, 5},
]
_non_empty_lists = [
[1],
[1, 2],
[1, 2, 3],
[1, 2, 3, 4],
[1, 2, 3, 4, 5],
]
_non_empty... | 0 | 1,273 | 0 | 0 | 0 | 5,222 | 0 | 27 | 458 |
4ac6b5ecb2889367a9de1e5429425af6d5b00551 | 176 | py | Python | src/web_app/tests/conftest.py | drcrook1/AI_Accelerators_Quality | bace0b5a41271885d1e052bdefae1389e8090ed2 | [
"MIT"
] | 2 | 2019-09-13T20:22:57.000Z | 2019-10-18T16:06:54.000Z | src/inference_function/tests/conftest.py | drcrook1/AI_Accelerators_Quality | bace0b5a41271885d1e052bdefae1389e8090ed2 | [
"MIT"
] | 7 | 2019-10-10T14:39:29.000Z | 2019-11-07T23:55:15.000Z | src/inference_function/tests/conftest.py | drcrook1/AI_Accelerators_Quality | bace0b5a41271885d1e052bdefae1389e8090ed2 | [
"MIT"
] | 2 | 2019-07-03T19:25:31.000Z | 2021-10-13T18:25:18.000Z | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../') | 35.2 | 67 | 0.727273 | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
28743e3a2094b477cd03626d4772df15c2a184d3 | 5,527 | py | Python | cmonitor/scraper.py | FilipOsowski/craigslist-monitor | 57e008263898acb6fc03f58f4808ee0a12acac33 | [
"MIT"
] | 2 | 2018-04-27T21:48:49.000Z | 2018-05-18T19:08:58.000Z | cmonitor/scraper.py | FilipOsowski/craigslist-monitor | 57e008263898acb6fc03f58f4808ee0a12acac33 | [
"MIT"
] | null | null | null | cmonitor/scraper.py | FilipOsowski/craigslist-monitor | 57e008263898acb6fc03f58f4808ee0a12acac33 | [
"MIT"
] | null | null | null |
# The class that handles craigslist item monitoring and parsing.
# Flushes the stdout of the scraper (a file) so that output is live.
# Interface for creating the scraper.
| 35.203822 | 90 | 0.604668 | import requests
import sys
import random
from time import sleep
from collections import deque
from lxml import html
# The class that handles craigslist item monitoring and parsing.
class item_scraper():
# The last_item_ids que stores existing item ids to determine whether an
# item is new.
last_item_ids ... | 0 | 0 | 0 | 4,648 | 0 | 519 | 0 | -16 | 198 |
be6fcabcff305815749769a764a1caf8cffb701b | 8,954 | py | Python | dashboard/views.py | njenga5/django-mediastore-site | 579fe162f32520ca95917e95fa4c841e1bbe0ab1 | [
"MIT"
] | 1 | 2020-12-19T20:49:04.000Z | 2020-12-19T20:49:04.000Z | dashboard/views.py | njenga5/django-mediastore-site | 579fe162f32520ca95917e95fa4c841e1bbe0ab1 | [
"MIT"
] | null | null | null | dashboard/views.py | njenga5/django-mediastore-site | 579fe162f32520ca95917e95fa4c841e1bbe0ab1 | [
"MIT"
] | null | null | null |
MUSIC_TYPES = ['mp3', 'ogg', 'm4a', 'wav', 'opus']
VIDEO_TYPES = ['mp4', 'webm',]
MAX_SPACE = 524_288_000
| 40.333333 | 120 | 0.555841 | import os
from django.shortcuts import render, HttpResponse, redirect
from django.http import Http404
from django.contrib import messages
from django.utils import timezone
from django.contrib.auth import logout
from . import forms
from . import models
MUSIC_TYPES = ['mp3', 'ogg', 'm4a', 'wav', 'opus']
VIDEO_TYPES = ['... | 0 | 0 | 0 | 0 | 0 | 8,377 | 0 | 76 | 383 |
0ae09cad6790a4d08edade1563e5ff562dd1556a | 345 | py | Python | construct_editor/gallery/test_flags_enum.py | jpsnyder/construct-editor | 9ad73aa89430a35f3b5bc71f965feb2e9cbb0568 | [
"MIT"
] | null | null | null | construct_editor/gallery/test_flags_enum.py | jpsnyder/construct-editor | 9ad73aa89430a35f3b5bc71f965feb2e9cbb0568 | [
"MIT"
] | null | null | null | construct_editor/gallery/test_flags_enum.py | jpsnyder/construct-editor | 9ad73aa89430a35f3b5bc71f965feb2e9cbb0568 | [
"MIT"
] | null | null | null | import construct as cs
from . import GalleryItem
constr = cs.Struct(
"permissions" / cs.FlagsEnum(cs.Int8ul, R=4, W=2, X=1),
)
gallery_item = GalleryItem(
construct=constr,
example_binarys={
"read": bytes([4]),
"read_write": bytes([6]),
},
) | 18.157895 | 59 | 0.657971 | import construct as cs
import construct_typed as cst
import dataclasses
import typing as t
from . import GalleryItem
constr = cs.Struct(
"permissions" / cs.FlagsEnum(cs.Int8ul, R=4, W=2, X=1),
)
gallery_item = GalleryItem(
construct=constr,
example_binarys={
"read": bytes([4]),
"read_wri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 66 |
79e77dde243795532b0f5543e8cfbf5b6eb53d7c | 137 | py | Python | python programs/forelse.py | saddam-gif/Python-crushcourse | 63e1e1ff1eeb9a5d34bb0354cc86566c4de60260 | [
"MIT"
] | null | null | null | python programs/forelse.py | saddam-gif/Python-crushcourse | 63e1e1ff1eeb9a5d34bb0354cc86566c4de60260 | [
"MIT"
] | null | null | null | python programs/forelse.py | saddam-gif/Python-crushcourse | 63e1e1ff1eeb9a5d34bb0354cc86566c4de60260 | [
"MIT"
] | null | null | null | nums = [12,100,14,27,33]
for num in nums:
if num%5 == 0:
print(num)
break
else:
print("Not found")
| 13.7 | 26 | 0.467153 | nums = [12,100,14,27,33]
for num in nums:
if num%5 == 0:
print(num)
break
else:
print("Not found")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ae5daa0b2defdc51c902c5d4880bd4f995b3ec9 | 1,836 | py | Python | gunicorn.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | gunicorn.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | gunicorn.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | import multiprocessing
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Load Secrets
secrets = load_secrets()
# Get a secret
proc_name = 'districtwebsites'
pidfile = '/var/run/gunicorn/www_slcschools_org.pid'
worker_tmp_di... | 26.608696 | 79 | 0.646514 | import glob
import multiprocessing
import os
import json
from django.core.exceptions import ImproperlyConfigured
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Load Secrets
def load_secrets(file=os.path.join(BASE_DIR, '.secrets.json'))... | 0 | 0 | 0 | 0 | 0 | 1,001 | 0 | 14 | 134 |
e1d5eb71793375c94806c287d2c4a7eecbf3b110 | 83 | py | Python | 03Aula09-09/ex07.py | danicon/Curso-IPE | 3b9e2a9d187492d6561a512363bd06156286df6a | [
"MIT"
] | 2 | 2020-09-09T12:50:57.000Z | 2020-09-09T12:56:02.000Z | 03Aula09-09/ex07.py | danicon/Curso-IPE | 3b9e2a9d187492d6561a512363bd06156286df6a | [
"MIT"
] | null | null | null | 03Aula09-09/ex07.py | danicon/Curso-IPE | 3b9e2a9d187492d6561a512363bd06156286df6a | [
"MIT"
] | null | null | null | fat=1
n=5
while n>=1:
fat = fat * n
n-=1
print(f"O fatoria de 5! = {fat}") | 11.857143 | 33 | 0.506024 | fat=1
n=5
while n>=1:
fat = fat * n
n-=1
print(f"O fatoria de 5! = {fat}") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e3a459d1ce29c6763786ea2e8a3d1c040352dde8 | 5,395 | py | Python | demo/20newsgroups/demo.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 14 | 2019-06-30T06:15:06.000Z | 2021-11-02T15:55:17.000Z | demo/20newsgroups/demo.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 8 | 2019-11-08T08:17:39.000Z | 2022-02-09T23:30:55.000Z | demo/20newsgroups/demo.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 3 | 2019-06-30T06:15:42.000Z | 2021-02-16T11:12:47.000Z | # Copyright 2019 Ivan Bondarenko
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 56.197917 | 120 | 0.670065 | # Copyright 2019 Ivan Bondarenko
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 0 | 0 | 0 | 0 | 0 | 4,193 | 0 | 140 | 188 |
dca914d98b86097dc27778e74bbbd63f44391333 | 354 | py | Python | cotr/cms/migrations/0007_renamed_fields.py | kingsdigitallab/cotr | 4afbfdd36d4dd0ee9f56152d3c963453c81e440c | [
"MIT"
] | null | null | null | cotr/cms/migrations/0007_renamed_fields.py | kingsdigitallab/cotr | 4afbfdd36d4dd0ee9f56152d3c963453c81e440c | [
"MIT"
] | 27 | 2020-12-28T17:34:59.000Z | 2022-03-12T00:25:43.000Z | cms/migrations/0007_renamed_fields.py | kingsdigitallab/ctrs-django | 7170b4f15bd9d097d00f215d747a02a9b656768c | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2018-08-10 16:28
| 18.631579 | 45 | 0.576271 | # Generated by Django 2.0 on 2018-08-10 16:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0006_peoplepage'),
]
operations = [
migrations.RenameField(
model_name='peoplepage',
old_name='name',
new_n... | 0 | 0 | 0 | 250 | 0 | 0 | 0 | 11 | 46 |
aafa73c93edfeec99dae5514f18024670697cacd | 13,051 | py | Python | server_automation/tests/test_ingestion_discrete.py | MapColonies/automation-ingestion-test | 851e6015850da00811bb91dcad2dd08222a37e8f | [
"MIT"
] | null | null | null | server_automation/tests/test_ingestion_discrete.py | MapColonies/automation-ingestion-test | 851e6015850da00811bb91dcad2dd08222a37e8f | [
"MIT"
] | null | null | null | server_automation/tests/test_ingestion_discrete.py | MapColonies/automation-ingestion-test | 851e6015850da00811bb91dcad2dd08222a37e8f | [
"MIT"
] | null | null | null | """This module provide multiple test of ingestion services"""
import shutil
from time import sleep
from conftest import ValueStorage
import logging
from server_automation.configuration import config
from server_automation.postgress import postgress_adapter
_log = logging.getLogger("server_automation.tests.test_ingesti... | 41.170347 | 139 | 0.620106 | """This module provide multiple test of ingestion services"""
import shutil
from time import sleep
from conftest import ValueStorage
import logging
import json
from server_automation.configuration import config
from discrete_kit.validator.json_compare_pycsw import *
from discrete_kit.functions.shape_functions import Sh... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 95 | 88 |
6755c433a898ac8587818c91b4cd5361bb85a5dd | 3,518 | py | Python | 5-6-19/Files/Calculus.py | QueenChristina/Calculus-Zombies | 81611015ba505bff6679d029280854e3934fad15 | [
"MIT"
] | 3 | 2019-08-30T02:53:34.000Z | 2022-01-03T07:05:39.000Z | 5-6-19/Files/Calculus.py | QueenChristina/Calculus-Zombies | 81611015ba505bff6679d029280854e3934fad15 | [
"MIT"
] | null | null | null | 5-6-19/Files/Calculus.py | QueenChristina/Calculus-Zombies | 81611015ba505bff6679d029280854e3934fad15 | [
"MIT"
] | null | null | null | import random, pygame
x, y = symbols("x y")
pygame.font.init()
WHITE = (255, 255, 255)
frames = 0
waiting = 'done'
derivatives = [x + 3, x**2 + 5, x**2 + 6*x, tan(x), sec(x)]
integrals = [x + 5, x + 2, 1/(1 + x**2)]
questiontypes = [derivatives, integrals]
questiontype = random.choice(questiontypes... | 32.878505 | 137 | 0.555713 | import sympy, random, pygame
from sympy import *
from pygame.locals import *
from Files import Var, Sprite, Thing
x, y = symbols("x y")
pygame.font.init()
WHITE = (255, 255, 255)
def show_text(text):
# small_font = pygame.font.Font("PixelFont.ttf", 35)
#text_surface = small_font.render(text, Fals... | 0 | 0 | 0 | 0 | 0 | 2,589 | 0 | 26 | 163 |
3dd10f77435f270d4b14b5caf0aa80b5b50948e9 | 6,193 | py | Python | dfa/server/services/firewall/native/fw_constants.py | CiscoSystems/fabric_enabler | d5318624dd15692197a7212ecd4b0ceea42dc73e | [
"Apache-2.0"
] | 1 | 2015-03-05T02:48:15.000Z | 2015-03-05T02:48:15.000Z | dfa/server/services/firewall/native/fw_constants.py | CiscoSystems/fabric_enabler | d5318624dd15692197a7212ecd4b0ceea42dc73e | [
"Apache-2.0"
] | 1 | 2016-05-25T22:13:43.000Z | 2016-07-21T20:49:48.000Z | dfa/server/services/firewall/native/fw_constants.py | CiscoSystems/fabric_enabler | d5318624dd15692197a7212ecd4b0ceea42dc73e | [
"Apache-2.0"
] | 2 | 2017-05-02T21:32:46.000Z | 2018-08-22T16:52:40.000Z | # Copyright 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 44.235714 | 79 | 0.850315 | # Copyright 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
68e928594ef5448f2f786775d06b081e8919f37d | 475 | py | Python | Dataset/Leetcode/test/62/486.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/62/486.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/62/486.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | //
if i>=m or j>=n:
return;
if i==m-1 and j==n-1:
res.append(ans)
return
//
dfs(i+1,j,ans,res)
ans.append([i+1,j])
dfs(i,j+1,ans,res)
ans.pop()
ans.append([i,j+1])
ans=[]
... | 20.652174 | 41 | 0.383158 | class Solution:
def XXX(self, m: int, n: int) -> int:
def dfs(i,j,ans,res):
//中止条件
if i>=m or j>=n:
return;
if i==m-1 and j==n-1:
res.append(ans)
return
//递归调用
dfs(i+1,j,ans,res)
ans.append([i+1,j])
... | 24 | 0 | 0 | 66 | 0 | 0 | 0 | 0 | 22 |
e7fb2a10e0bab4428f45874889bd4bc3397d3fe2 | 2,910 | py | Python | os_test.py | bdastur/openstackclients | 693099743294d54d26abdc6719d7a8fdc2bb8325 | [
"Apache-2.0"
] | 1 | 2015-07-19T16:15:33.000Z | 2015-07-19T16:15:33.000Z | os_test.py | bdastur/openstackclients | 693099743294d54d26abdc6719d7a8fdc2bb8325 | [
"Apache-2.0"
] | null | null | null | os_test.py | bdastur/openstackclients | 693099743294d54d26abdc6719d7a8fdc2bb8325 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Openstack Client Test code.
'''
| 29.1 | 76 | 0.551546 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Openstack Client Test code.
'''
import unittest
import credentials
import osnetwork_client as neutronclient
class OSTest(unittest.TestCase):
'''
Test Openstack client handlers.
'''
def get_openstack_credentials(self, rcfile):
'''
Get ... | 0 | 0 | 0 | 2,721 | 0 | 0 | 0 | 10 | 90 |
581f38a4825fa56464d32c2e25b3ff9f1ee8bd8a | 397 | py | Python | runtests.py | logitnet/django-htpayway | e5f336cc686e618df58ed6b3c107c994088291a4 | [
"MIT"
] | 1 | 2015-07-07T12:53:55.000Z | 2015-07-07T12:53:55.000Z | runtests.py | logitnet/django-htpayway | e5f336cc686e618df58ed6b3c107c994088291a4 | [
"MIT"
] | null | null | null | runtests.py | logitnet/django-htpayway | e5f336cc686e618df58ed6b3c107c994088291a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {'ENGINE': 'django.db.backends.sqlite3'}
},
INSTALLED_APPS=[
'htpayway',
],
MIDDLEWARE_CLASSES=[],
)
if __name__ == '__main__':
from django.test.simple import run_test... | 18.904762 | 59 | 0.647355 | #!/usr/bin/env python
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {'ENGINE': 'django.db.backends.sqlite3'}
},
INSTALLED_APPS=[
'htpayway',
],
MIDDLEWARE_CLASSES=[],
)
if __name__ == '__main__':
from django.test.simple import run_test... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10810cc46f835c1502a9f2941b98dcf4eff9e74f | 916 | py | Python | ann_benchmarks/algorithms/annoy_learned.py | Justinyu1618/ann-benchmarks | 9a5e1b7e6c128e94c01fcf25b65c4521cbde4efe | [
"MIT"
] | null | null | null | ann_benchmarks/algorithms/annoy_learned.py | Justinyu1618/ann-benchmarks | 9a5e1b7e6c128e94c01fcf25b65c4521cbde4efe | [
"MIT"
] | null | null | null | ann_benchmarks/algorithms/annoy_learned.py | Justinyu1618/ann-benchmarks | 9a5e1b7e6c128e94c01fcf25b65c4521cbde4efe | [
"MIT"
] | null | null | null | from __future__ import absolute_import
| 30.533333 | 75 | 0.606987 | from __future__ import absolute_import
import annoy
from ann_benchmarks.algorithms.base import BaseANN
class Annoy(BaseANN):
def __init__(self, metric, n_trees):
self._n_trees = n_trees
self._search_k = None
self._metric = metric
def fit(self, X):
self._annoy = annoy.AnnoyInde... | 0 | 0 | 0 | 789 | 0 | 0 | 0 | 20 | 67 |
681d3d123e56d04a5ea1a2b300ac7532f454ed66 | 1,484 | py | Python | google_news_result_opener.py | Atropos148/AutomateTheBoringStuff2E | cd2ca61057e279329b8858b38677d6fbe6d50394 | [
"MIT"
] | null | null | null | google_news_result_opener.py | Atropos148/AutomateTheBoringStuff2E | cd2ca61057e279329b8858b38677d6fbe6d50394 | [
"MIT"
] | null | null | null | google_news_result_opener.py | Atropos148/AutomateTheBoringStuff2E | cd2ca61057e279329b8858b38677d6fbe6d50394 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
# https://www.google.com/search?q=dfs&tbm=nws
# rso > div:nth-child(2) > g-card > div > div > div.dbsr > a
# rso > div:nth-child(1) > g-card > div > div > div.dbsr > a
| 28.538462 | 71 | 0.589623 | from typing import List
import webbrowser
import sys
import requests
import bs4
def main():
print("hello")
search_url: List = ["https://www.google.com/search?q=", "&tbm=nws"]
# if len(sys.argv) == 2:
# topic_name: str = sys.argv[1]
while True:
topic_name = input("What do you want to... | 0 | 0 | 0 | 0 | 0 | 1,171 | 0 | -30 | 133 |
2c08cb63ec1515c129af84af4fc50ea3d2610c0d | 215 | py | Python | dice_roll_simulator.py | R4ULtv/easy-project | afc63974d2a271730d992e5b829666b74ac8b8b0 | [
"MIT"
] | 1 | 2021-09-16T19:53:13.000Z | 2021-09-16T19:53:13.000Z | dice_roll_simulator.py | R4ULtv/easy-project | afc63974d2a271730d992e5b829666b74ac8b8b0 | [
"MIT"
] | null | null | null | dice_roll_simulator.py | R4ULtv/easy-project | afc63974d2a271730d992e5b829666b74ac8b8b0 | [
"MIT"
] | null | null | null | import random
while True:
print('1. Lancia il dado\n2. Esci')
user = int(input())
if user == 1:
num = random.randint(1,6)
print('Numero generato : ',num)
else:
break | 21.5 | 40 | 0.525581 | import random
while True:
print('1. Lancia il dado\n2. Esci')
user = int(input())
if user == 1:
num = random.randint(1,6)
print('Numero generato : ',num)
else:
break | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
21c17ffe76cd4624b248f6524c153beeed073e14 | 9,681 | py | Python | train.py | cheniison/e2e-joint-coref | 9ebe518e5fa0d49f8ceab4b04909523d09161462 | [
"MIT"
] | 4 | 2021-11-11T08:03:13.000Z | 2022-02-05T04:32:56.000Z | train.py | wangyang-stu/e2e-joint-coref | 02ff8f47f6c87d827ce799d56da214239ed7ae2c | [
"MIT"
] | 1 | 2021-11-30T08:55:33.000Z | 2021-12-16T08:16:08.000Z | train.py | wangyang-stu/e2e-joint-coref | 02ff8f47f6c87d827ce799d56da214239ed7ae2c | [
"MIT"
] | 2 | 2021-11-30T06:09:22.000Z | 2021-12-24T12:51:28.000Z | import torch
torch.backends.cudnn.benchmark = True
def find_clusters(unit_loc, index_clusters):
""" clusterscluster
return:
cluster-1
"""
if unit_loc in index_clusters:
return index_clusters[unit_loc]
return -1
if __name__ == "__main__":
train()
| 47.925743 | 295 | 0.600041 | import model
import config
import torch
import time
import tools
import json
import _pickle
import os
import copy
import numpy as np
import random
import math
import pprint
from torch.utils.data import BatchSampler, SequentialSampler, RandomSampler
from transformers import AutoTokenizer, AutoModel, AdamW
torch.backend... | 273 | 0 | 0 | 0 | 0 | 8,977 | 0 | -15 | 331 |
9609c031bedaa23e5862d29f6f9297ada06c6808 | 28,921 | py | Python | training/layers.py | BrandoZhang/alis | 9699eba112eda2ea27d6023221df2df9dc270b7f | [
"CC-BY-2.0"
] | 176 | 2021-04-15T05:28:59.000Z | 2022-03-30T07:06:00.000Z | training/layers.py | BrandoZhang/alis | 9699eba112eda2ea27d6023221df2df9dc270b7f | [
"CC-BY-2.0"
] | 12 | 2021-04-17T20:20:53.000Z | 2022-03-19T07:04:58.000Z | training/layers.py | BrandoZhang/alis | 9699eba112eda2ea27d6023221df2df9dc270b7f | [
"CC-BY-2.0"
] | 22 | 2021-04-16T02:05:41.000Z | 2022-03-03T12:23:10.000Z | from typing import Optional
import torch
import torch.nn as nn
from torch import Tensor
import numpy as np
from torch_utils import misc
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
#---------------------... | 43.101341 | 150 | 0.635317 | from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
import numpy as np
from omegaconf import OmegaConf, DictConfig
from torch_utils import persistence
from torch_utils.ops import bias_act
from torch_utils import misc
from torch_utils.ops.... | 0 | 21,907 | 0 | 0 | 0 | 1,787 | 0 | 128 | 502 |
ec0542b472203c0b4efba1ed7813abea26d53b69 | 3,524 | py | Python | script/training_script.py | analytique-bourassa/VAE-Classifier | d334cdd63e0c5a96b13d8a80c8b352f9a9c3d493 | [
"MIT"
] | 12 | 2020-02-19T01:00:10.000Z | 2022-03-17T11:52:35.000Z | script/training_script.py | analytique-bourassa/VAE-Classifier | d334cdd63e0c5a96b13d8a80c8b352f9a9c3d493 | [
"MIT"
] | null | null | null | script/training_script.py | analytique-bourassa/VAE-Classifier | d334cdd63e0c5a96b13d8a80c8b352f9a9c3d493 | [
"MIT"
] | 3 | 2019-07-04T12:52:11.000Z | 2021-07-01T01:51:38.000Z | from tools.tools import setup_data_loaders
from VariationalAutoEncoder.utils import evaluate_vae, train_vae
from VariationalAutoEncoder.VariationalAutoEncoder import VAE
import torch
import pyro
from pyro.infer import SVI, Trace_ELBO
from pyro.optim import Adam
from tqdm import tqdm
from tools.training_monitoring im... | 34.891089 | 99 | 0.755392 | from tools.tools import setup_data_loaders
from VariationalAutoEncoder.utils import evaluate_vae, train_vae
from VariationalAutoEncoder.VariationalAutoEncoder import VAE
import torch
import pyro
import pyro.distributions as dist
from pyro.infer import SVI, Trace_ELBO
from pyro.optim import Adam
from tqdm import tqdm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 22 |
356a2a356c7333feb46fb03cea0073f96b990937 | 1,574 | py | Python | model.py | thrilliams/who | cb9bc18f86d573c9f4e6378e72f819306c5a4ef3 | [
"MIT"
] | null | null | null | model.py | thrilliams/who | cb9bc18f86d573c9f4e6378e72f819306c5a4ef3 | [
"MIT"
] | null | null | null | model.py | thrilliams/who | cb9bc18f86d573c9f4e6378e72f819306c5a4ef3 | [
"MIT"
] | null | null | null |
learn() | 26.233333 | 52 | 0.507624 | from sklearn.naive_bayes import GaussianNB as GNB
from sklearn.svm import SVC
from preprocessor import preprocess
def testm(model, chunks, test):
set = [[], []]
for chunk in chunks:
set[0] += chunk[0]
set[1] += chunk[1]
model.fit(set[0], set[1])
data = model.predict(test[0])
num = 0... | 0 | 0 | 0 | 0 | 0 | 1,406 | 0 | 48 | 112 |
5cadcade5ead6d46840fcd48644b5053d2e3f572 | 3,293 | py | Python | netapp_lib/api/rest/rest.py | dprts/netapp-lib-dev | b6845e0de9904075fe4f68fb147c1e8a84121abf | [
"Apache-2.0"
] | null | null | null | netapp_lib/api/rest/rest.py | dprts/netapp-lib-dev | b6845e0de9904075fe4f68fb147c1e8a84121abf | [
"Apache-2.0"
] | null | null | null | netapp_lib/api/rest/rest.py | dprts/netapp-lib-dev | b6845e0de9904075fe4f68fb147c1e8a84121abf | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 NetApp, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.202381 | 79 | 0.644701 | # Copyright 2015 NetApp, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 0 | 0 | 2,406 | 0 | 0 | 0 | 45 | 135 |
926340aed8b623037716e4348377371416e7e37d | 5,038 | py | Python | idfy_sdk/services/signature/models/link.py | idfy-io/idfy-sdk-python | 0f7ced0cf0df080b1c73e2451bf02a23710b5bf1 | [
"Apache-2.0"
] | null | null | null | idfy_sdk/services/signature/models/link.py | idfy-io/idfy-sdk-python | 0f7ced0cf0df080b1c73e2451bf02a23710b5bf1 | [
"Apache-2.0"
] | null | null | null | idfy_sdk/services/signature/models/link.py | idfy-io/idfy-sdk-python | 0f7ced0cf0df080b1c73e2451bf02a23710b5bf1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Idfy.Signature
Sign contracts, declarations, forms and other documents using digital signatures. ## Last update Last build date for this endpoint: 18.03.2019
"""
from datetime import datetime as datetime
| 23.652582 | 150 | 0.548432 | # coding: utf-8
"""
Idfy.Signature
Sign contracts, declarations, forms and other documents using digital signatures. ## Last update Last build date for this endpoint: 18.03.2019
"""
import pprint
import re
from typing import List, Dict
from datetime import datetime as datetime
class Link(object):
... | 0 | 1,763 | 0 | 2,956 | 0 | 0 | 0 | -12 | 90 |
19e978b9dbaf3ac71fc17bb402cfdd9c840d4863 | 8,407 | py | Python | tests/test_parser.py | Grk0/docker-cleanup | 0b4aa8866360eac65e59c78449270249ef24eb98 | [
"Apache-2.0"
] | 9 | 2016-12-03T18:11:05.000Z | 2021-01-07T16:58:29.000Z | tests/test_parser.py | Grk0/docker-cleanup | 0b4aa8866360eac65e59c78449270249ef24eb98 | [
"Apache-2.0"
] | null | null | null | tests/test_parser.py | Grk0/docker-cleanup | 0b4aa8866360eac65e59c78449270249ef24eb98 | [
"Apache-2.0"
] | 3 | 2018-09-13T01:41:39.000Z | 2019-10-03T16:04:10.000Z | # Copyright 2015 Christian Aichinger <Greek0@gmx.net>
#
# 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 ... | 30.132616 | 77 | 0.607708 | # Copyright 2015 Christian Aichinger <Greek0@gmx.net>
#
# 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 ... | 4 | 1,898 | 0 | 1,541 | 0 | 132 | 0 | -31 | 341 |
b03f2c7164e71d1d149f0c7b8612e0a573f52c62 | 643 | py | Python | Aprendendo Python/cursopythonudamy/aula9condicoes.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | Aprendendo Python/cursopythonudamy/aula9condicoes.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | Aprendendo Python/cursopythonudamy/aula9condicoes.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | # Na identao do python utilizar apenas 4 espaos como conveno
print("Ol meu caro seja bem-vindo ao seu programa PYTHON\n")
num_1=int(input("Digite um nmero interiro :"))
print("Vamos trabalhar com soma agora ")
num_2=int(input("\nDigite outro nmero interiro :"))
total=num_1+num_2
if total <=5:
print(f" A soma {tota... | 37.823529 | 69 | 0.687403 | # Na identação do python utilizar apenas 4 espaços como convenção
print("Olá meu caro seja bem-vindo ao seu programa PYTHON\n")
num_1=int(input("Digite um número interiro :"))
print("Vamos trabalhar com soma agora ")
num_2=int(input("\nDigite outro número interiro :"))
total=num_1+num_2
if total <=5:
print(f" A som... | 32 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b1862fd3754adbd970d8d6b450e04dfca2a81394 | 500 | py | Python | leetcode/0066_Plus_One/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | leetcode/0066_Plus_One/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | leetcode/0066_Plus_One/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-01-21 21:30:34
# Description:
if __name__ == "__main__":
pass
| 20 | 54 | 0.524 | # !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-01-21 21:30:34
# Description:
import os, sys
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
token = 1
for i in range(len(digits) - 1, -1, -1):
sum = digits[i] + token
digits[... | 0 | 0 | 0 | 313 | 0 | 0 | 0 | -7 | 46 |
6efe214e57645d173e5e7d5b1c83a633d3ccce1d | 869 | py | Python | test_tflite.py | qinweizhang-1/yolov3-tiny-pb-nms | e35cd0ab7dd2769d12a32340f4de244ad52c2cde | [
"Apache-2.0"
] | 2 | 2021-04-13T06:02:14.000Z | 2021-05-24T03:29:20.000Z | test_tflite.py | qinweizhang-1/yolov3-tiny-pb-nms | e35cd0ab7dd2769d12a32340f4de244ad52c2cde | [
"Apache-2.0"
] | null | null | null | test_tflite.py | qinweizhang-1/yolov3-tiny-pb-nms | e35cd0ab7dd2769d12a32340f4de244ad52c2cde | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
# -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
import tensorflow as tf
import cv2
import numpy as np
weights = "./yolov3_tiny_widerface_boxes_int8.tflite"
image_path = "./416_416.jpg"
original_image = cv2.imread(image_path)
original_image = cv2.cvtColor(original_i... | 33.423077 | 100 | 0.774453 | # -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
# -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
import tensorflow as tf
import cv2
import numpy as np
weights = "./yolov3_tiny_widerface_boxes_int8.tflite"
image_path = "./416_416.jpg"
original_image = cv2.imread(image_path)
original_image = cv2.cvtColor(original_i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c77cfa80e77b7705bd3eaa8d5b29bbc2e97fb41b | 9,725 | py | Python | cyrtranslit/mapping.py | opendatakosovo/serbian-transliterator | 308ec9fba59f96c5eb8cf74371db8a3c0a3a78d8 | [
"MIT"
] | 53 | 2016-02-05T14:03:26.000Z | 2022-03-28T09:26:49.000Z | cyrtranslit/mapping.py | opendatakosovo/serbian-transliterator | 308ec9fba59f96c5eb8cf74371db8a3c0a3a78d8 | [
"MIT"
] | 14 | 2016-02-27T15:19:03.000Z | 2021-03-29T00:58:11.000Z | cyrtranslit/mapping.py | opendatakosovo/serbian-transliterator | 308ec9fba59f96c5eb8cf74371db8a3c0a3a78d8 | [
"MIT"
] | 19 | 2016-02-05T16:34:09.000Z | 2021-12-27T04:49:55.000Z | # -*- coding: utf-8 -*-
import copy
# Build the dictionaries to transliterate Serbian cyrillic to latin and vice versa.
# This dictionary is to transliterate from cyrillic to latin.
SR_CYR_TO_LAT_DICT = {
u'': u'A', u'': u'a',
u'': u'B', u'': u'b',
u'': u'V', u'': u'v',
u'': u'G', u'': u'g',
u'': u... | 33.419244 | 116 | 0.613368 | # -*- coding: utf-8 -*-
import copy
# Build the dictionaries to transliterate Serbian cyrillic to latin and vice versa.
# This dictionary is to transliterate from cyrillic to latin.
SR_CYR_TO_LAT_DICT = {
u'А': u'A', u'а': u'a',
u'Б': u'B', u'б': u'b',
u'В': u'V', u'в': u'v',
u'Г': u'G', u'г': u'g',
... | 769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11cad09c3f55143e830ec1012461eacd6a70c9c0 | 4,599 | py | Python | scripts/05_nlcd92_to_tracts.py | snmarkley1/HHUUD10 | 9b8ef34d55a37aea4b6cf634cb5ef0c4b24bf977 | [
"MIT"
] | 3 | 2022-03-11T15:22:03.000Z | 2022-03-22T17:02:20.000Z | scripts/05_nlcd92_to_tracts.py | snmarkley1/HHUUD10 | 9b8ef34d55a37aea4b6cf634cb5ef0c4b24bf977 | [
"MIT"
] | null | null | null | scripts/05_nlcd92_to_tracts.py | snmarkley1/HHUUD10 | 9b8ef34d55a37aea4b6cf634cb5ef0c4b24bf977 | [
"MIT"
] | null | null | null |
#####################################################################################
#####################################################################################
#### --------------------------------------------------------------------------- ####
#### ASSIGNING 1992 NLCD CATEGORIES to 2010 TRAC... | 38.647059 | 128 | 0.542509 |
#####################################################################################
#####################################################################################
#### --------------------------------------------------------------------------- ####
#### ASSIGNING 1992 NLCD CATEGORIES to 2010 TRAC... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
39967ca31d2f5acf9f77d22eed28cdf2d14aab38 | 726 | py | Python | subt/test_octomap.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 12 | 2017-02-16T10:22:59.000Z | 2022-03-20T05:48:06.000Z | subt/test_octomap.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 618 | 2016-08-30T04:46:12.000Z | 2022-03-25T16:03:10.000Z | subt/test_octomap.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 11 | 2016-08-27T20:02:55.000Z | 2022-03-07T08:53:53.000Z |
# vim: expandtab sw=4 ts=4
| 25.928571 | 105 | 0.657025 | import unittest
from unittest.mock import MagicMock
import os
import cv2
import numpy as np
from subt.octomap import Octomap, data2maplevel, frontiers
class OctomapTest(unittest.TestCase):
def test_map(self):
with open(os.path.join(os.path.dirname(__file__), 'test_data', 'freyja-octomap.bin'), 'rb') as... | 0 | 0 | 0 | 520 | 0 | 0 | 0 | 19 | 157 |
ae1e6667fe0f2b408cf01203a620f45e42df1c2b | 1,080 | py | Python | mooda/input/read_df.py | rbardaji/mooda | 00c0f9fae657d3d0f7dd3772a029f78a182a07b2 | [
"MIT"
] | 15 | 2018-08-08T10:46:04.000Z | 2021-09-24T14:38:37.000Z | mooda/input/read_df.py | rbardaji/mooda | 00c0f9fae657d3d0f7dd3772a029f78a182a07b2 | [
"MIT"
] | 3 | 2019-05-14T11:40:40.000Z | 2020-04-30T07:17:15.000Z | mooda/input/read_df.py | rbardaji/mooda | 00c0f9fae657d3d0f7dd3772a029f78a182a07b2 | [
"MIT"
] | 4 | 2018-11-02T14:44:59.000Z | 2021-05-10T21:57:25.000Z | from ..waterframe import WaterFrame
def read_df(df, index_time, index_depth=None, metadata={}, vocabulary={}):
"""
Get a WaterFrame from a pandas DataFrame.
Parameters
----------
df: Pandas.DataFrame
index_time: str
Column with the TIME index
index_depth: str
... | 20.769231 | 74 | 0.563889 | from ..waterframe import WaterFrame
def read_df(df, index_time, index_depth=None, metadata={}, vocabulary={}):
"""
Get a WaterFrame from a pandas DataFrame.
Parameters
----------
df: Pandas.DataFrame
index_time: str
Column with the TIME index
index_depth: str
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
09417630659f623fe8ff6fbb061c62312b984a9c | 43,554 | py | Python | src/appetite.py | layamba25/appetites | 5ecf38a064e00920b0aed6de0db9f9f171091962 | [
"Apache-2.0"
] | 34 | 2017-03-31T18:28:10.000Z | 2022-03-23T22:49:18.000Z | src/appetite.py | layamba25/appetites | 5ecf38a064e00920b0aed6de0db9f9f171091962 | [
"Apache-2.0"
] | 13 | 2017-04-04T19:22:42.000Z | 2020-07-29T08:58:39.000Z | src/appetite.py | layamba25/appetites | 5ecf38a064e00920b0aed6de0db9f9f171091962 | [
"Apache-2.0"
] | 19 | 2017-04-03T18:44:01.000Z | 2021-07-02T19:49:35.000Z | #!/usr/bin/env python
# pylint: disable=too-complex,no-name-in-module,import-error,relative-import,missing-returns-doc,too-many-instance-attributes,too-many-branches,too-many-statements,too-many-arguments,too-many-locals,no-member,invalid-name
"""Appetite Main.
Parent appetite class
"""
import argparse
import modules.... | 43.993939 | 221 | 0.543808 | #!/usr/bin/env python
# pylint: disable=too-complex,no-name-in-module,import-error,relative-import,missing-returns-doc,too-many-instance-attributes,too-many-branches,too-many-statements,too-many-arguments,too-many-locals,no-member,invalid-name
"""Appetite Main.
Parent appetite class
"""
import os
import sys
import tr... | 0 | 606 | 0 | 41,235 | 0 | 314 | 0 | 139 | 444 |
19883638b9af42f61b8d150852eef6a91b9b70db | 1,317 | py | Python | src/genie/libs/parser/iosxe/tests/ShowIpArp/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxe/tests/ShowIpArp/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxe/tests/ShowIpArp/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"interfaces": {
"GigabitEthernet2.390": {
"ipv4": {
"neighbors": {
"10.12.90.1": {
"age": "-",
"ip": "10.12.90.1",
"link_layer_address": "fa16.3eff.9c9e",
... | 32.121951 | 63 | 0.265756 | expected_output = {
"interfaces": {
"GigabitEthernet2.390": {
"ipv4": {
"neighbors": {
"10.12.90.1": {
"age": "-",
"ip": "10.12.90.1",
"link_layer_address": "fa16.3eff.9c9e",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d51c2dd166f49926770b54d7c5e8b303712398d5 | 446 | py | Python | samples/post_receiver.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | 2 | 2021-12-10T16:12:51.000Z | 2022-01-06T17:29:12.000Z | samples/post_receiver.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | samples/post_receiver.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | from webpie import WPApp
WPApp(Handler).run_server(8080)
| 31.857143 | 68 | 0.533632 | from webpie import WPApp, WPHandler
class Handler(WPHandler):
def post(self, request, relpath, **args):
print("Request method:", request.method)
print("Request headers:")
for h, v in request.headers.items():
print("%s: %s" % (h,v))
... | 0 | 0 | 0 | 354 | 0 | 0 | 0 | 11 | 23 |
e20586be55085431e58e69b48e220f0d98849b88 | 206 | py | Python | grokking_algorithms/sieve_eratosthenes.py | David2261/Python_Algorithms | cc354766658715d65430a82ebdf7f6ad18b0ab69 | [
"MIT"
] | null | null | null | grokking_algorithms/sieve_eratosthenes.py | David2261/Python_Algorithms | cc354766658715d65430a82ebdf7f6ad18b0ab69 | [
"MIT"
] | null | null | null | grokking_algorithms/sieve_eratosthenes.py | David2261/Python_Algorithms | cc354766658715d65430a82ebdf7f6ad18b0ab69 | [
"MIT"
] | null | null | null | n = int(input("n="))
for a in range(n+1):
continue
lst = []
i = 2
while i <= n:
if a[i] != 0:
lst.append(a[i])
for j in range(i, n+1, i):
a[j] = 0
i += 1
print(lst) | 14.714286 | 34 | 0.42233 | n = int(input("n="))
for a in range(n+1):
continue
lst = []
i = 2
while i <= n:
if a[i] != 0:
lst.append(a[i])
for j in range(i, n+1, i):
a[j] = 0
i += 1
print(lst) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
478bf374458895c34105d64427a1d825de1469f1 | 1,087 | py | Python | draw_captcha/constants.py | henu/django_draw_captcha | 7c910a168d547a650f33f9c6c68624b3a8f77625 | [
"MIT"
] | 1 | 2019-12-01T13:49:52.000Z | 2019-12-01T13:49:52.000Z | draw_captcha/constants.py | henu/django_draw_captcha | 7c910a168d547a650f33f9c6c68624b3a8f77625 | [
"MIT"
] | 1 | 2019-02-13T06:30:59.000Z | 2019-02-13T06:30:59.000Z | draw_captcha/constants.py | henu/django_draw_captcha | 7c910a168d547a650f33f9c6c68624b3a8f77625 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
ADJECTIVES = {
'colorful': _('colorful'),
'hairy': _('hairy'),
'wet': _('wet'),
'flying': _('flying'),
'burning': _('burning'),
'dirty': _('dirty'),
}
NOUNS = {
'cat': ... | 21.74 | 55 | 0.50046 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
ADJECTIVES = {
'colorful': _('colorful'),
'hairy': _('hairy'),
'wet': _('wet'),
'flying': _('flying'),
'burning': _('burning'),
'dirty': _('dirty'),
}
NOUNS = {
'cat': ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12d558b923134c8704a52e5eb3a015965fa39656 | 10,818 | py | Python | tsad/useful/ts.py | waico/DL-anomaly-detection | c69eeecfd3376e6e3544ab34e36d6360dbebeb94 | [
"BSD-3-Clause"
] | 8 | 2021-04-27T01:13:37.000Z | 2022-03-26T08:57:44.000Z | tsad/useful/ts.py | waico/DL-anomaly-detection | c69eeecfd3376e6e3544ab34e36d6360dbebeb94 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T16:05:26.000Z | 2021-12-23T16:05:26.000Z | tsad/useful/ts.py | waico/DL-anomaly-detection | c69eeecfd3376e6e3544ab34e36d6360dbebeb94 | [
"BSD-3-Clause"
] | 3 | 2021-04-11T09:34:55.000Z | 2021-12-14T15:54:51.000Z | # , 1
"""
CDSDSDS
"""
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def ts_train_test_split(df, len_seq,
points_ahead=1, ga... | 37.825175 | 123 | 0.612775 | # косяк, мой подсчет метрик не работает если там нет трушных 1
"""
CDSDSDS
"""
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def ts_train_test_split(df, l... | 3,990 | 0 | 0 | 0 | 0 | 115 | 0 | 0 | 60 |
c7cc3d591f8c1c43580a175134be66faf9b07552 | 1,960 | py | Python | treenav/signals.py | itsdkey/django-treenav | cea0bea7212333071f9a8a4731acdb2873a13010 | [
"BSD-3-Clause"
] | null | null | null | treenav/signals.py | itsdkey/django-treenav | cea0bea7212333071f9a8a4731acdb2873a13010 | [
"BSD-3-Clause"
] | null | null | null | treenav/signals.py | itsdkey/django-treenav | cea0bea7212333071f9a8a4731acdb2873a13010 | [
"BSD-3-Clause"
] | null | null | null | from django.core.cache import cache
from django.db.models.signals import post_save
def treenav_save_other_object_handler(sender, instance, created, **kwargs):
"""
This signal attempts to update the HREF of any menu items that point to
another model object, when that objects is saved.
"""
# import ... | 38.431373 | 80 | 0.719388 | from django.core.cache import cache
from django.db.models.signals import post_save
def treenav_save_other_object_handler(sender, instance, created, **kwargs):
"""
This signal attempts to update the HREF of any menu items that point to
another model object, when that objects is saved.
"""
# import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a97f3ec2def04d0f1232f5d84247ba74f4c8641b | 1,881 | py | Python | Model/predictor-dl-model/predictor_dl_model/pipeline/util.py | sanjaynirmal/blue-marlin | 725d614e941e5de76562d354edf11ac18897f242 | [
"Apache-2.0"
] | 1 | 2020-03-06T09:41:49.000Z | 2020-03-06T09:41:49.000Z | Model/predictor-dl-model/predictor_dl_model/pipeline/util.py | sanjaynirmal/blue-marlin | 725d614e941e5de76562d354edf11ac18897f242 | [
"Apache-2.0"
] | null | null | null | Model/predictor-dl-model/predictor_dl_model/pipeline/util.py | sanjaynirmal/blue-marlin | 725d614e941e5de76562d354edf11ac18897f242 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 35.490566 | 82 | 0.633174 | # 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... | 0 | 0 | 0 | 0 | 0 | 996 | 0 | -28 | 113 |
7e7184916186c2b8275c1c06b4d9ab8427d7189a | 8,459 | py | Python | cryptopalsolutions/sets/set1.py | maxwolfe/cryptopal-solutions | 525acfe4293597cd15e55dffb07d9e95c6fc44bb | [
"MIT"
] | null | null | null | cryptopalsolutions/sets/set1.py | maxwolfe/cryptopal-solutions | 525acfe4293597cd15e55dffb07d9e95c6fc44bb | [
"MIT"
] | null | null | null | cryptopalsolutions/sets/set1.py | maxwolfe/cryptopal-solutions | 525acfe4293597cd15e55dffb07d9e95c6fc44bb | [
"MIT"
] | null | null | null | """Cryptopals Set 1.
Basics
"""
| 28.385906 | 86 | 0.636837 | """Cryptopals Set 1.
Basics
"""
from base64 import b64decode
from dataclasses import dataclass
from itertools import zip_longest
import cryptopalsolutions.algorithms.binary as binary_helper
import cryptopalsolutions.algorithms.language as language_helper
import cryptopalsolutions.models.solutions as cryptopal_solutio... | 0 | 7,910 | 0 | 0 | 0 | 0 | 0 | 169 | 339 |
f10c30ce68ca580dba21c6ce0cff79266b24cb2f | 1,636 | py | Python | arima_util.py | jiaorenyu/koubei | 299421f1a96268ca3daafc01d91f1141cfd4f042 | [
"MIT"
] | null | null | null | arima_util.py | jiaorenyu/koubei | 299421f1a96268ca3daafc01d91f1141cfd4f042 | [
"MIT"
] | null | null | null | arima_util.py | jiaorenyu/koubei | 299421f1a96268ca3daafc01d91f1141cfd4f042 | [
"MIT"
] | null | null | null | import sys
import common
if __name__ == "__main__":
fn = sys.argv[1]
start_date = sys.argv[2]
end_date = sys.argv[3]
predict_start = sys.argv[4]
predict_end = sys.argv[5]
action_count = common.load_action_stat(fn)
count, date, real_value = get_history_pay(action_count, start_date, end_date... | 29.214286 | 109 | 0.65709 | import pandas as pd
import pyflux as pf
import sys
import date_util
import common
def get_history_pay(action_count, start_date, end_date, predict_start, predict_end):
date = []
count = []
date_list = date_util.get_date_list(start_date, end_date)
predict_list = date_util.get_date_list(predict_start, pre... | 0 | 0 | 0 | 0 | 0 | 977 | 0 | -9 | 112 |
93e421987f13120e22b8cc1acb04b40173de4857 | 137 | py | Python | tests/__init__.py | lchojnacki/master | 582553e6fa262a310511304f66cf94753308246c | [
"BSD-3-Clause"
] | 1 | 2021-06-11T12:32:12.000Z | 2021-06-11T12:32:12.000Z | tests/__init__.py | lchojnacki/master | 582553e6fa262a310511304f66cf94753308246c | [
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | lchojnacki/master | 582553e6fa262a310511304f66cf94753308246c | [
"BSD-3-Clause"
] | 2 | 2020-08-20T16:13:27.000Z | 2022-03-01T13:49:07.000Z | # TODO: Test verbose name and plural needed for translation.
# TODO: Incorporate HTML process to send message as text/html content type.
| 45.666667 | 75 | 0.788321 | # TODO: Test verbose name and plural needed for translation.
# TODO: Incorporate HTML process to send message as text/html content type.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f79f113487327846663a9bac2669e621e1e25c63 | 316 | py | Python | ZMQ(recommended)/python/client-server/manual_ip_port/client.py | enriquecoronadozu/NEP_samples | f3ec18011d38cbb6fa0903b45d4e046dcb0523f1 | [
"MIT"
] | 1 | 2021-04-23T03:56:45.000Z | 2021-04-23T03:56:45.000Z | ZMQ(recommended)/python/client-server/manual_ip_port/client.py | enriquecoronadozu/NEP_samples | f3ec18011d38cbb6fa0903b45d4e046dcb0523f1 | [
"MIT"
] | null | null | null | ZMQ(recommended)/python/client-server/manual_ip_port/client.py | enriquecoronadozu/NEP_samples | f3ec18011d38cbb6fa0903b45d4e046dcb0523f1 | [
"MIT"
] | null | null | null | import nep
import time
client = nep.client('127.0.0.1', 8000) # Create a new client instance
while True:
msg = {"message":"client request"} # Message to send as request
client.send_info(msg) # Send request
print (client.listen_info()) # Wait for server response
time.sleep(1) # Wait one second
| 28.727273 | 69 | 0.686709 | import nep
import time
client = nep.client('127.0.0.1', 8000) # Create a new client instance
while True:
msg = {"message":"client request"} # Message to send as request
client.send_info(msg) # Send request
print (client.listen_info()) # Wait for server response
time.sleep(1) # Wait one second
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5b7a58a561a63d7007b9296c84fb39a3aaf71504 | 4,445 | py | Python | quickdraw/code/main.py | nkarantzas/quick_draw | 756e5a7a20f617047ba15d3dc2fcc736b673e65e | [
"MIT"
] | null | null | null | quickdraw/code/main.py | nkarantzas/quick_draw | 756e5a7a20f617047ba15d3dc2fcc736b673e65e | [
"MIT"
] | null | null | null | quickdraw/code/main.py | nkarantzas/quick_draw | 756e5a7a20f617047ba15d3dc2fcc736b673e65e | [
"MIT"
] | null | null | null | import torch.nn as nn
if __name__ == '__main__':
main()
| 38.652174 | 101 | 0.64072 | from glob import glob
import os
import h5py
import resnet_one
import torch
from tqdm import tqdm
import torch.nn as nn
from flags import FLAGS
import json
from get_dataloaders import get_data
from training_functions import train_function, validation_function, validation_summary, test_function
from scoring_functions imp... | 0 | 0 | 0 | 0 | 0 | 4,037 | 0 | 80 | 265 |
8c9a6d4ff645386abb22e0b3c2a46918871ed8d6 | 814 | py | Python | locations/spiders/goodstart.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/goodstart.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/goodstart.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 24.666667 | 59 | 0.523342 | # -*- coding: utf-8 -*-
import re
import scrapy
import json
from locations.items import GeojsonPointItem
class GoodstartsSpider(scrapy.Spider):
name = "goodstart"
item_attributes = {"brand": "GoodStart Early Learning"}
allowed_domains = ["goodstart.org.au"]
start_urls = [
"https://www.goodst... | 0 | 0 | 0 | 683 | 0 | 0 | 0 | -7 | 113 |
90819ba5103155765a3fe6ab15f31da57a753251 | 801 | py | Python | src/processing/processing.py | martinjeannot/movie-recommendation-engine | dae5304c609ff725edcb5ac77fd25aee9a910725 | [
"MIT"
] | null | null | null | src/processing/processing.py | martinjeannot/movie-recommendation-engine | dae5304c609ff725edcb5ac77fd25aee9a910725 | [
"MIT"
] | null | null | null | src/processing/processing.py | martinjeannot/movie-recommendation-engine | dae5304c609ff725edcb5ac77fd25aee9a910725 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 33.375 | 96 | 0.701623 | from pathlib import Path
import numpy as np
import pandas as pd
def main():
data_path = (Path(__file__).parent / '../../data').resolve()
ratings = pd.read_csv(data_path / 'raw/ml-latest-small/ratings.csv')
ratings_matrix = ratings.pivot(index='userId', columns='movieId', values='rating').fillna(0)
#... | 0 | 0 | 0 | 0 | 0 | 672 | 0 | -2 | 90 |
944f6e94db8d871700ce068404145c8a4b62694a | 3,170 | py | Python | docs/cornell CS class/Lesson 29. Coroutines/demos/pipe.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/Lesson 29. Coroutines/demos/pipe.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/Lesson 29. Coroutines/demos/pipe.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
A module to show off a native coroutine pipeline.
This pipe allows us to send messages back-and-forth between coroutines,
simulating what we can do with the yield statement/expression. However,
it is very arcane it shows with the native coroutines are not as useful
for animation or other modern applications. In f... | 26.638655 | 71 | 0.63123 | """
A module to show off a native coroutine pipeline.
This pipe allows us to send messages back-and-forth between coroutines,
simulating what we can do with the yield statement/expression. However,
it is very arcane it shows with the native coroutines are not as useful
for animation or other modern applications. In f... | 0 | 0 | 1,145 | 1,397 | 0 | 0 | 0 | 0 | 69 |
dea1e8625da801ead3d87c5d23aecaca370e7052 | 744 | py | Python | tests/test_site_parser/test_get_page_html.py | PavliukKonstantin/wallpaper-downloader | 104b5ca1bfdb26b9132f7619406d4e756eb3654c | [
"MIT"
] | null | null | null | tests/test_site_parser/test_get_page_html.py | PavliukKonstantin/wallpaper-downloader | 104b5ca1bfdb26b9132f7619406d4e756eb3654c | [
"MIT"
] | null | null | null | tests/test_site_parser/test_get_page_html.py | PavliukKonstantin/wallpaper-downloader | 104b5ca1bfdb26b9132f7619406d4e756eb3654c | [
"MIT"
] | null | null | null | from wallpaper_downloader import site_parser
from bs4 import BeautifulSoup
def test_good_page_url():
"""
Test '_get_page_html' function of site_parser module.
Function is tested with the good URL of the page.
"""
page_html = site_parser._get_page_html(
"https://www.smashingmagazine.com/ca... | 24 | 67 | 0.672043 | from wallpaper_downloader import site_parser
from bs4 import BeautifulSoup
def test_good_page_url():
"""
Test '_get_page_html' function of site_parser module.
Function is tested with the good URL of the page.
"""
page_html = site_parser._get_page_html(
"https://www.smashingmagazine.com/ca... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b36748b221bcc039ee582de8745f4ffb93eb4da | 7,932 | py | Python | mirrorscript-v2.py | VineetBhawsar/Kali-Linux-Repository-Mirrorscript | b72279ba5cb57e48fce4ed36bd5cdf14e8dea00d | [
"MIT"
] | null | null | null | mirrorscript-v2.py | VineetBhawsar/Kali-Linux-Repository-Mirrorscript | b72279ba5cb57e48fce4ed36bd5cdf14e8dea00d | [
"MIT"
] | null | null | null | mirrorscript-v2.py | VineetBhawsar/Kali-Linux-Repository-Mirrorscript | b72279ba5cb57e48fce4ed36bd5cdf14e8dea00d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Mirrorscript v2 By Hazmirul Afiq
import subprocess, requests, re, sys
import operator
import argparse, apt, os
import threading
from shutil import copyfile
result_url = []
ping_result = []
mirrors = {}
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, l... | 30.045455 | 162 | 0.652168 | #!/usr/bin/python3
# Mirrorscript v2 By Hazmirul Afiq
import subprocess, requests, re, sys
import operator
import argparse, apt, os
import threading
from shutil import copyfile
result_url = []
ping_result = []
mirrors = {}
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, l... | 0 | 0 | 0 | 1,618 | 0 | 727 | 0 | 0 | 115 |
070315fbed82ed038c3dadff4cc995095b5a78dd | 4,234 | py | Python | src/spn/structure/leaves/parametric/MPE.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 199 | 2018-11-13T10:37:45.000Z | 2022-02-06T17:07:28.000Z | src/spn/structure/leaves/parametric/MPE.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 46 | 2018-11-30T13:40:38.000Z | 2022-01-22T21:05:07.000Z | src/spn/structure/leaves/parametric/MPE.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 78 | 2018-11-13T10:37:48.000Z | 2022-03-14T21:34:13.000Z | """
Created on July 02, 2018
@author: Alejandro Molina
"""
import logging
logger = logging.getLogger(__name__)
| 27.855263 | 120 | 0.70359 | """
Created on July 02, 2018
@author: Alejandro Molina
"""
from spn.algorithms.MPE import get_mpe_top_down_leaf, add_node_mpe
from spn.structure.leaves.parametric.Inference import continuous_log_likelihood, gamma_log_likelihood, \
discrete_log_likelihood, categorical_log_likelihood, categorical_dictionary_log_like... | 0 | 0 | 0 | 0 | 0 | 3,517 | 0 | 443 | 158 |
1628492f0fa3bfdbfaadb16b61c20a45afdf47df | 12,159 | py | Python | simscale_sdk/models/pressure_inlet_bc.py | slainesimscale/simscale-python-sdk | db483eeabe558e55d020f5f829a3bf13c9c287a7 | [
"MIT"
] | 8 | 2021-01-22T13:41:03.000Z | 2022-01-03T09:00:10.000Z | simscale_sdk/models/pressure_inlet_bc.py | slainesimscale/simscale-python-sdk | db483eeabe558e55d020f5f829a3bf13c9c287a7 | [
"MIT"
] | null | null | null | simscale_sdk/models/pressure_inlet_bc.py | slainesimscale/simscale-python-sdk | db483eeabe558e55d020f5f829a3bf13c9c287a7 | [
"MIT"
] | 3 | 2021-03-18T15:52:52.000Z | 2022-01-03T08:59:30.000Z | # coding: utf-8
"""
SimScale API
The version of the OpenAPI document: 0.0.0
Generated by: https://openapi-generator.tech
"""
| 31.664063 | 305 | 0.64076 | # coding: utf-8
"""
SimScale API
The version of the OpenAPI document: 0.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from simscale_sdk.configuration import Configuration
class PressureInletBC(object):
"""NOTE: This class is auto generated ... | 0 | 6,508 | 0 | 5,382 | 0 | 0 | 0 | 0 | 128 |
eb213d6bd854228c7adc6f7b3b8654771cb9a171 | 32,145 | py | Python | models/action.py | u-n-i-c-o-rn/jimiPlugin-inga | bfbde6d3412b56360288c5b7baceea31a33115e8 | [
"Apache-2.0"
] | null | null | null | models/action.py | u-n-i-c-o-rn/jimiPlugin-inga | bfbde6d3412b56360288c5b7baceea31a33115e8 | [
"Apache-2.0"
] | null | null | null | models/action.py | u-n-i-c-o-rn/jimiPlugin-inga | bfbde6d3412b56360288c5b7baceea31a33115e8 | [
"Apache-2.0"
] | null | null | null |
# Remote / Local Fuctions | 48.630862 | 275 | 0.539773 | import time
import uuid
import re
from pathlib import Path
import subprocess
import requests
import base64
from netaddr import *
from urllib3.exceptions import InsecureRequestWarning
from core import settings, helpers, audit, db, storage
from core.models import action
from plugins.inga.models import inga
from plugins.... | 0 | 0 | 0 | 28,642 | 0 | 2,776 | 0 | 81 | 619 |