hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790a221827a535b0708b790e6c2386085beca3fa | 1,228 | py | Python | backend/tests/email_generators/test_event_location_changed.py | fjacob21/mididecweb | b65f28eb6fdeafa265796b6190a4264a5eac54ce | [
"MIT"
] | null | null | null | backend/tests/email_generators/test_event_location_changed.py | fjacob21/mididecweb | b65f28eb6fdeafa265796b6190a4264a5eac54ce | [
"MIT"
] | 88 | 2016-11-12T14:54:38.000Z | 2018-08-02T00:25:07.000Z | backend/tests/email_generators/test_event_location_changed.py | mididecouverte/mididecweb | b65f28eb6fdeafa265796b6190a4264a5eac54ce | [
"MIT"
] | null | null | null | import pytest
from datetime import datetime, timedelta
import pytz
from bs4 import BeautifulSoup
from src.events import Events
from src.users import Users
from src.user import USER_ACCESS_MANAGER
from src.stores import MemoryStore
from src.email_generators import EventLocationChangedEmail
def test_event_location_chan... | 38.375 | 85 | 0.664495 | import pytest
from datetime import datetime, timedelta
import pytz
from bs4 import BeautifulSoup
from src.events import Events
from src.users import Users
from src.user import USER_ACCESS_MANAGER
from src.stores import MemoryStore
from src.email_generators import EventLocationChangedEmail
def test_event_location_chan... | true | true |
790a2249caf62e7895bf6298fd64cbf42158f83a | 980 | py | Python | tests/mimetest.py | seantis/mailthon | 610e29fd3d89267f9b9fd7ba0e18e312a1c1c0f6 | [
"MIT"
] | 230 | 2015-05-21T04:44:20.000Z | 2021-12-01T00:47:05.000Z | tests/mimetest.py | seantis/mailthon | 610e29fd3d89267f9b9fd7ba0e18e312a1c1c0f6 | [
"MIT"
] | 33 | 2015-05-22T18:48:59.000Z | 2020-12-18T09:37:33.000Z | tests/mimetest.py | seantis/mailthon | 610e29fd3d89267f9b9fd7ba0e18e312a1c1c0f6 | [
"MIT"
] | 33 | 2015-05-23T10:49:54.000Z | 2020-12-11T11:05:35.000Z | from re import search
from base64 import b64decode
from email.message import Message
class mimetest:
def __init__(self, mime):
self.mime = mime
assert not mime.defects
def __getitem__(self, header):
return self.mime[header]
@property
def transfer_encoding(self):
retur... | 22.790698 | 74 | 0.642857 | from re import search
from base64 import b64decode
from email.message import Message
class mimetest:
def __init__(self, mime):
self.mime = mime
assert not mime.defects
def __getitem__(self, header):
return self.mime[header]
@property
def transfer_encoding(self):
retur... | true | true |
790a26b2ecc1936ebb0585bcc8ec4ce375423bfc | 9,144 | py | Python | fairseq_cli/eval_lm.py | liangan1/fairseq | 31b54e8ec03824bad61a80bea376c987e2e7c721 | [
"MIT"
] | null | null | null | fairseq_cli/eval_lm.py | liangan1/fairseq | 31b54e8ec03824bad61a80bea376c987e2e7c721 | [
"MIT"
] | null | null | null | fairseq_cli/eval_lm.py | liangan1/fairseq | 31b54e8ec03824bad61a80bea376c987e2e7c721 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Evaluate the perplexity of a trained language model.
"""
import logging
import math
import os
import torch
fr... | 34.119403 | 112 | 0.585302 |
import logging
import math
import os
import torch
from fairseq import checkpoint_utils, options, tasks, utils
from fairseq.data import LMContextWindowDataset
from fairseq.logging import progress_bar
from fairseq.logging.meters import StopwatchMeter, TimeMeter
from fairseq.sequence_scorer import SequenceScorer
... | true | true |
790a2738b083790991dabb936f5922bade827531 | 26,978 | py | Python | tests/flytekit/unit/core/test_type_hints.py | sbrunk/flytekit | 0aa9cdb1be928f799170da61f1135121ccb64657 | [
"Apache-2.0"
] | null | null | null | tests/flytekit/unit/core/test_type_hints.py | sbrunk/flytekit | 0aa9cdb1be928f799170da61f1135121ccb64657 | [
"Apache-2.0"
] | null | null | null | tests/flytekit/unit/core/test_type_hints.py | sbrunk/flytekit | 0aa9cdb1be928f799170da61f1135121ccb64657 | [
"Apache-2.0"
] | null | null | null | import datetime
import os
import typing
from dataclasses import dataclass
import pandas
import pytest
from dataclasses_json import dataclass_json
import flytekit
from flytekit import ContainerTask, SQLTask, dynamic, kwtypes, maptask
from flytekit.common.translator import get_serializable
from flytekit.core import con... | 27.333333 | 117 | 0.5814 | import datetime
import os
import typing
from dataclasses import dataclass
import pandas
import pytest
from dataclasses_json import dataclass_json
import flytekit
from flytekit import ContainerTask, SQLTask, dynamic, kwtypes, maptask
from flytekit.common.translator import get_serializable
from flytekit.core import con... | true | true |
790a285d87c8d61d8b263589f416094d3fc693dc | 2,487 | py | Python | utils/utils.py | tperrier/mwachx | 94616659dc29843e661b2ecc9a2e7f1d4e81b5a4 | [
"Apache-2.0"
] | 3 | 2015-05-27T14:35:49.000Z | 2016-02-26T21:04:32.000Z | utils/utils.py | tperrier/mwachx | 94616659dc29843e661b2ecc9a2e7f1d4e81b5a4 | [
"Apache-2.0"
] | 375 | 2015-01-31T10:08:34.000Z | 2021-06-10T19:44:21.000Z | utils/utils.py | tperrier/mwachx | 94616659dc29843e661b2ecc9a2e7f1d4e81b5a4 | [
"Apache-2.0"
] | 6 | 2016-01-10T19:52:41.000Z | 2020-06-15T22:07:24.000Z | import datetime
from constance import config
from django.conf import settings
from django.utils import dateparse , timezone
import django.db.models as db
def today(today=None):
if today is not None:
return dateparse.parse_date(today) if isinstance(today,basestring) else today
elif not getattr(settings,... | 33.608108 | 110 | 0.686771 | import datetime
from constance import config
from django.conf import settings
from django.utils import dateparse , timezone
import django.db.models as db
def today(today=None):
if today is not None:
return dateparse.parse_date(today) if isinstance(today,basestring) else today
elif not getattr(settings,... | true | true |
790a292b8c7580b1fc8ea666e1f9ccc712fd9c7d | 1,664 | py | Python | src/sagemaker_training/_entry_point_type.py | bstriner/sagemaker-training-toolkit | 81a4323761a5327baaf0d24157b9428919b5cc67 | [
"Apache-2.0"
] | 248 | 2020-04-21T09:25:03.000Z | 2022-03-24T22:24:26.000Z | src/sagemaker_training/_entry_point_type.py | bstriner/sagemaker-training-toolkit | 81a4323761a5327baaf0d24157b9428919b5cc67 | [
"Apache-2.0"
] | 68 | 2020-04-22T09:31:18.000Z | 2022-03-19T06:44:36.000Z | src/sagemaker_training/_entry_point_type.py | bstriner/sagemaker-training-toolkit | 81a4323761a5327baaf0d24157b9428919b5cc67 | [
"Apache-2.0"
] | 60 | 2020-06-02T20:52:24.000Z | 2022-03-16T18:20:41.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file acc... | 32.627451 | 77 | 0.722957 |
import enum
import os
class _EntryPointType(enum.Enum):
PYTHON_PACKAGE = "PYTHON_PACKAGE"
PYTHON_PROGRAM = "PYTHON_PROGRAM"
COMMAND = "COMMAND"
PYTHON_PACKAGE = _EntryPointType.PYTHON_PACKAGE
PYTHON_PROGRAM = _EntryPointType.PYTHON_PROGRAM
COMMAND = _EntryPointType.COMMAND
def get(path, n... | true | true |
790a29d4059727dd8a425c767125df4baaa22f15 | 459 | py | Python | simple_notes/notes/migrations/0004_auto_20201008_0513.py | Namnetsy/simple-notes-django-app | 385fa829c43162e1c1a4682acc4668623e6e47b3 | [
"MIT"
] | null | null | null | simple_notes/notes/migrations/0004_auto_20201008_0513.py | Namnetsy/simple-notes-django-app | 385fa829c43162e1c1a4682acc4668623e6e47b3 | [
"MIT"
] | 9 | 2021-04-08T20:20:53.000Z | 2022-03-12T00:54:21.000Z | simple_notes/notes/migrations/0004_auto_20201008_0513.py | Namnetsy/simple-notes-django-app | 385fa829c43162e1c1a4682acc4668623e6e47b3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-08 05:13
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('notes', '0003_auto_20201006_0607'),
]
operations = [
... | 22.95 | 66 | 0.649237 |
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('notes', '0003_auto_20201006_0607'),
]
operations = [
migrations.AlterUniqueTogether(
... | true | true |
790a2a7d0397802902407a821f1b2a9907c9836c | 17,528 | py | Python | instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py | sanketmehta28/opentelemetry-python-contrib | f7fd1e069313dce6c4939146ade173a727cc4104 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2019-11-26T14:31:09.000Z | 2020-01-09T23:04:49.000Z | instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py | sanketmehta28/opentelemetry-python-contrib | f7fd1e069313dce6c4939146ade173a727cc4104 | [
"Apache-2.0",
"BSD-3-Clause"
] | 16 | 2020-02-07T10:01:02.000Z | 2020-04-06T22:03:31.000Z | instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py | sanketmehta28/opentelemetry-python-contrib | f7fd1e069313dce6c4939146ade173a727cc4104 | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2020-02-05T14:59:12.000Z | 2020-04-03T15:34:16.000Z | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.82397 | 124 | 0.641545 |
import abc
from unittest import mock
import httpretty
import requests
from requests.adapters import BaseAdapter
from requests.models import Response
import opentelemetry.instrumentation.requests
from opentelemetry import context, trace
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_K... | true | true |
790a2aa0390a9b66315c4b5f2fa235aaf4e751e1 | 2,530 | py | Python | copasi/bindings/python/unittests/Test_CMoiety.py | bmoreau/COPASI | d0bbec8947b1266ffd2b0ecf2566da7cf2c3e5ba | [
"Artistic-2.0"
] | null | null | null | copasi/bindings/python/unittests/Test_CMoiety.py | bmoreau/COPASI | d0bbec8947b1266ffd2b0ecf2566da7cf2c3e5ba | [
"Artistic-2.0"
] | null | null | null | copasi/bindings/python/unittests/Test_CMoiety.py | bmoreau/COPASI | d0bbec8947b1266ffd2b0ecf2566da7cf2c3e5ba | [
"Artistic-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Begin CVS Header
# $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/bindings/python/unittests/Test_CMoiety.py,v $
# $Revision: 1.11 $
# $Name: $
# $Author: shoops $
# $Date: 2010/07/16 18:55:59 $
# End CVS Header
# Copyright (C) 2010 by Pedro Mendes, Virginia Tech I... | 30.119048 | 108 | 0.696838 |
import COPASI
import unittest
from types import *
class Test_CMoiety(unittest.TestCase):
def setUp(self):
self.datamodel=COPASI.CCopasiRootContainer.addDatamodel()
self.model=self.datamodel.getModel()
self.model.createCompartment("comp1",1.0)
self.model.createCompartment("comp2",2... | true | true |
790a2c7cd415c6e41a96218f164884bbd0d995f7 | 697 | py | Python | ironic_inventory/tests/test_functional.py | softlayer/ironic-inventory-integrator | 1c7650bb2479939da6af910a80689103d32c75e3 | [
"Apache-2.0"
] | 1 | 2016-04-28T19:13:58.000Z | 2016-04-28T19:13:58.000Z | ironic_inventory/tests/test_functional.py | softlayer/ironic-inventory-integrator | 1c7650bb2479939da6af910a80689103d32c75e3 | [
"Apache-2.0"
] | null | null | null | ironic_inventory/tests/test_functional.py | softlayer/ironic-inventory-integrator | 1c7650bb2479939da6af910a80689103d32c75e3 | [
"Apache-2.0"
] | 1 | 2016-03-13T07:40:36.000Z | 2016-03-13T07:40:36.000Z | from unittest import TestCase
from webtest import TestApp
from ironic_inventory.tests import FunctionalTest
class TestRootController(FunctionalTest):
def test_get(self):
response = self.app.get('/')
assert response.status_int == 200
def test_search(self):
response = self.app.post('/'... | 30.304348 | 69 | 0.657102 | from unittest import TestCase
from webtest import TestApp
from ironic_inventory.tests import FunctionalTest
class TestRootController(FunctionalTest):
def test_get(self):
response = self.app.get('/')
assert response.status_int == 200
def test_search(self):
response = self.app.post('/'... | true | true |
790a2cb7f6339a5c9eb59efad748387b5e044992 | 12,797 | py | Python | keystone/models/revoke_model.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/models/revoke_model.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/models/revoke_model.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 36.562857 | 79 | 0.650231 |
from oslo_serialization import msgpackutils
from oslo_utils import timeutils
from six.moves import map
from keystone.common import cache
from keystone.common import utils
_NAMES = ['trust_id',
'consumer_id',
'access_token_id',
'audit_id',
'audit_chain_id',
... | true | true |
790a2fa8698fdd638a81ff20f5940ba01d810cb6 | 195 | py | Python | Code.py | Awesome12-arch/Python-Reminder-Application | 974d63e945676d8d88db987e100012f6414c9528 | [
"MIT"
] | null | null | null | Code.py | Awesome12-arch/Python-Reminder-Application | 974d63e945676d8d88db987e100012f6414c9528 | [
"MIT"
] | null | null | null | Code.py | Awesome12-arch/Python-Reminder-Application | 974d63e945676d8d88db987e100012f6414c9528 | [
"MIT"
] | null | null | null | import time
print("What shall I remind you about?")
text = str(input())
print("In how many minutes ?")
local_time = float(input())
local_time = local_time * 60
time.sleep(local_time)
print(text)
| 21.666667 | 39 | 0.728205 | import time
print("What shall I remind you about?")
text = str(input())
print("In how many minutes ?")
local_time = float(input())
local_time = local_time * 60
time.sleep(local_time)
print(text)
| true | true |
790a2fc209c2a8bb8a66d339807c4d97014f4534 | 73,893 | py | Python | discord/message.py | NQN-Discord/discord.py | 2fd948acfa818cfde7feb71c8bc20778c87ac39b | [
"MIT"
] | null | null | null | discord/message.py | NQN-Discord/discord.py | 2fd948acfa818cfde7feb71c8bc20778c87ac39b | [
"MIT"
] | null | null | null | discord/message.py | NQN-Discord/discord.py | 2fd948acfa818cfde7feb71c8bc20778c87ac39b | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 36.239823 | 179 | 0.613306 |
from __future__ import annotations
import asyncio
import datetime
import re
import io
from os import PathLike
from typing import (
Dict,
TYPE_CHECKING,
Sequence,
Union,
List,
Optional,
Any,
Callable,
Tuple,
ClassVar,
Type,
overload,
)
from . import utils
from .reaction... | true | true |
790a300e9c50914e34d93bb7a7af54da5ee62d4d | 3,035 | py | Python | lib/pubtal/DateContext.py | owlfish/pubtal | fb20a0acf2769b2c06012b65bd462f02da12bd1c | [
"BSD-3-Clause"
] | null | null | null | lib/pubtal/DateContext.py | owlfish/pubtal | fb20a0acf2769b2c06012b65bd462f02da12bd1c | [
"BSD-3-Clause"
] | null | null | null | lib/pubtal/DateContext.py | owlfish/pubtal | fb20a0acf2769b2c06012b65bd462f02da12bd1c | [
"BSD-3-Clause"
] | null | null | null | """ A class that can provide a date/time in any timeformat.format() format and both
local and UTC timezones within a ContextVariable.
Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted pr... | 38.417722 | 93 | 0.730478 | import re, time, math, string
import timeformat
from simpletal import simpleTALES
PATHREGEX = re.compile ('^((?:local)|(?:utc))/?(.*)$')
class Date (simpleTALES.ContextVariable):
def __init__ (self, value = None, defaultFormat = '%a[SHORT], %d %b[SHORT] %Y %H:%M:%S %Z'):
self.ourValue = value
self.defaultFormat ... | true | true |
790a309ea229283fa6080c94713b6f66529013fa | 461 | py | Python | codigo/Live176/exemplos_dos_slides/exemplo_05.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 572 | 2018-04-03T03:17:08.000Z | 2022-03-31T19:05:32.000Z | codigo/Live176/exemplos_dos_slides/exemplo_05.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 176 | 2018-05-18T15:56:16.000Z | 2022-03-28T20:39:07.000Z | codigo/Live176/exemplos_dos_slides/exemplo_05.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 140 | 2018-04-18T13:59:11.000Z | 2022-03-29T00:43:49.000Z | """Exemplo de como virar[flip] imagems."""
from PIL import Image
# Abre a imagem
im = Image.open('beijo_menor.jpg')
# Flip
im.transpose(Image.FLIP_LEFT_RIGHT).show() # Invete na horizontal
im.transpose(Image.FLIP_TOP_BOTTOM).show() # Invete na vertical
# Transposição
im.transpose(Image.ROTATE_90).show()
im.transpo... | 27.117647 | 66 | 0.761388 | from PIL import Image
im = Image.open('beijo_menor.jpg')
im.transpose(Image.FLIP_LEFT_RIGHT).show()
im.transpose(Image.FLIP_TOP_BOTTOM).show()
im.transpose(Image.ROTATE_90).show()
im.transpose(Image.ROTATE_180).show()
im.transpose(Image.ROTATE_270).show()
im.transpose(Image.TRANSPOSE).show()
im.transpose(Imag... | true | true |
790a31602a2e6231958a1ed23fbe61a5ef5fd6fa | 23 | py | Python | examples/ndfd/ndfd.py | eLBati/pyxb | 14737c23a125fd12c954823ad64fc4497816fae3 | [
"Apache-2.0"
] | 123 | 2015-01-12T06:43:22.000Z | 2022-03-20T18:06:46.000Z | examples/ndfd/ndfd.py | eLBati/pyxb | 14737c23a125fd12c954823ad64fc4497816fae3 | [
"Apache-2.0"
] | 103 | 2015-01-08T18:35:57.000Z | 2022-01-18T01:44:14.000Z | examples/ndfd/ndfd.py | eLBati/pyxb | 14737c23a125fd12c954823ad64fc4497816fae3 | [
"Apache-2.0"
] | 54 | 2015-02-15T17:12:00.000Z | 2022-03-07T23:02:32.000Z | from raw.ndfd import *
| 11.5 | 22 | 0.73913 | from raw.ndfd import *
| true | true |
790a31901607e0e43d54b9c3e5faabe14c2fa874 | 1,017 | py | Python | meerkat/views/simple.py | by46/meerkat | 41376dc1636b5975a50020bad5632b4edbf5b16d | [
"MIT"
] | null | null | null | meerkat/views/simple.py | by46/meerkat | 41376dc1636b5975a50020bad5632b4edbf5b16d | [
"MIT"
] | null | null | null | meerkat/views/simple.py | by46/meerkat | 41376dc1636b5975a50020bad5632b4edbf5b16d | [
"MIT"
] | null | null | null | import string
from flask import Blueprint
from flask import abort
from flask import redirect
from flask import render_template
from meerkat import utils
from meerkat.db import DataAccess
page = Blueprint('simple', __name__)
@page.route('/simple/')
def simple_index():
links = DataAccess.get_libs(... | 26.763158 | 77 | 0.679449 | import string
from flask import Blueprint
from flask import abort
from flask import redirect
from flask import render_template
from meerkat import utils
from meerkat.db import DataAccess
page = Blueprint('simple', __name__)
@page.route('/simple/')
def simple_index():
links = DataAccess.get_libs(... | true | true |
790a351ab08745d337dc403b70ab76fc5f969c80 | 1,407 | py | Python | quantum/plugins/cisco/nexus/cisco_nexus_configuration.py | r-mibu/neutron | 7aebe2468bdcc1befef7d09136fdedafcb0049ec | [
"Apache-2.0"
] | null | null | null | quantum/plugins/cisco/nexus/cisco_nexus_configuration.py | r-mibu/neutron | 7aebe2468bdcc1befef7d09136fdedafcb0049ec | [
"Apache-2.0"
] | null | null | null | quantum/plugins/cisco/nexus/cisco_nexus_configuration.py | r-mibu/neutron | 7aebe2468bdcc1befef7d09136fdedafcb0049ec | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 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... | 34.317073 | 78 | 0.739161 |
from quantum.common.utils import find_config_file
from quantum.plugins.cisco.common import cisco_configparser as confp
CP = confp.CiscoConfigParser(find_config_file({'plugin': 'cisco'},
"nexus.ini"))
SECTION = CP['SWITCH']
NEXUS_IP_ADDRESS = SECTION['nexus_ip_address'... | true | true |
790a382f05c75e9ec22248774e92d49b634a4a6b | 8,937 | py | Python | pysnmp/smi/mibs/SNMPv2-TM.py | RKinsey/pysnmp | 96b5cf31e2f5d19f34d0dd1075014c488f6a5789 | [
"BSD-2-Clause"
] | 492 | 2016-03-13T11:03:13.000Z | 2022-03-21T02:52:57.000Z | pysnmp/smi/mibs/SNMPv2-TM.py | bartomo/pysnmp | becd15c79c9a6b5696928ecd50bf5cca8b1770a1 | [
"BSD-2-Clause"
] | 372 | 2016-03-29T22:42:05.000Z | 2022-03-26T10:28:25.000Z | pysnmp/smi/mibs/SNMPv2-TM.py | bartomo/pysnmp | becd15c79c9a6b5696928ecd50bf5cca8b1770a1 | [
"BSD-2-Clause"
] | 197 | 2016-03-13T11:01:54.000Z | 2022-03-07T19:52:15.000Z | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysnmp/license.html
#
# ASN.1 source http://mibs.snmplabs.com:80/asn1/SNMPv2-TM
# Produced by pysmi-0.4.0 at Sun Feb 17 08:56:38 2019
#
# Parts of otherwise autogenerated MIB has been u... | 28.92233 | 109 | 0.71176 |
try:
from socket import inet_ntop, inet_pton, AF_INET
except ImportError:
from socket import inet_ntoa, inet_aton, AF_INET
inet_ntop = lambda x, y: inet_ntoa(y)
inet_pton = lambda x, y: inet_aton(y)
from pyasn1.compat.octets import int2oct
from pyasn1.compat.octets import oct2int
if 'mib... | true | true |
790a387be1dd9111b47fa150bd553d8f2d43cd43 | 5,002 | py | Python | kubernetes/client/models/io_xk8s_cluster_v1alpha4_machine_spec_bootstrap.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_xk8s_cluster_v1alpha4_machine_spec_bootstrap.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_xk8s_cluster_v1alpha4_machine_spec_bootstrap.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 33.57047 | 157 | 0.645942 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class IoXK8sClusterV1alpha4MachineSpecBootstrap(object):
openapi_types = {
'config_ref': 'IoXK8sClusterV1alpha4MachineSpecBootstrapConfigRef',
'data_secret_name': 'str'
}
attribute_map = ... | true | true |
790a3995c4a227a6dddb3783247357c4a32e4718 | 7,721 | py | Python | sympy/codegen/rewriting.py | MartinThoma/sympy | 009d0031bec7222ffa472e52148a2b4e441cd3a5 | [
"BSD-3-Clause"
] | 2 | 2019-05-18T22:36:49.000Z | 2019-05-24T05:56:16.000Z | sympy/codegen/rewriting.py | mmelotti/sympy | bea29026d27cc50c2e6a5501b6a70a9629ed3e18 | [
"BSD-3-Clause"
] | 1 | 2020-04-22T12:45:26.000Z | 2020-04-22T12:45:26.000Z | sympy/codegen/rewriting.py | mmelotti/sympy | bea29026d27cc50c2e6a5501b6a70a9629ed3e18 | [
"BSD-3-Clause"
] | 3 | 2019-05-18T21:32:31.000Z | 2019-07-26T11:05:46.000Z | """
Classes and functions useful for rewriting expressions for optimized code
generation. Some languages (or standards thereof), e.g. C99, offer specialized
math functions for better performance and/or precision.
Using the ``optimize`` function in this module, together with a collection of
rules (represented as instan... | 30.278431 | 96 | 0.643051 | from itertools import chain
from sympy import log, exp, Max, Min, Wild, expand_log, Dummy
from sympy.assumptions import Q, ask
from sympy.codegen.cfunctions import log1p, log2, exp2, expm1
from sympy.codegen.matrix_nodes import MatrixSolve
from sympy.core.expr import UnevaluatedExpr
from sympy.core.mul import Mul
from ... | true | true |
790a3a0571330e3c1221e6178016abcb51459297 | 1,105 | py | Python | infertrade/algos/community/__init__.py | holderfolyf/infertrade | db46d35244c01d595ae0fc5ad896101ec2a3fb57 | [
"Apache-2.0"
] | null | null | null | infertrade/algos/community/__init__.py | holderfolyf/infertrade | db46d35244c01d595ae0fc5ad896101ec2a3fb57 | [
"Apache-2.0"
] | null | null | null | infertrade/algos/community/__init__.py | holderfolyf/infertrade | db46d35244c01d595ae0fc5ad896101ec2a3fb57 | [
"Apache-2.0"
] | null | null | null | """
Functions for signals and positions created within this package.
Copyright 2021 InferStat 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
Un... | 39.464286 | 113 | 0.819005 |
from infertrade.PandasEnum import PandasEnum
from infertrade.algos.community.allocations import scikit_allocation_factory, infertrade_export_allocations
from infertrade.algos.community.signals import normalised_close, scikit_signal_factory, infertrade_export_signals
infertrade_export = {
"signal": infertrade_exp... | true | true |
790a3cbe4a9fb22354647695cb3667d39b29f240 | 37,137 | py | Python | vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | sharang-d/kops | 35cf4a352e2e115714f3d28fbda81feec2ae8a4e | [
"Apache-2.0"
] | 76 | 2017-12-18T21:56:50.000Z | 2021-11-19T13:18:29.000Z | vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | sharang-d/kops | 35cf4a352e2e115714f3d28fbda81feec2ae8a4e | [
"Apache-2.0"
] | 23 | 2017-12-18T18:23:20.000Z | 2018-02-28T08:38:50.000Z | vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | sharang-d/kops | 35cf4a352e2e115714f3d28fbda81feec2ae8a4e | [
"Apache-2.0"
] | 17 | 2017-12-06T15:21:21.000Z | 2022-02-18T04:50:28.000Z | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.878848 | 79 | 0.683819 |
import base64
import os
import re
import random
import shutil
import socket
import string
import json
import ipaddress
import charms.leadership
from shlex import split
from subprocess import check_call
from subprocess import check_output
from subprocess import CalledProcessError
from charms import la... | true | true |
790a3d59aa4af9a835a878db0704ae15286d09b4 | 1,875 | py | Python | whole_foods_delivery_slot_firefox.py | jtravisnorton/Whole-Foods-Delivery-Slot | abf81267d25afe7238135ee5841b9155d4f1071b | [
"Apache-2.0"
] | 519 | 2020-03-30T05:01:59.000Z | 2022-01-28T15:10:28.000Z | whole_foods_delivery_slot_firefox.py | jtravisnorton/Whole-Foods-Delivery-Slot | abf81267d25afe7238135ee5841b9155d4f1071b | [
"Apache-2.0"
] | 64 | 2020-03-30T19:09:21.000Z | 2021-03-03T17:59:31.000Z | whole_foods_delivery_slot_firefox.py | jtravisnorton/Whole-Foods-Delivery-Slot | abf81267d25afe7238135ee5841b9155d4f1071b | [
"Apache-2.0"
] | 189 | 2020-03-30T21:01:11.000Z | 2022-03-31T08:16:02.000Z | import bs4
from selenium import webdriver
import sys
import time
import os
def getWFSlot(productUrl):
driver = webdriver.Firefox()
driver.get(productUrl)
html = driver.page_source
soup = bs4.BeautifulSoup(html)
time.sleep(60)
no_open_slots = True
while no_open_slots:
driver.re... | 30.737705 | 104 | 0.6256 | import bs4
from selenium import webdriver
import sys
import time
import os
def getWFSlot(productUrl):
driver = webdriver.Firefox()
driver.get(productUrl)
html = driver.page_source
soup = bs4.BeautifulSoup(html)
time.sleep(60)
no_open_slots = True
while no_open_slots:
driver.re... | true | true |
790a3e9e46b7dca599ff65138be11f6962e19dcc | 16,655 | py | Python | pymatgen/io/vasp/tests/test_sets.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | 1 | 2015-05-18T14:31:20.000Z | 2015-05-18T14:31:20.000Z | pymatgen/io/vasp/tests/test_sets.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | null | null | null | pymatgen/io/vasp/tests/test_sets.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import unittest
import os
import shutil
import numpy as np
from monty.json import MontyDecoder
from pymatgen.io.vasp.sets import MITVaspInputSet, MITHSEVaspInputSet, \
MPVaspInputSet, MITGGAVaspInputSet, MITNEBVaspInputSet,\
MPStaticVaspInputSet, MPNon... | 39.940048 | 91 | 0.616331 |
from __future__ import unicode_literals
import unittest
import os
import shutil
import numpy as np
from monty.json import MontyDecoder
from pymatgen.io.vasp.sets import MITVaspInputSet, MITHSEVaspInputSet, \
MPVaspInputSet, MITGGAVaspInputSet, MITNEBVaspInputSet,\
MPStaticVaspInputSet, MPNonSCFVaspInputSet... | true | true |
790a3eb6d4ca4e63976f0726a55f649a8308636b | 1,302 | py | Python | Lecture_3_Agents/Exercise1/Exercises/reflex_vacuum_agent.py | aleksander-GD/AI-F20 | c5d086e317f657c1b7a2d2179eafcef0267755ed | [
"MIT"
] | null | null | null | Lecture_3_Agents/Exercise1/Exercises/reflex_vacuum_agent.py | aleksander-GD/AI-F20 | c5d086e317f657c1b7a2d2179eafcef0267755ed | [
"MIT"
] | null | null | null | Lecture_3_Agents/Exercise1/Exercises/reflex_vacuum_agent.py | aleksander-GD/AI-F20 | c5d086e317f657c1b7a2d2179eafcef0267755ed | [
"MIT"
] | null | null | null | A = 'A'
B = 'B'
Environment = {
A: 'Dirty',
B: 'Dirty',
'Current': A
}
def REFLEX_VACUUM_AGENT(loc_st): # Determine action
if loc_st[1] == 'Dirty':
return 'Suck'
if loc_st[0] == A:
return 'Right'
if loc_st[0] == B:
return 'Left'
def Sensors(): # Sense Environment
... | 26.571429 | 73 | 0.592934 | A = 'A'
B = 'B'
Environment = {
A: 'Dirty',
B: 'Dirty',
'Current': A
}
def REFLEX_VACUUM_AGENT(loc_st):
if loc_st[1] == 'Dirty':
return 'Suck'
if loc_st[0] == A:
return 'Right'
if loc_st[0] == B:
return 'Left'
def Sensors():
location = Environment['Current']
... | true | true |
790a3f0b2709166a3728a66ccd30986d5f1f1278 | 905 | py | Python | genmenu/gen_wiki_sitemap.py | RustFisher/python-playground | 3851eedd3db58d0e7de149da35f44356c7caa3f6 | [
"MIT"
] | 2 | 2021-07-22T01:58:16.000Z | 2021-07-22T06:24:13.000Z | genmenu/gen_wiki_sitemap.py | RustFisher/python-playground | 3851eedd3db58d0e7de149da35f44356c7caa3f6 | [
"MIT"
] | null | null | null | genmenu/gen_wiki_sitemap.py | RustFisher/python-playground | 3851eedd3db58d0e7de149da35f44356c7caa3f6 | [
"MIT"
] | null | null | null | import os
import re
def gen_sitemap(main_site, md_file):
pattern = re.compile(r': (.*?).md', re.S)
res = []
with open(md_file) as md:
for line in md.readlines():
line = str(line)
cur_urls = re.findall(pattern, line)
if len(cur_urls) > 0:
if cur_u... | 27.424242 | 109 | 0.550276 | import os
import re
def gen_sitemap(main_site, md_file):
pattern = re.compile(r': (.*?).md', re.S)
res = []
with open(md_file) as md:
for line in md.readlines():
line = str(line)
cur_urls = re.findall(pattern, line)
if len(cur_urls) > 0:
if cur_u... | true | true |
790a40393b486f96b1b116c61ba7abb9cc2df2e4 | 6,307 | py | Python | docs/source/conf.py | jsmits/github-cli | 0e5a4fb7a5b6b5ea0fb81ca66c1e1df0ef7eadbd | [
"BSD-3-Clause"
] | 81 | 2015-02-12T01:04:07.000Z | 2022-02-13T13:44:20.000Z | docs/source/conf.py | jsmits/github-cli | 0e5a4fb7a5b6b5ea0fb81ca66c1e1df0ef7eadbd | [
"BSD-3-Clause"
] | 2 | 2016-01-09T07:37:06.000Z | 2018-06-04T14:15:19.000Z | docs/source/conf.py | jsmits/github-cli | 0e5a4fb7a5b6b5ea0fb81ca66c1e1df0ef7eadbd | [
"BSD-3-Clause"
] | 7 | 2015-05-08T15:51:58.000Z | 2020-11-03T16:28:56.000Z | # -*- coding: utf-8 -*-
#
# github-cli documentation build configuration file, created by
# sphinx-quickstart on Tue May 5 17:40:34 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 32.34359 | 80 | 0.722531 |
import sys, os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'github-cli'
copyright = u'2009-2012, Sander Smits'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y v... | true | true |
790a417f405c24318040a99ff6cb8d6e62da8eea | 320 | py | Python | shoppinglist/serializers.py | christiankuhl/foodplanner | 20c4a577849bf0ba9304f82f43c307552e846bf2 | [
"MIT"
] | null | null | null | shoppinglist/serializers.py | christiankuhl/foodplanner | 20c4a577849bf0ba9304f82f43c307552e846bf2 | [
"MIT"
] | null | null | null | shoppinglist/serializers.py | christiankuhl/foodplanner | 20c4a577849bf0ba9304f82f43c307552e846bf2 | [
"MIT"
] | null | null | null | from shoppinglist.models import Ingredient
from rest_framework import serializers
class IngredientSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Ingredient
fields = ('account', 'member', 'ref_date', 'ref_meal',
'ingredient', 'created', 'ingredient_there')
| 35.555556 | 67 | 0.709375 | from shoppinglist.models import Ingredient
from rest_framework import serializers
class IngredientSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Ingredient
fields = ('account', 'member', 'ref_date', 'ref_meal',
'ingredient', 'created', 'ingredient_there')
| true | true |
790a420515c20d0bda082401a9fdd5c0dc97bd05 | 909 | py | Python | src/bjointsp/main.py | 5GCity/5GCity-resource-placement | 2704bcbf37bcc708d6b21b466853a83ad9d2636c | [
"Apache-2.0"
] | null | null | null | src/bjointsp/main.py | 5GCity/5GCity-resource-placement | 2704bcbf37bcc708d6b21b466853a83ad9d2636c | [
"Apache-2.0"
] | null | null | null | src/bjointsp/main.py | 5GCity/5GCity-resource-placement | 2704bcbf37bcc708d6b21b466853a83ad9d2636c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (C) 2019 - Virtual Open Systems SAS
#
# 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 ... | 31.344828 | 74 | 0.731573 |
import bjointsp.api.placement as placement
def main():
placement.api.app.run(host='localhost', port=3800, debug=True)
if __name__ == '__main__':
main()
| true | true |
790a42ab58d8a54aad07ae8b2a0b22075c955a08 | 748 | py | Python | comment/models.py | jackyfzh/j_django_blog | c0d5ea0919ad3244dfbf8358695ed22eac5bdf37 | [
"MIT"
] | 5 | 2020-06-13T05:16:52.000Z | 2021-05-22T10:57:45.000Z | comment/models.py | jackyfzh/j_django_blog | c0d5ea0919ad3244dfbf8358695ed22eac5bdf37 | [
"MIT"
] | 9 | 2020-06-06T01:52:52.000Z | 2022-03-12T00:33:13.000Z | comment/models.py | jackyfzh/j_django_blog | c0d5ea0919ad3244dfbf8358695ed22eac5bdf37 | [
"MIT"
] | 1 | 2020-06-13T05:17:25.000Z | 2020-06-13T05:17:25.000Z | from django.db import models
import uuid
from django.contrib.auth.models import User
from article.models import ArticlePost
from ckeditor.fields import RichTextField
from mptt.models import MPTTModel, TreeForeignKey
# Create your models here.
class Comment(models.Model): # 博文评论
article = models.ForeignKey(
... | 27.703704 | 53 | 0.679144 | from django.db import models
import uuid
from django.contrib.auth.models import User
from article.models import ArticlePost
from ckeditor.fields import RichTextField
from mptt.models import MPTTModel, TreeForeignKey
class Comment(models.Model):
article = models.ForeignKey(
ArticlePost,
on_delete=m... | true | true |
790a42de2c372488a969ad7dfc9c9229356f7c69 | 9,840 | py | Python | alembic/versions/3741581c7fc4_initial.py | ShacharOch/anyway | dd62eeec19d478aca78bf9eb151110a26690495d | [
"BSD-3-Clause"
] | null | null | null | alembic/versions/3741581c7fc4_initial.py | ShacharOch/anyway | dd62eeec19d478aca78bf9eb151110a26690495d | [
"BSD-3-Clause"
] | null | null | null | alembic/versions/3741581c7fc4_initial.py | ShacharOch/anyway | dd62eeec19d478aca78bf9eb151110a26690495d | [
"BSD-3-Clause"
] | null | null | null | """initial
Revision ID: 3741581c7fc4
Revises:
Create Date: 2017-10-02 09:13:51.619334
"""
# revision identifiers, used by Alembic.
revision = '3741581c7fc4'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by... | 48.955224 | 125 | 0.683232 |
revision = '3741581c7fc4'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
(), nullable=True),
sa.Column('longitude', sa.Float(), nullable=True),
sa.Column('type', sa.Integer(), nullable=True),
sa.Column('title', sa.String(len... | true | true |
790a43fc7b2d314ae42fcab39668731376907167 | 1,010 | py | Python | example/demo/common.py | ideascf/data-packer | 9a325af3164a1e83e1bd9a517de253a1ce622db8 | [
"MIT"
] | 2 | 2016-10-13T12:34:09.000Z | 2018-05-31T06:29:28.000Z | example/demo/common.py | ideascf/data-packer | 9a325af3164a1e83e1bd9a517de253a1ce622db8 | [
"MIT"
] | null | null | null | example/demo/common.py | ideascf/data-packer | 9a325af3164a1e83e1bd9a517de253a1ce622db8 | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import print_function
import json
from data_packer import err, DataPacker, container
g_src = {
'a': 1,
'b': 'hello',
'c': ['a', 'b', 'c'],
'd': {
'1': 1,
'2': 2,
},
'e': {
'1': ['a', 'b'],
'2': {
'a': 'a',
... | 17.118644 | 60 | 0.50297 |
from __future__ import print_function
import json
from data_packer import err, DataPacker, container
g_src = {
'a': 1,
'b': 'hello',
'c': ['a', 'b', 'c'],
'd': {
'1': 1,
'2': 2,
},
'e': {
'1': ['a', 'b'],
'2': {
'a': 'a',
'b': 'b'
... | true | true |
790a4402c4f10eb8abc4ab589e2e485c10012e6b | 645 | py | Python | uwsgiconf/contrib/django/uwsgify/admin/models.py | graceshaw/uwsgiconf | 205289bb279dfbcc1d9bfd599dd8ca5d6c527077 | [
"BSD-3-Clause"
] | null | null | null | uwsgiconf/contrib/django/uwsgify/admin/models.py | graceshaw/uwsgiconf | 205289bb279dfbcc1d9bfd599dd8ca5d6c527077 | [
"BSD-3-Clause"
] | null | null | null | uwsgiconf/contrib/django/uwsgify/admin/models.py | graceshaw/uwsgiconf | 205289bb279dfbcc1d9bfd599dd8ca5d6c527077 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.utils.translation import gettext_lazy as _
class Summary(models.Model):
class Meta:
app_label = 'uwsgify'
managed = False
verbose_name = _('Summary')
verbose_name_plural = _('Summary')
class Configuration(models.Model):
class Meta:
... | 21.5 | 54 | 0.635659 | from django.db import models
from django.utils.translation import gettext_lazy as _
class Summary(models.Model):
class Meta:
app_label = 'uwsgify'
managed = False
verbose_name = _('Summary')
verbose_name_plural = _('Summary')
class Configuration(models.Model):
class Meta:
... | true | true |
790a4507d31e38902dfe47fef274d952cd116e52 | 2,079 | py | Python | Bio/PDB/Structure.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 6 | 2015-04-22T17:18:46.000Z | 2020-06-02T14:16:20.000Z | Bio/PDB/Structure.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 14 | 2021-03-26T20:54:22.000Z | 2021-04-06T17:18:53.000Z | Bio/PDB/Structure.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 8 | 2016-02-20T22:53:21.000Z | 2022-02-04T06:10:23.000Z | # Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""The structure cla... | 31.029851 | 76 | 0.647908 |
from Bio.PDB.Entity import Entity
from Bio.PDB.internal_coords import IC_Chain
class Structure(Entity):
def __init__(self, id):
self.level = "S"
Entity.__init__(self, id)
def __repr__(self):
return "<Structure id=%s>" % self.get_id()
def get_models(self):
yield f... | true | true |
790a45fbd60d4b4c0b21668daf1344c954c47f0b | 423 | py | Python | fizzbuzz.py | anzpia/FizzBuzz | 21312296defcfa87f4febd1bec23d8402d130f29 | [
"MIT"
] | null | null | null | fizzbuzz.py | anzpia/FizzBuzz | 21312296defcfa87f4febd1bec23d8402d130f29 | [
"MIT"
] | null | null | null | fizzbuzz.py | anzpia/FizzBuzz | 21312296defcfa87f4febd1bec23d8402d130f29 | [
"MIT"
] | null | null | null | stevilo = int(input("Select a number between 1 and 100:"))
x = 1
if stevilo >= 1 and stevilo <= 100:
while x <= stevilo:
ostanek_1 = x % 3
ostanek_2 = x % 5
if x % 3 == 0 and x % 5 == 0:
print('fizzbuzz')
elif ostanek_1 == 0:
print ("fizz")
... | 24.882353 | 59 | 0.434988 | stevilo = int(input("Select a number between 1 and 100:"))
x = 1
if stevilo >= 1 and stevilo <= 100:
while x <= stevilo:
ostanek_1 = x % 3
ostanek_2 = x % 5
if x % 3 == 0 and x % 5 == 0:
print('fizzbuzz')
elif ostanek_1 == 0:
print ("fizz")
... | true | true |
790a467648c34c6d5587f6677448eece4263ea12 | 321 | py | Python | scripts/extract_key.py | 425629/esp32-weather-google-sheets | c4ee5f853e71ec9c25986150d7c7ed940e564953 | [
"MIT"
] | 50 | 2019-07-06T09:18:18.000Z | 2022-03-03T17:06:40.000Z | scripts/extract_key.py | 425629/esp32-weather-google-sheets | c4ee5f853e71ec9c25986150d7c7ed940e564953 | [
"MIT"
] | 10 | 2019-10-06T16:45:00.000Z | 2021-07-16T15:31:17.000Z | scripts/extract_key.py | 425629/esp32-weather-google-sheets | c4ee5f853e71ec9c25986150d7c7ed940e564953 | [
"MIT"
] | 15 | 2019-06-24T14:45:49.000Z | 2021-11-08T17:37:42.000Z | import json
import sys
from rsa import PrivateKey
with open(sys.argv[1], 'rb') as input:
key = PrivateKey.load_pkcs1(input.read())
d = {}
d['n'] = key.n
d['e'] = key.e
d['d'] = key.d
d['p'] = key.p
d['q'] = key.q
with open(sys.argv[2], 'w') as output:
output.write(json.dumps(d))... | 21.4 | 45 | 0.548287 | import json
import sys
from rsa import PrivateKey
with open(sys.argv[1], 'rb') as input:
key = PrivateKey.load_pkcs1(input.read())
d = {}
d['n'] = key.n
d['e'] = key.e
d['d'] = key.d
d['p'] = key.p
d['q'] = key.q
with open(sys.argv[2], 'w') as output:
output.write(json.dumps(d))... | true | true |
790a481bfed4f88fab5a1d37c43fb0db08719bd8 | 33,626 | py | Python | electrum/tests/test_lnmsg.py | Jesusown/electrum | 0df05dd914c823acae1828cad3b20bdeb13150e9 | [
"MIT"
] | 5,905 | 2015-01-02T17:05:36.000Z | 2022-03-29T07:28:29.000Z | electrum/tests/test_lnmsg.py | Jesusown/electrum | 0df05dd914c823acae1828cad3b20bdeb13150e9 | [
"MIT"
] | 6,097 | 2015-01-01T21:20:25.000Z | 2022-03-31T23:55:01.000Z | electrum/tests/test_lnmsg.py | Jesusown/electrum | 0df05dd914c823acae1828cad3b20bdeb13150e9 | [
"MIT"
] | 2,202 | 2015-01-02T18:31:25.000Z | 2022-03-28T15:35:03.000Z | import io
from electrum.lnmsg import (read_bigsize_int, write_bigsize_int, FieldEncodingNotMinimal,
UnexpectedEndOfStream, LNSerializer, UnknownMandatoryTLVRecordType,
MalformedMsg, MsgTrailingGarbage, MsgInvalidFieldOrder, encode_msg,
... | 83.855362 | 885 | 0.67195 | import io
from electrum.lnmsg import (read_bigsize_int, write_bigsize_int, FieldEncodingNotMinimal,
UnexpectedEndOfStream, LNSerializer, UnknownMandatoryTLVRecordType,
MalformedMsg, MsgTrailingGarbage, MsgInvalidFieldOrder, encode_msg,
... | true | true |
790a484b4e43905b871c0f0d6ed2d132d3772adb | 1,181 | py | Python | tests/test_xshg_calendar.py | schild/exchange_calendars | 7401ef1182af2af8a8f62acf03a48ae8091a8c88 | [
"Apache-2.0"
] | 6 | 2021-01-15T22:44:09.000Z | 2021-01-25T09:33:39.000Z | tests/test_xshg_calendar.py | gerrymanoim/trading_calendars | 7401ef1182af2af8a8f62acf03a48ae8091a8c88 | [
"Apache-2.0"
] | 3 | 2021-01-14T04:25:55.000Z | 2021-01-28T04:22:42.000Z | tests/test_xshg_calendar.py | schild/exchange_calendars | 7401ef1182af2af8a8f62acf03a48ae8091a8c88 | [
"Apache-2.0"
] | 1 | 2021-01-20T18:37:07.000Z | 2021-01-20T18:37:07.000Z | import pytest
from exchange_calendars.exchange_calendar_xshg import XSHGExchangeCalendar
from .test_exchange_calendar import ExchangeCalendarTestBase
from .test_utils import T
class TestXSHGCalendar(ExchangeCalendarTestBase):
@pytest.fixture(scope="class")
def calendar_cls(self):
yield XSHGExchangeCa... | 23.62 | 74 | 0.538527 | import pytest
from exchange_calendars.exchange_calendar_xshg import XSHGExchangeCalendar
from .test_exchange_calendar import ExchangeCalendarTestBase
from .test_utils import T
class TestXSHGCalendar(ExchangeCalendarTestBase):
@pytest.fixture(scope="class")
def calendar_cls(self):
yield XSHGExchangeCa... | true | true |
790a48b1e544425c8bf354a0e74a112e8801c522 | 636 | py | Python | manage.py | justindjeumenet/secure_auth_rest | 63eab9f41c386b2998b0268f3bc5b07f45a1d8ee | [
"MIT"
] | null | null | null | manage.py | justindjeumenet/secure_auth_rest | 63eab9f41c386b2998b0268f3bc5b07f45a1d8ee | [
"MIT"
] | null | null | null | manage.py | justindjeumenet/secure_auth_rest | 63eab9f41c386b2998b0268f3bc5b07f45a1d8ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'secure_auth_rest.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rai... | 28.909091 | 80 | 0.687107 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'secure_auth_rest.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed an... | true | true |
790a492a5ee328e07d44e3b32d8ed26d28ddde38 | 14,476 | py | Python | sphinx/util/cfamily.py | jeromekelleher/sphinx | 2e506c5ab457cba743bb47eb5b8c8eb9dd51d23d | [
"BSD-2-Clause"
] | null | null | null | sphinx/util/cfamily.py | jeromekelleher/sphinx | 2e506c5ab457cba743bb47eb5b8c8eb9dd51d23d | [
"BSD-2-Clause"
] | null | null | null | sphinx/util/cfamily.py | jeromekelleher/sphinx | 2e506c5ab457cba743bb47eb5b8c8eb9dd51d23d | [
"BSD-2-Clause"
] | null | null | null | """
sphinx.util.cfamily
~~~~~~~~~~~~~~~~~~~
Utility functions common to the C and C++ domains.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import warnings
from copy import deepcopy
from typing import (
Any, Callable, L... | 33.050228 | 91 | 0.550014 |
import re
import warnings
from copy import deepcopy
from typing import (
Any, Callable, List, Match, Pattern, Tuple, Union
)
from docutils import nodes
from docutils.nodes import TextElement
from sphinx.config import Config
from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.util import logging
... | true | true |
790a49391565ebcb6e6f24d926317fa3cb9775ac | 6,774 | py | Python | ansible/lib/ansible/modules/extras/packaging/language/cpanm.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/extras/packaging/language/cpanm.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/extras/packaging/language/cpanm.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Franck Cuny <franck@lumberjaph.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... | 30.651584 | 143 | 0.669767 |
DOCUMENTATION = '''
---
module: cpanm
short_description: Manages Perl library dependencies.
description:
- Manage Perl library dependencies.
version_added: "1.6"
options:
name:
description:
- The name of the Perl library to install. You may use the "full distribution path", e.g. MIYA... | true | true |
790a49eb2657bc4712d7f7c7decdd0ce992622ea | 11,494 | py | Python | django_ses/__init__.py | mlissner/django-ses | ede4756a82682d9b1181947affb0f51e08ad47ab | [
"MIT"
] | null | null | null | django_ses/__init__.py | mlissner/django-ses | ede4756a82682d9b1181947affb0f51e08ad47ab | [
"MIT"
] | null | null | null | django_ses/__init__.py | mlissner/django-ses | ede4756a82682d9b1181947affb0f51e08ad47ab | [
"MIT"
] | null | null | null | import logging
import boto3
from botocore.vendored.requests.packages.urllib3.exceptions import ResponseError
from django.core.mail.backends.base import BaseEmailBackend
from django_ses import settings
from datetime import datetime, timedelta
from time import sleep
try:
import importlib.metadata as importlib_met... | 42.88806 | 119 | 0.583522 | import logging
import boto3
from botocore.vendored.requests.packages.urllib3.exceptions import ResponseError
from django.core.mail.backends.base import BaseEmailBackend
from django_ses import settings
from datetime import datetime, timedelta
from time import sleep
try:
import importlib.metadata as importlib_met... | true | true |
790a4ad9639aa28891c9f7f66e581362653139cc | 1,968 | py | Python | Photo.py | Rougnt/ArkNightAutoClick | 693ba25227bdfbf228a3d5b3a04d86ea8135b78b | [
"MIT"
] | null | null | null | Photo.py | Rougnt/ArkNightAutoClick | 693ba25227bdfbf228a3d5b3a04d86ea8135b78b | [
"MIT"
] | null | null | null | Photo.py | Rougnt/ArkNightAutoClick | 693ba25227bdfbf228a3d5b3a04d86ea8135b78b | [
"MIT"
] | null | null | null | import cv2
import os,shutil
import numpy as np
from Adb import Adb
import time
class Photo():
'''
提取图片信息,比较图片
'''
def __init__(self,img_path) -> None:
'''
读取图片
'''
self.img = cv2.imread(img_path)
class sourceData():
'''
获取测试数据
'''
def ... | 28.114286 | 118 | 0.579776 | import cv2
import os,shutil
import numpy as np
from Adb import Adb
import time
class Photo():
def __init__(self,img_path) -> None:
self.img = cv2.imread(img_path)
class sourceData():
def __init__(self) -> None:
pass
@staticmethod
def getScreenPhoto():
adb = Adb(device=... | true | true |
790a4badc8ef66aa7ccea61012c5deeadf1e9938 | 208 | py | Python | UNIVESPalgortimo_1/s4aula2.py | joaorobsonR/algoritmo1 | 9e6ef6ee8967b771d20d7ebf96478412b0a7940f | [
"MIT"
] | null | null | null | UNIVESPalgortimo_1/s4aula2.py | joaorobsonR/algoritmo1 | 9e6ef6ee8967b771d20d7ebf96478412b0a7940f | [
"MIT"
] | null | null | null | UNIVESPalgortimo_1/s4aula2.py | joaorobsonR/algoritmo1 | 9e6ef6ee8967b771d20d7ebf96478412b0a7940f | [
"MIT"
] | null | null | null | ano = input('Digite o ano: ')
mes = input('Digite o mes: ')
dia = input('Digite o dia')
print('{}/{}/{}'.format(dia, mes, ano))
print(dia, mes, ano, sep='/')
print(type(ano))
eval(ano)
print(type(eval(ano)))
| 23.111111 | 39 | 0.605769 | ano = input('Digite o ano: ')
mes = input('Digite o mes: ')
dia = input('Digite o dia')
print('{}/{}/{}'.format(dia, mes, ano))
print(dia, mes, ano, sep='/')
print(type(ano))
eval(ano)
print(type(eval(ano)))
| true | true |
790a4bb2f1f953e5fc8f6fb8f4eee7e4ee3ac94e | 9,286 | py | Python | aiida/cmdline/params/types/plugin.py | borellim/aiida_core | eebef392c81e8b130834a92e1d7abf5e2e30b3ce | [
"BSD-2-Clause"
] | 1 | 2019-03-15T10:37:53.000Z | 2019-03-15T10:37:53.000Z | aiida/cmdline/params/types/plugin.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | aiida/cmdline/params/types/plugin.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 42.0181 | 120 | 0.643011 |
xception))
else:
return entry_point
| true | true |
790a4c12b64b58048378a350ea475e30625123a6 | 2,635 | py | Python | benchmark/opperf/nd_operations/unary_operators.py | paulk-asert/incubator-mxnet | 6acf7e6a051e75d9f1cca0ec3c198c38c0f6a3fe | [
"Apache-2.0"
] | 4 | 2018-10-12T05:02:17.000Z | 2019-06-27T04:44:11.000Z | benchmark/opperf/nd_operations/unary_operators.py | paulk-asert/incubator-mxnet | 6acf7e6a051e75d9f1cca0ec3c198c38c0f6a3fe | [
"Apache-2.0"
] | 4 | 2018-03-21T00:00:03.000Z | 2019-09-03T23:54:44.000Z | benchmark/opperf/nd_operations/unary_operators.py | ElaineBao/incubator-mxnet | bcb09fcda8e119dd5524bb4a99fc20248a8fbb24 | [
"Apache-2.0"
] | 1 | 2020-04-09T09:26:31.000Z | 2020-04-09T09:26:31.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.825397 | 113 | 0.718406 |
import mxnet as mx
from benchmark.opperf.utils.op_registry_utils import get_all_unary_operators
from benchmark.opperf.utils.benchmark_utils import run_op_benchmarks
def run_mx_unary_operators_benchmarks(ctx=mx.cpu(), dtype='float32', warmup=25, runs=100):
mx_unary_broadcast_ops = get_all_u... | true | true |
790a4cee5ffc44c339dbf2b5f3d567b15d1e4818 | 620 | py | Python | problem2/views.py | byteknacker/eulerapps | 5bebf00b4c77b84ceee8bbd73226db60e7fec03f | [
"BSD-3-Clause"
] | null | null | null | problem2/views.py | byteknacker/eulerapps | 5bebf00b4c77b84ceee8bbd73226db60e7fec03f | [
"BSD-3-Clause"
] | null | null | null | problem2/views.py | byteknacker/eulerapps | 5bebf00b4c77b84ceee8bbd73226db60e7fec03f | [
"BSD-3-Clause"
] | null | null | null | """Views of problem2 app."""
from django.shortcuts import render
from .forms import FiboForm
def display(request):
"""Function view to display form in the standard manner."""
if request.method == 'POST':
form = FiboForm(request.POST)
if form.is_valid():
fibo = form.save(commit=Fa... | 29.52381 | 69 | 0.593548 |
from django.shortcuts import render
from .forms import FiboForm
def display(request):
if request.method == 'POST':
form = FiboForm(request.POST)
if form.is_valid():
fibo = form.save(commit=False)
evensum = fibo.evenFiboSum()
fibo.save()
return rend... | true | true |
790a4cfeef76cc205825bcf9a8937cb36166b47c | 140 | py | Python | pycronserver/__init__.py | pyscioffice/pycronserver | bdacdc99ccc000fe0da02a93f48f2af689c7cf16 | [
"BSD-3-Clause"
] | null | null | null | pycronserver/__init__.py | pyscioffice/pycronserver | bdacdc99ccc000fe0da02a93f48f2af689c7cf16 | [
"BSD-3-Clause"
] | null | null | null | pycronserver/__init__.py | pyscioffice/pycronserver | bdacdc99ccc000fe0da02a93f48f2af689c7cf16 | [
"BSD-3-Clause"
] | null | null | null | from pycronserver.server import get_pycronserver, execute_funct
from pycronserver.local import get_local_pycronserver, create_config_folder
| 46.666667 | 75 | 0.9 | from pycronserver.server import get_pycronserver, execute_funct
from pycronserver.local import get_local_pycronserver, create_config_folder
| true | true |
790a4ef4e8d40496066bf195a1491a4ce6062cba | 935 | py | Python | ESEC.FSE.2017.Experimental.Replication/Figure2/F/Frelationrace/Table1CausalScore.py | austinatchley/Themis | 67d5e639e9445f1612249ae7939b3625fea138db | [
"BSD-4-Clause-UC"
] | 88 | 2017-08-14T19:44:21.000Z | 2021-11-20T00:48:01.000Z | ESEC.FSE.2017.Experimental.Replication/Figure2/F/Frelationrace/Table1CausalScore.py | kavithacd/Themis | 67d5e639e9445f1612249ae7939b3625fea138db | [
"BSD-4-Clause-UC"
] | 25 | 2017-03-07T15:33:46.000Z | 2020-06-18T01:39:26.000Z | ESEC.FSE.2017.Experimental.Replication/Figure2/F/Frelationrace/Table1CausalScore.py | kavithacd/Themis | 67d5e639e9445f1612249ae7939b3625fea138db | [
"BSD-4-Clause-UC"
] | 19 | 2017-10-11T15:25:12.000Z | 2021-08-16T01:47:43.000Z | '''
This script calculates the Causal discrimination score for the particular input file towards race or gender.
USAGE :
argv[1] : Input test suite
argv[2] : 0/1
0 for tace
1 for gender
'''
import sys
f = open(sys.argv[1],"r")
type = int(sys.argv[2])
#type = 0 means race
#type ... | 17.641509 | 108 | 0.537968 | import sys
f = open(sys.argv[1],"r")
type = int(sys.argv[2])
pos = 0
neg = 1
rowNum = 0
num=0
den=0
posFound = 0
negFound = 0
iter = 0
lst = []
lines =[]
for line in f:
line = line.strip()
l1 = line
lines.append(l1)
line =line.split(',')
if(float(line[-1])>0):
posFound=1
if(flo... | true | true |
790a4ef7640d16be62e9d15f580f76ce121919be | 2,572 | py | Python | safe_exploration/visualization/utils_visualization.py | Pathetiue/safe-exploration | 9495484b19f4df4b4671e721962d77341ef022f2 | [
"MIT"
] | 55 | 2019-05-13T07:17:08.000Z | 2022-03-23T16:39:20.000Z | safe_exploration/visualization/utils_visualization.py | Pathetiue/safe-exploration | 9495484b19f4df4b4671e721962d77341ef022f2 | [
"MIT"
] | 2 | 2019-05-13T06:56:43.000Z | 2019-12-12T22:19:28.000Z | safe_exploration/visualization/utils_visualization.py | befelix/safe-exploration | e6c0bc57b7b51fe3e3c97d51721893fe297b2b11 | [
"MIT"
] | 18 | 2019-05-13T11:08:21.000Z | 2021-12-23T12:51:36.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 21 15:49:49 2017
@author: tkoller
"""
import numpy as np
import numpy.linalg as nLa
from ..utils import unavailable
try:
import matplotlib.pyplot as plt
_has_matplotlib = True
except:
_has_matplotlib = False
@unavailable(not _has_matplotlib, "matplotlib")
... | 26.791667 | 82 | 0.591757 |
import numpy as np
import numpy.linalg as nLa
from ..utils import unavailable
try:
import matplotlib.pyplot as plt
_has_matplotlib = True
except:
_has_matplotlib = False
@unavailable(not _has_matplotlib, "matplotlib")
def plot_ellipsoid_3D(p, q, ax, n_points=100):
assert np.shape(p) == (3, 1), "p ... | true | true |
790a4f9b1ca5315576470030e7218150601d0818 | 56 | py | Python | pandoc_mustache/__init__.py | copart/pandoc-mustache | f6ace29cd0c8d6b4d8f182eedcf36ad38a2412fa | [
"CC0-1.0"
] | 43 | 2017-12-27T05:57:00.000Z | 2022-03-18T10:07:28.000Z | pandoc_mustache/__init__.py | copart/pandoc-mustache | f6ace29cd0c8d6b4d8f182eedcf36ad38a2412fa | [
"CC0-1.0"
] | 10 | 2018-02-07T11:20:37.000Z | 2021-04-22T21:44:19.000Z | pandoc_mustache/__init__.py | copart/pandoc-mustache | f6ace29cd0c8d6b4d8f182eedcf36ad38a2412fa | [
"CC0-1.0"
] | 8 | 2018-11-05T13:10:35.000Z | 2021-08-30T18:14:02.000Z | from .version import __version__
import pandoc_mustache
| 18.666667 | 32 | 0.875 | from .version import __version__
import pandoc_mustache
| true | true |
790a4fdab690a4aa3f7000ec30cef8d8feac2af3 | 1,110 | py | Python | main.py | randomvi/opencv-color-detector | 8106178434b15c116d8a93140a35f2c341480f11 | [
"MIT"
] | null | null | null | main.py | randomvi/opencv-color-detector | 8106178434b15c116d8a93140a35f2c341480f11 | [
"MIT"
] | null | null | null | main.py | randomvi/opencv-color-detector | 8106178434b15c116d8a93140a35f2c341480f11 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
# To capture webcam live stream, simply change the following line to: cap = cv2.VideoCapture(0)
cap = cv2.VideoCapture('./assets/video.mp4')
while (True):
# Capture frame by frame
_, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# hsv (hue sat value) ... | 30.833333 | 128 | 0.658559 | import numpy as np
import cv2
cap = cv2.VideoCapture('./assets/video.mp4')
while (True):
_, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_color = np.array([150, 150, 50])
upper_color = np.array([180, 255, 150])
mask = cv2.inRange(hsv, lower_color, upper_... | true | true |
790a4fef92fb47fe2079920afbb4d0daaeb27d2b | 6,563 | py | Python | nova/tests/utils.py | bopopescu/nova-35 | c32c01e08dccad921b4af6fc03d971d6e74c990f | [
"Apache-2.0"
] | null | null | null | nova/tests/utils.py | bopopescu/nova-35 | c32c01e08dccad921b4af6fc03d971d6e74c990f | [
"Apache-2.0"
] | null | null | null | nova/tests/utils.py | bopopescu/nova-35 | c32c01e08dccad921b4af6fc03d971d6e74c990f | [
"Apache-2.0"
] | 1 | 2020-07-24T09:13:22.000Z | 2020-07-24T09:13:22.000Z | # Copyright 2011 OpenStack Foundation
#
# 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 l... | 31.859223 | 79 | 0.534359 |
import errno
import platform
import socket
import sys
from oslo.config import cfg
from nova.compute import flavors
import nova.context
import nova.db
from nova import exception
from nova.image import glance
from nova.network import minidns
from nova.network import model as network_model
from nova.object... | true | true |
790a5079a589c041aece3672f3d4adbfb0bf86b8 | 9,955 | py | Python | modules/__init__.py | martinhoang11/vietnamese-ocr-toolbox | 524b4908bedceb0c87b2c7cd7b5e3f6e1126ace5 | [
"Apache-2.0"
] | 14 | 2021-09-05T10:42:14.000Z | 2022-03-10T16:27:26.000Z | modules/__init__.py | martinhoang11/vietnamese-ocr-toolbox | 524b4908bedceb0c87b2c7cd7b5e3f6e1126ace5 | [
"Apache-2.0"
] | 1 | 2021-06-16T11:35:24.000Z | 2021-06-16T11:35:24.000Z | modules/__init__.py | martinhoang11/vietnamese-ocr-toolbox | 524b4908bedceb0c87b2c7cd7b5e3f6e1126ace5 | [
"Apache-2.0"
] | 5 | 2021-09-05T13:26:51.000Z | 2022-03-09T07:49:45.000Z | import os
import cv2
import shutil
import argparse
import torch
import numpy as np
import pandas as pd
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib
from .preprocess import DocScanner
import modules.detection as detection
import modules.ocr as ocr
import modules.retrieval as retrieval
import m... | 34.686411 | 87 | 0.571974 | import os
import cv2
import shutil
import argparse
import torch
import numpy as np
import pandas as pd
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib
from .preprocess import DocScanner
import modules.detection as detection
import modules.ocr as ocr
import modules.retrieval as retrieval
import m... | true | true |
790a50b15268507121d2f017db89e93e56561b9b | 634 | py | Python | venv/lib/python3.6/site-packages/kappa/__init__.py | mrsaicharan1/Alexa-BestBuy | a22a0157b90d29b946d0f020e5f76744f73a6bff | [
"Apache-2.0"
] | 6 | 2018-05-31T04:40:53.000Z | 2022-02-18T18:59:27.000Z | venv/lib/python3.6/site-packages/kappa/__init__.py | mrsaicharan1/iiita-updates | a22a0157b90d29b946d0f020e5f76744f73a6bff | [
"Apache-2.0"
] | 6 | 2020-09-05T01:40:23.000Z | 2022-03-12T00:40:58.000Z | venv/lib/python3.6/site-packages/kappa/__init__.py | mrsaicharan1/iiita-updates | a22a0157b90d29b946d0f020e5f76744f73a6bff | [
"Apache-2.0"
] | 2 | 2019-04-29T14:16:10.000Z | 2020-07-23T12:04:17.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015 Mitch Garnaat
#
# 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 appl... | 37.294118 | 74 | 0.741325 |
__version__ = '0.6.0'
| true | true |
790a530bf4f20c9f3454fb0204cdee95b537d3f5 | 1,592 | py | Python | checkov/kubernetes/checks/resource/k8s/KubeletCryptographicCiphers.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | null | null | null | checkov/kubernetes/checks/resource/k8s/KubeletCryptographicCiphers.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | null | null | null | checkov/kubernetes/checks/resource/k8s/KubeletCryptographicCiphers.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | null | null | null | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
strongCiphers = ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA... | 49.75 | 329 | 0.672111 | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
strongCiphers = ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA... | true | true |
790a531edb2049e0687fb2d5392df7cfd4396fec | 5,404 | py | Python | mapclientplugins/filechooserstep/configuredialog.py | mapclient-plugins/mapclientplugins.filechooserstep | 6e46e4c832833e929b1b3f17b94877093e996c3b | [
"Apache-2.0"
] | null | null | null | mapclientplugins/filechooserstep/configuredialog.py | mapclient-plugins/mapclientplugins.filechooserstep | 6e46e4c832833e929b1b3f17b94877093e996c3b | [
"Apache-2.0"
] | null | null | null | mapclientplugins/filechooserstep/configuredialog.py | mapclient-plugins/mapclientplugins.filechooserstep | 6e46e4c832833e929b1b3f17b94877093e996c3b | [
"Apache-2.0"
] | 1 | 2021-11-05T01:04:22.000Z | 2021-11-05T01:04:22.000Z | import os
from PySide2 import QtWidgets
from mapclientplugins.filechooserstep.ui_configuredialog import Ui_ConfigureDialog
INVALID_STYLE_SHEET = 'background-color: rgba(239, 0, 0, 50)'
DEFAULT_STYLE_SHEET = ''
class ConfigureDialog(QtWidgets.QDialog):
"""
Configure dialog to present the user with the optio... | 41.569231 | 115 | 0.65544 | import os
from PySide2 import QtWidgets
from mapclientplugins.filechooserstep.ui_configuredialog import Ui_ConfigureDialog
INVALID_STYLE_SHEET = 'background-color: rgba(239, 0, 0, 50)'
DEFAULT_STYLE_SHEET = ''
class ConfigureDialog(QtWidgets.QDialog):
def __init__(self, parent=None):
QtWidgets.QDialog... | true | true |
790a54bf14fd4e3080ccf2119e2b6389f1e83c19 | 20,375 | py | Python | run_demo.py | ybettan/AirSimTensorFlow | 7c9a17d97a68e99da310f2e537bfb66433056066 | [
"MIT"
] | null | null | null | run_demo.py | ybettan/AirSimTensorFlow | 7c9a17d97a68e99da310f2e537bfb66433056066 | [
"MIT"
] | null | null | null | run_demo.py | ybettan/AirSimTensorFlow | 7c9a17d97a68e99da310f2e537bfb66433056066 | [
"MIT"
] | null | null | null | from __future__ import print_function
import pprint
import os
import time
import msgpackrpc
import math
import msgpackrpc #install as admin: pip install msgpack-rpc-python
import msgpack
import sys
import inspect
import types
import re
import shutil
import numpy as np #pip install numpy
#==========================... | 31.491499 | 181 | 0.599362 | from __future__ import print_function
import pprint
import os
import time
import msgpackrpc
import math
import msgpackrpc
import msgpack
import sys
import inspect
import types
import re
import shutil
import numpy as np
class MsgpackMixin:
def to_msgpack(self, *args, **kwargs):
return self.__dict_... | true | true |
790a54e339d91d6c45f6fb98a1d9e53e0ef37fda | 8,261 | py | Python | bamboo/lib/schema_builder.py | pld/bamboo | a0fc77aebd6ff6b1087ba46896b0ce705fbb25a3 | [
"BSD-3-Clause"
] | 27 | 2015-01-14T15:57:54.000Z | 2020-12-27T19:34:41.000Z | bamboo/lib/schema_builder.py | biswapanda/bamboo | 72fc260822a27ce52cbe65de178f8fa1b60311f3 | [
"BSD-3-Clause"
] | 2 | 2015-08-06T15:23:28.000Z | 2016-01-28T00:05:25.000Z | bamboo/lib/schema_builder.py | biswapanda/bamboo | 72fc260822a27ce52cbe65de178f8fa1b60311f3 | [
"BSD-3-Clause"
] | 10 | 2015-08-07T01:50:39.000Z | 2019-05-15T21:41:18.000Z | from datetime import datetime
import numpy as np
import re
from bamboo.core.frame import RESERVED_KEYS
from bamboo.core.parser import Parser
from bamboo.lib.exceptions import ArgumentError
from bamboo.lib.mongo import reserve_encoded
CARDINALITY = 'cardinality'
OLAP_TYPE = 'olap_type'
SIMPLETYPE = 'simpletype'
LABEL... | 30.149635 | 78 | 0.641932 | from datetime import datetime
import numpy as np
import re
from bamboo.core.frame import RESERVED_KEYS
from bamboo.core.parser import Parser
from bamboo.lib.exceptions import ArgumentError
from bamboo.lib.mongo import reserve_encoded
CARDINALITY = 'cardinality'
OLAP_TYPE = 'olap_type'
SIMPLETYPE = 'simpletype'
LABEL... | false | true |
790a558bc791a93fad1eae31222a7c127297e94e | 877 | py | Python | krgram/tl/api/functions/help.py | krow89/krgram | 52257d143be44b3c038c9458837f2df4b1640fa7 | [
"MIT"
] | null | null | null | krgram/tl/api/functions/help.py | krow89/krgram | 52257d143be44b3c038c9458837f2df4b1640fa7 | [
"MIT"
] | null | null | null | krgram/tl/api/functions/help.py | krow89/krgram | 52257d143be44b3c038c9458837f2df4b1640fa7 | [
"MIT"
] | null | null | null | from krgram.tl.core_types.native import TL_string
from krgram.tl.base import *
class getConfig(TLFunction):
ID = 0xc4f9186b
TLRegister.register(getConfig)
class getNearestDc(TLFunction):
ID = 0x1fb33026
TLRegister.register(getNearestDc)
class getAppUpdate(TLFunction):
ID = 0xc812ac7e
def get_structure(se... | 15.945455 | 74 | 0.749145 | from krgram.tl.core_types.native import TL_string
from krgram.tl.base import *
class getConfig(TLFunction):
ID = 0xc4f9186b
TLRegister.register(getConfig)
class getNearestDc(TLFunction):
ID = 0x1fb33026
TLRegister.register(getNearestDc)
class getAppUpdate(TLFunction):
ID = 0xc812ac7e
def get_structure(se... | true | true |
790a5659a4d9c50dfba399c8f82c0dd9c1a28788 | 6,566 | py | Python | model/cpn/ade.cpn.R50_v1c.v7/network.py | akinoriosamura/TorchSeg-mirror | 34033fe85fc24015bcef7a92aad39d2a25a001a5 | [
"MIT"
] | null | null | null | model/cpn/ade.cpn.R50_v1c.v7/network.py | akinoriosamura/TorchSeg-mirror | 34033fe85fc24015bcef7a92aad39d2a25a001a5 | [
"MIT"
] | 1 | 2021-06-08T20:36:43.000Z | 2021-06-08T20:36:43.000Z | model/cpn/ade.cpn.R50_v1c.v7/network.py | akinoriosamura/TorchSeg-mirror | 34033fe85fc24015bcef7a92aad39d2a25a001a5 | [
"MIT"
] | null | null | null | # encoding: utf-8
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import config
from base_model import resnet50
from seg_opr.seg_oprs import ConvBnRelu
class CPNet(nn.Module):
def __init__(self, out_planes, criterio... | 41.556962 | 80 | 0.581937 |
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import config
from base_model import resnet50
from seg_opr.seg_oprs import ConvBnRelu
class CPNet(nn.Module):
def __init__(self, out_planes, criterion, pretrained_mod... | true | true |
790a57426c4f8796ad41518ae68262146cf82e95 | 665 | py | Python | manage.py | nikhilchaudhary0126/goodshare | c1578796b6376f02970f61ea418e9eb87dc5bb64 | [
"MIT"
] | 1 | 2022-02-26T09:25:39.000Z | 2022-02-26T09:25:39.000Z | manage.py | nikhilchaudhary0126/goodshare | c1578796b6376f02970f61ea418e9eb87dc5bb64 | [
"MIT"
] | null | null | null | manage.py | nikhilchaudhary0126/goodshare | c1578796b6376f02970f61ea418e9eb87dc5bb64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'goodshare.settings')
try:
from django.core.management import execute_from_command_line
except Im... | 28.913043 | 73 | 0.679699 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'goodshare.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
790a576bef2092f8848a34e75ca0c306984a4d62 | 588 | py | Python | eggs/Fabric-1.4.2-py2.7.egg/fabric/thread_handling.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 2 | 2015-03-10T10:55:26.000Z | 2020-12-29T06:05:43.000Z | eggs/Fabric-1.4.2-py2.7.egg/fabric/thread_handling.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/Fabric-1.4.2-py2.7.egg/fabric/thread_handling.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:03:18.000Z | 2020-07-25T21:03:18.000Z | import threading
import sys
class ThreadHandler(object):
def __init__(self, name, callable, *args, **kwargs):
# Set up exception handling
self.exception = None
def wrapper(*args, **kwargs):
try:
callable(*args, **kwargs)
except BaseException:
... | 28 | 68 | 0.588435 | import threading
import sys
class ThreadHandler(object):
def __init__(self, name, callable, *args, **kwargs):
self.exception = None
def wrapper(*args, **kwargs):
try:
callable(*args, **kwargs)
except BaseException:
self.exception = ... | true | true |
790a577ece84db27e4160fb76a791f94a4e04f44 | 1,247 | py | Python | logAxes.py | Henrynaut/Py622 | 1ac33db96f82c562fe4a85ca5dc0b9b77c5fd088 | [
"MIT"
] | null | null | null | logAxes.py | Henrynaut/Py622 | 1ac33db96f82c562fe4a85ca5dc0b9b77c5fd088 | [
"MIT"
] | null | null | null | logAxes.py | Henrynaut/Py622 | 1ac33db96f82c562fe4a85ca5dc0b9b77c5fd088 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter # useful for `logit` scale
# Fixing random state for reproducibility
np.random.seed(19680801)
# make up some data in the interval ]0, 1[
y = np.random.normal(loc=0.5, scale=0.4, size=1000)
y = y[(y > 0) & (y < 1)]
y.sort(... | 22.672727 | 78 | 0.700882 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter
np.random.seed(19680801)
y = np.random.normal(loc=0.5, scale=0.4, size=1000)
y = y[(y > 0) & (y < 1)]
y.sort()
x = np.arange(len(y))
plt.figure(1)
plt.subplot(221)
plt.plot(x, y)
plt.yscale('linear')
plt.title('lin... | true | true |
790a58e79f1368e3c62b619aefa5153279d5551a | 5,251 | py | Python | tests/timestamp_tests.py | LeesahMasko/piwikibot | 024af387ff48c21526ee206541178157d2653ddc | [
"MIT"
] | null | null | null | tests/timestamp_tests.py | LeesahMasko/piwikibot | 024af387ff48c21526ee206541178157d2653ddc | [
"MIT"
] | 6 | 2021-02-27T03:35:42.000Z | 2021-03-07T22:17:40.000Z | tests/timestamp_tests.py | LeesahMasko/piwikibot | 024af387ff48c21526ee206541178157d2653ddc | [
"MIT"
] | null | null | null | """Tests for the Timestamp class."""
#
# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
import calendar
import datetime
import re
import unittest
from contextlib import suppress
from pywikibot import Timestamp
from tests.aspects import TestCase
class TestTimestamp(TestCase):
... | 35.006667 | 79 | 0.629404 |
import calendar
import datetime
import re
import unittest
from contextlib import suppress
from pywikibot import Timestamp
from tests.aspects import TestCase
class TestTimestamp(TestCase):
net = False
def test_clone(self):
t1 = Timestamp.utcnow()
t2 = t1.clone()
self.assertEq... | true | true |
790a59bd9f4ab48c7ffce8b4710fd684df18c5f8 | 3,858 | py | Python | google/cloud/datacatalog_v1beta1/types/table_spec.py | steffnay/python-datacatalog | 90a0be276e38e889a5086f8fd233d5b25e19965e | [
"Apache-2.0"
] | null | null | null | google/cloud/datacatalog_v1beta1/types/table_spec.py | steffnay/python-datacatalog | 90a0be276e38e889a5086f8fd233d5b25e19965e | [
"Apache-2.0"
] | null | null | null | google/cloud/datacatalog_v1beta1/types/table_spec.py | steffnay/python-datacatalog | 90a0be276e38e889a5086f8fd233d5b25e19965e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.756757 | 107 | 0.667963 |
import proto
__protobuf__ = proto.module(
package="google.cloud.datacatalog.v1beta1",
manifest={
"TableSourceType",
"BigQueryTableSpec",
"ViewSpec",
"TableSpec",
"BigQueryDateShardedSpec",
},
)
class TableSourceType(proto.Enum):
TABLE_SOURCE_T... | true | true |
790a59f0a0651c45430ea6219d0a12a690263e1e | 5,155 | py | Python | search/management/commands/test_selenium.py | pythonmentor/david-p8 | 61e24e2ecfd23e028d4927d8c18a5791e1b97d90 | [
"MIT"
] | null | null | null | search/management/commands/test_selenium.py | pythonmentor/david-p8 | 61e24e2ecfd23e028d4927d8c18a5791e1b97d90 | [
"MIT"
] | null | null | null | search/management/commands/test_selenium.py | pythonmentor/david-p8 | 61e24e2ecfd23e028d4927d8c18a5791e1b97d90 | [
"MIT"
] | null | null | null | import requests
import logging
import os
import selenium
import unittest
import time
import requests, re
from django.core.management.base import BaseCommand
from search.models import Product, Category, DetailProduct
from django.db import IntegrityError
from django.core.exceptions import MultipleObjectsReturned
from lo... | 38.470149 | 112 | 0.668477 | import requests
import logging
import os
import selenium
import unittest
import time
import requests, re
from django.core.management.base import BaseCommand
from search.models import Product, Category, DetailProduct
from django.db import IntegrityError
from django.core.exceptions import MultipleObjectsReturned
from lo... | true | true |
790a5b04a30e033e22fa76b57a22baece01da042 | 4,691 | py | Python | project_name/settings.py | YoggyPutra/cobaq | 4ce2dbb76f21cf955c8992b826b9e3cb57aa932f | [
"Unlicense"
] | null | null | null | project_name/settings.py | YoggyPutra/cobaq | 4ce2dbb76f21cf955c8992b826b9e3cb57aa932f | [
"Unlicense"
] | null | null | null | project_name/settings.py | YoggyPutra/cobaq | 4ce2dbb76f21cf955c8992b826b9e3cb57aa932f | [
"Unlicense"
] | null | null | null | """
Django settings for project_name project.
Generated by 'django-admin startproject' using Django 3.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import ... | 28.08982 | 106 | 0.715412 |
import os
from pathlib import Path
import dj_database_url
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = os.getenv('SECRET_KEY', 'django-insecure-*%$(!wsn1rre5@c!$jm7w&$+s3y0xqn%cnmk)&6(ukjn)18b!0')
PRODUCTION = os.getenv('DATABASE_URL') is not None
# If you want to enable debugging o... | true | true |
790a5b7407c9b5d974aa03fbf24850d0083df6b0 | 1,025 | py | Python | python/poo_algoritmos/merge_sort.py | lmonsalve22/Learning-to-Code | 2e32eba3fbd0bd63cc539e1e6d372ca346b765c9 | [
"MIT"
] | null | null | null | python/poo_algoritmos/merge_sort.py | lmonsalve22/Learning-to-Code | 2e32eba3fbd0bd63cc539e1e6d372ca346b765c9 | [
"MIT"
] | null | null | null | python/poo_algoritmos/merge_sort.py | lmonsalve22/Learning-to-Code | 2e32eba3fbd0bd63cc539e1e6d372ca346b765c9 | [
"MIT"
] | null | null | null | import random
def ordenamiento_por_mezcla(lista):
if len(lista) > 1:
medio = len(lista) // 2
izquierda = lista[:medio]
derecha = lista[medio:]
# llamada recursiva en cada mitad
ordenamiento_por_mezcla(izquierda)
ordenamiento_por_mezcla(derecha)
# Iteradores para recorrer las dos sublista... | 20.098039 | 66 | 0.612683 | import random
def ordenamiento_por_mezcla(lista):
if len(lista) > 1:
medio = len(lista) // 2
izquierda = lista[:medio]
derecha = lista[medio:]
ordenamiento_por_mezcla(izquierda)
ordenamiento_por_mezcla(derecha)
i = 0
j = 0
k = 0
while i < len(izquierda) and j < len(derec... | true | true |
790a5bead5babede83d434e3f33b39197b1ed5d8 | 4,240 | py | Python | cloudpassage/cve_exception.py | patricksanders/cloudpassage-halo-python-sdk | 7fccaaacf20cc469e03d5727c6528a105ae7e790 | [
"BSD-3-Clause"
] | 8 | 2016-10-24T12:37:32.000Z | 2019-06-01T10:00:18.000Z | cloudpassage/cve_exception.py | patricksanders/cloudpassage-halo-python-sdk | 7fccaaacf20cc469e03d5727c6528a105ae7e790 | [
"BSD-3-Clause"
] | 109 | 2016-08-09T04:51:48.000Z | 2020-02-11T02:33:35.000Z | cloudpassage/cve_exception.py | patricksanders/cloudpassage-halo-python-sdk | 7fccaaacf20cc469e03d5727c6528a105ae7e790 | [
"BSD-3-Clause"
] | 14 | 2016-01-23T00:10:30.000Z | 2021-07-07T21:13:56.000Z | """CveException Class"""
import cloudpassage.sanity as sanity
from .halo_endpoint import HaloEndpoint
from .http_helper import HttpHelper
class CveExceptions(HaloEndpoint):
"""Initializing the CveException class:
Args:
session (:class:`cloudpassage.HaloSession`): This will define how you
... | 32.366412 | 79 | 0.619811 | import cloudpassage.sanity as sanity
from .halo_endpoint import HaloEndpoint
from .http_helper import HttpHelper
class CveExceptions(HaloEndpoint):
object_name = "cve_exception"
objects_name = "cve_exceptions"
default_endpoint_version = 1
def endpoint(self):
return "/v{}/{}".format(self.endp... | true | true |
790a5c0817c70c253aa110fa1a7e2219922f0ee5 | 10,590 | py | Python | eduu/plugins/stickers.py | MikeOwino/EduuRobot | 24cbdce466ae3dd45d26796df866a94198d0feec | [
"MIT"
] | null | null | null | eduu/plugins/stickers.py | MikeOwino/EduuRobot | 24cbdce466ae3dd45d26796df866a94198d0feec | [
"MIT"
] | 6 | 2022-01-04T12:40:41.000Z | 2022-03-10T04:57:30.000Z | eduu/plugins/stickers.py | MikeOwino/EduuRobot | 24cbdce466ae3dd45d26796df866a94198d0feec | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
# Copyright (c) 2018-2022 Amano Team
import os
import shutil
import tempfile
from PIL import Image
from pyrogram import Client, filters
from pyrogram.enums import MessageEntityType
from pyrogram.errors import PeerIdInvalid, StickersetInvalid
from pyrogram.raw.functions.messages import G... | 37.821429 | 87 | 0.533428 |
import os
import shutil
import tempfile
from PIL import Image
from pyrogram import Client, filters
from pyrogram.enums import MessageEntityType
from pyrogram.errors import PeerIdInvalid, StickersetInvalid
from pyrogram.raw.functions.messages import GetStickerSet, SendMedia
from pyrogram.raw.functions.stickers impor... | true | true |
790a5c4c72fb6389d787e50af8dc5df8286f221b | 4,233 | py | Python | examples/pooling.py | tsaycal/romodel | 0d9bd0616dad41b1683452a0c7ff8e31caf47742 | [
"MIT"
] | null | null | null | examples/pooling.py | tsaycal/romodel | 0d9bd0616dad41b1683452a0c7ff8e31caf47742 | [
"MIT"
] | null | null | null | examples/pooling.py | tsaycal/romodel | 0d9bd0616dad41b1683452a0c7ff8e31caf47742 | [
"MIT"
] | null | null | null | import pyomo.environ as pe
import romodel as ro
feeds = range(5)
products = range(4)
pools = range(2)
qualities = range(4)
con_feed_pool = [(0, 0), (1, 0), (2, 0), (3, 1), (4, 1)]
con_pool_prod = [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3)]
con_feed_prod = []
price_product = [16, 25, 15, 10]
pric... | 29.601399 | 81 | 0.566501 | import pyomo.environ as pe
import romodel as ro
feeds = range(5)
products = range(4)
pools = range(2)
qualities = range(4)
con_feed_pool = [(0, 0), (1, 0), (2, 0), (3, 1), (4, 1)]
con_pool_prod = [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3)]
con_feed_prod = []
price_product = [16, 25, 15, 10]
pric... | true | true |
790a5c4c9795055da7b8d7049d3aede00aebbac6 | 285 | py | Python | frontend/views.py | yuliiabuchko/todo | 2a553ef6177f978126bbd746113eb4a50b9e3dea | [
"MIT"
] | null | null | null | frontend/views.py | yuliiabuchko/todo | 2a553ef6177f978126bbd746113eb4a50b9e3dea | [
"MIT"
] | 1 | 2021-04-08T21:17:38.000Z | 2021-04-08T21:17:38.000Z | frontend/views.py | yuliiabuchko/todo | 2a553ef6177f978126bbd746113eb4a50b9e3dea | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic.detail import DetailView
from todos.models import Task
def index(request):
return render(request, 'frontend/index.html')
class TodoDetailView(DetailView):
model = Task
template_name = 'frontend/index.html'
| 20.357143 | 50 | 0.768421 | from django.shortcuts import render
from django.views.generic.detail import DetailView
from todos.models import Task
def index(request):
return render(request, 'frontend/index.html')
class TodoDetailView(DetailView):
model = Task
template_name = 'frontend/index.html'
| true | true |
790a5d86ee689a83f18761d7920ca96cd2d159a8 | 3,586 | py | Python | 110borwein_2017/compare.py | ltabis/epitech-projects | e38b3f00a4ac44c969d5e4880cd65084dc2c870a | [
"MIT"
] | null | null | null | 110borwein_2017/compare.py | ltabis/epitech-projects | e38b3f00a4ac44c969d5e4880cd65084dc2c870a | [
"MIT"
] | null | null | null | 110borwein_2017/compare.py | ltabis/epitech-projects | e38b3f00a4ac44c969d5e4880cd65084dc2c870a | [
"MIT"
] | 1 | 2021-01-07T17:41:14.000Z | 2021-01-07T17:41:14.000Z | #!/usr/bin/python3
import time
from calcul import *
import sys
import os
max_exec = 10
red = "\033[31m"
white = "\033[39m"
cyan = "\033[36m"
green = "\033[32m"
save = sys.stdout
so = open("file.log", 'w')
sys.stdout = so
def rectangle_time(n):
time_rect = []
i = 0
while i < max_exec:
start_time =... | 29.883333 | 108 | 0.594255 |
import time
from calcul import *
import sys
import os
max_exec = 10
red = "\033[31m"
white = "\033[39m"
cyan = "\033[36m"
green = "\033[32m"
save = sys.stdout
so = open("file.log", 'w')
sys.stdout = so
def rectangle_time(n):
time_rect = []
i = 0
while i < max_exec:
start_time = time.time()
... | true | true |
790a5d93cb79bf9effeb45f3f8da517081c6c594 | 9,997 | py | Python | models/densenet121.py | arp95/pytorch_image_classifier | 81db0a99b79dcebc39843869bf684c5090db6fdb | [
"MIT"
] | 3 | 2020-08-17T16:09:00.000Z | 2021-02-02T04:52:17.000Z | models/densenet121.py | arp95/pytorch_image_classifier | 81db0a99b79dcebc39843869bf684c5090db6fdb | [
"MIT"
] | 1 | 2020-10-14T02:21:46.000Z | 2020-10-14T02:21:46.000Z | models/densenet121.py | arp95/cnn_architectures_image_classification | 81db0a99b79dcebc39843869bf684c5090db6fdb | [
"MIT"
] | null | null | null | # header files
import torch
import torch.nn as nn
import torchvision
import numpy as np
# define network (remember input size: (224 x 224 x 3))
class DenseNet_121(torch.nn.Module):
# define dense block
def dense_block(self, input_channels):
return torch.nn.Sequential(
torch.nn.Conv2d(... | 37.582707 | 83 | 0.577873 |
import torch
import torch.nn as nn
import torchvision
import numpy as np
class DenseNet_121(torch.nn.Module):
def dense_block(self, input_channels):
return torch.nn.Sequential(
torch.nn.Conv2d(input_channels, 128, kernel_size=1, bias=False),
torch.nn.BatchNorm2d(128),
... | true | true |
790a5daece740f88ebd8bfbd6ecde92682285a42 | 19,954 | py | Python | pyleecan/Classes/LamSlotWind.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/LamSlotWind.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/LamSlotWind.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Machine/LamSlotWind.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Machine/LamSlotWind
"""
from os import linesep
from sys import getsizeof
f... | 33.201331 | 110 | 0.606545 |
from os import linesep
from sys import getsizeof
from logging import getLogger
from ._check import check_var, raise_
from ..Functions.get_logger import get_logger
from ..Functions.save import save
from ..Functions.copy import copy
from ..Functions.load import load_init_dict
from ..Functions.Load.import_class import... | true | true |
790a5dfe71aa219c908137d06d5f413bfb35dba6 | 1,220 | py | Python | dvc/command/checkout.py | yfarjoun/dvc | eaca7dc80c765dd3a8dbe4c8fb3b206656bbc5e2 | [
"Apache-2.0"
] | null | null | null | dvc/command/checkout.py | yfarjoun/dvc | eaca7dc80c765dd3a8dbe4c8fb3b206656bbc5e2 | [
"Apache-2.0"
] | null | null | null | dvc/command/checkout.py | yfarjoun/dvc | eaca7dc80c765dd3a8dbe4c8fb3b206656bbc5e2 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from dvc.command.base import CmdBase
class CmdCheckout(CmdBase):
def run(self):
if not self.args.targets:
self.project.checkout(force=self.args.force)
else:
for target in self.args.targets:
self.project.checkout(
... | 29.047619 | 87 | 0.62377 | from __future__ import unicode_literals
from dvc.command.base import CmdBase
class CmdCheckout(CmdBase):
def run(self):
if not self.args.targets:
self.project.checkout(force=self.args.force)
else:
for target in self.args.targets:
self.project.checkout(
... | true | true |
790a5e04c67be0d563b2732ff23f9394a10b8a66 | 397 | py | Python | tests/tune/_utils/test_values.py | fugue-project/tune | bf2288ddcb29c8345d996a9b22c0910da9002da1 | [
"Apache-2.0"
] | 14 | 2021-03-03T20:02:09.000Z | 2021-11-10T20:32:22.000Z | tests/tune/_utils/test_values.py | fugue-project/tune | bf2288ddcb29c8345d996a9b22c0910da9002da1 | [
"Apache-2.0"
] | 26 | 2021-04-30T19:56:06.000Z | 2022-01-18T04:40:00.000Z | tests/tune/_utils/test_values.py | fugue-project/tune | bf2288ddcb29c8345d996a9b22c0910da9002da1 | [
"Apache-2.0"
] | 2 | 2021-04-30T03:12:21.000Z | 2022-02-05T12:13:37.000Z | import json
import numpy as np
from tune._utils import normalize_hp
def test_normalize_hp():
assert isinstance(np.int64(10), np.int64)
assert 10 == normalize_hp(np.int64(10))
assert not isinstance(normalize_hp(np.int64(10)), np.int64)
assert json.dumps(dict(a=[0, 1], b=1.1, c="x")) == json.dumps(
... | 26.466667 | 72 | 0.657431 | import json
import numpy as np
from tune._utils import normalize_hp
def test_normalize_hp():
assert isinstance(np.int64(10), np.int64)
assert 10 == normalize_hp(np.int64(10))
assert not isinstance(normalize_hp(np.int64(10)), np.int64)
assert json.dumps(dict(a=[0, 1], b=1.1, c="x")) == json.dumps(
... | true | true |
790a5e6702e1eacd68e7a245338708212141c8a9 | 1,495 | py | Python | examples/sum_worker.py | abau171/highfive | 07b3829331072035ab100d1d66deca3e8f3f372a | [
"MIT"
] | 3 | 2017-09-19T07:48:11.000Z | 2018-05-25T21:40:08.000Z | examples/sum_worker.py | abau171/highfive | 07b3829331072035ab100d1d66deca3e8f3f372a | [
"MIT"
] | null | null | null | examples/sum_worker.py | abau171/highfive | 07b3829331072035ab100d1d66deca3e8f3f372a | [
"MIT"
] | null | null | null | import time
import random
import highfive
# This is the remote worker for the sum example. Here, we define what the
# workers do when they get a call from the master. All we need is a single
# function which takes the call, does some processing, and returns a response.
# An interesting way to play with the workers ... | 38.333333 | 79 | 0.745819 | import time
import random
import highfive
def delayed_sum(numbers):
time.sleep(random.random() / 4)
return sum(numbers)
if __name__ == "__main__":
try:
highfive.run_worker_pool(delayed_sum)
except KeyboardInterrupt:
print("keyboard interrupt")
| true | true |
790a5e6e2e75add62cd780c155680f5a7e609996 | 1,701 | py | Python | mayan/apps/document_indexing/forms.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/document_indexing/forms.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 7 | 2020-06-06T00:01:04.000Z | 2022-01-13T01:47:17.000Z | mayan/apps/document_indexing/forms.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from django import forms
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from mayan.apps.common.classes import ModelProperty
from mayan.apps.common.forms import FilteredSelectionForm
from mayan.apps.documents... | 36.191489 | 79 | 0.678424 | from __future__ import absolute_import, unicode_literals
from django import forms
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from mayan.apps.common.classes import ModelProperty
from mayan.apps.common.forms import FilteredSelectionForm
from mayan.apps.documents... | true | true |
790a5f8c8cf690ffb397e8405f96dd3d982b74c7 | 2,360 | py | Python | venv/Lib/site-packages/jupyter_client/asynchronous/client.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | venv/Lib/site-packages/jupyter_client/asynchronous/client.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 8 | 2021-09-22T12:47:32.000Z | 2022-01-14T21:30:38.000Z | venv/Lib/site-packages/jupyter_client/asynchronous/client.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 3 | 2020-08-04T02:48:32.000Z | 2020-08-17T01:20:09.000Z | """Implements an async kernel client"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from traitlets import Type # type: ignore
from jupyter_client.channels import HBChannel
from jupyter_client.channels import ZMQSocketChannel
from jupyter_client.client import Ke... | 36.875 | 80 | 0.7 |
from traitlets import Type
from jupyter_client.channels import HBChannel
from jupyter_client.channels import ZMQSocketChannel
from jupyter_client.client import KernelClient
from jupyter_client.client import reqrep
def wrapped(meth, channel):
def _(self, *args, **kwargs):
reply = kwargs.pop("reply", F... | true | true |
790a5fab2bd71fa2690fa7a244b882847cde4739 | 2,020 | py | Python | quick-start/python/quick-start.py | vektonn/vektonn-examples | fa69328a4fd106f8de55319cec1408d88cfdba52 | [
"Apache-2.0"
] | 8 | 2021-11-22T07:20:23.000Z | 2021-12-07T08:32:58.000Z | quick-start/python/quick-start.py | vektonn/vektonn-examples | fa69328a4fd106f8de55319cec1408d88cfdba52 | [
"Apache-2.0"
] | null | null | null | quick-start/python/quick-start.py | vektonn/vektonn-examples | fa69328a4fd106f8de55319cec1408d88cfdba52 | [
"Apache-2.0"
] | null | null | null | from vektonn import Vektonn
from vektonn.dtos import Attribute, AttributeValue, Vector, InputDataPoint, SearchQuery
vektonn_client = Vektonn('http://localhost:8081')
input_data_points = [
InputDataPoint(
attributes=[
Attribute(key='id', value=AttributeValue(int64=1)),
Attribute(key... | 36.727273 | 107 | 0.668812 | from vektonn import Vektonn
from vektonn.dtos import Attribute, AttributeValue, Vector, InputDataPoint, SearchQuery
vektonn_client = Vektonn('http://localhost:8081')
input_data_points = [
InputDataPoint(
attributes=[
Attribute(key='id', value=AttributeValue(int64=1)),
Attribute(key... | true | true |
790a60a49dc26ab2276e5b7f9d6b8ef287df3e6a | 1,052 | py | Python | spark_auto_mapper_fhir/value_sets/contract_resource_asset_availiability_codes.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/value_sets/contract_resource_asset_availiability_codes.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/contract_resource_asset_availiability_codes.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 30.941176 | 84 | 0.773764 | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
class ContractResourceAssetAvailiabilityCodesCode(GenericType... | true | true |
790a615280e0c22c06d8a7e914dff9de55aa0383 | 6,376 | py | Python | src/data_collection/data_collector.py | BigPeet/pr0tagger | 2b71bf7615dd8e8f7ba8e1875af7af90734c0f41 | [
"MIT"
] | null | null | null | src/data_collection/data_collector.py | BigPeet/pr0tagger | 2b71bf7615dd8e8f7ba8e1875af7af90734c0f41 | [
"MIT"
] | null | null | null | src/data_collection/data_collector.py | BigPeet/pr0tagger | 2b71bf7615dd8e8f7ba8e1875af7af90734c0f41 | [
"MIT"
] | null | null | null | from datetime import timedelta
import json
from os import listdir
from os.path import isfile, join
import pr0gramm
import logging
__author__ = "Peter Wolf"
__mail__ = "pwolf2310@gmail.com"
__date__ = "2016-12-26"
LOG = logging.getLogger(__name__)
class DataSources:
IMAGE, THUMBNAIL, FULL_SIZE = range(3)
class... | 33.208333 | 90 | 0.601317 | from datetime import timedelta
import json
from os import listdir
from os.path import isfile, join
import pr0gramm
import logging
__author__ = "Peter Wolf"
__mail__ = "pwolf2310@gmail.com"
__date__ = "2016-12-26"
LOG = logging.getLogger(__name__)
class DataSources:
IMAGE, THUMBNAIL, FULL_SIZE = range(3)
class... | false | true |
790a617397094ee99d1a32c7cebf6ff874f00fb3 | 2,029 | py | Python | app.py | asaxena2019/FakeNewsify-Article-Credibility-Checker | b7ce42a42f536cc758dee66fd5a8cd455195d8e8 | [
"MIT"
] | null | null | null | app.py | asaxena2019/FakeNewsify-Article-Credibility-Checker | b7ce42a42f536cc758dee66fd5a8cd455195d8e8 | [
"MIT"
] | null | null | null | app.py | asaxena2019/FakeNewsify-Article-Credibility-Checker | b7ce42a42f536cc758dee66fd5a8cd455195d8e8 | [
"MIT"
] | 2 | 2020-06-28T06:56:43.000Z | 2020-06-28T13:17:27.000Z | from flask import Flask, render_template, request
import model
from model import get_headlines
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
url = request.form['url']
predict = model.predict(url)
value = predict[1]
clickbait = pr... | 5.229381 | 121 | 0.377526 | from flask import Flask, render_template, request
import model
from model import get_headlines
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
url = request.form['url']
predict = model.predict(url)
value = predict[1]
clickbait = pr... | true | true |
790a61bd42bf4aee38a4d49463c7c31640a629fb | 250 | py | Python | autoflow/workflow/components/regression/decision_tree.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 49 | 2020-04-16T11:17:28.000Z | 2020-05-06T01:32:44.000Z | autoflow/workflow/components/regression/decision_tree.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | null | null | null | autoflow/workflow/components/regression/decision_tree.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 3 | 2020-04-17T00:53:24.000Z | 2020-04-23T03:04:26.000Z |
from autoflow.workflow.components.regression_base import AutoFlowRegressionAlgorithm
__all__ = ["DecisionTreeRegressor"]
class DecisionTreeRegressor(AutoFlowRegressionAlgorithm):
module__ = "sklearn.tree"
class__ = "DecisionTreeRegressor"
| 27.777778 | 84 | 0.824 |
from autoflow.workflow.components.regression_base import AutoFlowRegressionAlgorithm
__all__ = ["DecisionTreeRegressor"]
class DecisionTreeRegressor(AutoFlowRegressionAlgorithm):
module__ = "sklearn.tree"
class__ = "DecisionTreeRegressor"
| true | true |
790a62b53845b48a68a1ce0d3d33b573ca9fa60a | 18,846 | py | Python | scripts/validate_docstrings.py | mattboggess/pandas | 5551bcf9d297ea8a0aeffb70b17ae6730e8abf89 | [
"BSD-3-Clause"
] | 2 | 2018-09-06T13:36:11.000Z | 2018-09-09T12:38:22.000Z | scripts/validate_docstrings.py | mattboggess/pandas | 5551bcf9d297ea8a0aeffb70b17ae6730e8abf89 | [
"BSD-3-Clause"
] | 3 | 2018-09-24T22:09:28.000Z | 2018-10-01T21:10:00.000Z | scripts/validate_docstrings.py | mattboggess/pandas | 5551bcf9d297ea8a0aeffb70b17ae6730e8abf89 | [
"BSD-3-Clause"
] | 1 | 2020-06-06T13:28:03.000Z | 2020-06-06T13:28:03.000Z | #!/usr/bin/env python
"""
Analyze docstrings to detect errors.
If no argument is provided, it does a quick check of docstrings and returns
a csv with all API functions and results of basic checks.
If a function or method is provided in the form "pandas.function",
"pandas.module.class.method", etc. a list of all error... | 33.713775 | 79 | 0.566699 |
import os
import sys
import csv
import re
import functools
import collections
import argparse
import pydoc
import inspect
import importlib
import doctest
try:
from io import StringIO
except ImportError:
from cStringIO import StringIO
import numpy
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__f... | true | true |
790a631401282bc2c74fe83c59baab22405ceddc | 409 | py | Python | oeis/tribonacci.py | reidhoch/oeis-seq | 5ee5fa0743cbe8fbcdb38c1c085fee2c2f96f7e0 | [
"MIT"
] | null | null | null | oeis/tribonacci.py | reidhoch/oeis-seq | 5ee5fa0743cbe8fbcdb38c1c085fee2c2f96f7e0 | [
"MIT"
] | 37 | 2021-06-10T14:48:48.000Z | 2022-03-29T14:01:57.000Z | oeis/tribonacci.py | reidhoch/oeis-seq | 5ee5fa0743cbe8fbcdb38c1c085fee2c2f96f7e0 | [
"MIT"
] | null | null | null | # coding=utf-8
from typing import Iterable
from .registry import registry
@registry.register("A000073")
def tribonacci() -> Iterable[int]:
"""Tribonacci numbers."""
yield 0
yield 0
yield 1
p3: int = 0 # tribonacci(0)
p2: int = 0 # tribonacci(1)
p1: int = 1 # tribonacci(2)
while Tru... | 20.45 | 34 | 0.581907 |
from typing import Iterable
from .registry import registry
@registry.register("A000073")
def tribonacci() -> Iterable[int]:
yield 0
yield 0
yield 1
p3: int = 0
p2: int = 0
p1: int = 1
while True:
curr: int = p1 + p2 + p3
yield curr
p1, p2, p3 = curr, p1, p2
| true | true |
790a636642b90802ff3afe4d29661ae23d6f172c | 2,181 | py | Python | axiom/plugins/offeringcmd.py | jonathanj/mantissa | 53e5502aba23ce99be78b27f923a276593033fe8 | [
"MIT"
] | 6 | 2016-02-17T15:04:53.000Z | 2021-08-20T09:44:10.000Z | axiom/plugins/offeringcmd.py | jonathanj/mantissa | 53e5502aba23ce99be78b27f923a276593033fe8 | [
"MIT"
] | 62 | 2015-02-04T23:40:55.000Z | 2021-02-18T19:56:02.000Z | axiom/plugins/offeringcmd.py | jonathanj/mantissa | 53e5502aba23ce99be78b27f923a276593033fe8 | [
"MIT"
] | 8 | 2015-11-15T17:26:42.000Z | 2020-12-02T06:36:52.000Z | # -*- test-case-name: xmantissa.test.test_offering -*-
# Copyright 2008 Divmod, Inc. See LICENSE file for details
"""
Axiomatic commands for manipulating Mantissa offerings.
"""
from twisted.python import usage
from axiom.scripts import axiomatic
from xmantissa import offering, publicweb
class Install(axiomatic.Axio... | 28.697368 | 69 | 0.624484 |
"""
Axiomatic commands for manipulating Mantissa offerings.
"""
from twisted.python import usage
from axiom.scripts import axiomatic
from xmantissa import offering, publicweb
class Install(axiomatic.AxiomaticSubCommand):
synopsis = "<offering>"
def parseArgs(self, offering):
self["offering"] = sel... | false | true |
790a6455010972eec2db6ca0b66815f5563e0259 | 11,669 | py | Python | tests/BlazingSQLTest/EndToEndTests/allE2ETest.py | jglaser/blazingsql | 072dc007cf3e7ac9bdafc1ed8318a8f7b24a2657 | [
"Apache-2.0"
] | null | null | null | tests/BlazingSQLTest/EndToEndTests/allE2ETest.py | jglaser/blazingsql | 072dc007cf3e7ac9bdafc1ed8318a8f7b24a2657 | [
"Apache-2.0"
] | null | null | null | tests/BlazingSQLTest/EndToEndTests/allE2ETest.py | jglaser/blazingsql | 072dc007cf3e7ac9bdafc1ed8318a8f7b24a2657 | [
"Apache-2.0"
] | null | null | null | # from blazingsql import BlazingContext
from Configuration import ExecutionMode
from Configuration import Settings as Settings
# from dask.distributed import Client
from DataBase import createSchema as createSchema
# from EndToEndTests import countDistincTest
from EndToEndTests import (
GroupByWitoutAggregations,... | 37.28115 | 88 | 0.68592 |
from Configuration import ExecutionMode
from Configuration import Settings as Settings
from DataBase import createSchema as createSchema
from EndToEndTests import (
GroupByWitoutAggregations,
aggregationsWithoutGroupByTest,
bindableAliasTest,
booleanTest,
caseTest,
castTest,
)
from EndToEnd... | true | true |
790a659d49877395c271e997888d2d68ab466174 | 1,253 | py | Python | test/unit/test_construct_hostname.py | fermezz/snowflake-connector-python | bc9616ad568b23cb8a931d2d590041f6bac1cff9 | [
"Apache-2.0"
] | 1 | 2021-08-06T07:21:09.000Z | 2021-08-06T07:21:09.000Z | test/unit/test_construct_hostname.py | fermezz/snowflake-connector-python | bc9616ad568b23cb8a931d2d590041f6bac1cff9 | [
"Apache-2.0"
] | 37 | 2021-08-11T23:22:14.000Z | 2021-08-12T22:27:15.000Z | test/unit/test_construct_hostname.py | fermezz/snowflake-connector-python | bc9616ad568b23cb8a931d2d590041f6bac1cff9 | [
"Apache-2.0"
] | 2 | 2021-05-21T10:52:52.000Z | 2021-05-21T13:34:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
from snowflake.connector.util_text import construct_hostname
def test_construct_hostname_basic():
assert (
construct_hostname("eu-central-1", "account1")
== "account1.eu-centra... | 28.477273 | 85 | 0.672785 |
from snowflake.connector.util_text import construct_hostname
def test_construct_hostname_basic():
assert (
construct_hostname("eu-central-1", "account1")
== "account1.eu-central-1.snowflakecomputing.com"
)
assert construct_hostname("", "account1") == "account1.snowflakecomputing.com... | true | true |
790a66c97044ad3b15211984004d33fd39612f22 | 5,773 | py | Python | scripts/classifcation_pos_n_trials_back (cv counts).py | nmningmei/metacognition | 734082e247cc7fc9d277563e2676e10692617a3f | [
"MIT"
] | 3 | 2019-07-09T15:37:46.000Z | 2019-07-17T16:28:02.000Z | scripts/classifcation_pos_n_trials_back (cv counts).py | nmningmei/metacognition | 734082e247cc7fc9d277563e2676e10692617a3f | [
"MIT"
] | null | null | null | scripts/classifcation_pos_n_trials_back (cv counts).py | nmningmei/metacognition | 734082e247cc7fc9d277563e2676e10692617a3f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 15 16:02:16 2018
@author: ning
"""
import os
working_dir = ''
import pandas as pd
pd.options.mode.chained_assignment = None
import numpy as np
from utils import (cv_counts)
saving_dir = '../results/cv_counts'
if not os.path.exists(saving_dir):
os.mkdir(saving_dir)
#... | 33.760234 | 126 | 0.411744 |
import os
working_dir = ''
import pandas as pd
pd.options.mode.chained_assignment = None
import numpy as np
from utils import (cv_counts)
saving_dir = '../results/cv_counts'
if not os.path.exists(saving_dir):
os.mkdir(saving_dir)
for participant in ['AC', 'CL', 'FW', 'HB', 'KK', 'LM', 'MC', 'MP1', 'MP2', 'NN', ... | true | true |
790a66f1295e33e078d674f2139b0f8e3276cc44 | 567 | py | Python | pypesto/optimize/__init__.py | m-philipps/pyPESTO | 4c30abfca56ba714c302141cd44a9dd366bff4bb | [
"BSD-3-Clause"
] | null | null | null | pypesto/optimize/__init__.py | m-philipps/pyPESTO | 4c30abfca56ba714c302141cd44a9dd366bff4bb | [
"BSD-3-Clause"
] | null | null | null | pypesto/optimize/__init__.py | m-philipps/pyPESTO | 4c30abfca56ba714c302141cd44a9dd366bff4bb | [
"BSD-3-Clause"
] | null | null | null | # noqa: D400,D205
"""
Optimize
========
Multistart optimization with support for various optimizers.
"""
from .load import (
fill_result_from_history,
optimization_result_from_history,
read_result_from_file,
read_results_from_file,
)
from .optimize import minimize
from .optimizer import (
CmaesOpt... | 19.551724 | 60 | 0.746032 |
from .load import (
fill_result_from_history,
optimization_result_from_history,
read_result_from_file,
read_results_from_file,
)
from .optimize import minimize
from .optimizer import (
CmaesOptimizer,
DlibOptimizer,
FidesOptimizer,
IpoptOptimizer,
NLoptOptimizer,
Optimizer,
... | true | true |
790a673b35e41f916d9e970cf44d0e194dbec7d2 | 7,560 | py | Python | extra_views/formsets.py | incuna/django-extra-views | 37b08e2d27938ab24b22be3ffcec1b4370d621a9 | [
"MIT"
] | null | null | null | extra_views/formsets.py | incuna/django-extra-views | 37b08e2d27938ab24b22be3ffcec1b4370d621a9 | [
"MIT"
] | null | null | null | extra_views/formsets.py | incuna/django-extra-views | 37b08e2d27938ab24b22be3ffcec1b4370d621a9 | [
"MIT"
] | null | null | null | from django.views.generic.base import TemplateResponseMixin, View
from django.http import HttpResponseRedirect
from django.forms.formsets import formset_factory
from django.forms.models import modelformset_factory, inlineformset_factory
from django.views.generic.detail import SingleObjectMixin, SingleObjectTemplateResp... | 31.898734 | 102 | 0.661111 | from django.views.generic.base import TemplateResponseMixin, View
from django.http import HttpResponseRedirect
from django.forms.formsets import formset_factory
from django.forms.models import modelformset_factory, inlineformset_factory
from django.views.generic.detail import SingleObjectMixin, SingleObjectTemplateResp... | true | true |
790a67a273a5c775988c3b7f3af46bd673e53ab6 | 10,140 | py | Python | GamePad/gamepad.py | SrGambiarra/ESP8266-MultiplayerGame | 6c0d3e1f5d859d32fd980c143cfd22c2365d1099 | [
"RSA-MD"
] | null | null | null | GamePad/gamepad.py | SrGambiarra/ESP8266-MultiplayerGame | 6c0d3e1f5d859d32fd980c143cfd22c2365d1099 | [
"RSA-MD"
] | null | null | null | GamePad/gamepad.py | SrGambiarra/ESP8266-MultiplayerGame | 6c0d3e1f5d859d32fd980c143cfd22c2365d1099 | [
"RSA-MD"
] | null | null | null |
from multiprocessing import parent_process
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, ListProperty
from kivy.graphics import Color, Line
from kivy.uix.screenmanager import Screen
from kivy.animation import Animation
from random import random, randint
from kiv... | 35.208333 | 91 | 0.588659 |
from multiprocessing import parent_process
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, ListProperty
from kivy.graphics import Color, Line
from kivy.uix.screenmanager import Screen
from kivy.animation import Animation
from random import random, randint
from kiv... | true | true |
790a67a98070ead48d44cdba6898f8aa501a3001 | 48,634 | py | Python | editortools/filter.py | furminator/Furminator-MCPE-Tool | 4fe247351503781db2012815c1e40e881d9e1bba | [
"0BSD"
] | null | null | null | editortools/filter.py | furminator/Furminator-MCPE-Tool | 4fe247351503781db2012815c1e40e881d9e1bba | [
"0BSD"
] | null | null | null | editortools/filter.py | furminator/Furminator-MCPE-Tool | 4fe247351503781db2012815c1e40e881d9e1bba | [
"0BSD"
] | null | null | null | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 40.697908 | 153 | 0.562857 | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | false | true |
790a67bcfeb56bd0391430b120308c8776f637d9 | 376 | py | Python | Old/exercise/example52.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | Old/exercise/example52.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | 1 | 2018-11-27T09:58:54.000Z | 2018-11-27T09:58:54.000Z | Old/exercise/example52.py | exchris/pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/7/25 0025 上午 10:14
# @Author : Exchris Tsai
# @Site :
# @File : example52.py
# @Software: PyCharm
"""
题目:学习使用按位或 | 。
程序分析:0|0=0; 0|1=1; 1|0=1; 1|1=1
"""
__author__ = 'Exchris Tsai'
if __name__ == '__main__':
a = 0o77
b = a | 3
print(... | 17.904762 | 36 | 0.513298 |
__author__ = 'Exchris Tsai'
if __name__ == '__main__':
a = 0o77
b = a | 3
print('a | b is %d' %b)
b |= 7
print('a | b is %d' %b) | true | true |
790a680754acad956620180933bf33dc64c43918 | 508 | py | Python | tests/example.py | bwohlberg/py2nb | efc98c33c34f364f582da5f716f678253c2887ba | [
"BSD-3-Clause"
] | 79 | 2015-06-05T17:38:07.000Z | 2020-08-09T01:52:00.000Z | tests/example.py | bwohlberg/py2jn | efc98c33c34f364f582da5f716f678253c2887ba | [
"BSD-3-Clause"
] | 6 | 2017-02-14T03:20:56.000Z | 2018-06-15T19:14:12.000Z | tests/example.py | bwohlberg/py2jn | efc98c33c34f364f582da5f716f678253c2887ba | [
"BSD-3-Clause"
] | 41 | 2017-02-13T23:00:32.000Z | 2020-04-05T06:31:45.000Z | """
# Hello
Demonstrate:
* conversion of regular python script into _Jupyter notebook_
* support **Markdown**
* this is a list
"""
from __future__ import absolute_import, print_function, division
"""
## Hello
This is a *hello world* function.
"""
def hello():
"""
This is a docstring
"""
print("he... | 10.367347 | 64 | 0.582677 |
from __future__ import absolute_import, print_function, division
def hello():
print("hello")
def main():
hello()
if __name__ == '__main__':
def what():
main()
print(what())
| true | true |
790a68208e1c6207772a92098da7f33d1495a262 | 424 | py | Python | tests/migrations/2015_10_10_move_keys.py | adamlwgriffiths/exodus | a8bd7edcc963fb87e034b06de6db3ae5948f5668 | [
"BSD-2-Clause"
] | 1 | 2015-10-21T06:15:24.000Z | 2015-10-21T06:15:24.000Z | tests/jaweson_migrations/2015_10_10_move_keys.py | adamlwgriffiths/exodus | a8bd7edcc963fb87e034b06de6db3ae5948f5668 | [
"BSD-2-Clause"
] | null | null | null | tests/jaweson_migrations/2015_10_10_move_keys.py | adamlwgriffiths/exodus | a8bd7edcc963fb87e034b06de6db3ae5948f5668 | [
"BSD-2-Clause"
] | 1 | 2019-11-06T11:44:15.000Z | 2019-11-06T11:44:15.000Z | from __future__ import print_function
from exodus import BaseMigration
class Migration(BaseMigration):
version = '2015_10_10'
def can_migrate_database(self, adapter):
return self.version > adapter.db.get('version', None)
def migrate_database(self, adapter):
# migrate the keys
ada... | 26.5 | 61 | 0.67217 | from __future__ import print_function
from exodus import BaseMigration
class Migration(BaseMigration):
version = '2015_10_10'
def can_migrate_database(self, adapter):
return self.version > adapter.db.get('version', None)
def migrate_database(self, adapter):
adapter.db['c'] = ada... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.