hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7d443d3261577798584404873e079b8cf3a20357 | 709 | py | Python | tests/test_sample.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | 1 | 2019-09-15T12:30:44.000Z | 2019-09-15T12:30:44.000Z | tests/test_sample.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | null | null | null | tests/test_sample.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | null | null | null | from pathlib import Path
from wired_components.resource import Root
| 27.269231 | 64 | 0.693935 | from pathlib import Path
from wired_components.resource import Root
def test_load_yaml(mocker):
from wired_components.samples.simple import load_yaml
yaml_string = """\
- title: Dummy Page
"""
mocker.patch(
'builtins.open', mocker.mock_open(read_data=yaml_string)
)
fn = Path('dummy_resour... | 592 | 0 | 46 |
4faf48cdf8e7170277bec6b62b80d8b5988b9ce0 | 2,024 | py | Python | src/terial/web/views/exemplar_views.py | keunhong/photoshape | 6e795512e059bc5a6bdac748fda961f66d51c6f6 | [
"PostgreSQL"
] | 81 | 2018-10-10T06:55:41.000Z | 2022-03-01T04:18:23.000Z | src/terial/web/views/exemplar_views.py | keunhong/photoshape | 6e795512e059bc5a6bdac748fda961f66d51c6f6 | [
"PostgreSQL"
] | 17 | 2018-10-22T04:50:59.000Z | 2022-02-12T00:29:11.000Z | src/terial/web/views/exemplar_views.py | keunhong/photoshape | 6e795512e059bc5a6bdac748fda961f66d51c6f6 | [
"PostgreSQL"
] | 16 | 2018-11-20T06:57:32.000Z | 2021-12-24T07:09:37.000Z | import math
from typing import List
import aiohttp_jinja2
from aiohttp import web
import sqlalchemy as sa
from terial.database import session_scope
from terial.models import Exemplar
@aiohttp_jinja2.template('list_exemplars.html')
| 29.333333 | 72 | 0.590909 | import math
from typing import List
import aiohttp_jinja2
from aiohttp import web
import sqlalchemy as sa
from terial.database import session_scope
from terial.models import Exemplar
@aiohttp_jinja2.template('list_exemplars.html')
async def list_exemplars(request: web.Request):
page = int(request.query.get('pag... | 1,743 | 0 | 45 |
c5d143b59144d668f255574870a8bfbbd66ebf5d | 210 | py | Python | spark_pipeline_framework/utilities/slack/base_slack_client.py | imranq2/SparkPipelineFramework | 3eb4ba959f8cbcbadc171023183044b699a00670 | [
"Apache-2.0"
] | 4 | 2020-09-21T01:05:11.000Z | 2020-11-17T23:02:00.000Z | spark_pipeline_framework/utilities/slack/base_slack_client.py | imranq2/SparkPipelineFramework | 3eb4ba959f8cbcbadc171023183044b699a00670 | [
"Apache-2.0"
] | 6 | 2020-10-27T20:33:10.000Z | 2021-06-04T01:56:32.000Z | spark_pipeline_framework/utilities/slack/base_slack_client.py | imranq2/SparkPipelineFramework | 3eb4ba959f8cbcbadc171023183044b699a00670 | [
"Apache-2.0"
] | 1 | 2020-10-08T16:53:25.000Z | 2020-10-08T16:53:25.000Z | from typing import Any
| 23.333333 | 82 | 0.695238 | from typing import Any
class BaseSlackClient:
def post_message_to_slack(
self, text: str, blocks: Any = None, use_conversation_threads: bool = True
) -> Any:
raise NotImplementedError
| 136 | 1 | 49 |
a3a7da4e7d8895083a6a7186378bcf984a75f4cb | 985 | py | Python | gridGenerator.py | traubad/RNNDBSCAN | 055f8f92ab61ea17df4ae56bcd1cc51c8c7b82ad | [
"MIT"
] | 1 | 2019-12-07T07:21:49.000Z | 2019-12-07T07:21:49.000Z | gridGenerator.py | traubad/RNNDBSCAN | 055f8f92ab61ea17df4ae56bcd1cc51c8c7b82ad | [
"MIT"
] | null | null | null | gridGenerator.py | traubad/RNNDBSCAN | 055f8f92ab61ea17df4ae56bcd1cc51c8c7b82ad | [
"MIT"
] | null | null | null | from random import randint
import csv
#Used for generating grid dataset
if __name__ == "__main__":
main()
| 31.774194 | 266 | 0.663959 | from random import randint
import csv
#Used for generating grid dataset
def makeGrid(classifier, num_dimensions,num_observations,d,startX=0,startY=0):
toAdd = [startX, startY, classifier]
output = [tuple(toAdd)]
for i in range((num_observations//2)-1):
toAdd[randint(0,1)] += d + randint(0... | 785 | 0 | 75 |
fc775a183adb86ab96470725ff2d2e93266ed666 | 6,279 | py | Python | utils/converters/default_symbol_name_formatter.py | LuizZak/swift-blend2d | 29bc21b592fd1054b68f48b3b4ca7d1515869220 | [
"Zlib",
"MIT"
] | 7 | 2019-04-22T10:21:18.000Z | 2021-05-11T01:35:06.000Z | utils/converters/default_symbol_name_formatter.py | LuizZak/swift-blend2d | 29bc21b592fd1054b68f48b3b4ca7d1515869220 | [
"Zlib",
"MIT"
] | 1 | 2021-04-01T12:51:35.000Z | 2021-04-06T12:44:08.000Z | utils/converters/default_symbol_name_formatter.py | LuizZak/swift-blend2d | 29bc21b592fd1054b68f48b3b4ca7d1515869220 | [
"Zlib",
"MIT"
] | null | null | null | import re
from typing import Tuple
from utils.collection.collection_utils import flatten
from utils.converters.base_word_capitalizer import BaseWordCapitalizer
from utils.converters.symbol_name_formatter import SymbolNameFormatter
from utils.data.compound_symbol_name import CompoundSymbolName
from utils.data.compound... | 32.874346 | 140 | 0.620959 | import re
from typing import Tuple
from utils.collection.collection_utils import flatten
from utils.converters.base_word_capitalizer import BaseWordCapitalizer
from utils.converters.symbol_name_formatter import SymbolNameFormatter
from utils.data.compound_symbol_name import CompoundSymbolName
from utils.data.compound... | 4,424 | 1,477 | 23 |
68e0122f50834132af7d602cb7a809c49acd7ff2 | 1,166 | py | Python | src/originexample/pipelines/import_technologies.py | project-origin/example-backend | 13d9b528533dcaada8b0f0b93bbe2ef6a25c38ae | [
"MIT"
] | null | null | null | src/originexample/pipelines/import_technologies.py | project-origin/example-backend | 13d9b528533dcaada8b0f0b93bbe2ef6a25c38ae | [
"MIT"
] | 1 | 2021-02-10T02:22:51.000Z | 2021-02-10T02:22:51.000Z | src/originexample/pipelines/import_technologies.py | project-origin/example-backend | 13d9b528533dcaada8b0f0b93bbe2ef6a25c38ae | [
"MIT"
] | null | null | null | """
TODO write this
"""
from originexample import logger
from originexample.db import atomic
from originexample.tasks import celery_app
from originexample.technology import Technology
from originexample.services.datahub import DataHubService
service = DataHubService()
@celery_app.task(
name='import_technologie... | 24.291667 | 68 | 0.729846 | """
TODO write this
"""
from originexample import logger
from originexample.db import atomic
from originexample.tasks import celery_app
from originexample.technology import Technology
from originexample.services.datahub import DataHubService
service = DataHubService()
def start_import_technologies():
import_tec... | 92 | 0 | 23 |
df068ce28f0831985e7392ecb95bec26a263b922 | 403 | py | Python | Biblioteca/views.py | Erik172/BibliotecaEscolarARP | 1cc61f5e0079d08eb54f1b49eb158bf57710007c | [
"MIT"
] | null | null | null | Biblioteca/views.py | Erik172/BibliotecaEscolarARP | 1cc61f5e0079d08eb54f1b49eb158bf57710007c | [
"MIT"
] | null | null | null | Biblioteca/views.py | Erik172/BibliotecaEscolarARP | 1cc61f5e0079d08eb54f1b49eb158bf57710007c | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from posts.models import Post
from books import services
| 26.866667 | 57 | 0.69727 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from posts.models import Post
from books import services
def home(request):
posts = Post.objects.all().order_by('-created')
# books = services.getMostViewBooks(3, 'spanish')
context = {
'posts': posts
# ... | 229 | 0 | 23 |
54a63c5bd57473c9654dfbc7f166b3764fe49015 | 725 | py | Python | tests/scripts/select.py | ChrisAHolland/constexpr-sql | 3ea390a3f8a5d0e1dcb9b5f187121d4649e5f9c3 | [
"MIT"
] | 121 | 2020-04-21T13:21:55.000Z | 2021-11-15T09:48:47.000Z | tests/scripts/select.py | ChrisAHolland/constexpr-sql | 3ea390a3f8a5d0e1dcb9b5f187121d4649e5f9c3 | [
"MIT"
] | 3 | 2020-04-23T05:29:54.000Z | 2021-07-18T18:37:57.000Z | tests/scripts/select.py | ChrisAHolland/constexpr-sql | 3ea390a3f8a5d0e1dcb9b5f187121d4649e5f9c3 | [
"MIT"
] | 5 | 2020-04-23T05:01:02.000Z | 2022-02-21T21:00:30.000Z | # Randomly selects ~500 queries to test from the 1.4mil query set
import random
if __name__ == "__main__":
main()
| 24.166667 | 65 | 0.662069 | # Randomly selects ~500 queries to test from the 1.4mil query set
import random
def main():
outfile = open("queries/test-queries.txt", "w")
#h = 100 / 23000
#h = 0
h = 1.0
outfile.write("JOINLESS\n")
with open("queries/joinless-queries.txt", "r") as infile:
for line in infile:
if random.random() < h:
o... | 585 | 0 | 23 |
1e9192d3f98e0f11bacec71e8c0c0fbbd40587c6 | 8,350 | py | Python | small-strain/laminate/visco-plasticity.py | tdegeus/GooseFFT | 1e460e6fed750cbaf33139e13cfc27dee5ab291e | [
"MIT"
] | 21 | 2017-02-22T10:26:46.000Z | 2022-03-13T20:54:26.000Z | small-strain/laminate/visco-plasticity.py | AbduKT/GooseFFT | 9c10ea3559680834fb99a4491eee9a17a7228792 | [
"MIT"
] | 6 | 2018-04-26T05:33:02.000Z | 2021-11-15T07:37:09.000Z | small-strain/laminate/visco-plasticity.py | AbduKT/GooseFFT | 9c10ea3559680834fb99a4491eee9a17a7228792 | [
"MIT"
] | 13 | 2017-02-03T15:13:20.000Z | 2021-11-25T14:56:28.000Z | import numpy as np
import scipy.sparse.linalg as sp
import itertools
# turn of warning for zero division (occurs due to vectorization)
np.seterr(divide='ignore', invalid='ignore')
# ----------------------------------- GRID ------------------------------------
Nx = 31 # number of voxels in x-direction... | 36.147186 | 88 | 0.561317 | import numpy as np
import scipy.sparse.linalg as sp
import itertools
# turn of warning for zero division (occurs due to vectorization)
np.seterr(divide='ignore', invalid='ignore')
# ----------------------------------- GRID ------------------------------------
Nx = 31 # number of voxels in x-direction... | 2,244 | 0 | 69 |
cd82d51334bf475ed31086e785ad896c08f0b0ce | 2,128 | py | Python | helpers.py | ryanorsinger/helpers | e4b323c9fb97f569357ede72794fa8a504c499cd | [
"MIT"
] | null | null | null | helpers.py | ryanorsinger/helpers | e4b323c9fb97f569357ede72794fa8a504c499cd | [
"MIT"
] | null | null | null | helpers.py | ryanorsinger/helpers | e4b323c9fb97f569357ede72794fa8a504c499cd | [
"MIT"
] | null | null | null | def remove_digits(s):
"""
Returns a string with all digits removed.
"""
return ''.join(filter(lambda x: not x.isdigit(), s))
def remove_parentheticals(s):
"""
Removes any parenthetical expression from a string
Returns "Bolivia" from "Bolivia (Plurinational State of)"
"""
... | 30.4 | 101 | 0.654605 | def remove_digits(s):
"""
Returns a string with all digits removed.
"""
return ''.join(filter(lambda x: not x.isdigit(), s))
def remove_parentheticals(s):
"""
Removes any parenthetical expression from a string
Returns "Bolivia" from "Bolivia (Plurinational State of)"
"""
... | 127 | 0 | 22 |
f7326cbc92b19dd088c0d4b5e17acb19500de1d9 | 4,740 | py | Python | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 43 | 2015-09-25T19:46:04.000Z | 2022-01-25T22:38:39.000Z | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 21 | 2015-09-10T15:40:26.000Z | 2021-08-31T15:17:25.000Z | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 16 | 2015-09-09T02:32:35.000Z | 2022-03-17T02:51:26.000Z | from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.decorators im... | 31.184211 | 100 | 0.665401 | from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.decorators im... | 2,600 | 1,154 | 419 |
93144c90e848fe4fa54700fe844b2ed596eb4b24 | 5,353 | py | Python | dpkt/aim.py | Vito-Swift/dpkt | 9242f8d116b6e26d8f1d78a1b5f62f14b4dc8a37 | [
"BSD-3-Clause"
] | 924 | 2015-01-04T01:22:15.000Z | 2022-03-28T02:22:46.000Z | dpkt/aim.py | Vito-Swift/dpkt | 9242f8d116b6e26d8f1d78a1b5f62f14b4dc8a37 | [
"BSD-3-Clause"
] | 599 | 2015-01-02T18:06:52.000Z | 2022-03-29T16:00:17.000Z | dpkt/aim.py | Vito-Swift/dpkt | 9242f8d116b6e26d8f1d78a1b5f62f14b4dc8a37 | [
"BSD-3-Clause"
] | 299 | 2015-02-12T19:50:34.000Z | 2022-03-15T00:35:29.000Z | # $Id: aim.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""AOL Instant Messenger."""
from __future__ import absolute_import
import struct
from . import dpkt
# OSCAR: http://iserverd1.khstu.ru/oscar/
class FLAP(dpkt.Packet):
"""Frame Layer Protocol.
See more about the FLAP on
https://e... | 33.45625 | 99 | 0.595367 | # $Id: aim.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""AOL Instant Messenger."""
from __future__ import absolute_import
import struct
from . import dpkt
# OSCAR: http://iserverd1.khstu.ru/oscar/
class FLAP(dpkt.Packet):
"""Frame Layer Protocol.
See more about the FLAP on
https://e... | 4,187 | 0 | 96 |
6cc4a44401acf8759fefb258de8c185f169f4e2c | 3,520 | py | Python | src/ppopt/utils/chebyshev_ball.py | TAMUparametric/PPOPT | 2d20f60e7e7c312f761d5563ba808bd0bb9361e5 | [
"MIT"
] | 9 | 2021-09-24T20:17:46.000Z | 2022-03-25T23:12:49.000Z | src/ppopt/utils/chebyshev_ball.py | TAMUparametric/PPOPT | 2d20f60e7e7c312f761d5563ba808bd0bb9361e5 | [
"MIT"
] | null | null | null | src/ppopt/utils/chebyshev_ball.py | TAMUparametric/PPOPT | 2d20f60e7e7c312f761d5563ba808bd0bb9361e5 | [
"MIT"
] | 2 | 2021-09-28T23:23:32.000Z | 2022-03-11T20:59:51.000Z | from typing import Iterable
import numpy
from ..solver_interface.solver_interface import solve_milp, solve_lp
from ..utils.constraint_utilities import constraint_norm
from ..utils.general_utils import make_column
def chebyshev_ball(A: numpy.ndarray, b: numpy.ndarray, equality_constraints: Iterable[int] = None,
... | 33.207547 | 119 | 0.613068 | from typing import Iterable
import numpy
from ..solver_interface.solver_interface import solve_milp, solve_lp
from ..utils.constraint_utilities import constraint_norm
from ..utils.general_utils import make_column
def chebyshev_ball(A: numpy.ndarray, b: numpy.ndarray, equality_constraints: Iterable[int] = None,
... | 0 | 0 | 0 |
6001b1e117cfc669e6ac3ee08b66d6720ecbb2a3 | 960 | py | Python | contact/models.py | IATI/new-website | b90783e32d19ac4c821c5ea018a52997a11b5286 | [
"MIT"
] | 4 | 2019-03-28T06:42:17.000Z | 2021-06-06T13:10:51.000Z | contact/models.py | IATI/new-website | b90783e32d19ac4c821c5ea018a52997a11b5286 | [
"MIT"
] | 177 | 2018-09-28T14:21:56.000Z | 2022-03-30T21:45:26.000Z | contact/models.py | IATI/new-website | b90783e32d19ac4c821c5ea018a52997a11b5286 | [
"MIT"
] | 8 | 2018-10-25T20:43:10.000Z | 2022-03-17T14:19:27.000Z | """Model definitions for the contact app."""
from wagtail.core.blocks import RichTextBlock, StreamBlock, StructBlock, TextBlock
from wagtail.core.fields import StreamField
from home.models import AbstractContentPage, DefaultPageHeaderImageMixin
class ContactTypeStreamBlock(StreamBlock):
"""Model allowing the CMS... | 34.285714 | 82 | 0.74375 | """Model definitions for the contact app."""
from wagtail.core.blocks import RichTextBlock, StreamBlock, StructBlock, TextBlock
from wagtail.core.fields import StreamField
from home.models import AbstractContentPage, DefaultPageHeaderImageMixin
class ContactTypeStreamBlock(StreamBlock):
"""Model allowing the CMS... | 0 | 0 | 0 |
a940241721a927fba8f0f74545c31941cb57ccb9 | 37 | py | Python | week1/14.py | kamorozov/coursera_python | 706bc1bc46839f8b3debdf293240ad5ce20c9775 | [
"Unlicense"
] | 2 | 2019-05-17T13:42:02.000Z | 2019-05-18T04:00:35.000Z | week1/14.py | kamorozov/coursera_python | 706bc1bc46839f8b3debdf293240ad5ce20c9775 | [
"Unlicense"
] | null | null | null | week1/14.py | kamorozov/coursera_python | 706bc1bc46839f8b3debdf293240ad5ce20c9775 | [
"Unlicense"
] | 2 | 2019-10-03T09:07:44.000Z | 2019-12-28T19:17:20.000Z | A = int(input())
print((A - 1)**A)
| 12.333333 | 18 | 0.459459 | A = int(input())
print((A - 1)**A)
| 0 | 0 | 0 |
51b9aba6709bebeb7887ebcdf5073c5b0a930ed0 | 129 | py | Python | nada/__init__.py | ahonn/Luoo-vol | 320f4569daaaa150ef972493801ab7926ecdd594 | [
"MIT"
] | null | null | null | nada/__init__.py | ahonn/Luoo-vol | 320f4569daaaa150ef972493801ab7926ecdd594 | [
"MIT"
] | null | null | null | nada/__init__.py | ahonn/Luoo-vol | 320f4569daaaa150ef972493801ab7926ecdd594 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Nada
"""
from menu import Menu
| 9.923077 | 24 | 0.496124 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Nada
"""
from menu import Menu
def start():
Menu().start()
| 11 | 0 | 25 |
211c14723164a1c16c14af2b23eca8ab409024d5 | 3,077 | py | Python | py/rackattack/ssh/connection.py | noam-stratoscale/rackattack-api | 05e5b45753db0873a7c4d995f8fa0aa227610a6c | [
"Apache-2.0"
] | null | null | null | py/rackattack/ssh/connection.py | noam-stratoscale/rackattack-api | 05e5b45753db0873a7c4d995f8fa0aa227610a6c | [
"Apache-2.0"
] | null | null | null | py/rackattack/ssh/connection.py | noam-stratoscale/rackattack-api | 05e5b45753db0873a7c4d995f8fa0aa227610a6c | [
"Apache-2.0"
] | null | null | null | import paramiko
import tempfile
import time
import socket
import logging
from rackattack.ssh import ftp
from rackattack.ssh import run
from rackattack.ssh import dirftp
from rackattack.ssh import tunnel
| 30.77 | 108 | 0.638284 | import paramiko
import tempfile
import time
import socket
import logging
from rackattack.ssh import ftp
from rackattack.ssh import run
from rackattack.ssh import dirftp
from rackattack.ssh import tunnel
def discardParamikoLogs():
logging.getLogger('paramiko').setLevel(logging.CRITICAL)
def discardSSHDebugMessag... | 2,481 | 321 | 69 |
327c774a30ada53f57558f96b6ca6c36bb7438c6 | 6,515 | py | Python | cmg/widgets/widget.py | cubeman99/russian-study-tool | b073df4694f1ad064a780088cdcb1436e1bde7e9 | [
"MIT"
] | null | null | null | cmg/widgets/widget.py | cubeman99/russian-study-tool | b073df4694f1ad064a780088cdcb1436e1bde7e9 | [
"MIT"
] | null | null | null | cmg/widgets/widget.py | cubeman99/russian-study-tool | b073df4694f1ad064a780088cdcb1436e1bde7e9 | [
"MIT"
] | null | null | null | import traceback
from pygame.rect import Rect
import cmg
from cmg.color import Color
from cmg.widgets.layout_item import LayoutItem
from cmg.event import Event
from cmg.input import KeyShortcut
| 28.203463 | 79 | 0.587874 | import traceback
from pygame.rect import Rect
import cmg
from cmg.color import Color
from cmg.widgets.layout_item import LayoutItem
from cmg.event import Event
from cmg.input import KeyShortcut
class Widget(LayoutItem):
def __init__(self):
super().__init__()
self.layout = None
self.rect = ... | 5,012 | 1,285 | 23 |
adc58009d1366b74fd9bf2c0881c20a95192c79f | 3,097 | py | Python | atomtools/filetype.py | atomse/atomtools | 6771dca631dc9330822bb50826e2700ba6973b32 | [
"MIT"
] | null | null | null | atomtools/filetype.py | atomse/atomtools | 6771dca631dc9330822bb50826e2700ba6973b32 | [
"MIT"
] | null | null | null | atomtools/filetype.py | atomse/atomtools | 6771dca631dc9330822bb50826e2700ba6973b32 | [
"MIT"
] | null | null | null | """
analyze chemical input/output filetype
"""
import os
import re
import argparse
import configparser
import modlog
from . import fileutil
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEFAULT_FILETYPE_REGEXP_CONF = 'default_filetype.conf'
DEFAULT_FILETYPE_REGEXP_CONF = os.path.join(
BASE_DIR, DEFAULT_... | 30.663366 | 96 | 0.674847 | """
analyze chemical input/output filetype
"""
import os
import re
import argparse
import configparser
import modlog
from . import fileutil
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEFAULT_FILETYPE_REGEXP_CONF = 'default_filetype.conf'
DEFAULT_FILETYPE_REGEXP_CONF = os.path.join(
BASE_DIR, DEFAULT_... | 508 | 0 | 69 |
068dfbf08898069352c3118723160a054bd585fe | 3,173 | py | Python | AuthenticationApp/models.py | Kayarn-Mechatronics/Octello | 45f4f73c764ca816918c31ef3ae4889740a68802 | [
"Apache-2.0"
] | null | null | null | AuthenticationApp/models.py | Kayarn-Mechatronics/Octello | 45f4f73c764ca816918c31ef3ae4889740a68802 | [
"Apache-2.0"
] | null | null | null | AuthenticationApp/models.py | Kayarn-Mechatronics/Octello | 45f4f73c764ca816918c31ef3ae4889740a68802 | [
"Apache-2.0"
] | null | null | null | from django.db import models, utils
from django.contrib.auth.models import AbstractUser
from django.contrib.sessions.base_session import AbstractBaseSession
from datetime import *
| 36.471264 | 109 | 0.581469 | from django.db import models, utils
from django.contrib.auth.models import AbstractUser
from django.contrib.sessions.base_session import AbstractBaseSession
from datetime import *
class Enterprises(models.Model):
enterprise_id = models.CharField(primary_key=True, max_length=20, null=False, unique=True)
name =... | 1,935 | 1,007 | 50 |
a7de339f5ac35603d4d1abec51dab361191355e6 | 5,732 | py | Python | RecongnizeCorridor/ogrTest.py | joyerf/LearnPythonGDAL | 5ffea10a179a3239bc435473e4a08c0cb58fbfae | [
"Apache-2.0"
] | null | null | null | RecongnizeCorridor/ogrTest.py | joyerf/LearnPythonGDAL | 5ffea10a179a3239bc435473e4a08c0cb58fbfae | [
"Apache-2.0"
] | null | null | null | RecongnizeCorridor/ogrTest.py | joyerf/LearnPythonGDAL | 5ffea10a179a3239bc435473e4a08c0cb58fbfae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
import log
from osgeo import ogr
import os
import feature
SHAPE_DRIVER = ogr.GetDriverByName('ESRI Shapefile')
def read(path=''):
"""
读取SHP文件
:param path:
:return:
"""
# 读取数据层
datasource = SHAPE_DRIVER.Open(path, 0) # 0 means read-only. 1 means writeabl... | 35.825 | 111 | 0.698011 | #!/usr/bin/python
# coding: utf-8
import log
from osgeo import ogr
import os
import feature
SHAPE_DRIVER = ogr.GetDriverByName('ESRI Shapefile')
def test_capability(path):
ds = ogr.Open(path, 0)
if ds is None:
log.debug('Shape file could not open from', path)
return
layer = ds.GetLayer()
... | 4,258 | 0 | 115 |
62f6bb39bce0d98f5904b8caf6dfcc72eff8bd3b | 2,593 | py | Python | 2018/day6/day6.py | ChuckWoodraska/AdventOfCode2018 | e690b195a948824aa4cb128377791b9d86a818fa | [
"MIT"
] | null | null | null | 2018/day6/day6.py | ChuckWoodraska/AdventOfCode2018 | e690b195a948824aa4cb128377791b9d86a818fa | [
"MIT"
] | null | null | null | 2018/day6/day6.py | ChuckWoodraska/AdventOfCode2018 | e690b195a948824aa4cb128377791b9d86a818fa | [
"MIT"
] | null | null | null | from collections import namedtuple
with open('input.txt', 'r') as f:
data = f.read().splitlines()
# Figure out array size
x_size = max([int(line.split(', ')[0]) for line in data]) + 1
y_size = max([int(line.split(', ')[1]) for line in data]) + 1
grid_list = [[0 for y in range(y_size)] for x in
... | 30.151163 | 79 | 0.568454 | from collections import namedtuple
def manhattan_distance(point_a, centers):
min_dist = [None, None, False]
for point_b in centers:
dist = abs(point_a[0] - point_b.x) + abs(point_a[1] - point_b.y)
if dist == 0:
return point_b.id
if min_dist[0] is None:
min_dist[... | 896 | 0 | 46 |
89f429668769ac8c6599a254a78bbce159dcc0cf | 1,932 | py | Python | project/app/auth/register.py | Rafiatu/cinch | 05f3927363a9f75598611e3f152b90464a588de2 | [
"MIT"
] | null | null | null | project/app/auth/register.py | Rafiatu/cinch | 05f3927363a9f75598611e3f152b90464a588de2 | [
"MIT"
] | null | null | null | project/app/auth/register.py | Rafiatu/cinch | 05f3927363a9f75598611e3f152b90464a588de2 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from db.serializers.user_serializer import UserSerializer
from lib.lower_strip import strip_and_lower
from app.action import Action
from db.models.artist import Artist
from db.models.account import Account
from ..validations.validate_artist import RegisterArtistValidation
... | 29.723077 | 85 | 0.626294 | from django.contrib.auth import get_user_model
from db.serializers.user_serializer import UserSerializer
from lib.lower_strip import strip_and_lower
from app.action import Action
from db.models.artist import Artist
from db.models.account import Account
from ..validations.validate_artist import RegisterArtistValidation
... | 1,534 | 54 | 23 |
a728db8eaa007ff626a15b4563f677a899a7920c | 1,452 | py | Python | dartsapp/player.py | SchluppiBobbz/DartsApp | 3538b90db30b4c59a03d49867df58b62d2e0a84a | [
"MIT"
] | null | null | null | dartsapp/player.py | SchluppiBobbz/DartsApp | 3538b90db30b4c59a03d49867df58b62d2e0a84a | [
"MIT"
] | null | null | null | dartsapp/player.py | SchluppiBobbz/DartsApp | 3538b90db30b4c59a03d49867df58b62d2e0a84a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Player module."""
import datetime
| 24.610169 | 88 | 0.545455 | # -*- coding: utf-8 -*-
"""Player module."""
import datetime
class Player(object):
ARROWS_LEFT = 0
GAMES_PLAYED = 0
GAMES_WON = 0
GAME_HISTORY = {}
RECENT_FIELDS = []
ACTUAL_HAND = []
def __init__(self, name="player", gender="m"):
if name:
self.name = name... | 928 | 440 | 23 |
f8e441b2b7bbb539f52d5aeea7edfa097a0617da | 1,794 | py | Python | starry/_core/ops/spot.py | fbartolic/starry | d50576caf964ad925c490c9f3ffe1273ab155397 | [
"MIT"
] | null | null | null | starry/_core/ops/spot.py | fbartolic/starry | d50576caf964ad925c490c9f3ffe1273ab155397 | [
"MIT"
] | null | null | null | starry/_core/ops/spot.py | fbartolic/starry | d50576caf964ad925c490c9f3ffe1273ab155397 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import theano
from theano import gof
import theano.tensor as tt
__all__ = ["spotYlmOp"]
| 30.931034 | 72 | 0.590858 | # -*- coding: utf-8 -*-
import numpy as np
import theano
from theano import gof
import theano.tensor as tt
__all__ = ["spotYlmOp"]
class spotYlmOp(tt.Op):
def __init__(self, func, ydeg, nw):
self.func = func
self._grad_op = spotYlmGradientOp(self)
self.Ny = (ydeg + 1) ** 2
self.nw... | 1,361 | 12 | 287 |
cabeedc1d15e9310c1089341891ca5341a8f26ac | 20,701 | py | Python | enaml/core/declarative.py | mmckerns/enaml | ebf417b4dce9132bffa038a588ad90436a59d37e | [
"BSD-3-Clause"
] | 11 | 2015-01-04T14:29:23.000Z | 2019-12-25T05:38:37.000Z | enaml/core/declarative.py | mmckerns/enaml | ebf417b4dce9132bffa038a588ad90436a59d37e | [
"BSD-3-Clause"
] | 36 | 2015-02-20T00:56:53.000Z | 2020-12-04T10:02:14.000Z | enaml/core/declarative.py | mmckerns/enaml | ebf417b4dce9132bffa038a588ad90436a59d37e | [
"BSD-3-Clause"
] | 3 | 2015-11-19T15:11:37.000Z | 2019-03-11T23:45:02.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
from types import FunctionType
from traits.api import (
Any, Property, Disallow, ReadOnly, C... | 35.939236 | 79 | 0.607217 | #------------------------------------------------------------------------------
# Copyright (c) 2013, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
from types import FunctionType
from traits.api import (
Any, Property, Disallow, ReadOnly, C... | 0 | 0 | 0 |
c4d6eba8f83a0d5ffc74046bfcea33567f116c00 | 109 | py | Python | Python/calculate_sum.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Python/calculate_sum.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Python/calculate_sum.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | n1 = int(input("Input first number: ")
n2 = int(input("Input second number: ")
sum = n1+n2
print("Sum:",sum)
| 21.8 | 39 | 0.651376 | n1 = int(input("Input first number: ")
n2 = int(input("Input second number: ")
sum = n1+n2
print("Sum:",sum)
| 0 | 0 | 0 |
3b3682ba89f623fb0035dc99b91c3ba3ca5a8b7d | 3,109 | py | Python | manager/app/cluster.py | mrandrey228/Naumachia | 93cacfd44eea0f004c630fb37de2f4529f9699ad | [
"MIT"
] | 79 | 2017-07-10T16:19:53.000Z | 2022-03-19T17:57:40.000Z | manager/app/cluster.py | mrandrey228/Naumachia | 93cacfd44eea0f004c630fb37de2f4529f9699ad | [
"MIT"
] | 33 | 2018-01-11T06:18:02.000Z | 2022-02-26T05:22:48.000Z | manager/app/cluster.py | mrandrey228/Naumachia | 93cacfd44eea0f004c630fb37de2f4529f9699ad | [
"MIT"
] | 11 | 2018-02-10T12:20:55.000Z | 2021-12-04T23:46:41.000Z | """Actions to manage challenge clusters"""
from .commands import vlan_ifname, BrctlCmd, ComposeCmd
from .db import DB
import docker
import logging
import subprocess
logger = logging.getLogger(__name__)
dockerc = docker.from_env()
def cluster_check(user, vpn, cluster):
"""Check that the cluster is up when Redis ... | 38.8625 | 119 | 0.651656 | """Actions to manage challenge clusters"""
from .commands import vlan_ifname, BrctlCmd, ComposeCmd
from .db import DB
import docker
import logging
import subprocess
logger = logging.getLogger(__name__)
dockerc = docker.from_env()
def cluster_bridge_exists(cluster):
return bool(dockerc.networks.list(names=[clust... | 2,200 | 0 | 92 |
eea510976ff8419cf356c7b1deddf1b31f7d8949 | 1,325 | py | Python | examples/weighting2.py | bobscotia/pyetf | d1a2f18e01a2cca1bc4d1ca2baf6fd827e5a9bdf | [
"MIT"
] | null | null | null | examples/weighting2.py | bobscotia/pyetf | d1a2f18e01a2cca1bc4d1ca2baf6fd827e5a9bdf | [
"MIT"
] | null | null | null | examples/weighting2.py | bobscotia/pyetf | d1a2f18e01a2cca1bc4d1ca2baf6fd827e5a9bdf | [
"MIT"
] | 3 | 2019-07-16T07:35:21.000Z | 2020-11-28T02:31:52.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 13 15:08:56 2019
@author: w
"""
import __init__
import ffn
from pyetf.data import eod
from pyetf.alloc import rpw_standard, rpw_ledoit_wolf
from pyetf.alloc import rpw_garch
from pyetf.alloc import rpw_future
from pyetf.alloc import to_weights
from pyetf.figure import plo... | 28.804348 | 99 | 0.714717 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 13 15:08:56 2019
@author: w
"""
import __init__
import ffn
from pyetf.data import eod
from pyetf.alloc import rpw_standard, rpw_ledoit_wolf
from pyetf.alloc import rpw_garch
from pyetf.alloc import rpw_future
from pyetf.alloc import to_weights
from pyetf.figure import plo... | 0 | 0 | 0 |
e816da9f3b8062c1f7fa7d599f89f266fc51ee74 | 2,505 | py | Python | locations/spiders/averitt.py | cmecklenborg/alltheplaces | e62b59fb0071b6e289c4622d368fdb203a28347e | [
"MIT"
] | null | null | null | locations/spiders/averitt.py | cmecklenborg/alltheplaces | e62b59fb0071b6e289c4622d368fdb203a28347e | [
"MIT"
] | null | null | null | locations/spiders/averitt.py | cmecklenborg/alltheplaces | e62b59fb0071b6e289c4622d368fdb203a28347e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
| 34.791667 | 86 | 0.527745 | # -*- coding: utf-8 -*-
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
class AverittSpider(scrapy.Spider):
name = "averitt"
item_attributes = {"brand": "Averitt Express"}
allowed_domains = ["averittexpress.com"]
start_urls = [
"h... | 2,039 | 306 | 23 |
ceeed0c0a6d05fcb7d00977125ff359d081fc895 | 11,375 | py | Python | src/superannotate/lib/app/interface/cli_interface.py | xalgorithm/superannotate-python-sdk | 8f28ff3fdfc7bbae41946c79847ad1f6cf8a9300 | [
"MIT"
] | 26 | 2020-09-25T06:25:06.000Z | 2022-01-30T16:44:07.000Z | src/superannotate/lib/app/interface/cli_interface.py | xalgorithm/superannotate-python-sdk | 8f28ff3fdfc7bbae41946c79847ad1f6cf8a9300 | [
"MIT"
] | 12 | 2020-12-21T19:59:48.000Z | 2022-01-21T10:32:07.000Z | src/superannotate/lib/app/interface/cli_interface.py | xalgorithm/superannotate-python-sdk | 8f28ff3fdfc7bbae41946c79847ad1f6cf8a9300 | [
"MIT"
] | 11 | 2020-09-17T13:39:19.000Z | 2022-03-02T18:12:29.000Z | import json
import os
import sys
import tempfile
from typing import Any
from typing import Optional
import lib.core as constances
from lib import __file__ as lib_path
from lib.app.helpers import split_project_path
from lib.app.input_converters.conversion import import_annotation
from lib.app.interface.base_interface i... | 37.665563 | 131 | 0.644747 | import json
import os
import sys
import tempfile
from typing import Any
from typing import Optional
import lib.core as constances
from lib import __file__ as lib_path
from lib.app.helpers import split_project_path
from lib.app.input_converters.conversion import import_annotation
from lib.app.interface.base_interface i... | 3,088 | 0 | 107 |
bf28921ca074429192c96837a6192f012913e624 | 1,234 | py | Python | tests/test_pandits.py | sotte/pandits | a121bee35c997af49b66739623d1a00754dbb809 | [
"Apache-2.0"
] | null | null | null | tests/test_pandits.py | sotte/pandits | a121bee35c997af49b66739623d1a00754dbb809 | [
"Apache-2.0"
] | null | null | null | tests/test_pandits.py | sotte/pandits | a121bee35c997af49b66739623d1a00754dbb809 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pandits
----------------------------------
Tests for `pandits` module.
"""
##############################################################################
from scipy import stats
from pandits import strategies
from pandits.bandit import Bandit
import pytest
##... | 26.826087 | 78 | 0.541329 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pandits
----------------------------------
Tests for `pandits` module.
"""
##############################################################################
from scipy import stats
from pandits import strategies
from pandits.bandit import Bandit
import pytest
##... | 504 | 0 | 22 |
223c01260126021736f30f857798c368c3e7d9df | 1,224 | py | Python | test/fixtures/python/post_with_urlencoded_data_and_headers.py | csperando/curlconverter | 733f110e5621375701f4424299ccd72e669876f6 | [
"MIT"
] | 536 | 2021-10-06T17:21:25.000Z | 2022-03-31T13:05:48.000Z | test/fixtures/python/post_with_urlencoded_data_and_headers.py | csperando/curlconverter | 733f110e5621375701f4424299ccd72e669876f6 | [
"MIT"
] | 74 | 2021-10-08T13:57:14.000Z | 2022-03-31T06:55:39.000Z | test/fixtures/python/post_with_urlencoded_data_and_headers.py | csperando/curlconverter | 733f110e5621375701f4424299ccd72e669876f6 | [
"MIT"
] | 104 | 2021-10-06T19:36:15.000Z | 2022-03-31T07:34:04.000Z | import requests
headers = {
'Origin': 'http://www.realtor.ca',
# 'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.8',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',
'Content-Type': 'appli... | 31.384615 | 142 | 0.617647 | import requests
headers = {
'Origin': 'http://www.realtor.ca',
# 'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.8',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',
'Content-Type': 'appli... | 0 | 0 | 0 |
63ce13e1ab5d4daae1952d8406103a447ac25b0b | 1,911 | py | Python | Scripts/correlation_heatmap.py | nutellaweera/DS_Hackathon_2021 | 2254d9613880329526926d0c6541a2505729a1e4 | [
"MIT"
] | 1 | 2021-11-19T15:20:51.000Z | 2021-11-19T15:20:51.000Z | Scripts/correlation_heatmap.py | nutellaweera/DS_Hackathon_2021 | 2254d9613880329526926d0c6541a2505729a1e4 | [
"MIT"
] | null | null | null | Scripts/correlation_heatmap.py | nutellaweera/DS_Hackathon_2021 | 2254d9613880329526926d0c6541a2505729a1e4 | [
"MIT"
] | null | null | null | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
gen_correlation() | 46.609756 | 196 | 0.641026 | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
def gen_correlation():
df = pd.read_csv("Datasets/CO2.csv")
filtered = df[(df["country"].isin(["India", "China", "Ethiopia", "United States"])) & (df["year"]>1950) & (df["year"]<2001)].filter(items=["year", "country", "share_global_co2",... | 1,796 | 0 | 23 |
98feb70dd7ca983bc63d2ab09f7122a4bcd37f71 | 332 | py | Python | source/soca/cluster_web_ui/scheduled_tasks/clean_tmp_folders.py | xinlaoda/scale-out-computing-on-aws | 77d03d624adf6823b90746c448259ce9d5098f6e | [
"Apache-2.0"
] | 12 | 2021-03-07T01:38:23.000Z | 2021-12-06T08:01:15.000Z | source/soca/cluster_web_ui/scheduled_tasks/clean_tmp_folders.py | cmaldon/scale-out-computing-on-aws | 69041c8341aa4438ac0c11e550916c0b0585913d | [
"Apache-2.0"
] | 14 | 2021-01-04T09:40:16.000Z | 2021-02-08T06:28:31.000Z | source/soca/cluster_web_ui/scheduled_tasks/clean_tmp_folders.py | cmaldon/scale-out-computing-on-aws | 69041c8341aa4438ac0c11e550916c0b0585913d | [
"Apache-2.0"
] | 3 | 2021-03-07T01:38:24.000Z | 2021-12-06T07:51:47.000Z | import os
import glob
import logging
logger = logging.getLogger("api_log")
| 25.538462 | 55 | 0.650602 | import os
import glob
import logging
logger = logging.getLogger("api_log")
def clean_tmp_folders():
directories = ["tmp/zip_downloads/*", "tmp/ssh/*"]
for directory in directories:
logger.info("Remove files inside " + directory)
files = glob.glob(directory)
for f in files:
o... | 234 | 0 | 23 |
02a9685bfd6b249992ae57c097c8f9acd3210e32 | 15,389 | py | Python | manifest_module.py | skgrush/blackbird | 662c249070338ec665e35efc45f76bc166f4f18a | [
"MIT"
] | null | null | null | manifest_module.py | skgrush/blackbird | 662c249070338ec665e35efc45f76bc166f4f18a | [
"MIT"
] | null | null | null | manifest_module.py | skgrush/blackbird | 662c249070338ec665e35efc45f76bc166f4f18a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import hashlib,string
from numbers import Number
from base64 import standard_b64encode,standard_b64decode
import filehash
try:
import warnings
except ImportError:
warnings = None
try:
import json
except ImportError:
json = None
#######CONSTANTS#######
_PRINTABLE = ''.join(map(ch... | 39.358056 | 142 | 0.504581 | #!/usr/bin/env python
import hashlib,string
from numbers import Number
from base64 import standard_b64encode,standard_b64decode
import filehash
try:
import warnings
except ImportError:
warnings = None
try:
import json
except ImportError:
json = None
#######CONSTANTS#######
_PRINTABLE = ''.join(map(ch... | 10,037 | 1,584 | 307 |
920059de115c4794577ee2aba6d9e107578efa08 | 2,371 | py | Python | src/fetch.py | christosgalano/COVID_19-Reporter | d019aac9b2894a6b53c4781087a54c761e8e1a74 | [
"BSD-2-Clause"
] | null | null | null | src/fetch.py | christosgalano/COVID_19-Reporter | d019aac9b2894a6b53c4781087a54c761e8e1a74 | [
"BSD-2-Clause"
] | null | null | null | src/fetch.py | christosgalano/COVID_19-Reporter | d019aac9b2894a6b53c4781087a54c761e8e1a74 | [
"BSD-2-Clause"
] | null | null | null | import pandas as pd
import requests
def update_data():
"""
Downloads the data and writes them to a new csv file.
:return: None
"""
confirmed_url = "https://data.humdata.org/hxlproxy/api/data-preview.csv?" \
"url=https%3A%2F%2Fraw.githubusercontent.com%2FCSSEGISandData%2FCOVID-... | 43.109091 | 114 | 0.680725 | import pandas as pd
import requests
def update_data():
"""
Downloads the data and writes them to a new csv file.
:return: None
"""
def download_data(url, filename):
req = requests.get(url)
with open(filename, 'wb') as f:
f.write(req.content)
confirmed_url = "https:... | 340 | 0 | 52 |
90b1f571fb170aa577aceaae898b69c1b6f5c9c8 | 394 | py | Python | userv/test_flask.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | userv/test_flask.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | userv/test_flask.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | from flask import Flask, request
import ujson as json
kv = {}
app = Flask(__name__)
@app.route('/kv')
if __name__=="__main__":
app.run(port=8080)
| 16.416667 | 34 | 0.593909 | from flask import Flask, request
import ujson as json
kv = {}
app = Flask(__name__)
@app.route('/kv')
def kv_op():
req = request
op = req.args.get('op')
if op=='get':
k = req.args.get('k')
v = json.dumps(kv.get(k))
return v
elif op=='set':
k = req.args.get('k')
v = req.args.get('v')
kv[k] = v
retur... | 221 | 0 | 22 |
def107bfa8142532d7551f0fa0482a750848d383 | 227 | py | Python | src/movement/no.py | Quanta-Robotics/Robot-Blueberry | 7b7e77e09ac5e9ec5afd947e0db1ecc8773e56da | [
"MIT"
] | 25 | 2021-06-08T07:09:30.000Z | 2021-12-30T06:28:35.000Z | src/movement/no.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 2 | 2021-05-23T12:54:51.000Z | 2021-06-07T17:47:56.000Z | src/movement/no.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 14 | 2021-06-08T13:02:28.000Z | 2021-12-30T20:07:18.000Z | from expression import *
changeDegreeGpio([0],[0],5,0.03)
time.sleep(0.5)
changeDegreeGpio([0],[90],5,0.03)
time.sleep(0.5)
changeDegreeGpio([0],[180],5,0.03)
time.sleep(0.5)
changeDegreeGpio([0],[90],5,0.03)
time.sleep(0.5)
| 18.916667 | 34 | 0.687225 | from expression import *
changeDegreeGpio([0],[0],5,0.03)
time.sleep(0.5)
changeDegreeGpio([0],[90],5,0.03)
time.sleep(0.5)
changeDegreeGpio([0],[180],5,0.03)
time.sleep(0.5)
changeDegreeGpio([0],[90],5,0.03)
time.sleep(0.5)
| 0 | 0 | 0 |
84df10814ec919bf9d579e991527c4008c8095f9 | 2,739 | py | Python | pydigilent/lowlevel/depp.py | greedysquid/pydigilent | 8ec18dcf97602038ee57b35365dfd9df86e5f72e | [
"MIT"
] | 7 | 2015-01-09T21:39:14.000Z | 2020-04-06T07:32:01.000Z | pydigilent/lowlevel/depp.py | greedysquid/pydigilent | 8ec18dcf97602038ee57b35365dfd9df86e5f72e | [
"MIT"
] | 2 | 2018-05-06T09:35:43.000Z | 2018-10-23T14:15:56.000Z | pydigilent/lowlevel/depp.py | greedysquid/pydigilent | 8ec18dcf97602038ee57b35365dfd9df86e5f72e | [
"MIT"
] | 5 | 2015-01-13T21:15:15.000Z | 2019-07-03T13:08:03.000Z | import ctypes
import sys
from pydigilent.lowlevel.common import HIF
if sys.platform.startswith("win"):
_depp = ctypes.cdll.depp
else:
_depp = ctypes.cdll.LoadLibrary("libdepp.so")
_DeppGetVersion = _depp.DeppGetVersion
_DeppGetVersion.argtypes = [ctypes.POINTER(ctypes.c_char * 32)]
_DeppGetVersion.restype = ... | 33.814815 | 127 | 0.786418 | import ctypes
import sys
from pydigilent.lowlevel.common import HIF
if sys.platform.startswith("win"):
_depp = ctypes.cdll.depp
else:
_depp = ctypes.cdll.LoadLibrary("libdepp.so")
_DeppGetVersion = _depp.DeppGetVersion
_DeppGetVersion.argtypes = [ctypes.POINTER(ctypes.c_char * 32)]
_DeppGetVersion.restype = ... | 459 | 0 | 92 |
5c4f4a19b68190fdb7ca217b996c687fff804d14 | 529 | py | Python | RKS.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | RKS.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | RKS.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | for i in range(int(input())):
n,k = [int(j) for j in input().split()]
m,s = set(),set()
for j in range(k):
a,b = [int(p) for p in input().split()]
m.add(a-1)
s.add(b-1)
c = 0
l = []
for j in range(n):
if(j not in m):
for k in range(n):
... | 25.190476 | 47 | 0.344045 | for i in range(int(input())):
n,k = [int(j) for j in input().split()]
m,s = set(),set()
for j in range(k):
a,b = [int(p) for p in input().split()]
m.add(a-1)
s.add(b-1)
c = 0
l = []
for j in range(n):
if(j not in m):
for k in range(n):
... | 0 | 0 | 0 |
87bae4c19ab09a79defaf921e7fb725094fb372f | 4,621 | py | Python | mipqctool/model/qctypes/integer.py | aueb-wim/HBPMedical-QCtool | f2cb7a23a9a1980b2797e37407e2dc5d4c236c5d | [
"Apache-2.0"
] | 8 | 2019-09-24T17:00:54.000Z | 2021-11-13T22:13:30.000Z | mipqctool/model/qctypes/integer.py | aueb-wim/HBPMedical-QCtool | f2cb7a23a9a1980b2797e37407e2dc5d4c236c5d | [
"Apache-2.0"
] | 5 | 2020-12-02T13:51:47.000Z | 2022-01-09T17:30:57.000Z | mipqctool/model/qctypes/integer.py | aueb-wim/DataQualityControlTool | 54d29aee2b54e61e94c5f2483961bf95e6977d90 | [
"Apache-2.0"
] | 2 | 2021-09-08T12:13:01.000Z | 2021-10-06T12:12:37.000Z | # -*- coding: utf-8 -*-
# numerical.py
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import numpy as np
from collections import Counter, OrderedDict
from mipqctool.config import ERROR, LOGGER, DEFAULT_MISS... | 29.812903 | 75 | 0.513958 | # -*- coding: utf-8 -*-
# numerical.py
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import numpy as np
from collections import Counter, OrderedDict
from mipqctool.config import ERROR, LOGGER, DEFAULT_MISS... | 185 | 0 | 23 |
0a4baa78009e47320d2cdb8442c37c6ca6a4becd | 2,677 | py | Python | wagtail/search/tests/test_db_backend.py | melisayu/wagtail | 614ec3fc2a656b25db710b80f9e60f1c8effd7a4 | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/search/tests/test_db_backend.py | fenghualanglang/wagtail | 361c3d5d5448aeccedda7d03530c09b65c13e5e8 | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/search/tests/test_db_backend.py | fenghualanglang/wagtail | 361c3d5d5448aeccedda7d03530c09b65c13e5e8 | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | import unittest
from django.test import TestCase
from django.test.utils import override_settings
from .test_backends import BackendTests
@override_settings(WAGTAILSEARCH_BACKENDS={
'default': {
'BACKEND': 'wagtail.search.backends.database.fallback',
}
})
| 31.127907 | 70 | 0.743369 | import unittest
from django.test import TestCase
from django.test.utils import override_settings
from .test_backends import BackendTests
@override_settings(WAGTAILSEARCH_BACKENDS={
'default': {
'BACKEND': 'wagtail.search.backends.database.fallback',
}
})
class TestDBBackend(BackendTests, TestCase):
... | 892 | 1,488 | 22 |
c5778092e9bf4d92621c8047205eb07168812962 | 634 | py | Python | nmtpytorch/layers/transformers/positionwise_ff.py | tejas1995/nmtpytorch | 0b8a8cda896eae6bb6f07c3cd81e870331a2d20c | [
"MIT"
] | 420 | 2017-12-18T11:48:44.000Z | 2022-01-06T09:04:53.000Z | nmtpytorch/layers/transformers/positionwise_ff.py | tejas1995/nmtpytorch | 0b8a8cda896eae6bb6f07c3cd81e870331a2d20c | [
"MIT"
] | 22 | 2017-12-18T14:31:29.000Z | 2021-07-13T11:37:44.000Z | nmtpytorch/layers/transformers/positionwise_ff.py | tejas1995/nmtpytorch | 0b8a8cda896eae6bb6f07c3cd81e870331a2d20c | [
"MIT"
] | 66 | 2017-12-18T15:31:38.000Z | 2021-08-05T11:15:17.000Z | import torch
from .. import FF
class PositionwiseFF(torch.nn.Module):
"""Positionwise Feed-forward layer.
Arguments:
Input:
Output:
"""
| 20.451613 | 62 | 0.585174 | import torch
from .. import FF
class PositionwiseFF(torch.nn.Module):
"""Positionwise Feed-forward layer.
Arguments:
Input:
Output:
"""
def __init__(self, model_dim, ff_dim, activ='relu'):
super().__init__()
self.model_dim = model_dim
self.ff_dim = ff_dim
s... | 418 | 0 | 54 |
db78c3a98201fa6509e9f6e92802db78e27db31d | 15,490 | py | Python | experiments/volume_potential_3d_derivatives.py | xywei/volumential | 07c6ca8c623acf24fb8deddf93baa1035234db58 | [
"MIT"
] | 6 | 2021-05-21T23:57:15.000Z | 2022-03-07T22:02:50.000Z | experiments/volume_potential_3d_derivatives.py | inducer/volumential | 290a5943d3f47958dcab6736bc2b758525471570 | [
"MIT"
] | 2 | 2021-03-26T15:41:27.000Z | 2021-03-26T15:42:21.000Z | experiments/volume_potential_3d_derivatives.py | inducer/volumential | 290a5943d3f47958dcab6736bc2b758525471570 | [
"MIT"
] | 1 | 2021-05-21T21:23:39.000Z | 2021-05-21T21:23:39.000Z | """ This example evaluates the volume potential and its derivatives
over [-1,1]^3 with the Laplace kernel.
"""
from __future__ import absolute_import, division, print_function
__copyright__ = "Copyright (C) 2019 Xiaoyu Wei"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a ... | 28.579336 | 88 | 0.667205 | """ This example evaluates the volume potential and its derivatives
over [-1,1]^3 with the Laplace kernel.
"""
from __future__ import absolute_import, division, print_function
__copyright__ = "Copyright (C) 2019 Xiaoyu Wei"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a ... | 109 | 0 | 26 |
4b937d1f0bf9e8a7366464db355a9f35b2262660 | 1,866 | py | Python | crawler/BreitbartArticleParser.py | harigov/newsalyzer | 9814033c5c219025fdd696185873ae41a2f64d42 | [
"MIT"
] | 3 | 2016-11-17T22:32:22.000Z | 2019-10-17T10:15:06.000Z | crawler/BreitbartArticleParser.py | harigov/newsalyzer | 9814033c5c219025fdd696185873ae41a2f64d42 | [
"MIT"
] | null | null | null | crawler/BreitbartArticleParser.py | harigov/newsalyzer | 9814033c5c219025fdd696185873ae41a2f64d42 | [
"MIT"
] | null | null | null | import urlparse
import os
from bs4 import BeautifulSoup
import re
from article_parser import ArticleParser
| 35.884615 | 84 | 0.541801 | import urlparse
import os
from bs4 import BeautifulSoup
import re
from article_parser import ArticleParser
class BreitbartArticleParser(ArticleParser):
def _get_title(self):
head = self._soup.find('header', {'class': 'articleheader'})
if head != None:
title = head.find('h1')
... | 1,579 | 23 | 157 |
587bce4d29aa9c8d3e101620df83c3aa7251462b | 14,920 | py | Python | pyvttbl/tests/test_stats_anova_mixed.py | yk/pyvttbl | af66c1aba410ba5386249cd5b95f2ae0ed01d870 | [
"BSD-3-Clause"
] | null | null | null | pyvttbl/tests/test_stats_anova_mixed.py | yk/pyvttbl | af66c1aba410ba5386249cd5b95f2ae0ed01d870 | [
"BSD-3-Clause"
] | null | null | null | pyvttbl/tests/test_stats_anova_mixed.py | yk/pyvttbl | af66c1aba410ba5386249cd5b95f2ae0ed01d870 | [
"BSD-3-Clause"
] | null | null | null |
# Copyright (c) 2011, Roger Lew [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
import unittest
import warnings
import os
import math
from random import shuffle, random
from collections import Counter,OrderedDict
from dictset import DictSet,_rep_generator
from math import isnan, isinf,... | 73.861386 | 151 | 0.309853 |
# Copyright (c) 2011, Roger Lew [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
import unittest
import warnings
import os
import math
from random import shuffle, random
from collections import Counter,OrderedDict
from dictset import DictSet,_rep_generator
from math import isnan, isinf,... | 14,170 | 21 | 84 |
8ab09d133307d6d310bd37ce456797fb532e51c1 | 19,859 | py | Python | model_clone/mixins/clone.py | diesieben07/django-clone | 5d323cf2edd5e3eee70d7b3748910efa814a4b3f | [
"MIT"
] | null | null | null | model_clone/mixins/clone.py | diesieben07/django-clone | 5d323cf2edd5e3eee70d7b3748910efa814a4b3f | [
"MIT"
] | null | null | null | model_clone/mixins/clone.py | diesieben07/django-clone | 5d323cf2edd5e3eee70d7b3748910efa814a4b3f | [
"MIT"
] | null | null | null | from itertools import repeat
from typing import List, Optional, Dict
from conditional import conditional
from django.core.checks import Error
from django.core.exceptions import ValidationError
from django.db import transaction, models, IntegrityError, connections
from django.db.models import SlugField
from django.util... | 38.337838 | 95 | 0.546352 | from itertools import repeat
from typing import List, Optional, Dict
from conditional import conditional
from django.core.checks import Error
from django.core.exceptions import ValidationError
from django.db import transaction, models, IntegrityError, connections
from django.db.models import SlugField
from django.util... | 4,971 | 0 | 106 |
a0ba1136846cbfa160247a71a1f7a7a248ba62d2 | 364 | py | Python | CangJie/Features/glyph.py | bigdata-ustc/CangJie | a3264082fa0432d257b5c4722b14c55f9092a411 | [
"MIT"
] | 2 | 2020-03-04T02:27:29.000Z | 2020-05-22T04:07:24.000Z | CangJie/Features/glyph.py | tswsxk/CangJie | 50c5183eae1d4f10c4cf364262437afcf54427fa | [
"MIT"
] | null | null | null | CangJie/Features/glyph.py | tswsxk/CangJie | 50c5183eae1d4f10c4cf364262437afcf54427fa | [
"MIT"
] | 1 | 2020-01-07T08:34:59.000Z | 2020-01-07T08:34:59.000Z | # coding: utf-8
# 2019/12/30 @ tongshiwei
from PIL import Image, ImageDraw, ImageFont
__all__ = ["character_glyph"]
| 20.222222 | 50 | 0.651099 | # coding: utf-8
# 2019/12/30 @ tongshiwei
from PIL import Image, ImageDraw, ImageFont
__all__ = ["character_glyph"]
def character_glyph(character, size=28):
im = Image.new("1", (size, size), 0)
text = character
dr = ImageDraw.Draw(im)
font = ImageFont.truetype("simsun", size)
dr.text((0, 0), te... | 222 | 0 | 23 |
4c2d24daadad6f5d7d50964cd8f0ed45232e1fec | 976 | py | Python | setup.py | datalad/datalad-fuse | 35df143cde90a7dd1b877fc1f7d1f397ef09b0f4 | [
"MIT"
] | null | null | null | setup.py | datalad/datalad-fuse | 35df143cde90a7dd1b877fc1f7d1f397ef09b0f4 | [
"MIT"
] | 65 | 2021-09-03T14:56:28.000Z | 2022-03-23T18:54:39.000Z | setup.py | datalad/datalad-fuse | 35df143cde90a7dd1b877fc1f7d1f397ef09b0f4 | [
"MIT"
] | 2 | 2021-09-15T16:10:03.000Z | 2021-10-01T18:38:11.000Z | #!/usr/bin/env python
import os.path
import sys
from setuptools import setup
# This is needed for versioneer to be importable when building with PEP 517.
# See <https://github.com/warner/python-versioneer/issues/193> and links
# therein for more information.
sys.path.append(os.path.dirname(__file__))
from _datalad_b... | 30.5 | 76 | 0.740779 | #!/usr/bin/env python
import os.path
import sys
from setuptools import setup
# This is needed for versioneer to be importable when building with PEP 517.
# See <https://github.com/warner/python-versioneer/issues/193> and links
# therein for more information.
sys.path.append(os.path.dirname(__file__))
from _datalad_b... | 0 | 0 | 0 |
db27c9cad391dc1c10451843b95b6888b1d3a56b | 640 | py | Python | 10-use-cases/50-json.py | svalgaard/python-workshop | e69998fdf43c4575612a79d86c1afc7ad63fd185 | [
"MIT"
] | null | null | null | 10-use-cases/50-json.py | svalgaard/python-workshop | e69998fdf43c4575612a79d86c1afc7ad63fd185 | [
"MIT"
] | null | null | null | 10-use-cases/50-json.py | svalgaard/python-workshop | e69998fdf43c4575612a79d86c1afc7ad63fd185 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
#
# Requires requests
#
import json
import requests
import sys
WEATHER_URL = "https://example.net/api.php?degree=C&location="
if __name__ == '__main__':
main()
| 18.285714 | 62 | 0.654688 | #! /usr/bin/env python3
#
# Requires requests
#
import json
import requests
import sys
WEATHER_URL = "https://example.net/api.php?degree=C&location="
def getWeather(city):
url = WEATHER_URL + city
response = requests.get(url)
return response.text
def main():
# This fails as the site does actually ... | 400 | 0 | 46 |
0ceac60e6afd05655db6ae07d5ad0ef28821a98e | 2,717 | py | Python | comz/flucyboxy.py | ZeroHexa/comz | 96ffcb82d6a4690dfd49eaa45dd0ccc4f679f3bb | [
"MIT"
] | 10 | 2019-09-27T13:50:39.000Z | 2022-02-02T05:28:40.000Z | comz/flucyboxy.py | ZeroHexa/comz | 96ffcb82d6a4690dfd49eaa45dd0ccc4f679f3bb | [
"MIT"
] | 1 | 2020-05-06T10:54:12.000Z | 2020-05-10T00:57:21.000Z | comz/flucyboxy.py | Sazxt/comz | 96ffcb82d6a4690dfd49eaa45dd0ccc4f679f3bb | [
"MIT"
] | 11 | 2019-09-05T14:18:53.000Z | 2022-02-02T05:28:41.000Z | # -*- coding: UTF-8 -*-.
# Author Sazxt
# My Team : Black Coder crush
import os as _osx
from py_compile import compile as comp
INC = {
"onc":["cek","syntax"],
"nca":["ok","not"]
}
class bytecode:
"""
Memaparkan Pesan ke dalam bytcode
"""
class cek_ascii:
"""
Cek Systax ascii mungkin saja tidak bisa di enc... | 22.641667 | 72 | 0.587781 | # -*- coding: UTF-8 -*-.
# Author Sazxt
# My Team : Black Coder crush
import os as _osx
from py_compile import compile as comp
INC = {
"onc":["cek","syntax"],
"nca":["ok","not"]
}
class flocbox(object):
def __init__(self,file=None,systax=''):
self.file = file
if systax == INC['onc'][0]:
self.ceks()
if ... | 1,034 | 290 | 186 |
7aaa187b60b264e21a3d7c5b85dfae9c10d83358 | 2,391 | py | Python | financepy/finutils/FinStatistics.py | suhasghorp/FinancePy | 567486785b33768f229a404e860f92fd042034a2 | [
"BSD-3-Clause"
] | null | null | null | financepy/finutils/FinStatistics.py | suhasghorp/FinancePy | 567486785b33768f229a404e860f92fd042034a2 | [
"BSD-3-Clause"
] | 1 | 2020-05-07T14:38:23.000Z | 2020-05-07T14:38:23.000Z | financepy/finutils/FinStatistics.py | suhasghorp/FinancePy | 567486785b33768f229a404e860f92fd042034a2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 07 14:31:53 2019
@author: Dominic O'Kane
"""
from math import sqrt
from numba import njit, float64, int32
##########################################################################
@njit(float64(float64[:]), fastmath=True, cache=True)
def mean... | 23.441176 | 75 | 0.434128 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 07 14:31:53 2019
@author: Dominic O'Kane
"""
from math import sqrt
from numba import njit, float64, int32
##########################################################################
@njit(float64(float64[:]), fastmath=True, cache=True)
def mean... | 0 | 0 | 0 |
56e76180e5ae47f2b90f458d32e2d184d576d301 | 18,742 | py | Python | tests/test_instances.py | pombredanne/pip-shims | 07b6d7dd3fb3b0845893febe1d67125aa35170a7 | [
"0BSD"
] | 12 | 2018-08-09T08:03:09.000Z | 2021-12-24T14:37:17.000Z | tests/test_instances.py | pombredanne/pip-shims | 07b6d7dd3fb3b0845893febe1d67125aa35170a7 | [
"0BSD"
] | 51 | 2018-08-15T02:05:25.000Z | 2022-03-28T07:13:18.000Z | tests/test_instances.py | pombredanne/pip-shims | 07b6d7dd3fb3b0845893febe1d67125aa35170a7 | [
"0BSD"
] | 4 | 2018-10-25T05:43:58.000Z | 2021-10-05T10:05:59.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
import textwrap
from functools import partial
import pytest
from pip_shims import (
FAVORITE_HASH,
USER_CACHE_DIR,
BadCommand,
BestVersionAlreadyInstalled,
CandidatePreferences,
... | 33.230496 | 152 | 0.645769 | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
import textwrap
from functools import partial
import pytest
from pip_shims import (
FAVORITE_HASH,
USER_CACHE_DIR,
BadCommand,
BestVersionAlreadyInstalled,
CandidatePreferences,
... | 15,887 | 0 | 688 |
98e28786a009a3355c6931eda855247aa58f227e | 10,730 | py | Python | evennia/comms/channelhandler.py | mistermikky/evennia | a9ea08fb4c6fb40a77a35351d7176e43d5c1c9ed | [
"BSD-3-Clause"
] | null | null | null | evennia/comms/channelhandler.py | mistermikky/evennia | a9ea08fb4c6fb40a77a35351d7176e43d5c1c9ed | [
"BSD-3-Clause"
] | null | null | null | evennia/comms/channelhandler.py | mistermikky/evennia | a9ea08fb4c6fb40a77a35351d7176e43d5c1c9ed | [
"BSD-3-Clause"
] | null | null | null | """
The channel handler, accessed from this module as CHANNEL_HANDLER is a
singleton that handles the stored set of channels and how they are
represented against the cmdhandler.
If there is a channel named 'newbie', we want to be able to just write
newbie Hello!
For this to work, 'newbie', the name of the channe... | 33.117284 | 116 | 0.611184 | """
The channel handler, accessed from this module as CHANNEL_HANDLER is a
singleton that handles the stored set of channels and how they are
represented against the cmdhandler.
If there is a channel named 'newbie', we want to be able to just write
newbie Hello!
For this to work, 'newbie', the name of the channe... | 148 | 0 | 35 |
297f932b9ebf94ac9edc33aa7c4a7169ec8b4e29 | 10,857 | py | Python | aidants_connect_web/tests/test_views/test_espace_aidant/test_espace_aidant.py | betagouv/Aidants_Connect | 2329d41545912460c4a43b5b41c892189fc1df11 | [
"MIT"
] | 16 | 2019-05-13T08:32:40.000Z | 2022-03-22T13:40:57.000Z | aidants_connect_web/tests/test_views/test_espace_aidant/test_espace_aidant.py | betagouv/Aidants_Connect | 2329d41545912460c4a43b5b41c892189fc1df11 | [
"MIT"
] | 207 | 2019-05-15T16:30:52.000Z | 2022-03-31T15:26:25.000Z | aidants_connect_web/tests/test_views/test_espace_aidant/test_espace_aidant.py | betagouv/Aidants_Connect | 2329d41545912460c4a43b5b41c892189fc1df11 | [
"MIT"
] | 12 | 2019-11-08T13:44:35.000Z | 2022-02-14T15:38:37.000Z | from django.conf import settings
from django.test import tag, TestCase
from django.test.client import Client
from django.urls import resolve, reverse
from django_otp.plugins.otp_totp.models import TOTPDevice
from aidants_connect_web.constants import JournalActionKeywords
from aidants_connect_web.models import Journal... | 39.336957 | 88 | 0.696509 | from django.conf import settings
from django.test import tag, TestCase
from django.test.client import Client
from django.urls import resolve, reverse
from django_otp.plugins.otp_totp.models import TOTPDevice
from aidants_connect_web.constants import JournalActionKeywords
from aidants_connect_web.models import Journal... | 8,954 | 1,112 | 132 |
528ced61f8be0ccfa1c3dc40b83385ef2f4ce559 | 18,101 | py | Python | satt.py | ZLLentz/solid-attenuator | 766ac1df169b3b9459222d979c9ef77a9be2b509 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-04-21T02:55:11.000Z | 2021-04-21T02:55:11.000Z | satt.py | ZLLentz/solid-attenuator | 766ac1df169b3b9459222d979c9ef77a9be2b509 | [
"BSD-3-Clause-LBNL"
] | 27 | 2020-12-07T23:11:42.000Z | 2022-02-02T23:59:03.000Z | satt.py | ZLLentz/solid-attenuator | 766ac1df169b3b9459222d979c9ef77a9be2b509 | [
"BSD-3-Clause-LBNL"
] | 2 | 2020-04-01T05:52:03.000Z | 2020-07-24T16:56:36.000Z | # ====================================================================
# This is old code intended for testing the attenuation algorithm.
# Not for use in beamline operations.
# ====================================================================
import logging
import h5py
import numpy as np
from ophyd import Epics... | 36.86558 | 107 | 0.5624 | # ====================================================================
# This is old code intended for testing the attenuation algorithm.
# Not for use in beamline operations.
# ====================================================================
import logging
import h5py
import numpy as np
from ophyd import Epics... | 1,731 | 1,958 | 77 |
b28f8d52e4e5e428ced72dc1b3b0eaef5796d0a3 | 1,298 | py | Python | sample-config.py | justJay-dev/hire-me | a1c4d16cb8f533ec3f7094860530184cd8f307e1 | [
"MIT"
] | null | null | null | sample-config.py | justJay-dev/hire-me | a1c4d16cb8f533ec3f7094860530184cd8f307e1 | [
"MIT"
] | null | null | null | sample-config.py | justJay-dev/hire-me | a1c4d16cb8f533ec3f7094860530184cd8f307e1 | [
"MIT"
] | null | null | null | import os
import platform
import pygments, markdown
from flask import render_template_string
from flask_flatpages import FlatPages, pygmented_markdown, pygments_style_defs
from app import debug
# setup articles, this is where you can do code highlight templates and stuff.
BLOG_NAME = "blog name"
APP_URL = get_url(... | 22.37931 | 78 | 0.751926 | import os
import platform
import pygments, markdown
from flask import render_template_string
from flask_flatpages import FlatPages, pygmented_markdown, pygments_style_defs
from app import debug
# setup articles, this is where you can do code highlight templates and stuff.
def the_markdown(text):
markdown_text = r... | 285 | 0 | 45 |
852d871fe9895be93ccd71f503a79628a67ad0d3 | 235 | py | Python | mylib/sites/youtube.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | 24 | 2019-12-08T03:56:32.000Z | 2021-10-02T13:26:37.000Z | mylib/sites/youtube.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | 2 | 2020-04-27T14:20:01.000Z | 2020-07-17T06:05:33.000Z | mylib/sites/youtube.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | 10 | 2019-08-06T01:11:28.000Z | 2021-07-19T08:45:11.000Z | #!/usr/bin/env python3
# encoding=utf8
from mylib.easy.text import regex_find
| 21.363636 | 83 | 0.659574 | #!/usr/bin/env python3
# encoding=utf8
from mylib.easy.text import regex_find
def find_url_in_text(text: str) -> list:
p = r'/watch\?v=[-\w]+'
return ['https://www.youtube.com' + e for e in regex_find(p, text, dedup=True)]
| 131 | 0 | 23 |
81cbbb1ebb631548915de847fca57cbbf747198f | 772 | py | Python | iati/iati/settings/test.py | andylolz/IATI-Standard-Website | b781b9fe6b6430f93826e530e9560183bf8fd310 | [
"MIT"
] | null | null | null | iati/iati/settings/test.py | andylolz/IATI-Standard-Website | b781b9fe6b6430f93826e530e9560183bf8fd310 | [
"MIT"
] | null | null | null | iati/iati/settings/test.py | andylolz/IATI-Standard-Website | b781b9fe6b6430f93826e530e9560183bf8fd310 | [
"MIT"
] | null | null | null | """Settings for dev environments (overrides base settings)."""
import os
from .base import * # noqa: F401, F403 # pylint: disable=unused-wildcard-import, wildcard-import
ALLOWED_HOSTS = ['*']
SECRET_KEY = '-sg0o=f6(j3!4u6^86!j@0&l^3clslh-#f@02d2^p_4vy0ma0y'
if 'TRAVIS' in os.environ:
DATABASES = {
'defa... | 26.62069 | 105 | 0.601036 | """Settings for dev environments (overrides base settings)."""
import os
from .base import * # noqa: F401, F403 # pylint: disable=unused-wildcard-import, wildcard-import
ALLOWED_HOSTS = ['*']
SECRET_KEY = '-sg0o=f6(j3!4u6^86!j@0&l^3clslh-#f@02d2^p_4vy0ma0y'
if 'TRAVIS' in os.environ:
DATABASES = {
'defa... | 0 | 0 | 0 |
6272271d63fc40761867eb40d1c284d96dbdc9ca | 8,484 | py | Python | docs/conf.py | GoCarrot/teak-air | be45fd0a09b56b74e6bd8fc8b63e87452ca1521e | [
"Apache-2.0"
] | null | null | null | docs/conf.py | GoCarrot/teak-air | be45fd0a09b56b74e6bd8fc8b63e87452ca1521e | [
"Apache-2.0"
] | 3 | 2019-02-25T23:25:18.000Z | 2020-08-25T18:34:26.000Z | docs/conf.py | GoCarrot/teak-air | be45fd0a09b56b74e6bd8fc8b63e87452ca1521e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Teak for Adobe AIR documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 31 12:44:59 2017.
#
# 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 ... | 30.517986 | 96 | 0.640736 | # -*- coding: utf-8 -*-
#
# Teak for Adobe AIR documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 31 12:44:59 2017.
#
# 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 ... | 2,425 | 0 | 114 |
93c03272908b12049a8e8cf2ab595d084323d312 | 4,810 | py | Python | packages/w3af/w3af/plugins/tests/grep/test_credit_cards.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | tools/w3af/w3af/plugins/tests/grep/test_credit_cards.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | tools/w3af/w3af/plugins/tests/grep/test_credit_cards.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | """
test_credit_cards.py
Copyright 2011 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hop... | 41.111111 | 104 | 0.639085 | """
test_credit_cards.py
Copyright 2011 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hop... | 3,460 | 20 | 239 |
35793cc1b237017364d81de691cd33858220d716 | 8,723 | py | Python | jonescalculus/jonescalculus.py | Kricki/jones-calculus | 9d65348696482318fdb8d6ecbe13b274b2e844c8 | [
"MIT"
] | null | null | null | jonescalculus/jonescalculus.py | Kricki/jones-calculus | 9d65348696482318fdb8d6ecbe13b274b2e844c8 | [
"MIT"
] | 2 | 2017-04-02T16:10:44.000Z | 2017-04-05T21:18:30.000Z | jonescalculus/jonescalculus.py | Kricki/jones-calculus | 9d65348696482318fdb8d6ecbe13b274b2e844c8 | [
"MIT"
] | 2 | 2019-07-22T22:35:30.000Z | 2020-04-14T08:09:39.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
https://en.wikipedia.org/wiki/Jones_calculus
"""
import numpy as np
import math
import cmath
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
__author__ = 'Christian Noelleke (https://github.com/Kricki)'
class JonesMatrix(np.matrix):
"""
... | 34.615079 | 114 | 0.547977 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
https://en.wikipedia.org/wiki/Jones_calculus
"""
import numpy as np
import math
import cmath
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
__author__ = 'Christian Noelleke (https://github.com/Kricki)'
class JonesMatrix(np.matrix):
"""
... | 3,086 | 44 | 283 |
31ec6a6ab2a64e927a10d29182173d40f381af4d | 168 | py | Python | fastapi/app/api/schema/product.py | terib0l/genicons | 43bfa743aa9ee642a5bea7b3e5ad57cec4d0010c | [
"MIT"
] | null | null | null | fastapi/app/api/schema/product.py | terib0l/genicons | 43bfa743aa9ee642a5bea7b3e5ad57cec4d0010c | [
"MIT"
] | null | null | null | fastapi/app/api/schema/product.py | terib0l/genicons | 43bfa743aa9ee642a5bea7b3e5ad57cec4d0010c | [
"MIT"
] | null | null | null | from pydantic import BaseModel
| 15.272727 | 30 | 0.690476 | from pydantic import BaseModel
class Product(BaseModel):
id: int
rounded_square_icon: bytes
circle_icon: bytes
class Config:
orm_mode = True
| 0 | 113 | 23 |
0b668626d05c2d41a5168aeadb87f52001fed3ac | 1,338 | py | Python | setup.py | hubpav/enmon | b0921876ec9945e9b4ecc4f802445d93457efdad | [
"MIT"
] | null | null | null | setup.py | hubpav/enmon | b0921876ec9945e9b4ecc4f802445d93457efdad | [
"MIT"
] | null | null | null | setup.py | hubpav/enmon | b0921876ec9945e9b4ecc4f802445d93457efdad | [
"MIT"
] | null | null | null | import os
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
info = {}
with open(os.path.join(here, 'enmon', '__info__.py'), 'r') as f:
exec(f.read(), info)
with open('requirements.txt', 'r') as f:
requirements = f.read()
with open('README.md', 'r') as f:
readme = f.read()
setuptools.s... | 28.468085 | 103 | 0.620329 | import os
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
info = {}
with open(os.path.join(here, 'enmon', '__info__.py'), 'r') as f:
exec(f.read(), info)
with open('requirements.txt', 'r') as f:
requirements = f.read()
with open('README.md', 'r') as f:
readme = f.read()
setuptools.s... | 0 | 0 | 0 |
50ec1dc4b82c3c17404274c355a73058e03bb654 | 6,186 | py | Python | tock/employees/tests/test_views.py | mikiec84/tock | 15318a45b2b144360e4d7e15db655467a45c2ab9 | [
"CC0-1.0"
] | null | null | null | tock/employees/tests/test_views.py | mikiec84/tock | 15318a45b2b144360e4d7e15db655467a45c2ab9 | [
"CC0-1.0"
] | 4 | 2021-02-02T22:57:57.000Z | 2022-02-10T23:19:15.000Z | tock/employees/tests/test_views.py | mikiec84/tock | 15318a45b2b144360e4d7e15db655467a45c2ab9 | [
"CC0-1.0"
] | null | null | null | import datetime
from django.urls import reverse
from django_webtest import WebTest
from employees.views import parse_date
from employees.models import UserData
from test_common import ProtectedViewTestCase
| 37.26506 | 111 | 0.594407 | import datetime
from django.urls import reverse
from django_webtest import WebTest
from employees.views import parse_date
from employees.models import UserData
from test_common import ProtectedViewTestCase
class UserViewTests(ProtectedViewTestCase, WebTest):
csrf_checks = False
def test_access_to_employ... | 956 | 4,996 | 23 |
78f06ae26d94d23ab2312af6324972b28f7d4ea5 | 2,459 | py | Python | docs/conf.py | billshi-NOAA/kluster | d01da2427b28717a197091bb4dd7aee87b5bd49d | [
"CC0-1.0"
] | null | null | null | docs/conf.py | billshi-NOAA/kluster | d01da2427b28717a197091bb4dd7aee87b5bd49d | [
"CC0-1.0"
] | null | null | null | docs/conf.py | billshi-NOAA/kluster | d01da2427b28717a197091bb4dd7aee87b5bd49d | [
"CC0-1.0"
] | null | null | null | import os
p, f = os.path.split(__file__)
root_p = os.path.normpath(p)
from HSTB.kluster import __version__ as kluster_version
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc... | 34.633803 | 122 | 0.670191 | import os
p, f = os.path.split(__file__)
root_p = os.path.normpath(p)
from HSTB.kluster import __version__ as kluster_version
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc... | 0 | 0 | 0 |
c4140c6ccc4d1616b2365c32481ad28edde1c73a | 1,212 | py | Python | app/api/valid.py | mimipeshy/politicov1 | 1d63e1289b5b620fd675d3ef319726d15c6f9234 | [
"MIT"
] | 1 | 2020-05-29T23:04:07.000Z | 2020-05-29T23:04:07.000Z | app/api/valid.py | mimipeshy/politicov1 | 1d63e1289b5b620fd675d3ef319726d15c6f9234 | [
"MIT"
] | null | null | null | app/api/valid.py | mimipeshy/politicov1 | 1d63e1289b5b620fd675d3ef319726d15c6f9234 | [
"MIT"
] | 1 | 2019-02-10T09:05:56.000Z | 2019-02-10T09:05:56.000Z | from flask import request
from app.api.responses import Responses
from app.api.routes.models.office import offices
| 39.096774 | 86 | 0.664191 | from flask import request
from app.api.responses import Responses
from app.api.routes.models.office import offices
def validate_update_all():
data = request.get_json()
required_fields = ['name']
if not data:
return Responses.bad_request("Empty inputs in Json"), 400
if 'name' not in data:
... | 1,072 | 0 | 23 |
9e5e2e28c90b3bb420e68ef7f6c1a8989c8a9bba | 968 | py | Python | setup.py | phausman/fce-ipmi | 140c3d1484b0d427aaaaf4a6915260401bd29b2d | [
"MIT"
] | null | null | null | setup.py | phausman/fce-ipmi | 140c3d1484b0d427aaaaf4a6915260401bd29b2d | [
"MIT"
] | null | null | null | setup.py | phausman/fce-ipmi | 140c3d1484b0d427aaaaf4a6915260401bd29b2d | [
"MIT"
] | null | null | null | import setuptools
from src.version import VERSION
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="fce-ipmi",
version=VERSION,
author="Przemyslaw Hausman",
description="Wrapper for various IPMI-related utilities",
license="MIT",
long_description=long... | 28.470588 | 74 | 0.623967 | import setuptools
from src.version import VERSION
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="fce-ipmi",
version=VERSION,
author="Przemyslaw Hausman",
description="Wrapper for various IPMI-related utilities",
license="MIT",
long_description=long... | 0 | 0 | 0 |
2ab8c6b9642e2dbe9fad76211bfcc7b095d4acd9 | 675 | pyw | Python | HelloWorld/Python01/Core Python Applications Programming 3rd/ch05/animalPmw.pyw | grtlinux/KieaPython | 5539a9e3625864aa20624b8d684dbe5828dac3d1 | [
"Apache-2.0"
] | 1 | 2022-01-29T08:32:11.000Z | 2022-01-29T08:32:11.000Z | HelloWorld/Python01/Core Python Applications Programming 3rd/ch05/animalPmw.pyw | grtlinux/KieaPython | 5539a9e3625864aa20624b8d684dbe5828dac3d1 | [
"Apache-2.0"
] | null | null | null | HelloWorld/Python01/Core Python Applications Programming 3rd/ch05/animalPmw.pyw | grtlinux/KieaPython | 5539a9e3625864aa20624b8d684dbe5828dac3d1 | [
"Apache-2.0"
] | 1 | 2022-01-29T08:32:12.000Z | 2022-01-29T08:32:12.000Z | #!/usr/bin/env python
from Tkinter import Button, END, Label, W
from Pmw import initialise, ComboBox, Counter
top = initialise()
lb = Label(top,
text='Animals (in pairs; min: pair, max: dozen)')
lb.pack()
ct = Counter(top, labelpos=W, label_text='Number:',
datatype='integer', entryfield_value=2,... | 24.107143 | 54 | 0.632593 | #!/usr/bin/env python
from Tkinter import Button, END, Label, W
from Pmw import initialise, ComboBox, Counter
top = initialise()
lb = Label(top,
text='Animals (in pairs; min: pair, max: dozen)')
lb.pack()
ct = Counter(top, labelpos=W, label_text='Number:',
datatype='integer', entryfield_value=2,... | 0 | 0 | 0 |
c9c7690a14417fde2470523dfd891e4547ffb7e5 | 1,634 | py | Python | bike/admin.py | kinsney/sport | 190482ef46eea1f7b1604b1b95fd2f0ee6b3880a | [
"MIT"
] | null | null | null | bike/admin.py | kinsney/sport | 190482ef46eea1f7b1604b1b95fd2f0ee6b3880a | [
"MIT"
] | null | null | null | bike/admin.py | kinsney/sport | 190482ef46eea1f7b1604b1b95fd2f0ee6b3880a | [
"MIT"
] | null | null | null | from django.contrib import admin
from bike.models import Version,Brand,Category,Bike,Address
from message.models import Message
# Register your models here.
#单车通过验证代码
bike_verify.short_description = "单车通过验证"
#单车未通过验证
bike_fail.short_description = "单车未通过验证"
@admin.register(Address)
@admin.register(Bike)
@admin.register... | 26.786885 | 59 | 0.654835 | from django.contrib import admin
from bike.models import Version,Brand,Category,Bike,Address
from message.models import Message
# Register your models here.
#单车通过验证代码
def bike_verify(modeladmin, request, queryset):
queryset.update(status='renting')
for bike in queryset:
try:
content = "{"+"}... | 661 | 413 | 178 |
647821d1f90e3b87afca688723b5d22c88caf22d | 32,103 | py | Python | plugin.video.kminus/urlfetch.py | jijarf/ahihi | ae7cd247126e1f014bc17a8abb0a16bc82ad6b4e | [
"Apache-2.0"
] | null | null | null | plugin.video.kminus/urlfetch.py | jijarf/ahihi | ae7cd247126e1f014bc17a8abb0a16bc82ad6b4e | [
"Apache-2.0"
] | null | null | null | plugin.video.kminus/urlfetch.py | jijarf/ahihi | ae7cd247126e1f014bc17a8abb0a16bc82ad6b4e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
urlfetch
~~~~~~~~~~
An easy to use HTTP client based on httplib.
:copyright: (c) 2011-2013 by Yue Du.
:license: BSD 2-clause License, see LICENSE for more details.
'''
__version__ = '0.5.3.1'
__author__ = 'Yue Du <ifduyue@gmail.com>'
__url__ = 'https://github.com/ifd... | 32.825153 | 123 | 0.55487 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
urlfetch
~~~~~~~~~~
An easy to use HTTP client based on httplib.
:copyright: (c) 2011-2013 by Yue Du.
:license: BSD 2-clause License, see LICENSE for more details.
'''
__version__ = '0.5.3.1'
__author__ = 'Yue Du <ifduyue@gmail.com>'
__url__ = 'https://github.com/ifd... | 2,169 | 19 | 425 |
35a04d7ef6ea15c18e44fa8cccd5440f8adbc91b | 553 | py | Python | keyboards/inline/lists_markups.py | Ilya-koala/VSL_Bot | 03399a49a2bc8baa97cc5d6f84a7406dbaafd262 | [
"MIT"
] | null | null | null | keyboards/inline/lists_markups.py | Ilya-koala/VSL_Bot | 03399a49a2bc8baa97cc5d6f84a7406dbaafd262 | [
"MIT"
] | 1 | 2021-06-25T18:53:54.000Z | 2021-06-30T16:15:54.000Z | keyboards/inline/lists_markups.py | Ilya-koala/VSL_Bot | 03399a49a2bc8baa97cc5d6f84a7406dbaafd262 | [
"MIT"
] | 3 | 2021-04-18T09:39:59.000Z | 2021-05-18T16:47:19.000Z | from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
start_page_keyboard = InlineKeyboardMarkup(row_width=2)
new_list_but = InlineKeyboardButton(
text='Новый список', callback_data='new_list')
user_lists_but = InlineKeyboardButton(
text='Мои списки', callback_data='user_lists')
start_page_key... | 32.529412 | 68 | 0.826401 | from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
start_page_keyboard = InlineKeyboardMarkup(row_width=2)
new_list_but = InlineKeyboardButton(
text='Новый список', callback_data='new_list')
user_lists_but = InlineKeyboardButton(
text='Мои списки', callback_data='user_lists')
start_page_key... | 0 | 0 | 0 |
6e2d10a6e96a9460f3f00c8a58cbe1812b4977f8 | 853 | py | Python | body_mass_calculator/forms.py | AlexanderUstinovv/body_mass_calculator | 0cefb6e0d0785d9045959493b4553390a6c58dc7 | [
"BSD-3-Clause"
] | null | null | null | body_mass_calculator/forms.py | AlexanderUstinovv/body_mass_calculator | 0cefb6e0d0785d9045959493b4553390a6c58dc7 | [
"BSD-3-Clause"
] | null | null | null | body_mass_calculator/forms.py | AlexanderUstinovv/body_mass_calculator | 0cefb6e0d0785d9045959493b4553390a6c58dc7 | [
"BSD-3-Clause"
] | null | null | null | from django.forms import ModelForm
from .models import MainPersonData
| 32.807692 | 74 | 0.594373 | from django.forms import ModelForm
from .models import MainPersonData
class MainDataForm(ModelForm):
class Meta:
model = MainPersonData
fields = ['name', 'age', 'sex', 'height', 'weight', 'smoking']
def clean(self):
cleaned_data = super().clean()
name = cleaned_data.get('name... | 704 | 154 | 23 |
157d984157fc546d6714399c4867ca03729b0eee | 4,400 | py | Python | functions/rplot.py | adisen99/srfp | 836059c942b396a5e70d36a0d544d0fa4a36272d | [
"MIT"
] | null | null | null | functions/rplot.py | adisen99/srfp | 836059c942b396a5e70d36a0d544d0fa4a36272d | [
"MIT"
] | null | null | null | functions/rplot.py | adisen99/srfp | 836059c942b396a5e70d36a0d544d0fa4a36272d | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import xarray as xr
from scipy import stats
def plot(data, x, y, type=None, **kwargs):
"""
Function to plot the corr coeff plot
--------------------------
input 3 values data, x and y in this order
and use... | 36.666667 | 133 | 0.5525 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import xarray as xr
from scipy import stats
def plot(data, x, y, type=None, **kwargs):
"""
Function to plot the corr coeff plot
--------------------------
input 3 values data, x and y in this order
and use... | 0 | 0 | 0 |
cb3b313c34a8d0b0462053f665ba837cffaf67f2 | 393 | py | Python | board/tests/factories/topics.py | malrefai/board-project | f230c20c41077dab1ef424e5a27868ad77470fb4 | [
"MIT"
] | null | null | null | board/tests/factories/topics.py | malrefai/board-project | f230c20c41077dab1ef424e5a27868ad77470fb4 | [
"MIT"
] | 6 | 2018-10-24T14:10:55.000Z | 2018-10-28T08:12:58.000Z | board/tests/factories/topics.py | malrefai/board-project | f230c20c41077dab1ef424e5a27868ad77470fb4 | [
"MIT"
] | 1 | 2018-10-25T11:30:18.000Z | 2018-10-25T11:30:18.000Z | from factory import DjangoModelFactory, Faker, SubFactory
from .boards import BoardFactory
from .users import UserFactory
from ...models import Topic
class TopicFactory(DjangoModelFactory):
"""
Defines topic factory
"""
subject = Faker("sentence", nb_words=3)
board = SubFactory(BoardFactory)
... | 21.833333 | 57 | 0.717557 | from factory import DjangoModelFactory, Faker, SubFactory
from .boards import BoardFactory
from .users import UserFactory
from ...models import Topic
class TopicFactory(DjangoModelFactory):
"""
Defines topic factory
"""
subject = Faker("sentence", nb_words=3)
board = SubFactory(BoardFactory)
... | 0 | 12 | 27 |
dce3caac814b94fb6850fecf646ad36aed24fbb0 | 5,460 | py | Python | train_batch_deform.py | ziashen/deblocking_pytorch | b156c5cbd26f0833089e5f1aee6e6d046579b56d | [
"MIT"
] | 10 | 2018-01-19T08:56:02.000Z | 2021-05-13T08:57:49.000Z | train_batch_deform.py | ziashen/deblocking_pytorch | b156c5cbd26f0833089e5f1aee6e6d046579b56d | [
"MIT"
] | 1 | 2019-10-10T11:38:59.000Z | 2019-10-10T11:38:59.000Z | train_batch_deform.py | ziashen/deblocking_pytorch | b156c5cbd26f0833089e5f1aee6e6d046579b56d | [
"MIT"
] | 1 | 2018-04-03T00:44:23.000Z | 2018-04-03T00:44:23.000Z | from __future__ import print_function
from math import log10
import numpy
import h5py
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from model import NetARCNN_deform
import argparse
from datetime import datetime
logfile =... | 36.4 | 196 | 0.678205 | from __future__ import print_function
from math import log10
import numpy
import h5py
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from model import NetARCNN_deform
import argparse
from datetime import datetime
logfile =... | 2,842 | 0 | 69 |
c41a9eee3d7b9959b9844dde9bd583712843448f | 1,925 | py | Python | ab_tokenizers.py | supremestdoggo/AnswerBot | ec1d959479fd8727187a52dc5eedc2fce1fbcd9c | [
"MIT"
] | null | null | null | ab_tokenizers.py | supremestdoggo/AnswerBot | ec1d959479fd8727187a52dc5eedc2fce1fbcd9c | [
"MIT"
] | null | null | null | ab_tokenizers.py | supremestdoggo/AnswerBot | ec1d959479fd8727187a52dc5eedc2fce1fbcd9c | [
"MIT"
] | null | null | null | from tokenizers import Tokenizer
from tokenizers.models import BPE
from tokenizers.pre_tokenizers import *
from tokenizers.trainers import BpeTrainer
import tokenizers
# Required functions
def dict_sort(dictionary: dict) -> list:
"""Takes in a dictionary with integer values and outputs a list of the keys sorted ... | 43.75 | 137 | 0.69974 | from tokenizers import Tokenizer
from tokenizers.models import BPE
from tokenizers.pre_tokenizers import *
from tokenizers.trainers import BpeTrainer
import tokenizers
# Required functions
def convert_to_base(number: int, base: int, tokens: list) -> list:
if number == 0:
return []
return [tokens[numbe... | 1,142 | 0 | 164 |
99975c770f2111135fd764df85659ccc0169ee32 | 226 | py | Python | tools/bin/pythonSrc/pychecker-0.8.18/test_input/import98.py | YangHao666666/hawq | 10cff8350f1ba806c6fec64eb67e0e6f6f24786c | [
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 450 | 2015-09-05T09:12:51.000Z | 2018-08-30T01:45:36.000Z | tools/bin/pythonSrc/pychecker-0.8.18/test_input/import98.py | YangHao666666/hawq | 10cff8350f1ba806c6fec64eb67e0e6f6f24786c | [
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 1,274 | 2015-09-22T20:06:16.000Z | 2018-08-31T22:14:00.000Z | tools/bin/pythonSrc/pychecker-0.8.18/test_input/import98.py | YangHao666666/hawq | 10cff8350f1ba806c6fec64eb67e0e6f6f24786c | [
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 278 | 2015-09-21T19:15:06.000Z | 2018-08-31T00:36:51.000Z | __doc__ = 'Auxiliary file for test98.py'
class BaseGood:
'Nice base init'
class BaseBad:
'Error should print as coming from this file'
| 18.833333 | 49 | 0.654867 | __doc__ = 'Auxiliary file for test98.py'
class BaseGood:
'Nice base init'
def __init__(self):
return
class BaseBad:
'Error should print as coming from this file'
def __init__(self):
return 42
| 29 | 0 | 52 |
e445bbd091149b9c272d954ed01204e9c61f2341 | 9,838 | py | Python | api/test.py | stephensanwo/Filed-Audio-Server | eaa0e46eaef79f9c7c385a092b633f5f26c30cf1 | [
"MIT"
] | null | null | null | api/test.py | stephensanwo/Filed-Audio-Server | eaa0e46eaef79f9c7c385a092b633f5f26c30cf1 | [
"MIT"
] | null | null | null | api/test.py | stephensanwo/Filed-Audio-Server | eaa0e46eaef79f9c7c385a092b633f5f26c30cf1 | [
"MIT"
] | null | null | null | import json
import unittest
from flask import Flask
from api import api
from database.AudioSchema import Song, Podcast, Audiobook
# Define test data
headers = dict(api_key="2c5a16d9-a951-4f62-ac68-e4df97e7b15d",
api_client="jane.doe@email.com"
)
# Change ID on run
podcastTestID = "6046f... | 33.576792 | 171 | 0.629091 | import json
import unittest
from flask import Flask
from api import api
from database.AudioSchema import Song, Podcast, Audiobook
# Define test data
headers = dict(api_key="2c5a16d9-a951-4f62-ac68-e4df97e7b15d",
api_client="jane.doe@email.com"
)
# Change ID on run
podcastTestID = "6046f... | 7,085 | 1,601 | 23 |
11b5a355475739bdb7922d9a8a9f15e86ff5628c | 7,309 | py | Python | CheckOpenSslVulnerable.py | galletitaoreo/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | 5 | 2019-08-07T08:59:53.000Z | 2021-05-14T19:35:57.000Z | CheckOpenSslVulnerable.py | Harusenpai/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | null | null | null | CheckOpenSslVulnerable.py | Harusenpai/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | 2 | 2021-03-31T21:20:19.000Z | 2021-08-28T04:21:12.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#class for check open ssl Heartbleed vulnerability
import socket
import urllib2
import httplib
import HTMLParser
import base64
import sys
import time
import select
import struct
import shodan
server_vulnerable =[]
hello = h2bin('''
16 03 02 00 dc 01 00 00 d8 03 02 53... | 34.154206 | 124 | 0.499795 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#class for check open ssl Heartbleed vulnerability
import socket
import urllib2
import httplib
import HTMLParser
import base64
import sys
import time
import select
import struct
import shodan
server_vulnerable =[]
def h2bin(x):
return x.replace(' ', '').replace('\... | 5,947 | 8 | 265 |
34665aadcd798a3633786f4d55dceecabc874540 | 8,757 | py | Python | src/button.py | ReedyHarbour/15112-Term-Project | 2e358d498db299e8d6f88c0438fbfe18836f0d7f | [
"Apache-2.0"
] | null | null | null | src/button.py | ReedyHarbour/15112-Term-Project | 2e358d498db299e8d6f88c0438fbfe18836f0d7f | [
"Apache-2.0"
] | null | null | null | src/button.py | ReedyHarbour/15112-Term-Project | 2e358d498db299e8d6f88c0438fbfe18836f0d7f | [
"Apache-2.0"
] | null | null | null | from direct.showbase.ShowBase import ShowBase
from panda3d.core import CollisionTraverser, CollisionNode
from panda3d.core import CollisionHandlerQueue, CollisionRay
from panda3d.core import TextNode
from panda3d.core import LPoint3, LVector3, BitMask32
from direct.actor.Actor import Actor
from direct.gui.Onscree... | 70.620968 | 117 | 0.523239 | from direct.showbase.ShowBase import ShowBase
from panda3d.core import CollisionTraverser, CollisionNode
from panda3d.core import CollisionHandlerQueue, CollisionRay
from panda3d.core import TextNode
from panda3d.core import LPoint3, LVector3, BitMask32
from direct.actor.Actor import Actor
from direct.gui.Onscree... | 7,739 | 16 | 140 |
b0862fbb3ac0f49ee4f3887201b2ce698e6241b0 | 236 | py | Python | connect_four/evaluation/__init__.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/__init__.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/__init__.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | from connect_four.evaluation.evaluator import ProofStatus
from connect_four.evaluation.evaluator import Evaluator
from connect_four.evaluation.evaluator import NodeType
from connect_four.evaluation.victor.victor_evaluator import Victor
| 47.2 | 66 | 0.894068 | from connect_four.evaluation.evaluator import ProofStatus
from connect_four.evaluation.evaluator import Evaluator
from connect_four.evaluation.evaluator import NodeType
from connect_four.evaluation.victor.victor_evaluator import Victor
| 0 | 0 | 0 |
bb9cac3bb7a680903034962261a51b2bdcf59edb | 1,216 | py | Python | tests/test_compose.py | edwardcjohnson/litmus | c8163076610d9150bce44c37ee69f1b533f77e69 | [
"MIT"
] | 1 | 2021-07-19T20:06:42.000Z | 2021-07-19T20:06:42.000Z | tests/test_compose.py | edwardcjohnson/litmus | c8163076610d9150bce44c37ee69f1b533f77e69 | [
"MIT"
] | 1 | 2021-07-11T02:19:28.000Z | 2021-07-11T02:19:28.000Z | tests/test_compose.py | edwardcjohnson/litmus | c8163076610d9150bce44c37ee69f1b533f77e69 | [
"MIT"
] | null | null | null | import pytest
import filecmp
import litmus.compose
import os
import pathlib
this_path = pathlib.Path(__file__).parent.resolve() | 32 | 74 | 0.615132 | import pytest
import filecmp
import litmus.compose
import os
import pathlib
this_path = pathlib.Path(__file__).parent.resolve()
class TestClassComposeTestModuleSkeleton():
@pytest.mark.parametrize(
"params,expected",
[
[
{
'module_file': "example_mod... | 764 | 302 | 23 |
467edac35ee660415b5a35d3569aec6a4bb9d1d1 | 1,600 | py | Python | qiskit/backends/basejob.py | Hosseinyeganeh/qiskit-core | c07c7435ce60c180b0826b70b55d454eaaa7bc35 | [
"Apache-2.0"
] | null | null | null | qiskit/backends/basejob.py | Hosseinyeganeh/qiskit-core | c07c7435ce60c180b0826b70b55d454eaaa7bc35 | [
"Apache-2.0"
] | null | null | null | qiskit/backends/basejob.py | Hosseinyeganeh/qiskit-core | c07c7435ce60c180b0826b70b55d454eaaa7bc35 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""This module implements the abstract base class for backend jobs
When creating a new backend module it is also necessary t... | 22.535211 | 77 | 0.63125 | # -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""This module implements the abstract base class for backend jobs
When creating a new backend module it is also necessary t... | 0 | 0 | 0 |
0c63b0edbf8ccad4d19fcaf2f4c35b7f96d7a639 | 1,789 | py | Python | src/nodes/corenodes/input/string_node.py | yonMaor/GimelStudio | 7ed7db429e61e0413791ad261583c7018f888953 | [
"Apache-2.0"
] | null | null | null | src/nodes/corenodes/input/string_node.py | yonMaor/GimelStudio | 7ed7db429e61e0413791ad261583c7018f888953 | [
"Apache-2.0"
] | null | null | null | src/nodes/corenodes/input/string_node.py | yonMaor/GimelStudio | 7ed7db429e61e0413791ad261583c7018f888953 | [
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------------------------
# Gimel Studio Copyright 2019-2022 by the Gimel Studio project contributors
#
# 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... | 30.844828 | 85 | 0.577418 | # ----------------------------------------------------------------------------
# Gimel Studio Copyright 2019-2022 by the Gimel Studio project contributors
#
# 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... | 756 | 154 | 23 |
2e29bf7042a771e8fd7cd807ba0da606f1083e06 | 215 | py | Python | crosspredict/nodes/__init__.py | ya-ds/crosspredict | d0902e7e5776db2e29c6f92aac0c61927502887d | [
"MIT"
] | 19 | 2020-04-05T18:23:44.000Z | 2022-03-21T09:13:47.000Z | crosspredict/nodes/__init__.py | crosspredict/crosspredict | b64d6fe5d985b90c6845508b912482011b9b37cf | [
"MIT"
] | null | null | null | crosspredict/nodes/__init__.py | crosspredict/crosspredict | b64d6fe5d985b90c6845508b912482011b9b37cf | [
"MIT"
] | 1 | 2021-08-03T06:36:02.000Z | 2021-08-03T06:36:02.000Z |
from ._nodes import model_fit, forward_selection, make_report, hyperopt_fit, model_single_fit, onefactor
__all__ = ['model_fit', 'forward_selection', 'make_report', 'hyperopt_fit', 'model_single_fit', 'onefactor'] | 53.75 | 108 | 0.795349 |
from ._nodes import model_fit, forward_selection, make_report, hyperopt_fit, model_single_fit, onefactor
__all__ = ['model_fit', 'forward_selection', 'make_report', 'hyperopt_fit', 'model_single_fit', 'onefactor'] | 0 | 0 | 0 |
e774db788ee07f39a6b88f3fbe157f984957225b | 1,388 | py | Python | pubgate/utils/startapp.py | traumschule/pubgate | 95f994d35ef928df904d2ee55aaa5e73672c2e04 | [
"BSD-3-Clause"
] | 79 | 2018-06-23T23:20:20.000Z | 2022-03-22T18:33:37.000Z | pubgate/utils/startapp.py | traumschule/pubgate | 95f994d35ef928df904d2ee55aaa5e73672c2e04 | [
"BSD-3-Clause"
] | 25 | 2018-11-03T10:14:06.000Z | 2021-01-20T22:33:14.000Z | pubgate/utils/startapp.py | traumschule/pubgate | 95f994d35ef928df904d2ee55aaa5e73672c2e04 | [
"BSD-3-Clause"
] | 5 | 2018-11-03T10:11:36.000Z | 2020-03-19T14:34:05.000Z | import json
from sanic.log import logger
from pubgate.db import User
from pubgate.utils import random_object_id
| 28.326531 | 63 | 0.645533 | import json
from sanic.log import logger
from pubgate.db import User
from pubgate.utils import random_object_id
def register_extensions(app):
extensions = app.config.EXTENSIONS
if app.config.get('UI_APP'):
ui_app = __import__(app.config.UI_APP)
app.ui_app_index = getattr(ui_app, 'index_view... | 1,202 | 0 | 69 |
13690d01007c12e76226d64c732b810f7d4e1aa0 | 13,094 | py | Python | imagen/boundingregion.py | aopy/imagen | 8e69d02bf43a8980f1c1fc19f6aa0fbf23db49fe | [
"BSD-3-Clause"
] | null | null | null | imagen/boundingregion.py | aopy/imagen | 8e69d02bf43a8980f1c1fc19f6aa0fbf23db49fe | [
"BSD-3-Clause"
] | null | null | null | imagen/boundingregion.py | aopy/imagen | 8e69d02bf43a8980f1c1fc19f6aa0fbf23db49fe | [
"BSD-3-Clause"
] | 2 | 2021-02-16T09:39:04.000Z | 2021-04-15T12:24:14.000Z | """
Bounding regions and bounding boxes.
"""
__version__='$Revision$'
from numpy import inf
### JABALERT: The aarect information should probably be rewritten in
### matrix notation, not list notation, so that it can be scaled,
### translated, etc. easily.
###
import param
from param.parameterized import get_occupied... | 31.250597 | 186 | 0.614404 | """
Bounding regions and bounding boxes.
"""
__version__='$Revision$'
from numpy import inf
### JABALERT: The aarect information should probably be rewritten in
### matrix notation, not list notation, so that it can be scaled,
### translated, etc. easily.
###
import param
from param.parameterized import get_occupied... | 2,803 | 11 | 869 |
177eb35e07274d88b2f806f2b433da19de4b9c4c | 139 | py | Python | src/stdio/hello.py | mincong-h/Python-Exercises | ef210371b6c6e28eec922a800e2164cdf30b496b | [
"Apache-2.0"
] | 1 | 2018-02-25T21:37:39.000Z | 2018-02-25T21:37:39.000Z | src/stdio/hello.py | mincong-h/Python-Exercises | ef210371b6c6e28eec922a800e2164cdf30b496b | [
"Apache-2.0"
] | 3 | 2017-05-02T16:10:50.000Z | 2021-05-17T19:37:53.000Z | src/stdio/hello.py | mincong-h/Python-Exercises | ef210371b6c6e28eec922a800e2164cdf30b496b | [
"Apache-2.0"
] | 1 | 2015-12-03T17:51:19.000Z | 2015-12-03T17:51:19.000Z | #!/usr/bin/env python3
import sys
if __name__ == "__main__":
main()
| 11.583333 | 27 | 0.582734 | #!/usr/bin/env python3
import sys
def main():
name = sys.argv[1]
print(f"Hello, {name}")
if __name__ == "__main__":
main()
| 41 | 0 | 23 |
37e3c453b123de4943ad40d0ef44a83386f3f8bf | 23,356 | py | Python | pybind/slxos/v16r_1_00b/openflow_state/resources/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/openflow_state/resources/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/openflow_state/resources/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 71.644172 | 838 | 0.749829 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 8,650 | 0 | 225 |
990feebce835a75f88527c3abcff35815c97975b | 8,674 | py | Python | ecopy/matrix_comp/anosim.py | MatthewRalston/ecopy | b936c91d3de0c610a7439a593a49af5070083992 | [
"MIT"
] | 51 | 2015-08-03T19:52:47.000Z | 2021-06-07T02:07:14.000Z | ecopy/matrix_comp/anosim.py | MatthewRalston/ecopy | b936c91d3de0c610a7439a593a49af5070083992 | [
"MIT"
] | 26 | 2015-08-03T19:29:56.000Z | 2022-02-13T21:41:49.000Z | ecopy/matrix_comp/anosim.py | MatthewRalston/ecopy | b936c91d3de0c610a7439a593a49af5070083992 | [
"MIT"
] | 29 | 2015-02-03T15:59:21.000Z | 2022-02-11T21:17:24.000Z | import numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
class anosim(object):
'''
Docstring for function ecopy.anosim
====================
Conducts analysis of similarity (ANOSIM) on a distance matrix given
one or two factors (groups)
Use
----
anosim(dist, f... | 44.71134 | 143 | 0.577934 | import numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
class anosim(object):
'''
Docstring for function ecopy.anosim
====================
Conducts analysis of similarity (ANOSIM) on a distance matrix given
one or two factors (groups)
Use
----
anosim(dist, f... | 6,851 | 0 | 106 |
e316e03ba5f9f8206bebd166a6ed9a4d32c8d22d | 955 | py | Python | kuber/tests/kube_api/test_execute.py | datalayer-externals/kuber | 4d577950ce7d1be2b882fbe66827dc3d7e67b350 | [
"MIT"
] | 1 | 2019-06-11T04:57:34.000Z | 2019-06-11T04:57:34.000Z | kuber/tests/kube_api/test_execute.py | datalayer-externals/kuber | 4d577950ce7d1be2b882fbe66827dc3d7e67b350 | [
"MIT"
] | 1 | 2019-05-05T22:08:13.000Z | 2019-05-06T11:43:32.000Z | kuber/tests/kube_api/test_execute.py | datalayer-externals/kuber | 4d577950ce7d1be2b882fbe66827dc3d7e67b350 | [
"MIT"
] | 2 | 2021-05-08T14:47:56.000Z | 2021-10-15T21:47:04.000Z | from unittest.mock import MagicMock
from unittest.mock import patch
import pytest
from kuber import kube_api
from kuber.latest import core_v1
def test_execute():
"""Should execute the specified action on the service without error."""
service = core_v1.Service()
service.metadata.name = "foo"
api = M... | 28.939394 | 80 | 0.717277 | from unittest.mock import MagicMock
from unittest.mock import patch
import pytest
from kuber import kube_api
from kuber.latest import core_v1
def test_execute():
"""Should execute the specified action on the service without error."""
service = core_v1.Service()
service.metadata.name = "foo"
api = M... | 0 | 0 | 0 |
4dc7dd8ba9e4e924695a0e6631b365c9dd4b423b | 2,430 | py | Python | CV/localizeCorrectAnswer.py | danielrojasperez/smartlaser | c9b51ec96e699412bb4924c5031efe3cdb5c1b14 | [
"MIT"
] | null | null | null | CV/localizeCorrectAnswer.py | danielrojasperez/smartlaser | c9b51ec96e699412bb4924c5031efe3cdb5c1b14 | [
"MIT"
] | 2 | 2020-05-26T22:53:21.000Z | 2020-06-14T04:24:54.000Z | CV/localizeCorrectAnswer.py | danielrojasperez/smartlaser | c9b51ec96e699412bb4924c5031efe3cdb5c1b14 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 21:03:53 2020
@author: xange
"""
import pytesseract
import os
from matplotlib import pyplot as plt
import numpy as np
import cv2
from PIL import Image
from difflib import SequenceMatcher
import sys
if __name__ == '__main__':
localizeCorrectA... | 24.3 | 103 | 0.569547 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 21:03:53 2020
@author: xange
"""
import pytesseract
import os
from matplotlib import pyplot as plt
import numpy as np
import cv2
from PIL import Image
from difflib import SequenceMatcher
import sys
def similar(a, b):
return SequenceMatcher(None,... | 2,039 | 0 | 46 |
659f0b858d65e086bd782bc85435b9d4d384bb61 | 5,619 | py | Python | adafruit_epd/ssd1608.py | makermelissa/Adafruit_CircuitPython_EPD | d738c779a65ea91a7f3d897214b0dba035a65212 | [
"Unlicense",
"MIT-0",
"MIT"
] | 26 | 2018-09-12T21:08:38.000Z | 2022-03-18T03:21:06.000Z | adafruit_epd/ssd1608.py | makermelissa/Adafruit_CircuitPython_EPD | d738c779a65ea91a7f3d897214b0dba035a65212 | [
"Unlicense",
"MIT-0",
"MIT"
] | 35 | 2018-07-18T17:52:03.000Z | 2021-07-05T21:55:17.000Z | adafruit_epd/ssd1608.py | makermelissa/Adafruit_CircuitPython_EPD | d738c779a65ea91a7f3d897214b0dba035a65212 | [
"Unlicense",
"MIT-0",
"MIT"
] | 17 | 2018-08-04T15:51:21.000Z | 2022-03-18T15:04:51.000Z | # SPDX-FileCopyrightText: 2018 Dean Miller for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_epd.ssd1608` - Adafruit SSD1608 - ePaper display driver
====================================================================================
CircuitPython driver for Adafruit SSD1608 display breakouts
* Au... | 36.019231 | 135 | 0.663107 | # SPDX-FileCopyrightText: 2018 Dean Miller for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_epd.ssd1608` - Adafruit SSD1608 - ePaper display driver
====================================================================================
CircuitPython driver for Adafruit SSD1608 display breakouts
* Au... | 765 | 0 | 26 |
acdfde94a8197159c7eaef4c002ca194ef474b55 | 20 | py | Python | imaginarium/storage/user/__init__.py | LordFeratum/Imaginarium | ce52f5cad7727aab2e81fcf36f662f55dea9330a | [
"MIT"
] | null | null | null | imaginarium/storage/user/__init__.py | LordFeratum/Imaginarium | ce52f5cad7727aab2e81fcf36f662f55dea9330a | [
"MIT"
] | null | null | null | imaginarium/storage/user/__init__.py | LordFeratum/Imaginarium | ce52f5cad7727aab2e81fcf36f662f55dea9330a | [
"MIT"
] | null | null | null | tablename = 'users'
| 10 | 19 | 0.7 | tablename = 'users'
| 0 | 0 | 0 |
5ae6537f3a5cc22ceb07e2ea867b5baa41f82904 | 1,674 | py | Python | src/MULSolver.py | Adhesh148/Tomasulo-Sim | bbc7aa14804d44dda9871433a9b1e654630cb18a | [
"MIT"
] | 2 | 2022-01-05T01:45:24.000Z | 2022-01-08T09:00:37.000Z | src/MULSolver.py | Adhesh148/Tomasulo-Sim | bbc7aa14804d44dda9871433a9b1e654630cb18a | [
"MIT"
] | null | null | null | src/MULSolver.py | Adhesh148/Tomasulo-Sim | bbc7aa14804d44dda9871433a9b1e654630cb18a | [
"MIT"
] | null | null | null | import subprocess
import re
import helper
#obj = MULSolve(-3, 7)
#r = obj.solve()
#print(r) | 18.808989 | 59 | 0.606332 | import subprocess
import re
import helper
class MULSolve:
def __init__(self,opnd1,opnd2,filename="mul_tb.v"):
self.opnd1 = opnd1
self.opnd2 = opnd2
self.filename = filename
def solve(self):
flag = 0
if self.opnd1 < 0 and self.opnd2 < 0:
self.opnd1 = self.opnd1 * -1
self.opnd2 = self.opnd2 * -1
f... | 1,494 | -6 | 94 |
8042b72545729eb6a31f37e993e1896918d532bb | 284 | py | Python | Lecture 03/forloop.py | TyeolRik/UOS_Algorithm_Codebook | b786ee23fc114d219d7dd25fb6438ad9f835ba1e | [
"MIT"
] | null | null | null | Lecture 03/forloop.py | TyeolRik/UOS_Algorithm_Codebook | b786ee23fc114d219d7dd25fb6438ad9f835ba1e | [
"MIT"
] | null | null | null | Lecture 03/forloop.py | TyeolRik/UOS_Algorithm_Codebook | b786ee23fc114d219d7dd25fb6438ad9f835ba1e | [
"MIT"
] | null | null | null | n = 10
a = [[0 for x in range(n)] for x in range(n)]
b = [[0 for x in range(n)] for x in range(n)]
c = [[0 for x in range(n)] for x in range(n)]
for i in range(n):
for j in range(n):
c[i][j] = 0
for k in range(n):
c[i][j] = c[i][j] + a[i][k] * b[k][j] | 28.4 | 49 | 0.46831 | n = 10
a = [[0 for x in range(n)] for x in range(n)]
b = [[0 for x in range(n)] for x in range(n)]
c = [[0 for x in range(n)] for x in range(n)]
for i in range(n):
for j in range(n):
c[i][j] = 0
for k in range(n):
c[i][j] = c[i][j] + a[i][k] * b[k][j] | 0 | 0 | 0 |
6b1985695f3bfe45e77f89ccc5b9d12385c09fa8 | 27,654 | py | Python | manila/tests/network/linux/test_ip_lib.py | redhat-openstack/manila | bef43561b303a36d99849952ba8c408b19bafd02 | [
"Apache-2.0"
] | null | null | null | manila/tests/network/linux/test_ip_lib.py | redhat-openstack/manila | bef43561b303a36d99849952ba8c408b19bafd02 | [
"Apache-2.0"
] | null | null | null | manila/tests/network/linux/test_ip_lib.py | redhat-openstack/manila | bef43561b303a36d99849952ba8c408b19bafd02 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 40.370803 | 79 | 0.587401 | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 20,936 | 193 | 2,402 |
f86cd2122c756ab12fbabe0d4ac3b093a91a406f | 116 | py | Python | chocolate/connection/__init__.py | Intelecy/chocolate | 0ba4f6f0130eab851d32d5534241c8cac3f6666e | [
"BSD-3-Clause"
] | 105 | 2017-10-27T02:14:22.000Z | 2022-01-13T12:57:05.000Z | chocolate/connection/__init__.py | Intelecy/chocolate | 0ba4f6f0130eab851d32d5534241c8cac3f6666e | [
"BSD-3-Clause"
] | 31 | 2017-10-03T13:41:35.000Z | 2021-08-20T21:01:29.000Z | chocolate/connection/__init__.py | Intelecy/chocolate | 0ba4f6f0130eab851d32d5534241c8cac3f6666e | [
"BSD-3-Clause"
] | 38 | 2017-10-05T20:19:42.000Z | 2022-03-28T11:34:04.000Z | from .mongodb import MongoDBConnection
from .pandas import DataFrameConnection
from .sqlite import SQLiteConnection
| 29 | 39 | 0.87069 | from .mongodb import MongoDBConnection
from .pandas import DataFrameConnection
from .sqlite import SQLiteConnection
| 0 | 0 | 0 |